@nizam-os/customer-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 +29 -0
- package/dist/Client.js +74 -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/InternalServerError.d.ts +6 -0
- package/dist/api/errors/InternalServerError.js +54 -0
- package/dist/api/errors/UnauthorizedError.d.ts +6 -0
- package/dist/api/errors/UnauthorizedError.js +54 -0
- package/dist/api/errors/index.d.ts +4 -0
- package/dist/api/errors/index.js +20 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/identity/client/Client.d.ts +39 -0
- package/dist/api/resources/identity/client/Client.js +116 -0
- package/dist/api/resources/identity/client/index.d.ts +1 -0
- package/dist/api/resources/identity/client/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 +2 -0
- package/dist/api/resources/index.js +38 -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/types/AcceptInviteRequest.d.ts +4 -0
- package/dist/api/types/AcceptInviteRequest.js +3 -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/CloseAssignmentRequest.d.ts +21 -0
- package/dist/api/types/CloseAssignmentRequest.js +18 -0
- package/dist/api/types/CreateAssetRequest.d.ts +26 -0
- package/dist/api/types/CreateAssetRequest.js +19 -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/CreateInviteRequest.d.ts +23 -0
- package/dist/api/types/CreateInviteRequest.js +17 -0
- package/dist/api/types/CreateOperatorRequest.d.ts +16 -0
- package/dist/api/types/CreateOperatorRequest.js +3 -0
- package/dist/api/types/CreateOrganizationRequest.d.ts +16 -0
- package/dist/api/types/CreateOrganizationRequest.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/InviteUserRequest.d.ts +9 -0
- package/dist/api/types/InviteUserRequest.js +3 -0
- package/dist/api/types/ListResponse.d.ts +23 -0
- package/dist/api/types/ListResponse.js +11 -0
- package/dist/api/types/OpenAssignmentRequest.d.ts +22 -0
- package/dist/api/types/OpenAssignmentRequest.js +15 -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/UpdateOrganizationRequest.d.ts +14 -0
- package/dist/api/types/UpdateOrganizationRequest.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/UserUpdateRequest.d.ts +9 -0
- package/dist/api/types/UserUpdateRequest.js +3 -0
- package/dist/api/types/index.d.ts +25 -0
- package/dist/api/types/index.js +41 -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/NizamCustomerError.d.ts +14 -0
- package/dist/errors/NizamCustomerError.js +35 -0
- package/dist/errors/NizamCustomerTimeoutError.d.ts +6 -0
- package/dist/errors/NizamCustomerTimeoutError.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,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.join = join;
|
|
4
|
+
function join(base, ...segments) {
|
|
5
|
+
if (!base) {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
if (segments.length === 0) {
|
|
9
|
+
return base;
|
|
10
|
+
}
|
|
11
|
+
if (base.includes("://")) {
|
|
12
|
+
let url;
|
|
13
|
+
try {
|
|
14
|
+
url = new URL(base);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return joinPath(base, ...segments);
|
|
18
|
+
}
|
|
19
|
+
const lastSegment = segments[segments.length - 1];
|
|
20
|
+
const shouldPreserveTrailingSlash = lastSegment?.endsWith("/");
|
|
21
|
+
for (const segment of segments) {
|
|
22
|
+
const cleanSegment = trimSlashes(segment);
|
|
23
|
+
if (cleanSegment) {
|
|
24
|
+
url.pathname = joinPathSegments(url.pathname, cleanSegment);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
|
|
28
|
+
url.pathname += "/";
|
|
29
|
+
}
|
|
30
|
+
return url.toString();
|
|
31
|
+
}
|
|
32
|
+
return joinPath(base, ...segments);
|
|
33
|
+
}
|
|
34
|
+
function joinPath(base, ...segments) {
|
|
35
|
+
if (segments.length === 0) {
|
|
36
|
+
return base;
|
|
37
|
+
}
|
|
38
|
+
let result = base;
|
|
39
|
+
const lastSegment = segments[segments.length - 1];
|
|
40
|
+
const shouldPreserveTrailingSlash = lastSegment?.endsWith("/");
|
|
41
|
+
for (const segment of segments) {
|
|
42
|
+
const cleanSegment = trimSlashes(segment);
|
|
43
|
+
if (cleanSegment) {
|
|
44
|
+
result = joinPathSegments(result, cleanSegment);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
|
|
48
|
+
result += "/";
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
function joinPathSegments(left, right) {
|
|
53
|
+
if (left.endsWith("/")) {
|
|
54
|
+
return left + right;
|
|
55
|
+
}
|
|
56
|
+
return `${left}/${right}`;
|
|
57
|
+
}
|
|
58
|
+
function trimSlashes(str) {
|
|
59
|
+
if (!str)
|
|
60
|
+
return str;
|
|
61
|
+
let start = 0;
|
|
62
|
+
let end = str.length;
|
|
63
|
+
if (str.startsWith("/"))
|
|
64
|
+
start = 1;
|
|
65
|
+
if (str.endsWith("/"))
|
|
66
|
+
end = str.length - 1;
|
|
67
|
+
return start === 0 && end === str.length ? str : str.slice(start, end);
|
|
68
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toQueryString = toQueryString;
|
|
4
|
+
const defaultQsOptions = {
|
|
5
|
+
arrayFormat: "indices",
|
|
6
|
+
encode: true,
|
|
7
|
+
};
|
|
8
|
+
function encodeValue(value, shouldEncode) {
|
|
9
|
+
if (value === undefined) {
|
|
10
|
+
return "";
|
|
11
|
+
}
|
|
12
|
+
if (value === null) {
|
|
13
|
+
return "";
|
|
14
|
+
}
|
|
15
|
+
const stringValue = String(value);
|
|
16
|
+
return shouldEncode ? encodeURIComponent(stringValue) : stringValue;
|
|
17
|
+
}
|
|
18
|
+
function stringifyObject(obj, prefix = "", options) {
|
|
19
|
+
const parts = [];
|
|
20
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
21
|
+
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
22
|
+
if (value === undefined) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
if (value.length === 0) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const effectiveFormat = options.arrayFormat;
|
|
30
|
+
if (effectiveFormat === "comma") {
|
|
31
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
32
|
+
const encodedValues = value
|
|
33
|
+
.filter((item) => item !== undefined && item !== null)
|
|
34
|
+
.map((item) => encodeValue(item, options.encode));
|
|
35
|
+
if (encodedValues.length > 0) {
|
|
36
|
+
parts.push(`${encodedKey}=${encodedValues.join(",")}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
for (let i = 0; i < value.length; i++) {
|
|
41
|
+
const item = value[i];
|
|
42
|
+
if (item === undefined) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
46
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
47
|
+
parts.push(...stringifyObject(item, arrayKey, options));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
51
|
+
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
52
|
+
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (typeof value === "object" && value !== null) {
|
|
58
|
+
if (Object.keys(value).length === 0) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
parts.push(...stringifyObject(value, fullKey, options));
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
65
|
+
parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return parts;
|
|
69
|
+
}
|
|
70
|
+
function toQueryString(obj, options) {
|
|
71
|
+
if (obj == null || typeof obj !== "object") {
|
|
72
|
+
return "";
|
|
73
|
+
}
|
|
74
|
+
const parts = stringifyObject(obj, "", {
|
|
75
|
+
...defaultQsOptions,
|
|
76
|
+
...options,
|
|
77
|
+
});
|
|
78
|
+
return parts.join("&");
|
|
79
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NizamCustomerEnvironment = void 0;
|
|
5
|
+
exports.NizamCustomerEnvironment = {
|
|
6
|
+
Production: "https://api.nizam.ai",
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as core from "../core/index.js";
|
|
2
|
+
export declare class NizamCustomerError extends Error {
|
|
3
|
+
readonly statusCode?: number;
|
|
4
|
+
readonly body?: unknown;
|
|
5
|
+
readonly rawResponse?: core.RawResponse;
|
|
6
|
+
readonly cause?: unknown;
|
|
7
|
+
constructor({ message, statusCode, body, rawResponse, cause, }: {
|
|
8
|
+
message?: string;
|
|
9
|
+
statusCode?: number;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
rawResponse?: core.RawResponse;
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NizamCustomerError = void 0;
|
|
5
|
+
const json_js_1 = require("../core/json.js");
|
|
6
|
+
class NizamCustomerError extends Error {
|
|
7
|
+
constructor({ message, statusCode, body, rawResponse, cause, }) {
|
|
8
|
+
super(buildMessage({ message, statusCode, body }));
|
|
9
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
10
|
+
if (Error.captureStackTrace) {
|
|
11
|
+
Error.captureStackTrace(this, this.constructor);
|
|
12
|
+
}
|
|
13
|
+
this.name = this.constructor.name;
|
|
14
|
+
this.statusCode = statusCode;
|
|
15
|
+
this.body = body;
|
|
16
|
+
this.rawResponse = rawResponse;
|
|
17
|
+
if (cause != null) {
|
|
18
|
+
this.cause = cause;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.NizamCustomerError = NizamCustomerError;
|
|
23
|
+
function buildMessage({ message, statusCode, body, }) {
|
|
24
|
+
const lines = [];
|
|
25
|
+
if (message != null) {
|
|
26
|
+
lines.push(message);
|
|
27
|
+
}
|
|
28
|
+
if (statusCode != null) {
|
|
29
|
+
lines.push(`Status code: ${statusCode.toString()}`);
|
|
30
|
+
}
|
|
31
|
+
if (body != null) {
|
|
32
|
+
lines.push(`Body: ${(0, json_js_1.toJson)(body, undefined, 2)}`);
|
|
33
|
+
}
|
|
34
|
+
return lines.join("\n");
|
|
35
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NizamCustomerTimeoutError = void 0;
|
|
5
|
+
class NizamCustomerTimeoutError extends Error {
|
|
6
|
+
constructor(message, opts) {
|
|
7
|
+
super(message);
|
|
8
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
9
|
+
if (Error.captureStackTrace) {
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
this.name = this.constructor.name;
|
|
13
|
+
if (opts?.cause != null) {
|
|
14
|
+
this.cause = opts.cause;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.NizamCustomerTimeoutError = NizamCustomerTimeoutError;
|
|
@@ -0,0 +1,68 @@
|
|
|
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.handleNonStatusCodeError = handleNonStatusCodeError;
|
|
38
|
+
const errors = __importStar(require("./index.js"));
|
|
39
|
+
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
40
|
+
switch (error.reason) {
|
|
41
|
+
case "non-json":
|
|
42
|
+
throw new errors.NizamCustomerError({
|
|
43
|
+
statusCode: error.statusCode,
|
|
44
|
+
body: error.rawBody,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
case "body-is-null":
|
|
48
|
+
throw new errors.NizamCustomerError({
|
|
49
|
+
statusCode: error.statusCode,
|
|
50
|
+
rawResponse: rawResponse,
|
|
51
|
+
});
|
|
52
|
+
case "timeout":
|
|
53
|
+
throw new errors.NizamCustomerTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, {
|
|
54
|
+
cause: error.cause,
|
|
55
|
+
});
|
|
56
|
+
case "unknown":
|
|
57
|
+
throw new errors.NizamCustomerError({
|
|
58
|
+
message: error.errorMessage,
|
|
59
|
+
rawResponse: rawResponse,
|
|
60
|
+
cause: error.cause,
|
|
61
|
+
});
|
|
62
|
+
default:
|
|
63
|
+
throw new errors.NizamCustomerError({
|
|
64
|
+
message: "Unknown error",
|
|
65
|
+
rawResponse: rawResponse,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NizamCustomerTimeoutError = exports.NizamCustomerError = void 0;
|
|
4
|
+
var NizamCustomerError_js_1 = require("./NizamCustomerError.js");
|
|
5
|
+
Object.defineProperty(exports, "NizamCustomerError", { enumerable: true, get: function () { return NizamCustomerError_js_1.NizamCustomerError; } });
|
|
6
|
+
var NizamCustomerTimeoutError_js_1 = require("./NizamCustomerTimeoutError.js");
|
|
7
|
+
Object.defineProperty(exports, "NizamCustomerTimeoutError", { enumerable: true, get: function () { return NizamCustomerTimeoutError_js_1.NizamCustomerTimeoutError; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.js";
|
package/dist/exports.js
ADDED
|
@@ -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("./core/exports.js"), exports);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as NizamCustomer from "./api/index.js";
|
|
2
|
+
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
3
|
+
export { NizamCustomerClient } from "./Client.js";
|
|
4
|
+
export { NizamCustomerEnvironment } from "./environments.js";
|
|
5
|
+
export { NizamCustomerError, NizamCustomerTimeoutError } from "./errors/index.js";
|
|
6
|
+
export * from "./exports.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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 __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NizamCustomerTimeoutError = exports.NizamCustomerError = exports.NizamCustomerEnvironment = exports.NizamCustomerClient = exports.NizamCustomer = void 0;
|
|
40
|
+
exports.NizamCustomer = __importStar(require("./api/index.js"));
|
|
41
|
+
var Client_js_1 = require("./Client.js");
|
|
42
|
+
Object.defineProperty(exports, "NizamCustomerClient", { enumerable: true, get: function () { return Client_js_1.NizamCustomerClient; } });
|
|
43
|
+
var environments_js_1 = require("./environments.js");
|
|
44
|
+
Object.defineProperty(exports, "NizamCustomerEnvironment", { enumerable: true, get: function () { return environments_js_1.NizamCustomerEnvironment; } });
|
|
45
|
+
var index_js_1 = require("./errors/index.js");
|
|
46
|
+
Object.defineProperty(exports, "NizamCustomerError", { enumerable: true, get: function () { return index_js_1.NizamCustomerError; } });
|
|
47
|
+
Object.defineProperty(exports, "NizamCustomerTimeoutError", { enumerable: true, get: function () { return index_js_1.NizamCustomerTimeoutError; } });
|
|
48
|
+
__exportStar(require("./exports.js"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nizam-os/customer-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Nizam customer SDK — generated by Fern from nizam-os/nizam",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"form-data": "^4.0.4",
|
|
16
|
+
"form-data-encoder": "^4.1.0",
|
|
17
|
+
"formdata-node": "^6.0.3",
|
|
18
|
+
"node-fetch": "^2.7.0",
|
|
19
|
+
"readable-stream": "^4.7.0",
|
|
20
|
+
"qs": "^6.13.1",
|
|
21
|
+
"url-join": "^4.0.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "~5.7.2",
|
|
25
|
+
"@types/node": "^22.10.5",
|
|
26
|
+
"@types/node-fetch": "^2.6.12",
|
|
27
|
+
"@types/qs": "^6.9.18",
|
|
28
|
+
"@types/readable-stream": "^4.0.18",
|
|
29
|
+
"@types/url-join": "^4.0.3"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false
|
|
35
|
+
}
|