Skip to content

Added Topology and Security Notification categories #1146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/notification-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Object.freeze(notificationFilterMinimumSeverityLevel)

type NotificationFilterDisabledCategory = ExcludeUnknown<NotificationCategory>
/**
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' } NotificationFilterDisabledCategory
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC'} NotificationFilterDisabledCategory
*/
/**
* Constants that represents the disabled categories in the {@link NotificationFilter}
Expand All @@ -51,6 +51,8 @@ const notificationFilterDisabledCategory: EnumRecord<NotificationFilterDisabledC
UNRECOGNIZED: 'UNRECOGNIZED',
UNSUPPORTED: 'UNSUPPORTED',
PERFORMANCE: 'PERFORMANCE',
TOPOLOGY: 'TOPOLOGY',
SECURITY: 'SECURITY',
DEPRECATION: 'DEPRECATION',
GENERIC: 'GENERIC'
}
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/result-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ Object.freeze(notificationSeverityLevel)
const severityLevels = Object.values(notificationSeverityLevel)

type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' | 'PERFORMANCE' |
'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
/**
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'} NotificationCategory
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN' } NotificationCategory
*/
/**
* Constants that represents the Category in the {@link Notification}
Expand All @@ -449,6 +449,8 @@ const notificationCategory: { [key in NotificationCategory]: key } = {
UNSUPPORTED: 'UNSUPPORTED',
PERFORMANCE: 'PERFORMANCE',
DEPRECATION: 'DEPRECATION',
TOPOLOGY: 'TOPOLOGY',
SECURITY: 'SECURITY',
GENERIC: 'GENERIC',
UNKNOWN: 'UNKNOWN'
}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/notification-filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function getValidNotificationsCategories (): NotificationFilterDisabledCategory[
'DEPRECATION',
'GENERIC',
'PERFORMANCE',
'TOPOLOGY',
'SECURITY',
'UNRECOGNIZED',
'UNSUPPORTED'
]
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/result-summary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ function getValidCategories (): NotificationCategory[] {
'UNRECOGNIZED',
'UNSUPPORTED',
'PERFORMANCE',
'TOPOLOGY',
'SECURITY',
'DEPRECATION',
'GENERIC',
'UNKNOWN'
Expand Down
4 changes: 3 additions & 1 deletion packages/neo4j-driver-deno/lib/core/notification-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Object.freeze(notificationFilterMinimumSeverityLevel)

type NotificationFilterDisabledCategory = ExcludeUnknown<NotificationCategory>
/**
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' } NotificationFilterDisabledCategory
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC'} NotificationFilterDisabledCategory
*/
/**
* Constants that represents the disabled categories in the {@link NotificationFilter}
Expand All @@ -51,6 +51,8 @@ const notificationFilterDisabledCategory: EnumRecord<NotificationFilterDisabledC
UNRECOGNIZED: 'UNRECOGNIZED',
UNSUPPORTED: 'UNSUPPORTED',
PERFORMANCE: 'PERFORMANCE',
TOPOLOGY: 'TOPOLOGY',
SECURITY: 'SECURITY',
DEPRECATION: 'DEPRECATION',
GENERIC: 'GENERIC'
}
Expand Down
6 changes: 4 additions & 2 deletions packages/neo4j-driver-deno/lib/core/result-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ Object.freeze(notificationSeverityLevel)
const severityLevels = Object.values(notificationSeverityLevel)

type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' | 'PERFORMANCE' |
'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'
/**
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN'} NotificationCategory
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'UNKNOWN' } NotificationCategory
*/
/**
* Constants that represents the Category in the {@link Notification}
Expand All @@ -449,6 +449,8 @@ const notificationCategory: { [key in NotificationCategory]: key } = {
UNSUPPORTED: 'UNSUPPORTED',
PERFORMANCE: 'PERFORMANCE',
DEPRECATION: 'DEPRECATION',
TOPOLOGY: 'TOPOLOGY',
SECURITY: 'SECURITY',
GENERIC: 'GENERIC',
UNKNOWN: 'UNKNOWN'
}
Expand Down
4 changes: 4 additions & 0 deletions packages/neo4j-driver/test/types/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,17 @@ const informationSeverity: NotificationSeverityLevel = notificationSeverityLevel
const hintCategoryString: string = notificationCategory.HINT
const deprecationCategoryString: string = notificationCategory.DEPRECATION
const performanceCategoryString: string = notificationCategory.PERFORMANCE
const topologyCategoryString: string = notificationCategory.TOPOLOGY
const securityCategoryString: string = notificationCategory.SECURITY
const genericCategoryString: string = notificationCategory.GENERIC
const unrecognizedCategoryString: string = notificationCategory.UNRECOGNIZED
const unsupportedCategoryString: string = notificationCategory.UNSUPPORTED
const unknownCategoryString: string = notificationCategory.UNKNOWN
const hintCategory: NotificationCategory = notificationCategory.HINT
const deprecationCategory: NotificationCategory = notificationCategory.DEPRECATION
const performanceCategory: NotificationCategory = notificationCategory.PERFORMANCE
const topologyCategory: NotificationCategory = notificationCategory.TOPOLOGY
const securityCategory: NotificationCategory = notificationCategory.SECURITY
const genericCategory: NotificationCategory = notificationCategory.GENERIC
const unrecognizedCategory: NotificationCategory = notificationCategory.UNRECOGNIZED
const unsupportedCategory: NotificationCategory = notificationCategory.UNSUPPORTED
Expand Down