celitech-sdk 2.0.7 → 2.0.10
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/README.md +48 -15
- package/dist/index.d.mts +2664 -0
- package/dist/index.d.ts +86 -37
- package/dist/index.js +1017 -703
- package/dist/index.mjs +1017 -703
- package/package.json +18 -7
package/dist/index.js
CHANGED
|
@@ -287,7 +287,11 @@ var TransportHookAdapter = class {
|
|
|
287
287
|
true
|
|
288
288
|
),
|
|
289
289
|
headers: this.hookParamsToTransportParams(newRequest.headers, request.headers, false),
|
|
290
|
-
pathParams: this.hookParamsToTransportParams(
|
|
290
|
+
pathParams: this.hookParamsToTransportParams(
|
|
291
|
+
newRequest.pathParams,
|
|
292
|
+
request.pathParams,
|
|
293
|
+
false
|
|
294
|
+
)
|
|
291
295
|
});
|
|
292
296
|
return newTransportRequest;
|
|
293
297
|
}
|
|
@@ -421,14 +425,13 @@ var HookHandler = class {
|
|
|
421
425
|
}
|
|
422
426
|
/**
|
|
423
427
|
* Handles a standard HTTP request with hook invocation.
|
|
424
|
-
* Calls beforeRequest hook, processes the request, and calls afterResponse
|
|
428
|
+
* Calls beforeRequest hook, processes the request, and calls the afterResponse hook.
|
|
425
429
|
* @template T - The expected response data type
|
|
426
430
|
* @param request - The HTTP request to process
|
|
427
431
|
* @returns A promise that resolves to the HTTP response
|
|
428
432
|
* @throws Error if no next handler is set, or if error handling fails
|
|
429
433
|
*/
|
|
430
434
|
async handle(request) {
|
|
431
|
-
var _a;
|
|
432
435
|
if (!this.next) {
|
|
433
436
|
throw new Error("No next handler set in hook handler.");
|
|
434
437
|
}
|
|
@@ -439,6 +442,10 @@ var HookHandler = class {
|
|
|
439
442
|
if (response.metadata.status < 400) {
|
|
440
443
|
return await hook.afterResponse(nextRequest, response, hookParams);
|
|
441
444
|
}
|
|
445
|
+
return await this.throwErrorResponse(request, response);
|
|
446
|
+
}
|
|
447
|
+
async throwErrorResponse(request, response, resolveUndeclaredError) {
|
|
448
|
+
var _a;
|
|
442
449
|
const arrayBuffer = response.raw;
|
|
443
450
|
const rawContentType = ((_a = response.metadata.headers["content-type"]) == null ? void 0 : _a.toLocaleLowerCase()) || "";
|
|
444
451
|
const contentType = getContentTypeDefinition(rawContentType);
|
|
@@ -459,6 +466,9 @@ var HookHandler = class {
|
|
|
459
466
|
customError.metadata = response.metadata;
|
|
460
467
|
customError.throw();
|
|
461
468
|
}
|
|
469
|
+
if (resolveUndeclaredError) {
|
|
470
|
+
throw await resolveUndeclaredError();
|
|
471
|
+
}
|
|
462
472
|
const decodedBody = new TextDecoder().decode(arrayBuffer);
|
|
463
473
|
throw new HttpError(
|
|
464
474
|
response.metadata,
|
|
@@ -488,7 +498,11 @@ Body: ${decodedBody}`
|
|
|
488
498
|
if (response.metadata.status < 400) {
|
|
489
499
|
yield await hook.afterResponse(nextRequest, response, hookParams);
|
|
490
500
|
} else {
|
|
491
|
-
|
|
501
|
+
return await this.throwErrorResponse(
|
|
502
|
+
request,
|
|
503
|
+
response,
|
|
504
|
+
() => hook.onError(nextRequest, response, hookParams)
|
|
505
|
+
);
|
|
492
506
|
}
|
|
493
507
|
}
|
|
494
508
|
}
|
|
@@ -773,7 +787,7 @@ var RequestValidationHandler = class {
|
|
|
773
787
|
if (!this.next) {
|
|
774
788
|
throw new Error("No next handler set in ContentTypeHandler.");
|
|
775
789
|
}
|
|
776
|
-
this.validateRequest(request);
|
|
790
|
+
await this.validateRequest(request);
|
|
777
791
|
return this.next.handle(request);
|
|
778
792
|
}
|
|
779
793
|
/**
|
|
@@ -787,7 +801,7 @@ var RequestValidationHandler = class {
|
|
|
787
801
|
if (!this.next) {
|
|
788
802
|
throw new Error("No next handler set in ContentTypeHandler.");
|
|
789
803
|
}
|
|
790
|
-
this.validateRequest(request);
|
|
804
|
+
await this.validateRequest(request);
|
|
791
805
|
yield* this.next.stream(request);
|
|
792
806
|
}
|
|
793
807
|
/**
|
|
@@ -797,33 +811,41 @@ var RequestValidationHandler = class {
|
|
|
797
811
|
*/
|
|
798
812
|
validateRequest(request) {
|
|
799
813
|
var _a, _b;
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
const parsedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
|
|
803
|
-
request.body = JSON.stringify(parsedBody);
|
|
804
|
-
} catch (error) {
|
|
805
|
-
if (error instanceof import_zod2.ZodError) {
|
|
806
|
-
throw new ValidationError(error, request.body);
|
|
807
|
-
}
|
|
808
|
-
throw error;
|
|
809
|
-
}
|
|
810
|
-
} else if (request.requestContentType === "text" /* Text */ || request.requestContentType === "image" /* Image */ || request.requestContentType === "binary" /* Binary */) {
|
|
814
|
+
const requestValidationEnabled = (_b = (_a = request.config.validation) == null ? void 0 : _a.requestValidation) != null ? _b : true;
|
|
815
|
+
if (request.requestContentType === "text" /* Text */ || request.requestContentType === "image" /* Image */ || request.requestContentType === "binary" /* Binary */) {
|
|
811
816
|
request.body = request.body;
|
|
812
817
|
} else if (request.requestContentType === "form" /* FormUrlEncoded */) {
|
|
813
|
-
request.body = this.toFormUrlEncoded(request);
|
|
818
|
+
request.body = this.toFormUrlEncoded(request, requestValidationEnabled);
|
|
814
819
|
} else if (request.requestContentType === "multipartFormData" /* MultipartFormData */) {
|
|
815
820
|
request.body = this.toFormData(request.body, request.filename, request.filenames);
|
|
816
821
|
} else {
|
|
817
|
-
request.body = JSON.stringify((
|
|
822
|
+
request.body = requestValidationEnabled ? JSON.stringify(this.validateBody(request, request.body)) : JSON.stringify(request.body);
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Validates a request body against its schema.
|
|
827
|
+
* @throws ValidationError if Zod schema validation fails
|
|
828
|
+
*/
|
|
829
|
+
validateBody(request, body) {
|
|
830
|
+
if (!request.requestSchema) {
|
|
831
|
+
return body;
|
|
832
|
+
}
|
|
833
|
+
try {
|
|
834
|
+
return request.requestSchema.parse(body);
|
|
835
|
+
} catch (error) {
|
|
836
|
+
if (error instanceof import_zod2.ZodError) {
|
|
837
|
+
throw new ValidationError(error, body);
|
|
838
|
+
}
|
|
839
|
+
throw error;
|
|
818
840
|
}
|
|
819
841
|
}
|
|
820
842
|
/**
|
|
821
843
|
* Converts request body to URL-encoded form data format.
|
|
822
844
|
* @param request - The HTTP request with body to convert
|
|
845
|
+
* @param requestValidationEnabled - Whether to validate the body against its schema first
|
|
823
846
|
* @returns URL-encoded string representation of the body
|
|
824
847
|
*/
|
|
825
|
-
toFormUrlEncoded(request) {
|
|
826
|
-
var _a;
|
|
848
|
+
toFormUrlEncoded(request, requestValidationEnabled) {
|
|
827
849
|
if (request.body === void 0) {
|
|
828
850
|
return "";
|
|
829
851
|
}
|
|
@@ -833,7 +855,7 @@ var RequestValidationHandler = class {
|
|
|
833
855
|
if (request.body instanceof URLSearchParams) {
|
|
834
856
|
return request.body.toString();
|
|
835
857
|
}
|
|
836
|
-
const validatedBody =
|
|
858
|
+
const validatedBody = requestValidationEnabled ? this.validateBody(request, request.body) : request.body;
|
|
837
859
|
if (validatedBody instanceof FormData) {
|
|
838
860
|
const params = new URLSearchParams();
|
|
839
861
|
validatedBody.forEach((value, key) => {
|
|
@@ -846,9 +868,9 @@ var RequestValidationHandler = class {
|
|
|
846
868
|
if (typeof validatedBody === "object" && validatedBody !== null && !Array.isArray(validatedBody)) {
|
|
847
869
|
const params = new URLSearchParams();
|
|
848
870
|
for (const [key, value] of Object.entries(validatedBody)) {
|
|
849
|
-
if (value
|
|
850
|
-
|
|
851
|
-
}
|
|
871
|
+
if (value == null)
|
|
872
|
+
continue;
|
|
873
|
+
params.append(key, `${value}`);
|
|
852
874
|
}
|
|
853
875
|
return params.toString();
|
|
854
876
|
}
|
|
@@ -856,7 +878,8 @@ var RequestValidationHandler = class {
|
|
|
856
878
|
}
|
|
857
879
|
/**
|
|
858
880
|
* Converts request body to multipart form data format.
|
|
859
|
-
* Handles files (ArrayBuffer
|
|
881
|
+
* Handles files (ArrayBuffer, Uint8Array, Buffer, or Blob — see `isFileLike` below), arrays,
|
|
882
|
+
* and regular values.
|
|
860
883
|
* @param body - The request body object
|
|
861
884
|
* @param filename - Optional filename for single file uploads
|
|
862
885
|
* @param filenames - Optional filenames array for array of file uploads
|
|
@@ -868,16 +891,16 @@ var RequestValidationHandler = class {
|
|
|
868
891
|
const value = body[key];
|
|
869
892
|
if (Array.isArray(value)) {
|
|
870
893
|
value.forEach((v, i) => {
|
|
871
|
-
if (v
|
|
894
|
+
if (isFileLike(v)) {
|
|
872
895
|
const fileFilename = filenames && filenames[i] ? filenames[i] : `${key}[${i}]`;
|
|
873
|
-
formData.append(`${key}[${i}]`,
|
|
896
|
+
formData.append(`${key}[${i}]`, toBlob(v), fileFilename);
|
|
874
897
|
} else {
|
|
875
898
|
formData.append(`${key}[${i}]`, v);
|
|
876
899
|
}
|
|
877
900
|
});
|
|
878
|
-
} else if (value
|
|
901
|
+
} else if (isFileLike(value)) {
|
|
879
902
|
const fileFilename = filename || key;
|
|
880
|
-
formData.append(key,
|
|
903
|
+
formData.append(key, toBlob(value), fileFilename);
|
|
881
904
|
} else {
|
|
882
905
|
formData.append(key, value);
|
|
883
906
|
}
|
|
@@ -885,6 +908,12 @@ var RequestValidationHandler = class {
|
|
|
885
908
|
return formData;
|
|
886
909
|
}
|
|
887
910
|
};
|
|
911
|
+
function isFileLike(value) {
|
|
912
|
+
return value instanceof ArrayBuffer || ArrayBuffer.isView(value) || typeof Blob !== "undefined" && value instanceof Blob;
|
|
913
|
+
}
|
|
914
|
+
function toBlob(value) {
|
|
915
|
+
return value instanceof Blob ? value : new Blob([value]);
|
|
916
|
+
}
|
|
888
917
|
|
|
889
918
|
// src/http/utils/line-decoder.ts
|
|
890
919
|
var LineDecoder = class {
|
|
@@ -901,7 +930,7 @@ var LineDecoder = class {
|
|
|
901
930
|
* @returns An array of complete lines as Uint8Array
|
|
902
931
|
*/
|
|
903
932
|
splitLines(chunk) {
|
|
904
|
-
this.lineBuffer += this.decoder.decode(chunk);
|
|
933
|
+
this.lineBuffer += this.decoder.decode(chunk, { stream: true });
|
|
905
934
|
let lineEndIndex;
|
|
906
935
|
const lines = [];
|
|
907
936
|
while ((lineEndIndex = this.lineBuffer.indexOf("\n")) >= 0) {
|
|
@@ -973,7 +1002,10 @@ var RequestFetchAdapter = class {
|
|
|
973
1002
|
headers: this.getHeaders(response)
|
|
974
1003
|
};
|
|
975
1004
|
if (response.status >= 400) {
|
|
976
|
-
|
|
1005
|
+
return yield {
|
|
1006
|
+
metadata,
|
|
1007
|
+
raw: await response.clone().arrayBuffer()
|
|
1008
|
+
};
|
|
977
1009
|
}
|
|
978
1010
|
if (!response.body) {
|
|
979
1011
|
return yield {
|
|
@@ -1157,10 +1189,8 @@ var RetryHandler = class {
|
|
|
1157
1189
|
}
|
|
1158
1190
|
const httpMethodsToRetry = (_b = (_a = request.config.retry) == null ? void 0 : _a.httpMethodsToRetry) != null ? _b : [
|
|
1159
1191
|
"GET",
|
|
1160
|
-
"POST",
|
|
1161
1192
|
"PUT",
|
|
1162
1193
|
"DELETE",
|
|
1163
|
-
"PATCH",
|
|
1164
1194
|
"HEAD",
|
|
1165
1195
|
"OPTIONS"
|
|
1166
1196
|
];
|
|
@@ -1210,15 +1240,16 @@ var RetryHandler = class {
|
|
|
1210
1240
|
if (!headers || maxRetryAfterDelayMs <= 0) {
|
|
1211
1241
|
return null;
|
|
1212
1242
|
}
|
|
1213
|
-
const
|
|
1243
|
+
const getHeader = (name) => headers[name];
|
|
1244
|
+
const retryAfterMs = getHeader("retry-after-ms");
|
|
1214
1245
|
if (retryAfterMs !== void 0 && /^\d+(\.\d+)?$/.test(retryAfterMs.trim())) {
|
|
1215
1246
|
return Math.min(Number(retryAfterMs.trim()), maxRetryAfterDelayMs);
|
|
1216
1247
|
}
|
|
1217
|
-
const seconds = this.parseRetryAfter(
|
|
1248
|
+
const seconds = this.parseRetryAfter(getHeader("retry-after"));
|
|
1218
1249
|
if (seconds !== null) {
|
|
1219
1250
|
return Math.min(Math.max(seconds * 1e3, 0), maxRetryAfterDelayMs);
|
|
1220
1251
|
}
|
|
1221
|
-
const reset =
|
|
1252
|
+
const reset = getHeader("x-ratelimit-reset");
|
|
1222
1253
|
if (reset !== void 0 && reset.trim() !== "") {
|
|
1223
1254
|
const epoch = Number(reset);
|
|
1224
1255
|
if (Number.isFinite(epoch)) {
|
|
@@ -1493,6 +1524,78 @@ var HttpClient = class {
|
|
|
1493
1524
|
}
|
|
1494
1525
|
};
|
|
1495
1526
|
|
|
1527
|
+
// src/http/utils/runtime.ts
|
|
1528
|
+
var RUNTIME = evaluateRuntime();
|
|
1529
|
+
function evaluateRuntime() {
|
|
1530
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1531
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
1532
|
+
if (isBrowser) {
|
|
1533
|
+
return { type: "browser", version: window.navigator.userAgent };
|
|
1534
|
+
}
|
|
1535
|
+
const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : _a.userAgent) === "Cloudflare-Workers";
|
|
1536
|
+
if (isCloudflare) {
|
|
1537
|
+
return { type: "workerd" };
|
|
1538
|
+
}
|
|
1539
|
+
const isEdgeRuntime = typeof EdgeRuntime === "string";
|
|
1540
|
+
if (isEdgeRuntime) {
|
|
1541
|
+
return { type: "edge-runtime" };
|
|
1542
|
+
}
|
|
1543
|
+
const isWebWorker = typeof self === "object" && typeof (self == null ? void 0 : self.importScripts) === "function" && (((_b = self.constructor) == null ? void 0 : _b.name) === "DedicatedWorkerGlobalScope" || ((_c = self.constructor) == null ? void 0 : _c.name) === "ServiceWorkerGlobalScope" || ((_d = self.constructor) == null ? void 0 : _d.name) === "SharedWorkerGlobalScope");
|
|
1544
|
+
if (isWebWorker) {
|
|
1545
|
+
return { type: "web-worker" };
|
|
1546
|
+
}
|
|
1547
|
+
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
1548
|
+
if (isDeno) {
|
|
1549
|
+
return {
|
|
1550
|
+
type: "deno",
|
|
1551
|
+
version: Deno.version.deno,
|
|
1552
|
+
os: (_e = Deno.build) == null ? void 0 : _e.os,
|
|
1553
|
+
arch: (_f = Deno.build) == null ? void 0 : _f.arch
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
1557
|
+
if (isBun) {
|
|
1558
|
+
return {
|
|
1559
|
+
type: "bun",
|
|
1560
|
+
version: Bun.version,
|
|
1561
|
+
os: typeof process !== "undefined" ? process.platform : void 0,
|
|
1562
|
+
arch: typeof process !== "undefined" ? process.arch : void 0
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
const isReactNative = typeof navigator !== "undefined" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
|
|
1566
|
+
if (isReactNative) {
|
|
1567
|
+
return { type: "react-native" };
|
|
1568
|
+
}
|
|
1569
|
+
const localProcess = typeof process !== "undefined" ? process : void 0;
|
|
1570
|
+
const isNode = typeof localProcess !== "undefined" && typeof ((_g = localProcess.versions) == null ? void 0 : _g.node) === "string";
|
|
1571
|
+
if (isNode) {
|
|
1572
|
+
return {
|
|
1573
|
+
type: "node",
|
|
1574
|
+
version: localProcess.versions.node,
|
|
1575
|
+
parsedVersion: Number(localProcess.versions.node.split(".")[0]),
|
|
1576
|
+
os: localProcess.platform,
|
|
1577
|
+
arch: localProcess.arch
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1580
|
+
return { type: "unknown" };
|
|
1581
|
+
}
|
|
1582
|
+
function toBase64(str) {
|
|
1583
|
+
if (typeof Buffer !== "undefined") {
|
|
1584
|
+
return Buffer.from(str, "utf-8").toString("base64");
|
|
1585
|
+
}
|
|
1586
|
+
if (typeof btoa === "function") {
|
|
1587
|
+
const bytes = new TextEncoder().encode(str);
|
|
1588
|
+
let binary = "";
|
|
1589
|
+
for (const byte of bytes) {
|
|
1590
|
+
binary += String.fromCharCode(byte);
|
|
1591
|
+
}
|
|
1592
|
+
return btoa(binary);
|
|
1593
|
+
}
|
|
1594
|
+
throw new Error(
|
|
1595
|
+
`No base64 encoder available in this runtime (${RUNTIME.type}): neither Buffer nor btoa is defined.`
|
|
1596
|
+
);
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1496
1599
|
// src/services/base-service.ts
|
|
1497
1600
|
var BaseService = class {
|
|
1498
1601
|
constructor(config, tokenManager) {
|
|
@@ -1555,6 +1658,9 @@ var BaseService = class {
|
|
|
1555
1658
|
}
|
|
1556
1659
|
return merged;
|
|
1557
1660
|
}
|
|
1661
|
+
toBase64(str) {
|
|
1662
|
+
return toBase64(str);
|
|
1663
|
+
}
|
|
1558
1664
|
set baseUrl(baseUrl) {
|
|
1559
1665
|
this.config.baseUrl = baseUrl;
|
|
1560
1666
|
}
|
|
@@ -1909,8 +2015,12 @@ var Request = class {
|
|
|
1909
2015
|
* Handles both cursor-based and limit-offset pagination strategies.
|
|
1910
2016
|
*
|
|
1911
2017
|
* @param cursor - The cursor value for cursor-based pagination (optional for limit-offset)
|
|
2018
|
+
* @param offsetIncrement - Fallback increment for offset pagination with no declared `pageSize`
|
|
2019
|
+
* (stepless offset — gap doc row 200), where the caller only learns the increment after fetching
|
|
2020
|
+
* a page (its item count). Ignored whenever `pageSize` is set, which always wins.
|
|
1912
2021
|
*/
|
|
1913
|
-
nextPage(cursor) {
|
|
2022
|
+
nextPage(cursor, offsetIncrement) {
|
|
2023
|
+
var _a;
|
|
1914
2024
|
if (!this.pagination) {
|
|
1915
2025
|
return;
|
|
1916
2026
|
}
|
|
@@ -1923,10 +2033,11 @@ var Request = class {
|
|
|
1923
2033
|
}
|
|
1924
2034
|
const offsetParam = this.getOffsetParam();
|
|
1925
2035
|
if (offsetParam) {
|
|
1926
|
-
|
|
2036
|
+
const increment = (_a = this.pagination.pageSize) != null ? _a : offsetIncrement;
|
|
2037
|
+
if (increment === void 0) {
|
|
1927
2038
|
throw new Error("pageSize is required for limit-offset pagination");
|
|
1928
2039
|
}
|
|
1929
|
-
offsetParam.value = Number(offsetParam.value) +
|
|
2040
|
+
offsetParam.value = Number(offsetParam.value) + increment;
|
|
1930
2041
|
}
|
|
1931
2042
|
}
|
|
1932
2043
|
constructPath() {
|
|
@@ -1983,9 +2094,9 @@ var RequestBuilder = class {
|
|
|
1983
2094
|
maxDelayMs: 5e3,
|
|
1984
2095
|
backoffFactor: 2,
|
|
1985
2096
|
jitterMs: 50,
|
|
1986
|
-
httpMethodsToRetry: ["GET", "
|
|
2097
|
+
httpMethodsToRetry: ["GET", "PUT", "DELETE", "HEAD", "OPTIONS"]
|
|
1987
2098
|
},
|
|
1988
|
-
validation: { responseValidation: true }
|
|
2099
|
+
validation: { responseValidation: true, requestValidation: true }
|
|
1989
2100
|
},
|
|
1990
2101
|
responses: [],
|
|
1991
2102
|
errors: [],
|
|
@@ -1999,7 +2110,7 @@ var RequestBuilder = class {
|
|
|
1999
2110
|
};
|
|
2000
2111
|
this.addHeaderParam({
|
|
2001
2112
|
key: "User-Agent",
|
|
2002
|
-
value: "postman-codegen/
|
|
2113
|
+
value: "postman-codegen/3.7.0 celitech-sdk/2.0.10 (typescript)"
|
|
2003
2114
|
});
|
|
2004
2115
|
}
|
|
2005
2116
|
setConfig(config) {
|
|
@@ -2097,7 +2208,8 @@ var RequestBuilder = class {
|
|
|
2097
2208
|
value: `${prefix != null ? prefix : "Bearer"} ${accessToken}`,
|
|
2098
2209
|
explode: false,
|
|
2099
2210
|
style: "simple" /* SIMPLE */,
|
|
2100
|
-
encode
|
|
2211
|
+
// Header values are not URL-encoded; `encode` only means something for path/query params.
|
|
2212
|
+
encode: false,
|
|
2101
2213
|
isLimit: false,
|
|
2102
2214
|
isOffset: false,
|
|
2103
2215
|
isCursor: false
|
|
@@ -2113,7 +2225,8 @@ var RequestBuilder = class {
|
|
|
2113
2225
|
value: `Basic ${this.toBase64(`${username}:${password}`)}`,
|
|
2114
2226
|
explode: false,
|
|
2115
2227
|
style: "simple" /* SIMPLE */,
|
|
2116
|
-
encode
|
|
2228
|
+
// Header values are not URL-encoded; `encode` only means something for path/query params.
|
|
2229
|
+
encode: false,
|
|
2117
2230
|
isLimit: false,
|
|
2118
2231
|
isOffset: false,
|
|
2119
2232
|
isCursor: false
|
|
@@ -2132,7 +2245,9 @@ var RequestBuilder = class {
|
|
|
2132
2245
|
value: apiKey,
|
|
2133
2246
|
explode: isQuery,
|
|
2134
2247
|
style: isQuery ? "form" /* FORM */ : "simple" /* SIMPLE */,
|
|
2135
|
-
|
|
2248
|
+
// Query values go through the FORM branch, which always URL-encodes regardless of this flag.
|
|
2249
|
+
// Header/cookie values are not URL-encoded, so `encode` must be false for those locations.
|
|
2250
|
+
encode: isQuery,
|
|
2136
2251
|
isLimit: false,
|
|
2137
2252
|
isOffset: false,
|
|
2138
2253
|
isCursor: false
|
|
@@ -2236,18 +2351,8 @@ var RequestBuilder = class {
|
|
|
2236
2351
|
build() {
|
|
2237
2352
|
return new Request(this.params);
|
|
2238
2353
|
}
|
|
2239
|
-
/**
|
|
2240
|
-
* Converts a string to Base64 encoding.
|
|
2241
|
-
* Works in both Node.js and browser environments.
|
|
2242
|
-
* @param str - The string to encode
|
|
2243
|
-
* @returns The Base64-encoded string
|
|
2244
|
-
*/
|
|
2245
2354
|
toBase64(str) {
|
|
2246
|
-
|
|
2247
|
-
return Buffer.from(str, "utf-8").toString("base64");
|
|
2248
|
-
} else {
|
|
2249
|
-
return btoa(unescape(encodeURIComponent(str)));
|
|
2250
|
-
}
|
|
2355
|
+
return toBase64(str);
|
|
2251
2356
|
}
|
|
2252
2357
|
};
|
|
2253
2358
|
|
|
@@ -2385,14 +2490,14 @@ var OAuthTokenManager = class {
|
|
|
2385
2490
|
* @throws Error if client credentials are missing or token request fails
|
|
2386
2491
|
*/
|
|
2387
2492
|
async getToken(scopes, config) {
|
|
2388
|
-
var _a, _b
|
|
2389
|
-
if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && (
|
|
2493
|
+
var _a, _b;
|
|
2494
|
+
if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && (this.token.expiresAt == null || this.token.expiresAt - Date.now() > 5e3)) {
|
|
2390
2495
|
return this.token;
|
|
2391
2496
|
}
|
|
2392
2497
|
if (!config.clientId || !config.clientSecret) {
|
|
2393
2498
|
throw new Error("OAuthError: clientId and clientSecret are required for token management.");
|
|
2394
2499
|
}
|
|
2395
|
-
const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((
|
|
2500
|
+
const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
|
|
2396
2501
|
const oAuth = new OAuthService(
|
|
2397
2502
|
{
|
|
2398
2503
|
...config,
|
|
@@ -2421,7 +2526,7 @@ var OAuthTokenManager = class {
|
|
|
2421
2526
|
};
|
|
2422
2527
|
|
|
2423
2528
|
// src/services/destinations/destinations-service.ts
|
|
2424
|
-
var
|
|
2529
|
+
var import_zod9 = require("zod");
|
|
2425
2530
|
|
|
2426
2531
|
// src/services/destinations/models/list-destinations-ok-response.ts
|
|
2427
2532
|
var import_zod7 = require("zod");
|
|
@@ -2484,7 +2589,7 @@ var listDestinationsOkResponseRequest = import_zod7.z.lazy(() => {
|
|
|
2484
2589
|
}));
|
|
2485
2590
|
});
|
|
2486
2591
|
|
|
2487
|
-
// src/services/common/
|
|
2592
|
+
// src/services/common/error-response.ts
|
|
2488
2593
|
var import_zod8 = require("zod");
|
|
2489
2594
|
|
|
2490
2595
|
// src/http/errors/throwable-error.ts
|
|
@@ -2525,58 +2630,29 @@ var ThrowableError = class extends Error {
|
|
|
2525
2630
|
}
|
|
2526
2631
|
};
|
|
2527
2632
|
|
|
2528
|
-
// src/services/common/
|
|
2529
|
-
var
|
|
2633
|
+
// src/services/common/error-response.ts
|
|
2634
|
+
var errorResponseResponse = import_zod8.z.lazy(() => {
|
|
2530
2635
|
return import_zod8.z.object({
|
|
2531
2636
|
message: import_zod8.z.string().optional()
|
|
2532
2637
|
}).transform((data) => ({
|
|
2533
2638
|
message: data["message"]
|
|
2534
2639
|
}));
|
|
2535
2640
|
});
|
|
2536
|
-
var
|
|
2537
|
-
constructor(message, response) {
|
|
2538
|
-
super(message);
|
|
2539
|
-
this.message = message;
|
|
2540
|
-
this.response = response;
|
|
2541
|
-
}
|
|
2542
|
-
static from(message, response) {
|
|
2543
|
-
const error = new BadRequest(message, response);
|
|
2544
|
-
const result = badRequestResponse.safeParse(response);
|
|
2545
|
-
const parsedResponse = result.success ? result.data : response || {};
|
|
2546
|
-
error.message = parsedResponse.message || "";
|
|
2547
|
-
return error;
|
|
2548
|
-
}
|
|
2549
|
-
throw() {
|
|
2550
|
-
const error = BadRequest.from(this.message, this.response);
|
|
2551
|
-
error.metadata = this.metadata;
|
|
2552
|
-
throw error;
|
|
2553
|
-
}
|
|
2554
|
-
};
|
|
2555
|
-
|
|
2556
|
-
// src/services/common/unauthorized.ts
|
|
2557
|
-
var import_zod9 = require("zod");
|
|
2558
|
-
var unauthorizedResponse = import_zod9.z.lazy(() => {
|
|
2559
|
-
return import_zod9.z.object({
|
|
2560
|
-
message: import_zod9.z.string().optional()
|
|
2561
|
-
}).transform((data) => ({
|
|
2562
|
-
message: data["message"]
|
|
2563
|
-
}));
|
|
2564
|
-
});
|
|
2565
|
-
var Unauthorized = class extends ThrowableError {
|
|
2641
|
+
var ErrorResponse = class extends ThrowableError {
|
|
2566
2642
|
constructor(message, response) {
|
|
2567
2643
|
super(message);
|
|
2568
2644
|
this.message = message;
|
|
2569
2645
|
this.response = response;
|
|
2570
2646
|
}
|
|
2571
2647
|
static from(message, response) {
|
|
2572
|
-
const error = new
|
|
2573
|
-
const result =
|
|
2648
|
+
const error = new ErrorResponse(message, response);
|
|
2649
|
+
const result = errorResponseResponse.safeParse(response);
|
|
2574
2650
|
const parsedResponse = result.success ? result.data : response || {};
|
|
2575
2651
|
error.message = parsedResponse.message || "";
|
|
2576
2652
|
return error;
|
|
2577
2653
|
}
|
|
2578
2654
|
throw() {
|
|
2579
|
-
const error =
|
|
2655
|
+
const error = ErrorResponse.from(this.message, this.response);
|
|
2580
2656
|
error.metadata = this.metadata;
|
|
2581
2657
|
throw error;
|
|
2582
2658
|
}
|
|
@@ -2600,53 +2676,65 @@ var DestinationsService = class extends BaseService {
|
|
|
2600
2676
|
*/
|
|
2601
2677
|
async listDestinations(requestConfig) {
|
|
2602
2678
|
const resolvedConfig = this.getResolvedConfig(this.listDestinationsConfig, requestConfig);
|
|
2603
|
-
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/destinations").setRequestSchema(
|
|
2679
|
+
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/destinations").setRequestSchema(import_zod9.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
2604
2680
|
schema: listDestinationsOkResponseResponse,
|
|
2605
2681
|
contentType: "json" /* Json */,
|
|
2606
2682
|
status: 200
|
|
2607
2683
|
}).addError({
|
|
2608
|
-
error:
|
|
2684
|
+
error: ErrorResponse,
|
|
2609
2685
|
contentType: "json" /* Json */,
|
|
2610
2686
|
status: 400
|
|
2611
2687
|
}).addError({
|
|
2612
|
-
error:
|
|
2688
|
+
error: ErrorResponse,
|
|
2613
2689
|
contentType: "json" /* Json */,
|
|
2614
2690
|
status: 401
|
|
2691
|
+
}).addError({
|
|
2692
|
+
error: ErrorResponse,
|
|
2693
|
+
contentType: "json" /* Json */,
|
|
2694
|
+
status: 409
|
|
2695
|
+
}).addError({
|
|
2696
|
+
error: ErrorResponse,
|
|
2697
|
+
contentType: "json" /* Json */,
|
|
2698
|
+
status: 422
|
|
2699
|
+
}).addError({
|
|
2700
|
+
error: ErrorResponse,
|
|
2701
|
+
contentType: "json" /* Json */,
|
|
2702
|
+
status: 503
|
|
2615
2703
|
}).build();
|
|
2616
2704
|
return this.client.callDirect(request);
|
|
2617
2705
|
}
|
|
2618
2706
|
};
|
|
2619
2707
|
|
|
2620
2708
|
// src/services/packages/packages-service.ts
|
|
2621
|
-
var
|
|
2709
|
+
var import_zod12 = require("zod");
|
|
2622
2710
|
|
|
2623
2711
|
// src/services/packages/models/list-packages-ok-response.ts
|
|
2624
|
-
var
|
|
2712
|
+
var import_zod11 = require("zod");
|
|
2625
2713
|
|
|
2626
2714
|
// src/services/packages/models/packages.ts
|
|
2627
|
-
var
|
|
2628
|
-
var packages =
|
|
2629
|
-
return
|
|
2630
|
-
id:
|
|
2631
|
-
destination:
|
|
2632
|
-
destinationIso2:
|
|
2633
|
-
dataLimitInBytes:
|
|
2634
|
-
dataLimitInGb:
|
|
2635
|
-
minDays:
|
|
2636
|
-
maxDays:
|
|
2637
|
-
priceInCents:
|
|
2715
|
+
var import_zod10 = require("zod");
|
|
2716
|
+
var packages = import_zod10.z.lazy(() => {
|
|
2717
|
+
return import_zod10.z.object({
|
|
2718
|
+
id: import_zod10.z.string(),
|
|
2719
|
+
destination: import_zod10.z.string(),
|
|
2720
|
+
destinationIso2: import_zod10.z.string(),
|
|
2721
|
+
dataLimitInBytes: import_zod10.z.number(),
|
|
2722
|
+
dataLimitInGb: import_zod10.z.number(),
|
|
2723
|
+
minDays: import_zod10.z.number(),
|
|
2724
|
+
maxDays: import_zod10.z.number(),
|
|
2725
|
+
priceInCents: import_zod10.z.number()
|
|
2638
2726
|
});
|
|
2639
2727
|
});
|
|
2640
|
-
var packagesResponse =
|
|
2641
|
-
return
|
|
2642
|
-
id:
|
|
2643
|
-
destination:
|
|
2644
|
-
destinationISO2:
|
|
2645
|
-
dataLimitInBytes:
|
|
2646
|
-
dataLimitInGB:
|
|
2647
|
-
minDays:
|
|
2648
|
-
maxDays:
|
|
2649
|
-
priceInCents:
|
|
2728
|
+
var packagesResponse = import_zod10.z.lazy(() => {
|
|
2729
|
+
return import_zod10.z.object({
|
|
2730
|
+
id: import_zod10.z.string(),
|
|
2731
|
+
destination: import_zod10.z.string(),
|
|
2732
|
+
destinationISO2: import_zod10.z.string(),
|
|
2733
|
+
dataLimitInBytes: import_zod10.z.number(),
|
|
2734
|
+
dataLimitInGB: import_zod10.z.number(),
|
|
2735
|
+
minDays: import_zod10.z.number(),
|
|
2736
|
+
maxDays: import_zod10.z.number(),
|
|
2737
|
+
priceInCents: import_zod10.z.number()
|
|
2650
2738
|
}).transform((data) => ({
|
|
2651
2739
|
id: data["id"],
|
|
2652
2740
|
destination: data["destination"],
|
|
@@ -2658,16 +2746,16 @@ var packagesResponse = import_zod11.z.lazy(() => {
|
|
|
2658
2746
|
priceInCents: data["priceInCents"]
|
|
2659
2747
|
}));
|
|
2660
2748
|
});
|
|
2661
|
-
var packagesRequest =
|
|
2662
|
-
return
|
|
2663
|
-
id:
|
|
2664
|
-
destination:
|
|
2665
|
-
destinationIso2:
|
|
2666
|
-
dataLimitInBytes:
|
|
2667
|
-
dataLimitInGb:
|
|
2668
|
-
minDays:
|
|
2669
|
-
maxDays:
|
|
2670
|
-
priceInCents:
|
|
2749
|
+
var packagesRequest = import_zod10.z.lazy(() => {
|
|
2750
|
+
return import_zod10.z.object({
|
|
2751
|
+
id: import_zod10.z.string(),
|
|
2752
|
+
destination: import_zod10.z.string(),
|
|
2753
|
+
destinationIso2: import_zod10.z.string(),
|
|
2754
|
+
dataLimitInBytes: import_zod10.z.number(),
|
|
2755
|
+
dataLimitInGb: import_zod10.z.number(),
|
|
2756
|
+
minDays: import_zod10.z.number(),
|
|
2757
|
+
maxDays: import_zod10.z.number(),
|
|
2758
|
+
priceInCents: import_zod10.z.number()
|
|
2671
2759
|
}).transform((data) => ({
|
|
2672
2760
|
id: data["id"],
|
|
2673
2761
|
destination: data["destination"],
|
|
@@ -2681,25 +2769,25 @@ var packagesRequest = import_zod11.z.lazy(() => {
|
|
|
2681
2769
|
});
|
|
2682
2770
|
|
|
2683
2771
|
// src/services/packages/models/list-packages-ok-response.ts
|
|
2684
|
-
var listPackagesOkResponse =
|
|
2685
|
-
return
|
|
2686
|
-
packages:
|
|
2687
|
-
afterCursor:
|
|
2772
|
+
var listPackagesOkResponse = import_zod11.z.lazy(() => {
|
|
2773
|
+
return import_zod11.z.object({
|
|
2774
|
+
packages: import_zod11.z.array(packages),
|
|
2775
|
+
afterCursor: import_zod11.z.string().nullable()
|
|
2688
2776
|
});
|
|
2689
2777
|
});
|
|
2690
|
-
var listPackagesOkResponseResponse =
|
|
2691
|
-
return
|
|
2692
|
-
packages:
|
|
2693
|
-
afterCursor:
|
|
2778
|
+
var listPackagesOkResponseResponse = import_zod11.z.lazy(() => {
|
|
2779
|
+
return import_zod11.z.object({
|
|
2780
|
+
packages: import_zod11.z.array(packagesResponse),
|
|
2781
|
+
afterCursor: import_zod11.z.string().nullable()
|
|
2694
2782
|
}).transform((data) => ({
|
|
2695
2783
|
packages: data["packages"],
|
|
2696
2784
|
afterCursor: data["afterCursor"]
|
|
2697
2785
|
}));
|
|
2698
2786
|
});
|
|
2699
|
-
var listPackagesOkResponseRequest =
|
|
2700
|
-
return
|
|
2701
|
-
packages:
|
|
2702
|
-
afterCursor:
|
|
2787
|
+
var listPackagesOkResponseRequest = import_zod11.z.lazy(() => {
|
|
2788
|
+
return import_zod11.z.object({
|
|
2789
|
+
packages: import_zod11.z.array(packagesRequest),
|
|
2790
|
+
afterCursor: import_zod11.z.string().nullable()
|
|
2703
2791
|
}).transform((data) => ({
|
|
2704
2792
|
packages: data["packages"],
|
|
2705
2793
|
afterCursor: data["afterCursor"]
|
|
@@ -2733,29 +2821,41 @@ var PackagesService = class extends BaseService {
|
|
|
2733
2821
|
*/
|
|
2734
2822
|
async listPackages(params, requestConfig) {
|
|
2735
2823
|
const resolvedConfig = this.getResolvedConfig(this.listPackagesConfig, requestConfig);
|
|
2736
|
-
|
|
2737
|
-
destination:
|
|
2738
|
-
dataLimitInGb:
|
|
2739
|
-
startDate:
|
|
2740
|
-
endDate:
|
|
2741
|
-
afterCursor:
|
|
2742
|
-
limit:
|
|
2743
|
-
startTime:
|
|
2744
|
-
endTime:
|
|
2745
|
-
includeUnlimited:
|
|
2824
|
+
import_zod12.z.object({
|
|
2825
|
+
destination: import_zod12.z.string().optional(),
|
|
2826
|
+
dataLimitInGb: import_zod12.z.number().optional(),
|
|
2827
|
+
startDate: import_zod12.z.string().optional(),
|
|
2828
|
+
endDate: import_zod12.z.string().optional(),
|
|
2829
|
+
afterCursor: import_zod12.z.string().optional(),
|
|
2830
|
+
limit: import_zod12.z.number().optional(),
|
|
2831
|
+
startTime: import_zod12.z.number().optional(),
|
|
2832
|
+
endTime: import_zod12.z.number().optional(),
|
|
2833
|
+
includeUnlimited: import_zod12.z.boolean().optional()
|
|
2746
2834
|
}).parse(params != null ? params : {});
|
|
2747
|
-
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/packages").setRequestSchema(
|
|
2835
|
+
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/packages").setRequestSchema(import_zod12.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
2748
2836
|
schema: listPackagesOkResponseResponse,
|
|
2749
2837
|
contentType: "json" /* Json */,
|
|
2750
2838
|
status: 200
|
|
2751
2839
|
}).addError({
|
|
2752
|
-
error:
|
|
2840
|
+
error: ErrorResponse,
|
|
2753
2841
|
contentType: "json" /* Json */,
|
|
2754
2842
|
status: 400
|
|
2755
2843
|
}).addError({
|
|
2756
|
-
error:
|
|
2844
|
+
error: ErrorResponse,
|
|
2757
2845
|
contentType: "json" /* Json */,
|
|
2758
2846
|
status: 401
|
|
2847
|
+
}).addError({
|
|
2848
|
+
error: ErrorResponse,
|
|
2849
|
+
contentType: "json" /* Json */,
|
|
2850
|
+
status: 409
|
|
2851
|
+
}).addError({
|
|
2852
|
+
error: ErrorResponse,
|
|
2853
|
+
contentType: "json" /* Json */,
|
|
2854
|
+
status: 422
|
|
2855
|
+
}).addError({
|
|
2856
|
+
error: ErrorResponse,
|
|
2857
|
+
contentType: "json" /* Json */,
|
|
2858
|
+
status: 503
|
|
2759
2859
|
}).addQueryParam({
|
|
2760
2860
|
key: "destination",
|
|
2761
2861
|
value: params == null ? void 0 : params.destination
|
|
@@ -2789,38 +2889,38 @@ var PackagesService = class extends BaseService {
|
|
|
2789
2889
|
};
|
|
2790
2890
|
|
|
2791
2891
|
// src/services/purchases/purchases-service.ts
|
|
2792
|
-
var
|
|
2892
|
+
var import_zod32 = require("zod");
|
|
2793
2893
|
|
|
2794
2894
|
// src/services/purchases/models/create-purchase-v2-request.ts
|
|
2795
|
-
var
|
|
2796
|
-
var createPurchaseV2Request =
|
|
2797
|
-
return
|
|
2798
|
-
destination:
|
|
2799
|
-
dataLimitInGb:
|
|
2800
|
-
startDate:
|
|
2801
|
-
endDate:
|
|
2802
|
-
duration:
|
|
2803
|
-
quantity:
|
|
2804
|
-
email:
|
|
2805
|
-
referenceId:
|
|
2806
|
-
networkBrand:
|
|
2807
|
-
emailBrand:
|
|
2808
|
-
language:
|
|
2895
|
+
var import_zod13 = require("zod");
|
|
2896
|
+
var createPurchaseV2Request = import_zod13.z.lazy(() => {
|
|
2897
|
+
return import_zod13.z.object({
|
|
2898
|
+
destination: import_zod13.z.string(),
|
|
2899
|
+
dataLimitInGb: import_zod13.z.number(),
|
|
2900
|
+
startDate: import_zod13.z.string().optional(),
|
|
2901
|
+
endDate: import_zod13.z.string().optional(),
|
|
2902
|
+
duration: import_zod13.z.number().optional(),
|
|
2903
|
+
quantity: import_zod13.z.number().gte(1).lte(5),
|
|
2904
|
+
email: import_zod13.z.string().optional(),
|
|
2905
|
+
referenceId: import_zod13.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
2906
|
+
networkBrand: import_zod13.z.string().optional(),
|
|
2907
|
+
emailBrand: import_zod13.z.string().optional(),
|
|
2908
|
+
language: import_zod13.z.string().optional()
|
|
2809
2909
|
});
|
|
2810
2910
|
});
|
|
2811
|
-
var createPurchaseV2RequestResponse =
|
|
2812
|
-
return
|
|
2813
|
-
destination:
|
|
2814
|
-
dataLimitInGB:
|
|
2815
|
-
startDate:
|
|
2816
|
-
endDate:
|
|
2817
|
-
duration:
|
|
2818
|
-
quantity:
|
|
2819
|
-
email:
|
|
2820
|
-
referenceId:
|
|
2821
|
-
networkBrand:
|
|
2822
|
-
emailBrand:
|
|
2823
|
-
language:
|
|
2911
|
+
var createPurchaseV2RequestResponse = import_zod13.z.lazy(() => {
|
|
2912
|
+
return import_zod13.z.object({
|
|
2913
|
+
destination: import_zod13.z.string(),
|
|
2914
|
+
dataLimitInGB: import_zod13.z.number(),
|
|
2915
|
+
startDate: import_zod13.z.string().optional(),
|
|
2916
|
+
endDate: import_zod13.z.string().optional(),
|
|
2917
|
+
duration: import_zod13.z.number().optional(),
|
|
2918
|
+
quantity: import_zod13.z.number().gte(1).lte(5),
|
|
2919
|
+
email: import_zod13.z.string().optional(),
|
|
2920
|
+
referenceId: import_zod13.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
2921
|
+
networkBrand: import_zod13.z.string().optional(),
|
|
2922
|
+
emailBrand: import_zod13.z.string().optional(),
|
|
2923
|
+
language: import_zod13.z.string().optional()
|
|
2824
2924
|
}).transform((data) => ({
|
|
2825
2925
|
destination: data["destination"],
|
|
2826
2926
|
dataLimitInGb: data["dataLimitInGB"],
|
|
@@ -2835,19 +2935,19 @@ var createPurchaseV2RequestResponse = import_zod14.z.lazy(() => {
|
|
|
2835
2935
|
language: data["language"]
|
|
2836
2936
|
}));
|
|
2837
2937
|
});
|
|
2838
|
-
var createPurchaseV2RequestRequest =
|
|
2839
|
-
return
|
|
2840
|
-
destination:
|
|
2841
|
-
dataLimitInGb:
|
|
2842
|
-
startDate:
|
|
2843
|
-
endDate:
|
|
2844
|
-
duration:
|
|
2845
|
-
quantity:
|
|
2846
|
-
email:
|
|
2847
|
-
referenceId:
|
|
2848
|
-
networkBrand:
|
|
2849
|
-
emailBrand:
|
|
2850
|
-
language:
|
|
2938
|
+
var createPurchaseV2RequestRequest = import_zod13.z.lazy(() => {
|
|
2939
|
+
return import_zod13.z.object({
|
|
2940
|
+
destination: import_zod13.z.string(),
|
|
2941
|
+
dataLimitInGb: import_zod13.z.number(),
|
|
2942
|
+
startDate: import_zod13.z.string().optional(),
|
|
2943
|
+
endDate: import_zod13.z.string().optional(),
|
|
2944
|
+
duration: import_zod13.z.number().optional(),
|
|
2945
|
+
quantity: import_zod13.z.number().gte(1).lte(5),
|
|
2946
|
+
email: import_zod13.z.string().optional(),
|
|
2947
|
+
referenceId: import_zod13.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
2948
|
+
networkBrand: import_zod13.z.string().optional(),
|
|
2949
|
+
emailBrand: import_zod13.z.string().optional(),
|
|
2950
|
+
language: import_zod13.z.string().optional()
|
|
2851
2951
|
}).transform((data) => ({
|
|
2852
2952
|
destination: data["destination"],
|
|
2853
2953
|
dataLimitInGB: data["dataLimitInGb"],
|
|
@@ -2864,33 +2964,33 @@ var createPurchaseV2RequestRequest = import_zod14.z.lazy(() => {
|
|
|
2864
2964
|
});
|
|
2865
2965
|
|
|
2866
2966
|
// src/services/purchases/models/create-purchase-v2-ok-response.ts
|
|
2867
|
-
var
|
|
2967
|
+
var import_zod16 = require("zod");
|
|
2868
2968
|
|
|
2869
2969
|
// src/services/purchases/models/create-purchase-v2-ok-response-purchase.ts
|
|
2870
|
-
var
|
|
2871
|
-
var createPurchaseV2OkResponsePurchase =
|
|
2872
|
-
return
|
|
2873
|
-
id:
|
|
2874
|
-
packageId:
|
|
2875
|
-
createdDate:
|
|
2970
|
+
var import_zod14 = require("zod");
|
|
2971
|
+
var createPurchaseV2OkResponsePurchase = import_zod14.z.lazy(() => {
|
|
2972
|
+
return import_zod14.z.object({
|
|
2973
|
+
id: import_zod14.z.string(),
|
|
2974
|
+
packageId: import_zod14.z.string(),
|
|
2975
|
+
createdDate: import_zod14.z.string()
|
|
2876
2976
|
});
|
|
2877
2977
|
});
|
|
2878
|
-
var createPurchaseV2OkResponsePurchaseResponse =
|
|
2879
|
-
return
|
|
2880
|
-
id:
|
|
2881
|
-
packageId:
|
|
2882
|
-
createdDate:
|
|
2978
|
+
var createPurchaseV2OkResponsePurchaseResponse = import_zod14.z.lazy(() => {
|
|
2979
|
+
return import_zod14.z.object({
|
|
2980
|
+
id: import_zod14.z.string(),
|
|
2981
|
+
packageId: import_zod14.z.string(),
|
|
2982
|
+
createdDate: import_zod14.z.string()
|
|
2883
2983
|
}).transform((data) => ({
|
|
2884
2984
|
id: data["id"],
|
|
2885
2985
|
packageId: data["packageId"],
|
|
2886
2986
|
createdDate: data["createdDate"]
|
|
2887
2987
|
}));
|
|
2888
2988
|
});
|
|
2889
|
-
var createPurchaseV2OkResponsePurchaseRequest =
|
|
2890
|
-
return
|
|
2891
|
-
id:
|
|
2892
|
-
packageId:
|
|
2893
|
-
createdDate:
|
|
2989
|
+
var createPurchaseV2OkResponsePurchaseRequest = import_zod14.z.lazy(() => {
|
|
2990
|
+
return import_zod14.z.object({
|
|
2991
|
+
id: import_zod14.z.string(),
|
|
2992
|
+
packageId: import_zod14.z.string(),
|
|
2993
|
+
createdDate: import_zod14.z.string()
|
|
2894
2994
|
}).transform((data) => ({
|
|
2895
2995
|
id: data["id"],
|
|
2896
2996
|
packageId: data["packageId"],
|
|
@@ -2899,23 +2999,23 @@ var createPurchaseV2OkResponsePurchaseRequest = import_zod15.z.lazy(() => {
|
|
|
2899
2999
|
});
|
|
2900
3000
|
|
|
2901
3001
|
// src/services/purchases/models/create-purchase-v2-ok-response-profile.ts
|
|
2902
|
-
var
|
|
2903
|
-
var createPurchaseV2OkResponseProfile =
|
|
2904
|
-
return
|
|
2905
|
-
iccid:
|
|
2906
|
-
activationCode:
|
|
2907
|
-
manualActivationCode:
|
|
2908
|
-
iosActivationLink:
|
|
2909
|
-
androidActivationLink:
|
|
3002
|
+
var import_zod15 = require("zod");
|
|
3003
|
+
var createPurchaseV2OkResponseProfile = import_zod15.z.lazy(() => {
|
|
3004
|
+
return import_zod15.z.object({
|
|
3005
|
+
iccid: import_zod15.z.string().min(18).max(22),
|
|
3006
|
+
activationCode: import_zod15.z.string().min(1e3).max(8e3),
|
|
3007
|
+
manualActivationCode: import_zod15.z.string(),
|
|
3008
|
+
iosActivationLink: import_zod15.z.string(),
|
|
3009
|
+
androidActivationLink: import_zod15.z.string()
|
|
2910
3010
|
});
|
|
2911
3011
|
});
|
|
2912
|
-
var createPurchaseV2OkResponseProfileResponse =
|
|
2913
|
-
return
|
|
2914
|
-
iccid:
|
|
2915
|
-
activationCode:
|
|
2916
|
-
manualActivationCode:
|
|
2917
|
-
iosActivationLink:
|
|
2918
|
-
androidActivationLink:
|
|
3012
|
+
var createPurchaseV2OkResponseProfileResponse = import_zod15.z.lazy(() => {
|
|
3013
|
+
return import_zod15.z.object({
|
|
3014
|
+
iccid: import_zod15.z.string().min(18).max(22),
|
|
3015
|
+
activationCode: import_zod15.z.string().min(1e3).max(8e3),
|
|
3016
|
+
manualActivationCode: import_zod15.z.string(),
|
|
3017
|
+
iosActivationLink: import_zod15.z.string(),
|
|
3018
|
+
androidActivationLink: import_zod15.z.string()
|
|
2919
3019
|
}).transform((data) => ({
|
|
2920
3020
|
iccid: data["iccid"],
|
|
2921
3021
|
activationCode: data["activationCode"],
|
|
@@ -2924,13 +3024,13 @@ var createPurchaseV2OkResponseProfileResponse = import_zod16.z.lazy(() => {
|
|
|
2924
3024
|
androidActivationLink: data["androidActivationLink"]
|
|
2925
3025
|
}));
|
|
2926
3026
|
});
|
|
2927
|
-
var createPurchaseV2OkResponseProfileRequest =
|
|
2928
|
-
return
|
|
2929
|
-
iccid:
|
|
2930
|
-
activationCode:
|
|
2931
|
-
manualActivationCode:
|
|
2932
|
-
iosActivationLink:
|
|
2933
|
-
androidActivationLink:
|
|
3027
|
+
var createPurchaseV2OkResponseProfileRequest = import_zod15.z.lazy(() => {
|
|
3028
|
+
return import_zod15.z.object({
|
|
3029
|
+
iccid: import_zod15.z.string().min(18).max(22),
|
|
3030
|
+
activationCode: import_zod15.z.string().min(1e3).max(8e3),
|
|
3031
|
+
manualActivationCode: import_zod15.z.string(),
|
|
3032
|
+
iosActivationLink: import_zod15.z.string(),
|
|
3033
|
+
androidActivationLink: import_zod15.z.string()
|
|
2934
3034
|
}).transform((data) => ({
|
|
2935
3035
|
iccid: data["iccid"],
|
|
2936
3036
|
activationCode: data["activationCode"],
|
|
@@ -2941,14 +3041,14 @@ var createPurchaseV2OkResponseProfileRequest = import_zod16.z.lazy(() => {
|
|
|
2941
3041
|
});
|
|
2942
3042
|
|
|
2943
3043
|
// src/services/purchases/models/create-purchase-v2-ok-response.ts
|
|
2944
|
-
var createPurchaseV2OkResponse =
|
|
2945
|
-
return
|
|
3044
|
+
var createPurchaseV2OkResponse = import_zod16.z.lazy(() => {
|
|
3045
|
+
return import_zod16.z.object({
|
|
2946
3046
|
purchase: createPurchaseV2OkResponsePurchase,
|
|
2947
3047
|
profile: createPurchaseV2OkResponseProfile
|
|
2948
3048
|
});
|
|
2949
3049
|
});
|
|
2950
|
-
var createPurchaseV2OkResponseResponse =
|
|
2951
|
-
return
|
|
3050
|
+
var createPurchaseV2OkResponseResponse = import_zod16.z.lazy(() => {
|
|
3051
|
+
return import_zod16.z.object({
|
|
2952
3052
|
purchase: createPurchaseV2OkResponsePurchaseResponse,
|
|
2953
3053
|
profile: createPurchaseV2OkResponseProfileResponse
|
|
2954
3054
|
}).transform((data) => ({
|
|
@@ -2956,8 +3056,8 @@ var createPurchaseV2OkResponseResponse = import_zod17.z.lazy(() => {
|
|
|
2956
3056
|
profile: data["profile"]
|
|
2957
3057
|
}));
|
|
2958
3058
|
});
|
|
2959
|
-
var createPurchaseV2OkResponseRequest =
|
|
2960
|
-
return
|
|
3059
|
+
var createPurchaseV2OkResponseRequest = import_zod16.z.lazy(() => {
|
|
3060
|
+
return import_zod16.z.object({
|
|
2961
3061
|
purchase: createPurchaseV2OkResponsePurchaseRequest,
|
|
2962
3062
|
profile: createPurchaseV2OkResponseProfileRequest
|
|
2963
3063
|
}).transform((data) => ({
|
|
@@ -2967,33 +3067,33 @@ var createPurchaseV2OkResponseRequest = import_zod17.z.lazy(() => {
|
|
|
2967
3067
|
});
|
|
2968
3068
|
|
|
2969
3069
|
// src/services/purchases/models/list-purchases-ok-response.ts
|
|
2970
|
-
var
|
|
3070
|
+
var import_zod20 = require("zod");
|
|
2971
3071
|
|
|
2972
3072
|
// src/services/purchases/models/purchases.ts
|
|
2973
|
-
var
|
|
3073
|
+
var import_zod19 = require("zod");
|
|
2974
3074
|
|
|
2975
3075
|
// src/services/purchases/models/package_.ts
|
|
2976
|
-
var
|
|
2977
|
-
var package_ =
|
|
2978
|
-
return
|
|
2979
|
-
id:
|
|
2980
|
-
dataLimitInBytes:
|
|
2981
|
-
dataLimitInGb:
|
|
2982
|
-
destination:
|
|
2983
|
-
destinationIso2:
|
|
2984
|
-
destinationName:
|
|
2985
|
-
priceInCents:
|
|
3076
|
+
var import_zod17 = require("zod");
|
|
3077
|
+
var package_ = import_zod17.z.lazy(() => {
|
|
3078
|
+
return import_zod17.z.object({
|
|
3079
|
+
id: import_zod17.z.string(),
|
|
3080
|
+
dataLimitInBytes: import_zod17.z.number(),
|
|
3081
|
+
dataLimitInGb: import_zod17.z.number(),
|
|
3082
|
+
destination: import_zod17.z.string(),
|
|
3083
|
+
destinationIso2: import_zod17.z.string(),
|
|
3084
|
+
destinationName: import_zod17.z.string(),
|
|
3085
|
+
priceInCents: import_zod17.z.number()
|
|
2986
3086
|
});
|
|
2987
3087
|
});
|
|
2988
|
-
var packageResponse =
|
|
2989
|
-
return
|
|
2990
|
-
id:
|
|
2991
|
-
dataLimitInBytes:
|
|
2992
|
-
dataLimitInGB:
|
|
2993
|
-
destination:
|
|
2994
|
-
destinationISO2:
|
|
2995
|
-
destinationName:
|
|
2996
|
-
priceInCents:
|
|
3088
|
+
var packageResponse = import_zod17.z.lazy(() => {
|
|
3089
|
+
return import_zod17.z.object({
|
|
3090
|
+
id: import_zod17.z.string(),
|
|
3091
|
+
dataLimitInBytes: import_zod17.z.number(),
|
|
3092
|
+
dataLimitInGB: import_zod17.z.number(),
|
|
3093
|
+
destination: import_zod17.z.string(),
|
|
3094
|
+
destinationISO2: import_zod17.z.string(),
|
|
3095
|
+
destinationName: import_zod17.z.string(),
|
|
3096
|
+
priceInCents: import_zod17.z.number()
|
|
2997
3097
|
}).transform((data) => ({
|
|
2998
3098
|
id: data["id"],
|
|
2999
3099
|
dataLimitInBytes: data["dataLimitInBytes"],
|
|
@@ -3004,15 +3104,15 @@ var packageResponse = import_zod18.z.lazy(() => {
|
|
|
3004
3104
|
priceInCents: data["priceInCents"]
|
|
3005
3105
|
}));
|
|
3006
3106
|
});
|
|
3007
|
-
var packageRequest =
|
|
3008
|
-
return
|
|
3009
|
-
id:
|
|
3010
|
-
dataLimitInBytes:
|
|
3011
|
-
dataLimitInGb:
|
|
3012
|
-
destination:
|
|
3013
|
-
destinationIso2:
|
|
3014
|
-
destinationName:
|
|
3015
|
-
priceInCents:
|
|
3107
|
+
var packageRequest = import_zod17.z.lazy(() => {
|
|
3108
|
+
return import_zod17.z.object({
|
|
3109
|
+
id: import_zod17.z.string(),
|
|
3110
|
+
dataLimitInBytes: import_zod17.z.number(),
|
|
3111
|
+
dataLimitInGb: import_zod17.z.number(),
|
|
3112
|
+
destination: import_zod17.z.string(),
|
|
3113
|
+
destinationIso2: import_zod17.z.string(),
|
|
3114
|
+
destinationName: import_zod17.z.string(),
|
|
3115
|
+
priceInCents: import_zod17.z.number()
|
|
3016
3116
|
}).transform((data) => ({
|
|
3017
3117
|
id: data["id"],
|
|
3018
3118
|
dataLimitInBytes: data["dataLimitInBytes"],
|
|
@@ -3025,60 +3125,60 @@ var packageRequest = import_zod18.z.lazy(() => {
|
|
|
3025
3125
|
});
|
|
3026
3126
|
|
|
3027
3127
|
// src/services/purchases/models/purchases-esim.ts
|
|
3028
|
-
var
|
|
3029
|
-
var purchasesEsim =
|
|
3030
|
-
return
|
|
3031
|
-
iccid:
|
|
3128
|
+
var import_zod18 = require("zod");
|
|
3129
|
+
var purchasesEsim = import_zod18.z.lazy(() => {
|
|
3130
|
+
return import_zod18.z.object({
|
|
3131
|
+
iccid: import_zod18.z.string().min(18).max(22)
|
|
3032
3132
|
});
|
|
3033
3133
|
});
|
|
3034
|
-
var purchasesEsimResponse =
|
|
3035
|
-
return
|
|
3036
|
-
iccid:
|
|
3134
|
+
var purchasesEsimResponse = import_zod18.z.lazy(() => {
|
|
3135
|
+
return import_zod18.z.object({
|
|
3136
|
+
iccid: import_zod18.z.string().min(18).max(22)
|
|
3037
3137
|
}).transform((data) => ({
|
|
3038
3138
|
iccid: data["iccid"]
|
|
3039
3139
|
}));
|
|
3040
3140
|
});
|
|
3041
|
-
var purchasesEsimRequest =
|
|
3042
|
-
return
|
|
3043
|
-
iccid:
|
|
3141
|
+
var purchasesEsimRequest = import_zod18.z.lazy(() => {
|
|
3142
|
+
return import_zod18.z.object({
|
|
3143
|
+
iccid: import_zod18.z.string().min(18).max(22)
|
|
3044
3144
|
}).transform((data) => ({
|
|
3045
3145
|
iccid: data["iccid"]
|
|
3046
3146
|
}));
|
|
3047
3147
|
});
|
|
3048
3148
|
|
|
3049
3149
|
// src/services/purchases/models/purchases.ts
|
|
3050
|
-
var purchases =
|
|
3051
|
-
return
|
|
3052
|
-
id:
|
|
3053
|
-
startDate:
|
|
3054
|
-
endDate:
|
|
3055
|
-
duration:
|
|
3056
|
-
createdDate:
|
|
3057
|
-
startTime:
|
|
3058
|
-
endTime:
|
|
3059
|
-
createdAt:
|
|
3150
|
+
var purchases = import_zod19.z.lazy(() => {
|
|
3151
|
+
return import_zod19.z.object({
|
|
3152
|
+
id: import_zod19.z.string(),
|
|
3153
|
+
startDate: import_zod19.z.string().nullable(),
|
|
3154
|
+
endDate: import_zod19.z.string().nullable(),
|
|
3155
|
+
duration: import_zod19.z.number().optional().nullable(),
|
|
3156
|
+
createdDate: import_zod19.z.string(),
|
|
3157
|
+
startTime: import_zod19.z.number().optional().nullable(),
|
|
3158
|
+
endTime: import_zod19.z.number().optional().nullable(),
|
|
3159
|
+
createdAt: import_zod19.z.number().optional(),
|
|
3060
3160
|
package: package_,
|
|
3061
3161
|
esim: purchasesEsim,
|
|
3062
|
-
source:
|
|
3063
|
-
purchaseType:
|
|
3064
|
-
referenceId:
|
|
3162
|
+
source: import_zod19.z.string(),
|
|
3163
|
+
purchaseType: import_zod19.z.string(),
|
|
3164
|
+
referenceId: import_zod19.z.string().optional().nullable()
|
|
3065
3165
|
});
|
|
3066
3166
|
});
|
|
3067
|
-
var purchasesResponse =
|
|
3068
|
-
return
|
|
3069
|
-
id:
|
|
3070
|
-
startDate:
|
|
3071
|
-
endDate:
|
|
3072
|
-
duration:
|
|
3073
|
-
createdDate:
|
|
3074
|
-
startTime:
|
|
3075
|
-
endTime:
|
|
3076
|
-
createdAt:
|
|
3167
|
+
var purchasesResponse = import_zod19.z.lazy(() => {
|
|
3168
|
+
return import_zod19.z.object({
|
|
3169
|
+
id: import_zod19.z.string(),
|
|
3170
|
+
startDate: import_zod19.z.string().nullable(),
|
|
3171
|
+
endDate: import_zod19.z.string().nullable(),
|
|
3172
|
+
duration: import_zod19.z.number().optional().nullable(),
|
|
3173
|
+
createdDate: import_zod19.z.string(),
|
|
3174
|
+
startTime: import_zod19.z.number().optional().nullable(),
|
|
3175
|
+
endTime: import_zod19.z.number().optional().nullable(),
|
|
3176
|
+
createdAt: import_zod19.z.number().optional(),
|
|
3077
3177
|
package: packageResponse,
|
|
3078
3178
|
esim: purchasesEsimResponse,
|
|
3079
|
-
source:
|
|
3080
|
-
purchaseType:
|
|
3081
|
-
referenceId:
|
|
3179
|
+
source: import_zod19.z.string(),
|
|
3180
|
+
purchaseType: import_zod19.z.string(),
|
|
3181
|
+
referenceId: import_zod19.z.string().optional().nullable()
|
|
3082
3182
|
}).transform((data) => ({
|
|
3083
3183
|
id: data["id"],
|
|
3084
3184
|
startDate: data["startDate"],
|
|
@@ -3095,21 +3195,21 @@ var purchasesResponse = import_zod20.z.lazy(() => {
|
|
|
3095
3195
|
referenceId: data["referenceId"]
|
|
3096
3196
|
}));
|
|
3097
3197
|
});
|
|
3098
|
-
var purchasesRequest =
|
|
3099
|
-
return
|
|
3100
|
-
id:
|
|
3101
|
-
startDate:
|
|
3102
|
-
endDate:
|
|
3103
|
-
duration:
|
|
3104
|
-
createdDate:
|
|
3105
|
-
startTime:
|
|
3106
|
-
endTime:
|
|
3107
|
-
createdAt:
|
|
3198
|
+
var purchasesRequest = import_zod19.z.lazy(() => {
|
|
3199
|
+
return import_zod19.z.object({
|
|
3200
|
+
id: import_zod19.z.string(),
|
|
3201
|
+
startDate: import_zod19.z.string().nullable(),
|
|
3202
|
+
endDate: import_zod19.z.string().nullable(),
|
|
3203
|
+
duration: import_zod19.z.number().optional().nullable(),
|
|
3204
|
+
createdDate: import_zod19.z.string(),
|
|
3205
|
+
startTime: import_zod19.z.number().optional().nullable(),
|
|
3206
|
+
endTime: import_zod19.z.number().optional().nullable(),
|
|
3207
|
+
createdAt: import_zod19.z.number().optional(),
|
|
3108
3208
|
package: packageRequest,
|
|
3109
3209
|
esim: purchasesEsimRequest,
|
|
3110
|
-
source:
|
|
3111
|
-
purchaseType:
|
|
3112
|
-
referenceId:
|
|
3210
|
+
source: import_zod19.z.string(),
|
|
3211
|
+
purchaseType: import_zod19.z.string(),
|
|
3212
|
+
referenceId: import_zod19.z.string().optional().nullable()
|
|
3113
3213
|
}).transform((data) => ({
|
|
3114
3214
|
id: data["id"],
|
|
3115
3215
|
startDate: data["startDate"],
|
|
@@ -3128,25 +3228,25 @@ var purchasesRequest = import_zod20.z.lazy(() => {
|
|
|
3128
3228
|
});
|
|
3129
3229
|
|
|
3130
3230
|
// src/services/purchases/models/list-purchases-ok-response.ts
|
|
3131
|
-
var listPurchasesOkResponse =
|
|
3132
|
-
return
|
|
3133
|
-
purchases:
|
|
3134
|
-
afterCursor:
|
|
3231
|
+
var listPurchasesOkResponse = import_zod20.z.lazy(() => {
|
|
3232
|
+
return import_zod20.z.object({
|
|
3233
|
+
purchases: import_zod20.z.array(purchases),
|
|
3234
|
+
afterCursor: import_zod20.z.string().nullable()
|
|
3135
3235
|
});
|
|
3136
3236
|
});
|
|
3137
|
-
var listPurchasesOkResponseResponse =
|
|
3138
|
-
return
|
|
3139
|
-
purchases:
|
|
3140
|
-
afterCursor:
|
|
3237
|
+
var listPurchasesOkResponseResponse = import_zod20.z.lazy(() => {
|
|
3238
|
+
return import_zod20.z.object({
|
|
3239
|
+
purchases: import_zod20.z.array(purchasesResponse),
|
|
3240
|
+
afterCursor: import_zod20.z.string().nullable()
|
|
3141
3241
|
}).transform((data) => ({
|
|
3142
3242
|
purchases: data["purchases"],
|
|
3143
3243
|
afterCursor: data["afterCursor"]
|
|
3144
3244
|
}));
|
|
3145
3245
|
});
|
|
3146
|
-
var listPurchasesOkResponseRequest =
|
|
3147
|
-
return
|
|
3148
|
-
purchases:
|
|
3149
|
-
afterCursor:
|
|
3246
|
+
var listPurchasesOkResponseRequest = import_zod20.z.lazy(() => {
|
|
3247
|
+
return import_zod20.z.object({
|
|
3248
|
+
purchases: import_zod20.z.array(purchasesRequest),
|
|
3249
|
+
afterCursor: import_zod20.z.string().nullable()
|
|
3150
3250
|
}).transform((data) => ({
|
|
3151
3251
|
purchases: data["purchases"],
|
|
3152
3252
|
afterCursor: data["afterCursor"]
|
|
@@ -3154,35 +3254,35 @@ var listPurchasesOkResponseRequest = import_zod21.z.lazy(() => {
|
|
|
3154
3254
|
});
|
|
3155
3255
|
|
|
3156
3256
|
// src/services/purchases/models/create-purchase-request.ts
|
|
3157
|
-
var
|
|
3158
|
-
var createPurchaseRequest =
|
|
3159
|
-
return
|
|
3160
|
-
destination:
|
|
3161
|
-
dataLimitInGb:
|
|
3162
|
-
startDate:
|
|
3163
|
-
endDate:
|
|
3164
|
-
email:
|
|
3165
|
-
referenceId:
|
|
3166
|
-
networkBrand:
|
|
3167
|
-
emailBrand:
|
|
3168
|
-
language:
|
|
3169
|
-
startTime:
|
|
3170
|
-
endTime:
|
|
3257
|
+
var import_zod21 = require("zod");
|
|
3258
|
+
var createPurchaseRequest = import_zod21.z.lazy(() => {
|
|
3259
|
+
return import_zod21.z.object({
|
|
3260
|
+
destination: import_zod21.z.string(),
|
|
3261
|
+
dataLimitInGb: import_zod21.z.number(),
|
|
3262
|
+
startDate: import_zod21.z.string(),
|
|
3263
|
+
endDate: import_zod21.z.string(),
|
|
3264
|
+
email: import_zod21.z.string().optional(),
|
|
3265
|
+
referenceId: import_zod21.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
3266
|
+
networkBrand: import_zod21.z.string().optional(),
|
|
3267
|
+
emailBrand: import_zod21.z.string().optional(),
|
|
3268
|
+
language: import_zod21.z.string().optional(),
|
|
3269
|
+
startTime: import_zod21.z.number().optional(),
|
|
3270
|
+
endTime: import_zod21.z.number().optional()
|
|
3171
3271
|
});
|
|
3172
3272
|
});
|
|
3173
|
-
var createPurchaseRequestResponse =
|
|
3174
|
-
return
|
|
3175
|
-
destination:
|
|
3176
|
-
dataLimitInGB:
|
|
3177
|
-
startDate:
|
|
3178
|
-
endDate:
|
|
3179
|
-
email:
|
|
3180
|
-
referenceId:
|
|
3181
|
-
networkBrand:
|
|
3182
|
-
emailBrand:
|
|
3183
|
-
language:
|
|
3184
|
-
startTime:
|
|
3185
|
-
endTime:
|
|
3273
|
+
var createPurchaseRequestResponse = import_zod21.z.lazy(() => {
|
|
3274
|
+
return import_zod21.z.object({
|
|
3275
|
+
destination: import_zod21.z.string(),
|
|
3276
|
+
dataLimitInGB: import_zod21.z.number(),
|
|
3277
|
+
startDate: import_zod21.z.string(),
|
|
3278
|
+
endDate: import_zod21.z.string(),
|
|
3279
|
+
email: import_zod21.z.string().optional(),
|
|
3280
|
+
referenceId: import_zod21.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
3281
|
+
networkBrand: import_zod21.z.string().optional(),
|
|
3282
|
+
emailBrand: import_zod21.z.string().optional(),
|
|
3283
|
+
language: import_zod21.z.string().optional(),
|
|
3284
|
+
startTime: import_zod21.z.number().optional(),
|
|
3285
|
+
endTime: import_zod21.z.number().optional()
|
|
3186
3286
|
}).transform((data) => ({
|
|
3187
3287
|
destination: data["destination"],
|
|
3188
3288
|
dataLimitInGb: data["dataLimitInGB"],
|
|
@@ -3197,19 +3297,19 @@ var createPurchaseRequestResponse = import_zod22.z.lazy(() => {
|
|
|
3197
3297
|
endTime: data["endTime"]
|
|
3198
3298
|
}));
|
|
3199
3299
|
});
|
|
3200
|
-
var createPurchaseRequestRequest =
|
|
3201
|
-
return
|
|
3202
|
-
destination:
|
|
3203
|
-
dataLimitInGb:
|
|
3204
|
-
startDate:
|
|
3205
|
-
endDate:
|
|
3206
|
-
email:
|
|
3207
|
-
referenceId:
|
|
3208
|
-
networkBrand:
|
|
3209
|
-
emailBrand:
|
|
3210
|
-
language:
|
|
3211
|
-
startTime:
|
|
3212
|
-
endTime:
|
|
3300
|
+
var createPurchaseRequestRequest = import_zod21.z.lazy(() => {
|
|
3301
|
+
return import_zod21.z.object({
|
|
3302
|
+
destination: import_zod21.z.string(),
|
|
3303
|
+
dataLimitInGb: import_zod21.z.number(),
|
|
3304
|
+
startDate: import_zod21.z.string(),
|
|
3305
|
+
endDate: import_zod21.z.string(),
|
|
3306
|
+
email: import_zod21.z.string().optional(),
|
|
3307
|
+
referenceId: import_zod21.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
3308
|
+
networkBrand: import_zod21.z.string().optional(),
|
|
3309
|
+
emailBrand: import_zod21.z.string().optional(),
|
|
3310
|
+
language: import_zod21.z.string().optional(),
|
|
3311
|
+
startTime: import_zod21.z.number().optional(),
|
|
3312
|
+
endTime: import_zod21.z.number().optional()
|
|
3213
3313
|
}).transform((data) => ({
|
|
3214
3314
|
destination: data["destination"],
|
|
3215
3315
|
dataLimitInGB: data["dataLimitInGb"],
|
|
@@ -3226,30 +3326,30 @@ var createPurchaseRequestRequest = import_zod22.z.lazy(() => {
|
|
|
3226
3326
|
});
|
|
3227
3327
|
|
|
3228
3328
|
// src/services/purchases/models/create-purchase-ok-response.ts
|
|
3229
|
-
var
|
|
3329
|
+
var import_zod24 = require("zod");
|
|
3230
3330
|
|
|
3231
3331
|
// src/services/purchases/models/create-purchase-ok-response-purchase.ts
|
|
3232
|
-
var
|
|
3233
|
-
var createPurchaseOkResponsePurchase =
|
|
3234
|
-
return
|
|
3235
|
-
id:
|
|
3236
|
-
packageId:
|
|
3237
|
-
startDate:
|
|
3238
|
-
endDate:
|
|
3239
|
-
createdDate:
|
|
3240
|
-
startTime:
|
|
3241
|
-
endTime:
|
|
3332
|
+
var import_zod22 = require("zod");
|
|
3333
|
+
var createPurchaseOkResponsePurchase = import_zod22.z.lazy(() => {
|
|
3334
|
+
return import_zod22.z.object({
|
|
3335
|
+
id: import_zod22.z.string(),
|
|
3336
|
+
packageId: import_zod22.z.string(),
|
|
3337
|
+
startDate: import_zod22.z.string().nullable(),
|
|
3338
|
+
endDate: import_zod22.z.string().nullable(),
|
|
3339
|
+
createdDate: import_zod22.z.string(),
|
|
3340
|
+
startTime: import_zod22.z.number().optional().nullable(),
|
|
3341
|
+
endTime: import_zod22.z.number().optional().nullable()
|
|
3242
3342
|
});
|
|
3243
3343
|
});
|
|
3244
|
-
var createPurchaseOkResponsePurchaseResponse =
|
|
3245
|
-
return
|
|
3246
|
-
id:
|
|
3247
|
-
packageId:
|
|
3248
|
-
startDate:
|
|
3249
|
-
endDate:
|
|
3250
|
-
createdDate:
|
|
3251
|
-
startTime:
|
|
3252
|
-
endTime:
|
|
3344
|
+
var createPurchaseOkResponsePurchaseResponse = import_zod22.z.lazy(() => {
|
|
3345
|
+
return import_zod22.z.object({
|
|
3346
|
+
id: import_zod22.z.string(),
|
|
3347
|
+
packageId: import_zod22.z.string(),
|
|
3348
|
+
startDate: import_zod22.z.string().nullable(),
|
|
3349
|
+
endDate: import_zod22.z.string().nullable(),
|
|
3350
|
+
createdDate: import_zod22.z.string(),
|
|
3351
|
+
startTime: import_zod22.z.number().optional().nullable(),
|
|
3352
|
+
endTime: import_zod22.z.number().optional().nullable()
|
|
3253
3353
|
}).transform((data) => ({
|
|
3254
3354
|
id: data["id"],
|
|
3255
3355
|
packageId: data["packageId"],
|
|
@@ -3260,15 +3360,15 @@ var createPurchaseOkResponsePurchaseResponse = import_zod23.z.lazy(() => {
|
|
|
3260
3360
|
endTime: data["endTime"]
|
|
3261
3361
|
}));
|
|
3262
3362
|
});
|
|
3263
|
-
var createPurchaseOkResponsePurchaseRequest =
|
|
3264
|
-
return
|
|
3265
|
-
id:
|
|
3266
|
-
packageId:
|
|
3267
|
-
startDate:
|
|
3268
|
-
endDate:
|
|
3269
|
-
createdDate:
|
|
3270
|
-
startTime:
|
|
3271
|
-
endTime:
|
|
3363
|
+
var createPurchaseOkResponsePurchaseRequest = import_zod22.z.lazy(() => {
|
|
3364
|
+
return import_zod22.z.object({
|
|
3365
|
+
id: import_zod22.z.string(),
|
|
3366
|
+
packageId: import_zod22.z.string(),
|
|
3367
|
+
startDate: import_zod22.z.string().nullable(),
|
|
3368
|
+
endDate: import_zod22.z.string().nullable(),
|
|
3369
|
+
createdDate: import_zod22.z.string(),
|
|
3370
|
+
startTime: import_zod22.z.number().optional().nullable(),
|
|
3371
|
+
endTime: import_zod22.z.number().optional().nullable()
|
|
3272
3372
|
}).transform((data) => ({
|
|
3273
3373
|
id: data["id"],
|
|
3274
3374
|
packageId: data["packageId"],
|
|
@@ -3281,30 +3381,30 @@ var createPurchaseOkResponsePurchaseRequest = import_zod23.z.lazy(() => {
|
|
|
3281
3381
|
});
|
|
3282
3382
|
|
|
3283
3383
|
// src/services/purchases/models/create-purchase-ok-response-profile.ts
|
|
3284
|
-
var
|
|
3285
|
-
var createPurchaseOkResponseProfile =
|
|
3286
|
-
return
|
|
3287
|
-
iccid:
|
|
3288
|
-
activationCode:
|
|
3289
|
-
manualActivationCode:
|
|
3384
|
+
var import_zod23 = require("zod");
|
|
3385
|
+
var createPurchaseOkResponseProfile = import_zod23.z.lazy(() => {
|
|
3386
|
+
return import_zod23.z.object({
|
|
3387
|
+
iccid: import_zod23.z.string().min(18).max(22),
|
|
3388
|
+
activationCode: import_zod23.z.string().min(1e3).max(8e3),
|
|
3389
|
+
manualActivationCode: import_zod23.z.string()
|
|
3290
3390
|
});
|
|
3291
3391
|
});
|
|
3292
|
-
var createPurchaseOkResponseProfileResponse =
|
|
3293
|
-
return
|
|
3294
|
-
iccid:
|
|
3295
|
-
activationCode:
|
|
3296
|
-
manualActivationCode:
|
|
3392
|
+
var createPurchaseOkResponseProfileResponse = import_zod23.z.lazy(() => {
|
|
3393
|
+
return import_zod23.z.object({
|
|
3394
|
+
iccid: import_zod23.z.string().min(18).max(22),
|
|
3395
|
+
activationCode: import_zod23.z.string().min(1e3).max(8e3),
|
|
3396
|
+
manualActivationCode: import_zod23.z.string()
|
|
3297
3397
|
}).transform((data) => ({
|
|
3298
3398
|
iccid: data["iccid"],
|
|
3299
3399
|
activationCode: data["activationCode"],
|
|
3300
3400
|
manualActivationCode: data["manualActivationCode"]
|
|
3301
3401
|
}));
|
|
3302
3402
|
});
|
|
3303
|
-
var createPurchaseOkResponseProfileRequest =
|
|
3304
|
-
return
|
|
3305
|
-
iccid:
|
|
3306
|
-
activationCode:
|
|
3307
|
-
manualActivationCode:
|
|
3403
|
+
var createPurchaseOkResponseProfileRequest = import_zod23.z.lazy(() => {
|
|
3404
|
+
return import_zod23.z.object({
|
|
3405
|
+
iccid: import_zod23.z.string().min(18).max(22),
|
|
3406
|
+
activationCode: import_zod23.z.string().min(1e3).max(8e3),
|
|
3407
|
+
manualActivationCode: import_zod23.z.string()
|
|
3308
3408
|
}).transform((data) => ({
|
|
3309
3409
|
iccid: data["iccid"],
|
|
3310
3410
|
activationCode: data["activationCode"],
|
|
@@ -3313,14 +3413,14 @@ var createPurchaseOkResponseProfileRequest = import_zod24.z.lazy(() => {
|
|
|
3313
3413
|
});
|
|
3314
3414
|
|
|
3315
3415
|
// src/services/purchases/models/create-purchase-ok-response.ts
|
|
3316
|
-
var createPurchaseOkResponse =
|
|
3317
|
-
return
|
|
3416
|
+
var createPurchaseOkResponse = import_zod24.z.lazy(() => {
|
|
3417
|
+
return import_zod24.z.object({
|
|
3318
3418
|
purchase: createPurchaseOkResponsePurchase,
|
|
3319
3419
|
profile: createPurchaseOkResponseProfile
|
|
3320
3420
|
});
|
|
3321
3421
|
});
|
|
3322
|
-
var createPurchaseOkResponseResponse =
|
|
3323
|
-
return
|
|
3422
|
+
var createPurchaseOkResponseResponse = import_zod24.z.lazy(() => {
|
|
3423
|
+
return import_zod24.z.object({
|
|
3324
3424
|
purchase: createPurchaseOkResponsePurchaseResponse,
|
|
3325
3425
|
profile: createPurchaseOkResponseProfileResponse
|
|
3326
3426
|
}).transform((data) => ({
|
|
@@ -3328,8 +3428,8 @@ var createPurchaseOkResponseResponse = import_zod25.z.lazy(() => {
|
|
|
3328
3428
|
profile: data["profile"]
|
|
3329
3429
|
}));
|
|
3330
3430
|
});
|
|
3331
|
-
var createPurchaseOkResponseRequest =
|
|
3332
|
-
return
|
|
3431
|
+
var createPurchaseOkResponseRequest = import_zod24.z.lazy(() => {
|
|
3432
|
+
return import_zod24.z.object({
|
|
3333
3433
|
purchase: createPurchaseOkResponsePurchaseRequest,
|
|
3334
3434
|
profile: createPurchaseOkResponseProfileRequest
|
|
3335
3435
|
}).transform((data) => ({
|
|
@@ -3339,33 +3439,33 @@ var createPurchaseOkResponseRequest = import_zod25.z.lazy(() => {
|
|
|
3339
3439
|
});
|
|
3340
3440
|
|
|
3341
3441
|
// src/services/purchases/models/top-up-esim-request.ts
|
|
3342
|
-
var
|
|
3343
|
-
var topUpEsimRequest =
|
|
3344
|
-
return
|
|
3345
|
-
iccid:
|
|
3346
|
-
dataLimitInGb:
|
|
3347
|
-
startDate:
|
|
3348
|
-
endDate:
|
|
3349
|
-
duration:
|
|
3350
|
-
email:
|
|
3351
|
-
referenceId:
|
|
3352
|
-
emailBrand:
|
|
3353
|
-
startTime:
|
|
3354
|
-
endTime:
|
|
3442
|
+
var import_zod25 = require("zod");
|
|
3443
|
+
var topUpEsimRequest = import_zod25.z.lazy(() => {
|
|
3444
|
+
return import_zod25.z.object({
|
|
3445
|
+
iccid: import_zod25.z.string().min(18).max(22),
|
|
3446
|
+
dataLimitInGb: import_zod25.z.number(),
|
|
3447
|
+
startDate: import_zod25.z.string().optional(),
|
|
3448
|
+
endDate: import_zod25.z.string().optional(),
|
|
3449
|
+
duration: import_zod25.z.number().optional(),
|
|
3450
|
+
email: import_zod25.z.string().optional(),
|
|
3451
|
+
referenceId: import_zod25.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
3452
|
+
emailBrand: import_zod25.z.string().optional(),
|
|
3453
|
+
startTime: import_zod25.z.number().optional(),
|
|
3454
|
+
endTime: import_zod25.z.number().optional()
|
|
3355
3455
|
});
|
|
3356
3456
|
});
|
|
3357
|
-
var topUpEsimRequestResponse =
|
|
3358
|
-
return
|
|
3359
|
-
iccid:
|
|
3360
|
-
dataLimitInGB:
|
|
3361
|
-
startDate:
|
|
3362
|
-
endDate:
|
|
3363
|
-
duration:
|
|
3364
|
-
email:
|
|
3365
|
-
referenceId:
|
|
3366
|
-
emailBrand:
|
|
3367
|
-
startTime:
|
|
3368
|
-
endTime:
|
|
3457
|
+
var topUpEsimRequestResponse = import_zod25.z.lazy(() => {
|
|
3458
|
+
return import_zod25.z.object({
|
|
3459
|
+
iccid: import_zod25.z.string().min(18).max(22),
|
|
3460
|
+
dataLimitInGB: import_zod25.z.number(),
|
|
3461
|
+
startDate: import_zod25.z.string().optional(),
|
|
3462
|
+
endDate: import_zod25.z.string().optional(),
|
|
3463
|
+
duration: import_zod25.z.number().optional(),
|
|
3464
|
+
email: import_zod25.z.string().optional(),
|
|
3465
|
+
referenceId: import_zod25.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
3466
|
+
emailBrand: import_zod25.z.string().optional(),
|
|
3467
|
+
startTime: import_zod25.z.number().optional(),
|
|
3468
|
+
endTime: import_zod25.z.number().optional()
|
|
3369
3469
|
}).transform((data) => ({
|
|
3370
3470
|
iccid: data["iccid"],
|
|
3371
3471
|
dataLimitInGb: data["dataLimitInGB"],
|
|
@@ -3379,18 +3479,18 @@ var topUpEsimRequestResponse = import_zod26.z.lazy(() => {
|
|
|
3379
3479
|
endTime: data["endTime"]
|
|
3380
3480
|
}));
|
|
3381
3481
|
});
|
|
3382
|
-
var topUpEsimRequestRequest =
|
|
3383
|
-
return
|
|
3384
|
-
iccid:
|
|
3385
|
-
dataLimitInGb:
|
|
3386
|
-
startDate:
|
|
3387
|
-
endDate:
|
|
3388
|
-
duration:
|
|
3389
|
-
email:
|
|
3390
|
-
referenceId:
|
|
3391
|
-
emailBrand:
|
|
3392
|
-
startTime:
|
|
3393
|
-
endTime:
|
|
3482
|
+
var topUpEsimRequestRequest = import_zod25.z.lazy(() => {
|
|
3483
|
+
return import_zod25.z.object({
|
|
3484
|
+
iccid: import_zod25.z.string().min(18).max(22),
|
|
3485
|
+
dataLimitInGb: import_zod25.z.number(),
|
|
3486
|
+
startDate: import_zod25.z.string().optional(),
|
|
3487
|
+
endDate: import_zod25.z.string().optional(),
|
|
3488
|
+
duration: import_zod25.z.number().optional(),
|
|
3489
|
+
email: import_zod25.z.string().optional(),
|
|
3490
|
+
referenceId: import_zod25.z.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
|
|
3491
|
+
emailBrand: import_zod25.z.string().optional(),
|
|
3492
|
+
startTime: import_zod25.z.number().optional(),
|
|
3493
|
+
endTime: import_zod25.z.number().optional()
|
|
3394
3494
|
}).transform((data) => ({
|
|
3395
3495
|
iccid: data["iccid"],
|
|
3396
3496
|
dataLimitInGB: data["dataLimitInGb"],
|
|
@@ -3406,30 +3506,30 @@ var topUpEsimRequestRequest = import_zod26.z.lazy(() => {
|
|
|
3406
3506
|
});
|
|
3407
3507
|
|
|
3408
3508
|
// src/services/purchases/models/top-up-esim-ok-response.ts
|
|
3409
|
-
var
|
|
3509
|
+
var import_zod28 = require("zod");
|
|
3410
3510
|
|
|
3411
3511
|
// src/services/purchases/models/top-up-esim-ok-response-purchase.ts
|
|
3412
|
-
var
|
|
3413
|
-
var topUpEsimOkResponsePurchase =
|
|
3414
|
-
return
|
|
3415
|
-
id:
|
|
3416
|
-
packageId:
|
|
3417
|
-
startDate:
|
|
3418
|
-
endDate:
|
|
3419
|
-
createdDate:
|
|
3420
|
-
startTime:
|
|
3421
|
-
endTime:
|
|
3512
|
+
var import_zod26 = require("zod");
|
|
3513
|
+
var topUpEsimOkResponsePurchase = import_zod26.z.lazy(() => {
|
|
3514
|
+
return import_zod26.z.object({
|
|
3515
|
+
id: import_zod26.z.string(),
|
|
3516
|
+
packageId: import_zod26.z.string(),
|
|
3517
|
+
startDate: import_zod26.z.string().nullable(),
|
|
3518
|
+
endDate: import_zod26.z.string().nullable(),
|
|
3519
|
+
createdDate: import_zod26.z.string(),
|
|
3520
|
+
startTime: import_zod26.z.number().optional().nullable(),
|
|
3521
|
+
endTime: import_zod26.z.number().optional().nullable()
|
|
3422
3522
|
});
|
|
3423
3523
|
});
|
|
3424
|
-
var topUpEsimOkResponsePurchaseResponse =
|
|
3425
|
-
return
|
|
3426
|
-
id:
|
|
3427
|
-
packageId:
|
|
3428
|
-
startDate:
|
|
3429
|
-
endDate:
|
|
3430
|
-
createdDate:
|
|
3431
|
-
startTime:
|
|
3432
|
-
endTime:
|
|
3524
|
+
var topUpEsimOkResponsePurchaseResponse = import_zod26.z.lazy(() => {
|
|
3525
|
+
return import_zod26.z.object({
|
|
3526
|
+
id: import_zod26.z.string(),
|
|
3527
|
+
packageId: import_zod26.z.string(),
|
|
3528
|
+
startDate: import_zod26.z.string().nullable(),
|
|
3529
|
+
endDate: import_zod26.z.string().nullable(),
|
|
3530
|
+
createdDate: import_zod26.z.string(),
|
|
3531
|
+
startTime: import_zod26.z.number().optional().nullable(),
|
|
3532
|
+
endTime: import_zod26.z.number().optional().nullable()
|
|
3433
3533
|
}).transform((data) => ({
|
|
3434
3534
|
id: data["id"],
|
|
3435
3535
|
packageId: data["packageId"],
|
|
@@ -3440,15 +3540,15 @@ var topUpEsimOkResponsePurchaseResponse = import_zod27.z.lazy(() => {
|
|
|
3440
3540
|
endTime: data["endTime"]
|
|
3441
3541
|
}));
|
|
3442
3542
|
});
|
|
3443
|
-
var topUpEsimOkResponsePurchaseRequest =
|
|
3444
|
-
return
|
|
3445
|
-
id:
|
|
3446
|
-
packageId:
|
|
3447
|
-
startDate:
|
|
3448
|
-
endDate:
|
|
3449
|
-
createdDate:
|
|
3450
|
-
startTime:
|
|
3451
|
-
endTime:
|
|
3543
|
+
var topUpEsimOkResponsePurchaseRequest = import_zod26.z.lazy(() => {
|
|
3544
|
+
return import_zod26.z.object({
|
|
3545
|
+
id: import_zod26.z.string(),
|
|
3546
|
+
packageId: import_zod26.z.string(),
|
|
3547
|
+
startDate: import_zod26.z.string().nullable(),
|
|
3548
|
+
endDate: import_zod26.z.string().nullable(),
|
|
3549
|
+
createdDate: import_zod26.z.string(),
|
|
3550
|
+
startTime: import_zod26.z.number().optional().nullable(),
|
|
3551
|
+
endTime: import_zod26.z.number().optional().nullable()
|
|
3452
3552
|
}).transform((data) => ({
|
|
3453
3553
|
id: data["id"],
|
|
3454
3554
|
packageId: data["packageId"],
|
|
@@ -3461,36 +3561,36 @@ var topUpEsimOkResponsePurchaseRequest = import_zod27.z.lazy(() => {
|
|
|
3461
3561
|
});
|
|
3462
3562
|
|
|
3463
3563
|
// src/services/purchases/models/top-up-esim-ok-response-profile.ts
|
|
3464
|
-
var
|
|
3465
|
-
var topUpEsimOkResponseProfile =
|
|
3466
|
-
return
|
|
3467
|
-
iccid:
|
|
3564
|
+
var import_zod27 = require("zod");
|
|
3565
|
+
var topUpEsimOkResponseProfile = import_zod27.z.lazy(() => {
|
|
3566
|
+
return import_zod27.z.object({
|
|
3567
|
+
iccid: import_zod27.z.string().min(18).max(22)
|
|
3468
3568
|
});
|
|
3469
3569
|
});
|
|
3470
|
-
var topUpEsimOkResponseProfileResponse =
|
|
3471
|
-
return
|
|
3472
|
-
iccid:
|
|
3570
|
+
var topUpEsimOkResponseProfileResponse = import_zod27.z.lazy(() => {
|
|
3571
|
+
return import_zod27.z.object({
|
|
3572
|
+
iccid: import_zod27.z.string().min(18).max(22)
|
|
3473
3573
|
}).transform((data) => ({
|
|
3474
3574
|
iccid: data["iccid"]
|
|
3475
3575
|
}));
|
|
3476
3576
|
});
|
|
3477
|
-
var topUpEsimOkResponseProfileRequest =
|
|
3478
|
-
return
|
|
3479
|
-
iccid:
|
|
3577
|
+
var topUpEsimOkResponseProfileRequest = import_zod27.z.lazy(() => {
|
|
3578
|
+
return import_zod27.z.object({
|
|
3579
|
+
iccid: import_zod27.z.string().min(18).max(22)
|
|
3480
3580
|
}).transform((data) => ({
|
|
3481
3581
|
iccid: data["iccid"]
|
|
3482
3582
|
}));
|
|
3483
3583
|
});
|
|
3484
3584
|
|
|
3485
3585
|
// src/services/purchases/models/top-up-esim-ok-response.ts
|
|
3486
|
-
var topUpEsimOkResponse =
|
|
3487
|
-
return
|
|
3586
|
+
var topUpEsimOkResponse = import_zod28.z.lazy(() => {
|
|
3587
|
+
return import_zod28.z.object({
|
|
3488
3588
|
purchase: topUpEsimOkResponsePurchase,
|
|
3489
3589
|
profile: topUpEsimOkResponseProfile
|
|
3490
3590
|
});
|
|
3491
3591
|
});
|
|
3492
|
-
var topUpEsimOkResponseResponse =
|
|
3493
|
-
return
|
|
3592
|
+
var topUpEsimOkResponseResponse = import_zod28.z.lazy(() => {
|
|
3593
|
+
return import_zod28.z.object({
|
|
3494
3594
|
purchase: topUpEsimOkResponsePurchaseResponse,
|
|
3495
3595
|
profile: topUpEsimOkResponseProfileResponse
|
|
3496
3596
|
}).transform((data) => ({
|
|
@@ -3498,8 +3598,8 @@ var topUpEsimOkResponseResponse = import_zod29.z.lazy(() => {
|
|
|
3498
3598
|
profile: data["profile"]
|
|
3499
3599
|
}));
|
|
3500
3600
|
});
|
|
3501
|
-
var topUpEsimOkResponseRequest =
|
|
3502
|
-
return
|
|
3601
|
+
var topUpEsimOkResponseRequest = import_zod28.z.lazy(() => {
|
|
3602
|
+
return import_zod28.z.object({
|
|
3503
3603
|
purchase: topUpEsimOkResponsePurchaseRequest,
|
|
3504
3604
|
profile: topUpEsimOkResponseProfileRequest
|
|
3505
3605
|
}).transform((data) => ({
|
|
@@ -3509,23 +3609,23 @@ var topUpEsimOkResponseRequest = import_zod29.z.lazy(() => {
|
|
|
3509
3609
|
});
|
|
3510
3610
|
|
|
3511
3611
|
// src/services/purchases/models/edit-purchase-request.ts
|
|
3512
|
-
var
|
|
3513
|
-
var editPurchaseRequest =
|
|
3514
|
-
return
|
|
3515
|
-
purchaseId:
|
|
3516
|
-
startDate:
|
|
3517
|
-
endDate:
|
|
3518
|
-
startTime:
|
|
3519
|
-
endTime:
|
|
3612
|
+
var import_zod29 = require("zod");
|
|
3613
|
+
var editPurchaseRequest = import_zod29.z.lazy(() => {
|
|
3614
|
+
return import_zod29.z.object({
|
|
3615
|
+
purchaseId: import_zod29.z.string(),
|
|
3616
|
+
startDate: import_zod29.z.string(),
|
|
3617
|
+
endDate: import_zod29.z.string(),
|
|
3618
|
+
startTime: import_zod29.z.number().optional(),
|
|
3619
|
+
endTime: import_zod29.z.number().optional()
|
|
3520
3620
|
});
|
|
3521
3621
|
});
|
|
3522
|
-
var editPurchaseRequestResponse =
|
|
3523
|
-
return
|
|
3524
|
-
purchaseId:
|
|
3525
|
-
startDate:
|
|
3526
|
-
endDate:
|
|
3527
|
-
startTime:
|
|
3528
|
-
endTime:
|
|
3622
|
+
var editPurchaseRequestResponse = import_zod29.z.lazy(() => {
|
|
3623
|
+
return import_zod29.z.object({
|
|
3624
|
+
purchaseId: import_zod29.z.string(),
|
|
3625
|
+
startDate: import_zod29.z.string(),
|
|
3626
|
+
endDate: import_zod29.z.string(),
|
|
3627
|
+
startTime: import_zod29.z.number().optional(),
|
|
3628
|
+
endTime: import_zod29.z.number().optional()
|
|
3529
3629
|
}).transform((data) => ({
|
|
3530
3630
|
purchaseId: data["purchaseId"],
|
|
3531
3631
|
startDate: data["startDate"],
|
|
@@ -3534,13 +3634,13 @@ var editPurchaseRequestResponse = import_zod30.z.lazy(() => {
|
|
|
3534
3634
|
endTime: data["endTime"]
|
|
3535
3635
|
}));
|
|
3536
3636
|
});
|
|
3537
|
-
var editPurchaseRequestRequest =
|
|
3538
|
-
return
|
|
3539
|
-
purchaseId:
|
|
3540
|
-
startDate:
|
|
3541
|
-
endDate:
|
|
3542
|
-
startTime:
|
|
3543
|
-
endTime:
|
|
3637
|
+
var editPurchaseRequestRequest = import_zod29.z.lazy(() => {
|
|
3638
|
+
return import_zod29.z.object({
|
|
3639
|
+
purchaseId: import_zod29.z.string(),
|
|
3640
|
+
startDate: import_zod29.z.string(),
|
|
3641
|
+
endDate: import_zod29.z.string(),
|
|
3642
|
+
startTime: import_zod29.z.number().optional(),
|
|
3643
|
+
endTime: import_zod29.z.number().optional()
|
|
3544
3644
|
}).transform((data) => ({
|
|
3545
3645
|
purchaseId: data["purchaseId"],
|
|
3546
3646
|
startDate: data["startDate"],
|
|
@@ -3551,23 +3651,23 @@ var editPurchaseRequestRequest = import_zod30.z.lazy(() => {
|
|
|
3551
3651
|
});
|
|
3552
3652
|
|
|
3553
3653
|
// src/services/purchases/models/edit-purchase-ok-response.ts
|
|
3554
|
-
var
|
|
3555
|
-
var editPurchaseOkResponse =
|
|
3556
|
-
return
|
|
3557
|
-
purchaseId:
|
|
3558
|
-
newStartDate:
|
|
3559
|
-
newEndDate:
|
|
3560
|
-
newStartTime:
|
|
3561
|
-
newEndTime:
|
|
3654
|
+
var import_zod30 = require("zod");
|
|
3655
|
+
var editPurchaseOkResponse = import_zod30.z.lazy(() => {
|
|
3656
|
+
return import_zod30.z.object({
|
|
3657
|
+
purchaseId: import_zod30.z.string(),
|
|
3658
|
+
newStartDate: import_zod30.z.string().nullable(),
|
|
3659
|
+
newEndDate: import_zod30.z.string().nullable(),
|
|
3660
|
+
newStartTime: import_zod30.z.number().optional().nullable(),
|
|
3661
|
+
newEndTime: import_zod30.z.number().optional().nullable()
|
|
3562
3662
|
});
|
|
3563
3663
|
});
|
|
3564
|
-
var editPurchaseOkResponseResponse =
|
|
3565
|
-
return
|
|
3566
|
-
purchaseId:
|
|
3567
|
-
newStartDate:
|
|
3568
|
-
newEndDate:
|
|
3569
|
-
newStartTime:
|
|
3570
|
-
newEndTime:
|
|
3664
|
+
var editPurchaseOkResponseResponse = import_zod30.z.lazy(() => {
|
|
3665
|
+
return import_zod30.z.object({
|
|
3666
|
+
purchaseId: import_zod30.z.string(),
|
|
3667
|
+
newStartDate: import_zod30.z.string().nullable(),
|
|
3668
|
+
newEndDate: import_zod30.z.string().nullable(),
|
|
3669
|
+
newStartTime: import_zod30.z.number().optional().nullable(),
|
|
3670
|
+
newEndTime: import_zod30.z.number().optional().nullable()
|
|
3571
3671
|
}).transform((data) => ({
|
|
3572
3672
|
purchaseId: data["purchaseId"],
|
|
3573
3673
|
newStartDate: data["newStartDate"],
|
|
@@ -3576,13 +3676,13 @@ var editPurchaseOkResponseResponse = import_zod31.z.lazy(() => {
|
|
|
3576
3676
|
newEndTime: data["newEndTime"]
|
|
3577
3677
|
}));
|
|
3578
3678
|
});
|
|
3579
|
-
var editPurchaseOkResponseRequest =
|
|
3580
|
-
return
|
|
3581
|
-
purchaseId:
|
|
3582
|
-
newStartDate:
|
|
3583
|
-
newEndDate:
|
|
3584
|
-
newStartTime:
|
|
3585
|
-
newEndTime:
|
|
3679
|
+
var editPurchaseOkResponseRequest = import_zod30.z.lazy(() => {
|
|
3680
|
+
return import_zod30.z.object({
|
|
3681
|
+
purchaseId: import_zod30.z.string(),
|
|
3682
|
+
newStartDate: import_zod30.z.string().nullable(),
|
|
3683
|
+
newEndDate: import_zod30.z.string().nullable(),
|
|
3684
|
+
newStartTime: import_zod30.z.number().optional().nullable(),
|
|
3685
|
+
newEndTime: import_zod30.z.number().optional().nullable()
|
|
3586
3686
|
}).transform((data) => ({
|
|
3587
3687
|
purchaseId: data["purchaseId"],
|
|
3588
3688
|
newStartDate: data["newStartDate"],
|
|
@@ -3593,30 +3693,30 @@ var editPurchaseOkResponseRequest = import_zod31.z.lazy(() => {
|
|
|
3593
3693
|
});
|
|
3594
3694
|
|
|
3595
3695
|
// src/services/purchases/models/get-purchase-consumption-ok-response.ts
|
|
3596
|
-
var
|
|
3597
|
-
var getPurchaseConsumptionOkResponse =
|
|
3598
|
-
return
|
|
3599
|
-
dataUsageRemainingInBytes:
|
|
3600
|
-
dataUsageRemainingInGb:
|
|
3601
|
-
status:
|
|
3696
|
+
var import_zod31 = require("zod");
|
|
3697
|
+
var getPurchaseConsumptionOkResponse = import_zod31.z.lazy(() => {
|
|
3698
|
+
return import_zod31.z.object({
|
|
3699
|
+
dataUsageRemainingInBytes: import_zod31.z.number(),
|
|
3700
|
+
dataUsageRemainingInGb: import_zod31.z.number(),
|
|
3701
|
+
status: import_zod31.z.string()
|
|
3602
3702
|
});
|
|
3603
3703
|
});
|
|
3604
|
-
var getPurchaseConsumptionOkResponseResponse =
|
|
3605
|
-
return
|
|
3606
|
-
dataUsageRemainingInBytes:
|
|
3607
|
-
dataUsageRemainingInGB:
|
|
3608
|
-
status:
|
|
3704
|
+
var getPurchaseConsumptionOkResponseResponse = import_zod31.z.lazy(() => {
|
|
3705
|
+
return import_zod31.z.object({
|
|
3706
|
+
dataUsageRemainingInBytes: import_zod31.z.number(),
|
|
3707
|
+
dataUsageRemainingInGB: import_zod31.z.number(),
|
|
3708
|
+
status: import_zod31.z.string()
|
|
3609
3709
|
}).transform((data) => ({
|
|
3610
3710
|
dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
|
|
3611
3711
|
dataUsageRemainingInGb: data["dataUsageRemainingInGB"],
|
|
3612
3712
|
status: data["status"]
|
|
3613
3713
|
}));
|
|
3614
3714
|
});
|
|
3615
|
-
var getPurchaseConsumptionOkResponseRequest =
|
|
3616
|
-
return
|
|
3617
|
-
dataUsageRemainingInBytes:
|
|
3618
|
-
dataUsageRemainingInGb:
|
|
3619
|
-
status:
|
|
3715
|
+
var getPurchaseConsumptionOkResponseRequest = import_zod31.z.lazy(() => {
|
|
3716
|
+
return import_zod31.z.object({
|
|
3717
|
+
dataUsageRemainingInBytes: import_zod31.z.number(),
|
|
3718
|
+
dataUsageRemainingInGb: import_zod31.z.number(),
|
|
3719
|
+
status: import_zod31.z.string()
|
|
3620
3720
|
}).transform((data) => ({
|
|
3621
3721
|
dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
|
|
3622
3722
|
dataUsageRemainingInGB: data["dataUsageRemainingInGb"],
|
|
@@ -3682,23 +3782,40 @@ var PurchasesService = class extends BaseService {
|
|
|
3682
3782
|
}
|
|
3683
3783
|
/**
|
|
3684
3784
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
|
3785
|
+
* @param {string} [params.idempotencyKey] - Optional. A unique value (for example a UUID) that makes this request safe to retry. If a request with the same `Idempotency-Key` and the same body succeeds, repeating it returns the original response instead of performing the action again, and the response includes the header `Idempotent-Replayed: true`. Keys are scoped to your credentials and remembered for 3 days. Only successful (2xx) responses are remembered, so a request that failed can be retried with the same key. Reusing a key with a different request returns `422`; sending it while the original request is still being processed returns `409`. If the idempotency store is temporarily unavailable, the request is not processed and returns `503`; retry it. Must be 1 to 255 printable ASCII characters, without spaces.
|
|
3685
3786
|
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
3686
3787
|
* @returns {Promise<HttpResponse<CreatePurchaseV2OkResponse[]>>} - Successful Response
|
|
3687
3788
|
*/
|
|
3688
|
-
async createPurchaseV2(body, requestConfig) {
|
|
3789
|
+
async createPurchaseV2(body, params, requestConfig) {
|
|
3689
3790
|
const resolvedConfig = this.getResolvedConfig(this.createPurchaseV2Config, requestConfig);
|
|
3791
|
+
import_zod32.z.object({ idempotencyKey: import_zod32.z.string().optional() }).parse(params != null ? params : {});
|
|
3690
3792
|
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases/v2").setRequestSchema(createPurchaseV2RequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
3691
|
-
schema:
|
|
3793
|
+
schema: import_zod32.z.array(createPurchaseV2OkResponseResponse),
|
|
3692
3794
|
contentType: "json" /* Json */,
|
|
3693
3795
|
status: 200
|
|
3694
3796
|
}).addError({
|
|
3695
|
-
error:
|
|
3797
|
+
error: ErrorResponse,
|
|
3696
3798
|
contentType: "json" /* Json */,
|
|
3697
3799
|
status: 400
|
|
3698
3800
|
}).addError({
|
|
3699
|
-
error:
|
|
3801
|
+
error: ErrorResponse,
|
|
3700
3802
|
contentType: "json" /* Json */,
|
|
3701
3803
|
status: 401
|
|
3804
|
+
}).addError({
|
|
3805
|
+
error: ErrorResponse,
|
|
3806
|
+
contentType: "json" /* Json */,
|
|
3807
|
+
status: 409
|
|
3808
|
+
}).addError({
|
|
3809
|
+
error: ErrorResponse,
|
|
3810
|
+
contentType: "json" /* Json */,
|
|
3811
|
+
status: 422
|
|
3812
|
+
}).addError({
|
|
3813
|
+
error: ErrorResponse,
|
|
3814
|
+
contentType: "json" /* Json */,
|
|
3815
|
+
status: 503
|
|
3816
|
+
}).addHeaderParam({
|
|
3817
|
+
key: "Idempotency-Key",
|
|
3818
|
+
value: params == null ? void 0 : params.idempotencyKey
|
|
3702
3819
|
}).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
|
3703
3820
|
return this.client.callDirect(request);
|
|
3704
3821
|
}
|
|
@@ -3719,30 +3836,42 @@ var PurchasesService = class extends BaseService {
|
|
|
3719
3836
|
*/
|
|
3720
3837
|
async listPurchases(params, requestConfig) {
|
|
3721
3838
|
const resolvedConfig = this.getResolvedConfig(this.listPurchasesConfig, requestConfig);
|
|
3722
|
-
|
|
3723
|
-
purchaseId:
|
|
3724
|
-
iccid:
|
|
3725
|
-
afterDate:
|
|
3726
|
-
beforeDate:
|
|
3727
|
-
email:
|
|
3728
|
-
referenceId:
|
|
3729
|
-
afterCursor:
|
|
3730
|
-
limit:
|
|
3731
|
-
after:
|
|
3732
|
-
before:
|
|
3839
|
+
import_zod32.z.object({
|
|
3840
|
+
purchaseId: import_zod32.z.string().optional(),
|
|
3841
|
+
iccid: import_zod32.z.string().optional(),
|
|
3842
|
+
afterDate: import_zod32.z.string().optional(),
|
|
3843
|
+
beforeDate: import_zod32.z.string().optional(),
|
|
3844
|
+
email: import_zod32.z.string().optional(),
|
|
3845
|
+
referenceId: import_zod32.z.string().optional(),
|
|
3846
|
+
afterCursor: import_zod32.z.string().optional(),
|
|
3847
|
+
limit: import_zod32.z.number().optional(),
|
|
3848
|
+
after: import_zod32.z.number().optional(),
|
|
3849
|
+
before: import_zod32.z.number().optional()
|
|
3733
3850
|
}).parse(params != null ? params : {});
|
|
3734
|
-
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases").setRequestSchema(
|
|
3851
|
+
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases").setRequestSchema(import_zod32.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
3735
3852
|
schema: listPurchasesOkResponseResponse,
|
|
3736
3853
|
contentType: "json" /* Json */,
|
|
3737
3854
|
status: 200
|
|
3738
3855
|
}).addError({
|
|
3739
|
-
error:
|
|
3856
|
+
error: ErrorResponse,
|
|
3740
3857
|
contentType: "json" /* Json */,
|
|
3741
3858
|
status: 400
|
|
3742
3859
|
}).addError({
|
|
3743
|
-
error:
|
|
3860
|
+
error: ErrorResponse,
|
|
3744
3861
|
contentType: "json" /* Json */,
|
|
3745
3862
|
status: 401
|
|
3863
|
+
}).addError({
|
|
3864
|
+
error: ErrorResponse,
|
|
3865
|
+
contentType: "json" /* Json */,
|
|
3866
|
+
status: 409
|
|
3867
|
+
}).addError({
|
|
3868
|
+
error: ErrorResponse,
|
|
3869
|
+
contentType: "json" /* Json */,
|
|
3870
|
+
status: 422
|
|
3871
|
+
}).addError({
|
|
3872
|
+
error: ErrorResponse,
|
|
3873
|
+
contentType: "json" /* Json */,
|
|
3874
|
+
status: 503
|
|
3746
3875
|
}).addQueryParam({
|
|
3747
3876
|
key: "purchaseId",
|
|
3748
3877
|
value: params == null ? void 0 : params.purchaseId
|
|
@@ -3778,45 +3907,79 @@ var PurchasesService = class extends BaseService {
|
|
|
3778
3907
|
}
|
|
3779
3908
|
/**
|
|
3780
3909
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
|
3910
|
+
* @param {string} [params.idempotencyKey] - Optional. A unique value (for example a UUID) that makes this request safe to retry. If a request with the same `Idempotency-Key` and the same body succeeds, repeating it returns the original response instead of performing the action again, and the response includes the header `Idempotent-Replayed: true`. Keys are scoped to your credentials and remembered for 3 days. Only successful (2xx) responses are remembered, so a request that failed can be retried with the same key. Reusing a key with a different request returns `422`; sending it while the original request is still being processed returns `409`. If the idempotency store is temporarily unavailable, the request is not processed and returns `503`; retry it. Must be 1 to 255 printable ASCII characters, without spaces.
|
|
3781
3911
|
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
3782
3912
|
* @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} - Successful Response
|
|
3783
3913
|
*/
|
|
3784
|
-
async createPurchase(body, requestConfig) {
|
|
3914
|
+
async createPurchase(body, params, requestConfig) {
|
|
3785
3915
|
const resolvedConfig = this.getResolvedConfig(this.createPurchaseConfig, requestConfig);
|
|
3916
|
+
import_zod32.z.object({ idempotencyKey: import_zod32.z.string().optional() }).parse(params != null ? params : {});
|
|
3786
3917
|
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
3787
3918
|
schema: createPurchaseOkResponseResponse,
|
|
3788
3919
|
contentType: "json" /* Json */,
|
|
3789
3920
|
status: 200
|
|
3790
3921
|
}).addError({
|
|
3791
|
-
error:
|
|
3922
|
+
error: ErrorResponse,
|
|
3792
3923
|
contentType: "json" /* Json */,
|
|
3793
3924
|
status: 400
|
|
3794
3925
|
}).addError({
|
|
3795
|
-
error:
|
|
3926
|
+
error: ErrorResponse,
|
|
3796
3927
|
contentType: "json" /* Json */,
|
|
3797
3928
|
status: 401
|
|
3929
|
+
}).addError({
|
|
3930
|
+
error: ErrorResponse,
|
|
3931
|
+
contentType: "json" /* Json */,
|
|
3932
|
+
status: 409
|
|
3933
|
+
}).addError({
|
|
3934
|
+
error: ErrorResponse,
|
|
3935
|
+
contentType: "json" /* Json */,
|
|
3936
|
+
status: 422
|
|
3937
|
+
}).addError({
|
|
3938
|
+
error: ErrorResponse,
|
|
3939
|
+
contentType: "json" /* Json */,
|
|
3940
|
+
status: 503
|
|
3941
|
+
}).addHeaderParam({
|
|
3942
|
+
key: "Idempotency-Key",
|
|
3943
|
+
value: params == null ? void 0 : params.idempotencyKey
|
|
3798
3944
|
}).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
|
3799
3945
|
return this.client.callDirect(request);
|
|
3800
3946
|
}
|
|
3801
3947
|
/**
|
|
3802
3948
|
* This endpoint is used to top-up an existing eSIM with the previously associated destination by providing its ICCID and package details. To determine if an eSIM can be topped up, use the Get eSIM endpoint, which returns the `isTopUpAllowed` flag.
|
|
3949
|
+
* @param {string} [params.idempotencyKey] - Optional. A unique value (for example a UUID) that makes this request safe to retry. If a request with the same `Idempotency-Key` and the same body succeeds, repeating it returns the original response instead of performing the action again, and the response includes the header `Idempotent-Replayed: true`. Keys are scoped to your credentials and remembered for 3 days. Only successful (2xx) responses are remembered, so a request that failed can be retried with the same key. Reusing a key with a different request returns `422`; sending it while the original request is still being processed returns `409`. If the idempotency store is temporarily unavailable, the request is not processed and returns `503`; retry it. Must be 1 to 255 printable ASCII characters, without spaces.
|
|
3803
3950
|
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
3804
3951
|
* @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} - Successful Response
|
|
3805
3952
|
*/
|
|
3806
|
-
async topUpEsim(body, requestConfig) {
|
|
3953
|
+
async topUpEsim(body, params, requestConfig) {
|
|
3807
3954
|
const resolvedConfig = this.getResolvedConfig(this.topUpEsimConfig, requestConfig);
|
|
3955
|
+
import_zod32.z.object({ idempotencyKey: import_zod32.z.string().optional() }).parse(params != null ? params : {});
|
|
3808
3956
|
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
3809
3957
|
schema: topUpEsimOkResponseResponse,
|
|
3810
3958
|
contentType: "json" /* Json */,
|
|
3811
3959
|
status: 200
|
|
3812
3960
|
}).addError({
|
|
3813
|
-
error:
|
|
3961
|
+
error: ErrorResponse,
|
|
3814
3962
|
contentType: "json" /* Json */,
|
|
3815
3963
|
status: 400
|
|
3816
3964
|
}).addError({
|
|
3817
|
-
error:
|
|
3965
|
+
error: ErrorResponse,
|
|
3818
3966
|
contentType: "json" /* Json */,
|
|
3819
3967
|
status: 401
|
|
3968
|
+
}).addError({
|
|
3969
|
+
error: ErrorResponse,
|
|
3970
|
+
contentType: "json" /* Json */,
|
|
3971
|
+
status: 409
|
|
3972
|
+
}).addError({
|
|
3973
|
+
error: ErrorResponse,
|
|
3974
|
+
contentType: "json" /* Json */,
|
|
3975
|
+
status: 422
|
|
3976
|
+
}).addError({
|
|
3977
|
+
error: ErrorResponse,
|
|
3978
|
+
contentType: "json" /* Json */,
|
|
3979
|
+
status: 503
|
|
3980
|
+
}).addHeaderParam({
|
|
3981
|
+
key: "Idempotency-Key",
|
|
3982
|
+
value: params == null ? void 0 : params.idempotencyKey
|
|
3820
3983
|
}).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
|
3821
3984
|
return this.client.callDirect(request);
|
|
3822
3985
|
}
|
|
@@ -3829,23 +3992,40 @@ var PurchasesService = class extends BaseService {
|
|
|
3829
3992
|
|
|
3830
3993
|
The end date can be extended or shortened as long as it adheres to the same pricing category and does not exceed the allowed duration limits.
|
|
3831
3994
|
|
|
3995
|
+
* @param {string} [params.idempotencyKey] - Optional. A unique value (for example a UUID) that makes this request safe to retry. If a request with the same `Idempotency-Key` and the same body succeeds, repeating it returns the original response instead of performing the action again, and the response includes the header `Idempotent-Replayed: true`. Keys are scoped to your credentials and remembered for 3 days. Only successful (2xx) responses are remembered, so a request that failed can be retried with the same key. Reusing a key with a different request returns `422`; sending it while the original request is still being processed returns `409`. If the idempotency store is temporarily unavailable, the request is not processed and returns `503`; retry it. Must be 1 to 255 printable ASCII characters, without spaces.
|
|
3832
3996
|
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
3833
3997
|
* @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} - Successful Response
|
|
3834
3998
|
*/
|
|
3835
|
-
async editPurchase(body, requestConfig) {
|
|
3999
|
+
async editPurchase(body, params, requestConfig) {
|
|
3836
4000
|
const resolvedConfig = this.getResolvedConfig(this.editPurchaseConfig, requestConfig);
|
|
4001
|
+
import_zod32.z.object({ idempotencyKey: import_zod32.z.string().optional() }).parse(params != null ? params : {});
|
|
3837
4002
|
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
3838
4003
|
schema: editPurchaseOkResponseResponse,
|
|
3839
4004
|
contentType: "json" /* Json */,
|
|
3840
4005
|
status: 200
|
|
3841
4006
|
}).addError({
|
|
3842
|
-
error:
|
|
4007
|
+
error: ErrorResponse,
|
|
3843
4008
|
contentType: "json" /* Json */,
|
|
3844
4009
|
status: 400
|
|
3845
4010
|
}).addError({
|
|
3846
|
-
error:
|
|
4011
|
+
error: ErrorResponse,
|
|
3847
4012
|
contentType: "json" /* Json */,
|
|
3848
4013
|
status: 401
|
|
4014
|
+
}).addError({
|
|
4015
|
+
error: ErrorResponse,
|
|
4016
|
+
contentType: "json" /* Json */,
|
|
4017
|
+
status: 409
|
|
4018
|
+
}).addError({
|
|
4019
|
+
error: ErrorResponse,
|
|
4020
|
+
contentType: "json" /* Json */,
|
|
4021
|
+
status: 422
|
|
4022
|
+
}).addError({
|
|
4023
|
+
error: ErrorResponse,
|
|
4024
|
+
contentType: "json" /* Json */,
|
|
4025
|
+
status: 503
|
|
4026
|
+
}).addHeaderParam({
|
|
4027
|
+
key: "Idempotency-Key",
|
|
4028
|
+
value: params == null ? void 0 : params.idempotencyKey
|
|
3849
4029
|
}).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
|
3850
4030
|
return this.client.callDirect(request);
|
|
3851
4031
|
}
|
|
@@ -3857,18 +4037,30 @@ var PurchasesService = class extends BaseService {
|
|
|
3857
4037
|
*/
|
|
3858
4038
|
async getPurchaseConsumption(purchaseId, requestConfig) {
|
|
3859
4039
|
const resolvedConfig = this.getResolvedConfig(this.getPurchaseConsumptionConfig, requestConfig);
|
|
3860
|
-
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(
|
|
4040
|
+
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(import_zod32.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
3861
4041
|
schema: getPurchaseConsumptionOkResponseResponse,
|
|
3862
4042
|
contentType: "json" /* Json */,
|
|
3863
4043
|
status: 200
|
|
3864
4044
|
}).addError({
|
|
3865
|
-
error:
|
|
4045
|
+
error: ErrorResponse,
|
|
3866
4046
|
contentType: "json" /* Json */,
|
|
3867
4047
|
status: 400
|
|
3868
4048
|
}).addError({
|
|
3869
|
-
error:
|
|
4049
|
+
error: ErrorResponse,
|
|
3870
4050
|
contentType: "json" /* Json */,
|
|
3871
4051
|
status: 401
|
|
4052
|
+
}).addError({
|
|
4053
|
+
error: ErrorResponse,
|
|
4054
|
+
contentType: "json" /* Json */,
|
|
4055
|
+
status: 409
|
|
4056
|
+
}).addError({
|
|
4057
|
+
error: ErrorResponse,
|
|
4058
|
+
contentType: "json" /* Json */,
|
|
4059
|
+
status: 422
|
|
4060
|
+
}).addError({
|
|
4061
|
+
error: ErrorResponse,
|
|
4062
|
+
contentType: "json" /* Json */,
|
|
4063
|
+
status: 503
|
|
3872
4064
|
}).addPathParam({
|
|
3873
4065
|
key: "purchaseId",
|
|
3874
4066
|
value: purchaseId
|
|
@@ -3901,30 +4093,30 @@ var CreatePurchaseRequestLanguage = /* @__PURE__ */ ((CreatePurchaseRequestLangu
|
|
|
3901
4093
|
var import_zod41 = require("zod");
|
|
3902
4094
|
|
|
3903
4095
|
// src/services/e-sim/models/get-esim-ok-response.ts
|
|
3904
|
-
var
|
|
4096
|
+
var import_zod34 = require("zod");
|
|
3905
4097
|
|
|
3906
4098
|
// src/services/e-sim/models/get-esim-ok-response-esim.ts
|
|
3907
|
-
var
|
|
3908
|
-
var getEsimOkResponseEsim =
|
|
3909
|
-
return
|
|
3910
|
-
iccid:
|
|
3911
|
-
smdpAddress:
|
|
3912
|
-
activationCode:
|
|
3913
|
-
manualActivationCode:
|
|
3914
|
-
status:
|
|
3915
|
-
connectivityStatus:
|
|
3916
|
-
isTopUpAllowed:
|
|
4099
|
+
var import_zod33 = require("zod");
|
|
4100
|
+
var getEsimOkResponseEsim = import_zod33.z.lazy(() => {
|
|
4101
|
+
return import_zod33.z.object({
|
|
4102
|
+
iccid: import_zod33.z.string().min(18).max(22),
|
|
4103
|
+
smdpAddress: import_zod33.z.string(),
|
|
4104
|
+
activationCode: import_zod33.z.string().min(1e3).max(8e3),
|
|
4105
|
+
manualActivationCode: import_zod33.z.string(),
|
|
4106
|
+
status: import_zod33.z.string(),
|
|
4107
|
+
connectivityStatus: import_zod33.z.string(),
|
|
4108
|
+
isTopUpAllowed: import_zod33.z.boolean()
|
|
3917
4109
|
});
|
|
3918
4110
|
});
|
|
3919
|
-
var getEsimOkResponseEsimResponse =
|
|
3920
|
-
return
|
|
3921
|
-
iccid:
|
|
3922
|
-
smdpAddress:
|
|
3923
|
-
activationCode:
|
|
3924
|
-
manualActivationCode:
|
|
3925
|
-
status:
|
|
3926
|
-
connectivityStatus:
|
|
3927
|
-
isTopUpAllowed:
|
|
4111
|
+
var getEsimOkResponseEsimResponse = import_zod33.z.lazy(() => {
|
|
4112
|
+
return import_zod33.z.object({
|
|
4113
|
+
iccid: import_zod33.z.string().min(18).max(22),
|
|
4114
|
+
smdpAddress: import_zod33.z.string(),
|
|
4115
|
+
activationCode: import_zod33.z.string().min(1e3).max(8e3),
|
|
4116
|
+
manualActivationCode: import_zod33.z.string(),
|
|
4117
|
+
status: import_zod33.z.string(),
|
|
4118
|
+
connectivityStatus: import_zod33.z.string(),
|
|
4119
|
+
isTopUpAllowed: import_zod33.z.boolean()
|
|
3928
4120
|
}).transform((data) => ({
|
|
3929
4121
|
iccid: data["iccid"],
|
|
3930
4122
|
smdpAddress: data["smdpAddress"],
|
|
@@ -3935,15 +4127,15 @@ var getEsimOkResponseEsimResponse = import_zod34.z.lazy(() => {
|
|
|
3935
4127
|
isTopUpAllowed: data["isTopUpAllowed"]
|
|
3936
4128
|
}));
|
|
3937
4129
|
});
|
|
3938
|
-
var getEsimOkResponseEsimRequest =
|
|
3939
|
-
return
|
|
3940
|
-
iccid:
|
|
3941
|
-
smdpAddress:
|
|
3942
|
-
activationCode:
|
|
3943
|
-
manualActivationCode:
|
|
3944
|
-
status:
|
|
3945
|
-
connectivityStatus:
|
|
3946
|
-
isTopUpAllowed:
|
|
4130
|
+
var getEsimOkResponseEsimRequest = import_zod33.z.lazy(() => {
|
|
4131
|
+
return import_zod33.z.object({
|
|
4132
|
+
iccid: import_zod33.z.string().min(18).max(22),
|
|
4133
|
+
smdpAddress: import_zod33.z.string(),
|
|
4134
|
+
activationCode: import_zod33.z.string().min(1e3).max(8e3),
|
|
4135
|
+
manualActivationCode: import_zod33.z.string(),
|
|
4136
|
+
status: import_zod33.z.string(),
|
|
4137
|
+
connectivityStatus: import_zod33.z.string(),
|
|
4138
|
+
isTopUpAllowed: import_zod33.z.boolean()
|
|
3947
4139
|
}).transform((data) => ({
|
|
3948
4140
|
iccid: data["iccid"],
|
|
3949
4141
|
smdpAddress: data["smdpAddress"],
|
|
@@ -3956,20 +4148,20 @@ var getEsimOkResponseEsimRequest = import_zod34.z.lazy(() => {
|
|
|
3956
4148
|
});
|
|
3957
4149
|
|
|
3958
4150
|
// src/services/e-sim/models/get-esim-ok-response.ts
|
|
3959
|
-
var getEsimOkResponse =
|
|
3960
|
-
return
|
|
4151
|
+
var getEsimOkResponse = import_zod34.z.lazy(() => {
|
|
4152
|
+
return import_zod34.z.object({
|
|
3961
4153
|
esim: getEsimOkResponseEsim
|
|
3962
4154
|
});
|
|
3963
4155
|
});
|
|
3964
|
-
var getEsimOkResponseResponse =
|
|
3965
|
-
return
|
|
4156
|
+
var getEsimOkResponseResponse = import_zod34.z.lazy(() => {
|
|
4157
|
+
return import_zod34.z.object({
|
|
3966
4158
|
esim: getEsimOkResponseEsimResponse
|
|
3967
4159
|
}).transform((data) => ({
|
|
3968
4160
|
esim: data["esim"]
|
|
3969
4161
|
}));
|
|
3970
4162
|
});
|
|
3971
|
-
var getEsimOkResponseRequest =
|
|
3972
|
-
return
|
|
4163
|
+
var getEsimOkResponseRequest = import_zod34.z.lazy(() => {
|
|
4164
|
+
return import_zod34.z.object({
|
|
3973
4165
|
esim: getEsimOkResponseEsimRequest
|
|
3974
4166
|
}).transform((data) => ({
|
|
3975
4167
|
esim: data["esim"]
|
|
@@ -3977,24 +4169,24 @@ var getEsimOkResponseRequest = import_zod35.z.lazy(() => {
|
|
|
3977
4169
|
});
|
|
3978
4170
|
|
|
3979
4171
|
// src/services/e-sim/models/get-esim-device-ok-response.ts
|
|
3980
|
-
var
|
|
4172
|
+
var import_zod36 = require("zod");
|
|
3981
4173
|
|
|
3982
4174
|
// src/services/e-sim/models/device.ts
|
|
3983
|
-
var
|
|
3984
|
-
var device =
|
|
3985
|
-
return
|
|
3986
|
-
oem:
|
|
3987
|
-
hardwareName:
|
|
3988
|
-
hardwareModel:
|
|
3989
|
-
eid:
|
|
4175
|
+
var import_zod35 = require("zod");
|
|
4176
|
+
var device = import_zod35.z.lazy(() => {
|
|
4177
|
+
return import_zod35.z.object({
|
|
4178
|
+
oem: import_zod35.z.string(),
|
|
4179
|
+
hardwareName: import_zod35.z.string(),
|
|
4180
|
+
hardwareModel: import_zod35.z.string(),
|
|
4181
|
+
eid: import_zod35.z.string()
|
|
3990
4182
|
});
|
|
3991
4183
|
});
|
|
3992
|
-
var deviceResponse =
|
|
3993
|
-
return
|
|
3994
|
-
oem:
|
|
3995
|
-
hardwareName:
|
|
3996
|
-
hardwareModel:
|
|
3997
|
-
eid:
|
|
4184
|
+
var deviceResponse = import_zod35.z.lazy(() => {
|
|
4185
|
+
return import_zod35.z.object({
|
|
4186
|
+
oem: import_zod35.z.string(),
|
|
4187
|
+
hardwareName: import_zod35.z.string(),
|
|
4188
|
+
hardwareModel: import_zod35.z.string(),
|
|
4189
|
+
eid: import_zod35.z.string()
|
|
3998
4190
|
}).transform((data) => ({
|
|
3999
4191
|
oem: data["oem"],
|
|
4000
4192
|
hardwareName: data["hardwareName"],
|
|
@@ -4002,12 +4194,12 @@ var deviceResponse = import_zod36.z.lazy(() => {
|
|
|
4002
4194
|
eid: data["eid"]
|
|
4003
4195
|
}));
|
|
4004
4196
|
});
|
|
4005
|
-
var deviceRequest =
|
|
4006
|
-
return
|
|
4007
|
-
oem:
|
|
4008
|
-
hardwareName:
|
|
4009
|
-
hardwareModel:
|
|
4010
|
-
eid:
|
|
4197
|
+
var deviceRequest = import_zod35.z.lazy(() => {
|
|
4198
|
+
return import_zod35.z.object({
|
|
4199
|
+
oem: import_zod35.z.string(),
|
|
4200
|
+
hardwareName: import_zod35.z.string(),
|
|
4201
|
+
hardwareModel: import_zod35.z.string(),
|
|
4202
|
+
eid: import_zod35.z.string()
|
|
4011
4203
|
}).transform((data) => ({
|
|
4012
4204
|
oem: data["oem"],
|
|
4013
4205
|
hardwareName: data["hardwareName"],
|
|
@@ -4017,20 +4209,20 @@ var deviceRequest = import_zod36.z.lazy(() => {
|
|
|
4017
4209
|
});
|
|
4018
4210
|
|
|
4019
4211
|
// src/services/e-sim/models/get-esim-device-ok-response.ts
|
|
4020
|
-
var getEsimDeviceOkResponse =
|
|
4021
|
-
return
|
|
4212
|
+
var getEsimDeviceOkResponse = import_zod36.z.lazy(() => {
|
|
4213
|
+
return import_zod36.z.object({
|
|
4022
4214
|
device
|
|
4023
4215
|
});
|
|
4024
4216
|
});
|
|
4025
|
-
var getEsimDeviceOkResponseResponse =
|
|
4026
|
-
return
|
|
4217
|
+
var getEsimDeviceOkResponseResponse = import_zod36.z.lazy(() => {
|
|
4218
|
+
return import_zod36.z.object({
|
|
4027
4219
|
device: deviceResponse
|
|
4028
4220
|
}).transform((data) => ({
|
|
4029
4221
|
device: data["device"]
|
|
4030
4222
|
}));
|
|
4031
4223
|
});
|
|
4032
|
-
var getEsimDeviceOkResponseRequest =
|
|
4033
|
-
return
|
|
4224
|
+
var getEsimDeviceOkResponseRequest = import_zod36.z.lazy(() => {
|
|
4225
|
+
return import_zod36.z.object({
|
|
4034
4226
|
device: deviceRequest
|
|
4035
4227
|
}).transform((data) => ({
|
|
4036
4228
|
device: data["device"]
|
|
@@ -4038,36 +4230,36 @@ var getEsimDeviceOkResponseRequest = import_zod37.z.lazy(() => {
|
|
|
4038
4230
|
});
|
|
4039
4231
|
|
|
4040
4232
|
// src/services/e-sim/models/get-esim-history-ok-response.ts
|
|
4041
|
-
var
|
|
4233
|
+
var import_zod39 = require("zod");
|
|
4042
4234
|
|
|
4043
4235
|
// src/services/e-sim/models/get-esim-history-ok-response-esim.ts
|
|
4044
|
-
var
|
|
4236
|
+
var import_zod38 = require("zod");
|
|
4045
4237
|
|
|
4046
4238
|
// src/services/e-sim/models/history.ts
|
|
4047
|
-
var
|
|
4048
|
-
var history =
|
|
4049
|
-
return
|
|
4050
|
-
status:
|
|
4051
|
-
statusDate:
|
|
4052
|
-
date:
|
|
4239
|
+
var import_zod37 = require("zod");
|
|
4240
|
+
var history = import_zod37.z.lazy(() => {
|
|
4241
|
+
return import_zod37.z.object({
|
|
4242
|
+
status: import_zod37.z.string(),
|
|
4243
|
+
statusDate: import_zod37.z.string(),
|
|
4244
|
+
date: import_zod37.z.number().optional()
|
|
4053
4245
|
});
|
|
4054
4246
|
});
|
|
4055
|
-
var historyResponse =
|
|
4056
|
-
return
|
|
4057
|
-
status:
|
|
4058
|
-
statusDate:
|
|
4059
|
-
date:
|
|
4247
|
+
var historyResponse = import_zod37.z.lazy(() => {
|
|
4248
|
+
return import_zod37.z.object({
|
|
4249
|
+
status: import_zod37.z.string(),
|
|
4250
|
+
statusDate: import_zod37.z.string(),
|
|
4251
|
+
date: import_zod37.z.number().optional()
|
|
4060
4252
|
}).transform((data) => ({
|
|
4061
4253
|
status: data["status"],
|
|
4062
4254
|
statusDate: data["statusDate"],
|
|
4063
4255
|
date: data["date"]
|
|
4064
4256
|
}));
|
|
4065
4257
|
});
|
|
4066
|
-
var historyRequest =
|
|
4067
|
-
return
|
|
4068
|
-
status:
|
|
4069
|
-
statusDate:
|
|
4070
|
-
date:
|
|
4258
|
+
var historyRequest = import_zod37.z.lazy(() => {
|
|
4259
|
+
return import_zod37.z.object({
|
|
4260
|
+
status: import_zod37.z.string(),
|
|
4261
|
+
statusDate: import_zod37.z.string(),
|
|
4262
|
+
date: import_zod37.z.number().optional()
|
|
4071
4263
|
}).transform((data) => ({
|
|
4072
4264
|
status: data["status"],
|
|
4073
4265
|
statusDate: data["statusDate"],
|
|
@@ -4076,25 +4268,25 @@ var historyRequest = import_zod38.z.lazy(() => {
|
|
|
4076
4268
|
});
|
|
4077
4269
|
|
|
4078
4270
|
// src/services/e-sim/models/get-esim-history-ok-response-esim.ts
|
|
4079
|
-
var getEsimHistoryOkResponseEsim =
|
|
4080
|
-
return
|
|
4081
|
-
iccid:
|
|
4082
|
-
history:
|
|
4271
|
+
var getEsimHistoryOkResponseEsim = import_zod38.z.lazy(() => {
|
|
4272
|
+
return import_zod38.z.object({
|
|
4273
|
+
iccid: import_zod38.z.string().min(18).max(22),
|
|
4274
|
+
history: import_zod38.z.array(history)
|
|
4083
4275
|
});
|
|
4084
4276
|
});
|
|
4085
|
-
var getEsimHistoryOkResponseEsimResponse =
|
|
4086
|
-
return
|
|
4087
|
-
iccid:
|
|
4088
|
-
history:
|
|
4277
|
+
var getEsimHistoryOkResponseEsimResponse = import_zod38.z.lazy(() => {
|
|
4278
|
+
return import_zod38.z.object({
|
|
4279
|
+
iccid: import_zod38.z.string().min(18).max(22),
|
|
4280
|
+
history: import_zod38.z.array(historyResponse)
|
|
4089
4281
|
}).transform((data) => ({
|
|
4090
4282
|
iccid: data["iccid"],
|
|
4091
4283
|
history: data["history"]
|
|
4092
4284
|
}));
|
|
4093
4285
|
});
|
|
4094
|
-
var getEsimHistoryOkResponseEsimRequest =
|
|
4095
|
-
return
|
|
4096
|
-
iccid:
|
|
4097
|
-
history:
|
|
4286
|
+
var getEsimHistoryOkResponseEsimRequest = import_zod38.z.lazy(() => {
|
|
4287
|
+
return import_zod38.z.object({
|
|
4288
|
+
iccid: import_zod38.z.string().min(18).max(22),
|
|
4289
|
+
history: import_zod38.z.array(historyRequest)
|
|
4098
4290
|
}).transform((data) => ({
|
|
4099
4291
|
iccid: data["iccid"],
|
|
4100
4292
|
history: data["history"]
|
|
@@ -4102,26 +4294,48 @@ var getEsimHistoryOkResponseEsimRequest = import_zod39.z.lazy(() => {
|
|
|
4102
4294
|
});
|
|
4103
4295
|
|
|
4104
4296
|
// src/services/e-sim/models/get-esim-history-ok-response.ts
|
|
4105
|
-
var getEsimHistoryOkResponse =
|
|
4106
|
-
return
|
|
4297
|
+
var getEsimHistoryOkResponse = import_zod39.z.lazy(() => {
|
|
4298
|
+
return import_zod39.z.object({
|
|
4107
4299
|
esim: getEsimHistoryOkResponseEsim
|
|
4108
4300
|
});
|
|
4109
4301
|
});
|
|
4110
|
-
var getEsimHistoryOkResponseResponse =
|
|
4111
|
-
return
|
|
4302
|
+
var getEsimHistoryOkResponseResponse = import_zod39.z.lazy(() => {
|
|
4303
|
+
return import_zod39.z.object({
|
|
4112
4304
|
esim: getEsimHistoryOkResponseEsimResponse
|
|
4113
4305
|
}).transform((data) => ({
|
|
4114
4306
|
esim: data["esim"]
|
|
4115
4307
|
}));
|
|
4116
4308
|
});
|
|
4117
|
-
var getEsimHistoryOkResponseRequest =
|
|
4118
|
-
return
|
|
4309
|
+
var getEsimHistoryOkResponseRequest = import_zod39.z.lazy(() => {
|
|
4310
|
+
return import_zod39.z.object({
|
|
4119
4311
|
esim: getEsimHistoryOkResponseEsimRequest
|
|
4120
4312
|
}).transform((data) => ({
|
|
4121
4313
|
esim: data["esim"]
|
|
4122
4314
|
}));
|
|
4123
4315
|
});
|
|
4124
4316
|
|
|
4317
|
+
// src/services/e-sim/models/suspend-esim-ok-response.ts
|
|
4318
|
+
var import_zod40 = require("zod");
|
|
4319
|
+
var suspendEsimOkResponse = import_zod40.z.lazy(() => {
|
|
4320
|
+
return import_zod40.z.object({
|
|
4321
|
+
message: import_zod40.z.string()
|
|
4322
|
+
});
|
|
4323
|
+
});
|
|
4324
|
+
var suspendEsimOkResponseResponse = import_zod40.z.lazy(() => {
|
|
4325
|
+
return import_zod40.z.object({
|
|
4326
|
+
message: import_zod40.z.string()
|
|
4327
|
+
}).transform((data) => ({
|
|
4328
|
+
message: data["message"]
|
|
4329
|
+
}));
|
|
4330
|
+
});
|
|
4331
|
+
var suspendEsimOkResponseRequest = import_zod40.z.lazy(() => {
|
|
4332
|
+
return import_zod40.z.object({
|
|
4333
|
+
message: import_zod40.z.string()
|
|
4334
|
+
}).transform((data) => ({
|
|
4335
|
+
message: data["message"]
|
|
4336
|
+
}));
|
|
4337
|
+
});
|
|
4338
|
+
|
|
4125
4339
|
// src/services/e-sim/e-sim-service.ts
|
|
4126
4340
|
var ESimService = class extends BaseService {
|
|
4127
4341
|
/**
|
|
@@ -4151,6 +4365,15 @@ var ESimService = class extends BaseService {
|
|
|
4151
4365
|
this.getEsimHistoryConfig = config;
|
|
4152
4366
|
return this;
|
|
4153
4367
|
}
|
|
4368
|
+
/**
|
|
4369
|
+
* Sets method-level configuration for suspendEsim.
|
|
4370
|
+
* @param config - Partial configuration to override service-level defaults
|
|
4371
|
+
* @returns This service instance for method chaining
|
|
4372
|
+
*/
|
|
4373
|
+
setSuspendEsimConfig(config) {
|
|
4374
|
+
this.suspendEsimConfig = config;
|
|
4375
|
+
return this;
|
|
4376
|
+
}
|
|
4154
4377
|
/**
|
|
4155
4378
|
* Get eSIM
|
|
4156
4379
|
* @param {string} params.iccid - ID of the eSIM
|
|
@@ -4165,13 +4388,25 @@ var ESimService = class extends BaseService {
|
|
|
4165
4388
|
contentType: "json" /* Json */,
|
|
4166
4389
|
status: 200
|
|
4167
4390
|
}).addError({
|
|
4168
|
-
error:
|
|
4391
|
+
error: ErrorResponse,
|
|
4169
4392
|
contentType: "json" /* Json */,
|
|
4170
4393
|
status: 400
|
|
4171
4394
|
}).addError({
|
|
4172
|
-
error:
|
|
4395
|
+
error: ErrorResponse,
|
|
4173
4396
|
contentType: "json" /* Json */,
|
|
4174
4397
|
status: 401
|
|
4398
|
+
}).addError({
|
|
4399
|
+
error: ErrorResponse,
|
|
4400
|
+
contentType: "json" /* Json */,
|
|
4401
|
+
status: 409
|
|
4402
|
+
}).addError({
|
|
4403
|
+
error: ErrorResponse,
|
|
4404
|
+
contentType: "json" /* Json */,
|
|
4405
|
+
status: 422
|
|
4406
|
+
}).addError({
|
|
4407
|
+
error: ErrorResponse,
|
|
4408
|
+
contentType: "json" /* Json */,
|
|
4409
|
+
status: 503
|
|
4175
4410
|
}).addQueryParam({
|
|
4176
4411
|
key: "iccid",
|
|
4177
4412
|
value: params == null ? void 0 : params.iccid
|
|
@@ -4191,13 +4426,25 @@ var ESimService = class extends BaseService {
|
|
|
4191
4426
|
contentType: "json" /* Json */,
|
|
4192
4427
|
status: 200
|
|
4193
4428
|
}).addError({
|
|
4194
|
-
error:
|
|
4429
|
+
error: ErrorResponse,
|
|
4195
4430
|
contentType: "json" /* Json */,
|
|
4196
4431
|
status: 400
|
|
4197
4432
|
}).addError({
|
|
4198
|
-
error:
|
|
4433
|
+
error: ErrorResponse,
|
|
4199
4434
|
contentType: "json" /* Json */,
|
|
4200
4435
|
status: 401
|
|
4436
|
+
}).addError({
|
|
4437
|
+
error: ErrorResponse,
|
|
4438
|
+
contentType: "json" /* Json */,
|
|
4439
|
+
status: 409
|
|
4440
|
+
}).addError({
|
|
4441
|
+
error: ErrorResponse,
|
|
4442
|
+
contentType: "json" /* Json */,
|
|
4443
|
+
status: 422
|
|
4444
|
+
}).addError({
|
|
4445
|
+
error: ErrorResponse,
|
|
4446
|
+
contentType: "json" /* Json */,
|
|
4447
|
+
status: 503
|
|
4201
4448
|
}).addPathParam({
|
|
4202
4449
|
key: "iccid",
|
|
4203
4450
|
value: iccid
|
|
@@ -4217,19 +4464,74 @@ var ESimService = class extends BaseService {
|
|
|
4217
4464
|
contentType: "json" /* Json */,
|
|
4218
4465
|
status: 200
|
|
4219
4466
|
}).addError({
|
|
4220
|
-
error:
|
|
4467
|
+
error: ErrorResponse,
|
|
4221
4468
|
contentType: "json" /* Json */,
|
|
4222
4469
|
status: 400
|
|
4223
4470
|
}).addError({
|
|
4224
|
-
error:
|
|
4471
|
+
error: ErrorResponse,
|
|
4225
4472
|
contentType: "json" /* Json */,
|
|
4226
4473
|
status: 401
|
|
4474
|
+
}).addError({
|
|
4475
|
+
error: ErrorResponse,
|
|
4476
|
+
contentType: "json" /* Json */,
|
|
4477
|
+
status: 409
|
|
4478
|
+
}).addError({
|
|
4479
|
+
error: ErrorResponse,
|
|
4480
|
+
contentType: "json" /* Json */,
|
|
4481
|
+
status: 422
|
|
4482
|
+
}).addError({
|
|
4483
|
+
error: ErrorResponse,
|
|
4484
|
+
contentType: "json" /* Json */,
|
|
4485
|
+
status: 503
|
|
4227
4486
|
}).addPathParam({
|
|
4228
4487
|
key: "iccid",
|
|
4229
4488
|
value: iccid
|
|
4230
4489
|
}).build();
|
|
4231
4490
|
return this.client.callDirect(request);
|
|
4232
4491
|
}
|
|
4492
|
+
/**
|
|
4493
|
+
* Suspends an eSIM to prevent abuse. All of the eSIM's packages are terminated and its connectivity is switched off. The eSIM is not refunded: the charge stays.
|
|
4494
|
+
* @param {string} iccid - ID of the eSIM
|
|
4495
|
+
* @param {string} [params.idempotencyKey] - Optional. A unique value (for example a UUID) that makes this request safe to retry. If a request with the same `Idempotency-Key` and the same body succeeds, repeating it returns the original response instead of performing the action again, and the response includes the header `Idempotent-Replayed: true`. Keys are scoped to your credentials and remembered for 3 days. Only successful (2xx) responses are remembered, so a request that failed can be retried with the same key. Reusing a key with a different request returns `422`; sending it while the original request is still being processed returns `409`. If the idempotency store is temporarily unavailable, the request is not processed and returns `503`; retry it. Must be 1 to 255 printable ASCII characters, without spaces.
|
|
4496
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
4497
|
+
* @returns {Promise<HttpResponse<SuspendEsimOkResponse>>} - Successful Response
|
|
4498
|
+
*/
|
|
4499
|
+
async suspendEsim(iccid, params, requestConfig) {
|
|
4500
|
+
const resolvedConfig = this.getResolvedConfig(this.suspendEsimConfig, requestConfig);
|
|
4501
|
+
import_zod41.z.object({ idempotencyKey: import_zod41.z.string().optional() }).parse(params != null ? params : {});
|
|
4502
|
+
const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/esim/{iccid}/suspend").setRequestSchema(import_zod41.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
|
4503
|
+
schema: suspendEsimOkResponseResponse,
|
|
4504
|
+
contentType: "json" /* Json */,
|
|
4505
|
+
status: 200
|
|
4506
|
+
}).addError({
|
|
4507
|
+
error: ErrorResponse,
|
|
4508
|
+
contentType: "json" /* Json */,
|
|
4509
|
+
status: 400
|
|
4510
|
+
}).addError({
|
|
4511
|
+
error: ErrorResponse,
|
|
4512
|
+
contentType: "json" /* Json */,
|
|
4513
|
+
status: 401
|
|
4514
|
+
}).addError({
|
|
4515
|
+
error: ErrorResponse,
|
|
4516
|
+
contentType: "json" /* Json */,
|
|
4517
|
+
status: 409
|
|
4518
|
+
}).addError({
|
|
4519
|
+
error: ErrorResponse,
|
|
4520
|
+
contentType: "json" /* Json */,
|
|
4521
|
+
status: 422
|
|
4522
|
+
}).addError({
|
|
4523
|
+
error: ErrorResponse,
|
|
4524
|
+
contentType: "json" /* Json */,
|
|
4525
|
+
status: 503
|
|
4526
|
+
}).addPathParam({
|
|
4527
|
+
key: "iccid",
|
|
4528
|
+
value: iccid
|
|
4529
|
+
}).addHeaderParam({
|
|
4530
|
+
key: "Idempotency-Key",
|
|
4531
|
+
value: params == null ? void 0 : params.idempotencyKey
|
|
4532
|
+
}).build();
|
|
4533
|
+
return this.client.callDirect(request);
|
|
4534
|
+
}
|
|
4233
4535
|
};
|
|
4234
4536
|
|
|
4235
4537
|
// src/services/i-frame/i-frame-service.ts
|
|
@@ -4280,13 +4582,25 @@ var IFrameService = class extends BaseService {
|
|
|
4280
4582
|
contentType: "json" /* Json */,
|
|
4281
4583
|
status: 200
|
|
4282
4584
|
}).addError({
|
|
4283
|
-
error:
|
|
4585
|
+
error: ErrorResponse,
|
|
4284
4586
|
contentType: "json" /* Json */,
|
|
4285
4587
|
status: 400
|
|
4286
4588
|
}).addError({
|
|
4287
|
-
error:
|
|
4589
|
+
error: ErrorResponse,
|
|
4288
4590
|
contentType: "json" /* Json */,
|
|
4289
4591
|
status: 401
|
|
4592
|
+
}).addError({
|
|
4593
|
+
error: ErrorResponse,
|
|
4594
|
+
contentType: "json" /* Json */,
|
|
4595
|
+
status: 409
|
|
4596
|
+
}).addError({
|
|
4597
|
+
error: ErrorResponse,
|
|
4598
|
+
contentType: "json" /* Json */,
|
|
4599
|
+
status: 422
|
|
4600
|
+
}).addError({
|
|
4601
|
+
error: ErrorResponse,
|
|
4602
|
+
contentType: "json" /* Json */,
|
|
4603
|
+
status: 503
|
|
4290
4604
|
}).build();
|
|
4291
4605
|
return this.client.callDirect(request);
|
|
4292
4606
|
}
|