@nizam-os/operator-sdk 3.0.0 → 5.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 (89) hide show
  1. package/dist/api/resources/files/client/Client.d.ts +3 -1
  2. package/dist/api/resources/files/client/Client.js +11 -6
  3. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +4 -0
  4. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.js +1 -0
  5. package/dist/api/resources/files/client/requests/ListFilesRequest.d.ts +7 -6
  6. package/dist/api/resources/files/index.d.ts +1 -0
  7. package/dist/api/resources/files/index.js +1 -0
  8. package/dist/api/resources/files/types/ListFilesRequestKindItem.d.ts +11 -0
  9. package/dist/api/resources/files/types/ListFilesRequestKindItem.js +14 -0
  10. package/dist/api/resources/files/types/ListFilesRequestSortItem.d.ts +5 -0
  11. package/dist/api/resources/files/types/ListFilesRequestSortItem.js +8 -0
  12. package/dist/api/resources/files/types/ListFilesRequestStatusItem.d.ts +6 -0
  13. package/dist/api/resources/files/types/ListFilesRequestStatusItem.js +9 -0
  14. package/dist/api/resources/files/types/index.d.ts +3 -0
  15. package/dist/api/resources/files/types/index.js +19 -0
  16. package/dist/api/resources/index.d.ts +2 -0
  17. package/dist/api/resources/index.js +2 -0
  18. package/dist/api/resources/notifications/client/Client.d.ts +1 -1
  19. package/dist/api/resources/notifications/client/Client.js +2 -2
  20. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +3 -2
  21. package/dist/api/resources/notifications/index.d.ts +1 -0
  22. package/dist/api/resources/notifications/index.js +1 -0
  23. package/dist/api/resources/notifications/types/ListNotificationsRequestSortItem.d.ts +5 -0
  24. package/dist/api/resources/notifications/types/ListNotificationsRequestSortItem.js +8 -0
  25. package/dist/api/resources/notifications/types/index.d.ts +1 -0
  26. package/dist/api/resources/notifications/types/index.js +17 -0
  27. package/dist/api/resources/taskAttempts/client/Client.d.ts +2 -0
  28. package/dist/api/resources/taskAttempts/client/Client.js +6 -2
  29. package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.d.ts +3 -0
  30. package/dist/api/types/ActiveOrganization.d.ts +2 -2
  31. package/dist/api/types/ActivityResource.d.ts +4 -4
  32. package/dist/api/types/AllowedTransitions.d.ts +28 -0
  33. package/dist/api/types/AllowedTransitions.js +23 -0
  34. package/dist/api/types/AllowedTransitionsRequest.d.ts +7 -0
  35. package/dist/api/types/AllowedTransitionsRequest.js +3 -0
  36. package/dist/api/types/ApiFieldError.d.ts +1 -1
  37. package/dist/api/types/Asset.d.ts +26 -4
  38. package/dist/api/types/Asset.js +13 -0
  39. package/dist/api/types/AssetListItem.d.ts +11 -5
  40. package/dist/api/types/Assignment.d.ts +6 -6
  41. package/dist/api/types/BulkJobSubmission.d.ts +3 -3
  42. package/dist/api/types/BusinessCategory.d.ts +3 -3
  43. package/dist/api/types/Country.d.ts +3 -3
  44. package/dist/api/types/CreateAssetRequest.d.ts +25 -0
  45. package/dist/api/types/CreateAssetRequest.js +10 -0
  46. package/dist/api/types/Currency.d.ts +5 -5
  47. package/dist/api/types/Device.d.ts +21 -6
  48. package/dist/api/types/Device.js +13 -0
  49. package/dist/api/types/Devices.d.ts +2 -2
  50. package/dist/api/types/ExportAssetsRequest.d.ts +36 -0
  51. package/dist/api/types/ExportAssetsRequest.js +31 -0
  52. package/dist/api/types/FileDownloadUrl.d.ts +4 -4
  53. package/dist/api/types/FileUploadSession.d.ts +12 -11
  54. package/dist/api/types/FileUploadSession.js +1 -0
  55. package/dist/api/types/File_.d.ts +14 -13
  56. package/dist/api/types/File_.js +1 -0
  57. package/dist/api/types/HeatmapCell.d.ts +4 -4
  58. package/dist/api/types/ImportError.d.ts +4 -4
  59. package/dist/api/types/ImportSubmission.d.ts +4 -4
  60. package/dist/api/types/Invite.d.ts +8 -8
  61. package/dist/api/types/Job.d.ts +11 -11
  62. package/dist/api/types/JobSubmission.d.ts +2 -2
  63. package/dist/api/types/Language.d.ts +4 -4
  64. package/dist/api/types/Membership.d.ts +3 -3
  65. package/dist/api/types/MqttToken.d.ts +4 -4
  66. package/dist/api/types/Notification.d.ts +9 -9
  67. package/dist/api/types/NotificationCounts.d.ts +5 -5
  68. package/dist/api/types/NotificationDeadLetter.d.ts +9 -9
  69. package/dist/api/types/NotificationPreferences.d.ts +2 -2
  70. package/dist/api/types/NotificationUnreadCount.d.ts +2 -2
  71. package/dist/api/types/NotificationsArchived.d.ts +2 -2
  72. package/dist/api/types/NotificationsMarkedRead.d.ts +2 -2
  73. package/dist/api/types/Operator.d.ts +4 -4
  74. package/dist/api/types/OperatorPosition.d.ts +5 -5
  75. package/dist/api/types/Organization.d.ts +7 -7
  76. package/dist/api/types/Position.d.ts +6 -6
  77. package/dist/api/types/ProblemDetail.d.ts +1 -1
  78. package/dist/api/types/RealtimeTicket.d.ts +3 -3
  79. package/dist/api/types/ReconcileResponse.d.ts +4 -4
  80. package/dist/api/types/TaskAttemptPhoto.d.ts +7 -7
  81. package/dist/api/types/Timezone.d.ts +4 -4
  82. package/dist/api/types/UpdateAssetRequest.d.ts +21 -0
  83. package/dist/api/types/UpdateAssetRequest.js +3 -0
  84. package/dist/api/types/UploadInitiation.d.ts +6 -6
  85. package/dist/api/types/User.d.ts +5 -5
  86. package/dist/api/types/UserResource.d.ts +4 -4
  87. package/dist/api/types/index.d.ts +4 -0
  88. package/dist/api/types/index.js +4 -0
  89. package/package.json +1 -1
@@ -11,7 +11,7 @@ export declare class FilesClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<FilesClient.Options>;
12
12
  constructor(options: FilesClient.Options);
13
13
  /**
14
- * The active organization's files ordered by `created_at` descending (pass `sort=created_at` for ascending). `kind` / `status` accept comma-separated values; `subject_type` + `subject_id` narrow to the files documenting one business entity. Pagination is bidirectional (`starting_after` / `ending_before`).
14
+ * The active organization's files ordered by `created_at` descending by default. `kind` / `status` accept comma-separated values; `subject_type` + `subject_id` narrow to the files documenting one business entity. Pagination is bidirectional (`starting_after` / `ending_before`).
15
15
  *
16
16
  * @param {NizamOperatorRuntime.ListFilesRequest} request
17
17
  * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -41,6 +41,7 @@ export declare class FilesClient {
41
41
  * @throws {@link NizamOperatorRuntime.BadRequestError}
42
42
  * @throws {@link NizamOperatorRuntime.UnauthorizedError}
43
43
  * @throws {@link NizamOperatorRuntime.ForbiddenError}
44
+ * @throws {@link NizamOperatorRuntime.ConflictError}
44
45
  * @throws {@link NizamOperatorRuntime.ContentTooLargeError}
45
46
  * @throws {@link NizamOperatorRuntime.UnprocessableEntityError}
46
47
  * @throws {@link NizamOperatorRuntime.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",
@@ -47,7 +47,7 @@ class FilesClient {
47
47
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
48
48
  }
49
49
  /**
50
- * The active organization's files ordered by `created_at` descending (pass `sort=created_at` for ascending). `kind` / `status` accept comma-separated values; `subject_type` + `subject_id` narrow to the files documenting one business entity. Pagination is bidirectional (`starting_after` / `ending_before`).
50
+ * The active organization's files ordered by `created_at` descending by default. `kind` / `status` accept comma-separated values; `subject_type` + `subject_id` narrow to the files documenting one business entity. Pagination is bidirectional (`starting_after` / `ending_before`).
51
51
  *
52
52
  * @param {NizamOperatorRuntime.ListFilesRequest} request
53
53
  * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -72,11 +72,11 @@ class FilesClient {
72
72
  async __listFiles(request = {}, requestOptions) {
73
73
  const { kind, status, subject_type: subjectType, subject_id: subjectId, sort, limit, starting_after: startingAfter, ending_before: endingBefore, } = request;
74
74
  const _queryParams = {
75
- kind,
76
- status,
75
+ kind: Array.isArray(kind) ? kind.map((item) => item) : kind != null ? kind : undefined,
76
+ status: Array.isArray(status) ? status.map((item) => item) : status != null ? status : undefined,
77
77
  subject_type: subjectType,
78
78
  subject_id: subjectId,
79
- sort,
79
+ sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
80
80
  limit,
81
81
  starting_after: startingAfter,
82
82
  ending_before: endingBefore,
@@ -137,6 +137,7 @@ class FilesClient {
137
137
  * @throws {@link NizamOperatorRuntime.BadRequestError}
138
138
  * @throws {@link NizamOperatorRuntime.UnauthorizedError}
139
139
  * @throws {@link NizamOperatorRuntime.ForbiddenError}
140
+ * @throws {@link NizamOperatorRuntime.ConflictError}
140
141
  * @throws {@link NizamOperatorRuntime.ContentTooLargeError}
141
142
  * @throws {@link NizamOperatorRuntime.UnprocessableEntityError}
142
143
  * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
@@ -144,6 +145,7 @@ class FilesClient {
144
145
  *
145
146
  * @example
146
147
  * await client.files.initiateFileUpload({
148
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
147
149
  * kind: "profile_picture",
148
150
  * subject_type: "task_attempt",
149
151
  * subject_id: "b3c4d5e6-7f8a-9b0c-1d2e-3f4a5b6c7d8e",
@@ -157,8 +159,9 @@ class FilesClient {
157
159
  return core.HttpResponsePromise.fromPromise(this.__initiateFileUpload(request, requestOptions));
158
160
  }
159
161
  async __initiateFileUpload(request, requestOptions) {
162
+ const { "Idempotency-Key": idempotencyKey, ..._body } = request;
160
163
  const _authRequest = await this._options.authProvider.getAuthRequest();
161
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
164
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
162
165
  const _response = await core.fetcher({
163
166
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
164
167
  (await core.Supplier.get(this._options.environment)) ??
@@ -168,7 +171,7 @@ class FilesClient {
168
171
  contentType: "application/json",
169
172
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
170
173
  requestType: "json",
171
- body: request,
174
+ body: _body,
172
175
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
173
176
  maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
174
177
  abortSignal: requestOptions?.abortSignal,
@@ -189,6 +192,8 @@ class FilesClient {
189
192
  throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
190
193
  case 403:
191
194
  throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
195
+ case 409:
196
+ throw new NizamOperatorRuntime.ConflictError(_response.error.body, _response.rawResponse);
192
197
  case 413:
193
198
  throw new NizamOperatorRuntime.ContentTooLargeError(_response.error.body, _response.rawResponse);
194
199
  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). */
@@ -36,6 +39,7 @@ export declare namespace InitiateFileUploadRequest {
36
39
  readonly ImportReport: "import_report";
37
40
  readonly SignedDocument: "signed_document";
38
41
  readonly ProductImage: "product_image";
42
+ readonly DataExport: "data_export";
39
43
  };
40
44
  type Kind = (typeof Kind)[keyof typeof Kind];
41
45
  }
@@ -13,5 +13,6 @@ var InitiateFileUploadRequest;
13
13
  ImportReport: "import_report",
14
14
  SignedDocument: "signed_document",
15
15
  ProductImage: "product_image",
16
+ DataExport: "data_export",
16
17
  };
17
18
  })(InitiateFileUploadRequest || (exports.InitiateFileUploadRequest = InitiateFileUploadRequest = {}));
@@ -1,3 +1,4 @@
1
+ import type * as NizamOperatorRuntime from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -8,16 +9,16 @@
8
9
  * }
9
10
  */
10
11
  export interface ListFilesRequest {
11
- /** Filter by file kind. Comma-separated; values: `profile_picture`, `chat_attachment`, `task_pod_photo`, `import_source`, `import_report`, `signed_document`, `product_image`. */
12
- kind?: string | string[];
13
- /** Filter by lifecycle status. Comma-separated; values: `active`, `quarantined`, `deleted`. */
14
- status?: string | string[];
12
+ /** Filter by file kind. Comma-separated; matched case-insensitively. */
13
+ kind?: NizamOperatorRuntime.ListFilesRequestKindItem | NizamOperatorRuntime.ListFilesRequestKindItem[];
14
+ /** Filter by lifecycle status. Comma-separated; matched case-insensitively. */
15
+ status?: NizamOperatorRuntime.ListFilesRequestStatusItem | NizamOperatorRuntime.ListFilesRequestStatusItem[];
15
16
  /** Filter by the documented entity's type (pairs with `subject_id`). */
16
17
  subject_type?: string;
17
18
  /** Filter by the documented entity's id (requires `subject_type`). */
18
19
  subject_id?: string;
19
- /** Sort order. Allowed fields: `created_at`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
20
- sort?: string | string[];
20
+ /** Sort order. Allowed fields: `created_at`. 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`. */
21
+ sort?: NizamOperatorRuntime.ListFilesRequestSortItem | NizamOperatorRuntime.ListFilesRequestSortItem[];
21
22
  /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
22
23
  limit?: number;
23
24
  /** 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,11 @@
1
+ export declare const ListFilesRequestKindItem: {
2
+ readonly ProfilePicture: "profile_picture";
3
+ readonly ChatAttachment: "chat_attachment";
4
+ readonly TaskPodPhoto: "task_pod_photo";
5
+ readonly ImportSource: "import_source";
6
+ readonly ImportReport: "import_report";
7
+ readonly SignedDocument: "signed_document";
8
+ readonly ProductImage: "product_image";
9
+ readonly DataExport: "data_export";
10
+ };
11
+ export type ListFilesRequestKindItem = (typeof ListFilesRequestKindItem)[keyof typeof ListFilesRequestKindItem];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ListFilesRequestKindItem = void 0;
5
+ exports.ListFilesRequestKindItem = {
6
+ ProfilePicture: "profile_picture",
7
+ ChatAttachment: "chat_attachment",
8
+ TaskPodPhoto: "task_pod_photo",
9
+ ImportSource: "import_source",
10
+ ImportReport: "import_report",
11
+ SignedDocument: "signed_document",
12
+ ProductImage: "product_image",
13
+ DataExport: "data_export",
14
+ };
@@ -0,0 +1,5 @@
1
+ export declare const ListFilesRequestSortItem: {
2
+ readonly CreatedAtAsc: "created_at:asc";
3
+ readonly CreatedAtDesc: "created_at:desc";
4
+ };
5
+ export type ListFilesRequestSortItem = (typeof ListFilesRequestSortItem)[keyof typeof ListFilesRequestSortItem];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ListFilesRequestSortItem = void 0;
5
+ exports.ListFilesRequestSortItem = {
6
+ CreatedAtAsc: "created_at:asc",
7
+ CreatedAtDesc: "created_at:desc",
8
+ };
@@ -0,0 +1,6 @@
1
+ export declare const ListFilesRequestStatusItem: {
2
+ readonly Active: "active";
3
+ readonly Quarantined: "quarantined";
4
+ readonly Deleted: "deleted";
5
+ };
6
+ export type ListFilesRequestStatusItem = (typeof ListFilesRequestStatusItem)[keyof typeof ListFilesRequestStatusItem];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ListFilesRequestStatusItem = void 0;
5
+ exports.ListFilesRequestStatusItem = {
6
+ Active: "active",
7
+ Quarantined: "quarantined",
8
+ Deleted: "deleted",
9
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./ListFilesRequestKindItem.js";
2
+ export * from "./ListFilesRequestSortItem.js";
3
+ export * from "./ListFilesRequestStatusItem.js";
@@ -0,0 +1,19 @@
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("./ListFilesRequestKindItem.js"), exports);
18
+ __exportStar(require("./ListFilesRequestSortItem.js"), exports);
19
+ __exportStar(require("./ListFilesRequestStatusItem.js"), exports);
@@ -2,6 +2,7 @@ export * from "./devices/client/requests/index.js";
2
2
  export * as devices from "./devices/index.js";
3
3
  export * from "./files/client/requests/index.js";
4
4
  export * as files from "./files/index.js";
5
+ export * from "./files/types/index.js";
5
6
  export * from "./invites/client/requests/index.js";
6
7
  export * as invites from "./invites/index.js";
7
8
  export * as lookups from "./lookups/index.js";
@@ -9,6 +10,7 @@ export * from "./notificationPreferences/client/requests/index.js";
9
10
  export * as notificationPreferences from "./notificationPreferences/index.js";
10
11
  export * from "./notifications/client/requests/index.js";
11
12
  export * as notifications from "./notifications/index.js";
13
+ export * from "./notifications/types/index.js";
12
14
  export * as positions from "./positions/index.js";
13
15
  export * as realtime from "./realtime/index.js";
14
16
  export * from "./taskAttempts/client/requests/index.js";
@@ -41,6 +41,7 @@ __exportStar(require("./devices/client/requests/index.js"), exports);
41
41
  exports.devices = __importStar(require("./devices/index.js"));
42
42
  __exportStar(require("./files/client/requests/index.js"), exports);
43
43
  exports.files = __importStar(require("./files/index.js"));
44
+ __exportStar(require("./files/types/index.js"), exports);
44
45
  __exportStar(require("./invites/client/requests/index.js"), exports);
45
46
  exports.invites = __importStar(require("./invites/index.js"));
46
47
  exports.lookups = __importStar(require("./lookups/index.js"));
@@ -48,6 +49,7 @@ __exportStar(require("./notificationPreferences/client/requests/index.js"), expo
48
49
  exports.notificationPreferences = __importStar(require("./notificationPreferences/index.js"));
49
50
  __exportStar(require("./notifications/client/requests/index.js"), exports);
50
51
  exports.notifications = __importStar(require("./notifications/index.js"));
52
+ __exportStar(require("./notifications/types/index.js"), exports);
51
53
  exports.positions = __importStar(require("./positions/index.js"));
52
54
  exports.realtime = __importStar(require("./realtime/index.js"));
53
55
  __exportStar(require("./taskAttempts/client/requests/index.js"), exports);
@@ -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). `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.
17
+ * The caller's own notifications ordered by `created_at` descending by default. `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 {NizamOperatorRuntime.ListNotificationsRequest} request
20
20
  * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -50,7 +50,7 @@ class NotificationsClient {
50
50
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
51
  }
52
52
  /**
53
- * The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `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.
53
+ * The caller's own notifications ordered by `created_at` descending by default. `status` selects the segment — `all` (default; the active inbox, non-archived), `unread`, `read`, or `archived`. `category` and `kind` accept comma-separated values and AND on top of the segment; `q` matches the notification title/body. `since=` (RFC 3339) returns only items at/after the instant for incremental catch-up after a reconnect. Pagination is bidirectional (`starting_after` / `ending_before`); cursors are bound to the sort direction that minted them.
54
54
  *
55
55
  * @param {NizamOperatorRuntime.ListNotificationsRequest} request
56
56
  * @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -81,7 +81,7 @@ class NotificationsClient {
81
81
  kind,
82
82
  q,
83
83
  since: since != null ? since : undefined,
84
- sort,
84
+ sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
85
85
  limit,
86
86
  starting_after: startingAfter,
87
87
  ending_before: endingBefore,
@@ -1,3 +1,4 @@
1
+ import type * as NizamOperatorRuntime from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -19,8 +20,8 @@ export interface ListNotificationsRequest {
19
20
  q?: string;
20
21
  /** Only notifications created at/after this RFC 3339 instant. */
21
22
  since?: string;
22
- /** Sort order. Allowed fields: `created_at`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
23
- sort?: string | string[];
23
+ /** Sort order. Allowed fields: `created_at`. 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`. */
24
+ sort?: NizamOperatorRuntime.ListNotificationsRequestSortItem | NizamOperatorRuntime.ListNotificationsRequestSortItem[];
24
25
  /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
25
26
  limit?: number;
26
27
  /** 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,5 @@
1
+ export declare const ListNotificationsRequestSortItem: {
2
+ readonly CreatedAtAsc: "created_at:asc";
3
+ readonly CreatedAtDesc: "created_at:desc";
4
+ };
5
+ export type ListNotificationsRequestSortItem = (typeof ListNotificationsRequestSortItem)[keyof typeof ListNotificationsRequestSortItem];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ListNotificationsRequestSortItem = void 0;
5
+ exports.ListNotificationsRequestSortItem = {
6
+ CreatedAtAsc: "created_at:asc",
7
+ CreatedAtDesc: "created_at:desc",
8
+ };
@@ -0,0 +1 @@
1
+ export * from "./ListNotificationsRequestSortItem.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("./ListNotificationsRequestSortItem.js"), exports);
@@ -42,6 +42,7 @@ export declare class TaskAttemptsClient {
42
42
  * @throws {@link NizamOperatorRuntime.UnauthorizedError}
43
43
  * @throws {@link NizamOperatorRuntime.ForbiddenError}
44
44
  * @throws {@link NizamOperatorRuntime.NotFoundError}
45
+ * @throws {@link NizamOperatorRuntime.ConflictError}
45
46
  * @throws {@link NizamOperatorRuntime.ContentTooLargeError}
46
47
  * @throws {@link NizamOperatorRuntime.UnprocessableEntityError}
47
48
  * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
@@ -49,6 +50,7 @@ export declare class TaskAttemptsClient {
49
50
  *
50
51
  * @example
51
52
  * await client.taskAttempts.captureTaskAttemptPhoto({
53
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
52
54
  * attemptId: "00000000-0000-0000-0000-000000000000",
53
55
  * filename: "delivery-door.jpg",
54
56
  * content_type: "image/jpeg",
@@ -135,6 +135,7 @@ class TaskAttemptsClient {
135
135
  * @throws {@link NizamOperatorRuntime.UnauthorizedError}
136
136
  * @throws {@link NizamOperatorRuntime.ForbiddenError}
137
137
  * @throws {@link NizamOperatorRuntime.NotFoundError}
138
+ * @throws {@link NizamOperatorRuntime.ConflictError}
138
139
  * @throws {@link NizamOperatorRuntime.ContentTooLargeError}
139
140
  * @throws {@link NizamOperatorRuntime.UnprocessableEntityError}
140
141
  * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
@@ -142,6 +143,7 @@ class TaskAttemptsClient {
142
143
  *
143
144
  * @example
144
145
  * await client.taskAttempts.captureTaskAttemptPhoto({
146
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
145
147
  * attemptId: "00000000-0000-0000-0000-000000000000",
146
148
  * filename: "delivery-door.jpg",
147
149
  * content_type: "image/jpeg",
@@ -157,9 +159,9 @@ class TaskAttemptsClient {
157
159
  return core.HttpResponsePromise.fromPromise(this.__captureTaskAttemptPhoto(request, requestOptions));
158
160
  }
159
161
  async __captureTaskAttemptPhoto(request, requestOptions) {
160
- const { attemptId, ..._body } = request;
162
+ const { attemptId, "Idempotency-Key": idempotencyKey, ..._body } = request;
161
163
  const _authRequest = await this._options.authProvider.getAuthRequest();
162
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
164
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "Idempotency-Key": idempotencyKey }), requestOptions?.headers);
163
165
  const _response = await core.fetcher({
164
166
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
165
167
  (await core.Supplier.get(this._options.environment)) ??
@@ -192,6 +194,8 @@ class TaskAttemptsClient {
192
194
  throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
193
195
  case 404:
194
196
  throw new NizamOperatorRuntime.NotFoundError(_response.error.body, _response.rawResponse);
197
+ case 409:
198
+ throw new NizamOperatorRuntime.ConflictError(_response.error.body, _response.rawResponse);
195
199
  case 413:
196
200
  throw new NizamOperatorRuntime.ContentTooLargeError(_response.error.body, _response.rawResponse);
197
201
  case 422:
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
+ * "Idempotency-Key": "9f1e6d2a-7c3b-4e5f-8a91-0b2c3d4e5f60",
4
5
  * attemptId: "00000000-0000-0000-0000-000000000000",
5
6
  * filename: "delivery-door.jpg",
6
7
  * content_type: "image/jpeg",
@@ -14,6 +15,8 @@
14
15
  */
15
16
  export interface CaptureTaskAttemptPhotoRequest {
16
17
  attemptId: string;
18
+ /** 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. */
19
+ "Idempotency-Key"?: string;
17
20
  /** Original filename. */
18
21
  filename: string;
19
22
  /** Declared MIME type — POD photos accept image/jpeg, image/png, image/webp, image/heic, image/heif. */
@@ -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?: NizamOperatorRuntime.MembershipChoice[] | undefined;
11
+ memberships: NizamOperatorRuntime.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 = {}));
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Asset ids whose common legal status transitions to compute.
3
+ */
4
+ export interface AllowedTransitionsRequest {
5
+ /** The selected asset ids. */
6
+ ids: string[];
7
+ }
@@ -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 });
@@ -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. */