@openfin/cloud-notification-core-api 0.0.1-alpha.babe94a → 0.0.1-alpha.ccf7226

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/bundle.d.ts +520 -285
  2. package/index.cjs +293 -176
  3. package/index.mjs +292 -176
  4. package/package.json +1 -1
package/bundle.d.ts CHANGED
@@ -4,331 +4,566 @@ export declare class AuthorizationError extends CloudNotificationAPIError {
4
4
  constructor(message?: string, code?: string);
5
5
  }
6
6
 
7
+ /**
8
+ * Represents common properties for all notification events
9
+ */
7
10
  export declare type BaseNotificationReceivedEvent = {
8
- action: 'new' | 'update';
11
+ /**
12
+ * The action that was performed on the notification
13
+ */
14
+ action: 'new' | 'update' | 'delete';
15
+ /**
16
+ * The unique identifier for the notification
17
+ */
9
18
  notificationId: string;
19
+ /**
20
+ * The correlation identifier for the notification
21
+ */
10
22
  correlationId?: string;
23
+ /**
24
+ * The identifier of the target of the notification
25
+ */
11
26
  target: string;
27
+ /**
28
+ * The name of the target i.e, the group or user that the notification was sent to
29
+ */
12
30
  targetName?: string;
31
+ /**
32
+ * The type of the target i.e, 'group' or 'user'
33
+ */
13
34
  targetType: string;
35
+ /**
36
+ * The payload of the notification.
37
+ * See the documentation for the notification center events for more information on the payload
38
+ */
14
39
  payload: unknown;
15
40
  };
16
41
 
17
42
  /**
18
- * Represents a single connection to a Cloud Notification service
43
+ * Represents a single connection to the Cloud Notification service
19
44
  *
20
- * @public
21
- * @class
22
45
  */
23
46
  export declare class CloudNotificationAPI {
24
47
  #private;
25
- constructor(cloudNotificationSettings: CloudNotificationSettings);
26
48
  /**
27
- * Connects and creates a session on the Cloud Notifications service
49
+ * Constructs a new instance of the CloudNotificationAPI
28
50
  *
29
- * @param {ConnectParameters} parameters - The parameters to use to connect
30
- * @returns {*} {Promise<void>}
31
- * @memberof CloudNotificationAPI
32
- * @throws {CloudNotificationAPIError} - If an error occurs during connection
33
- * @throws {AuthorizationError} - If the connection is unauthorized
51
+ * @param cloudNotificationSettings - The settings for the Cloud Notification API.
34
52
  */
35
- connect(parameters: ConnectParameters): Promise<ConnectionResult>;
53
+ constructor(cloudNotificationSettings: CloudNotificationSettings);
36
54
  /**
37
- * Disconnects from the Cloud Notification service
55
+ * Connects and creates a session on the Cloud Notifications service.
38
56
  *
39
- * @returns {*} {Promise<void>}
40
- * @memberof CloudNotificationAPI
41
- * @throws {CloudNotificationAPIError} - If an error occurs during disconnection
42
- */
43
- disconnect(): Promise<void>;
44
- postNotificationEvent(event: {
45
- notificationId: string;
46
- category: string;
47
- type: string;
48
- payload?: unknown;
49
- }): Promise<void>;
50
- getNotificationEvents(notificationIds: string[]): Promise<NotificationEventDetailGroupedByUserId>;
51
- raiseNotification(options: NotificationOptions_2, payload: unknown): Promise<NotificationRaiseResult>;
52
- updateNotification(): Promise<void>;
53
- deleteNotification(): Promise<void>;
54
- addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
55
- removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
56
- once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
57
- }
58
-
59
- export declare class CloudNotificationAPIError extends Error {
60
- code: string;
61
- constructor(message?: string, code?: string, cause?: unknown);
62
- }
57
+ * @example
58
+ * ```typescript
59
+ * const notificationApi = new CloudNotificationAPI({
60
+ * url: process.env.NOTIFICATION_SERVER_HOST
61
+ * });
62
+ *
63
+ * let connectionResult: ConnectionResult;
64
+ * try {
65
+ * connectionResult = await notificationApi.connect(connectSettings);
66
+ * } catch (errorConnect) {
67
+ * terminal.write(chalk.red(`\nError connecting to notification server: ${errorConnect}\n`));
68
+ * process.exit(1);
69
+ * }
70
+ * ```
71
+ *
72
+ * @param parameters - The parameters to use to connect.
73
+ * @returns A promise that resolves when the connection is established.
74
+ * @throws {@link CloudNotificationAPIError} If an error occurs during connection.
75
+ * @throws {@link AuthorizationError} If the connection is unauthorized.
76
+ */
77
+ connect(parameters: ConnectParameters): Promise<ConnectionResult>;
78
+ /**
79
+ * Disconnects from the Cloud Notification service.
80
+ *
81
+ * @returns A promise that resolves when disconnected.
82
+ * @throws {@link CloudNotificationAPIError} If an error occurs during disconnection.
83
+ */
84
+ disconnect(): Promise<void>;
85
+ /**
86
+ * Posts a notification event to the Cloud Notification service.
87
+ *
88
+ * @param notificationId - The ID of the notification.
89
+ * @param event - The event details, including category, type, and optional payload.
90
+ * @returns A promise that resolves when the event is posted.
91
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
92
+ * @throws {@link PublishError} If an error occurs during publishing.
93
+ */
94
+ postNotificationEvent(notificationId: string, event: {
95
+ category: string;
96
+ type: string;
97
+ payload?: unknown;
98
+ }): Promise<void>;
99
+ /**
100
+ * Raises a notification to the Cloud Notification service.
101
+ *
102
+ * @param options - The options for the notification.
103
+ * @param payload - The payload of the notification which should generally conform to the notification center schema
104
+ * @returns A promise that resolves with the notification raise result.
105
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
106
+ * @throws {@link PublishError} If an error occurs during publishing.
107
+ */
108
+ raiseNotification(options: NotificationOptions_2, payload: unknown): Promise<NotificationRaiseResult>;
109
+ /**
110
+ * Raises a notification update to the Cloud Notification service.
111
+ *
112
+ * @param notificationId - The ID of the notification to update.
113
+ * @param options - The options for the notification update.
114
+ * @param payload - The new payload of the notification which should generally conform to the notification center update schema
115
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
116
+ * @throws {@link PublishError} If an error occurs during publishing of the update.
117
+ */
118
+ updateNotification(notificationId: string, options: NotificationUpdateOptions, payload: unknown): Promise<void>;
119
+ /**
120
+ * Marks a notification as deleted in the Cloud Notification service.
121
+ *
122
+ * This in turn causes notification events to be raised for the notification
123
+ *
124
+ * @param notificationId - The ID of the notification to delete.
125
+ * @returns A promise that resolves when the notification is deleted.
126
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
127
+ */
128
+ deleteNotification(notificationId: string): Promise<void>;
129
+ /**
130
+ * Replays notifications from the Cloud Notification service.
131
+ *
132
+ * This is called at platform startup to populate the notification center with notifications that were missed since the last time the platform was started.
133
+ *
134
+ * @param pageItemLimit - The maximum number of items per page.
135
+ * @param pageStartCursor - The cursor to start the page from. This is retrieved from the pageInfo property.
136
+ * @returns A promise that resolves with the notifications replay details.
137
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
138
+ * @throws {@link NotificationRetrievalError} If an error occurs during retrieval.
139
+ */
140
+ replayNotifications(pageItemLimit: number | undefined, pageStartCursor: string | undefined): Promise<NotificationsReplayDetails>;
141
+ /**
142
+ * Adds an event listener for a specific event type.
143
+ *
144
+ * @param type - The event type.
145
+ * @param callback - The callback function to invoke when the event occurs.
146
+ */
147
+ addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
148
+ /**
149
+ * Removes an event listener for a specific event type.
150
+ *
151
+ * @param type - The event type.
152
+ * @param callback - The callback function to remove.
153
+ */
154
+ removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
155
+ /**
156
+ * Adds a one-time event listener for a specific event type.
157
+ *
158
+ * @param type - The event type.
159
+ * @param callback - The callback function to invoke once when the event occurs.
160
+ */
161
+ once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
162
+ }
63
163
 
64
- /**
65
- * Represents a logging function to be used by the cloud notification client
66
- */
67
- export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
164
+ export declare class CloudNotificationAPIError extends Error {
165
+ code: string;
166
+ constructor(message?: string, code?: string, cause?: unknown);
167
+ }
68
168
 
69
- export declare type CloudNotificationSettings = {
70
- /**
71
- * The URL of the notification server to connect to
72
- */
73
- url: string;
74
- /**
75
- * The default TTL for notifications published.
76
- * Can be overridden on each publish if required
77
- * */
78
- defaultTTL?: number;
79
- };
169
+ /**
170
+ * Represents a logging function to be used by the cloud notification client
171
+ */
172
+ export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
80
173
 
81
- export declare type ConnectionResult = {
82
- sessionId: string;
83
- platformId: string;
84
- sourceId: string;
85
- userId: string;
86
- groups: {
87
- uuid: string;
88
- name: string;
89
- }[];
90
- };
174
+ export declare type CloudNotificationSettings = {
175
+ /**
176
+ * The URL of the notification server to connect to
177
+ *
178
+ * @example 'https://the-environment.example.com/notifications'
179
+ */
180
+ url: string;
181
+ /**
182
+ * The maximum number of times to retry connecting to the cloud notification service when the connection is dropped
183
+ * defaults to 30
184
+ */
185
+ reconnectRetryLimit?: number;
186
+ /**
187
+ * Specifies how often keep alive messages should be sent to the cloud notification service in seconds
188
+ * defaults to 30
189
+ */
190
+ keepAliveIntervalSeconds?: number;
191
+ /**
192
+ * Optional function to call with any logging messages to allow integration with the host application's logging
193
+ *
194
+ * Defaults to console.log
195
+ */
196
+ logger?: CloudNotificationLogger;
197
+ /**
198
+ * The time used to deduplicate notifications
199
+ */
200
+ deduplicationTTLms?: number;
201
+ /**
202
+ * Will cause the api to calculate the time offset between the local machine and the notification server
203
+ * defaults to true
204
+ */
205
+ syncTime?: boolean;
206
+ };
91
207
 
92
- /**
93
- * Represents the parameters to use to connect to an notification server
94
- */
95
- export declare type ConnectParameters = {
96
- /**
97
- * ID for a group of shared applications.
98
- * This acts as a namespace for the notification messages that allows separation of messages between different groups of applications for the same user
99
- */
100
- platformId: string;
101
- /**
102
- * A value that distinguishes the host the application is running in. For example this could be the hostname of the current machine
103
- */
104
- sourceId: string;
105
- /**
106
- * The maximum number of times to retry connecting to the cloud notification service when the connection is dropped
107
- * defaults to 30
108
- */
109
- reconnectRetryLimit?: number;
110
- /**
111
- * Specifies how often keep alive messages should be sent to the cloud notification service in seconds
112
- * defaults to 30
113
- */
114
- keepAliveIntervalSeconds?: number;
115
- /**
116
- * Calculates the time offset between the local machine and the notification server
117
- * defaults to true
118
- */
119
- syncTime?: boolean;
120
- /**
121
- * Optional function to call with any logging messages to allow integration with the host application's logging
122
- *
123
- * defaults to console.log
124
- */
125
- logger?: CloudNotificationLogger;
126
- /**
127
- * Determines the type of authentication to use with the service gateway
128
- * defaults to 'none'
129
- *
130
- * 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
131
- * 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
132
- * 'default' - Authentication will be inherited from the current session
133
- */
134
- authenticationType?: 'jwt' | 'basic' | 'default';
135
- /**
136
- * Optional parameters for basic authentication
137
- */
138
- basicAuthenticationParameters?: {
139
- /**
140
- * The username to use for basic authentication
141
- */
142
- username: string;
143
- /**
144
- * The password to use for basic authentication
145
- */
146
- password: string;
147
- };
148
- /**
149
- * Optional parameters for JWT authentication
150
- */
151
- jwtAuthenticationParameters?: {
152
- /**
153
- * When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
154
- */
155
- jwtRequestCallback: () => string | object;
156
- /**
157
- * The id of the service gateway JWT authentication definition to use
158
- *
159
- * Note: Contact Here support to to get your organization's authentication id
160
- */
161
- authenticationId: string;
162
- };
163
- };
208
+ /**
209
+ * Represents the result of a successful connection to the server
210
+ */
211
+ export declare type ConnectionResult = {
212
+ /**
213
+ * The unique identifier for the session
214
+ */
215
+ sessionId: string;
216
+ /**
217
+ * The platform identifier
218
+ */
219
+ platformId: string;
220
+ /**
221
+ * The source identifier
222
+ */
223
+ sourceId: string;
224
+ /**
225
+ * The user identifier
226
+ */
227
+ userId: string;
228
+ /**
229
+ * A collection of groups that the user is either a direct or indirect member of
230
+ */
231
+ groups: {
232
+ uuid: string;
233
+ name: string;
234
+ }[];
235
+ };
164
236
 
165
- export declare type CreateSessionResponse = {
166
- sessionId: string;
167
- sessionRootTopic: string;
168
- userNotificationEventsTopic: string;
169
- allNotificationEventsTopic: string;
170
- channelsRootTopic: string;
171
- publishTopic: string;
172
- lastWillTopic: string;
173
- url: string;
174
- token: string;
175
- orgId: string;
176
- userId: string;
177
- platformId: string;
178
- groups: UserGroupWithTopic[];
179
- userNotificationTopic: string;
180
- };
237
+ /**
238
+ * Represents the parameters to use to connect to an notification server
239
+ */
240
+ export declare type ConnectParameters = {
241
+ /**
242
+ * ID for a group of shared applications.
243
+ *
244
+ * This acts as a namespace for the notification messages that allows separation of messages between different groups of applications for the same user
245
+ *
246
+ * This, in general, should be the uuid of the platform that you are communicating
247
+ */
248
+ platformId: string;
249
+ /**
250
+ * A value that distinguishes the host the application is running in. For example this could be the hostname of the current machine
251
+ */
252
+ sourceId: string;
253
+ /**
254
+ * Determines the type of authentication to use with the service gateway
255
+ *
256
+ * - 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
257
+ * - 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
258
+ * - 'default' - Authentication will be inherited from the current session
259
+ */
260
+ authenticationType?: 'jwt' | 'basic' | 'default';
261
+ /**
262
+ * Optional parameters for basic authentication
263
+ */
264
+ basicAuthenticationParameters?: {
265
+ /**
266
+ * The username to use for basic authentication
267
+ */
268
+ username: string;
269
+ /**
270
+ * The password to use for basic authentication
271
+ */
272
+ password: string;
273
+ };
274
+ /**
275
+ * Optional parameters for JWT authentication
276
+ */
277
+ jwtAuthenticationParameters?: {
278
+ /**
279
+ * When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
280
+ *
281
+ * This token should be conform to the configuration set within your environment. Contact Here support for more details
282
+ *
283
+ * @example
284
+ * ```typescript
285
+ * const jwtRequestCallback = () => {
286
+ * return 'your-jwt-token';
287
+ * };
288
+ * ```
289
+ */
290
+ jwtRequestCallback: () => string | object;
291
+ /**
292
+ * The id of the service gateway JWT authentication definition to use
293
+ *
294
+ * Note: Contact Here support to to get your organization's authentication id
295
+ */
296
+ authenticationId: string;
297
+ };
298
+ };
181
299
 
182
- export declare type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
300
+ export declare type DeleteNotificationEvent = BaseNotificationReceivedEvent & {
301
+ action: 'delete';
302
+ };
183
303
 
184
- export declare type EventMap = {
185
- reconnected: () => void;
186
- disconnected: () => void;
187
- reconnecting: (attemptNo: number) => void;
188
- error: (error: Error) => void;
189
- 'session-expired': () => void;
190
- 'session-extended': () => void;
191
- 'new-notification': (event: NewNotificationEvent) => void;
192
- 'update-notification': (event: UpdateNotificationEvent) => void;
193
- 'notification-event': (event: NotificationEvent) => void;
194
- 'notification-event-all': (event: NotificationEvent) => void;
195
- };
304
+ export declare type EventMap = {
305
+ /**
306
+ * Emitted when the connection has been re-established
307
+ * @returns void
308
+ */
309
+ reconnected: () => void;
310
+ /**
311
+ * Emitted when the connection has been disconnected
312
+ * @returns void
313
+ */
314
+ reconnecting: (attemptNo: number) => void;
315
+ /**
316
+ * Emitted when the connection has been disconnected
317
+ * @returns void
318
+ */
319
+ disconnected: () => void;
320
+ /**
321
+ * Emitted when an error occurs
322
+ * @returns void
323
+ */
324
+ error: (error: Error) => void;
325
+ /**
326
+ * Emitted when the session has expired
327
+ * @returns void
328
+ */
329
+ 'session-expired': () => void;
330
+ /**
331
+ * Emitted when the session has been extended
332
+ * @returns void
333
+ */
334
+ 'session-extended': () => void;
335
+ /**
336
+ * Emitted when a new notification is received
337
+ * @returns void
338
+ */
339
+ 'new-notification': (event: NewNotificationEvent) => void;
340
+ /**
341
+ * Emitted when an update to a notification is received
342
+ * @returns void
343
+ */
344
+ 'update-notification': (event: UpdateNotificationEvent) => void;
345
+ /**
346
+ * Emitted when a notification is deleted
347
+ * @returns void
348
+ */
349
+ 'delete-notification': (event: DeleteNotificationEvent) => void;
350
+ /**
351
+ * Emitted when a notification event is received for this specific session
352
+ * @returns void
353
+ */
354
+ 'notification-event': (event: NotificationEvent) => void;
355
+ /**
356
+ * Emitted when a notification event is received for all sessions
357
+ * @returns void
358
+ */
359
+ 'global-notification-event': (event: NotificationEvent) => void;
360
+ };
196
361
 
197
- export declare class EventRetrievalError extends CloudNotificationAPIError {
198
- constructor(message?: string, code?: string, cause?: unknown);
199
- }
362
+ export declare class EventPublishError extends CloudNotificationAPIError {
363
+ constructor(message?: string, code?: string, cause?: unknown);
364
+ }
200
365
 
201
- export declare class InvalidMessageFormatError extends CloudNotificationAPIError {
202
- constructor(zodParseResult: z.SafeParseReturnType<unknown, unknown>);
203
- }
366
+ export declare class EventRetrievalError extends CloudNotificationAPIError {
367
+ constructor(message?: string, code?: string, cause?: unknown);
368
+ }
204
369
 
205
- export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
370
+ export declare class InvalidMessageFormatError extends CloudNotificationAPIError {
371
+ constructor(zodParseResult: z.SafeParseReturnType<unknown, unknown>);
372
+ }
206
373
 
207
- export declare type NewNotificationEvent = BaseNotificationReceivedEvent & {
208
- action: 'new';
209
- };
374
+ export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
210
375
 
211
- export declare type NotificationEvent = {
212
- notificationId: string;
213
- correlationId?: string;
214
- category: string;
215
- type: string;
216
- payload?: unknown;
217
- };
376
+ export declare type NewNotificationEvent = BaseNotificationReceivedEvent & {
377
+ action: 'new';
378
+ };
218
379
 
219
- export declare type NotificationEventDetail = z.infer<typeof notificationEventDetailSchema>;
380
+ /**
381
+ * Represents a notification event
382
+ */
383
+ export declare type NotificationEvent = {
384
+ /**
385
+ * The unique identifier for the notification
386
+ */
387
+ notificationId: string;
388
+ /**
389
+ * The correlation identifier for the notification
390
+ */
391
+ correlationId?: string;
392
+ /**
393
+ * The category of the notification.
394
+ * For notification center events this will be 'notification-center-event'
395
+ */
396
+ category: string;
397
+ /**
398
+ * The type of the notification.
399
+ * For example 'notification-close' when a user closes a notification in the notification center
400
+ */
401
+ type: string;
402
+ /**
403
+ * The payload of the notification.
404
+ * See the documentation for the notification center events for more information on the payload
405
+ */
406
+ payload?: unknown;
407
+ };
220
408
 
221
- export declare type NotificationEventDetailGroupedByUserId = {
222
- [userId: string]: NotificationEventDetail[];
223
- };
409
+ /**
410
+ * Represents the options for a notification publish
411
+ */
412
+ declare type NotificationOptions_2 = {
413
+ /**
414
+ * A caller specified identifier for the notification
415
+ *
416
+ * This is used to identify the notification in the system when events and responses are received
417
+ */
418
+ correlationId?: string;
419
+ /**
420
+ * The targets to send the notification to
421
+ *
422
+ * This is a set of groups and users that the notification will be sent to
423
+ *
424
+ * @example
425
+ * ```typescript
426
+ * const notificationOptions: NotificationOptions = {
427
+ * targets: {
428
+ * groups: ['all-users'],
429
+ * users: ['someuser@company.com']
430
+ * }
431
+ * };
432
+ * ```
433
+ */
434
+ targets: NotificationTargets;
435
+ /**
436
+ * Optional number of seconds to keep the notification alive
437
+ *
438
+ * After this time the notification will be expired and a delete update will be raised
439
+ */
440
+ ttlSeconds?: number;
441
+ };
442
+ export { NotificationOptions_2 as NotificationOptions }
224
443
 
225
- export declare const notificationEventDetailSchema: z.ZodObject<{
226
- userId: z.ZodString;
227
- platformId: z.ZodString;
228
- sourceId: z.ZodString;
229
- notificationId: z.ZodString;
230
- category: z.ZodString;
231
- type: z.ZodString;
232
- sessionId: z.ZodString;
233
- payload: z.ZodOptional<z.ZodUnknown>;
234
- correlationId: z.ZodOptional<z.ZodString>;
235
- timestamp: z.ZodString;
236
- }, "strip", z.ZodTypeAny, {
237
- notificationId: string;
238
- category: string;
239
- type: string;
240
- userId: string;
241
- platformId: string;
242
- sourceId: string;
243
- sessionId: string;
244
- timestamp: string;
245
- payload?: unknown;
246
- correlationId?: string | undefined;
247
- }, {
248
- notificationId: string;
249
- category: string;
250
- type: string;
251
- userId: string;
252
- platformId: string;
253
- sourceId: string;
254
- sessionId: string;
255
- timestamp: string;
256
- payload?: unknown;
257
- correlationId?: string | undefined;
258
- }>;
444
+ /**
445
+ * Represents the response from raising a notification
446
+ */
447
+ export declare type NotificationRaiseResult = {
448
+ /**
449
+ * The unique identifier for the notification
450
+ */
451
+ notificationId: string;
452
+ /**
453
+ * The correlation ID that was provided when raising the notification
454
+ */
455
+ correlationId?: string;
456
+ };
259
457
 
260
- /**
261
- * Represents the options for a notification publish
262
- */
263
- declare type NotificationOptions_2 = {
264
- /**
265
- * Time to live for the notification in seconds
266
- * This is the time that the notification will be kept in the system before it is deleted
267
- * If not specified, the default time to live for the notification will be used
268
- */
269
- ttl?: number;
270
- /**
271
- * A caller specified identifier for the notification
272
- * This is used to identify the notification in the system when events and responses are received
273
- */
274
- correlationId?: string;
275
- /**
276
- * The targets to send the notification to
277
- * This is a set of groups and users that the notification will be sent to
278
- */
279
- targets: NotificationTargets;
280
- };
281
- export { NotificationOptions_2 as NotificationOptions }
458
+ export declare class NotificationRetrievalError extends CloudNotificationAPIError {
459
+ constructor(message?: string, code?: string, cause?: unknown);
460
+ }
282
461
 
283
- /**
284
- * Represents the response from raising a notification
285
- */
286
- export declare type NotificationRaiseResult = {
287
- /**
288
- * The unique identifier for the notification
289
- */
290
- notificationId: string;
291
- /**
292
- * The correction ID that was provided when raising the notification
293
- */
294
- correlationId?: string;
295
- };
462
+ /**
463
+ * Represents a single notification replay detail.
464
+ */
465
+ export declare type NotificationsReplayDetail = {
466
+ /**
467
+ * The cursor of the notification.
468
+ */
469
+ cursor: string;
470
+ /**
471
+ * The session ID of the notification.
472
+ */
473
+ sessionId: string;
474
+ /**
475
+ * The notification ID.
476
+ */
477
+ notificationId: string;
478
+ /**
479
+ * The version of the notification.
480
+ */
481
+ version: number;
482
+ /**
483
+ * The type of notification record.
484
+ */
485
+ action: 'new' | 'update' | 'delete';
486
+ /**
487
+ * The payload of the notification.
488
+ */
489
+ payload?: unknown;
490
+ /**
491
+ * The original correlation ID of the notification if specified.
492
+ */
493
+ correlationId?: string | null;
494
+ /**
495
+ * The timestamp of the notification.
496
+ */
497
+ timestamp: Date;
498
+ };
296
499
 
297
- /**
298
- * Represents a set of targets for a notification publish
299
- */
300
- export declare type NotificationTargets = {
301
- /**
302
- * The groups to send the notification to
303
- */
304
- groups: string[];
305
- /**
306
- * The users to send the notification to
307
- */
308
- users: string[];
309
- };
500
+ /**
501
+ * Represents the results of a notifications replay request.
502
+ */
503
+ export declare type NotificationsReplayDetails = {
504
+ /**
505
+ * The list of notifications replay details.
506
+ */
507
+ data: NotificationsReplayDetail[];
508
+ /**
509
+ * The pagination information for the notifications replay request.
510
+ */
511
+ pageInfo: {
512
+ /**
513
+ * The cursor of the first notification in the page.
514
+ */
515
+ pageStart?: string;
516
+ /**
517
+ * The cursor of the next page.
518
+ */
519
+ nextPage?: string;
520
+ /**
521
+ * Whether there is a next page of notifications.
522
+ */
523
+ hasNextPage: boolean;
524
+ };
525
+ };
310
526
 
311
- export declare class PublishError extends CloudNotificationAPIError {
312
- constructor(message?: string, code?: string, cause?: unknown);
313
- }
527
+ /**
528
+ * Represents a set of targets for a notification publish
529
+ */
530
+ export declare type NotificationTargets = {
531
+ /**
532
+ * The optional groups to send the notification to
533
+ *
534
+ * This can be a collection of either group names e.g. all-users which can be retrieved from the admin console or the
535
+ * UUID of the group itself
536
+ */
537
+ groups: string[];
538
+ /**
539
+ * The optional specific users to send the notification to
540
+ *
541
+ * This can be the username e.g. someuser\@company.com or the UUID of the user itself
542
+ */
543
+ users: string[];
544
+ };
314
545
 
315
- export declare type PublishResult = {
316
- notificationId: string;
317
- correlationId: string | undefined;
318
- };
546
+ /**
547
+ * Represents the options for a notification update
548
+ */
549
+ export declare type NotificationUpdateOptions = {
550
+ /**
551
+ * Optional number of seconds to keep the notification alive
552
+ * After this time the notification will be expired and a delete update will be raised
553
+ */
554
+ ttlSeconds?: number;
555
+ };
319
556
 
320
- export declare class SessionNotConnectedError extends CloudNotificationAPIError {
321
- constructor(message?: string, code?: string);
322
- }
557
+ export declare class PublishError extends CloudNotificationAPIError {
558
+ constructor(message?: string, code?: string, cause?: unknown);
559
+ }
323
560
 
324
- export declare type UpdateNotificationEvent = BaseNotificationReceivedEvent & {
325
- action: 'update';
326
- };
561
+ export declare class SessionNotConnectedError extends CloudNotificationAPIError {
562
+ constructor(message?: string, code?: string);
563
+ }
327
564
 
328
- export declare type UserGroupWithTopic = {
329
- uuid: string;
330
- name: string;
331
- topic?: string;
332
- };
565
+ export declare type UpdateNotificationEvent = BaseNotificationReceivedEvent & {
566
+ action: 'update';
567
+ };
333
568
 
334
- export { }
569
+ export { }