@nizam-os/dashboard-sdk 9.0.0 → 11.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 (172) hide show
  1. package/dist/api/resources/activity/client/Client.d.ts +1 -1
  2. package/dist/api/resources/activity/client/Client.js +2 -2
  3. package/dist/api/resources/activity/client/requests/ListActivityRequest.d.ts +3 -2
  4. package/dist/api/resources/activity/index.d.ts +1 -0
  5. package/dist/api/resources/activity/index.js +1 -0
  6. package/dist/api/resources/activity/types/ListActivityRequestSortItem.d.ts +5 -0
  7. package/dist/api/resources/activity/types/ListActivityRequestSortItem.js +8 -0
  8. package/dist/api/resources/activity/types/index.d.ts +1 -0
  9. package/dist/api/resources/activity/types/index.js +17 -0
  10. package/dist/api/resources/assets/client/Client.d.ts +241 -1
  11. package/dist/api/resources/assets/client/Client.js +754 -7
  12. package/dist/api/resources/assets/client/requests/ActivateAssetRequest.d.ts +9 -0
  13. package/dist/api/resources/assets/client/requests/ActivateAssetRequest.js +3 -0
  14. package/dist/api/resources/assets/client/requests/AllowedTransitionsRequest.d.ts +10 -0
  15. package/dist/api/resources/assets/client/requests/AllowedTransitionsRequest.js +3 -0
  16. package/dist/api/resources/assets/client/requests/CreateAssetRequest.d.ts +31 -0
  17. package/dist/api/resources/assets/client/requests/CreateAssetRequest.js +10 -0
  18. package/dist/api/resources/assets/client/requests/DeactivateAssetRequest.d.ts +9 -0
  19. package/dist/api/resources/assets/client/requests/DeactivateAssetRequest.js +3 -0
  20. package/dist/api/resources/assets/client/requests/DeleteAssetRequest.d.ts +9 -0
  21. package/dist/api/resources/assets/client/requests/DeleteAssetRequest.js +3 -0
  22. package/dist/api/resources/assets/client/requests/EnterAssetMaintenanceRequest.d.ts +9 -0
  23. package/dist/api/resources/assets/client/requests/EnterAssetMaintenanceRequest.js +3 -0
  24. package/dist/api/resources/assets/client/requests/ExportAssetsRequest.d.ts +44 -0
  25. package/dist/api/resources/assets/client/requests/ExportAssetsRequest.js +31 -0
  26. package/dist/api/resources/assets/client/requests/ListAssetsRequest.d.ts +13 -6
  27. package/dist/api/resources/assets/client/requests/ReportAssetLostRequest.d.ts +9 -0
  28. package/dist/api/resources/assets/client/requests/ReportAssetLostRequest.js +3 -0
  29. package/dist/api/resources/assets/client/requests/RetireAssetRequest.d.ts +9 -0
  30. package/dist/api/resources/assets/client/requests/RetireAssetRequest.js +3 -0
  31. package/dist/api/resources/assets/client/requests/SellAssetRequest.d.ts +9 -0
  32. package/dist/api/resources/assets/client/requests/SellAssetRequest.js +3 -0
  33. package/dist/api/resources/assets/client/requests/TakeAssetOutOfServiceRequest.d.ts +9 -0
  34. package/dist/api/resources/assets/client/requests/TakeAssetOutOfServiceRequest.js +3 -0
  35. package/dist/api/resources/assets/client/requests/UpdateAssetRequest.d.ts +36 -0
  36. package/dist/api/resources/assets/client/requests/UpdateAssetRequest.js +3 -0
  37. package/dist/api/resources/assets/client/requests/index.d.ts +11 -0
  38. package/dist/api/resources/assets/client/requests/index.js +3 -1
  39. package/dist/api/resources/assets/index.d.ts +1 -0
  40. package/dist/api/resources/assets/index.js +1 -0
  41. package/dist/api/resources/assets/types/ListAssetsRequestKindItem.d.ts +12 -0
  42. package/dist/api/resources/assets/types/ListAssetsRequestKindItem.js +15 -0
  43. package/dist/api/resources/assets/types/ListAssetsRequestSortItem.d.ts +25 -0
  44. package/dist/api/resources/assets/types/ListAssetsRequestSortItem.js +28 -0
  45. package/dist/api/resources/assets/types/ListAssetsRequestStatusItem.d.ts +10 -0
  46. package/dist/api/resources/assets/types/ListAssetsRequestStatusItem.js +13 -0
  47. package/dist/api/resources/assets/types/index.d.ts +3 -0
  48. package/dist/api/resources/assets/types/index.js +19 -0
  49. package/dist/api/resources/assignments/client/Client.d.ts +2 -0
  50. package/dist/api/resources/assignments/client/Client.js +5 -2
  51. package/dist/api/resources/assignments/client/requests/OpenAssignmentRequest.d.ts +4 -0
  52. package/dist/api/resources/files/client/Client.d.ts +3 -1
  53. package/dist/api/resources/files/client/Client.js +11 -6
  54. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +4 -0
  55. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.js +1 -0
  56. package/dist/api/resources/files/client/requests/ListFilesRequest.d.ts +7 -6
  57. package/dist/api/resources/files/index.d.ts +1 -0
  58. package/dist/api/resources/files/index.js +1 -0
  59. package/dist/api/resources/files/types/ListFilesRequestKindItem.d.ts +11 -0
  60. package/dist/api/resources/files/types/ListFilesRequestKindItem.js +14 -0
  61. package/dist/api/resources/files/types/ListFilesRequestSortItem.d.ts +5 -0
  62. package/dist/api/resources/files/types/ListFilesRequestSortItem.js +8 -0
  63. package/dist/api/resources/files/types/ListFilesRequestStatusItem.d.ts +6 -0
  64. package/dist/api/resources/files/types/ListFilesRequestStatusItem.js +9 -0
  65. package/dist/api/resources/files/types/index.d.ts +3 -0
  66. package/dist/api/resources/files/types/index.js +19 -0
  67. package/dist/api/resources/imports/client/Client.d.ts +2 -0
  68. package/dist/api/resources/imports/client/Client.js +7 -2
  69. package/dist/api/resources/imports/client/requests/CreateImportRequest.d.ts +3 -0
  70. package/dist/api/resources/index.d.ts +7 -0
  71. package/dist/api/resources/index.js +7 -0
  72. package/dist/api/resources/invites/client/Client.d.ts +5 -0
  73. package/dist/api/resources/invites/client/Client.js +12 -2
  74. package/dist/api/resources/invites/client/requests/CreateInviteRequest.d.ts +5 -0
  75. package/dist/api/resources/jobs/client/Client.d.ts +1 -1
  76. package/dist/api/resources/jobs/client/Client.js +2 -2
  77. package/dist/api/resources/jobs/client/requests/ListJobsRequest.d.ts +3 -2
  78. package/dist/api/resources/jobs/index.d.ts +1 -0
  79. package/dist/api/resources/jobs/index.js +1 -0
  80. package/dist/api/resources/jobs/types/ListJobsRequestSortItem.d.ts +5 -0
  81. package/dist/api/resources/jobs/types/ListJobsRequestSortItem.js +8 -0
  82. package/dist/api/resources/jobs/types/index.d.ts +1 -0
  83. package/dist/api/resources/jobs/types/index.js +17 -0
  84. package/dist/api/resources/notifications/client/Client.d.ts +1 -1
  85. package/dist/api/resources/notifications/client/Client.js +2 -2
  86. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +3 -2
  87. package/dist/api/resources/notifications/index.d.ts +1 -0
  88. package/dist/api/resources/notifications/index.js +1 -0
  89. package/dist/api/resources/notifications/types/ListNotificationsRequestSortItem.d.ts +5 -0
  90. package/dist/api/resources/notifications/types/ListNotificationsRequestSortItem.js +8 -0
  91. package/dist/api/resources/notifications/types/index.d.ts +1 -0
  92. package/dist/api/resources/notifications/types/index.js +17 -0
  93. package/dist/api/resources/operators/client/Client.d.ts +21 -11
  94. package/dist/api/resources/operators/client/Client.js +25 -12
  95. package/dist/api/resources/operators/client/requests/CreateOperatorBody.d.ts +37 -0
  96. package/dist/api/resources/operators/client/requests/CreateOperatorBody.js +3 -0
  97. package/dist/api/resources/operators/client/requests/index.d.ts +1 -0
  98. package/dist/api/resources/organizations/client/Client.d.ts +3 -3
  99. package/dist/api/resources/organizations/client/Client.js +7 -6
  100. package/dist/api/resources/organizations/client/requests/CreateOrganizationRequest.d.ts +4 -0
  101. package/dist/api/resources/organizations/client/requests/ListOrganizationsRequest.d.ts +3 -2
  102. package/dist/api/resources/organizations/index.d.ts +1 -0
  103. package/dist/api/resources/organizations/index.js +1 -0
  104. package/dist/api/resources/organizations/types/ListOrganizationsRequestSortItem.d.ts +5 -0
  105. package/dist/api/resources/organizations/types/ListOrganizationsRequestSortItem.js +8 -0
  106. package/dist/api/resources/organizations/types/index.d.ts +1 -0
  107. package/dist/api/resources/organizations/types/index.js +17 -0
  108. package/dist/api/resources/taskAttempts/client/Client.d.ts +2 -0
  109. package/dist/api/resources/taskAttempts/client/Client.js +6 -2
  110. package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.d.ts +3 -0
  111. package/dist/api/resources/users/client/Client.d.ts +4 -1
  112. package/dist/api/resources/users/client/Client.js +10 -4
  113. package/dist/api/resources/users/client/requests/InviteUserRequest.d.ts +4 -0
  114. package/dist/api/resources/users/client/requests/ListUsersRequest.d.ts +3 -2
  115. package/dist/api/resources/users/index.d.ts +1 -0
  116. package/dist/api/resources/users/index.js +1 -0
  117. package/dist/api/resources/users/types/ListUsersRequestSortItem.d.ts +7 -0
  118. package/dist/api/resources/users/types/ListUsersRequestSortItem.js +10 -0
  119. package/dist/api/resources/users/types/index.d.ts +1 -0
  120. package/dist/api/resources/users/types/index.js +17 -0
  121. package/dist/api/types/ActiveOrganization.d.ts +2 -2
  122. package/dist/api/types/ActivityResource.d.ts +4 -4
  123. package/dist/api/types/AllowedTransitions.d.ts +28 -0
  124. package/dist/api/types/AllowedTransitions.js +23 -0
  125. package/dist/api/types/ApiFieldError.d.ts +1 -1
  126. package/dist/api/types/Asset.d.ts +26 -4
  127. package/dist/api/types/Asset.js +13 -0
  128. package/dist/api/types/AssetListItem.d.ts +11 -5
  129. package/dist/api/types/Assignment.d.ts +6 -6
  130. package/dist/api/types/BulkJobSubmission.d.ts +3 -3
  131. package/dist/api/types/BusinessCategory.d.ts +3 -3
  132. package/dist/api/types/Country.d.ts +3 -3
  133. package/dist/api/types/Currency.d.ts +5 -5
  134. package/dist/api/types/Device.d.ts +21 -6
  135. package/dist/api/types/Device.js +13 -0
  136. package/dist/api/types/Devices.d.ts +2 -2
  137. package/dist/api/types/FileDownloadUrl.d.ts +4 -4
  138. package/dist/api/types/FileUploadSession.d.ts +12 -11
  139. package/dist/api/types/FileUploadSession.js +1 -0
  140. package/dist/api/types/File_.d.ts +14 -13
  141. package/dist/api/types/File_.js +1 -0
  142. package/dist/api/types/HeatmapCell.d.ts +4 -4
  143. package/dist/api/types/ImportError.d.ts +4 -4
  144. package/dist/api/types/ImportSubmission.d.ts +4 -4
  145. package/dist/api/types/Invite.d.ts +8 -8
  146. package/dist/api/types/Job.d.ts +11 -11
  147. package/dist/api/types/JobSubmission.d.ts +2 -2
  148. package/dist/api/types/Language.d.ts +4 -4
  149. package/dist/api/types/Membership.d.ts +3 -3
  150. package/dist/api/types/MqttToken.d.ts +4 -4
  151. package/dist/api/types/Notification.d.ts +9 -9
  152. package/dist/api/types/NotificationCounts.d.ts +5 -5
  153. package/dist/api/types/NotificationDeadLetter.d.ts +9 -9
  154. package/dist/api/types/NotificationPreferences.d.ts +2 -2
  155. package/dist/api/types/NotificationUnreadCount.d.ts +2 -2
  156. package/dist/api/types/NotificationsArchived.d.ts +2 -2
  157. package/dist/api/types/NotificationsMarkedRead.d.ts +2 -2
  158. package/dist/api/types/Operator.d.ts +4 -4
  159. package/dist/api/types/OperatorPosition.d.ts +5 -5
  160. package/dist/api/types/Organization.d.ts +7 -7
  161. package/dist/api/types/Position.d.ts +6 -6
  162. package/dist/api/types/ProblemDetail.d.ts +1 -1
  163. package/dist/api/types/RealtimeTicket.d.ts +3 -3
  164. package/dist/api/types/ReconcileResponse.d.ts +4 -4
  165. package/dist/api/types/TaskAttemptPhoto.d.ts +7 -7
  166. package/dist/api/types/Timezone.d.ts +4 -4
  167. package/dist/api/types/UploadInitiation.d.ts +6 -6
  168. package/dist/api/types/User.d.ts +5 -5
  169. package/dist/api/types/UserResource.d.ts +4 -4
  170. package/dist/api/types/index.d.ts +1 -0
  171. package/dist/api/types/index.js +1 -0
  172. package/package.json +1 -1
@@ -190,7 +190,7 @@ class UsersClient {
190
190
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/me/profile-picture");
191
191
  }
192
192
  /**
193
- * Dashboard sees co-members of the caller's active organization (tenant-scoped via the organization_users join). Platform staff bypass RLS and see across tenants. Allowed sort fields: `created_at`, `name` (prefix with `-` for descending). RFC 8288 Link header carries `first`, `prev`, `next` rels alongside the body's bidirectional cursors.
193
+ * Dashboard sees co-members of the caller's active organization (tenant-scoped via the organization_users join). Platform staff bypass RLS and see across tenants. The sortable fields and direction grammar are on the `sort` parameter. RFC 8288 Link header carries `first`, `prev`, `next` rels alongside the body's bidirectional cursors.
194
194
  *
195
195
  * @param {NizamDashboard.ListUsersRequest} request
196
196
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -213,7 +213,7 @@ class UsersClient {
213
213
  async __listUsers(request = {}, requestOptions) {
214
214
  const { sort, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
215
215
  const _queryParams = {
216
- sort,
216
+ sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
217
217
  limit,
218
218
  starting_after: startingAfter,
219
219
  ending_before: endingBefore,
@@ -271,6 +271,7 @@ class UsersClient {
271
271
  * @param {NizamDashboard.InviteUserRequest} request
272
272
  * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
273
273
  *
274
+ * @throws {@link NizamDashboard.BadRequestError}
274
275
  * @throws {@link NizamDashboard.UnauthorizedError}
275
276
  * @throws {@link NizamDashboard.ForbiddenError}
276
277
  * @throws {@link NizamDashboard.ConflictError}
@@ -280,12 +281,14 @@ class UsersClient {
280
281
  *
281
282
  * @example
282
283
  * await client.users.inviteUser({
284
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
283
285
  * email: "newhire@acme.example",
284
286
  * name: "New Hire"
285
287
  * })
286
288
  *
287
289
  * @example
288
290
  * await client.users.inviteUser({
291
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
289
292
  * email: "newhire@acme.example"
290
293
  * })
291
294
  */
@@ -293,8 +296,9 @@ class UsersClient {
293
296
  return core.HttpResponsePromise.fromPromise(this.__inviteUser(request, requestOptions));
294
297
  }
295
298
  async __inviteUser(request, requestOptions) {
299
+ const { "Idempotency-Key": idempotencyKey, ..._body } = request;
296
300
  const _authRequest = await this._options.authProvider.getAuthRequest();
297
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
301
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
298
302
  const _response = await core.fetcher({
299
303
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
300
304
  (await core.Supplier.get(this._options.environment)) ??
@@ -304,7 +308,7 @@ class UsersClient {
304
308
  contentType: "application/json",
305
309
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
306
310
  requestType: "json",
307
- body: request,
311
+ body: _body,
308
312
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
309
313
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
310
314
  abortSignal: requestOptions?.abortSignal,
@@ -316,6 +320,8 @@ class UsersClient {
316
320
  }
317
321
  if (_response.error.reason === "status-code") {
318
322
  switch (_response.error.statusCode) {
323
+ case 400:
324
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
319
325
  case 401:
320
326
  throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
321
327
  case 403:
@@ -1,16 +1,20 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
4
5
  * email: "newhire@acme.example",
5
6
  * name: "New Hire"
6
7
  * }
7
8
  *
8
9
  * @example
9
10
  * {
11
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
10
12
  * email: "newhire@acme.example"
11
13
  * }
12
14
  */
13
15
  export interface InviteUserRequest {
16
+ /** 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. */
17
+ "Idempotency-Key"?: string;
14
18
  /** Recipient email. */
15
19
  email: string;
16
20
  /** Display name (optional). */
@@ -1,3 +1,4 @@
1
+ import type * as NizamDashboard from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -6,8 +7,8 @@
6
7
  * }
7
8
  */
8
9
  export interface ListUsersRequest {
9
- /** Sort order. Allowed fields: `created_at`, `name`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
10
- sort?: string | string[];
10
+ /** Sort order. Allowed fields: `created_at`, `name`. Append `:asc` or `:desc` to each field (direction required, e.g. `created_at:desc`), comma-separated for multi-sort; unknown fields or directions are rejected with `400 validation_failed`. */
11
+ sort?: NizamDashboard.ListUsersRequestSortItem | NizamDashboard.ListUsersRequestSortItem[];
11
12
  /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
12
13
  limit?: number;
13
14
  /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
@@ -1 +1,2 @@
1
1
  export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,7 @@
1
+ export declare const ListUsersRequestSortItem: {
2
+ readonly CreatedAtAsc: "created_at:asc";
3
+ readonly CreatedAtDesc: "created_at:desc";
4
+ readonly NameAsc: "name:asc";
5
+ readonly NameDesc: "name:desc";
6
+ };
7
+ export type ListUsersRequestSortItem = (typeof ListUsersRequestSortItem)[keyof typeof ListUsersRequestSortItem];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ListUsersRequestSortItem = void 0;
5
+ exports.ListUsersRequestSortItem = {
6
+ CreatedAtAsc: "created_at:asc",
7
+ CreatedAtDesc: "created_at:desc",
8
+ NameAsc: "name:asc",
9
+ NameDesc: "name:desc",
10
+ };
@@ -0,0 +1 @@
1
+ export * from "./ListUsersRequestSortItem.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("./ListUsersRequestSortItem.js"), exports);
@@ -8,9 +8,9 @@ export interface ActiveOrganization {
8
8
  /** Stored preference (users.last_active_organization_id). Null when the user has never picked. */
9
9
  preferred_organization_id?: string | undefined;
10
10
  /** All active memberships for the picker UI. */
11
- memberships?: NizamDashboard.MembershipChoice[] | undefined;
11
+ memberships: NizamDashboard.MembershipChoice[];
12
12
  /** Object type discriminator. */
13
- object?: ActiveOrganization.Object_ | undefined;
13
+ object: ActiveOrganization.Object_;
14
14
  }
15
15
  export declare namespace ActiveOrganization {
16
16
  /** Object type discriminator. */
@@ -3,13 +3,13 @@
3
3
  */
4
4
  export interface ActivityResource {
5
5
  /** Stable UUID of this activity row — the resource id and pagination key. */
6
- id?: string | undefined;
6
+ id: string;
7
7
  /** Per-publication idempotency key — equal to the realtime ActivityFeedItem's `id` for the same event, so a client can dedupe realtime against REST. Null for directly-written audit rows. */
8
8
  event_id?: string | undefined;
9
9
  /** Canonical event verb. */
10
10
  event?: ActivityResource.Event | undefined;
11
11
  /** Human-readable narrative shown in the feed UI. */
12
- description?: string | undefined;
12
+ description: string;
13
13
  /** Type of the entity the action targeted (polymorphic subject). */
14
14
  subject_type?: string | undefined;
15
15
  /** Id of the entity the action targeted. */
@@ -21,9 +21,9 @@ export interface ActivityResource {
21
21
  /** Optional UI filtering bucket. */
22
22
  log_name?: string | undefined;
23
23
  /** When the activity was recorded — the authoritative timestamp. */
24
- occurred_at?: string | undefined;
24
+ occurred_at: string;
25
25
  /** Object type discriminator. */
26
- object?: ActivityResource.Object_ | undefined;
26
+ object: ActivityResource.Object_;
27
27
  }
28
28
  export declare namespace ActivityResource {
29
29
  /** Canonical event verb. */
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The lifecycle status transitions legal for an entire asset selection.
3
+ */
4
+ export interface AllowedTransitions {
5
+ /** Statuses every selected asset may move to next (the intersection of their legal-transition sets); empty if they share none. */
6
+ allowed_transitions: AllowedTransitions.AllowedTransitions.Item[];
7
+ object: AllowedTransitions.Object_;
8
+ }
9
+ export declare namespace AllowedTransitions {
10
+ type AllowedTransitions = AllowedTransitions.Item[];
11
+ namespace AllowedTransitions {
12
+ /** A legal next status. */
13
+ const Item: {
14
+ readonly Active: "active";
15
+ readonly Maintenance: "maintenance";
16
+ readonly OutOfService: "out_of_service";
17
+ readonly Retired: "retired";
18
+ readonly Sold: "sold";
19
+ readonly Inactive: "inactive";
20
+ readonly Lost: "lost";
21
+ };
22
+ type Item = (typeof Item)[keyof typeof Item];
23
+ }
24
+ const Object_: {
25
+ readonly AllowedTransitions: "allowed_transitions";
26
+ };
27
+ type Object_ = (typeof Object_)[keyof typeof Object_];
28
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AllowedTransitions = void 0;
5
+ var AllowedTransitions;
6
+ (function (AllowedTransitions_1) {
7
+ let AllowedTransitions;
8
+ (function (AllowedTransitions) {
9
+ /** A legal next status. */
10
+ AllowedTransitions.Item = {
11
+ Active: "active",
12
+ Maintenance: "maintenance",
13
+ OutOfService: "out_of_service",
14
+ Retired: "retired",
15
+ Sold: "sold",
16
+ Inactive: "inactive",
17
+ Lost: "lost",
18
+ };
19
+ })(AllowedTransitions = AllowedTransitions_1.AllowedTransitions || (AllowedTransitions_1.AllowedTransitions = {}));
20
+ AllowedTransitions_1.Object_ = {
21
+ AllowedTransitions: "allowed_transitions",
22
+ };
23
+ })(AllowedTransitions || (exports.AllowedTransitions = AllowedTransitions = {}));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * One field-level entry inside a 422 validation problem.
2
+ * One field-level error entry present on 422 validation failures and on field-level 409 conflicts.
3
3
  */
4
4
  export interface ApiFieldError {
5
5
  /** Dot-notated JSON path matching the request shape. */
@@ -3,27 +3,35 @@
3
3
  */
4
4
  export interface Asset {
5
5
  /** Stable UUID. */
6
- id?: string | undefined;
6
+ id: string;
7
7
  /** Top-level kind. */
8
- kind?: Asset.Kind | undefined;
8
+ kind: Asset.Kind;
9
9
  /** Sub-kind within the kind (free-form). */
10
10
  sub_kind?: string | undefined;
11
11
  /** SAE J3016 autonomy level 0..5. */
12
12
  autonomy_level?: number | undefined;
13
13
  /** Lifecycle status. */
14
- status?: Asset.Status | undefined;
14
+ status: Asset.Status;
15
15
  /** Display name. */
16
16
  name?: string | undefined;
17
17
  /** Vehicle Identification Number. */
18
18
  vin?: string | undefined;
19
19
  /** License plate. */
20
20
  plate_number?: string | undefined;
21
+ /** Manufacturer. */
22
+ make?: string | undefined;
23
+ /** Model designation. */
24
+ model?: string | undefined;
25
+ /** Model year. */
26
+ year?: number | undefined;
21
27
  /** Owning organization id. */
22
28
  organization_id?: string | undefined;
23
29
  /** Current primary operator (active assignment, role=primary). */
24
30
  current_primary_operator_id?: string | undefined;
31
+ /** Lifecycle statuses this asset may move to next — the wire projection of the server-side transition matrix, derived from `status`. The status picker offers exactly these; empty for a terminal status (sold, lost). */
32
+ allowed_transitions: Asset.AllowedTransitions.Item[];
25
33
  /** Object type discriminator. */
26
- object?: Asset.Object_ | undefined;
34
+ object: Asset.Object_;
27
35
  }
28
36
  export declare namespace Asset {
29
37
  /** Top-level kind. */
@@ -50,6 +58,20 @@ export declare namespace Asset {
50
58
  readonly Lost: "lost";
51
59
  };
52
60
  type Status = (typeof Status)[keyof typeof Status];
61
+ type AllowedTransitions = AllowedTransitions.Item[];
62
+ namespace AllowedTransitions {
63
+ /** A legal next status. */
64
+ const Item: {
65
+ readonly Active: "active";
66
+ readonly Maintenance: "maintenance";
67
+ readonly OutOfService: "out_of_service";
68
+ readonly Retired: "retired";
69
+ readonly Sold: "sold";
70
+ readonly Inactive: "inactive";
71
+ readonly Lost: "lost";
72
+ };
73
+ type Item = (typeof Item)[keyof typeof Item];
74
+ }
53
75
  /** Object type discriminator. */
54
76
  const Object_: {
55
77
  readonly Asset: "asset";
@@ -26,6 +26,19 @@ var Asset;
26
26
  Inactive: "inactive",
27
27
  Lost: "lost",
28
28
  };
29
+ let AllowedTransitions;
30
+ (function (AllowedTransitions) {
31
+ /** A legal next status. */
32
+ AllowedTransitions.Item = {
33
+ Active: "active",
34
+ Maintenance: "maintenance",
35
+ OutOfService: "out_of_service",
36
+ Retired: "retired",
37
+ Sold: "sold",
38
+ Inactive: "inactive",
39
+ Lost: "lost",
40
+ };
41
+ })(AllowedTransitions = Asset.AllowedTransitions || (Asset.AllowedTransitions = {}));
29
42
  /** Object type discriminator. */
30
43
  Asset.Object_ = {
31
44
  Asset: "asset",
@@ -3,21 +3,27 @@
3
3
  */
4
4
  export interface AssetListItem {
5
5
  /** Stable UUID. */
6
- id?: string | undefined;
6
+ id: string;
7
7
  /** Top-level kind. */
8
- kind?: AssetListItem.Kind | undefined;
8
+ kind: AssetListItem.Kind;
9
9
  /** Sub-kind within the kind (free-form). */
10
10
  sub_kind?: string | undefined;
11
11
  /** SAE J3016 autonomy level 0..5. */
12
12
  autonomy_level?: number | undefined;
13
13
  /** Lifecycle status. */
14
- status?: AssetListItem.Status | undefined;
14
+ status: AssetListItem.Status;
15
15
  /** Display name. */
16
16
  name?: string | undefined;
17
17
  /** Vehicle Identification Number. */
18
18
  vin?: string | undefined;
19
19
  /** License plate. */
20
20
  plate_number?: string | undefined;
21
+ /** Manufacturer. */
22
+ make?: string | undefined;
23
+ /** Model designation. */
24
+ model?: string | undefined;
25
+ /** Model year. */
26
+ year?: number | undefined;
21
27
  /** Owning organization id. */
22
28
  organization_id?: string | undefined;
23
29
  /** Current primary operator (active assignment, role=primary). */
@@ -25,11 +31,11 @@ export interface AssetListItem {
25
31
  /** Creation timestamp (ISO-8601 UTC). */
26
32
  created_at?: string | undefined;
27
33
  /** Relevance score (descending) when the request carried `q`; 0 for plain listings. Scores are only comparable within a single response. */
28
- rank?: number | undefined;
34
+ rank: number;
29
35
  /** Highlighted match fragment when the request carried `q&highlight=true`. Matched terms are wrapped in `<mark>…</mark>`. */
30
36
  snippet?: string | undefined;
31
37
  /** Object type discriminator. */
32
- object?: AssetListItem.Object_ | undefined;
38
+ object: AssetListItem.Object_;
33
39
  }
34
40
  export declare namespace AssetListItem {
35
41
  /** Top-level kind. */
@@ -3,21 +3,21 @@
3
3
  */
4
4
  export interface Assignment {
5
5
  /** Stable UUID. */
6
- id?: string | undefined;
6
+ id: string;
7
7
  /** Asset id. */
8
- asset_id?: string | undefined;
8
+ asset_id: string;
9
9
  /** Operator id. */
10
- operator_id?: string | undefined;
10
+ operator_id: string;
11
11
  /** Role discriminator for concurrent assignments on the same asset. */
12
- role?: Assignment.Role | undefined;
12
+ role: Assignment.Role;
13
13
  /** Start of validity. */
14
- valid_from?: string | undefined;
14
+ valid_from: string;
15
15
  /** End of validity (null = still active). */
16
16
  valid_until?: string | undefined;
17
17
  /** Why the assignment was closed (null while active). */
18
18
  terminated_reason?: Assignment.TerminatedReason | undefined;
19
19
  /** Object type discriminator. */
20
- object?: Assignment.Object_ | undefined;
20
+ object: Assignment.Object_;
21
21
  }
22
22
  export declare namespace Assignment {
23
23
  /** Role discriminator for concurrent assignments on the same asset. */
@@ -2,10 +2,10 @@
2
2
  * Acknowledgement of a bulk admin action that fanned out one job per work item.
3
3
  */
4
4
  export interface BulkJobSubmission {
5
- job_ids?: string[] | undefined;
5
+ job_ids: string[];
6
6
  /** Number of jobs created (one per matched service account). */
7
- count?: number | undefined;
8
- object?: BulkJobSubmission.Object_ | undefined;
7
+ count: number;
8
+ object: BulkJobSubmission.Object_;
9
9
  }
10
10
  export declare namespace BulkJobSubmission {
11
11
  const Object_: {
@@ -3,11 +3,11 @@
3
3
  */
4
4
  export interface BusinessCategory {
5
5
  /** Stable slug — matches the DB CHECK constraint on `organizations.business_category`. */
6
- slug?: string | undefined;
6
+ slug: string;
7
7
  /** Human-readable label for picker UIs. */
8
- display_name?: string | undefined;
8
+ display_name: string;
9
9
  /** Object type discriminator. */
10
- object?: BusinessCategory.Object_ | undefined;
10
+ object: BusinessCategory.Object_;
11
11
  }
12
12
  export declare namespace BusinessCategory {
13
13
  /** Object type discriminator. */
@@ -3,13 +3,13 @@
3
3
  */
4
4
  export interface Country {
5
5
  /** ISO 3166-1 alpha-2 code. */
6
- code?: string | undefined;
6
+ code: string;
7
7
  /** Display name in the Accept-Language locale. */
8
- name?: string | undefined;
8
+ name: string;
9
9
  /** E.164 country calling code with `+` prefix, or null if not allocated. */
10
10
  calling_code?: string | undefined;
11
11
  /** Object type discriminator. */
12
- object?: Country.Object_ | undefined;
12
+ object: Country.Object_;
13
13
  }
14
14
  export declare namespace Country {
15
15
  /** Object type discriminator. */
@@ -3,15 +3,15 @@
3
3
  */
4
4
  export interface Currency {
5
5
  /** ISO 4217 code. */
6
- code?: string | undefined;
6
+ code: string;
7
7
  /** Display name in the Accept-Language locale. */
8
- name?: string | undefined;
8
+ name: string;
9
9
  /** Short symbol in the Accept-Language locale. */
10
- symbol?: string | undefined;
10
+ symbol: string;
11
11
  /** Default number of fractional digits per ISO 4217. */
12
- fraction_digits?: number | undefined;
12
+ fraction_digits: number;
13
13
  /** Object type discriminator. */
14
- object?: Currency.Object_ | undefined;
14
+ object: Currency.Object_;
15
15
  }
16
16
  export declare namespace Currency {
17
17
  /** Object type discriminator. */
@@ -3,19 +3,34 @@
3
3
  */
4
4
  export interface Device {
5
5
  /** Device id. */
6
- id?: string | undefined;
6
+ id: string;
7
7
  /** Push transport. */
8
- platform?: string | undefined;
8
+ platform: Device.Platform;
9
9
  /** Registration lifecycle. */
10
- status?: string | undefined;
10
+ status: Device.Status;
11
11
  /** When the device was first registered. */
12
- registered_at?: string | undefined;
12
+ registered_at: string;
13
13
  /** When the registration was last refreshed (last seen). */
14
- last_seen_at?: string | undefined;
14
+ last_seen_at: string;
15
15
  /** Object type discriminator. */
16
- object?: Device.Object_ | undefined;
16
+ object: Device.Object_;
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";
@@ -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",
@@ -4,9 +4,9 @@ import type * as NizamDashboard from "../index.js";
4
4
  */
5
5
  export interface Devices {
6
6
  /** The caller's live device registrations. */
7
- devices?: NizamDashboard.Device[] | undefined;
7
+ devices: NizamDashboard.Device[];
8
8
  /** Object type discriminator. */
9
- object?: Devices.Object_ | undefined;
9
+ object: Devices.Object_;
10
10
  }
11
11
  export declare namespace Devices {
12
12
  /** Object type discriminator. */
@@ -1,12 +1,12 @@
1
1
  /**
2
- * A short-lived URL granting read access to the file's bytes. Fetch it promptly — request a fresh grant after expiry.
2
+ * A short-lived URL granting read access to a file's bytes. Fetch it promptly — request a fresh grant after expiry.
3
3
  */
4
4
  export interface FileDownloadUrl {
5
5
  /** The URL to GET the bytes from. */
6
- url?: string | undefined;
6
+ url: string;
7
7
  /** When the URL stops working. */
8
- expires_at?: string | undefined;
9
- object?: FileDownloadUrl.Object_ | undefined;
8
+ expires_at: string;
9
+ object: FileDownloadUrl.Object_;
10
10
  }
11
11
  export declare namespace FileDownloadUrl {
12
12
  const Object_: {
@@ -4,24 +4,24 @@ import type * as NizamDashboard from "../index.js";
4
4
  */
5
5
  export interface FileUploadSession {
6
6
  /** Session id — the handle for resume / complete / cancel. */
7
- id?: string | undefined;
7
+ id: string;
8
8
  /** Pre-reserved id of the file this upload will become. */
9
- file_id?: string | undefined;
9
+ file_id: string;
10
10
  /** The kind declared at initiation. */
11
- kind?: FileUploadSession.Kind | undefined;
11
+ kind: FileUploadSession.Kind;
12
12
  /** Session lifecycle. */
13
- status?: FileUploadSession.Status | undefined;
13
+ status: FileUploadSession.Status;
14
14
  /** Nominal part size; every part except the last must be exactly this size. */
15
- part_size_bytes?: number | undefined;
15
+ part_size_bytes: number;
16
16
  /** Total parts in the layout. */
17
- part_count?: number | undefined;
17
+ part_count: number;
18
18
  /** Bytes confirmed so far (client-reported, re-verified at completion). */
19
- bytes_uploaded?: number | undefined;
20
- completed_part_numbers?: number[] | undefined;
21
- parts?: NizamDashboard.FileUploadPart[] | undefined;
19
+ bytes_uploaded: number;
20
+ completed_part_numbers: number[];
21
+ parts: NizamDashboard.FileUploadPart[];
22
22
  /** Deadline: the session expires and is swept if not completed by then. */
23
- expires_at?: string | undefined;
24
- object?: FileUploadSession.Object_ | undefined;
23
+ expires_at: string;
24
+ object: FileUploadSession.Object_;
25
25
  }
26
26
  export declare namespace FileUploadSession {
27
27
  /** The kind declared at initiation. */
@@ -33,6 +33,7 @@ export declare namespace FileUploadSession {
33
33
  readonly ImportReport: "import_report";
34
34
  readonly SignedDocument: "signed_document";
35
35
  readonly ProductImage: "product_image";
36
+ readonly DataExport: "data_export";
36
37
  };
37
38
  type Kind = (typeof Kind)[keyof typeof Kind];
38
39
  /** Session lifecycle. */
@@ -13,6 +13,7 @@ var FileUploadSession;
13
13
  ImportReport: "import_report",
14
14
  SignedDocument: "signed_document",
15
15
  ProductImage: "product_image",
16
+ DataExport: "data_export",
16
17
  };
17
18
  /** Session lifecycle. */
18
19
  FileUploadSession.Status = {