@openfin/cloud-notification-core-api 0.0.1-alpha.9ac8c3d → 0.0.1-alpha.9af0e25

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 +497 -477
  2. package/index.cjs +49 -30
  3. package/index.mjs +49 -30
  4. package/package.json +6 -8
package/bundle.d.ts CHANGED
@@ -134,517 +134,537 @@ export declare class CloudNotificationAPI {
134
134
  */
135
135
  raiseNotification(options: NotificationOptions_2, payload: unknown): Promise<NotificationRaiseResult>;
136
136
  /**
137
- * Raises a notification update to the Cloud Notification service.
137
+ * Raises a notification to the connected user via the Cloud Notification service.
138
138
  *
139
- * @param notificationId - The ID of the notification to update.
140
- * @param options - The options for the notification update.
141
- * @param payload - The new payload of the notification which should generally conform to the notification center update schema
139
+ * Unlike {@link raiseNotification}, no notification raise permissions are required and the notification
140
+ * is always targeted at the connected user only.
141
+ *
142
+ * @param options - The options for the notification.
143
+ * @param payload - The payload of the notification which should generally conform to the notification center schema
144
+ * @returns A promise that resolves with the notification raise result.
142
145
  * @throws {@link SessionNotConnectedError} If the session is not connected.
143
- * @throws {@link PublishError} If an error occurs during publishing of the update.
146
+ * @throws {@link PublishError} If an error occurs during publishing.
144
147
  */
145
- updateNotification(notificationId: string, options: NotificationUpdateOptions, payload: unknown): Promise<void>;
148
+ raiseNotificationToMe(options: NotificationToMeOptions, payload: unknown): Promise<NotificationRaiseResult>;
146
149
  /**
147
- * Marks a notification as deleted in the Cloud Notification service.
148
- *
149
- * This in turn causes notification events to be raised for the notification
150
+ * Raises a notification update to the Cloud Notification service.
150
151
  *
151
- * @param notificationId - The ID of the notification to delete.
152
- * @returns A promise that resolves when the notification is deleted.
152
+ * @param notificationId - The ID of the notification to update.
153
+ * @param options - The options for the notification update.
154
+ * @param payload - The new payload of the notification which should generally conform to the notification center update schema
153
155
  * @throws {@link SessionNotConnectedError} If the session is not connected.
154
- */
155
- deleteNotification(notificationId: string | string[]): Promise<void>;
156
- /**
157
- * Replays notifications from the Cloud Notification service.
158
- *
159
- * This is called at platform startup to populate the notification center with notifications that were missed since the last time the platform was started.
160
- *
161
- * @param pageItemLimit - The maximum number of items per page.
162
- * @param pageStartCursor - The cursor to start the page from. This is retrieved from the pageInfo property.
163
- * @returns A promise that resolves with the notifications replay details.
164
- * @throws {@link SessionNotConnectedError} If the session is not connected.
165
- * @throws {@link NotificationRetrievalError} If an error occurs during retrieval.
156
+ * @throws {@link PublishError} If an error occurs during publishing of the update.
157
+ */
158
+ updateNotification(notificationId: string, options: NotificationUpdateOptions, payload: unknown): Promise<void>;
159
+ /**
160
+ * Marks a notification as deleted in the Cloud Notification service.
161
+ *
162
+ * This in turn causes notification events to be raised for the notification
163
+ *
164
+ * @param notificationId - The ID of the notification to delete.
165
+ * @returns A promise that resolves when the notification is deleted.
166
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
166
167
  */
167
- replayNotifications(pageItemLimit: number | undefined, pageStartCursor: string | undefined): Promise<NotificationsReplayDetails>;
168
+ deleteNotification(notificationId: string | string[]): Promise<void>;
168
169
  /**
169
- * Adds an event listener for a specific event type.
170
+ * Replays notifications from the Cloud Notification service.
170
171
  *
171
- * @param type - The event type.
172
- * @param callback - The callback function to invoke when the event occurs.
173
- */
174
- addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
175
- /**
176
- * Removes an event listener for a specific event type.
177
- *
178
- * @param type - The event type.
179
- * @param callback - The callback function to remove.
180
- */
181
- removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
182
- /**
183
- * Adds a one-time event listener for a specific event type.
172
+ * This is called at platform startup to populate the notification center with notifications that were missed since the last time the platform was started.
184
173
  *
185
- * @param type - The event type.
186
- * @param callback - The callback function to invoke once when the event occurs.
187
- */
188
- once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
189
- }
174
+ * @param pageItemLimit - The maximum number of items per page.
175
+ * @param pageStartCursor - The cursor to start the page from. This is retrieved from the pageInfo property.
176
+ * @returns A promise that resolves with the notifications replay details.
177
+ * @throws {@link SessionNotConnectedError} If the session is not connected.
178
+ * @throws {@link NotificationRetrievalError} If an error occurs during retrieval.
179
+ */
180
+ replayNotifications(pageItemLimit: number | undefined, pageStartCursor: string | undefined): Promise<NotificationsReplayDetails>;
181
+ /**
182
+ * Adds an event listener for a specific event type.
183
+ *
184
+ * @param type - The event type.
185
+ * @param callback - The callback function to invoke when the event occurs.
186
+ */
187
+ addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
188
+ /**
189
+ * Removes an event listener for a specific event type.
190
+ *
191
+ * @param type - The event type.
192
+ * @param callback - The callback function to remove.
193
+ */
194
+ removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
195
+ /**
196
+ * Adds a one-time event listener for a specific event type.
197
+ *
198
+ * @param type - The event type.
199
+ * @param callback - The callback function to invoke once when the event occurs.
200
+ */
201
+ once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
202
+ }
190
203
 
191
- export declare class CloudNotificationAPIError extends Error {
192
- code: string;
193
- constructor(message?: string, code?: string, cause?: unknown);
194
- }
204
+ export declare class CloudNotificationAPIError extends Error {
205
+ code: string;
206
+ constructor(message?: string, code?: string, cause?: unknown);
207
+ }
195
208
 
196
- /**
197
- * Represents a logging function to be used by the cloud notification client
198
- */
199
- export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
209
+ /**
210
+ * Represents a logging function to be used by the cloud notification client
211
+ */
212
+ export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
200
213
 
201
- export declare type CloudNotificationSettings = {
202
- /**
203
- * The URL of the notification server to connect to
204
- *
205
- * @example 'https://the-environment.example.com/notifications'
206
- */
207
- url: string;
208
- /**
209
- * The maximum number of times to retry connecting to the cloud notification service when the connection is dropped
210
- * defaults to 30
211
- */
212
- reconnectRetryLimit?: number;
213
- /**
214
- * Specifies how often keep alive messages should be sent to the cloud notification service in seconds
215
- * defaults to 30
216
- */
217
- keepAliveIntervalSeconds?: number;
218
- /**
219
- * Optional function to call with any logging messages to allow integration with the host application's logging
220
- *
221
- * Defaults to console.log
222
- */
223
- logger?: CloudNotificationLogger;
224
- /**
225
- * The time used to deduplicate notifications
226
- */
227
- deduplicationTTLms?: number;
228
- /**
229
- * Will cause the api to calculate the time offset between the local machine and the notification server
230
- * defaults to true
231
- */
232
- syncTime?: boolean;
233
- };
214
+ export declare type CloudNotificationSettings = {
215
+ /**
216
+ * The URL of the notification server to connect to
217
+ *
218
+ * @example 'https://the-environment.example.com/notifications'
219
+ */
220
+ url: string;
221
+ /**
222
+ * The maximum number of times to retry connecting to the cloud notification service when the connection is dropped
223
+ * defaults to 30
224
+ */
225
+ reconnectRetryLimit?: number;
226
+ /**
227
+ * Specifies how often keep alive messages should be sent to the cloud notification service in seconds
228
+ * defaults to 30
229
+ */
230
+ keepAliveIntervalSeconds?: number;
231
+ /**
232
+ * Optional function to call with any logging messages to allow integration with the host application's logging
233
+ *
234
+ * Defaults to console.log
235
+ */
236
+ logger?: CloudNotificationLogger;
237
+ /**
238
+ * The time used to deduplicate notifications
239
+ */
240
+ deduplicationTTLms?: number;
241
+ /**
242
+ * Will cause the api to calculate the time offset between the local machine and the notification server
243
+ * defaults to true
244
+ */
245
+ syncTime?: boolean;
246
+ };
234
247
 
235
- /**
236
- * Represents the result of a successful connection to the server
237
- */
238
- export declare type ConnectionResult = {
239
- /**
240
- * The unique identifier for the session
241
- */
242
- sessionId: string;
243
- /**
244
- * The platform identifier
245
- */
246
- platformId: string;
247
- /**
248
- * The source identifier
249
- */
250
- sourceId: string;
251
- /**
252
- * The user identifier
253
- */
254
- userId: string;
255
- /**
256
- * A collection of groups that the user is either a direct or indirect member of
257
- */
258
- groups: {
259
- uuid: string;
260
- name: string;
261
- }[];
262
- };
248
+ /**
249
+ * Represents the result of a successful connection to the server
250
+ */
251
+ export declare type ConnectionResult = {
252
+ /**
253
+ * The unique identifier for the session
254
+ */
255
+ sessionId: string;
256
+ /**
257
+ * The platform identifier
258
+ */
259
+ platformId: string;
260
+ /**
261
+ * The source identifier
262
+ */
263
+ sourceId: string;
264
+ /**
265
+ * The user identifier
266
+ */
267
+ userId: string;
268
+ /**
269
+ * A collection of groups that the user is either a direct or indirect member of
270
+ */
271
+ groups: {
272
+ uuid: string;
273
+ name: string;
274
+ }[];
275
+ };
263
276
 
264
- /**
265
- * Represents the parameters to use to connect to an notification server
266
- */
267
- export declare type ConnectParameters = {
268
- /**
269
- * ID for a group of shared applications.
270
- *
271
- * This acts as a namespace for the notification messages that allows separation of messages between different groups of applications for the same user
272
- *
273
- * This, in general, should be the uuid of the platform that you are communicating
274
- */
275
- platformId: string;
276
- /**
277
- * A value that distinguishes the host the application is running in. For example this could be the hostname of the current machine
278
- */
279
- sourceId: string;
280
- /**
281
- * Determines the type of authentication to use with the service gateway
282
- *
283
- * - 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
284
- * - 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
285
- * - 'default' - Authentication will be inherited from the current session
286
- */
287
- authenticationType?: 'jwt' | 'basic' | 'default';
288
- /**
289
- * Optional parameters for basic authentication
290
- */
291
- basicAuthenticationParameters?: {
292
- /**
293
- * The username to use for basic authentication
294
- */
295
- username: string;
296
- /**
297
- * The password to use for basic authentication
298
- */
299
- password: string;
300
- };
301
- /**
302
- * Optional parameters for JWT authentication
303
- */
304
- jwtAuthenticationParameters?: {
305
- /**
306
- * When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
307
- *
308
- * This token should be conform to the configuration set within your environment. Contact Here support for more details
309
- *
310
- * @example
311
- * ```typescript
312
- * const jwtRequestCallback = () => {
313
- * return 'your-jwt-token';
314
- * };
315
- * ```
316
- */
317
- jwtRequestCallback: () => string | object;
318
- /**
319
- * The id of the service gateway JWT authentication definition to use
320
- *
321
- * Note: Contact Here support to to get your organization's authentication id
322
- */
323
- authenticationId: string;
324
- };
325
- };
277
+ /**
278
+ * Represents the parameters to use to connect to an notification server
279
+ */
280
+ export declare type ConnectParameters = {
281
+ /**
282
+ * ID for a group of shared applications.
283
+ *
284
+ * This acts as a namespace for the notification messages that allows separation of messages between different groups of applications for the same user
285
+ *
286
+ * This, in general, should be the uuid of the platform that you are communicating
287
+ */
288
+ platformId: string;
289
+ /**
290
+ * A value that distinguishes the host the application is running in. For example this could be the hostname of the current machine
291
+ */
292
+ sourceId: string;
293
+ /**
294
+ * Determines the type of authentication to use with the service gateway
295
+ *
296
+ * - 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
297
+ * - 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
298
+ * - 'default' - Authentication will be inherited from the current session
299
+ */
300
+ authenticationType?: 'jwt' | 'basic' | 'default';
301
+ /**
302
+ * Optional parameters for basic authentication
303
+ */
304
+ basicAuthenticationParameters?: {
305
+ /**
306
+ * The username to use for basic authentication
307
+ */
308
+ username: string;
309
+ /**
310
+ * The password to use for basic authentication
311
+ */
312
+ password: string;
313
+ };
314
+ /**
315
+ * Optional parameters for JWT authentication
316
+ */
317
+ jwtAuthenticationParameters?: {
318
+ /**
319
+ * When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
320
+ *
321
+ * This token should be conform to the configuration set within your environment. Contact Here support for more details
322
+ *
323
+ * @example
324
+ * ```typescript
325
+ * const jwtRequestCallback = () => {
326
+ * return 'your-jwt-token';
327
+ * };
328
+ * ```
329
+ */
330
+ jwtRequestCallback: () => string | object;
331
+ /**
332
+ * The id of the service gateway JWT authentication definition to use
333
+ *
334
+ * Note: Contact Here support to to get your organization's authentication id
335
+ */
336
+ authenticationId: string;
337
+ };
338
+ };
326
339
 
327
- export declare type DeleteNotificationEvent = BaseNotificationReceivedEvent & {
328
- action: 'delete';
329
- };
340
+ export declare type DeleteNotificationEvent = BaseNotificationReceivedEvent & {
341
+ action: 'delete';
342
+ };
330
343
 
331
- export declare type EventMap = {
332
- /**
333
- * Emitted when the connection has been re-established
334
- * @returns void
335
- */
336
- reconnected: () => void;
337
- /**
338
- * Emitted when the connection has been disconnected
339
- * @returns void
340
- */
341
- reconnecting: (attemptNo: number) => void;
342
- /**
343
- * Emitted when the connection has been disconnected
344
- * @returns void
345
- */
346
- disconnected: () => void;
347
- /**
348
- * Emitted when an error occurs
349
- * @returns void
350
- */
351
- error: (error: Error) => void;
352
- /**
353
- * Emitted when the session has expired
354
- * @returns void
355
- */
356
- 'session-expired': () => void;
357
- /**
358
- * Emitted when the session has been extended
359
- * @returns void
360
- */
361
- 'session-extended': () => void;
362
- /**
363
- * Emitted when a new notification is received
364
- * @returns void
365
- */
366
- 'new-notification': (event: NewNotificationEvent) => void;
367
- /**
368
- * Emitted when an update to a notification is received
369
- * @returns void
370
- */
371
- 'update-notification': (event: UpdateNotificationEvent) => void;
372
- /**
373
- * Emitted when a notification is deleted
374
- * @returns void
375
- */
376
- 'delete-notification': (event: DeleteNotificationEvent) => void;
377
- /**
378
- * Emitted when a notification event is received for this specific session
379
- * @returns void
380
- */
381
- 'notification-event': (event: NotificationEvent) => void;
382
- /**
383
- * Emitted when a notification event is received for all sessions
384
- * @returns void
385
- */
386
- 'global-notification-event': (event: NotificationEvent) => void;
387
- };
344
+ export declare type EventMap = {
345
+ /**
346
+ * Emitted when the connection has been re-established
347
+ * @returns void
348
+ */
349
+ reconnected: () => void;
350
+ /**
351
+ * Emitted when the connection has been disconnected
352
+ * @returns void
353
+ */
354
+ reconnecting: (attemptNo: number) => void;
355
+ /**
356
+ * Emitted when the connection has been disconnected
357
+ * @returns void
358
+ */
359
+ disconnected: () => void;
360
+ /**
361
+ * Emitted when an error occurs
362
+ * @returns void
363
+ */
364
+ error: (error: Error) => void;
365
+ /**
366
+ * Emitted when the session has expired
367
+ * @returns void
368
+ */
369
+ 'session-expired': () => void;
370
+ /**
371
+ * Emitted when the session has been extended
372
+ * @returns void
373
+ */
374
+ 'session-extended': () => void;
375
+ /**
376
+ * Emitted when a new notification is received
377
+ * @returns void
378
+ */
379
+ 'new-notification': (event: NewNotificationEvent) => void;
380
+ /**
381
+ * Emitted when an update to a notification is received
382
+ * @returns void
383
+ */
384
+ 'update-notification': (event: UpdateNotificationEvent) => void;
385
+ /**
386
+ * Emitted when a notification is deleted
387
+ * @returns void
388
+ */
389
+ 'delete-notification': (event: DeleteNotificationEvent) => void;
390
+ /**
391
+ * Emitted when a notification event is received for this specific session
392
+ * @returns void
393
+ */
394
+ 'notification-event': (event: NotificationEvent) => void;
395
+ /**
396
+ * Emitted when a notification event is received for all sessions
397
+ * @returns void
398
+ */
399
+ 'global-notification-event': (event: NotificationEvent) => void;
400
+ };
388
401
 
389
- export declare class EventPublishError extends CloudNotificationAPIError {
390
- constructor(message?: string, code?: string, cause?: unknown);
391
- }
402
+ export declare class EventPublishError extends CloudNotificationAPIError {
403
+ constructor(message?: string, code?: string, cause?: unknown);
404
+ }
392
405
 
393
- export declare class EventRetrievalError extends CloudNotificationAPIError {
394
- constructor(message?: string, code?: string, cause?: unknown);
395
- }
406
+ export declare class EventRetrievalError extends CloudNotificationAPIError {
407
+ constructor(message?: string, code?: string, cause?: unknown);
408
+ }
396
409
 
397
- export declare class InvalidMessageFormatError extends CloudNotificationAPIError {
398
- constructor(zodParseResult: z.SafeParseReturnType<unknown, unknown>);
399
- }
410
+ export declare class InvalidMessageFormatError extends CloudNotificationAPIError {
411
+ constructor(zodParseResult: z.SafeParseReturnType<unknown, unknown>);
412
+ }
400
413
 
401
- export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
414
+ export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
402
415
 
403
- export declare type NewNotificationEvent = BaseNotificationReceivedEvent & {
404
- action: 'new';
405
- };
416
+ export declare type NewNotificationEvent = BaseNotificationReceivedEvent & {
417
+ action: 'new';
418
+ };
406
419
 
407
- /**
408
- * Represents a notification event
409
- */
410
- export declare type NotificationEvent = {
411
- /**
412
- * The unique identifier for the notification
413
- */
414
- notificationId: string;
415
- /**
416
- * The correlation identifier for the notification
417
- */
418
- correlationId?: string;
419
- /**
420
- * The source identifier
421
- */
422
- sourceId: string;
423
- /**
424
- * The originating session identifier
425
- */
426
- originatingSessionId: string;
427
- /**
428
- * The platform identifier
429
- */
430
- platformId: string;
431
- /**
432
- * The unique platform identifier for the user
433
- */
434
- userId: string;
435
- /**
436
- * The resolved username of the user
437
- */
438
- userName?: string;
439
- /**
440
- * The category of the notification.
441
- * For notification center events this will be 'notification-center-event'
442
- */
443
- category: string;
444
- /**
445
- * The type of the notification.
446
- * For example 'notification-close' when a user closes a notification in the notification center
447
- */
448
- type: string;
449
- /**
450
- * The payload of the notification.
451
- * See the documentation for the notification center events for more information on the payload
452
- */
453
- payload?: unknown;
454
- };
420
+ /**
421
+ * Represents a notification event
422
+ */
423
+ export declare type NotificationEvent = {
424
+ /**
425
+ * The unique identifier for the notification
426
+ */
427
+ notificationId: string;
428
+ /**
429
+ * The correlation identifier for the notification
430
+ */
431
+ correlationId?: string;
432
+ /**
433
+ * The source identifier
434
+ */
435
+ sourceId: string;
436
+ /**
437
+ * The originating session identifier
438
+ */
439
+ originatingSessionId: string;
440
+ /**
441
+ * The platform identifier
442
+ */
443
+ platformId: string;
444
+ /**
445
+ * The unique platform identifier for the user
446
+ */
447
+ userId: string;
448
+ /**
449
+ * The resolved username of the user
450
+ */
451
+ userName?: string;
452
+ /**
453
+ * The category of the notification.
454
+ * For notification center events this will be 'notification-center-event'
455
+ */
456
+ category: string;
457
+ /**
458
+ * The type of the notification.
459
+ * For example 'notification-close' when a user closes a notification in the notification center
460
+ */
461
+ type: string;
462
+ /**
463
+ * The payload of the notification.
464
+ * See the documentation for the notification center events for more information on the payload
465
+ */
466
+ payload?: unknown;
467
+ };
455
468
 
456
- /**
457
- * Represents the options for a notification event publish
458
- */
459
- export declare type NotificationEventOptions = {
460
- /**
461
- * The targets to send the event to
462
- *
463
- * This is a set of groups and users that the notification event will direct to. You may use to explicitly remove the notification
464
- * from a subset of the original targets that received it.
465
- *
466
- * For example you send a notification to *all-users* and then want to remove the notification from a specific group. You can do this by
467
- * specifying the group name in the targets.
468
- *
469
- * @example
470
- * ```typescript
471
- * const notificationEventOptions: NotificationEventOptions = {
472
- * targets: {
473
- * groups: ['all-users'],
474
- * users: ['someuser@company.com']
475
- * }
476
- * };
477
- * ```
478
- */
479
- targets: NotificationTargets;
480
- };
469
+ /**
470
+ * Represents the options for a notification event publish
471
+ */
472
+ export declare type NotificationEventOptions = {
473
+ /**
474
+ * The targets to send the event to
475
+ *
476
+ * This is a set of groups and users that the notification event will direct to. You may use to explicitly remove the notification
477
+ * from a subset of the original targets that received it.
478
+ *
479
+ * For example you send a notification to *all-users* and then want to remove the notification from a specific group. You can do this by
480
+ * specifying the group name in the targets.
481
+ *
482
+ * @example
483
+ * ```typescript
484
+ * const notificationEventOptions: NotificationEventOptions = {
485
+ * targets: {
486
+ * groups: ['all-users'],
487
+ * users: ['someuser@company.com']
488
+ * }
489
+ * };
490
+ * ```
491
+ */
492
+ targets: NotificationTargets;
493
+ };
481
494
 
482
- /**
483
- * Represents the options for a notification publish
484
- */
485
- declare type NotificationOptions_2 = {
486
- /**
487
- * A caller specified identifier for the notification
488
- *
489
- * This is used to identify the notification in the system when events and responses are received
490
- */
491
- correlationId?: string;
492
- /**
493
- * The targets to send the notification to
494
- *
495
- * This is a set of groups and users that the notification will be sent to
496
- *
497
- * @example
498
- * ```typescript
499
- * const notificationOptions: NotificationOptions = {
500
- * targets: {
501
- * groups: ['all-users'],
502
- * users: ['someuser@company.com']
503
- * }
504
- * };
505
- * ```
506
- */
507
- targets: NotificationTargets;
508
- /**
509
- * Optional number of seconds to keep the notification alive
510
- *
511
- * After this time the notification will be expired and a delete update will be raised
512
- */
513
- ttlSeconds?: number;
514
- };
515
- export { NotificationOptions_2 as NotificationOptions }
495
+ /**
496
+ * Represents the options for a notification publish
497
+ */
498
+ declare type NotificationOptions_2 = {
499
+ /**
500
+ * A caller specified identifier for the notification
501
+ *
502
+ * This is used to identify the notification in the system when events and responses are received
503
+ */
504
+ correlationId?: string;
505
+ /**
506
+ * The targets to send the notification to
507
+ *
508
+ * This is a set of groups and users that the notification will be sent to
509
+ *
510
+ * @example
511
+ * ```typescript
512
+ * const notificationOptions: NotificationOptions = {
513
+ * targets: {
514
+ * groups: ['all-users'],
515
+ * users: ['someuser@company.com']
516
+ * }
517
+ * };
518
+ * ```
519
+ */
520
+ targets: NotificationTargets;
521
+ /**
522
+ * Optional number of seconds to keep the notification alive
523
+ *
524
+ * After this time the notification will be expired and a delete update will be raised
525
+ */
526
+ ttlSeconds?: number;
527
+ };
528
+ export { NotificationOptions_2 as NotificationOptions }
516
529
 
517
- /**
518
- * Represents the response from raising a notification
519
- */
520
- export declare type NotificationRaiseResult = {
521
- /**
522
- * The unique identifier for the notification
523
- */
524
- notificationId: string;
525
- /**
526
- * The correlation ID that was provided when raising the notification
527
- */
528
- correlationId?: string;
529
- };
530
+ /**
531
+ * Represents the response from raising a notification
532
+ */
533
+ export declare type NotificationRaiseResult = {
534
+ /**
535
+ * The unique identifier for the notification
536
+ */
537
+ notificationId: string;
538
+ /**
539
+ * The correlation ID that was provided when raising the notification
540
+ */
541
+ correlationId?: string;
542
+ };
530
543
 
531
- export declare class NotificationRetrievalError extends CloudNotificationAPIError {
532
- constructor(message?: string, code?: string, cause?: unknown);
533
- }
544
+ export declare class NotificationRetrievalError extends CloudNotificationAPIError {
545
+ constructor(message?: string, code?: string, cause?: unknown);
546
+ }
534
547
 
535
- /**
536
- * Represents a single notification replay detail.
537
- */
538
- export declare type NotificationsReplayDetail = {
539
- /**
540
- * The cursor of the notification.
541
- */
542
- cursor: string;
543
- /**
544
- * The session ID of the notification.
545
- */
546
- sessionId: string;
547
- /**
548
- * The notification ID.
549
- */
550
- notificationId: string;
551
- /**
552
- * The version of the notification.
553
- */
554
- version: number;
555
- /**
556
- * The type of notification record.
557
- */
558
- action: 'new' | 'update' | 'delete';
559
- /**
560
- * The payload of the notification.
561
- */
562
- payload?: unknown;
563
- /**
564
- * The original correlation ID of the notification if specified.
565
- */
566
- correlationId?: string | null;
567
- /**
568
- * The timestamp of the notification.
569
- */
570
- timestamp: Date;
571
- /**
572
- * The payload of the latest reminder event for the notification.
573
- */
574
- latestReminderPayload?: unknown;
575
- };
548
+ /**
549
+ * Represents a single notification replay detail.
550
+ */
551
+ export declare type NotificationsReplayDetail = {
552
+ /**
553
+ * The cursor of the notification.
554
+ */
555
+ cursor: string;
556
+ /**
557
+ * The session ID of the notification.
558
+ */
559
+ sessionId: string;
560
+ /**
561
+ * The notification ID.
562
+ */
563
+ notificationId: string;
564
+ /**
565
+ * The version of the notification.
566
+ */
567
+ version: number;
568
+ /**
569
+ * The type of notification record.
570
+ */
571
+ action: 'new' | 'update' | 'delete';
572
+ /**
573
+ * The payload of the notification.
574
+ */
575
+ payload?: unknown;
576
+ /**
577
+ * The original correlation ID of the notification if specified.
578
+ */
579
+ correlationId?: string | null;
580
+ /**
581
+ * The timestamp of the notification.
582
+ */
583
+ timestamp: Date;
584
+ /**
585
+ * The payload of the latest reminder event for the notification.
586
+ */
587
+ latestReminderPayload?: unknown;
588
+ };
576
589
 
577
- /**
578
- * Represents the results of a notifications replay request.
579
- */
580
- export declare type NotificationsReplayDetails = {
581
- /**
582
- * The list of notifications replay details.
583
- */
584
- data: NotificationsReplayDetail[];
585
- /**
586
- * The pagination information for the notifications replay request.
587
- */
588
- pageInfo: {
589
- /**
590
- * The cursor of the first notification in the page.
591
- */
592
- pageStart?: string;
593
- /**
594
- * The cursor of the next page.
595
- */
596
- nextPage?: string;
597
- /**
598
- * Whether there is a next page of notifications.
599
- */
600
- hasNextPage: boolean;
601
- };
602
- };
590
+ /**
591
+ * Represents the results of a notifications replay request.
592
+ */
593
+ export declare type NotificationsReplayDetails = {
594
+ /**
595
+ * The list of notifications replay details.
596
+ */
597
+ data: NotificationsReplayDetail[];
598
+ /**
599
+ * The pagination information for the notifications replay request.
600
+ */
601
+ pageInfo: {
602
+ /**
603
+ * The cursor of the first notification in the page.
604
+ */
605
+ pageStart?: string;
606
+ /**
607
+ * The cursor of the next page.
608
+ */
609
+ nextPage?: string;
610
+ /**
611
+ * Whether there is a next page of notifications.
612
+ */
613
+ hasNextPage: boolean;
614
+ };
615
+ };
603
616
 
604
- /**
605
- * Represents a set of targets for a notification publish
606
- */
607
- export declare type NotificationTargets = {
608
- /**
609
- * The optional groups to send the notification to
610
- *
611
- * This can be a collection of either group names e.g. all-users which can be retrieved from the admin console or the
612
- * UUID of the group itself
613
- */
614
- groups: string[];
615
- /**
616
- * The optional specific users to send the notification to
617
- *
618
- * This can be the username e.g. someuser\@company.com or the UUID of the user itself
619
- */
620
- users: string[];
621
- };
617
+ /**
618
+ * Represents a set of targets for a notification publish
619
+ */
620
+ export declare type NotificationTargets = {
621
+ /**
622
+ * The optional groups to send the notification to
623
+ *
624
+ * This can be a collection of either group names e.g. all-users which can be retrieved from the admin console or the
625
+ * UUID of the group itself
626
+ */
627
+ groups: string[];
628
+ /**
629
+ * The optional specific users to send the notification to
630
+ *
631
+ * This can be the username e.g. someuser\@company.com or the UUID of the user itself
632
+ */
633
+ users: string[];
634
+ };
622
635
 
623
- /**
624
- * Represents the options for a notification update
625
- */
626
- export declare type NotificationUpdateOptions = {
627
- /**
628
- * Optional number of seconds to keep the notification alive
629
- * After this time the notification will be expired and a delete update will be raised
630
- */
631
- ttlSeconds?: number;
632
- };
636
+ /**
637
+ * Represents the options for a notification publish to the calling user
638
+ *
639
+ * The notification is always targeted at the connected user, so targets cannot be specified
640
+ */
641
+ export declare type NotificationToMeOptions = Omit<NotificationOptions_2, 'targets'>;
642
+
643
+ /**
644
+ * Represents the options for a notification update
645
+ */
646
+ export declare type NotificationUpdateOptions = {
647
+ /**
648
+ * Optional number of seconds to keep the notification alive
649
+ * After this time the notification will be expired and a delete update will be raised
650
+ */
651
+ ttlSeconds?: number;
652
+ };
633
653
 
634
- export declare class PublishError extends CloudNotificationAPIError {
635
- constructor(message?: string, code?: string, cause?: unknown);
636
- }
654
+ export declare class PublishError extends CloudNotificationAPIError {
655
+ constructor(message?: string, code?: string, cause?: unknown);
656
+ }
637
657
 
638
- export declare class SessionNotConnectedError extends CloudNotificationAPIError {
639
- constructor(message?: string, code?: string);
640
- }
658
+ export declare class SessionNotConnectedError extends CloudNotificationAPIError {
659
+ constructor(message?: string, code?: string);
660
+ }
641
661
 
642
- export declare type TARGET_TYPE = z.infer<typeof targetTypeSchema>;
662
+ export declare type TARGET_TYPE = z.infer<typeof targetTypeSchema>;
643
663
 
644
- export declare const targetTypeSchema: z.ZodEnum<["users", "groups"]>;
664
+ export declare const targetTypeSchema: z.ZodEnum<["users", "groups"]>;
645
665
 
646
- export declare type UpdateNotificationEvent = BaseNotificationReceivedEvent & {
647
- action: 'update';
648
- };
666
+ export declare type UpdateNotificationEvent = BaseNotificationReceivedEvent & {
667
+ action: 'update';
668
+ };
649
669
 
650
- export { }
670
+ export { }