@nizam-os/operator-sdk 5.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.
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +24 -20
- package/dist/api/resources/assets/client/Client.d.ts +54 -0
- package/dist/api/resources/assets/client/Client.js +184 -0
- package/dist/api/resources/assets/client/index.d.ts +1 -0
- package/dist/api/resources/assets/client/index.js +17 -0
- package/dist/api/resources/assets/client/requests/GetMyAssetRequest.d.ts +9 -0
- package/dist/api/resources/assets/client/requests/GetMyAssetRequest.js +3 -0
- package/dist/api/resources/assets/client/requests/ListMyAssetsRequest.d.ts +15 -0
- package/dist/api/resources/assets/client/requests/ListMyAssetsRequest.js +3 -0
- package/dist/api/resources/assets/client/requests/index.d.ts +2 -0
- package/dist/api/resources/assets/client/requests/index.js +2 -0
- package/dist/api/resources/assets/exports.d.ts +2 -0
- package/dist/api/resources/assets/exports.js +21 -0
- package/dist/api/resources/assets/index.d.ts +1 -0
- package/dist/api/resources/assets/index.js +17 -0
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +3 -1
- package/dist/api/types/OperatorAsset.d.ts +64 -0
- package/dist/api/types/OperatorAsset.js +33 -0
- package/dist/api/types/User.d.ts +22 -0
- package/dist/api/types/User.js +19 -0
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -0
- 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/
|
|
39
|
-
const Client_js_2 = require("./api/resources/
|
|
40
|
-
const Client_js_3 = require("./api/resources/
|
|
41
|
-
const Client_js_4 = require("./api/resources/
|
|
42
|
-
const Client_js_5 = require("./api/resources/
|
|
43
|
-
const Client_js_6 = require("./api/resources/
|
|
44
|
-
const Client_js_7 = require("./api/resources/
|
|
45
|
-
const Client_js_8 = require("./api/resources/
|
|
46
|
-
const Client_js_9 = require("./api/resources/
|
|
47
|
-
const Client_js_10 = require("./api/resources/
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,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,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);
|
|
@@ -36,7 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.users = exports.taskAttempts = exports.realtime = exports.positions = exports.notifications = exports.notificationPreferences = exports.lookups = exports.invites = exports.files = exports.devices = void 0;
|
|
39
|
+
exports.users = exports.taskAttempts = exports.realtime = exports.positions = exports.notifications = exports.notificationPreferences = exports.lookups = exports.invites = exports.files = exports.devices = exports.assets = void 0;
|
|
40
|
+
__exportStar(require("./assets/client/requests/index.js"), exports);
|
|
41
|
+
exports.assets = __importStar(require("./assets/index.js"));
|
|
40
42
|
__exportStar(require("./devices/client/requests/index.js"), exports);
|
|
41
43
|
exports.devices = __importStar(require("./devices/index.js"));
|
|
42
44
|
__exportStar(require("./files/client/requests/index.js"), exports);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An asset as seen by an operator assigned to operate it — the operational identity fields, without the dashboard's lifecycle-management hints.
|
|
3
|
+
*/
|
|
4
|
+
export interface OperatorAsset {
|
|
5
|
+
/** Stable UUID. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Top-level kind. */
|
|
8
|
+
kind: OperatorAsset.Kind;
|
|
9
|
+
/** Sub-kind within the kind (free-form). */
|
|
10
|
+
sub_kind?: string | undefined;
|
|
11
|
+
/** SAE J3016 autonomy level 0..5. */
|
|
12
|
+
autonomy_level?: number | undefined;
|
|
13
|
+
/** Lifecycle status. */
|
|
14
|
+
status: OperatorAsset.Status;
|
|
15
|
+
/** Display name. */
|
|
16
|
+
name?: string | undefined;
|
|
17
|
+
/** Vehicle Identification Number. */
|
|
18
|
+
vin?: string | undefined;
|
|
19
|
+
/** License plate. */
|
|
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;
|
|
27
|
+
/** Owning organization id. */
|
|
28
|
+
organization_id?: string | undefined;
|
|
29
|
+
/** Current primary operator (active assignment, role=primary). */
|
|
30
|
+
current_primary_operator_id?: string | undefined;
|
|
31
|
+
/** Object type discriminator. */
|
|
32
|
+
object: OperatorAsset.Object_;
|
|
33
|
+
}
|
|
34
|
+
export declare namespace OperatorAsset {
|
|
35
|
+
/** Top-level kind. */
|
|
36
|
+
const Kind: {
|
|
37
|
+
readonly GroundVehicle: "ground_vehicle";
|
|
38
|
+
readonly AerialVehicle: "aerial_vehicle";
|
|
39
|
+
readonly MarineVehicle: "marine_vehicle";
|
|
40
|
+
readonly Robot: "robot";
|
|
41
|
+
readonly Agv: "agv";
|
|
42
|
+
readonly Trailer: "trailer";
|
|
43
|
+
readonly Container: "container";
|
|
44
|
+
readonly Pallet: "pallet";
|
|
45
|
+
readonly Equipment: "equipment";
|
|
46
|
+
};
|
|
47
|
+
type Kind = (typeof Kind)[keyof typeof Kind];
|
|
48
|
+
/** Lifecycle status. */
|
|
49
|
+
const Status: {
|
|
50
|
+
readonly Active: "active";
|
|
51
|
+
readonly Maintenance: "maintenance";
|
|
52
|
+
readonly OutOfService: "out_of_service";
|
|
53
|
+
readonly Retired: "retired";
|
|
54
|
+
readonly Sold: "sold";
|
|
55
|
+
readonly Inactive: "inactive";
|
|
56
|
+
readonly Lost: "lost";
|
|
57
|
+
};
|
|
58
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
59
|
+
/** Object type discriminator. */
|
|
60
|
+
const Object_: {
|
|
61
|
+
readonly Asset: "asset";
|
|
62
|
+
};
|
|
63
|
+
type Object_ = (typeof Object_)[keyof typeof Object_];
|
|
64
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.OperatorAsset = void 0;
|
|
5
|
+
var OperatorAsset;
|
|
6
|
+
(function (OperatorAsset) {
|
|
7
|
+
/** Top-level kind. */
|
|
8
|
+
OperatorAsset.Kind = {
|
|
9
|
+
GroundVehicle: "ground_vehicle",
|
|
10
|
+
AerialVehicle: "aerial_vehicle",
|
|
11
|
+
MarineVehicle: "marine_vehicle",
|
|
12
|
+
Robot: "robot",
|
|
13
|
+
Agv: "agv",
|
|
14
|
+
Trailer: "trailer",
|
|
15
|
+
Container: "container",
|
|
16
|
+
Pallet: "pallet",
|
|
17
|
+
Equipment: "equipment",
|
|
18
|
+
};
|
|
19
|
+
/** Lifecycle status. */
|
|
20
|
+
OperatorAsset.Status = {
|
|
21
|
+
Active: "active",
|
|
22
|
+
Maintenance: "maintenance",
|
|
23
|
+
OutOfService: "out_of_service",
|
|
24
|
+
Retired: "retired",
|
|
25
|
+
Sold: "sold",
|
|
26
|
+
Inactive: "inactive",
|
|
27
|
+
Lost: "lost",
|
|
28
|
+
};
|
|
29
|
+
/** Object type discriminator. */
|
|
30
|
+
OperatorAsset.Object_ = {
|
|
31
|
+
Asset: "asset",
|
|
32
|
+
};
|
|
33
|
+
})(OperatorAsset || (exports.OperatorAsset = OperatorAsset = {}));
|
package/dist/api/types/User.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export interface User {
|
|
|
9
9
|
/** Keycloak Organization id the user belongs to. Null for cross-tenant platform admins. */
|
|
10
10
|
organization_id?: string | undefined;
|
|
11
11
|
roles: string[];
|
|
12
|
+
/** The caller's effective permission ids for the active organization (epic #317): the union of catalog grants for every role they hold. Gate actions on these (`can("asset:create")`) rather than role strings, so frontend and backend reference the one catalog and cannot drift. Coarse and instance-independent; per-instance authority ('may delete THIS asset') is enforced server-side at the mutation, never precomputed here. */
|
|
13
|
+
permissions: User.Permissions.Item[];
|
|
12
14
|
/** Email shadowed from Keycloak. Null until the user completes a profile. */
|
|
13
15
|
email?: string | undefined;
|
|
14
16
|
/** Display name shadowed from Keycloak. */
|
|
@@ -34,6 +36,26 @@ export declare namespace User {
|
|
|
34
36
|
readonly Admin: "admin";
|
|
35
37
|
};
|
|
36
38
|
type Portal = (typeof Portal)[keyof typeof Portal];
|
|
39
|
+
type Permissions = Permissions.Item[];
|
|
40
|
+
namespace Permissions {
|
|
41
|
+
const Item: {
|
|
42
|
+
readonly AssetCreate: "asset:create";
|
|
43
|
+
readonly AssetDelete: "asset:delete";
|
|
44
|
+
readonly AssetDispose: "asset:dispose";
|
|
45
|
+
readonly AssetExport: "asset:export";
|
|
46
|
+
readonly AssetImport: "asset:import";
|
|
47
|
+
readonly AssetRead: "asset:read";
|
|
48
|
+
readonly AssetTransition: "asset:transition";
|
|
49
|
+
readonly AssetUpdate: "asset:update";
|
|
50
|
+
readonly KeycloakProjectionAdminister: "keycloak-projection:administer";
|
|
51
|
+
readonly NotificationDeliveryRead: "notification-delivery:read";
|
|
52
|
+
readonly OrgMaintenanceAdminister: "org-maintenance:administer";
|
|
53
|
+
readonly ServiceAccountAdminister: "service-account:administer";
|
|
54
|
+
readonly UserAdminister: "user:administer";
|
|
55
|
+
readonly UserInvite: "user:invite";
|
|
56
|
+
};
|
|
57
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
58
|
+
}
|
|
37
59
|
/** Object type discriminator. */
|
|
38
60
|
const Object_: {
|
|
39
61
|
readonly User: "user";
|
package/dist/api/types/User.js
CHANGED
|
@@ -14,6 +14,25 @@ var User;
|
|
|
14
14
|
PlatformStaff: "platform_staff",
|
|
15
15
|
Admin: "admin",
|
|
16
16
|
};
|
|
17
|
+
let Permissions;
|
|
18
|
+
(function (Permissions) {
|
|
19
|
+
Permissions.Item = {
|
|
20
|
+
AssetCreate: "asset:create",
|
|
21
|
+
AssetDelete: "asset:delete",
|
|
22
|
+
AssetDispose: "asset:dispose",
|
|
23
|
+
AssetExport: "asset:export",
|
|
24
|
+
AssetImport: "asset:import",
|
|
25
|
+
AssetRead: "asset:read",
|
|
26
|
+
AssetTransition: "asset:transition",
|
|
27
|
+
AssetUpdate: "asset:update",
|
|
28
|
+
KeycloakProjectionAdminister: "keycloak-projection:administer",
|
|
29
|
+
NotificationDeliveryRead: "notification-delivery:read",
|
|
30
|
+
OrgMaintenanceAdminister: "org-maintenance:administer",
|
|
31
|
+
ServiceAccountAdminister: "service-account:administer",
|
|
32
|
+
UserAdminister: "user:administer",
|
|
33
|
+
UserInvite: "user:invite",
|
|
34
|
+
};
|
|
35
|
+
})(Permissions = User.Permissions || (User.Permissions = {}));
|
|
17
36
|
/** Object type discriminator. */
|
|
18
37
|
User.Object_ = {
|
|
19
38
|
User: "user",
|
|
@@ -69,6 +69,7 @@ export * from "./NotificationsMarkedRead.js";
|
|
|
69
69
|
export * from "./NotificationUnreadCount.js";
|
|
70
70
|
export * from "./OpenAssignmentRequest.js";
|
|
71
71
|
export * from "./Operator.js";
|
|
72
|
+
export * from "./OperatorAsset.js";
|
|
72
73
|
export * from "./OperatorPosition.js";
|
|
73
74
|
export * from "./Organization.js";
|
|
74
75
|
export * from "./Position.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -85,6 +85,7 @@ __exportStar(require("./NotificationsMarkedRead.js"), exports);
|
|
|
85
85
|
__exportStar(require("./NotificationUnreadCount.js"), exports);
|
|
86
86
|
__exportStar(require("./OpenAssignmentRequest.js"), exports);
|
|
87
87
|
__exportStar(require("./Operator.js"), exports);
|
|
88
|
+
__exportStar(require("./OperatorAsset.js"), exports);
|
|
88
89
|
__exportStar(require("./OperatorPosition.js"), exports);
|
|
89
90
|
__exportStar(require("./Organization.js"), exports);
|
|
90
91
|
__exportStar(require("./Position.js"), exports);
|