@openfin/cloud-notification-core-api 0.0.1-alpha.d138264 → 0.0.1-alpha.f7345bf
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 +361 -286
- package/index.cjs +262 -184
- package/index.mjs +261 -184
- 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' | 'delete';
|
|
9
9
|
notificationId: string;
|
|
10
10
|
correlationId?: string;
|
|
11
11
|
target: string;
|
|
@@ -15,320 +15,395 @@ export declare type BaseNotificationReceivedEvent = {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Represents a single connection to
|
|
18
|
+
* Represents a single connection to the Cloud Notification service
|
|
19
19
|
*
|
|
20
|
-
* @public
|
|
21
|
-
* @class
|
|
22
20
|
*/
|
|
23
21
|
export declare class CloudNotificationAPI {
|
|
24
22
|
#private;
|
|
23
|
+
deDuplicator: SetWithTTL<string>;
|
|
25
24
|
constructor(cloudNotificationSettings: CloudNotificationSettings);
|
|
26
25
|
/**
|
|
27
|
-
* Connects and creates a session on the Cloud Notifications service
|
|
26
|
+
* Connects and creates a session on the Cloud Notifications service.
|
|
28
27
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @returns
|
|
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
|
-
|
|
28
|
+
* @param parameters - The parameters to use to connect.
|
|
29
|
+
* @returns A promise that resolves when the connection is established.
|
|
30
|
+
* @throws {@link CloudNotificationAPIError} If an error occurs during connection.
|
|
31
|
+
* @throws {@link AuthorizationError} If the connection is unauthorized.
|
|
32
|
+
*/
|
|
33
|
+
connect(parameters: ConnectParameters): Promise<ConnectionResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Disconnects from the Cloud Notification service.
|
|
36
|
+
*
|
|
37
|
+
* @returns A promise that resolves when disconnected.
|
|
38
|
+
* @throws {@link CloudNotificationAPIError} If an error occurs during disconnection.
|
|
39
|
+
*/
|
|
40
|
+
disconnect(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Posts a notification event to the Cloud Notification service.
|
|
43
|
+
*
|
|
44
|
+
* @param notificationId - The ID of the notification.
|
|
45
|
+
* @param event - The event details, including category, type, and optional payload.
|
|
46
|
+
* @returns A promise that resolves when the event is posted.
|
|
47
|
+
* @throws {@link SessionNotConnectedError} If the session is not connected.
|
|
48
|
+
* @throws {@link PublishError} If an error occurs during publishing.
|
|
49
|
+
*/
|
|
50
|
+
postNotificationEvent(notificationId: string, event: {
|
|
51
|
+
category: string;
|
|
52
|
+
type: string;
|
|
53
|
+
payload?: unknown;
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Raises a notification to the Cloud Notification service.
|
|
57
|
+
*
|
|
58
|
+
* @param options - The options for the notification.
|
|
59
|
+
* @param payload - The payload of the notification.
|
|
60
|
+
* @returns A promise that resolves with the notification raise result.
|
|
61
|
+
* @throws {@link SessionNotConnectedError} If the session is not connected.
|
|
62
|
+
* @throws {@link PublishError} If an error occurs during publishing.
|
|
63
|
+
*/
|
|
64
|
+
raiseNotification(options: NotificationOptions_2, payload: unknown): Promise<NotificationRaiseResult>;
|
|
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
|
+
}
|
|
58
115
|
|
|
59
|
-
export declare class CloudNotificationAPIError extends Error {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
116
|
+
export declare class CloudNotificationAPIError extends Error {
|
|
117
|
+
code: string;
|
|
118
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
119
|
+
}
|
|
63
120
|
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export declare type CloudNotificationLogger = (level: LogLevel, message: string) => void;
|
|
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;
|
|
68
125
|
|
|
69
|
-
export declare type CloudNotificationSettings = {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
+
};
|
|
80
157
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
+
};
|
|
91
186
|
|
|
92
|
-
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
export declare type ConnectParameters = {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* The password to use for basic authentication
|
|
145
|
-
*/
|
|
146
|
-
password: string;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Optional parameters for JWT authentication
|
|
150
|
-
*/
|
|
151
|
-
jwtAuthenticationParameters?: {
|
|
152
|
-
/**
|
|
153
|
-
* When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
|
|
154
|
-
*/
|
|
155
|
-
jwtRequestCallback: () => string | object;
|
|
156
|
-
/**
|
|
157
|
-
* The id of the service gateway JWT authentication definition to use
|
|
158
|
-
*
|
|
159
|
-
* Note: Contact Here support to to get your organization's authentication id
|
|
160
|
-
*/
|
|
161
|
-
authenticationId: string;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
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
|
+
};
|
|
164
238
|
|
|
165
|
-
export declare type
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
userNotificationEventsTopic: string;
|
|
169
|
-
allNotificationEventsTopic: string;
|
|
170
|
-
channelsRootTopic: string;
|
|
171
|
-
publishTopic: string;
|
|
172
|
-
lastWillTopic: string;
|
|
173
|
-
url: string;
|
|
174
|
-
token: string;
|
|
175
|
-
orgId: string;
|
|
176
|
-
userId: string;
|
|
177
|
-
platformId: string;
|
|
178
|
-
groups: UserGroupWithTopic[];
|
|
179
|
-
userNotificationTopic: string;
|
|
180
|
-
};
|
|
239
|
+
export declare type DeleteNotificationEvent = BaseNotificationReceivedEvent & {
|
|
240
|
+
action: 'delete';
|
|
241
|
+
};
|
|
181
242
|
|
|
182
|
-
export declare type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
|
|
243
|
+
export declare type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
|
|
183
244
|
|
|
184
|
-
export declare type EventMap = {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
};
|
|
245
|
+
export declare type EventMap = {
|
|
246
|
+
reconnected: () => void;
|
|
247
|
+
disconnected: () => void;
|
|
248
|
+
reconnecting: (attemptNo: number) => void;
|
|
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
|
+
};
|
|
196
257
|
|
|
197
|
-
export declare class
|
|
198
|
-
|
|
199
|
-
}
|
|
258
|
+
export declare class EventPublishError extends CloudNotificationAPIError {
|
|
259
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
260
|
+
}
|
|
200
261
|
|
|
201
|
-
export declare class
|
|
202
|
-
|
|
203
|
-
}
|
|
262
|
+
export declare class EventRetrievalError extends CloudNotificationAPIError {
|
|
263
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
264
|
+
}
|
|
204
265
|
|
|
205
|
-
export declare
|
|
266
|
+
export declare class InvalidMessageFormatError extends CloudNotificationAPIError {
|
|
267
|
+
constructor(zodParseResult: z.SafeParseReturnType<unknown, unknown>);
|
|
268
|
+
}
|
|
206
269
|
|
|
207
|
-
export declare type
|
|
208
|
-
action: 'new';
|
|
209
|
-
};
|
|
270
|
+
export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
|
|
210
271
|
|
|
211
|
-
export declare type
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
category: string;
|
|
215
|
-
type: string;
|
|
216
|
-
payload?: unknown;
|
|
217
|
-
};
|
|
272
|
+
export declare type NewNotificationEvent = BaseNotificationReceivedEvent & {
|
|
273
|
+
action: 'new';
|
|
274
|
+
};
|
|
218
275
|
|
|
219
|
-
export declare type
|
|
276
|
+
export declare type NotificationEvent = {
|
|
277
|
+
notificationId: string;
|
|
278
|
+
correlationId?: string;
|
|
279
|
+
category: string;
|
|
280
|
+
type: string;
|
|
281
|
+
payload?: unknown;
|
|
282
|
+
};
|
|
220
283
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
284
|
+
/**
|
|
285
|
+
* Represents the options for a notification publish
|
|
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 }
|
|
224
305
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
category: string;
|
|
239
|
-
type: string;
|
|
240
|
-
userId: string;
|
|
241
|
-
platformId: string;
|
|
242
|
-
sourceId: string;
|
|
243
|
-
sessionId: string;
|
|
244
|
-
timestamp: string;
|
|
245
|
-
payload?: unknown;
|
|
246
|
-
correlationId?: string | undefined;
|
|
247
|
-
}, {
|
|
248
|
-
notificationId: string;
|
|
249
|
-
category: string;
|
|
250
|
-
type: string;
|
|
251
|
-
userId: string;
|
|
252
|
-
platformId: string;
|
|
253
|
-
sourceId: string;
|
|
254
|
-
sessionId: string;
|
|
255
|
-
timestamp: string;
|
|
256
|
-
payload?: unknown;
|
|
257
|
-
correlationId?: string | undefined;
|
|
258
|
-
}>;
|
|
306
|
+
/**
|
|
307
|
+
* Represents the response from raising a notification
|
|
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
|
+
};
|
|
259
319
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
declare type NotificationOptions_2 = {
|
|
264
|
-
/**
|
|
265
|
-
* Time to live for the notification in seconds
|
|
266
|
-
* This is the time that the notification will be kept in the system before it is deleted
|
|
267
|
-
* If not specified, the default time to live for the notification will be used
|
|
268
|
-
*/
|
|
269
|
-
ttl?: number;
|
|
270
|
-
/**
|
|
271
|
-
* A caller specified identifier for the notification
|
|
272
|
-
* This is used to identify the notification in the system when events and responses are received
|
|
273
|
-
*/
|
|
274
|
-
correlationId?: string;
|
|
275
|
-
/**
|
|
276
|
-
* The targets to send the notification to
|
|
277
|
-
* This is a set of groups and users that the notification will be sent to
|
|
278
|
-
*/
|
|
279
|
-
targets: NotificationTargets;
|
|
280
|
-
};
|
|
281
|
-
export { NotificationOptions_2 as NotificationOptions }
|
|
320
|
+
export declare class NotificationRetrievalError extends CloudNotificationAPIError {
|
|
321
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
322
|
+
}
|
|
282
323
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
*/
|
|
294
|
-
correlationId?: string;
|
|
295
|
-
};
|
|
324
|
+
export declare type NotificationsReplayDetail = {
|
|
325
|
+
cursor: string;
|
|
326
|
+
sessionId: string;
|
|
327
|
+
notificationId: string;
|
|
328
|
+
version: number;
|
|
329
|
+
action: 'new' | 'update' | 'delete';
|
|
330
|
+
payload?: unknown;
|
|
331
|
+
correlationId?: string | null;
|
|
332
|
+
timestamp: Date;
|
|
333
|
+
};
|
|
296
334
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* The users to send the notification to
|
|
307
|
-
*/
|
|
308
|
-
users: string[];
|
|
309
|
-
};
|
|
335
|
+
export declare type NotificationsReplayDetails = {
|
|
336
|
+
data: NotificationsReplayDetail[];
|
|
337
|
+
pageInfo: {
|
|
338
|
+
pageStart?: string;
|
|
339
|
+
nextPage?: string;
|
|
340
|
+
hasNextPage: boolean;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
310
343
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
344
|
+
/**
|
|
345
|
+
* Represents a set of targets for a notification publish
|
|
346
|
+
*/
|
|
347
|
+
export declare type NotificationTargets = {
|
|
348
|
+
/**
|
|
349
|
+
* The groups to send the notification to
|
|
350
|
+
*/
|
|
351
|
+
groups: string[];
|
|
352
|
+
/**
|
|
353
|
+
* The users to send the notification to
|
|
354
|
+
*/
|
|
355
|
+
users: string[];
|
|
356
|
+
};
|
|
314
357
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Represents the options for a notification update
|
|
360
|
+
*/
|
|
361
|
+
export declare type NotificationUpdateOptions = {
|
|
362
|
+
/**
|
|
363
|
+
* Optional number of seconds to keep the notification alive
|
|
364
|
+
* After this time the notification will be expired and a delete update will be raised
|
|
365
|
+
*/
|
|
366
|
+
ttlSeconds?: number;
|
|
367
|
+
};
|
|
319
368
|
|
|
320
|
-
export declare class
|
|
321
|
-
|
|
322
|
-
}
|
|
369
|
+
export declare class PublishError extends CloudNotificationAPIError {
|
|
370
|
+
constructor(message?: string, code?: string, cause?: unknown);
|
|
371
|
+
}
|
|
323
372
|
|
|
324
|
-
export declare type
|
|
325
|
-
|
|
326
|
-
|
|
373
|
+
export declare type PublishResult = {
|
|
374
|
+
notificationId: string;
|
|
375
|
+
correlationId: string | undefined;
|
|
376
|
+
};
|
|
327
377
|
|
|
328
|
-
export declare
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
378
|
+
export declare class SessionNotConnectedError extends CloudNotificationAPIError {
|
|
379
|
+
constructor(message?: string, code?: string);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Simple set-like structure that allows you to add values with a TTL (time to live).
|
|
384
|
+
* Values are automatically removed from the set after the TTL expires.
|
|
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
|
+
}
|
|
398
|
+
|
|
399
|
+
export declare type UpdateNotificationEvent = BaseNotificationReceivedEvent & {
|
|
400
|
+
action: 'update';
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
export declare type UserGroupWithTopic = {
|
|
404
|
+
uuid: string;
|
|
405
|
+
name: string;
|
|
406
|
+
topic?: string;
|
|
407
|
+
};
|
|
333
408
|
|
|
334
|
-
export { }
|
|
409
|
+
export { }
|