@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,373 @@
|
|
|
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.IdentityClient = 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
|
+
* Users, organizations, and the active session.
|
|
47
|
+
*/
|
|
48
|
+
class IdentityClient {
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns the authenticated user merged with profile claims from their JWT.
|
|
54
|
+
*
|
|
55
|
+
* JIT-provisions a shadow row on the first call (so a brand-new Keycloak user can hit any
|
|
56
|
+
* endpoint without an explicit signup step) and stamps `last_login_at` + increments
|
|
57
|
+
* `login_count` on every subsequent call.
|
|
58
|
+
*
|
|
59
|
+
* The `roles` array combines realm roles (flat, e.g. `platform_admin`) with portal-scoped
|
|
60
|
+
* client roles (prefixed, e.g. `dashboard:dispatcher`). The frontend usually drops the
|
|
61
|
+
* portal prefix when rendering since it knows its own portal.
|
|
62
|
+
*
|
|
63
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
66
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
67
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
68
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await client.identity.me()
|
|
72
|
+
*/
|
|
73
|
+
me(requestOptions) {
|
|
74
|
+
return core.HttpResponsePromise.fromPromise(this.__me(requestOptions));
|
|
75
|
+
}
|
|
76
|
+
async __me(requestOptions) {
|
|
77
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
78
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
79
|
+
const _response = await core.fetcher({
|
|
80
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
81
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
82
|
+
environments.NizamDashboardEnvironment.Production, "v1/me"),
|
|
83
|
+
method: "GET",
|
|
84
|
+
headers: _headers,
|
|
85
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
86
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
87
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
88
|
+
abortSignal: requestOptions?.abortSignal,
|
|
89
|
+
fetchFn: this._options?.fetch,
|
|
90
|
+
logging: this._options.logging,
|
|
91
|
+
});
|
|
92
|
+
if (_response.ok) {
|
|
93
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
94
|
+
}
|
|
95
|
+
if (_response.error.reason === "status-code") {
|
|
96
|
+
switch (_response.error.statusCode) {
|
|
97
|
+
case 401:
|
|
98
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
99
|
+
case 403:
|
|
100
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
101
|
+
case 409:
|
|
102
|
+
throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
|
|
103
|
+
case 500:
|
|
104
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
105
|
+
default:
|
|
106
|
+
throw new errors.NizamDashboardError({
|
|
107
|
+
statusCode: _response.error.statusCode,
|
|
108
|
+
body: _response.error.body,
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me");
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Dashboard sees the active set; platform staff additionally see soft-deleted rows and may sort by `deleted_at`.
|
|
117
|
+
*
|
|
118
|
+
* @param {NizamDashboard.ListUsersRequest} request
|
|
119
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
|
+
*
|
|
121
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
122
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
123
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* await client.identity.listUsers()
|
|
127
|
+
*/
|
|
128
|
+
listUsers(request = {}, requestOptions) {
|
|
129
|
+
return core.HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions));
|
|
130
|
+
}
|
|
131
|
+
async __listUsers(request = {}, requestOptions) {
|
|
132
|
+
const { limit, offset, sort } = request;
|
|
133
|
+
const _queryParams = {
|
|
134
|
+
limit,
|
|
135
|
+
offset,
|
|
136
|
+
sort,
|
|
137
|
+
};
|
|
138
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
139
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
140
|
+
const _response = await core.fetcher({
|
|
141
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
142
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
143
|
+
environments.NizamDashboardEnvironment.Production, "v1/users"),
|
|
144
|
+
method: "GET",
|
|
145
|
+
headers: _headers,
|
|
146
|
+
queryString: core.url
|
|
147
|
+
.queryBuilder()
|
|
148
|
+
.addMany(_queryParams)
|
|
149
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
150
|
+
.build(),
|
|
151
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
152
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
153
|
+
abortSignal: requestOptions?.abortSignal,
|
|
154
|
+
fetchFn: this._options?.fetch,
|
|
155
|
+
logging: this._options.logging,
|
|
156
|
+
});
|
|
157
|
+
if (_response.ok) {
|
|
158
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
159
|
+
}
|
|
160
|
+
if (_response.error.reason === "status-code") {
|
|
161
|
+
switch (_response.error.statusCode) {
|
|
162
|
+
case 401:
|
|
163
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
164
|
+
case 403:
|
|
165
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
166
|
+
case 500:
|
|
167
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
168
|
+
default:
|
|
169
|
+
throw new errors.NizamDashboardError({
|
|
170
|
+
statusCode: _response.error.statusCode,
|
|
171
|
+
body: _response.error.body,
|
|
172
|
+
rawResponse: _response.rawResponse,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Tenant-admin operation. Creates a placeholder User row that JIT provisioning replaces once the recipient completes Keycloak signup.
|
|
180
|
+
*
|
|
181
|
+
* @param {NizamDashboard.InviteUserRequest} request
|
|
182
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
183
|
+
*
|
|
184
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
185
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
186
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
187
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
188
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* await client.identity.inviteUser({
|
|
192
|
+
* email: "newhire@acme.example",
|
|
193
|
+
* name: "New Hire"
|
|
194
|
+
* })
|
|
195
|
+
*/
|
|
196
|
+
inviteUser(request, requestOptions) {
|
|
197
|
+
return core.HttpResponsePromise.fromPromise(this.__inviteUser(request, requestOptions));
|
|
198
|
+
}
|
|
199
|
+
async __inviteUser(request, requestOptions) {
|
|
200
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
201
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
202
|
+
const _response = await core.fetcher({
|
|
203
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
204
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
205
|
+
environments.NizamDashboardEnvironment.Production, "v1/users"),
|
|
206
|
+
method: "POST",
|
|
207
|
+
headers: _headers,
|
|
208
|
+
contentType: "application/json",
|
|
209
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
210
|
+
requestType: "json",
|
|
211
|
+
body: request,
|
|
212
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
213
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
214
|
+
abortSignal: requestOptions?.abortSignal,
|
|
215
|
+
fetchFn: this._options?.fetch,
|
|
216
|
+
logging: this._options.logging,
|
|
217
|
+
});
|
|
218
|
+
if (_response.ok) {
|
|
219
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
220
|
+
}
|
|
221
|
+
if (_response.error.reason === "status-code") {
|
|
222
|
+
switch (_response.error.statusCode) {
|
|
223
|
+
case 401:
|
|
224
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
225
|
+
case 403:
|
|
226
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
227
|
+
case 409:
|
|
228
|
+
throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
|
|
229
|
+
case 422:
|
|
230
|
+
throw new NizamDashboard.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
231
|
+
case 500:
|
|
232
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
233
|
+
default:
|
|
234
|
+
throw new errors.NizamDashboardError({
|
|
235
|
+
statusCode: _response.error.statusCode,
|
|
236
|
+
body: _response.error.body,
|
|
237
|
+
rawResponse: _response.rawResponse,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/users");
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Tenant-admin operation. Sets `deleted_at = NOW()`. Subsequent dashboard reads filter the row out; platform staff can still surface and act on it.
|
|
245
|
+
*
|
|
246
|
+
* @param {NizamDashboard.SoftDeleteUserRequest} request
|
|
247
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
248
|
+
*
|
|
249
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
250
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
251
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
252
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* await client.identity.softDeleteUser({
|
|
256
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
257
|
+
* })
|
|
258
|
+
*/
|
|
259
|
+
softDeleteUser(request, requestOptions) {
|
|
260
|
+
return core.HttpResponsePromise.fromPromise(this.__softDeleteUser(request, requestOptions));
|
|
261
|
+
}
|
|
262
|
+
async __softDeleteUser(request, requestOptions) {
|
|
263
|
+
const { id } = request;
|
|
264
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
265
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
266
|
+
const _response = await core.fetcher({
|
|
267
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
268
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
269
|
+
environments.NizamDashboardEnvironment.Production, `v1/users/${core.url.encodePathParam(id)}`),
|
|
270
|
+
method: "DELETE",
|
|
271
|
+
headers: _headers,
|
|
272
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
273
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
274
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
275
|
+
abortSignal: requestOptions?.abortSignal,
|
|
276
|
+
fetchFn: this._options?.fetch,
|
|
277
|
+
logging: this._options.logging,
|
|
278
|
+
});
|
|
279
|
+
if (_response.ok) {
|
|
280
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
281
|
+
}
|
|
282
|
+
if (_response.error.reason === "status-code") {
|
|
283
|
+
switch (_response.error.statusCode) {
|
|
284
|
+
case 401:
|
|
285
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
286
|
+
case 403:
|
|
287
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
288
|
+
case 404:
|
|
289
|
+
throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
|
|
290
|
+
case 500:
|
|
291
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
292
|
+
default:
|
|
293
|
+
throw new errors.NizamDashboardError({
|
|
294
|
+
statusCode: _response.error.statusCode,
|
|
295
|
+
body: _response.error.body,
|
|
296
|
+
rawResponse: _response.rawResponse,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/users/{id}");
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Tenant-admin operation. Body has no `status` — lifecycle changes go through the platform-staff surface.
|
|
304
|
+
*
|
|
305
|
+
* @param {NizamDashboard.UserUpdateRequest} request
|
|
306
|
+
* @param {IdentityClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
307
|
+
*
|
|
308
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
309
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
310
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
311
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
312
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
313
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* await client.identity.updateUser({
|
|
317
|
+
* id: "00000000-0000-0000-0000-000000000000",
|
|
318
|
+
* email: "renamed@acme.example",
|
|
319
|
+
* name: "Ali Issa"
|
|
320
|
+
* })
|
|
321
|
+
*/
|
|
322
|
+
updateUser(request, requestOptions) {
|
|
323
|
+
return core.HttpResponsePromise.fromPromise(this.__updateUser(request, requestOptions));
|
|
324
|
+
}
|
|
325
|
+
async __updateUser(request, requestOptions) {
|
|
326
|
+
const { id, ..._body } = request;
|
|
327
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
328
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
329
|
+
const _response = await core.fetcher({
|
|
330
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
331
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
332
|
+
environments.NizamDashboardEnvironment.Production, `v1/users/${core.url.encodePathParam(id)}`),
|
|
333
|
+
method: "PATCH",
|
|
334
|
+
headers: _headers,
|
|
335
|
+
contentType: "application/json",
|
|
336
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
337
|
+
requestType: "json",
|
|
338
|
+
body: _body,
|
|
339
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
340
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
341
|
+
abortSignal: requestOptions?.abortSignal,
|
|
342
|
+
fetchFn: this._options?.fetch,
|
|
343
|
+
logging: this._options.logging,
|
|
344
|
+
});
|
|
345
|
+
if (_response.ok) {
|
|
346
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
347
|
+
}
|
|
348
|
+
if (_response.error.reason === "status-code") {
|
|
349
|
+
switch (_response.error.statusCode) {
|
|
350
|
+
case 401:
|
|
351
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
352
|
+
case 403:
|
|
353
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
354
|
+
case 404:
|
|
355
|
+
throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
|
|
356
|
+
case 409:
|
|
357
|
+
throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
|
|
358
|
+
case 422:
|
|
359
|
+
throw new NizamDashboard.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
360
|
+
case 500:
|
|
361
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
362
|
+
default:
|
|
363
|
+
throw new errors.NizamDashboardError({
|
|
364
|
+
statusCode: _response.error.statusCode,
|
|
365
|
+
body: _response.error.body,
|
|
366
|
+
rawResponse: _response.rawResponse,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/users/{id}");
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
exports.IdentityClient = IdentityClient;
|
|
@@ -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,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {}
|
|
4
|
+
*/
|
|
5
|
+
export interface ListUsersRequest {
|
|
6
|
+
limit?: number;
|
|
7
|
+
offset?: number;
|
|
8
|
+
/** Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */
|
|
9
|
+
sort?: string | string[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "00000000-0000-0000-0000-000000000000",
|
|
5
|
+
* email: "renamed@acme.example",
|
|
6
|
+
* name: "Ali Issa"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface UserUpdateRequest {
|
|
10
|
+
id: string;
|
|
11
|
+
/** New email (optional). */
|
|
12
|
+
email?: string;
|
|
13
|
+
/** New display name (optional). */
|
|
14
|
+
name?: 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.IdentityClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "IdentityClient", { enumerable: true, get: function () { return Client_js_1.IdentityClient; } });
|
|
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,13 @@
|
|
|
1
|
+
export * from "./assets/client/requests/index.js";
|
|
2
|
+
export * as assets from "./assets/index.js";
|
|
3
|
+
export * from "./assignments/client/requests/index.js";
|
|
4
|
+
export * as assignments from "./assignments/index.js";
|
|
5
|
+
export * from "./identity/client/requests/index.js";
|
|
6
|
+
export * as identity from "./identity/index.js";
|
|
7
|
+
export * from "./invites/client/requests/index.js";
|
|
8
|
+
export * as invites from "./invites/index.js";
|
|
9
|
+
export * as lookups from "./lookups/index.js";
|
|
10
|
+
export * from "./operators/client/requests/index.js";
|
|
11
|
+
export * as operators from "./operators/index.js";
|
|
12
|
+
export * from "./organizations/client/requests/index.js";
|
|
13
|
+
export * as organizations from "./organizations/index.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.organizations = exports.operators = exports.lookups = exports.invites = exports.identity = exports.assignments = exports.assets = void 0;
|
|
40
|
+
__exportStar(require("./assets/client/requests/index.js"), exports);
|
|
41
|
+
exports.assets = __importStar(require("./assets/index.js"));
|
|
42
|
+
__exportStar(require("./assignments/client/requests/index.js"), exports);
|
|
43
|
+
exports.assignments = __importStar(require("./assignments/index.js"));
|
|
44
|
+
__exportStar(require("./identity/client/requests/index.js"), exports);
|
|
45
|
+
exports.identity = __importStar(require("./identity/index.js"));
|
|
46
|
+
__exportStar(require("./invites/client/requests/index.js"), exports);
|
|
47
|
+
exports.invites = __importStar(require("./invites/index.js"));
|
|
48
|
+
exports.lookups = __importStar(require("./lookups/index.js"));
|
|
49
|
+
__exportStar(require("./operators/client/requests/index.js"), exports);
|
|
50
|
+
exports.operators = __importStar(require("./operators/index.js"));
|
|
51
|
+
__exportStar(require("./organizations/client/requests/index.js"), exports);
|
|
52
|
+
exports.organizations = __importStar(require("./organizations/index.js"));
|
|
@@ -0,0 +1,58 @@
|
|
|
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 InvitesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Org-admin invites and recipient acceptance.
|
|
12
|
+
*/
|
|
13
|
+
export declare class InvitesClient {
|
|
14
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<InvitesClient.Options>;
|
|
15
|
+
constructor(options: InvitesClient.Options);
|
|
16
|
+
/**
|
|
17
|
+
* Persists a pending invite and emails the recipient with the accept link.
|
|
18
|
+
*
|
|
19
|
+
* @param {NizamDashboard.CreateInviteRequest} request
|
|
20
|
+
* @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
+
*
|
|
22
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
23
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
24
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
25
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.invites.createInvite({
|
|
29
|
+
* organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
|
|
30
|
+
* email: "ali@nizam.ai",
|
|
31
|
+
* role: "super_admin",
|
|
32
|
+
* ttl_days: 7
|
|
33
|
+
* })
|
|
34
|
+
*/
|
|
35
|
+
createInvite(request: NizamDashboard.CreateInviteRequest, requestOptions?: InvitesClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Invite>;
|
|
36
|
+
private __createInvite;
|
|
37
|
+
/**
|
|
38
|
+
* Validates the token, links the calling user to the organization, and marks the invite accepted.
|
|
39
|
+
*
|
|
40
|
+
* @param {NizamDashboard.AcceptInviteRequest} request
|
|
41
|
+
* @param {InvitesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
42
|
+
*
|
|
43
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
44
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
45
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
46
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
47
|
+
* @throws {@link NizamDashboard.GoneError}
|
|
48
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
49
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.invites.acceptInvite({
|
|
53
|
+
* token: "5f8d2c4e6a1b3d7f9c0e2a4b6d8c0e2a4b6d8c0e2a4b6d8c"
|
|
54
|
+
* })
|
|
55
|
+
*/
|
|
56
|
+
acceptInvite(request: NizamDashboard.AcceptInviteRequest, requestOptions?: InvitesClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Invite>;
|
|
57
|
+
private __acceptInvite;
|
|
58
|
+
}
|