@nizam-os/dashboard-sdk 8.1.0 → 10.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.
Files changed (52) hide show
  1. package/dist/api/resources/assets/client/Client.d.ts +5 -0
  2. package/dist/api/resources/assets/client/Client.js +10 -2
  3. package/dist/api/resources/assets/client/requests/CreateAssetRequest.d.ts +6 -0
  4. package/dist/api/resources/assignments/client/Client.d.ts +2 -0
  5. package/dist/api/resources/assignments/client/Client.js +5 -2
  6. package/dist/api/resources/assignments/client/requests/OpenAssignmentRequest.d.ts +4 -0
  7. package/dist/api/resources/files/client/Client.d.ts +2 -0
  8. package/dist/api/resources/files/client/Client.js +7 -2
  9. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +3 -0
  10. package/dist/api/resources/imports/client/Client.d.ts +2 -0
  11. package/dist/api/resources/imports/client/Client.js +7 -2
  12. package/dist/api/resources/imports/client/requests/CreateImportRequest.d.ts +3 -0
  13. package/dist/api/resources/invites/client/Client.d.ts +5 -0
  14. package/dist/api/resources/invites/client/Client.js +12 -2
  15. package/dist/api/resources/invites/client/requests/CreateInviteRequest.d.ts +5 -0
  16. package/dist/api/resources/notifications/client/Client.d.ts +93 -2
  17. package/dist/api/resources/notifications/client/Client.js +311 -4
  18. package/dist/api/resources/notifications/client/requests/ArchiveNotificationRequest.d.ts +9 -0
  19. package/dist/api/resources/notifications/client/requests/ArchiveNotificationRequest.js +3 -0
  20. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +10 -2
  21. package/dist/api/resources/notifications/client/requests/MarkNotificationUnreadRequest.d.ts +9 -0
  22. package/dist/api/resources/notifications/client/requests/MarkNotificationUnreadRequest.js +3 -0
  23. package/dist/api/resources/notifications/client/requests/UnarchiveNotificationRequest.d.ts +9 -0
  24. package/dist/api/resources/notifications/client/requests/UnarchiveNotificationRequest.js +3 -0
  25. package/dist/api/resources/notifications/client/requests/index.d.ts +3 -0
  26. package/dist/api/resources/operators/client/Client.d.ts +21 -11
  27. package/dist/api/resources/operators/client/Client.js +25 -12
  28. package/dist/api/resources/operators/client/requests/CreateOperatorBody.d.ts +37 -0
  29. package/dist/api/resources/operators/client/requests/CreateOperatorBody.js +3 -0
  30. package/dist/api/resources/operators/client/requests/index.d.ts +1 -0
  31. package/dist/api/resources/organizations/client/Client.d.ts +2 -2
  32. package/dist/api/resources/organizations/client/Client.js +5 -4
  33. package/dist/api/resources/organizations/client/requests/CreateOrganizationRequest.d.ts +4 -0
  34. package/dist/api/resources/taskAttempts/client/Client.d.ts +2 -0
  35. package/dist/api/resources/taskAttempts/client/Client.js +6 -2
  36. package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.d.ts +3 -0
  37. package/dist/api/resources/users/client/Client.d.ts +3 -0
  38. package/dist/api/resources/users/client/Client.js +8 -2
  39. package/dist/api/resources/users/client/requests/InviteUserRequest.d.ts +4 -0
  40. package/dist/api/types/Device.d.ts +17 -2
  41. package/dist/api/types/Device.js +13 -0
  42. package/dist/api/types/Notification.d.ts +4 -0
  43. package/dist/api/types/NotificationCategoryCount.d.ts +23 -0
  44. package/dist/api/types/NotificationCategoryCount.js +16 -0
  45. package/dist/api/types/NotificationCounts.d.ts +23 -0
  46. package/dist/api/types/NotificationCounts.js +11 -0
  47. package/dist/api/types/NotificationsArchived.d.ts +16 -0
  48. package/dist/api/types/NotificationsArchived.js +11 -0
  49. package/dist/api/types/NotificationsMarkedRead.d.ts +1 -1
  50. package/dist/api/types/index.d.ts +3 -0
  51. package/dist/api/types/index.js +3 -0
  52. package/package.json +1 -1
@@ -43,12 +43,14 @@ export declare class AssetsClient {
43
43
  * @throws {@link NizamDashboard.BadRequestError}
44
44
  * @throws {@link NizamDashboard.UnauthorizedError}
45
45
  * @throws {@link NizamDashboard.ForbiddenError}
46
+ * @throws {@link NizamDashboard.ConflictError}
46
47
  * @throws {@link NizamDashboard.UnprocessableEntityError}
47
48
  * @throws {@link NizamDashboard.TooManyRequestsError}
48
49
  * @throws {@link NizamDashboard.InternalServerError}
49
50
  *
50
51
  * @example
51
52
  * await client.assets.createAsset({
53
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
52
54
  * kind: "ground_vehicle",
53
55
  * name: "Truck 7",
54
56
  * autonomy_level: 0
@@ -56,6 +58,7 @@ export declare class AssetsClient {
56
58
  *
57
59
  * @example
58
60
  * await client.assets.createAsset({
61
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
59
62
  * kind: "aerial_vehicle",
60
63
  * name: "Delivery Drone D-12",
61
64
  * autonomy_level: 4
@@ -63,6 +66,7 @@ export declare class AssetsClient {
63
66
  *
64
67
  * @example
65
68
  * await client.assets.createAsset({
69
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
66
70
  * kind: "robot",
67
71
  * name: "Picker Bot 3",
68
72
  * autonomy_level: 5
@@ -70,6 +74,7 @@ export declare class AssetsClient {
70
74
  *
71
75
  * @example
72
76
  * await client.assets.createAsset({
77
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
73
78
  * kind: "container"
74
79
  * })
75
80
  */
@@ -139,12 +139,14 @@ class AssetsClient {
139
139
  * @throws {@link NizamDashboard.BadRequestError}
140
140
  * @throws {@link NizamDashboard.UnauthorizedError}
141
141
  * @throws {@link NizamDashboard.ForbiddenError}
142
+ * @throws {@link NizamDashboard.ConflictError}
142
143
  * @throws {@link NizamDashboard.UnprocessableEntityError}
143
144
  * @throws {@link NizamDashboard.TooManyRequestsError}
144
145
  * @throws {@link NizamDashboard.InternalServerError}
145
146
  *
146
147
  * @example
147
148
  * await client.assets.createAsset({
149
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
148
150
  * kind: "ground_vehicle",
149
151
  * name: "Truck 7",
150
152
  * autonomy_level: 0
@@ -152,6 +154,7 @@ class AssetsClient {
152
154
  *
153
155
  * @example
154
156
  * await client.assets.createAsset({
157
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
155
158
  * kind: "aerial_vehicle",
156
159
  * name: "Delivery Drone D-12",
157
160
  * autonomy_level: 4
@@ -159,6 +162,7 @@ class AssetsClient {
159
162
  *
160
163
  * @example
161
164
  * await client.assets.createAsset({
165
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
162
166
  * kind: "robot",
163
167
  * name: "Picker Bot 3",
164
168
  * autonomy_level: 5
@@ -166,6 +170,7 @@ class AssetsClient {
166
170
  *
167
171
  * @example
168
172
  * await client.assets.createAsset({
173
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
169
174
  * kind: "container"
170
175
  * })
171
176
  */
@@ -173,8 +178,9 @@ class AssetsClient {
173
178
  return core.HttpResponsePromise.fromPromise(this.__createAsset(request, requestOptions));
174
179
  }
175
180
  async __createAsset(request, requestOptions) {
181
+ const { "Idempotency-Key": idempotencyKey, ..._body } = request;
176
182
  const _authRequest = await this._options.authProvider.getAuthRequest();
177
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
183
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
178
184
  const _response = await core.fetcher({
179
185
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
180
186
  (await core.Supplier.get(this._options.environment)) ??
@@ -184,7 +190,7 @@ class AssetsClient {
184
190
  contentType: "application/json",
185
191
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
186
192
  requestType: "json",
187
- body: request,
193
+ body: _body,
188
194
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
189
195
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
190
196
  abortSignal: requestOptions?.abortSignal,
@@ -202,6 +208,8 @@ class AssetsClient {
202
208
  throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
203
209
  case 403:
204
210
  throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
211
+ case 409:
212
+ throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
205
213
  case 422:
206
214
  throw new NizamDashboard.UnprocessableEntityError(_response.error.body, _response.rawResponse);
207
215
  case 429:
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
4
5
  * kind: "ground_vehicle",
5
6
  * name: "Truck 7",
6
7
  * autonomy_level: 0
@@ -8,6 +9,7 @@
8
9
  *
9
10
  * @example
10
11
  * {
12
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
11
13
  * kind: "aerial_vehicle",
12
14
  * name: "Delivery Drone D-12",
13
15
  * autonomy_level: 4
@@ -15,6 +17,7 @@
15
17
  *
16
18
  * @example
17
19
  * {
20
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
18
21
  * kind: "robot",
19
22
  * name: "Picker Bot 3",
20
23
  * autonomy_level: 5
@@ -22,10 +25,13 @@
22
25
  *
23
26
  * @example
24
27
  * {
28
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
25
29
  * kind: "container"
26
30
  * }
27
31
  */
28
32
  export interface CreateAssetRequest {
33
+ /** 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. */
34
+ "Idempotency-Key"?: string;
29
35
  /** Top-level kind. */
30
36
  kind: CreateAssetRequest.Kind;
31
37
  /** Display name. */
@@ -29,6 +29,7 @@ export declare class AssignmentsClient {
29
29
  *
30
30
  * @example
31
31
  * await client.assignments.openAssignment({
32
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
32
33
  * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
33
34
  * operator_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
34
35
  * role: "primary"
@@ -36,6 +37,7 @@ export declare class AssignmentsClient {
36
37
  *
37
38
  * @example
38
39
  * await client.assignments.openAssignment({
40
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
39
41
  * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
40
42
  * operator_id: "d2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
41
43
  * role: "safety_monitor"
@@ -65,6 +65,7 @@ class AssignmentsClient {
65
65
  *
66
66
  * @example
67
67
  * await client.assignments.openAssignment({
68
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
68
69
  * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
69
70
  * operator_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
70
71
  * role: "primary"
@@ -72,6 +73,7 @@ class AssignmentsClient {
72
73
  *
73
74
  * @example
74
75
  * await client.assignments.openAssignment({
76
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
75
77
  * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
76
78
  * operator_id: "d2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
77
79
  * role: "safety_monitor"
@@ -81,8 +83,9 @@ class AssignmentsClient {
81
83
  return core.HttpResponsePromise.fromPromise(this.__openAssignment(request, requestOptions));
82
84
  }
83
85
  async __openAssignment(request, requestOptions) {
86
+ const { "Idempotency-Key": idempotencyKey, ..._body } = request;
84
87
  const _authRequest = await this._options.authProvider.getAuthRequest();
85
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
88
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
86
89
  const _response = await core.fetcher({
87
90
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
88
91
  (await core.Supplier.get(this._options.environment)) ??
@@ -92,7 +95,7 @@ class AssignmentsClient {
92
95
  contentType: "application/json",
93
96
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
94
97
  requestType: "json",
95
- body: request,
98
+ body: _body,
96
99
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
97
100
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
98
101
  abortSignal: requestOptions?.abortSignal,
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
4
5
  * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
5
6
  * operator_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
6
7
  * role: "primary"
@@ -8,12 +9,15 @@
8
9
  *
9
10
  * @example
10
11
  * {
12
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
11
13
  * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
12
14
  * operator_id: "d2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
13
15
  * role: "safety_monitor"
14
16
  * }
15
17
  */
16
18
  export interface OpenAssignmentRequest {
19
+ /** 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. */
20
+ "Idempotency-Key"?: string;
17
21
  /** Asset id. */
18
22
  asset_id: string;
19
23
  /** Operator id. */
@@ -41,6 +41,7 @@ export declare class FilesClient {
41
41
  * @throws {@link NizamDashboard.BadRequestError}
42
42
  * @throws {@link NizamDashboard.UnauthorizedError}
43
43
  * @throws {@link NizamDashboard.ForbiddenError}
44
+ * @throws {@link NizamDashboard.ConflictError}
44
45
  * @throws {@link NizamDashboard.ContentTooLargeError}
45
46
  * @throws {@link NizamDashboard.UnprocessableEntityError}
46
47
  * @throws {@link NizamDashboard.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 NizamDashboard.BadRequestError}
135
135
  * @throws {@link NizamDashboard.UnauthorizedError}
136
136
  * @throws {@link NizamDashboard.ForbiddenError}
137
+ * @throws {@link NizamDashboard.ConflictError}
137
138
  * @throws {@link NizamDashboard.ContentTooLargeError}
138
139
  * @throws {@link NizamDashboard.UnprocessableEntityError}
139
140
  * @throws {@link NizamDashboard.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: request,
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 NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
184
187
  case 403:
185
188
  throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
189
+ case 409:
190
+ throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
186
191
  case 413:
187
192
  throw new NizamDashboard.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). */
@@ -19,6 +19,7 @@ export declare class ImportsClient {
19
19
  * @throws {@link NizamDashboard.BadRequestError}
20
20
  * @throws {@link NizamDashboard.UnauthorizedError}
21
21
  * @throws {@link NizamDashboard.ForbiddenError}
22
+ * @throws {@link NizamDashboard.ConflictError}
22
23
  * @throws {@link NizamDashboard.ContentTooLargeError}
23
24
  * @throws {@link NizamDashboard.UnprocessableEntityError}
24
25
  * @throws {@link NizamDashboard.TooManyRequestsError}
@@ -26,6 +27,7 @@ export declare class ImportsClient {
26
27
  *
27
28
  * @example
28
29
  * await client.imports.createImport({
30
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
29
31
  * kind: "import_fleet_assets_xlsx",
30
32
  * filename: "fleet-assets.xlsx",
31
33
  * content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -55,6 +55,7 @@ class ImportsClient {
55
55
  * @throws {@link NizamDashboard.BadRequestError}
56
56
  * @throws {@link NizamDashboard.UnauthorizedError}
57
57
  * @throws {@link NizamDashboard.ForbiddenError}
58
+ * @throws {@link NizamDashboard.ConflictError}
58
59
  * @throws {@link NizamDashboard.ContentTooLargeError}
59
60
  * @throws {@link NizamDashboard.UnprocessableEntityError}
60
61
  * @throws {@link NizamDashboard.TooManyRequestsError}
@@ -62,6 +63,7 @@ class ImportsClient {
62
63
  *
63
64
  * @example
64
65
  * await client.imports.createImport({
66
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
65
67
  * kind: "import_fleet_assets_xlsx",
66
68
  * filename: "fleet-assets.xlsx",
67
69
  * content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -73,8 +75,9 @@ class ImportsClient {
73
75
  return core.HttpResponsePromise.fromPromise(this.__createImport(request, requestOptions));
74
76
  }
75
77
  async __createImport(request, requestOptions) {
78
+ const { "Idempotency-Key": idempotencyKey, ..._body } = request;
76
79
  const _authRequest = await this._options.authProvider.getAuthRequest();
77
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
80
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
78
81
  const _response = await core.fetcher({
79
82
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
80
83
  (await core.Supplier.get(this._options.environment)) ??
@@ -84,7 +87,7 @@ class ImportsClient {
84
87
  contentType: "application/json",
85
88
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
86
89
  requestType: "json",
87
- body: request,
90
+ body: _body,
88
91
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
89
92
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
90
93
  abortSignal: requestOptions?.abortSignal,
@@ -102,6 +105,8 @@ class ImportsClient {
102
105
  throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
103
106
  case 403:
104
107
  throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
108
+ case 409:
109
+ throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
105
110
  case 413:
106
111
  throw new NizamDashboard.ContentTooLargeError(_response.error.body, _response.rawResponse);
107
112
  case 422:
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
4
5
  * kind: "import_fleet_assets_xlsx",
5
6
  * filename: "fleet-assets.xlsx",
6
7
  * content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
@@ -9,6 +10,8 @@
9
10
  * }
10
11
  */
11
12
  export interface CreateImportRequest {
13
+ /** 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. */
14
+ "Idempotency-Key"?: string;
12
15
  /** The import kind to run (lowercase). */
13
16
  kind: string;
14
17
  /** Original filename of the source file. */
@@ -19,14 +19,17 @@ export declare class InvitesClient {
19
19
  * @param {NizamDashboard.CreateInviteRequest} request
20
20
  * @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration.
21
21
  *
22
+ * @throws {@link NizamDashboard.BadRequestError}
22
23
  * @throws {@link NizamDashboard.UnauthorizedError}
23
24
  * @throws {@link NizamDashboard.ForbiddenError}
25
+ * @throws {@link NizamDashboard.ConflictError}
24
26
  * @throws {@link NizamDashboard.UnprocessableEntityError}
25
27
  * @throws {@link NizamDashboard.TooManyRequestsError}
26
28
  * @throws {@link NizamDashboard.InternalServerError}
27
29
  *
28
30
  * @example
29
31
  * await client.invites.createInvite({
32
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
30
33
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
31
34
  * email: "ali@nizam.ai",
32
35
  * role: "admin"
@@ -34,6 +37,7 @@ export declare class InvitesClient {
34
37
  *
35
38
  * @example
36
39
  * await client.invites.createInvite({
40
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
37
41
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
38
42
  * email: "jordan@example.com",
39
43
  * role: "dispatcher",
@@ -42,6 +46,7 @@ export declare class InvitesClient {
42
46
  *
43
47
  * @example
44
48
  * await client.invites.createInvite({
49
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
45
50
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
46
51
  * email: "auditor@partner.example",
47
52
  * role: "viewer",
@@ -55,14 +55,17 @@ class InvitesClient {
55
55
  * @param {NizamDashboard.CreateInviteRequest} request
56
56
  * @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration.
57
57
  *
58
+ * @throws {@link NizamDashboard.BadRequestError}
58
59
  * @throws {@link NizamDashboard.UnauthorizedError}
59
60
  * @throws {@link NizamDashboard.ForbiddenError}
61
+ * @throws {@link NizamDashboard.ConflictError}
60
62
  * @throws {@link NizamDashboard.UnprocessableEntityError}
61
63
  * @throws {@link NizamDashboard.TooManyRequestsError}
62
64
  * @throws {@link NizamDashboard.InternalServerError}
63
65
  *
64
66
  * @example
65
67
  * await client.invites.createInvite({
68
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
66
69
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
67
70
  * email: "ali@nizam.ai",
68
71
  * role: "admin"
@@ -70,6 +73,7 @@ class InvitesClient {
70
73
  *
71
74
  * @example
72
75
  * await client.invites.createInvite({
76
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
73
77
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
74
78
  * email: "jordan@example.com",
75
79
  * role: "dispatcher",
@@ -78,6 +82,7 @@ class InvitesClient {
78
82
  *
79
83
  * @example
80
84
  * await client.invites.createInvite({
85
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
81
86
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
82
87
  * email: "auditor@partner.example",
83
88
  * role: "viewer",
@@ -88,8 +93,9 @@ class InvitesClient {
88
93
  return core.HttpResponsePromise.fromPromise(this.__createInvite(request, requestOptions));
89
94
  }
90
95
  async __createInvite(request, requestOptions) {
96
+ const { "Idempotency-Key": idempotencyKey, ..._body } = request;
91
97
  const _authRequest = await this._options.authProvider.getAuthRequest();
92
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
98
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
93
99
  const _response = await core.fetcher({
94
100
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
95
101
  (await core.Supplier.get(this._options.environment)) ??
@@ -99,7 +105,7 @@ class InvitesClient {
99
105
  contentType: "application/json",
100
106
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
101
107
  requestType: "json",
102
- body: request,
108
+ body: _body,
103
109
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
104
110
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
105
111
  abortSignal: requestOptions?.abortSignal,
@@ -111,10 +117,14 @@ class InvitesClient {
111
117
  }
112
118
  if (_response.error.reason === "status-code") {
113
119
  switch (_response.error.statusCode) {
120
+ case 400:
121
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
114
122
  case 401:
115
123
  throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
116
124
  case 403:
117
125
  throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
126
+ case 409:
127
+ throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
118
128
  case 422:
119
129
  throw new NizamDashboard.UnprocessableEntityError(_response.error.body, _response.rawResponse);
120
130
  case 429:
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
4
5
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
5
6
  * email: "ali@nizam.ai",
6
7
  * role: "admin"
@@ -8,6 +9,7 @@
8
9
  *
9
10
  * @example
10
11
  * {
12
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
11
13
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
12
14
  * email: "jordan@example.com",
13
15
  * role: "dispatcher",
@@ -16,6 +18,7 @@
16
18
  *
17
19
  * @example
18
20
  * {
21
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
19
22
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
20
23
  * email: "auditor@partner.example",
21
24
  * role: "viewer",
@@ -23,6 +26,8 @@
23
26
  * }
24
27
  */
25
28
  export interface CreateInviteRequest {
29
+ /** 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. */
30
+ "Idempotency-Key"?: string;
26
31
  /** Organization the invite is for. */
27
32
  organization_id: string;
28
33
  /** Recipient email. */
@@ -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=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.
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 {NizamDashboard.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?: NizamDashboard.ListNotificationsRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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 NizamDashboard.BadRequestError}
45
+ * @throws {@link NizamDashboard.UnauthorizedError}
46
+ * @throws {@link NizamDashboard.ForbiddenError}
47
+ * @throws {@link NizamDashboard.TooManyRequestsError}
48
+ * @throws {@link NizamDashboard.InternalServerError}
49
+ *
50
+ * @example
51
+ * await client.notifications.archiveAllNotifications()
52
+ */
53
+ archiveAllNotifications(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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 NizamDashboard.BadRequestError}
61
+ * @throws {@link NizamDashboard.UnauthorizedError}
62
+ * @throws {@link NizamDashboard.ForbiddenError}
63
+ * @throws {@link NizamDashboard.TooManyRequestsError}
64
+ * @throws {@link NizamDashboard.InternalServerError}
65
+ *
66
+ * @example
67
+ * await client.notifications.getNotificationCounts()
68
+ */
69
+ getNotificationCounts(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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<NizamDashboard.NotificationsMarkedRead>;
52
86
  private __markAllNotificationsRead;
53
87
  /**
54
- * The unread badge count for the active organization. Excludes dismissed (soft-deleted) notifications.
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<NizamDashboard.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 {NizamDashboard.ArchiveNotificationRequest} request
107
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
108
+ *
109
+ * @throws {@link NizamDashboard.UnauthorizedError}
110
+ * @throws {@link NizamDashboard.ForbiddenError}
111
+ * @throws {@link NizamDashboard.NotFoundError}
112
+ * @throws {@link NizamDashboard.TooManyRequestsError}
113
+ * @throws {@link NizamDashboard.InternalServerError}
114
+ *
115
+ * @example
116
+ * await client.notifications.archiveNotification({
117
+ * id: "00000000-0000-0000-0000-000000000000"
118
+ * })
119
+ */
120
+ archiveNotification(request: NizamDashboard.ArchiveNotificationRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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: NizamDashboard.MarkNotificationReadRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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 {NizamDashboard.UnarchiveNotificationRequest} request
145
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link NizamDashboard.UnauthorizedError}
148
+ * @throws {@link NizamDashboard.ForbiddenError}
149
+ * @throws {@link NizamDashboard.NotFoundError}
150
+ * @throws {@link NizamDashboard.TooManyRequestsError}
151
+ * @throws {@link NizamDashboard.InternalServerError}
152
+ *
153
+ * @example
154
+ * await client.notifications.unarchiveNotification({
155
+ * id: "00000000-0000-0000-0000-000000000000"
156
+ * })
157
+ */
158
+ unarchiveNotification(request: NizamDashboard.UnarchiveNotificationRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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 {NizamDashboard.MarkNotificationUnreadRequest} request
164
+ * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
165
+ *
166
+ * @throws {@link NizamDashboard.UnauthorizedError}
167
+ * @throws {@link NizamDashboard.ForbiddenError}
168
+ * @throws {@link NizamDashboard.NotFoundError}
169
+ * @throws {@link NizamDashboard.TooManyRequestsError}
170
+ * @throws {@link NizamDashboard.InternalServerError}
171
+ *
172
+ * @example
173
+ * await client.notifications.markNotificationUnread({
174
+ * id: "00000000-0000-0000-0000-000000000000"
175
+ * })
176
+ */
177
+ markNotificationUnread(request: NizamDashboard.MarkNotificationUnreadRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Notification>;
178
+ private __markNotificationUnread;
88
179
  }