Skip to content

Commit 3602321

Browse files
authored
Added Topology and Security Notification categories (neo4j#1146)
I added Topology and Security notification categories to align with the new categories as of the 5.14 server.
1 parent 397c30e commit 3602321

File tree

7 files changed

+22
-6
lines changed

7 files changed

+22
-6
lines changed

packages/core/src/notification-filter.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Object.freeze(notificationFilterMinimumSeverityLevel)
4141

4242
type NotificationFilterDisabledCategory = ExcludeUnknown<NotificationCategory>
4343
/**
44-
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' } NotificationFilterDisabledCategory
44+
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC'} NotificationFilterDisabledCategory
4545
*/
4646
/**
4747
* Constants that represents the disabled categories in the {@link NotificationFilter}
@@ -51,6 +51,8 @@ const notificationFilterDisabledCategory: EnumRecord<NotificationFilterDisabledC
5151
UNRECOGNIZED: 'UNRECOGNIZED',
5252
UNSUPPORTED: 'UNSUPPORTED',
5353
PERFORMANCE: 'PERFORMANCE',
54+
TOPOLOGY: 'TOPOLOGY',
55+
SECURITY: 'SECURITY',
5456
DEPRECATION: 'DEPRECATION',
5557
GENERIC: 'GENERIC'
5658
}

packages/core/src/result-summary.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ Object.freeze(notificationSeverityLevel)
436436
const severityLevels = Object.values(notificationSeverityLevel)
437437

438438
type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' | 'PERFORMANCE' |
439-
'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
439+
'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
440440
/**
441-
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'} NotificationCategory
441+
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN' } NotificationCategory
442442
*/
443443
/**
444444
* Constants that represents the Category in the {@link Notification}
@@ -449,6 +449,8 @@ const notificationCategory: { [key in NotificationCategory]: key } = {
449449
UNSUPPORTED: 'UNSUPPORTED',
450450
PERFORMANCE: 'PERFORMANCE',
451451
DEPRECATION: 'DEPRECATION',
452+
TOPOLOGY: 'TOPOLOGY',
453+
SECURITY: 'SECURITY',
452454
GENERIC: 'GENERIC',
453455
UNKNOWN: 'UNKNOWN'
454456
}

packages/core/test/notification-filter.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ function getValidNotificationsCategories (): NotificationFilterDisabledCategory[
7777
'DEPRECATION',
7878
'GENERIC',
7979
'PERFORMANCE',
80+
'TOPOLOGY',
81+
'SECURITY',
8082
'UNRECOGNIZED',
8183
'UNSUPPORTED'
8284
]

packages/core/test/result-summary.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ function getValidCategories (): NotificationCategory[] {
375375
'UNRECOGNIZED',
376376
'UNSUPPORTED',
377377
'PERFORMANCE',
378+
'TOPOLOGY',
379+
'SECURITY',
378380
'DEPRECATION',
379381
'GENERIC',
380382
'UNKNOWN'

packages/neo4j-driver-deno/lib/core/notification-filter.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Object.freeze(notificationFilterMinimumSeverityLevel)
4141

4242
type NotificationFilterDisabledCategory = ExcludeUnknown<NotificationCategory>
4343
/**
44-
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' } NotificationFilterDisabledCategory
44+
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC'} NotificationFilterDisabledCategory
4545
*/
4646
/**
4747
* Constants that represents the disabled categories in the {@link NotificationFilter}
@@ -51,6 +51,8 @@ const notificationFilterDisabledCategory: EnumRecord<NotificationFilterDisabledC
5151
UNRECOGNIZED: 'UNRECOGNIZED',
5252
UNSUPPORTED: 'UNSUPPORTED',
5353
PERFORMANCE: 'PERFORMANCE',
54+
TOPOLOGY: 'TOPOLOGY',
55+
SECURITY: 'SECURITY',
5456
DEPRECATION: 'DEPRECATION',
5557
GENERIC: 'GENERIC'
5658
}

packages/neo4j-driver-deno/lib/core/result-summary.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ Object.freeze(notificationSeverityLevel)
436436
const severityLevels = Object.values(notificationSeverityLevel)
437437

438438
type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' | 'PERFORMANCE' |
439-
'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
439+
'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
440440
/**
441-
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'} NotificationCategory
441+
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN' } NotificationCategory
442442
*/
443443
/**
444444
* Constants that represents the Category in the {@link Notification}
@@ -449,6 +449,8 @@ const notificationCategory: { [key in NotificationCategory]: key } = {
449449
UNSUPPORTED: 'UNSUPPORTED',
450450
PERFORMANCE: 'PERFORMANCE',
451451
DEPRECATION: 'DEPRECATION',
452+
TOPOLOGY: 'TOPOLOGY',
453+
SECURITY: 'SECURITY',
452454
GENERIC: 'GENERIC',
453455
UNKNOWN: 'UNKNOWN'
454456
}

packages/neo4j-driver/test/types/index.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,17 @@ const informationSeverity: NotificationSeverityLevel = notificationSeverityLevel
145145
const hintCategoryString: string = notificationCategory.HINT
146146
const deprecationCategoryString: string = notificationCategory.DEPRECATION
147147
const performanceCategoryString: string = notificationCategory.PERFORMANCE
148+
const topologyCategoryString: string = notificationCategory.TOPOLOGY
149+
const securityCategoryString: string = notificationCategory.SECURITY
148150
const genericCategoryString: string = notificationCategory.GENERIC
149151
const unrecognizedCategoryString: string = notificationCategory.UNRECOGNIZED
150152
const unsupportedCategoryString: string = notificationCategory.UNSUPPORTED
151153
const unknownCategoryString: string = notificationCategory.UNKNOWN
152154
const hintCategory: NotificationCategory = notificationCategory.HINT
153155
const deprecationCategory: NotificationCategory = notificationCategory.DEPRECATION
154156
const performanceCategory: NotificationCategory = notificationCategory.PERFORMANCE
157+
const topologyCategory: NotificationCategory = notificationCategory.TOPOLOGY
158+
const securityCategory: NotificationCategory = notificationCategory.SECURITY
155159
const genericCategory: NotificationCategory = notificationCategory.GENERIC
156160
const unrecognizedCategory: NotificationCategory = notificationCategory.UNRECOGNIZED
157161
const unsupportedCategory: NotificationCategory = notificationCategory.UNSUPPORTED

0 commit comments

Comments
 (0)