@nizam-os/customer-sdk 2.7.0 → 4.0.0
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/dist/api/resources/files/client/Client.d.ts +2 -0
- package/dist/api/resources/files/client/Client.js +7 -2
- package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +3 -0
- package/dist/api/resources/notifications/client/Client.d.ts +93 -2
- package/dist/api/resources/notifications/client/Client.js +311 -4
- package/dist/api/resources/notifications/client/requests/ArchiveNotificationRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/ArchiveNotificationRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +10 -2
- package/dist/api/resources/notifications/client/requests/MarkNotificationUnreadRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/MarkNotificationUnreadRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/UnarchiveNotificationRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/UnarchiveNotificationRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/index.d.ts +3 -0
- package/dist/api/types/Device.d.ts +17 -2
- package/dist/api/types/Device.js +13 -0
- package/dist/api/types/Notification.d.ts +4 -0
- package/dist/api/types/NotificationCategoryCount.d.ts +23 -0
- package/dist/api/types/NotificationCategoryCount.js +16 -0
- package/dist/api/types/NotificationCounts.d.ts +23 -0
- package/dist/api/types/NotificationCounts.js +11 -0
- package/dist/api/types/NotificationsArchived.d.ts +16 -0
- package/dist/api/types/NotificationsArchived.js +11 -0
- package/dist/api/types/NotificationsMarkedRead.d.ts +1 -1
- package/dist/api/types/index.d.ts +3 -0
- package/dist/api/types/index.js +3 -0
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ export declare class FilesClient {
|
|
|
41
41
|
* @throws {@link NizamCustomer.BadRequestError}
|
|
42
42
|
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
43
43
|
* @throws {@link NizamCustomer.ForbiddenError}
|
|
44
|
+
* @throws {@link NizamCustomer.ConflictError}
|
|
44
45
|
* @throws {@link NizamCustomer.ContentTooLargeError}
|
|
45
46
|
* @throws {@link NizamCustomer.UnprocessableEntityError}
|
|
46
47
|
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
@@ -48,6 +49,7 @@ export declare class FilesClient {
|
|
|
48
49
|
*
|
|
49
50
|
* @example
|
|
50
51
|
* await client.files.initiateFileUpload({
|
|
52
|
+
* "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
|
|
51
53
|
* kind: "profile_picture",
|
|
52
54
|
* subject_type: "task_attempt",
|
|
53
55
|
* subject_id: "b3c4d5e6-7f8a-9b0c-1d2e-3f4a5b6c7d8e",
|
|
@@ -134,6 +134,7 @@ class FilesClient {
|
|
|
134
134
|
* @throws {@link NizamCustomer.BadRequestError}
|
|
135
135
|
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
136
136
|
* @throws {@link NizamCustomer.ForbiddenError}
|
|
137
|
+
* @throws {@link NizamCustomer.ConflictError}
|
|
137
138
|
* @throws {@link NizamCustomer.ContentTooLargeError}
|
|
138
139
|
* @throws {@link NizamCustomer.UnprocessableEntityError}
|
|
139
140
|
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
@@ -141,6 +142,7 @@ class FilesClient {
|
|
|
141
142
|
*
|
|
142
143
|
* @example
|
|
143
144
|
* await client.files.initiateFileUpload({
|
|
145
|
+
* "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
|
|
144
146
|
* kind: "profile_picture",
|
|
145
147
|
* subject_type: "task_attempt",
|
|
146
148
|
* subject_id: "b3c4d5e6-7f8a-9b0c-1d2e-3f4a5b6c7d8e",
|
|
@@ -154,8 +156,9 @@ class FilesClient {
|
|
|
154
156
|
return core.HttpResponsePromise.fromPromise(this.__initiateFileUpload(request, requestOptions));
|
|
155
157
|
}
|
|
156
158
|
async __initiateFileUpload(request, requestOptions) {
|
|
159
|
+
const { "Idempotency-Key": idempotencyKey, ..._body } = request;
|
|
157
160
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
158
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
161
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
|
|
159
162
|
const _response = await core.fetcher({
|
|
160
163
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
161
164
|
(await core.Supplier.get(this._options.environment)) ??
|
|
@@ -165,7 +168,7 @@ class FilesClient {
|
|
|
165
168
|
contentType: "application/json",
|
|
166
169
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
167
170
|
requestType: "json",
|
|
168
|
-
body:
|
|
171
|
+
body: _body,
|
|
169
172
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
170
173
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
171
174
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -183,6 +186,8 @@ class FilesClient {
|
|
|
183
186
|
throw new NizamCustomer.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
184
187
|
case 403:
|
|
185
188
|
throw new NizamCustomer.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
189
|
+
case 409:
|
|
190
|
+
throw new NizamCustomer.ConflictError(_response.error.body, _response.rawResponse);
|
|
186
191
|
case 413:
|
|
187
192
|
throw new NizamCustomer.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
188
193
|
case 422:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
+
* "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
|
|
4
5
|
* kind: "profile_picture",
|
|
5
6
|
* subject_type: "task_attempt",
|
|
6
7
|
* subject_id: "b3c4d5e6-7f8a-9b0c-1d2e-3f4a5b6c7d8e",
|
|
@@ -11,6 +12,8 @@
|
|
|
11
12
|
* }
|
|
12
13
|
*/
|
|
13
14
|
export interface InitiateFileUploadRequest {
|
|
15
|
+
/** Optional. Supply a UUID (canonical 8-4-4-4-12 form; lowercase v4 recommended) to make this operation idempotent: the same key on a retry replays the original outcome instead of creating a second resource. 2xx successes and deliberate 4xx domain rejections are cached and replayed for 24h when the request body matches; transient 5xx responses are never cached, so a retry with the same key re-executes. A malformed key is rejected with 400 `idempotency.invalid_key`; reusing a key with a different request body is 409 `idempotency.key_conflict`; a key still in flight is 409 `idempotency.in_progress`. Omit the header and the operation behaves like any other write. */
|
|
16
|
+
"Idempotency-Key"?: string;
|
|
14
17
|
/** What the bytes are for the platform — fixes the policy applied to them. */
|
|
15
18
|
kind: InitiateFileUploadRequest.Kind;
|
|
16
19
|
/** Type of the business entity this file documents (optional at upload time; can also be attached later). */
|
|
@@ -14,7 +14,7 @@ export declare class NotificationsClient {
|
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<NotificationsClient.Options>;
|
|
15
15
|
constructor(options: NotificationsClient.Options);
|
|
16
16
|
/**
|
|
17
|
-
* The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `unread
|
|
17
|
+
* The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `status` selects the segment — `all` (default; the active inbox, non-archived), `unread`, `read`, or `archived`. `category` and `kind` accept comma-separated values and AND on top of the segment; `q` matches the notification title/body. `since=` (RFC 3339) returns only items at/after the instant for incremental catch-up after a reconnect. Pagination is bidirectional (`starting_after` / `ending_before`); cursors are bound to the sort direction that minted them.
|
|
18
18
|
*
|
|
19
19
|
* @param {NizamCustomer.ListNotificationsRequest} request
|
|
20
20
|
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -27,6 +27,8 @@ export declare class NotificationsClient {
|
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* await client.notifications.listNotifications({
|
|
30
|
+
* status: "<string>",
|
|
31
|
+
* q: "<string>",
|
|
30
32
|
* since: "2026-05-20T14:00:00Z",
|
|
31
33
|
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
32
34
|
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
@@ -34,6 +36,38 @@ export declare class NotificationsClient {
|
|
|
34
36
|
*/
|
|
35
37
|
listNotifications(request?: NizamCustomer.ListNotificationsRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.ListResponseNotification>;
|
|
36
38
|
private __listNotifications;
|
|
39
|
+
/**
|
|
40
|
+
* Archives every active notification of the caller in one operation. Returns the number archived (zero when the active inbox was already empty).
|
|
41
|
+
*
|
|
42
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link NizamCustomer.BadRequestError}
|
|
45
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
46
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
47
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
48
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.notifications.archiveAllNotifications()
|
|
52
|
+
*/
|
|
53
|
+
archiveAllNotifications(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.NotificationsArchived>;
|
|
54
|
+
private __archiveAllNotifications;
|
|
55
|
+
/**
|
|
56
|
+
* The segment-badge roll-up for the active organization: total + unread (active, non-archived), archived, and per-category active total/unread. Computed server-side in one pass so segment badges stay accurate across cursor pages (never inferred from the loaded page). Excludes dismissed (soft-deleted) notifications.
|
|
57
|
+
*
|
|
58
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link NizamCustomer.BadRequestError}
|
|
61
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
62
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
63
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
64
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.notifications.getNotificationCounts()
|
|
68
|
+
*/
|
|
69
|
+
getNotificationCounts(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.NotificationCounts>;
|
|
70
|
+
private __getNotificationCounts;
|
|
37
71
|
/**
|
|
38
72
|
* Flips every unread notification of the caller to read in one operation. Returns the number of notifications that were flipped (zero when the inbox was already clear).
|
|
39
73
|
*
|
|
@@ -51,7 +85,7 @@ export declare class NotificationsClient {
|
|
|
51
85
|
markAllNotificationsRead(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.NotificationsMarkedRead>;
|
|
52
86
|
private __markAllNotificationsRead;
|
|
53
87
|
/**
|
|
54
|
-
* The unread badge count for the active organization.
|
|
88
|
+
* The unread badge count for the active organization. Counts active (non-archived) unread notifications; excludes dismissed (soft-deleted) and archived ones.
|
|
55
89
|
*
|
|
56
90
|
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
91
|
*
|
|
@@ -66,6 +100,25 @@ export declare class NotificationsClient {
|
|
|
66
100
|
*/
|
|
67
101
|
getUnreadNotificationCount(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.NotificationUnreadCount>;
|
|
68
102
|
private __getUnreadNotificationCount;
|
|
103
|
+
/**
|
|
104
|
+
* Moves a single notification to the archive ("Done") — reversible, not a delete: it leaves the active inbox but stays listable under `status=archived`. Idempotent. 404 if the notification is not the caller's.
|
|
105
|
+
*
|
|
106
|
+
* @param {NizamCustomer.ArchiveNotificationRequest} request
|
|
107
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
110
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
111
|
+
* @throws {@link NizamCustomer.NotFoundError}
|
|
112
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
113
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* await client.notifications.archiveNotification({
|
|
117
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
118
|
+
* })
|
|
119
|
+
*/
|
|
120
|
+
archiveNotification(request: NizamCustomer.ArchiveNotificationRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.Notification>;
|
|
121
|
+
private __archiveNotification;
|
|
69
122
|
/**
|
|
70
123
|
* Flips a single notification to read. Idempotent — a second call is a no-op that preserves the original read timestamp. 404 if the notification is not the caller's.
|
|
71
124
|
*
|
|
@@ -85,4 +138,42 @@ export declare class NotificationsClient {
|
|
|
85
138
|
*/
|
|
86
139
|
markNotificationRead(request: NizamCustomer.MarkNotificationReadRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.Notification>;
|
|
87
140
|
private __markNotificationRead;
|
|
141
|
+
/**
|
|
142
|
+
* Restores an archived notification to the active inbox — the inverse of archive. Idempotent. 404 if the notification is not the caller's.
|
|
143
|
+
*
|
|
144
|
+
* @param {NizamCustomer.UnarchiveNotificationRequest} request
|
|
145
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
146
|
+
*
|
|
147
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
148
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
149
|
+
* @throws {@link NizamCustomer.NotFoundError}
|
|
150
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
151
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* await client.notifications.unarchiveNotification({
|
|
155
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
156
|
+
* })
|
|
157
|
+
*/
|
|
158
|
+
unarchiveNotification(request: NizamCustomer.UnarchiveNotificationRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.Notification>;
|
|
159
|
+
private __unarchiveNotification;
|
|
160
|
+
/**
|
|
161
|
+
* Flips a single notification back to unread — the inverse of mark-read. Idempotent. 404 if the notification is not the caller's.
|
|
162
|
+
*
|
|
163
|
+
* @param {NizamCustomer.MarkNotificationUnreadRequest} request
|
|
164
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
165
|
+
*
|
|
166
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
167
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
168
|
+
* @throws {@link NizamCustomer.NotFoundError}
|
|
169
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
170
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.notifications.markNotificationUnread({
|
|
174
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
175
|
+
* })
|
|
176
|
+
*/
|
|
177
|
+
markNotificationUnread(request: NizamCustomer.MarkNotificationUnreadRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamCustomer.Notification>;
|
|
178
|
+
private __markNotificationUnread;
|
|
88
179
|
}
|
|
@@ -50,7 +50,7 @@ class NotificationsClient {
|
|
|
50
50
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `unread
|
|
53
|
+
* The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `status` selects the segment — `all` (default; the active inbox, non-archived), `unread`, `read`, or `archived`. `category` and `kind` accept comma-separated values and AND on top of the segment; `q` matches the notification title/body. `since=` (RFC 3339) returns only items at/after the instant for incremental catch-up after a reconnect. Pagination is bidirectional (`starting_after` / `ending_before`); cursors are bound to the sort direction that minted them.
|
|
54
54
|
*
|
|
55
55
|
* @param {NizamCustomer.ListNotificationsRequest} request
|
|
56
56
|
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -63,6 +63,8 @@ class NotificationsClient {
|
|
|
63
63
|
*
|
|
64
64
|
* @example
|
|
65
65
|
* await client.notifications.listNotifications({
|
|
66
|
+
* status: "<string>",
|
|
67
|
+
* q: "<string>",
|
|
66
68
|
* since: "2026-05-20T14:00:00Z",
|
|
67
69
|
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
68
70
|
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
@@ -72,9 +74,12 @@ class NotificationsClient {
|
|
|
72
74
|
return core.HttpResponsePromise.fromPromise(this.__listNotifications(request, requestOptions));
|
|
73
75
|
}
|
|
74
76
|
async __listNotifications(request = {}, requestOptions) {
|
|
75
|
-
const {
|
|
77
|
+
const { status, category, kind, q, since, sort, limit, starting_after: startingAfter, ending_before: endingBefore, } = request;
|
|
76
78
|
const _queryParams = {
|
|
77
|
-
|
|
79
|
+
status,
|
|
80
|
+
category,
|
|
81
|
+
kind,
|
|
82
|
+
q,
|
|
78
83
|
since: since != null ? since : undefined,
|
|
79
84
|
sort,
|
|
80
85
|
limit,
|
|
@@ -128,6 +133,122 @@ class NotificationsClient {
|
|
|
128
133
|
}
|
|
129
134
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/notifications");
|
|
130
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Archives every active notification of the caller in one operation. Returns the number archived (zero when the active inbox was already empty).
|
|
138
|
+
*
|
|
139
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
|
+
*
|
|
141
|
+
* @throws {@link NizamCustomer.BadRequestError}
|
|
142
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
143
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
144
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
145
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* await client.notifications.archiveAllNotifications()
|
|
149
|
+
*/
|
|
150
|
+
archiveAllNotifications(requestOptions) {
|
|
151
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveAllNotifications(requestOptions));
|
|
152
|
+
}
|
|
153
|
+
async __archiveAllNotifications(requestOptions) {
|
|
154
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
155
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
156
|
+
const _response = await core.fetcher({
|
|
157
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
158
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
159
|
+
environments.NizamCustomerEnvironment.Production, "v1/notifications/archive_all"),
|
|
160
|
+
method: "POST",
|
|
161
|
+
headers: _headers,
|
|
162
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
163
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
164
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
165
|
+
abortSignal: requestOptions?.abortSignal,
|
|
166
|
+
fetchFn: this._options?.fetch,
|
|
167
|
+
logging: this._options.logging,
|
|
168
|
+
});
|
|
169
|
+
if (_response.ok) {
|
|
170
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
171
|
+
}
|
|
172
|
+
if (_response.error.reason === "status-code") {
|
|
173
|
+
switch (_response.error.statusCode) {
|
|
174
|
+
case 400:
|
|
175
|
+
throw new NizamCustomer.BadRequestError(_response.error.body, _response.rawResponse);
|
|
176
|
+
case 401:
|
|
177
|
+
throw new NizamCustomer.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
178
|
+
case 403:
|
|
179
|
+
throw new NizamCustomer.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
180
|
+
case 429:
|
|
181
|
+
throw new NizamCustomer.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
182
|
+
case 500:
|
|
183
|
+
throw new NizamCustomer.InternalServerError(_response.error.body, _response.rawResponse);
|
|
184
|
+
default:
|
|
185
|
+
throw new errors.NizamCustomerError({
|
|
186
|
+
statusCode: _response.error.statusCode,
|
|
187
|
+
body: _response.error.body,
|
|
188
|
+
rawResponse: _response.rawResponse,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/archive_all");
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The segment-badge roll-up for the active organization: total + unread (active, non-archived), archived, and per-category active total/unread. Computed server-side in one pass so segment badges stay accurate across cursor pages (never inferred from the loaded page). Excludes dismissed (soft-deleted) notifications.
|
|
196
|
+
*
|
|
197
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
198
|
+
*
|
|
199
|
+
* @throws {@link NizamCustomer.BadRequestError}
|
|
200
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
201
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
202
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
203
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* await client.notifications.getNotificationCounts()
|
|
207
|
+
*/
|
|
208
|
+
getNotificationCounts(requestOptions) {
|
|
209
|
+
return core.HttpResponsePromise.fromPromise(this.__getNotificationCounts(requestOptions));
|
|
210
|
+
}
|
|
211
|
+
async __getNotificationCounts(requestOptions) {
|
|
212
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
213
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
214
|
+
const _response = await core.fetcher({
|
|
215
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
216
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
217
|
+
environments.NizamCustomerEnvironment.Production, "v1/notifications/counts"),
|
|
218
|
+
method: "GET",
|
|
219
|
+
headers: _headers,
|
|
220
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
221
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
222
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
223
|
+
abortSignal: requestOptions?.abortSignal,
|
|
224
|
+
fetchFn: this._options?.fetch,
|
|
225
|
+
logging: this._options.logging,
|
|
226
|
+
});
|
|
227
|
+
if (_response.ok) {
|
|
228
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
229
|
+
}
|
|
230
|
+
if (_response.error.reason === "status-code") {
|
|
231
|
+
switch (_response.error.statusCode) {
|
|
232
|
+
case 400:
|
|
233
|
+
throw new NizamCustomer.BadRequestError(_response.error.body, _response.rawResponse);
|
|
234
|
+
case 401:
|
|
235
|
+
throw new NizamCustomer.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
236
|
+
case 403:
|
|
237
|
+
throw new NizamCustomer.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
238
|
+
case 429:
|
|
239
|
+
throw new NizamCustomer.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
240
|
+
case 500:
|
|
241
|
+
throw new NizamCustomer.InternalServerError(_response.error.body, _response.rawResponse);
|
|
242
|
+
default:
|
|
243
|
+
throw new errors.NizamCustomerError({
|
|
244
|
+
statusCode: _response.error.statusCode,
|
|
245
|
+
body: _response.error.body,
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/notifications/counts");
|
|
251
|
+
}
|
|
131
252
|
/**
|
|
132
253
|
* Flips every unread notification of the caller to read in one operation. Returns the number of notifications that were flipped (zero when the inbox was already clear).
|
|
133
254
|
*
|
|
@@ -190,7 +311,7 @@ class NotificationsClient {
|
|
|
190
311
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/read_all");
|
|
191
312
|
}
|
|
192
313
|
/**
|
|
193
|
-
* The unread badge count for the active organization.
|
|
314
|
+
* The unread badge count for the active organization. Counts active (non-archived) unread notifications; excludes dismissed (soft-deleted) and archived ones.
|
|
194
315
|
*
|
|
195
316
|
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
196
317
|
*
|
|
@@ -250,6 +371,68 @@ class NotificationsClient {
|
|
|
250
371
|
}
|
|
251
372
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/notifications/unread_count");
|
|
252
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* Moves a single notification to the archive ("Done") — reversible, not a delete: it leaves the active inbox but stays listable under `status=archived`. Idempotent. 404 if the notification is not the caller's.
|
|
376
|
+
*
|
|
377
|
+
* @param {NizamCustomer.ArchiveNotificationRequest} request
|
|
378
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
379
|
+
*
|
|
380
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
381
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
382
|
+
* @throws {@link NizamCustomer.NotFoundError}
|
|
383
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
384
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* await client.notifications.archiveNotification({
|
|
388
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
389
|
+
* })
|
|
390
|
+
*/
|
|
391
|
+
archiveNotification(request, requestOptions) {
|
|
392
|
+
return core.HttpResponsePromise.fromPromise(this.__archiveNotification(request, requestOptions));
|
|
393
|
+
}
|
|
394
|
+
async __archiveNotification(request, requestOptions) {
|
|
395
|
+
const { id } = request;
|
|
396
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
397
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
398
|
+
const _response = await core.fetcher({
|
|
399
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
400
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
401
|
+
environments.NizamCustomerEnvironment.Production, `v1/notifications/${core.url.encodePathParam(id)}/archive`),
|
|
402
|
+
method: "POST",
|
|
403
|
+
headers: _headers,
|
|
404
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
405
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
406
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
407
|
+
abortSignal: requestOptions?.abortSignal,
|
|
408
|
+
fetchFn: this._options?.fetch,
|
|
409
|
+
logging: this._options.logging,
|
|
410
|
+
});
|
|
411
|
+
if (_response.ok) {
|
|
412
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
413
|
+
}
|
|
414
|
+
if (_response.error.reason === "status-code") {
|
|
415
|
+
switch (_response.error.statusCode) {
|
|
416
|
+
case 401:
|
|
417
|
+
throw new NizamCustomer.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
418
|
+
case 403:
|
|
419
|
+
throw new NizamCustomer.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
420
|
+
case 404:
|
|
421
|
+
throw new NizamCustomer.NotFoundError(_response.error.body, _response.rawResponse);
|
|
422
|
+
case 429:
|
|
423
|
+
throw new NizamCustomer.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
424
|
+
case 500:
|
|
425
|
+
throw new NizamCustomer.InternalServerError(_response.error.body, _response.rawResponse);
|
|
426
|
+
default:
|
|
427
|
+
throw new errors.NizamCustomerError({
|
|
428
|
+
statusCode: _response.error.statusCode,
|
|
429
|
+
body: _response.error.body,
|
|
430
|
+
rawResponse: _response.rawResponse,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/{id}/archive");
|
|
435
|
+
}
|
|
253
436
|
/**
|
|
254
437
|
* Flips a single notification to read. Idempotent — a second call is a no-op that preserves the original read timestamp. 404 if the notification is not the caller's.
|
|
255
438
|
*
|
|
@@ -312,5 +495,129 @@ class NotificationsClient {
|
|
|
312
495
|
}
|
|
313
496
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/{id}/read");
|
|
314
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Restores an archived notification to the active inbox — the inverse of archive. Idempotent. 404 if the notification is not the caller's.
|
|
500
|
+
*
|
|
501
|
+
* @param {NizamCustomer.UnarchiveNotificationRequest} request
|
|
502
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
503
|
+
*
|
|
504
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
505
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
506
|
+
* @throws {@link NizamCustomer.NotFoundError}
|
|
507
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
508
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* await client.notifications.unarchiveNotification({
|
|
512
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
513
|
+
* })
|
|
514
|
+
*/
|
|
515
|
+
unarchiveNotification(request, requestOptions) {
|
|
516
|
+
return core.HttpResponsePromise.fromPromise(this.__unarchiveNotification(request, requestOptions));
|
|
517
|
+
}
|
|
518
|
+
async __unarchiveNotification(request, requestOptions) {
|
|
519
|
+
const { id } = request;
|
|
520
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
521
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
522
|
+
const _response = await core.fetcher({
|
|
523
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
524
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
525
|
+
environments.NizamCustomerEnvironment.Production, `v1/notifications/${core.url.encodePathParam(id)}/unarchive`),
|
|
526
|
+
method: "POST",
|
|
527
|
+
headers: _headers,
|
|
528
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
529
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
530
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
531
|
+
abortSignal: requestOptions?.abortSignal,
|
|
532
|
+
fetchFn: this._options?.fetch,
|
|
533
|
+
logging: this._options.logging,
|
|
534
|
+
});
|
|
535
|
+
if (_response.ok) {
|
|
536
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
537
|
+
}
|
|
538
|
+
if (_response.error.reason === "status-code") {
|
|
539
|
+
switch (_response.error.statusCode) {
|
|
540
|
+
case 401:
|
|
541
|
+
throw new NizamCustomer.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
542
|
+
case 403:
|
|
543
|
+
throw new NizamCustomer.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
544
|
+
case 404:
|
|
545
|
+
throw new NizamCustomer.NotFoundError(_response.error.body, _response.rawResponse);
|
|
546
|
+
case 429:
|
|
547
|
+
throw new NizamCustomer.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
548
|
+
case 500:
|
|
549
|
+
throw new NizamCustomer.InternalServerError(_response.error.body, _response.rawResponse);
|
|
550
|
+
default:
|
|
551
|
+
throw new errors.NizamCustomerError({
|
|
552
|
+
statusCode: _response.error.statusCode,
|
|
553
|
+
body: _response.error.body,
|
|
554
|
+
rawResponse: _response.rawResponse,
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/{id}/unarchive");
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Flips a single notification back to unread — the inverse of mark-read. Idempotent. 404 if the notification is not the caller's.
|
|
562
|
+
*
|
|
563
|
+
* @param {NizamCustomer.MarkNotificationUnreadRequest} request
|
|
564
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
565
|
+
*
|
|
566
|
+
* @throws {@link NizamCustomer.UnauthorizedError}
|
|
567
|
+
* @throws {@link NizamCustomer.ForbiddenError}
|
|
568
|
+
* @throws {@link NizamCustomer.NotFoundError}
|
|
569
|
+
* @throws {@link NizamCustomer.TooManyRequestsError}
|
|
570
|
+
* @throws {@link NizamCustomer.InternalServerError}
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* await client.notifications.markNotificationUnread({
|
|
574
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
575
|
+
* })
|
|
576
|
+
*/
|
|
577
|
+
markNotificationUnread(request, requestOptions) {
|
|
578
|
+
return core.HttpResponsePromise.fromPromise(this.__markNotificationUnread(request, requestOptions));
|
|
579
|
+
}
|
|
580
|
+
async __markNotificationUnread(request, requestOptions) {
|
|
581
|
+
const { id } = request;
|
|
582
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
583
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
584
|
+
const _response = await core.fetcher({
|
|
585
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
586
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
587
|
+
environments.NizamCustomerEnvironment.Production, `v1/notifications/${core.url.encodePathParam(id)}/unread`),
|
|
588
|
+
method: "POST",
|
|
589
|
+
headers: _headers,
|
|
590
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
591
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
592
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
593
|
+
abortSignal: requestOptions?.abortSignal,
|
|
594
|
+
fetchFn: this._options?.fetch,
|
|
595
|
+
logging: this._options.logging,
|
|
596
|
+
});
|
|
597
|
+
if (_response.ok) {
|
|
598
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
599
|
+
}
|
|
600
|
+
if (_response.error.reason === "status-code") {
|
|
601
|
+
switch (_response.error.statusCode) {
|
|
602
|
+
case 401:
|
|
603
|
+
throw new NizamCustomer.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
604
|
+
case 403:
|
|
605
|
+
throw new NizamCustomer.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
606
|
+
case 404:
|
|
607
|
+
throw new NizamCustomer.NotFoundError(_response.error.body, _response.rawResponse);
|
|
608
|
+
case 429:
|
|
609
|
+
throw new NizamCustomer.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
610
|
+
case 500:
|
|
611
|
+
throw new NizamCustomer.InternalServerError(_response.error.body, _response.rawResponse);
|
|
612
|
+
default:
|
|
613
|
+
throw new errors.NizamCustomerError({
|
|
614
|
+
statusCode: _response.error.statusCode,
|
|
615
|
+
body: _response.error.body,
|
|
616
|
+
rawResponse: _response.rawResponse,
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/{id}/unread");
|
|
621
|
+
}
|
|
315
622
|
}
|
|
316
623
|
exports.NotificationsClient = NotificationsClient;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
+
* status: "<string>",
|
|
5
|
+
* q: "<string>",
|
|
4
6
|
* since: "2026-05-20T14:00:00Z",
|
|
5
7
|
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
6
8
|
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
7
9
|
* }
|
|
8
10
|
*/
|
|
9
11
|
export interface ListNotificationsRequest {
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
/** Inbox segment. One of: `all` (default — active, non-archived), `unread`, `read`, `archived`. */
|
|
13
|
+
status?: string;
|
|
14
|
+
/** Filter by category. Comma-separated; values: `transactional`, `operational`, `alert`, `marketing`, `security`, `system`. */
|
|
15
|
+
category?: string | string[];
|
|
16
|
+
/** Filter by notification kind (wire key). Comma-separated; e.g. `membership.joined`. */
|
|
17
|
+
kind?: string | string[];
|
|
18
|
+
/** Free-text search over the notification title/body (max 200 chars). */
|
|
19
|
+
q?: string;
|
|
12
20
|
/** Only notifications created at/after this RFC 3339 instant. */
|
|
13
21
|
since?: string;
|
|
14
22
|
/** Sort order. Allowed fields: `created_at`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
export type { ArchiveNotificationRequest } from "./ArchiveNotificationRequest.js";
|
|
1
2
|
export type { ListNotificationsRequest } from "./ListNotificationsRequest.js";
|
|
2
3
|
export type { MarkNotificationReadRequest } from "./MarkNotificationReadRequest.js";
|
|
4
|
+
export type { MarkNotificationUnreadRequest } from "./MarkNotificationUnreadRequest.js";
|
|
5
|
+
export type { UnarchiveNotificationRequest } from "./UnarchiveNotificationRequest.js";
|
|
@@ -5,9 +5,9 @@ export interface Device {
|
|
|
5
5
|
/** Device id. */
|
|
6
6
|
id?: string | undefined;
|
|
7
7
|
/** Push transport. */
|
|
8
|
-
platform?:
|
|
8
|
+
platform?: Device.Platform | undefined;
|
|
9
9
|
/** Registration lifecycle. */
|
|
10
|
-
status?:
|
|
10
|
+
status?: Device.Status | undefined;
|
|
11
11
|
/** When the device was first registered. */
|
|
12
12
|
registered_at?: string | undefined;
|
|
13
13
|
/** When the registration was last refreshed (last seen). */
|
|
@@ -16,6 +16,21 @@ export interface Device {
|
|
|
16
16
|
object?: Device.Object_ | undefined;
|
|
17
17
|
}
|
|
18
18
|
export declare namespace Device {
|
|
19
|
+
/** Push transport. */
|
|
20
|
+
const Platform: {
|
|
21
|
+
readonly Ios: "ios";
|
|
22
|
+
readonly Android: "android";
|
|
23
|
+
readonly Web: "web";
|
|
24
|
+
};
|
|
25
|
+
type Platform = (typeof Platform)[keyof typeof Platform];
|
|
26
|
+
/** Registration lifecycle. */
|
|
27
|
+
const Status: {
|
|
28
|
+
readonly Active: "active";
|
|
29
|
+
readonly Suspended: "suspended";
|
|
30
|
+
readonly Inactive: "inactive";
|
|
31
|
+
readonly Expired: "expired";
|
|
32
|
+
};
|
|
33
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
19
34
|
/** Object type discriminator. */
|
|
20
35
|
const Object_: {
|
|
21
36
|
readonly Device: "device";
|
package/dist/api/types/Device.js
CHANGED
|
@@ -4,6 +4,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Device = void 0;
|
|
5
5
|
var Device;
|
|
6
6
|
(function (Device) {
|
|
7
|
+
/** Push transport. */
|
|
8
|
+
Device.Platform = {
|
|
9
|
+
Ios: "ios",
|
|
10
|
+
Android: "android",
|
|
11
|
+
Web: "web",
|
|
12
|
+
};
|
|
13
|
+
/** Registration lifecycle. */
|
|
14
|
+
Device.Status = {
|
|
15
|
+
Active: "active",
|
|
16
|
+
Suspended: "suspended",
|
|
17
|
+
Inactive: "inactive",
|
|
18
|
+
Expired: "expired",
|
|
19
|
+
};
|
|
7
20
|
/** Object type discriminator. */
|
|
8
21
|
Device.Object_ = {
|
|
9
22
|
Device: "device",
|
|
@@ -18,6 +18,10 @@ export interface Notification {
|
|
|
18
18
|
read?: boolean | undefined;
|
|
19
19
|
/** When it was read (RFC 3339); null while unread. */
|
|
20
20
|
read_at?: string | undefined;
|
|
21
|
+
/** Whether the recipient has archived ("Done") it. */
|
|
22
|
+
archived?: boolean | undefined;
|
|
23
|
+
/** When it was archived (RFC 3339); null while in the active inbox. */
|
|
24
|
+
archived_at?: string | undefined;
|
|
21
25
|
/** When it was raised (RFC 3339). */
|
|
22
26
|
created_at?: string | undefined;
|
|
23
27
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Active total/unread for one category.
|
|
3
|
+
*/
|
|
4
|
+
export interface NotificationCategoryCount {
|
|
5
|
+
/** Category. */
|
|
6
|
+
category?: NotificationCategoryCount.Category | undefined;
|
|
7
|
+
/** Active notifications in this category. */
|
|
8
|
+
total?: number | undefined;
|
|
9
|
+
/** Active unread notifications in this category. */
|
|
10
|
+
unread?: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace NotificationCategoryCount {
|
|
13
|
+
/** Category. */
|
|
14
|
+
const Category: {
|
|
15
|
+
readonly Transactional: "transactional";
|
|
16
|
+
readonly Operational: "operational";
|
|
17
|
+
readonly Alert: "alert";
|
|
18
|
+
readonly Marketing: "marketing";
|
|
19
|
+
readonly Security: "security";
|
|
20
|
+
readonly System: "system";
|
|
21
|
+
};
|
|
22
|
+
type Category = (typeof Category)[keyof typeof Category];
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NotificationCategoryCount = void 0;
|
|
5
|
+
var NotificationCategoryCount;
|
|
6
|
+
(function (NotificationCategoryCount) {
|
|
7
|
+
/** Category. */
|
|
8
|
+
NotificationCategoryCount.Category = {
|
|
9
|
+
Transactional: "transactional",
|
|
10
|
+
Operational: "operational",
|
|
11
|
+
Alert: "alert",
|
|
12
|
+
Marketing: "marketing",
|
|
13
|
+
Security: "security",
|
|
14
|
+
System: "system",
|
|
15
|
+
};
|
|
16
|
+
})(NotificationCategoryCount || (exports.NotificationCategoryCount = NotificationCategoryCount = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as NizamCustomer from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Inbox segment-badge counts (server-derived).
|
|
4
|
+
*/
|
|
5
|
+
export interface NotificationCounts {
|
|
6
|
+
/** Active (non-archived) notifications. */
|
|
7
|
+
total?: number | undefined;
|
|
8
|
+
/** Active unread notifications. */
|
|
9
|
+
unread?: number | undefined;
|
|
10
|
+
/** Archived ("Done") notifications. */
|
|
11
|
+
archived?: number | undefined;
|
|
12
|
+
/** Per-category active counts; categories with no active row are omitted. */
|
|
13
|
+
categories?: NizamCustomer.NotificationCategoryCount[] | undefined;
|
|
14
|
+
/** Object type discriminator. */
|
|
15
|
+
object?: NotificationCounts.Object_ | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace NotificationCounts {
|
|
18
|
+
/** Object type discriminator. */
|
|
19
|
+
const Object_: {
|
|
20
|
+
readonly NotificationCounts: "notification_counts";
|
|
21
|
+
};
|
|
22
|
+
type Object_ = (typeof Object_)[keyof typeof Object_];
|
|
23
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NotificationCounts = void 0;
|
|
5
|
+
var NotificationCounts;
|
|
6
|
+
(function (NotificationCounts) {
|
|
7
|
+
/** Object type discriminator. */
|
|
8
|
+
NotificationCounts.Object_ = {
|
|
9
|
+
NotificationCounts: "notification_counts",
|
|
10
|
+
};
|
|
11
|
+
})(NotificationCounts || (exports.NotificationCounts = NotificationCounts = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of an archive-all operation.
|
|
3
|
+
*/
|
|
4
|
+
export interface NotificationsArchived {
|
|
5
|
+
/** Number of notifications archived. */
|
|
6
|
+
archived?: number | undefined;
|
|
7
|
+
/** Object type discriminator. */
|
|
8
|
+
object?: NotificationsArchived.Object_ | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace NotificationsArchived {
|
|
11
|
+
/** Object type discriminator. */
|
|
12
|
+
const Object_: {
|
|
13
|
+
readonly NotificationsArchived: "notifications_archived";
|
|
14
|
+
};
|
|
15
|
+
type Object_ = (typeof Object_)[keyof typeof Object_];
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NotificationsArchived = void 0;
|
|
5
|
+
var NotificationsArchived;
|
|
6
|
+
(function (NotificationsArchived) {
|
|
7
|
+
/** Object type discriminator. */
|
|
8
|
+
NotificationsArchived.Object_ = {
|
|
9
|
+
NotificationsArchived: "notifications_archived",
|
|
10
|
+
};
|
|
11
|
+
})(NotificationsArchived || (exports.NotificationsArchived = NotificationsArchived = {}));
|
|
@@ -57,10 +57,13 @@ export * from "./MembershipChoice.js";
|
|
|
57
57
|
export * from "./MembershipDriftResponse.js";
|
|
58
58
|
export * from "./MqttToken.js";
|
|
59
59
|
export * from "./Notification.js";
|
|
60
|
+
export * from "./NotificationCategoryCount.js";
|
|
61
|
+
export * from "./NotificationCounts.js";
|
|
60
62
|
export * from "./NotificationDeadLetter.js";
|
|
61
63
|
export * from "./NotificationPreference.js";
|
|
62
64
|
export * from "./NotificationPreferenceItem.js";
|
|
63
65
|
export * from "./NotificationPreferences.js";
|
|
66
|
+
export * from "./NotificationsArchived.js";
|
|
64
67
|
export * from "./NotificationsMarkedRead.js";
|
|
65
68
|
export * from "./NotificationUnreadCount.js";
|
|
66
69
|
export * from "./OpenAssignmentRequest.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -73,10 +73,13 @@ __exportStar(require("./MembershipChoice.js"), exports);
|
|
|
73
73
|
__exportStar(require("./MembershipDriftResponse.js"), exports);
|
|
74
74
|
__exportStar(require("./MqttToken.js"), exports);
|
|
75
75
|
__exportStar(require("./Notification.js"), exports);
|
|
76
|
+
__exportStar(require("./NotificationCategoryCount.js"), exports);
|
|
77
|
+
__exportStar(require("./NotificationCounts.js"), exports);
|
|
76
78
|
__exportStar(require("./NotificationDeadLetter.js"), exports);
|
|
77
79
|
__exportStar(require("./NotificationPreference.js"), exports);
|
|
78
80
|
__exportStar(require("./NotificationPreferenceItem.js"), exports);
|
|
79
81
|
__exportStar(require("./NotificationPreferences.js"), exports);
|
|
82
|
+
__exportStar(require("./NotificationsArchived.js"), exports);
|
|
80
83
|
__exportStar(require("./NotificationsMarkedRead.js"), exports);
|
|
81
84
|
__exportStar(require("./NotificationUnreadCount.js"), exports);
|
|
82
85
|
__exportStar(require("./OpenAssignmentRequest.js"), exports);
|