Skip to content

Commit e6e2055

Browse files
authored
Deprecate Notificatons and Stabilize GqlStatusObjects (#1285)
1 parent 1e64dda commit e6e2055

File tree

12 files changed

+20
-32
lines changed

12 files changed

+20
-32
lines changed

packages/core/src/driver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class SessionConfig {
266266
this.bookmarkManager = undefined
267267

268268
/**
269-
* Configure filter for {@link Notification} objects returned in {@link ResultSummary#notifications}.
269+
* Configure filter for {@link gqlStatusObjects} notification returned in {@link ResultSummary#gqlStatusObjects}.
270270
*
271271
* This configuration enables filter notifications by:
272272
*

packages/core/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ import ResultSummary, {
6464
QueryStatistics,
6565
Stats
6666
} from './result-summary'
67-
import Notification, {
67+
import GqlStatusObject, {
6868
NotificationPosition,
6969
NotificationSeverityLevel,
7070
NotificationClassification,
7171
NotificationCategory,
72-
GqlStatusObject,
72+
Notification,
7373
notificationCategory,
7474
notificationClassification,
7575
notificationSeverityLevel

packages/core/src/notification-filter.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ Object.freeze(notificationFilterDisabledCategory)
6161
type NotificationFilterDisabledClassification = ExcludeUnknown<NotificationClassification>
6262
/**
6363
* @typedef {NotificationFilterDisabledCategory} NotificationFilterDisabledClassification
64-
* @experimental
6564
*/
6665
/**
6766
* Constants that represents the disabled classifications in the {@link NotificationFilter}
6867
*
6968
* @type {notificationFilterDisabledCategory}
70-
* @experimental
7169
*/
7270
const notificationFilterDisabledClassification: EnumRecord<NotificationFilterDisabledClassification> = notificationFilterDisabledCategory
7371

@@ -115,7 +113,6 @@ class NotificationFilter {
115113
* and it must not be enabled at same time.
116114
*
117115
* @type {?NotificationFilterDisabledClassification[]}
118-
* @experimental
119116
*/
120117
this.disabledClassifications = undefined
121118

packages/core/src/notification.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type NotificationSeverityLevel = 'WARNING' | 'INFORMATION' | 'UNKNOWN'
5050
* @typedef {'WARNING' | 'INFORMATION' | 'UNKNOWN'} NotificationSeverityLevel
5151
*/
5252
/**
53-
* Constants that represents the Severity level in the {@link Notification}
53+
* Constants that represents the Severity level in the {@link GqlStatusObject}
5454
*/
5555
const notificationSeverityLevel: { [key in NotificationSeverityLevel]: key } = {
5656
WARNING: 'WARNING',
@@ -67,7 +67,7 @@ type NotificationCategory = 'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' | 'PERFORMAN
6767
* @typedef {'HINT' | 'UNRECOGNIZED' | 'UNSUPPORTED' |'PERFORMANCE' | 'TOPOLOGY' | 'SECURITY' | 'DEPRECATION' | 'GENERIC' | 'SCHEMA' | 'UNKNOWN' } NotificationCategory
6868
*/
6969
/**
70-
* Constants that represents the Category in the {@link Notification}
70+
* Constants that represents the Category in the {@link GqlStatusObject}
7171
*/
7272
const notificationCategory: { [key in NotificationCategory]: key } = {
7373
HINT: 'HINT',
@@ -88,18 +88,17 @@ const categories = Object.values(notificationCategory)
8888
type NotificationClassification = NotificationCategory
8989
/**
9090
* @typedef {NotificationCategory} NotificationClassification
91-
* @experimental
9291
*/
9392
/**
9493
* Constants that represents the Classification in the {@link GqlStatusObject}
9594
* @type {notificationCategory}
96-
* @experimental
9795
*/
9896
const notificationClassification = notificationCategory
9997

10098
/**
10199
* Class for Cypher notifications
102100
* @access public
101+
* @deprecated has been superceded by {@link GqlStatusObject}
103102
*/
104103
class Notification {
105104
code: string
@@ -228,9 +227,7 @@ class Notification {
228227
* Representation for GqlStatusObject found when executing a query.
229228
* <p>
230229
* This object represents a status of query execution.
231-
* This status is a superset of {@link Notification}.
232230
*
233-
* @experimental
234231
* @public
235232
*/
236233
class GqlStatusObject {
@@ -557,7 +554,7 @@ function _asEnumerableClassification (classification: any): NotificationClassifi
557554
: notificationClassification.UNKNOWN
558555
}
559556

560-
export default Notification
557+
export default GqlStatusObject
561558

562559
export {
563560
notificationSeverityLevel,

packages/core/src/result-summary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import Integer from './integer'
1919
import { NumberOrInteger } from './graph-types'
2020
import { util } from './internal'
21-
import Notification, { GqlStatusObject, buildGqlStatusObjectFromMetadata, buildNotificationsFromMetadata } from './notification'
21+
import GqlStatusObject, { Notification, buildGqlStatusObjectFromMetadata, buildNotificationsFromMetadata } from './notification'
2222

2323
/**
2424
* A ResultSummary instance contains structured metadata for a {@link Result}.
@@ -107,6 +107,7 @@ class ResultSummary<T extends NumberOrInteger = Integer> {
107107
* or errors, notifications do not affect the execution of a query.
108108
* @type {Array<Notification>}
109109
* @public
110+
* @deprecated has been superceded by {@link ResultSummary.gqlStatusObjects}
110111
*/
111112
this.notifications = buildNotificationsFromMetadata(metadata)
112113

@@ -129,7 +130,6 @@ class ResultSummary<T extends NumberOrInteger = Integer> {
129130
*
130131
* @type {Array<GqlStatusObject>}
131132
* @public
132-
* @experimental
133133
*/
134134
this.gqlStatusObjects = buildGqlStatusObjectFromMetadata(metadata)
135135

packages/core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export class Config {
298298
this.resolver = undefined
299299

300300
/**
301-
* Configure filter for Notification objects returned in {@link ResultSummary#notifications}.
301+
* Configure filter for GqlStatusObject notifications returned in {@link ResultSummary#gqlStatusObjects}.
302302
*
303303
* See {@link SessionConfig#notificationFilter} for usage instructions.
304304
*

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/neo4j-driver-deno/lib/core/index.ts

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)