@openfin/cloud-notification-core-api 0.0.1-alpha.3594f81 → 0.0.1-alpha.80d41e7
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.
- package/bundle.d.ts +243 -364
- package/index.cjs +96 -234
- package/index.mjs +97 -233
- package/package.json +1 -1
package/bundle.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare class AuthorizationError extends CloudNotificationAPIError {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export declare type BaseNotificationReceivedEvent = {
|
|
8
|
-
action: 'new' | 'update'
|
|
8
|
+
action: 'new' | 'update';
|
|
9
9
|
notificationId: string;
|
|
10
10
|
correlationId?: string;
|
|
11
11
|
target: string;
|
|
@@ -20,390 +20,269 @@ export declare type BaseNotificationReceivedEvent = {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare class CloudNotificationAPI {
|
|
22
22
|
#private;
|
|
23
|
-
deDuplicator: SetWithTTL<string>;
|
|
24
23
|
constructor(cloudNotificationSettings: CloudNotificationSettings);
|
|
25
24
|
/**
|
|
26
|
-
* Connects and creates a session on the Cloud Notifications service
|
|
25
|
+
* Connects and creates a session on the Cloud Notifications service
|
|
27
26
|
*
|
|
28
|
-
* @param parameters - The parameters to use to connect
|
|
29
|
-
* @returns
|
|
30
|
-
* @
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Raises a notification update to the Cloud Notification service.
|
|
67
|
-
*
|
|
68
|
-
* @param notificationId - The ID of the notification to update.
|
|
69
|
-
* @param options - The options for the notification update.
|
|
70
|
-
* @param payload - The new payload of the notification.
|
|
71
|
-
* @throws {@link SessionNotConnectedError} If the session is not connected.
|
|
72
|
-
* @throws {@link PublishError} If an error occurs during publishing of the update.
|
|
73
|
-
*/
|
|
74
|
-
updateNotification(notificationId: string, options: NotificationUpdateOptions, payload: unknown): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* Marks a notification as deleted in the Cloud Notification service.
|
|
77
|
-
*
|
|
78
|
-
* @param notificationId - The ID of the notification to delete.
|
|
79
|
-
* @returns A promise that resolves when the notification is deleted.
|
|
80
|
-
* @throws {@link SessionNotConnectedError} If the session is not connected.
|
|
81
|
-
*/
|
|
82
|
-
deleteNotification(notificationId: string): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* Replays notifications from the Cloud Notification service.
|
|
85
|
-
*
|
|
86
|
-
* @param pageItemLimit - The maximum number of items per page.
|
|
87
|
-
* @param pageStartCursor - The cursor to start the page from.
|
|
88
|
-
* @returns A promise that resolves with the notifications replay details.
|
|
89
|
-
* @throws {@link SessionNotConnectedError} If the session is not connected.
|
|
90
|
-
* @throws {@link NotificationRetrievalError} If an error occurs during retrieval.
|
|
91
|
-
*/
|
|
92
|
-
replayNotifications(pageItemLimit: number | undefined, pageStartCursor: string | undefined): Promise<NotificationsReplayDetails>;
|
|
93
|
-
/**
|
|
94
|
-
* Adds an event listener for a specific event type.
|
|
95
|
-
*
|
|
96
|
-
* @param type - The event type.
|
|
97
|
-
* @param callback - The callback function to invoke when the event occurs.
|
|
98
|
-
*/
|
|
99
|
-
addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
100
|
-
/**
|
|
101
|
-
* Removes an event listener for a specific event type.
|
|
102
|
-
*
|
|
103
|
-
* @param type - The event type.
|
|
104
|
-
* @param callback - The callback function to remove.
|
|
105
|
-
*/
|
|
106
|
-
removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
107
|
-
/**
|
|
108
|
-
* Adds a one-time event listener for a specific event type.
|
|
109
|
-
*
|
|
110
|
-
* @param type - The event type.
|
|
111
|
-
* @param callback - The callback function to invoke once when the event occurs.
|
|
112
|
-
*/
|
|
113
|
-
once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export declare class CloudNotificationAPIError extends Error {
|
|
117
|
-
code: string;
|
|
118
|
-
constructor(message?: string, code?: string, cause?: unknown);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Represents a logging function to be used by the cloud notification client
|
|
123
|
-
*/
|
|
124
|
-
export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
|
|
125
|
-
|
|
126
|
-
export declare type CloudNotificationSettings = {
|
|
127
|
-
/**
|
|
128
|
-
* The URL of the notification server to connect to
|
|
129
|
-
*/
|
|
130
|
-
url: string;
|
|
131
|
-
/**
|
|
132
|
-
* The maximum number of times to retry connecting to the cloud notification service when the connection is dropped
|
|
133
|
-
* defaults to 30
|
|
134
|
-
*/
|
|
135
|
-
reconnectRetryLimit?: number;
|
|
136
|
-
/**
|
|
137
|
-
* Specifies how often keep alive messages should be sent to the cloud notification service in seconds
|
|
138
|
-
* defaults to 30
|
|
139
|
-
*/
|
|
140
|
-
keepAliveIntervalSeconds?: number;
|
|
141
|
-
/**
|
|
142
|
-
* Optional function to call with any logging messages to allow integration with the host application's logging
|
|
143
|
-
*
|
|
144
|
-
* defaults to console.log
|
|
145
|
-
*/
|
|
146
|
-
logger?: CloudNotificationLogger;
|
|
147
|
-
/**
|
|
148
|
-
* The time used to deduplicate notifications
|
|
149
|
-
*/
|
|
150
|
-
deduplicationTTLms?: number;
|
|
151
|
-
/**
|
|
152
|
-
* Will cause the api to calculate the time offset between the local machine and the notification server
|
|
153
|
-
* defaults to true
|
|
154
|
-
*/
|
|
155
|
-
syncTime?: boolean;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Repesents the result of a successful connection to the server
|
|
160
|
-
*/
|
|
161
|
-
export declare type ConnectionResult = {
|
|
162
|
-
/**
|
|
163
|
-
* The unique identifier for the session
|
|
164
|
-
*/
|
|
165
|
-
sessionId: string;
|
|
166
|
-
/**
|
|
167
|
-
* The platform identifier
|
|
168
|
-
*/
|
|
169
|
-
platformId: string;
|
|
170
|
-
/**
|
|
171
|
-
* The source identifier
|
|
172
|
-
*/
|
|
173
|
-
sourceId: string;
|
|
174
|
-
/**
|
|
175
|
-
* The user identifier
|
|
176
|
-
*/
|
|
177
|
-
userId: string;
|
|
178
|
-
/**
|
|
179
|
-
* A collection of groups that the user is either a direct or indirect member of
|
|
180
|
-
*/
|
|
181
|
-
groups: {
|
|
182
|
-
uuid: string;
|
|
183
|
-
name: string;
|
|
184
|
-
}[];
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Represents the parameters to use to connect to an notification server
|
|
189
|
-
*/
|
|
190
|
-
export declare type ConnectParameters = {
|
|
191
|
-
/**
|
|
192
|
-
* ID for a group of shared applications.
|
|
193
|
-
* This acts as a namespace for the notification messages that allows separation of messages between different groups of applications for the same user
|
|
194
|
-
*/
|
|
195
|
-
platformId: string;
|
|
196
|
-
/**
|
|
197
|
-
* A value that distinguishes the host the application is running in. For example this could be the hostname of the current machine
|
|
198
|
-
*/
|
|
199
|
-
sourceId: string;
|
|
200
|
-
/**
|
|
201
|
-
* Determines the type of authentication to use with the service gateway
|
|
202
|
-
* defaults to 'none'
|
|
203
|
-
*
|
|
204
|
-
* 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
|
|
205
|
-
* 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
|
|
206
|
-
* 'default' - Authentication will be inherited from the current session
|
|
207
|
-
*/
|
|
208
|
-
authenticationType?: 'jwt' | 'basic' | 'default';
|
|
209
|
-
/**
|
|
210
|
-
* Optional parameters for basic authentication
|
|
211
|
-
*/
|
|
212
|
-
basicAuthenticationParameters?: {
|
|
213
|
-
/**
|
|
214
|
-
* The username to use for basic authentication
|
|
215
|
-
*/
|
|
216
|
-
username: string;
|
|
217
|
-
/**
|
|
218
|
-
* The password to use for basic authentication
|
|
219
|
-
*/
|
|
220
|
-
password: string;
|
|
221
|
-
};
|
|
222
|
-
/**
|
|
223
|
-
* Optional parameters for JWT authentication
|
|
224
|
-
*/
|
|
225
|
-
jwtAuthenticationParameters?: {
|
|
226
|
-
/**
|
|
227
|
-
* When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
|
|
228
|
-
*/
|
|
229
|
-
jwtRequestCallback: () => string | object;
|
|
230
|
-
/**
|
|
231
|
-
* The id of the service gateway JWT authentication definition to use
|
|
232
|
-
*
|
|
233
|
-
* Note: Contact Here support to to get your organization's authentication id
|
|
234
|
-
*/
|
|
235
|
-
authenticationId: string;
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
export declare type DeleteNotificationEvent = BaseNotificationReceivedEvent & {
|
|
240
|
-
action: 'delete';
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export declare type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
|
|
27
|
+
* @param {ConnectParameters} parameters - The parameters to use to connect
|
|
28
|
+
* @returns {*} {Promise<void>}
|
|
29
|
+
* @memberof CloudNotificationAPI
|
|
30
|
+
* @throws {CloudNotificationAPIError} - If an error occurs during connection
|
|
31
|
+
* @throws {AuthorizationError} - If the connection is unauthorized
|
|
32
|
+
*/
|
|
33
|
+
connect(parameters: ConnectParameters): Promise<ConnectionResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Disconnects from the Cloud Notification service
|
|
36
|
+
*
|
|
37
|
+
* @returns {*} {Promise<void>}
|
|
38
|
+
* @memberof CloudNotificationAPI
|
|
39
|
+
* @throws {CloudNotificationAPIError} - If an error occurs during disconnection
|
|
40
|
+
*/
|
|
41
|
+
disconnect(): Promise<void>;
|
|
42
|
+
postNotificationEvent(notificationId: string, event: {
|
|
43
|
+
category: string;
|
|
44
|
+
type: string;
|
|
45
|
+
payload?: unknown;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Raises a notification to the Cloud Notification service
|
|
49
|
+
*
|
|
50
|
+
* @param {NotificationOptions} options - The options for the notification
|
|
51
|
+
* @param {unknown} payload - The payload of the notification
|
|
52
|
+
* @returns {*} {Promise<NotificationRaiseResult>}
|
|
53
|
+
* @memberof CloudNotificationAPI
|
|
54
|
+
* @throws {SessionNotConnectedError} - If the session is not connected
|
|
55
|
+
* @throws {PublishError} - If an error occurs during publishing
|
|
56
|
+
*/
|
|
57
|
+
raiseNotification(options: NotificationOptions_2, payload: unknown): Promise<NotificationRaiseResult>;
|
|
58
|
+
updateNotification(): Promise<void>;
|
|
59
|
+
deleteNotification(): Promise<void>;
|
|
60
|
+
addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
61
|
+
removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
62
|
+
once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
63
|
+
}
|
|
244
64
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
error: (error: Error) => void;
|
|
250
|
-
'session-expired': () => void;
|
|
251
|
-
'session-extended': () => void;
|
|
252
|
-
'new-notification': (event: NewNotificationEvent) => void;
|
|
253
|
-
'update-notification': (event: UpdateNotificationEvent) => void;
|
|
254
|
-
'delete-notification': (event: DeleteNotificationEvent) => void;
|
|
255
|
-
'notification-event': (event: NotificationEvent) => void;
|
|
256
|
-
};
|
|
65
|
+
export declare class CloudNotificationAPIError extends Error {
|
|
66
|
+
code: string;
|
|
67
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
68
|
+
}
|
|
257
69
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Represents a logging function to be used by the cloud notification client
|
|
72
|
+
*/
|
|
73
|
+
export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
|
|
261
74
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
75
|
+
export declare type CloudNotificationSettings = {
|
|
76
|
+
/**
|
|
77
|
+
* The URL of the notification server to connect to
|
|
78
|
+
*/
|
|
79
|
+
url: string;
|
|
80
|
+
};
|
|
265
81
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Repesents the result of a successful connection to the server
|
|
84
|
+
*/
|
|
85
|
+
export declare type ConnectionResult = {
|
|
86
|
+
/**
|
|
87
|
+
* The unique identifier for the session
|
|
88
|
+
*/
|
|
89
|
+
sessionId: string;
|
|
90
|
+
/**
|
|
91
|
+
* The platform identifier
|
|
92
|
+
*/
|
|
93
|
+
platformId: string;
|
|
94
|
+
/**
|
|
95
|
+
* The source identifier
|
|
96
|
+
*/
|
|
97
|
+
sourceId: string;
|
|
98
|
+
/**
|
|
99
|
+
* The user identifier
|
|
100
|
+
*/
|
|
101
|
+
userId: string;
|
|
102
|
+
/**
|
|
103
|
+
* A collection of groups that the user is either a direct or indirect member of
|
|
104
|
+
*/
|
|
105
|
+
groups: {
|
|
106
|
+
uuid: string;
|
|
107
|
+
name: string;
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
269
110
|
|
|
270
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Represents the parameters to use to connect to an notification server
|
|
113
|
+
*/
|
|
114
|
+
export declare type ConnectParameters = {
|
|
115
|
+
/**
|
|
116
|
+
* ID for a group of shared applications.
|
|
117
|
+
* This acts as a namespace for the notification messages that allows separation of messages between different groups of applications for the same user
|
|
118
|
+
*/
|
|
119
|
+
platformId: string;
|
|
120
|
+
/**
|
|
121
|
+
* A value that distinguishes the host the application is running in. For example this could be the hostname of the current machine
|
|
122
|
+
*/
|
|
123
|
+
sourceId: string;
|
|
124
|
+
/**
|
|
125
|
+
* The maximum number of times to retry connecting to the cloud notification service when the connection is dropped
|
|
126
|
+
* defaults to 30
|
|
127
|
+
*/
|
|
128
|
+
reconnectRetryLimit?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Specifies how often keep alive messages should be sent to the cloud notification service in seconds
|
|
131
|
+
* defaults to 30
|
|
132
|
+
*/
|
|
133
|
+
keepAliveIntervalSeconds?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Calculates the time offset between the local machine and the notification server
|
|
136
|
+
* defaults to true
|
|
137
|
+
*/
|
|
138
|
+
syncTime?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Optional function to call with any logging messages to allow integration with the host application's logging
|
|
141
|
+
*
|
|
142
|
+
* defaults to console.log
|
|
143
|
+
*/
|
|
144
|
+
logger?: CloudNotificationLogger;
|
|
145
|
+
/**
|
|
146
|
+
* Determines the type of authentication to use with the service gateway
|
|
147
|
+
* defaults to 'none'
|
|
148
|
+
*
|
|
149
|
+
* 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
|
|
150
|
+
* 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
|
|
151
|
+
* 'default' - Authentication will be inherited from the current session
|
|
152
|
+
*/
|
|
153
|
+
authenticationType?: 'jwt' | 'basic' | 'default';
|
|
154
|
+
/**
|
|
155
|
+
* Optional parameters for basic authentication
|
|
156
|
+
*/
|
|
157
|
+
basicAuthenticationParameters?: {
|
|
158
|
+
/**
|
|
159
|
+
* The username to use for basic authentication
|
|
160
|
+
*/
|
|
161
|
+
username: string;
|
|
162
|
+
/**
|
|
163
|
+
* The password to use for basic authentication
|
|
164
|
+
*/
|
|
165
|
+
password: string;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Optional parameters for JWT authentication
|
|
169
|
+
*/
|
|
170
|
+
jwtAuthenticationParameters?: {
|
|
171
|
+
/**
|
|
172
|
+
* When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
|
|
173
|
+
*/
|
|
174
|
+
jwtRequestCallback: () => string | object;
|
|
175
|
+
/**
|
|
176
|
+
* The id of the service gateway JWT authentication definition to use
|
|
177
|
+
*
|
|
178
|
+
* Note: Contact Here support to to get your organization's authentication id
|
|
179
|
+
*/
|
|
180
|
+
authenticationId: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
271
183
|
|
|
272
|
-
|
|
273
|
-
action: 'new';
|
|
274
|
-
};
|
|
184
|
+
export declare type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
|
|
275
185
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
186
|
+
export declare type EventMap = {
|
|
187
|
+
reconnected: () => void;
|
|
188
|
+
disconnected: () => void;
|
|
189
|
+
reconnecting: (attemptNo: number) => void;
|
|
190
|
+
error: (error: Error) => void;
|
|
191
|
+
'session-expired': () => void;
|
|
192
|
+
'session-extended': () => void;
|
|
193
|
+
'new-notification': (event: NewNotificationEvent) => void;
|
|
194
|
+
'update-notification': (event: UpdateNotificationEvent) => void;
|
|
195
|
+
'notification-event': (event: NotificationEvent) => void;
|
|
196
|
+
};
|
|
283
197
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
declare type NotificationOptions_2 = {
|
|
288
|
-
/**
|
|
289
|
-
* A caller specified identifier for the notification
|
|
290
|
-
* This is used to identify the notification in the system when events and responses are received
|
|
291
|
-
*/
|
|
292
|
-
correlationId?: string;
|
|
293
|
-
/**
|
|
294
|
-
* The targets to send the notification to
|
|
295
|
-
* This is a set of groups and users that the notification will be sent to
|
|
296
|
-
*/
|
|
297
|
-
targets: NotificationTargets;
|
|
298
|
-
/**
|
|
299
|
-
* Optional number of seconds to keep the notification alive
|
|
300
|
-
* After this time the notification will be expired and a delete update will be raised
|
|
301
|
-
*/
|
|
302
|
-
ttlSeconds?: number;
|
|
303
|
-
};
|
|
304
|
-
export { NotificationOptions_2 as NotificationOptions }
|
|
198
|
+
export declare class EventRetrievalError extends CloudNotificationAPIError {
|
|
199
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
200
|
+
}
|
|
305
201
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
export declare type NotificationRaiseResult = {
|
|
310
|
-
/**
|
|
311
|
-
* The unique identifier for the notification
|
|
312
|
-
*/
|
|
313
|
-
notificationId: string;
|
|
314
|
-
/**
|
|
315
|
-
* The correlation ID that was provided when raising the notification
|
|
316
|
-
*/
|
|
317
|
-
correlationId?: string;
|
|
318
|
-
};
|
|
202
|
+
export declare class InvalidMessageFormatError extends CloudNotificationAPIError {
|
|
203
|
+
constructor(zodParseResult: z.SafeParseReturnType<unknown, unknown>);
|
|
204
|
+
}
|
|
319
205
|
|
|
320
|
-
|
|
321
|
-
constructor(message?: string, code?: string, cause?: unknown);
|
|
322
|
-
}
|
|
206
|
+
export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
|
|
323
207
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
notificationId: string;
|
|
328
|
-
version: number;
|
|
329
|
-
action: 'new' | 'update' | 'delete';
|
|
330
|
-
payload?: unknown;
|
|
331
|
-
correlationId?: string | null;
|
|
332
|
-
timestamp: Date;
|
|
333
|
-
};
|
|
208
|
+
export declare type NewNotificationEvent = BaseNotificationReceivedEvent & {
|
|
209
|
+
action: 'new';
|
|
210
|
+
};
|
|
334
211
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
};
|
|
212
|
+
export declare type NotificationEvent = {
|
|
213
|
+
notificationId: string;
|
|
214
|
+
correlationId?: string;
|
|
215
|
+
category: string;
|
|
216
|
+
type: string;
|
|
217
|
+
payload?: unknown;
|
|
218
|
+
};
|
|
343
219
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Represents the options for a notification publish
|
|
222
|
+
*/
|
|
223
|
+
declare type NotificationOptions_2 = {
|
|
224
|
+
/**
|
|
225
|
+
* A caller specified identifier for the notification
|
|
226
|
+
* This is used to identify the notification in the system when events and responses are received
|
|
227
|
+
*/
|
|
228
|
+
correlationId?: string;
|
|
229
|
+
/**
|
|
230
|
+
* The targets to send the notification to
|
|
231
|
+
* This is a set of groups and users that the notification will be sent to
|
|
232
|
+
*/
|
|
233
|
+
targets: NotificationTargets;
|
|
234
|
+
};
|
|
235
|
+
export { NotificationOptions_2 as NotificationOptions }
|
|
357
236
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
237
|
+
/**
|
|
238
|
+
* Represents the response from raising a notification
|
|
239
|
+
*/
|
|
240
|
+
export declare type NotificationRaiseResult = {
|
|
241
|
+
/**
|
|
242
|
+
* The unique identifier for the notification
|
|
243
|
+
*/
|
|
244
|
+
notificationId: string;
|
|
245
|
+
/**
|
|
246
|
+
* The correlation ID that was provided when raising the notification
|
|
247
|
+
*/
|
|
248
|
+
correlationId?: string;
|
|
249
|
+
};
|
|
368
250
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Represents a set of targets for a notification publish
|
|
253
|
+
*/
|
|
254
|
+
export declare type NotificationTargets = {
|
|
255
|
+
/**
|
|
256
|
+
* The groups to send the notification to
|
|
257
|
+
*/
|
|
258
|
+
groups: string[];
|
|
259
|
+
/**
|
|
260
|
+
* The users to send the notification to
|
|
261
|
+
*/
|
|
262
|
+
users: string[];
|
|
263
|
+
};
|
|
372
264
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
};
|
|
265
|
+
export declare class PublishError extends CloudNotificationAPIError {
|
|
266
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
267
|
+
}
|
|
377
268
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
269
|
+
export declare type PublishResult = {
|
|
270
|
+
notificationId: string;
|
|
271
|
+
correlationId: string | undefined;
|
|
272
|
+
};
|
|
381
273
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
*/
|
|
386
|
-
declare class SetWithTTL<T> {
|
|
387
|
-
#private;
|
|
388
|
-
private ttl;
|
|
389
|
-
private store;
|
|
390
|
-
private nextCollection;
|
|
391
|
-
private collectionDelay;
|
|
392
|
-
constructor(ttl: number, collectionCheckInterval?: number);
|
|
393
|
-
get size(): number;
|
|
394
|
-
add(value: T, customTtl?: number): this;
|
|
395
|
-
has(value: T): boolean;
|
|
396
|
-
delete(value: T): this;
|
|
397
|
-
}
|
|
274
|
+
export declare class SessionNotConnectedError extends CloudNotificationAPIError {
|
|
275
|
+
constructor(message?: string, code?: string);
|
|
276
|
+
}
|
|
398
277
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
278
|
+
export declare type UpdateNotificationEvent = BaseNotificationReceivedEvent & {
|
|
279
|
+
action: 'update';
|
|
280
|
+
};
|
|
402
281
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
282
|
+
export declare type UserGroupWithTopic = {
|
|
283
|
+
uuid: string;
|
|
284
|
+
name: string;
|
|
285
|
+
topic?: string;
|
|
286
|
+
};
|
|
408
287
|
|
|
409
|
-
|
|
288
|
+
export { }
|