@nizam-os/dashboard-sdk 1.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.
- package/dist/BaseClient.d.ts +42 -0
- package/dist/BaseClient.js +80 -0
- package/dist/Client.d.ts +44 -0
- package/dist/Client.js +94 -0
- package/dist/api/errors/ConflictError.d.ts +6 -0
- package/dist/api/errors/ConflictError.js +54 -0
- package/dist/api/errors/ForbiddenError.d.ts +6 -0
- package/dist/api/errors/ForbiddenError.js +54 -0
- package/dist/api/errors/GoneError.d.ts +6 -0
- package/dist/api/errors/GoneError.js +54 -0
- package/dist/api/errors/InternalServerError.d.ts +6 -0
- package/dist/api/errors/InternalServerError.js +54 -0
- package/dist/api/errors/NotFoundError.d.ts +6 -0
- package/dist/api/errors/NotFoundError.js +54 -0
- package/dist/api/errors/UnauthorizedError.d.ts +6 -0
- package/dist/api/errors/UnauthorizedError.js +54 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +6 -0
- package/dist/api/errors/UnprocessableEntityError.js +54 -0
- package/dist/api/errors/index.d.ts +7 -0
- package/dist/api/errors/index.js +23 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/assets/client/Client.d.ts +52 -0
- package/dist/api/resources/assets/client/Client.js +173 -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/CreateAssetRequest.d.ts +31 -0
- package/dist/api/resources/assets/client/requests/CreateAssetRequest.js +19 -0
- package/dist/api/resources/assets/client/requests/GetAssetRequest.d.ts +9 -0
- package/dist/api/resources/assets/client/requests/GetAssetRequest.js +3 -0
- package/dist/api/resources/assets/client/requests/index.d.ts +2 -0
- package/dist/api/resources/assets/client/requests/index.js +5 -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/assignments/client/Client.d.ts +74 -0
- package/dist/api/resources/assignments/client/Client.js +245 -0
- package/dist/api/resources/assignments/client/index.d.ts +1 -0
- package/dist/api/resources/assignments/client/index.js +17 -0
- package/dist/api/resources/assignments/client/requests/CloseAssignmentRequest.d.ts +26 -0
- package/dist/api/resources/assignments/client/requests/CloseAssignmentRequest.js +18 -0
- package/dist/api/resources/assignments/client/requests/GetAssignmentRequest.d.ts +9 -0
- package/dist/api/resources/assignments/client/requests/GetAssignmentRequest.js +3 -0
- package/dist/api/resources/assignments/client/requests/OpenAssignmentRequest.d.ts +27 -0
- package/dist/api/resources/assignments/client/requests/OpenAssignmentRequest.js +15 -0
- package/dist/api/resources/assignments/client/requests/index.d.ts +3 -0
- package/dist/api/resources/assignments/client/requests/index.js +7 -0
- package/dist/api/resources/assignments/exports.d.ts +2 -0
- package/dist/api/resources/assignments/exports.js +21 -0
- package/dist/api/resources/assignments/index.d.ts +1 -0
- package/dist/api/resources/assignments/index.js +17 -0
- package/dist/api/resources/identity/client/Client.d.ts +114 -0
- package/dist/api/resources/identity/client/Client.js +373 -0
- package/dist/api/resources/identity/client/index.d.ts +1 -0
- package/dist/api/resources/identity/client/index.js +17 -0
- package/dist/api/resources/identity/client/requests/InviteUserRequest.d.ts +13 -0
- package/dist/api/resources/identity/client/requests/InviteUserRequest.js +3 -0
- package/dist/api/resources/identity/client/requests/ListUsersRequest.d.ts +10 -0
- package/dist/api/resources/identity/client/requests/ListUsersRequest.js +3 -0
- package/dist/api/resources/identity/client/requests/SoftDeleteUserRequest.d.ts +9 -0
- package/dist/api/resources/identity/client/requests/SoftDeleteUserRequest.js +3 -0
- package/dist/api/resources/identity/client/requests/UserUpdateRequest.d.ts +15 -0
- package/dist/api/resources/identity/client/requests/UserUpdateRequest.js +3 -0
- package/dist/api/resources/identity/client/requests/index.d.ts +4 -0
- package/dist/api/resources/identity/client/requests/index.js +2 -0
- package/dist/api/resources/identity/exports.d.ts +2 -0
- package/dist/api/resources/identity/exports.js +21 -0
- package/dist/api/resources/identity/index.d.ts +1 -0
- package/dist/api/resources/identity/index.js +17 -0
- package/dist/api/resources/index.d.ts +13 -0
- package/dist/api/resources/index.js +52 -0
- package/dist/api/resources/invites/client/Client.d.ts +58 -0
- package/dist/api/resources/invites/client/Client.js +187 -0
- package/dist/api/resources/invites/client/index.d.ts +1 -0
- package/dist/api/resources/invites/client/index.js +17 -0
- package/dist/api/resources/invites/client/requests/AcceptInviteRequest.d.ts +10 -0
- package/dist/api/resources/invites/client/requests/AcceptInviteRequest.js +3 -0
- package/dist/api/resources/invites/client/requests/CreateInviteRequest.d.ts +32 -0
- package/dist/api/resources/invites/client/requests/CreateInviteRequest.js +17 -0
- package/dist/api/resources/invites/client/requests/index.d.ts +2 -0
- package/dist/api/resources/invites/client/requests/index.js +5 -0
- package/dist/api/resources/invites/exports.d.ts +2 -0
- package/dist/api/resources/invites/exports.js +21 -0
- package/dist/api/resources/invites/index.d.ts +1 -0
- package/dist/api/resources/invites/index.js +17 -0
- package/dist/api/resources/lookups/client/Client.d.ts +27 -0
- package/dist/api/resources/lookups/client/Client.js +100 -0
- package/dist/api/resources/lookups/client/index.d.ts +1 -0
- package/dist/api/resources/lookups/client/index.js +2 -0
- package/dist/api/resources/lookups/exports.d.ts +2 -0
- package/dist/api/resources/lookups/exports.js +21 -0
- package/dist/api/resources/lookups/index.d.ts +1 -0
- package/dist/api/resources/lookups/index.js +17 -0
- package/dist/api/resources/operators/client/Client.d.ts +66 -0
- package/dist/api/resources/operators/client/Client.js +187 -0
- package/dist/api/resources/operators/client/index.d.ts +1 -0
- package/dist/api/resources/operators/client/index.js +17 -0
- package/dist/api/resources/operators/client/requests/GetOperatorRequest.d.ts +9 -0
- package/dist/api/resources/operators/client/requests/GetOperatorRequest.js +3 -0
- package/dist/api/resources/operators/client/requests/index.d.ts +1 -0
- package/dist/api/resources/operators/client/requests/index.js +2 -0
- package/dist/api/resources/operators/exports.d.ts +2 -0
- package/dist/api/resources/operators/exports.js +21 -0
- package/dist/api/resources/operators/index.d.ts +1 -0
- package/dist/api/resources/operators/index.js +17 -0
- package/dist/api/resources/organizations/client/Client.d.ts +136 -0
- package/dist/api/resources/organizations/client/Client.js +432 -0
- package/dist/api/resources/organizations/client/index.d.ts +1 -0
- package/dist/api/resources/organizations/client/index.js +17 -0
- package/dist/api/resources/organizations/client/requests/CreateOrganizationRequest.d.ts +28 -0
- package/dist/api/resources/organizations/client/requests/CreateOrganizationRequest.js +3 -0
- package/dist/api/resources/organizations/client/requests/DeleteOrganizationRequest.d.ts +9 -0
- package/dist/api/resources/organizations/client/requests/DeleteOrganizationRequest.js +3 -0
- package/dist/api/resources/organizations/client/requests/GetOrganizationRequest.d.ts +9 -0
- package/dist/api/resources/organizations/client/requests/GetOrganizationRequest.js +3 -0
- package/dist/api/resources/organizations/client/requests/LeaveOrganizationRequest.d.ts +9 -0
- package/dist/api/resources/organizations/client/requests/LeaveOrganizationRequest.js +3 -0
- package/dist/api/resources/organizations/client/requests/UpdateOrganizationRequest.d.ts +27 -0
- package/dist/api/resources/organizations/client/requests/UpdateOrganizationRequest.js +3 -0
- package/dist/api/resources/organizations/client/requests/index.d.ts +5 -0
- package/dist/api/resources/organizations/client/requests/index.js +2 -0
- package/dist/api/resources/organizations/exports.d.ts +2 -0
- package/dist/api/resources/organizations/exports.js +21 -0
- package/dist/api/resources/organizations/index.d.ts +1 -0
- package/dist/api/resources/organizations/index.js +17 -0
- package/dist/api/types/ApiFieldError.d.ts +11 -0
- package/dist/api/types/ApiFieldError.js +3 -0
- package/dist/api/types/Asset.d.ts +58 -0
- package/dist/api/types/Asset.js +33 -0
- package/dist/api/types/Assignment.d.ts +49 -0
- package/dist/api/types/Assignment.js +30 -0
- package/dist/api/types/CreateAutonomousOperatorRequest.d.ts +15 -0
- package/dist/api/types/CreateAutonomousOperatorRequest.js +3 -0
- package/dist/api/types/CreateHumanOperatorRequest.d.ts +17 -0
- package/dist/api/types/CreateHumanOperatorRequest.js +3 -0
- package/dist/api/types/CreateOperatorRequest.d.ts +16 -0
- package/dist/api/types/CreateOperatorRequest.js +3 -0
- package/dist/api/types/CreateTeleoperatedOperatorRequest.d.ts +11 -0
- package/dist/api/types/CreateTeleoperatedOperatorRequest.js +3 -0
- package/dist/api/types/InternalUserUpdateRequest.d.ts +21 -0
- package/dist/api/types/InternalUserUpdateRequest.js +14 -0
- package/dist/api/types/Invite.d.ts +47 -0
- package/dist/api/types/Invite.js +28 -0
- package/dist/api/types/ListResponse.d.ts +23 -0
- package/dist/api/types/ListResponse.js +11 -0
- package/dist/api/types/Operator.d.ts +45 -0
- package/dist/api/types/Operator.js +26 -0
- package/dist/api/types/Organization.d.ts +35 -0
- package/dist/api/types/Organization.js +17 -0
- package/dist/api/types/OrganizationMembership.d.ts +29 -0
- package/dist/api/types/OrganizationMembership.js +21 -0
- package/dist/api/types/ProblemDetail.d.ts +21 -0
- package/dist/api/types/ProblemDetail.js +3 -0
- package/dist/api/types/User.d.ts +40 -0
- package/dist/api/types/User.js +21 -0
- package/dist/api/types/UserResource.d.ts +34 -0
- package/dist/api/types/UserResource.js +18 -0
- package/dist/api/types/index.d.ts +16 -0
- package/dist/api/types/index.js +32 -0
- package/dist/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/auth/BearerAuthProvider.js +68 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +5 -0
- package/dist/core/auth/AuthProvider.d.ts +8 -0
- package/dist/core/auth/AuthProvider.js +9 -0
- package/dist/core/auth/AuthRequest.d.ts +9 -0
- package/dist/core/auth/AuthRequest.js +2 -0
- package/dist/core/auth/BasicAuth.d.ts +8 -0
- package/dist/core/auth/BasicAuth.js +32 -0
- package/dist/core/auth/BearerToken.d.ts +7 -0
- package/dist/core/auth/BearerToken.js +16 -0
- package/dist/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/core/auth/index.d.ts +5 -0
- package/dist/core/auth/index.js +11 -0
- package/dist/core/base64.d.ts +2 -0
- package/dist/core/base64.js +26 -0
- package/dist/core/exports.d.ts +1 -0
- package/dist/core/exports.js +17 -0
- package/dist/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/core/fetcher/BinaryResponse.js +17 -0
- package/dist/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/core/fetcher/EndpointSupplier.js +13 -0
- package/dist/core/fetcher/Fetcher.d.ts +56 -0
- package/dist/core/fetcher/Fetcher.js +310 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +92 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +13 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +8 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +33 -0
- package/dist/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/core/fetcher/getFetchFn.js +6 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +16 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +58 -0
- package/dist/core/fetcher/index.d.ts +13 -0
- package/dist/core/fetcher/index.js +19 -0
- package/dist/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/core/fetcher/makePassthroughRequest.js +122 -0
- package/dist/core/fetcher/makeRequest.d.ts +6 -0
- package/dist/core/fetcher/makeRequest.js +59 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +59 -0
- package/dist/core/fetcher/signals.d.ts +5 -0
- package/dist/core/fetcher/signals.js +24 -0
- package/dist/core/headers.d.ts +2 -0
- package/dist/core/headers.js +31 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +45 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/logging/exports.d.ts +18 -0
- package/dist/core/logging/exports.js +45 -0
- package/dist/core/logging/index.d.ts +1 -0
- package/dist/core/logging/index.js +17 -0
- package/dist/core/logging/logger.d.ts +126 -0
- package/dist/core/logging/logger.js +143 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/core/url/QueryStringBuilder.js +83 -0
- package/dist/core/url/encodePathParam.d.ts +1 -0
- package/dist/core/url/encodePathParam.js +21 -0
- package/dist/core/url/index.d.ts +4 -0
- package/dist/core/url/index.js +11 -0
- package/dist/core/url/join.d.ts +1 -0
- package/dist/core/url/join.js +68 -0
- package/dist/core/url/qs.d.ts +7 -0
- package/dist/core/url/qs.js +79 -0
- package/dist/environments.d.ts +4 -0
- package/dist/environments.js +7 -0
- package/dist/errors/NizamDashboardError.d.ts +14 -0
- package/dist/errors/NizamDashboardError.js +35 -0
- package/dist/errors/NizamDashboardTimeoutError.d.ts +6 -0
- package/dist/errors/NizamDashboardTimeoutError.js +18 -0
- package/dist/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/errors/handleNonStatusCodeError.js +68 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/exports.d.ts +1 -0
- package/dist/exports.js +17 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +48 -0
- package/package.json +35 -0
|
@@ -0,0 +1,187 @@
|
|
|
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.OperatorsClient = 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 NizamDashboard = __importStar(require("../../../index.js"));
|
|
45
|
+
/**
|
|
46
|
+
* Universal controlling-agent master — humans, autonomous software, teleoperators, hybrids. Kind-discriminated.
|
|
47
|
+
*/
|
|
48
|
+
class OperatorsClient {
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates a new operator (human, autonomous software, or teleoperated). The `kind` discriminator selects the variant.
|
|
54
|
+
*
|
|
55
|
+
* @param {NizamDashboard.CreateOperatorRequest} request
|
|
56
|
+
* @param {OperatorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
59
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
60
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
61
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await client.operators.createOperator({
|
|
65
|
+
* kind: "human"
|
|
66
|
+
* })
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.operators.createOperator({
|
|
70
|
+
* kind: "autonomous",
|
|
71
|
+
* vendor: "Waymo",
|
|
72
|
+
* product: "Waymo Driver",
|
|
73
|
+
* version: "7.3",
|
|
74
|
+
* responsible_party: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
|
|
75
|
+
* })
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.operators.createOperator({
|
|
79
|
+
* kind: "teleoperated",
|
|
80
|
+
* controller_user_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
|
|
81
|
+
* responsible_party: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f"
|
|
82
|
+
* })
|
|
83
|
+
*/
|
|
84
|
+
createOperator(request, requestOptions) {
|
|
85
|
+
return core.HttpResponsePromise.fromPromise(this.__createOperator(request, requestOptions));
|
|
86
|
+
}
|
|
87
|
+
async __createOperator(request, requestOptions) {
|
|
88
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
89
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
90
|
+
const _response = await core.fetcher({
|
|
91
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
92
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
93
|
+
environments.NizamDashboardEnvironment.Production, "v1/operators"),
|
|
94
|
+
method: "POST",
|
|
95
|
+
headers: _headers,
|
|
96
|
+
contentType: "application/json",
|
|
97
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
98
|
+
requestType: "json",
|
|
99
|
+
body: request,
|
|
100
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
101
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
102
|
+
abortSignal: requestOptions?.abortSignal,
|
|
103
|
+
fetchFn: this._options?.fetch,
|
|
104
|
+
logging: this._options.logging,
|
|
105
|
+
});
|
|
106
|
+
if (_response.ok) {
|
|
107
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
108
|
+
}
|
|
109
|
+
if (_response.error.reason === "status-code") {
|
|
110
|
+
switch (_response.error.statusCode) {
|
|
111
|
+
case 401:
|
|
112
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
113
|
+
case 403:
|
|
114
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 422:
|
|
116
|
+
throw new NizamDashboard.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 500:
|
|
118
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
119
|
+
default:
|
|
120
|
+
throw new errors.NizamDashboardError({
|
|
121
|
+
statusCode: _response.error.statusCode,
|
|
122
|
+
body: _response.error.body,
|
|
123
|
+
rawResponse: _response.rawResponse,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/operators");
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @param {NizamDashboard.GetOperatorRequest} request
|
|
131
|
+
* @param {OperatorsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
132
|
+
*
|
|
133
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
134
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
135
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
136
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* await client.operators.getOperator({
|
|
140
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
141
|
+
* })
|
|
142
|
+
*/
|
|
143
|
+
getOperator(request, requestOptions) {
|
|
144
|
+
return core.HttpResponsePromise.fromPromise(this.__getOperator(request, requestOptions));
|
|
145
|
+
}
|
|
146
|
+
async __getOperator(request, requestOptions) {
|
|
147
|
+
const { id } = request;
|
|
148
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
149
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
150
|
+
const _response = await core.fetcher({
|
|
151
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
152
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
153
|
+
environments.NizamDashboardEnvironment.Production, `v1/operators/${core.url.encodePathParam(id)}`),
|
|
154
|
+
method: "GET",
|
|
155
|
+
headers: _headers,
|
|
156
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
157
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
158
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
159
|
+
abortSignal: requestOptions?.abortSignal,
|
|
160
|
+
fetchFn: this._options?.fetch,
|
|
161
|
+
logging: this._options.logging,
|
|
162
|
+
});
|
|
163
|
+
if (_response.ok) {
|
|
164
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
165
|
+
}
|
|
166
|
+
if (_response.error.reason === "status-code") {
|
|
167
|
+
switch (_response.error.statusCode) {
|
|
168
|
+
case 401:
|
|
169
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
170
|
+
case 403:
|
|
171
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
172
|
+
case 404:
|
|
173
|
+
throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
|
|
174
|
+
case 500:
|
|
175
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
176
|
+
default:
|
|
177
|
+
throw new errors.NizamDashboardError({
|
|
178
|
+
statusCode: _response.error.statusCode,
|
|
179
|
+
body: _response.error.body,
|
|
180
|
+
rawResponse: _response.rawResponse,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/operators/{id}");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.OperatorsClient = OperatorsClient;
|
|
@@ -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 @@
|
|
|
1
|
+
export type { GetOperatorRequest } from "./GetOperatorRequest.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.OperatorsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "OperatorsClient", { enumerable: true, get: function () { return Client_js_1.OperatorsClient; } });
|
|
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);
|
|
@@ -0,0 +1,136 @@
|
|
|
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 NizamDashboard from "../../../index.js";
|
|
5
|
+
export declare namespace OrganizationsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Tenants — the top-level container for users, merchants, and operations.
|
|
12
|
+
*/
|
|
13
|
+
export declare class OrganizationsClient {
|
|
14
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationsClient.Options>;
|
|
15
|
+
constructor(options: OrganizationsClient.Options);
|
|
16
|
+
/**
|
|
17
|
+
* Returns every organization the calling user is a member of, with their role inside.
|
|
18
|
+
*
|
|
19
|
+
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
22
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
23
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* await client.organizations.listMyOrganizations()
|
|
27
|
+
*/
|
|
28
|
+
listMyOrganizations(requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.OrganizationMembership[]>;
|
|
29
|
+
private __listMyOrganizations;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a brand-new tenant with the calling user as the founding admin. The id is assigned by Keycloak so the same value identifies the organization in both systems. Slug is derived from the name when not supplied.
|
|
32
|
+
*
|
|
33
|
+
* @param {NizamDashboard.CreateOrganizationRequest} request
|
|
34
|
+
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
37
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
38
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
39
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
40
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.organizations.createOrganization({
|
|
44
|
+
* name: "Acme Logistics",
|
|
45
|
+
* slug: "acme-logistics",
|
|
46
|
+
* primary_domain: "acme.com",
|
|
47
|
+
* business_category: "third_party_logistics",
|
|
48
|
+
* phone: "+15551234567",
|
|
49
|
+
* country: "US",
|
|
50
|
+
* timezone: "America/Los_Angeles"
|
|
51
|
+
* })
|
|
52
|
+
*/
|
|
53
|
+
createOrganization(request: NizamDashboard.CreateOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Organization>;
|
|
54
|
+
private __createOrganization;
|
|
55
|
+
/**
|
|
56
|
+
* Returns one organization. RLS narrows visibility — non-members get 404 indistinguishable from a non-existent id (prevents tenant probing).
|
|
57
|
+
*
|
|
58
|
+
* @param {NizamDashboard.GetOrganizationRequest} request
|
|
59
|
+
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
|
+
*
|
|
61
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
62
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
63
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
64
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.organizations.getOrganization({
|
|
68
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
getOrganization(request: NizamDashboard.GetOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Organization>;
|
|
72
|
+
private __getOrganization;
|
|
73
|
+
/**
|
|
74
|
+
* Owner-only. Sets `deleted_at` on the organizations row; subsequent reads filter it out. The Keycloak Organization is intentionally left in place — restore is just an UPDATE un-setting `deleted_at`. Members are not removed; their memberships persist alongside the soft-deleted row in case a restore path is added later.
|
|
75
|
+
*
|
|
76
|
+
* @param {NizamDashboard.DeleteOrganizationRequest} request
|
|
77
|
+
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
80
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
81
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
82
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* await client.organizations.deleteOrganization({
|
|
86
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
87
|
+
* })
|
|
88
|
+
*/
|
|
89
|
+
deleteOrganization(request: NizamDashboard.DeleteOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
90
|
+
private __deleteOrganization;
|
|
91
|
+
/**
|
|
92
|
+
* Set-only partial update. Null/omitted fields stay unchanged. A slug rename also renames the Keycloak Organization's alias inside the same transaction so the two stay in lockstep.
|
|
93
|
+
*
|
|
94
|
+
* @param {NizamDashboard.UpdateOrganizationRequest} request
|
|
95
|
+
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
98
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
99
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
100
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
101
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
102
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* await client.organizations.updateOrganization({
|
|
106
|
+
* id: "00000000-0000-0000-0000-000000000000",
|
|
107
|
+
* name: "Acme Logistics",
|
|
108
|
+
* slug: "acme-logistics",
|
|
109
|
+
* business_category: "third_party_logistics",
|
|
110
|
+
* phone: "+15551234567",
|
|
111
|
+
* country: "US",
|
|
112
|
+
* timezone: "America/Los_Angeles"
|
|
113
|
+
* })
|
|
114
|
+
*/
|
|
115
|
+
updateOrganization(request: NizamDashboard.UpdateOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Organization>;
|
|
116
|
+
private __updateOrganization;
|
|
117
|
+
/**
|
|
118
|
+
* Removes the caller's membership from the organization. The owner cannot leave — they must transfer ownership (future endpoint) or delete the org instead.
|
|
119
|
+
*
|
|
120
|
+
* @param {NizamDashboard.LeaveOrganizationRequest} request
|
|
121
|
+
* @param {OrganizationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
122
|
+
*
|
|
123
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
124
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
125
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
126
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
127
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* await client.organizations.leaveOrganization({
|
|
131
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
132
|
+
* })
|
|
133
|
+
*/
|
|
134
|
+
leaveOrganization(request: NizamDashboard.LeaveOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
135
|
+
private __leaveOrganization;
|
|
136
|
+
}
|