@nizam-os/operator-sdk 2.8.2 → 2.9.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.
Files changed (137) hide show
  1. package/dist/Client.d.ts +9 -0
  2. package/dist/Client.js +26 -14
  3. package/dist/api/resources/devices/client/Client.d.ts +71 -0
  4. package/dist/api/resources/devices/client/Client.js +238 -0
  5. package/dist/api/resources/devices/client/index.d.ts +1 -0
  6. package/dist/api/resources/devices/client/index.js +17 -0
  7. package/dist/api/resources/devices/client/requests/DeregisterDeviceRequest.d.ts +9 -0
  8. package/dist/api/resources/devices/client/requests/DeregisterDeviceRequest.js +3 -0
  9. package/dist/api/resources/devices/client/requests/RegisterDevice.d.ts +22 -0
  10. package/dist/api/resources/devices/client/requests/RegisterDevice.js +13 -0
  11. package/dist/api/resources/devices/client/requests/index.d.ts +2 -0
  12. package/dist/api/resources/devices/client/requests/index.js +5 -0
  13. package/dist/api/resources/devices/exports.d.ts +2 -0
  14. package/dist/api/resources/devices/exports.js +21 -0
  15. package/dist/api/resources/devices/index.d.ts +1 -0
  16. package/dist/api/resources/devices/index.js +17 -0
  17. package/dist/api/resources/index.d.ts +6 -0
  18. package/dist/api/resources/index.js +7 -1
  19. package/dist/api/resources/notificationPreferences/client/Client.d.ts +49 -0
  20. package/dist/api/resources/notificationPreferences/client/Client.js +175 -0
  21. package/dist/api/resources/notificationPreferences/client/index.d.ts +1 -0
  22. package/dist/api/resources/notificationPreferences/client/index.js +17 -0
  23. package/dist/api/resources/notificationPreferences/client/requests/UpdateNotificationPreferences.d.ts +11 -0
  24. package/dist/api/resources/notificationPreferences/client/requests/UpdateNotificationPreferences.js +3 -0
  25. package/dist/api/resources/notificationPreferences/client/requests/index.d.ts +1 -0
  26. package/dist/api/resources/notificationPreferences/client/requests/index.js +2 -0
  27. package/dist/api/resources/notificationPreferences/exports.d.ts +2 -0
  28. package/dist/api/resources/notificationPreferences/exports.js +21 -0
  29. package/dist/api/resources/notificationPreferences/index.d.ts +1 -0
  30. package/dist/api/resources/notificationPreferences/index.js +17 -0
  31. package/dist/api/resources/notifications/client/Client.d.ts +88 -0
  32. package/dist/api/resources/notifications/client/Client.js +316 -0
  33. package/dist/api/resources/notifications/client/index.d.ts +1 -0
  34. package/dist/api/resources/notifications/client/index.js +17 -0
  35. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +22 -0
  36. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.js +3 -0
  37. package/dist/api/resources/notifications/client/requests/MarkNotificationReadRequest.d.ts +9 -0
  38. package/dist/api/resources/notifications/client/requests/MarkNotificationReadRequest.js +3 -0
  39. package/dist/api/resources/notifications/client/requests/index.d.ts +2 -0
  40. package/dist/api/resources/notifications/client/requests/index.js +2 -0
  41. package/dist/api/resources/notifications/exports.d.ts +2 -0
  42. package/dist/api/resources/notifications/exports.js +21 -0
  43. package/dist/api/resources/notifications/index.d.ts +1 -0
  44. package/dist/api/resources/notifications/index.js +17 -0
  45. package/dist/api/types/ActiveOrganization.d.ts +2 -2
  46. package/dist/api/types/ActiveOrganization.js +1 -1
  47. package/dist/api/types/ActivityResource.d.ts +2 -2
  48. package/dist/api/types/ActivityResource.js +1 -1
  49. package/dist/api/types/Asset.d.ts +2 -2
  50. package/dist/api/types/Asset.js +1 -1
  51. package/dist/api/types/AssetListItem.d.ts +2 -2
  52. package/dist/api/types/AssetListItem.js +1 -1
  53. package/dist/api/types/Assignment.d.ts +2 -2
  54. package/dist/api/types/Assignment.js +1 -1
  55. package/dist/api/types/BusinessCategory.d.ts +2 -2
  56. package/dist/api/types/BusinessCategory.js +1 -1
  57. package/dist/api/types/Country.d.ts +2 -2
  58. package/dist/api/types/Country.js +1 -1
  59. package/dist/api/types/Currency.d.ts +2 -2
  60. package/dist/api/types/Currency.js +1 -1
  61. package/dist/api/types/Device.d.ts +24 -0
  62. package/dist/api/types/Device.js +11 -0
  63. package/dist/api/types/Devices.d.ts +17 -0
  64. package/dist/api/types/Devices.js +11 -0
  65. package/dist/api/types/Invite.d.ts +2 -2
  66. package/dist/api/types/Invite.js +1 -1
  67. package/dist/api/types/Language.d.ts +2 -2
  68. package/dist/api/types/Language.js +1 -1
  69. package/dist/api/types/ListResponseActivityResource.d.ts +3 -3
  70. package/dist/api/types/ListResponseActivityResource.js +1 -1
  71. package/dist/api/types/ListResponseAssetListItem.d.ts +3 -3
  72. package/dist/api/types/ListResponseAssetListItem.js +1 -1
  73. package/dist/api/types/ListResponseBusinessCategory.d.ts +3 -3
  74. package/dist/api/types/ListResponseBusinessCategory.js +1 -1
  75. package/dist/api/types/ListResponseCountry.d.ts +3 -3
  76. package/dist/api/types/ListResponseCountry.js +1 -1
  77. package/dist/api/types/ListResponseCurrency.d.ts +3 -3
  78. package/dist/api/types/ListResponseCurrency.js +1 -1
  79. package/dist/api/types/ListResponseFile.d.ts +3 -3
  80. package/dist/api/types/ListResponseFile.js +1 -1
  81. package/dist/api/types/ListResponseHeatmapCell.d.ts +3 -3
  82. package/dist/api/types/ListResponseHeatmapCell.js +1 -1
  83. package/dist/api/types/ListResponseJob.d.ts +3 -3
  84. package/dist/api/types/ListResponseJob.js +1 -1
  85. package/dist/api/types/ListResponseLanguage.d.ts +3 -3
  86. package/dist/api/types/ListResponseLanguage.js +1 -1
  87. package/dist/api/types/ListResponseMembership.d.ts +3 -3
  88. package/dist/api/types/ListResponseMembership.js +1 -1
  89. package/dist/api/types/ListResponseNotification.d.ts +27 -0
  90. package/dist/api/types/ListResponseNotification.js +11 -0
  91. package/dist/api/types/ListResponseNotificationDeadLetter.d.ts +27 -0
  92. package/dist/api/types/ListResponseNotificationDeadLetter.js +11 -0
  93. package/dist/api/types/ListResponseOperatorPosition.d.ts +3 -3
  94. package/dist/api/types/ListResponseOperatorPosition.js +1 -1
  95. package/dist/api/types/ListResponseOrganization.d.ts +3 -3
  96. package/dist/api/types/ListResponseOrganization.js +1 -1
  97. package/dist/api/types/ListResponsePosition.d.ts +3 -3
  98. package/dist/api/types/ListResponsePosition.js +1 -1
  99. package/dist/api/types/ListResponseTimezone.d.ts +3 -3
  100. package/dist/api/types/ListResponseTimezone.js +1 -1
  101. package/dist/api/types/ListResponseUserResource.d.ts +3 -3
  102. package/dist/api/types/ListResponseUserResource.js +1 -1
  103. package/dist/api/types/Membership.d.ts +2 -2
  104. package/dist/api/types/Membership.js +1 -1
  105. package/dist/api/types/Notification.d.ts +48 -0
  106. package/dist/api/types/Notification.js +27 -0
  107. package/dist/api/types/NotificationDeadLetter.d.ts +36 -0
  108. package/dist/api/types/NotificationDeadLetter.js +11 -0
  109. package/dist/api/types/NotificationPreference.d.ts +13 -0
  110. package/dist/api/types/NotificationPreference.js +3 -0
  111. package/dist/api/types/NotificationPreferenceItem.d.ts +13 -0
  112. package/dist/api/types/NotificationPreferenceItem.js +3 -0
  113. package/dist/api/types/NotificationPreferences.d.ts +17 -0
  114. package/dist/api/types/NotificationPreferences.js +11 -0
  115. package/dist/api/types/NotificationUnreadCount.d.ts +16 -0
  116. package/dist/api/types/NotificationUnreadCount.js +11 -0
  117. package/dist/api/types/NotificationsMarkedRead.d.ts +16 -0
  118. package/dist/api/types/NotificationsMarkedRead.js +11 -0
  119. package/dist/api/types/Operator.d.ts +2 -2
  120. package/dist/api/types/Operator.js +1 -1
  121. package/dist/api/types/Organization.d.ts +2 -2
  122. package/dist/api/types/Organization.js +1 -1
  123. package/dist/api/types/QuietHours.d.ts +11 -0
  124. package/dist/api/types/QuietHours.js +3 -0
  125. package/dist/api/types/RealtimeTicket.d.ts +2 -2
  126. package/dist/api/types/RealtimeTicket.js +1 -1
  127. package/dist/api/types/ReconcileResponse.d.ts +2 -2
  128. package/dist/api/types/ReconcileResponse.js +1 -1
  129. package/dist/api/types/Timezone.d.ts +2 -2
  130. package/dist/api/types/Timezone.js +1 -1
  131. package/dist/api/types/User.d.ts +2 -2
  132. package/dist/api/types/User.js +1 -1
  133. package/dist/api/types/UserResource.d.ts +2 -2
  134. package/dist/api/types/UserResource.js +1 -1
  135. package/dist/api/types/index.d.ts +12 -0
  136. package/dist/api/types/index.js +12 -0
  137. package/package.json +1 -1
@@ -0,0 +1,316 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.NotificationsClient = void 0;
38
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
39
+ const headers_js_1 = require("../../../../core/headers.js");
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const environments = __importStar(require("../../../../environments.js"));
42
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
43
+ const errors = __importStar(require("../../../../errors/index.js"));
44
+ const NizamOperatorRuntime = __importStar(require("../../../index.js"));
45
+ /**
46
+ * The authenticated user's notification inbox.
47
+ */
48
+ class NotificationsClient {
49
+ constructor(options) {
50
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
+ }
52
+ /**
53
+ * The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `unread=true` restricts to unread; `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
+ *
55
+ * @param {NizamOperatorRuntime.ListNotificationsRequest} request
56
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link NizamOperatorRuntime.BadRequestError}
59
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
60
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
61
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
62
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
63
+ *
64
+ * @example
65
+ * await client.notifications.listNotifications({
66
+ * since: "2026-05-20T14:00:00Z",
67
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
68
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
69
+ * })
70
+ */
71
+ listNotifications(request = {}, requestOptions) {
72
+ return core.HttpResponsePromise.fromPromise(this.__listNotifications(request, requestOptions));
73
+ }
74
+ async __listNotifications(request = {}, requestOptions) {
75
+ const { unread, since, sort, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
76
+ const _queryParams = {
77
+ unread,
78
+ since: since != null ? since : undefined,
79
+ sort,
80
+ limit,
81
+ starting_after: startingAfter,
82
+ ending_before: endingBefore,
83
+ };
84
+ const _authRequest = await this._options.authProvider.getAuthRequest();
85
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
86
+ const _response = await core.fetcher({
87
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
88
+ (await core.Supplier.get(this._options.environment)) ??
89
+ environments.NizamOperatorRuntimeEnvironment.Production, "v1/notifications"),
90
+ method: "GET",
91
+ headers: _headers,
92
+ queryString: core.url
93
+ .queryBuilder()
94
+ .addMany(_queryParams)
95
+ .mergeAdditional(requestOptions?.queryParams)
96
+ .build(),
97
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
98
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
99
+ abortSignal: requestOptions?.abortSignal,
100
+ fetchFn: this._options?.fetch,
101
+ logging: this._options.logging,
102
+ });
103
+ if (_response.ok) {
104
+ return {
105
+ data: _response.body,
106
+ rawResponse: _response.rawResponse,
107
+ };
108
+ }
109
+ if (_response.error.reason === "status-code") {
110
+ switch (_response.error.statusCode) {
111
+ case 400:
112
+ throw new NizamOperatorRuntime.BadRequestError(_response.error.body, _response.rawResponse);
113
+ case 401:
114
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
115
+ case 403:
116
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
117
+ case 429:
118
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
119
+ case 500:
120
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
121
+ default:
122
+ throw new errors.NizamOperatorRuntimeError({
123
+ statusCode: _response.error.statusCode,
124
+ body: _response.error.body,
125
+ rawResponse: _response.rawResponse,
126
+ });
127
+ }
128
+ }
129
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/notifications");
130
+ }
131
+ /**
132
+ * 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
+ *
134
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
135
+ *
136
+ * @throws {@link NizamOperatorRuntime.BadRequestError}
137
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
138
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
139
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
140
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
141
+ *
142
+ * @example
143
+ * await client.notifications.markAllNotificationsRead()
144
+ */
145
+ markAllNotificationsRead(requestOptions) {
146
+ return core.HttpResponsePromise.fromPromise(this.__markAllNotificationsRead(requestOptions));
147
+ }
148
+ async __markAllNotificationsRead(requestOptions) {
149
+ const _authRequest = await this._options.authProvider.getAuthRequest();
150
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
151
+ const _response = await core.fetcher({
152
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
153
+ (await core.Supplier.get(this._options.environment)) ??
154
+ environments.NizamOperatorRuntimeEnvironment.Production, "v1/notifications/read_all"),
155
+ method: "POST",
156
+ headers: _headers,
157
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
158
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
159
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
160
+ abortSignal: requestOptions?.abortSignal,
161
+ fetchFn: this._options?.fetch,
162
+ logging: this._options.logging,
163
+ });
164
+ if (_response.ok) {
165
+ return {
166
+ data: _response.body,
167
+ rawResponse: _response.rawResponse,
168
+ };
169
+ }
170
+ if (_response.error.reason === "status-code") {
171
+ switch (_response.error.statusCode) {
172
+ case 400:
173
+ throw new NizamOperatorRuntime.BadRequestError(_response.error.body, _response.rawResponse);
174
+ case 401:
175
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
176
+ case 403:
177
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
178
+ case 429:
179
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
180
+ case 500:
181
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
182
+ default:
183
+ throw new errors.NizamOperatorRuntimeError({
184
+ statusCode: _response.error.statusCode,
185
+ body: _response.error.body,
186
+ rawResponse: _response.rawResponse,
187
+ });
188
+ }
189
+ }
190
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/read_all");
191
+ }
192
+ /**
193
+ * The unread badge count for the active organization. Excludes dismissed (soft-deleted) notifications.
194
+ *
195
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
196
+ *
197
+ * @throws {@link NizamOperatorRuntime.BadRequestError}
198
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
199
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
200
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
201
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
202
+ *
203
+ * @example
204
+ * await client.notifications.getUnreadNotificationCount()
205
+ */
206
+ getUnreadNotificationCount(requestOptions) {
207
+ return core.HttpResponsePromise.fromPromise(this.__getUnreadNotificationCount(requestOptions));
208
+ }
209
+ async __getUnreadNotificationCount(requestOptions) {
210
+ const _authRequest = await this._options.authProvider.getAuthRequest();
211
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
212
+ const _response = await core.fetcher({
213
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
214
+ (await core.Supplier.get(this._options.environment)) ??
215
+ environments.NizamOperatorRuntimeEnvironment.Production, "v1/notifications/unread_count"),
216
+ method: "GET",
217
+ headers: _headers,
218
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
219
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
220
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
221
+ abortSignal: requestOptions?.abortSignal,
222
+ fetchFn: this._options?.fetch,
223
+ logging: this._options.logging,
224
+ });
225
+ if (_response.ok) {
226
+ return {
227
+ data: _response.body,
228
+ rawResponse: _response.rawResponse,
229
+ };
230
+ }
231
+ if (_response.error.reason === "status-code") {
232
+ switch (_response.error.statusCode) {
233
+ case 400:
234
+ throw new NizamOperatorRuntime.BadRequestError(_response.error.body, _response.rawResponse);
235
+ case 401:
236
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
237
+ case 403:
238
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
239
+ case 429:
240
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
241
+ case 500:
242
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
243
+ default:
244
+ throw new errors.NizamOperatorRuntimeError({
245
+ statusCode: _response.error.statusCode,
246
+ body: _response.error.body,
247
+ rawResponse: _response.rawResponse,
248
+ });
249
+ }
250
+ }
251
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/notifications/unread_count");
252
+ }
253
+ /**
254
+ * 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
+ *
256
+ * @param {NizamOperatorRuntime.MarkNotificationReadRequest} request
257
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
258
+ *
259
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
260
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
261
+ * @throws {@link NizamOperatorRuntime.NotFoundError}
262
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
263
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
264
+ *
265
+ * @example
266
+ * await client.notifications.markNotificationRead({
267
+ * id: "00000000-0000-0000-0000-000000000000"
268
+ * })
269
+ */
270
+ markNotificationRead(request, requestOptions) {
271
+ return core.HttpResponsePromise.fromPromise(this.__markNotificationRead(request, requestOptions));
272
+ }
273
+ async __markNotificationRead(request, requestOptions) {
274
+ const { id } = request;
275
+ const _authRequest = await this._options.authProvider.getAuthRequest();
276
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
277
+ const _response = await core.fetcher({
278
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
279
+ (await core.Supplier.get(this._options.environment)) ??
280
+ environments.NizamOperatorRuntimeEnvironment.Production, `v1/notifications/${core.url.encodePathParam(id)}/read`),
281
+ method: "POST",
282
+ headers: _headers,
283
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
284
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
285
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
286
+ abortSignal: requestOptions?.abortSignal,
287
+ fetchFn: this._options?.fetch,
288
+ logging: this._options.logging,
289
+ });
290
+ if (_response.ok) {
291
+ return { data: _response.body, rawResponse: _response.rawResponse };
292
+ }
293
+ if (_response.error.reason === "status-code") {
294
+ switch (_response.error.statusCode) {
295
+ case 401:
296
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
297
+ case 403:
298
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
299
+ case 404:
300
+ throw new NizamOperatorRuntime.NotFoundError(_response.error.body, _response.rawResponse);
301
+ case 429:
302
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
303
+ case 500:
304
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
305
+ default:
306
+ throw new errors.NizamOperatorRuntimeError({
307
+ statusCode: _response.error.statusCode,
308
+ body: _response.error.body,
309
+ rawResponse: _response.rawResponse,
310
+ });
311
+ }
312
+ }
313
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/notifications/{id}/read");
314
+ }
315
+ }
316
+ exports.NotificationsClient = NotificationsClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * since: "2026-05-20T14:00:00Z",
5
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
6
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
7
+ * }
8
+ */
9
+ export interface ListNotificationsRequest {
10
+ /** Restrict to unread notifications. */
11
+ unread?: boolean;
12
+ /** Only notifications created at/after this RFC 3339 instant. */
13
+ since?: string;
14
+ /** Sort order. Allowed fields: `created_at`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
15
+ sort?: string | string[];
16
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
17
+ limit?: number;
18
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
19
+ starting_after?: string;
20
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
21
+ ending_before?: string;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface MarkNotificationReadRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export type { ListNotificationsRequest } from "./ListNotificationsRequest.js";
2
+ export type { MarkNotificationReadRequest } from "./MarkNotificationReadRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { NotificationsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.NotificationsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "NotificationsClient", { enumerable: true, get: function () { return Client_js_1.NotificationsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -9,11 +9,11 @@ export interface ActiveOrganization {
9
9
  preferred_organization_id?: string | undefined;
10
10
  /** All active memberships for the picker UI. */
11
11
  memberships?: NizamOperatorRuntime.MembershipChoice[] | undefined;
12
- /** Object type discriminator (Stripe pattern). */
12
+ /** Object type discriminator. */
13
13
  object?: ActiveOrganization.Object_ | undefined;
14
14
  }
15
15
  export declare namespace ActiveOrganization {
16
- /** Object type discriminator (Stripe pattern). */
16
+ /** Object type discriminator. */
17
17
  const Object_: {
18
18
  readonly ActiveOrganization: "active_organization";
19
19
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ActiveOrganization = void 0;
5
5
  var ActiveOrganization;
6
6
  (function (ActiveOrganization) {
7
- /** Object type discriminator (Stripe pattern). */
7
+ /** Object type discriminator. */
8
8
  ActiveOrganization.Object_ = {
9
9
  ActiveOrganization: "active_organization",
10
10
  };
@@ -22,7 +22,7 @@ export interface ActivityResource {
22
22
  log_name?: string | undefined;
23
23
  /** When the activity was recorded — the authoritative timestamp. */
24
24
  occurred_at?: string | undefined;
25
- /** Object type discriminator (Stripe pattern). */
25
+ /** Object type discriminator. */
26
26
  object?: ActivityResource.Object_ | undefined;
27
27
  }
28
28
  export declare namespace ActivityResource {
@@ -47,7 +47,7 @@ export declare namespace ActivityResource {
47
47
  readonly Custom: "custom";
48
48
  };
49
49
  type Event = (typeof Event)[keyof typeof Event];
50
- /** Object type discriminator (Stripe pattern). */
50
+ /** Object type discriminator. */
51
51
  const Object_: {
52
52
  readonly Activity: "activity";
53
53
  };
@@ -24,7 +24,7 @@ var ActivityResource;
24
24
  LoggedOut: "logged_out",
25
25
  Custom: "custom",
26
26
  };
27
- /** Object type discriminator (Stripe pattern). */
27
+ /** Object type discriminator. */
28
28
  ActivityResource.Object_ = {
29
29
  Activity: "activity",
30
30
  };
@@ -22,7 +22,7 @@ export interface Asset {
22
22
  organization_id?: string | undefined;
23
23
  /** Current primary operator (active assignment, role=primary). */
24
24
  current_primary_operator_id?: string | undefined;
25
- /** Object type discriminator (Stripe pattern). */
25
+ /** Object type discriminator. */
26
26
  object?: Asset.Object_ | undefined;
27
27
  }
28
28
  export declare namespace Asset {
@@ -50,7 +50,7 @@ export declare namespace Asset {
50
50
  readonly Lost: "lost";
51
51
  };
52
52
  type Status = (typeof Status)[keyof typeof Status];
53
- /** Object type discriminator (Stripe pattern). */
53
+ /** Object type discriminator. */
54
54
  const Object_: {
55
55
  readonly Asset: "asset";
56
56
  };
@@ -26,7 +26,7 @@ var Asset;
26
26
  Inactive: "inactive",
27
27
  Lost: "lost",
28
28
  };
29
- /** Object type discriminator (Stripe pattern). */
29
+ /** Object type discriminator. */
30
30
  Asset.Object_ = {
31
31
  Asset: "asset",
32
32
  };
@@ -28,7 +28,7 @@ export interface AssetListItem {
28
28
  rank?: number | undefined;
29
29
  /** Highlighted match fragment when the request carried `q&highlight=true`. Matched terms are wrapped in `<mark>…</mark>`. */
30
30
  snippet?: string | undefined;
31
- /** Object type discriminator (Stripe pattern). */
31
+ /** Object type discriminator. */
32
32
  object?: AssetListItem.Object_ | undefined;
33
33
  }
34
34
  export declare namespace AssetListItem {
@@ -56,7 +56,7 @@ export declare namespace AssetListItem {
56
56
  readonly Lost: "lost";
57
57
  };
58
58
  type Status = (typeof Status)[keyof typeof Status];
59
- /** Object type discriminator (Stripe pattern). */
59
+ /** Object type discriminator. */
60
60
  const Object_: {
61
61
  readonly Asset: "asset";
62
62
  };
@@ -26,7 +26,7 @@ var AssetListItem;
26
26
  Inactive: "inactive",
27
27
  Lost: "lost",
28
28
  };
29
- /** Object type discriminator (Stripe pattern). */
29
+ /** Object type discriminator. */
30
30
  AssetListItem.Object_ = {
31
31
  Asset: "asset",
32
32
  };
@@ -16,7 +16,7 @@ export interface Assignment {
16
16
  valid_until?: string | undefined;
17
17
  /** Why the assignment was closed (null while active). */
18
18
  terminated_reason?: Assignment.TerminatedReason | undefined;
19
- /** Object type discriminator (Stripe pattern). */
19
+ /** Object type discriminator. */
20
20
  object?: Assignment.Object_ | undefined;
21
21
  }
22
22
  export declare namespace Assignment {
@@ -41,7 +41,7 @@ export declare namespace Assignment {
41
41
  readonly ManualClose: "manual_close";
42
42
  };
43
43
  type TerminatedReason = (typeof TerminatedReason)[keyof typeof TerminatedReason];
44
- /** Object type discriminator (Stripe pattern). */
44
+ /** Object type discriminator. */
45
45
  const Object_: {
46
46
  readonly Assignment: "assignment";
47
47
  };
@@ -23,7 +23,7 @@ var Assignment;
23
23
  ContractEnded: "contract_ended",
24
24
  ManualClose: "manual_close",
25
25
  };
26
- /** Object type discriminator (Stripe pattern). */
26
+ /** Object type discriminator. */
27
27
  Assignment.Object_ = {
28
28
  Assignment: "assignment",
29
29
  };
@@ -6,11 +6,11 @@ export interface BusinessCategory {
6
6
  slug?: string | undefined;
7
7
  /** Human-readable label for picker UIs. */
8
8
  display_name?: string | undefined;
9
- /** Object type discriminator (Stripe pattern). */
9
+ /** Object type discriminator. */
10
10
  object?: BusinessCategory.Object_ | undefined;
11
11
  }
12
12
  export declare namespace BusinessCategory {
13
- /** Object type discriminator (Stripe pattern). */
13
+ /** Object type discriminator. */
14
14
  const Object_: {
15
15
  readonly BusinessCategory: "business_category";
16
16
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.BusinessCategory = void 0;
5
5
  var BusinessCategory;
6
6
  (function (BusinessCategory) {
7
- /** Object type discriminator (Stripe pattern). */
7
+ /** Object type discriminator. */
8
8
  BusinessCategory.Object_ = {
9
9
  BusinessCategory: "business_category",
10
10
  };
@@ -8,11 +8,11 @@ export interface Country {
8
8
  name?: string | undefined;
9
9
  /** E.164 country calling code with `+` prefix, or null if not allocated. */
10
10
  calling_code?: string | undefined;
11
- /** Object type discriminator (Stripe pattern). */
11
+ /** Object type discriminator. */
12
12
  object?: Country.Object_ | undefined;
13
13
  }
14
14
  export declare namespace Country {
15
- /** Object type discriminator (Stripe pattern). */
15
+ /** Object type discriminator. */
16
16
  const Object_: {
17
17
  readonly Country: "country";
18
18
  };
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Country = void 0;
5
5
  var Country;
6
6
  (function (Country) {
7
- /** Object type discriminator (Stripe pattern). */
7
+ /** Object type discriminator. */
8
8
  Country.Object_ = {
9
9
  Country: "country",
10
10
  };
@@ -10,11 +10,11 @@ export interface Currency {
10
10
  symbol?: string | undefined;
11
11
  /** Default number of fractional digits per ISO 4217. */
12
12
  fraction_digits?: number | undefined;
13
- /** Object type discriminator (Stripe pattern). */
13
+ /** Object type discriminator. */
14
14
  object?: Currency.Object_ | undefined;
15
15
  }
16
16
  export declare namespace Currency {
17
- /** Object type discriminator (Stripe pattern). */
17
+ /** Object type discriminator. */
18
18
  const Object_: {
19
19
  readonly Currency: "currency";
20
20
  };