@openfin/cloud-notification-core-api 0.0.1-alpha.ffa9f89 → 10.0.0-beta.1d

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