@nizam-os/operator-sdk 4.0.0 → 5.1.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 (104) hide show
  1. package/dist/Client.d.ts +3 -0
  2. package/dist/Client.js +24 -20
  3. package/dist/api/resources/assets/client/Client.d.ts +54 -0
  4. package/dist/api/resources/assets/client/Client.js +184 -0
  5. package/dist/api/resources/assets/client/index.d.ts +1 -0
  6. package/dist/api/resources/assets/client/index.js +17 -0
  7. package/dist/api/resources/assets/client/requests/GetMyAssetRequest.d.ts +9 -0
  8. package/dist/api/resources/assets/client/requests/GetMyAssetRequest.js +3 -0
  9. package/dist/api/resources/assets/client/requests/ListMyAssetsRequest.d.ts +15 -0
  10. package/dist/api/resources/assets/client/requests/ListMyAssetsRequest.js +3 -0
  11. package/dist/api/resources/assets/client/requests/index.d.ts +2 -0
  12. package/dist/api/resources/assets/client/requests/index.js +2 -0
  13. package/dist/api/resources/assets/exports.d.ts +2 -0
  14. package/dist/api/resources/assets/exports.js +21 -0
  15. package/dist/api/resources/assets/index.d.ts +1 -0
  16. package/dist/api/resources/assets/index.js +17 -0
  17. package/dist/api/resources/files/client/Client.d.ts +1 -1
  18. package/dist/api/resources/files/client/Client.js +4 -4
  19. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +1 -0
  20. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.js +1 -0
  21. package/dist/api/resources/files/client/requests/ListFilesRequest.d.ts +7 -6
  22. package/dist/api/resources/files/index.d.ts +1 -0
  23. package/dist/api/resources/files/index.js +1 -0
  24. package/dist/api/resources/files/types/ListFilesRequestKindItem.d.ts +11 -0
  25. package/dist/api/resources/files/types/ListFilesRequestKindItem.js +14 -0
  26. package/dist/api/resources/files/types/ListFilesRequestSortItem.d.ts +5 -0
  27. package/dist/api/resources/files/types/ListFilesRequestSortItem.js +8 -0
  28. package/dist/api/resources/files/types/ListFilesRequestStatusItem.d.ts +6 -0
  29. package/dist/api/resources/files/types/ListFilesRequestStatusItem.js +9 -0
  30. package/dist/api/resources/files/types/index.d.ts +3 -0
  31. package/dist/api/resources/files/types/index.js +19 -0
  32. package/dist/api/resources/index.d.ts +4 -0
  33. package/dist/api/resources/index.js +5 -1
  34. package/dist/api/resources/notifications/client/Client.d.ts +1 -1
  35. package/dist/api/resources/notifications/client/Client.js +2 -2
  36. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +3 -2
  37. package/dist/api/resources/notifications/index.d.ts +1 -0
  38. package/dist/api/resources/notifications/index.js +1 -0
  39. package/dist/api/resources/notifications/types/ListNotificationsRequestSortItem.d.ts +5 -0
  40. package/dist/api/resources/notifications/types/ListNotificationsRequestSortItem.js +8 -0
  41. package/dist/api/resources/notifications/types/index.d.ts +1 -0
  42. package/dist/api/resources/notifications/types/index.js +17 -0
  43. package/dist/api/types/ActiveOrganization.d.ts +2 -2
  44. package/dist/api/types/ActivityResource.d.ts +4 -4
  45. package/dist/api/types/AllowedTransitions.d.ts +28 -0
  46. package/dist/api/types/AllowedTransitions.js +23 -0
  47. package/dist/api/types/AllowedTransitionsRequest.d.ts +7 -0
  48. package/dist/api/types/AllowedTransitionsRequest.js +3 -0
  49. package/dist/api/types/ApiFieldError.d.ts +1 -1
  50. package/dist/api/types/Asset.d.ts +26 -4
  51. package/dist/api/types/Asset.js +13 -0
  52. package/dist/api/types/AssetListItem.d.ts +11 -5
  53. package/dist/api/types/Assignment.d.ts +6 -6
  54. package/dist/api/types/BulkJobSubmission.d.ts +3 -3
  55. package/dist/api/types/BusinessCategory.d.ts +3 -3
  56. package/dist/api/types/Country.d.ts +3 -3
  57. package/dist/api/types/CreateAssetRequest.d.ts +25 -0
  58. package/dist/api/types/CreateAssetRequest.js +10 -0
  59. package/dist/api/types/Currency.d.ts +5 -5
  60. package/dist/api/types/Device.d.ts +6 -6
  61. package/dist/api/types/Devices.d.ts +2 -2
  62. package/dist/api/types/ExportAssetsRequest.d.ts +36 -0
  63. package/dist/api/types/ExportAssetsRequest.js +31 -0
  64. package/dist/api/types/FileDownloadUrl.d.ts +4 -4
  65. package/dist/api/types/FileUploadSession.d.ts +12 -11
  66. package/dist/api/types/FileUploadSession.js +1 -0
  67. package/dist/api/types/File_.d.ts +14 -13
  68. package/dist/api/types/File_.js +1 -0
  69. package/dist/api/types/HeatmapCell.d.ts +4 -4
  70. package/dist/api/types/ImportError.d.ts +4 -4
  71. package/dist/api/types/ImportSubmission.d.ts +4 -4
  72. package/dist/api/types/Invite.d.ts +8 -8
  73. package/dist/api/types/Job.d.ts +11 -11
  74. package/dist/api/types/JobSubmission.d.ts +2 -2
  75. package/dist/api/types/Language.d.ts +4 -4
  76. package/dist/api/types/Membership.d.ts +3 -3
  77. package/dist/api/types/MqttToken.d.ts +4 -4
  78. package/dist/api/types/Notification.d.ts +9 -9
  79. package/dist/api/types/NotificationCounts.d.ts +5 -5
  80. package/dist/api/types/NotificationDeadLetter.d.ts +9 -9
  81. package/dist/api/types/NotificationPreferences.d.ts +2 -2
  82. package/dist/api/types/NotificationUnreadCount.d.ts +2 -2
  83. package/dist/api/types/NotificationsArchived.d.ts +2 -2
  84. package/dist/api/types/NotificationsMarkedRead.d.ts +2 -2
  85. package/dist/api/types/Operator.d.ts +4 -4
  86. package/dist/api/types/OperatorAsset.d.ts +64 -0
  87. package/dist/api/types/OperatorAsset.js +33 -0
  88. package/dist/api/types/OperatorPosition.d.ts +5 -5
  89. package/dist/api/types/Organization.d.ts +7 -7
  90. package/dist/api/types/Position.d.ts +6 -6
  91. package/dist/api/types/ProblemDetail.d.ts +1 -1
  92. package/dist/api/types/RealtimeTicket.d.ts +3 -3
  93. package/dist/api/types/ReconcileResponse.d.ts +4 -4
  94. package/dist/api/types/TaskAttemptPhoto.d.ts +7 -7
  95. package/dist/api/types/Timezone.d.ts +4 -4
  96. package/dist/api/types/UpdateAssetRequest.d.ts +21 -0
  97. package/dist/api/types/UpdateAssetRequest.js +3 -0
  98. package/dist/api/types/UploadInitiation.d.ts +6 -6
  99. package/dist/api/types/User.d.ts +27 -5
  100. package/dist/api/types/User.js +19 -0
  101. package/dist/api/types/UserResource.d.ts +4 -4
  102. package/dist/api/types/index.d.ts +5 -0
  103. package/dist/api/types/index.js +5 -0
  104. package/package.json +1 -1
package/dist/Client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AssetsClient } from "./api/resources/assets/client/Client.js";
1
2
  import { DevicesClient } from "./api/resources/devices/client/Client.js";
2
3
  import { FilesClient } from "./api/resources/files/client/Client.js";
3
4
  import { InvitesClient } from "./api/resources/invites/client/Client.js";
@@ -22,6 +23,7 @@ export declare class NizamOperatorRuntimeClient {
22
23
  protected _invites: InvitesClient | undefined;
23
24
  protected _lookups: LookupsClient | undefined;
24
25
  protected _users: UsersClient | undefined;
26
+ protected _assets: AssetsClient | undefined;
25
27
  protected _devices: DevicesClient | undefined;
26
28
  protected _positions: PositionsClient | undefined;
27
29
  protected _notificationPreferences: NotificationPreferencesClient | undefined;
@@ -33,6 +35,7 @@ export declare class NizamOperatorRuntimeClient {
33
35
  get invites(): InvitesClient;
34
36
  get lookups(): LookupsClient;
35
37
  get users(): UsersClient;
38
+ get assets(): AssetsClient;
36
39
  get devices(): DevicesClient;
37
40
  get positions(): PositionsClient;
38
41
  get notificationPreferences(): NotificationPreferencesClient;
package/dist/Client.js CHANGED
@@ -35,16 +35,17 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.NizamOperatorRuntimeClient = void 0;
38
- const Client_js_1 = require("./api/resources/devices/client/Client.js");
39
- const Client_js_2 = require("./api/resources/files/client/Client.js");
40
- const Client_js_3 = require("./api/resources/invites/client/Client.js");
41
- const Client_js_4 = require("./api/resources/lookups/client/Client.js");
42
- const Client_js_5 = require("./api/resources/notificationPreferences/client/Client.js");
43
- const Client_js_6 = require("./api/resources/notifications/client/Client.js");
44
- const Client_js_7 = require("./api/resources/positions/client/Client.js");
45
- const Client_js_8 = require("./api/resources/realtime/client/Client.js");
46
- const Client_js_9 = require("./api/resources/taskAttempts/client/Client.js");
47
- const Client_js_10 = require("./api/resources/users/client/Client.js");
38
+ const Client_js_1 = require("./api/resources/assets/client/Client.js");
39
+ const Client_js_2 = require("./api/resources/devices/client/Client.js");
40
+ const Client_js_3 = require("./api/resources/files/client/Client.js");
41
+ const Client_js_4 = require("./api/resources/invites/client/Client.js");
42
+ const Client_js_5 = require("./api/resources/lookups/client/Client.js");
43
+ const Client_js_6 = require("./api/resources/notificationPreferences/client/Client.js");
44
+ const Client_js_7 = require("./api/resources/notifications/client/Client.js");
45
+ const Client_js_8 = require("./api/resources/positions/client/Client.js");
46
+ const Client_js_9 = require("./api/resources/realtime/client/Client.js");
47
+ const Client_js_10 = require("./api/resources/taskAttempts/client/Client.js");
48
+ const Client_js_11 = require("./api/resources/users/client/Client.js");
48
49
  const BaseClient_js_1 = require("./BaseClient.js");
49
50
  const core = __importStar(require("./core/index.js"));
50
51
  class NizamOperatorRuntimeClient {
@@ -52,34 +53,37 @@ class NizamOperatorRuntimeClient {
52
53
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
53
54
  }
54
55
  get files() {
55
- return (this._files ?? (this._files = new Client_js_2.FilesClient(this._options)));
56
+ return (this._files ?? (this._files = new Client_js_3.FilesClient(this._options)));
56
57
  }
57
58
  get invites() {
58
- return (this._invites ?? (this._invites = new Client_js_3.InvitesClient(this._options)));
59
+ return (this._invites ?? (this._invites = new Client_js_4.InvitesClient(this._options)));
59
60
  }
60
61
  get lookups() {
61
- return (this._lookups ?? (this._lookups = new Client_js_4.LookupsClient(this._options)));
62
+ return (this._lookups ?? (this._lookups = new Client_js_5.LookupsClient(this._options)));
62
63
  }
63
64
  get users() {
64
- return (this._users ?? (this._users = new Client_js_10.UsersClient(this._options)));
65
+ return (this._users ?? (this._users = new Client_js_11.UsersClient(this._options)));
66
+ }
67
+ get assets() {
68
+ return (this._assets ?? (this._assets = new Client_js_1.AssetsClient(this._options)));
65
69
  }
66
70
  get devices() {
67
- return (this._devices ?? (this._devices = new Client_js_1.DevicesClient(this._options)));
71
+ return (this._devices ?? (this._devices = new Client_js_2.DevicesClient(this._options)));
68
72
  }
69
73
  get positions() {
70
- return (this._positions ?? (this._positions = new Client_js_7.PositionsClient(this._options)));
74
+ return (this._positions ?? (this._positions = new Client_js_8.PositionsClient(this._options)));
71
75
  }
72
76
  get notificationPreferences() {
73
- return (this._notificationPreferences ?? (this._notificationPreferences = new Client_js_5.NotificationPreferencesClient(this._options)));
77
+ return (this._notificationPreferences ?? (this._notificationPreferences = new Client_js_6.NotificationPreferencesClient(this._options)));
74
78
  }
75
79
  get notifications() {
76
- return (this._notifications ?? (this._notifications = new Client_js_6.NotificationsClient(this._options)));
80
+ return (this._notifications ?? (this._notifications = new Client_js_7.NotificationsClient(this._options)));
77
81
  }
78
82
  get realtime() {
79
- return (this._realtime ?? (this._realtime = new Client_js_8.RealtimeClient(this._options)));
83
+ return (this._realtime ?? (this._realtime = new Client_js_9.RealtimeClient(this._options)));
80
84
  }
81
85
  get taskAttempts() {
82
- return (this._taskAttempts ?? (this._taskAttempts = new Client_js_9.TaskAttemptsClient(this._options)));
86
+ return (this._taskAttempts ?? (this._taskAttempts = new Client_js_10.TaskAttemptsClient(this._options)));
83
87
  }
84
88
  /**
85
89
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -0,0 +1,54 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as NizamOperatorRuntime from "../../../index.js";
5
+ export declare namespace AssetsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * Universal physical-hardware master — vehicles, drones, robots, trailers, containers, equipment. Kind-discriminated.
12
+ */
13
+ export declare class AssetsClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<AssetsClient.Options>;
15
+ constructor(options: AssetsClient.Options);
16
+ /**
17
+ * Returns the assets the authenticated operator is currently assigned to operate — and only those. Deny-by-default: an operator with no active assignment sees an empty list. Resolved through the narrow `operate` (assigned-operator) relation, never the owning-org `view` surface, so it never exposes a whole tenant. Ordered by `created_at` descending; bidirectional cursor pagination (`starting_after` / `ending_before`).
18
+ *
19
+ * @param {NizamOperatorRuntime.ListMyAssetsRequest} request
20
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
21
+ *
22
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
23
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
24
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
25
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
26
+ *
27
+ * @example
28
+ * await client.assets.listMyAssets({
29
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
30
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
31
+ * })
32
+ */
33
+ listMyAssets(request?: NizamOperatorRuntime.ListMyAssetsRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<NizamOperatorRuntime.OperatorAsset>;
34
+ private __listMyAssets;
35
+ /**
36
+ * Returns one asset the authenticated operator is assigned to operate. Resolved through the `operate` (assigned-operator) relation only — never the owning-org `view` surface. An asset the operator is not assigned to (or that does not exist) returns 404, indistinguishable from a missing id so the endpoint can't be used to probe for assets.
37
+ *
38
+ * @param {NizamOperatorRuntime.GetMyAssetRequest} request
39
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
42
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
43
+ * @throws {@link NizamOperatorRuntime.NotFoundError}
44
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
45
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
46
+ *
47
+ * @example
48
+ * await client.assets.getMyAsset({
49
+ * id: "00000000-0000-0000-0000-000000000000"
50
+ * })
51
+ */
52
+ getMyAsset(request: NizamOperatorRuntime.GetMyAssetRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<NizamOperatorRuntime.OperatorAsset>;
53
+ private __getMyAsset;
54
+ }
@@ -0,0 +1,184 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.AssetsClient = void 0;
38
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
39
+ const headers_js_1 = require("../../../../core/headers.js");
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const environments = __importStar(require("../../../../environments.js"));
42
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
43
+ const errors = __importStar(require("../../../../errors/index.js"));
44
+ const NizamOperatorRuntime = __importStar(require("../../../index.js"));
45
+ /**
46
+ * Universal physical-hardware master — vehicles, drones, robots, trailers, containers, equipment. Kind-discriminated.
47
+ */
48
+ class AssetsClient {
49
+ constructor(options) {
50
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
+ }
52
+ /**
53
+ * Returns the assets the authenticated operator is currently assigned to operate — and only those. Deny-by-default: an operator with no active assignment sees an empty list. Resolved through the narrow `operate` (assigned-operator) relation, never the owning-org `view` surface, so it never exposes a whole tenant. Ordered by `created_at` descending; bidirectional cursor pagination (`starting_after` / `ending_before`).
54
+ *
55
+ * @param {NizamOperatorRuntime.ListMyAssetsRequest} request
56
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
59
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
60
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
61
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
62
+ *
63
+ * @example
64
+ * await client.assets.listMyAssets({
65
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
66
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
67
+ * })
68
+ */
69
+ listMyAssets(request = {}, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__listMyAssets(request, requestOptions));
71
+ }
72
+ async __listMyAssets(request = {}, requestOptions) {
73
+ const { limit, starting_after: startingAfter, ending_before: endingBefore } = request;
74
+ const _queryParams = {
75
+ limit,
76
+ starting_after: startingAfter,
77
+ ending_before: endingBefore,
78
+ };
79
+ const _authRequest = await this._options.authProvider.getAuthRequest();
80
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
81
+ const _response = await core.fetcher({
82
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
83
+ (await core.Supplier.get(this._options.environment)) ??
84
+ environments.NizamOperatorRuntimeEnvironment.Production, "v1/me/assets"),
85
+ method: "GET",
86
+ headers: _headers,
87
+ queryString: core.url
88
+ .queryBuilder()
89
+ .addMany(_queryParams)
90
+ .mergeAdditional(requestOptions?.queryParams)
91
+ .build(),
92
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
93
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
94
+ abortSignal: requestOptions?.abortSignal,
95
+ fetchFn: this._options?.fetch,
96
+ logging: this._options.logging,
97
+ });
98
+ if (_response.ok) {
99
+ return { data: _response.body, rawResponse: _response.rawResponse };
100
+ }
101
+ if (_response.error.reason === "status-code") {
102
+ switch (_response.error.statusCode) {
103
+ case 401:
104
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
105
+ case 403:
106
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
107
+ case 429:
108
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
109
+ case 500:
110
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
111
+ default:
112
+ throw new errors.NizamOperatorRuntimeError({
113
+ statusCode: _response.error.statusCode,
114
+ body: _response.error.body,
115
+ rawResponse: _response.rawResponse,
116
+ });
117
+ }
118
+ }
119
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me/assets");
120
+ }
121
+ /**
122
+ * Returns one asset the authenticated operator is assigned to operate. Resolved through the `operate` (assigned-operator) relation only — never the owning-org `view` surface. An asset the operator is not assigned to (or that does not exist) returns 404, indistinguishable from a missing id so the endpoint can't be used to probe for assets.
123
+ *
124
+ * @param {NizamOperatorRuntime.GetMyAssetRequest} request
125
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
126
+ *
127
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
128
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
129
+ * @throws {@link NizamOperatorRuntime.NotFoundError}
130
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
131
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
132
+ *
133
+ * @example
134
+ * await client.assets.getMyAsset({
135
+ * id: "00000000-0000-0000-0000-000000000000"
136
+ * })
137
+ */
138
+ getMyAsset(request, requestOptions) {
139
+ return core.HttpResponsePromise.fromPromise(this.__getMyAsset(request, requestOptions));
140
+ }
141
+ async __getMyAsset(request, requestOptions) {
142
+ const { id } = request;
143
+ const _authRequest = await this._options.authProvider.getAuthRequest();
144
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
145
+ const _response = await core.fetcher({
146
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
147
+ (await core.Supplier.get(this._options.environment)) ??
148
+ environments.NizamOperatorRuntimeEnvironment.Production, `v1/me/assets/${core.url.encodePathParam(id)}`),
149
+ method: "GET",
150
+ headers: _headers,
151
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
152
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
153
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
154
+ abortSignal: requestOptions?.abortSignal,
155
+ fetchFn: this._options?.fetch,
156
+ logging: this._options.logging,
157
+ });
158
+ if (_response.ok) {
159
+ return { data: _response.body, rawResponse: _response.rawResponse };
160
+ }
161
+ if (_response.error.reason === "status-code") {
162
+ switch (_response.error.statusCode) {
163
+ case 401:
164
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
165
+ case 403:
166
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
167
+ case 404:
168
+ throw new NizamOperatorRuntime.NotFoundError(_response.error.body, _response.rawResponse);
169
+ case 429:
170
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
171
+ case 500:
172
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
173
+ default:
174
+ throw new errors.NizamOperatorRuntimeError({
175
+ statusCode: _response.error.statusCode,
176
+ body: _response.error.body,
177
+ rawResponse: _response.rawResponse,
178
+ });
179
+ }
180
+ }
181
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me/assets/{id}");
182
+ }
183
+ }
184
+ exports.AssetsClient = AssetsClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface GetMyAssetRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
5
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
6
+ * }
7
+ */
8
+ export interface ListMyAssetsRequest {
9
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
10
+ limit?: number;
11
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
12
+ starting_after?: string;
13
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
14
+ ending_before?: string;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export type { GetMyAssetRequest } from "./GetMyAssetRequest.js";
2
+ export type { ListMyAssetsRequest } from "./ListMyAssetsRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { AssetsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AssetsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "AssetsClient", { enumerable: true, get: function () { return Client_js_1.AssetsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -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.
@@ -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,
@@ -39,6 +39,7 @@ export declare namespace InitiateFileUploadRequest {
39
39
  readonly ImportReport: "import_report";
40
40
  readonly SignedDocument: "signed_document";
41
41
  readonly ProductImage: "product_image";
42
+ readonly DataExport: "data_export";
42
43
  };
43
44
  type Kind = (typeof Kind)[keyof typeof Kind];
44
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);