celitech-sdk 2.0.6 → 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/dist/index.mjs CHANGED
@@ -241,7 +241,11 @@ var TransportHookAdapter = class {
241
241
  true
242
242
  ),
243
243
  headers: this.hookParamsToTransportParams(newRequest.headers, request.headers, false),
244
- pathParams: this.hookParamsToTransportParams(newRequest.pathParams, request.headers, false)
244
+ pathParams: this.hookParamsToTransportParams(
245
+ newRequest.pathParams,
246
+ request.pathParams,
247
+ false
248
+ )
245
249
  });
246
250
  return newTransportRequest;
247
251
  }
@@ -336,7 +340,7 @@ var TransportHookAdapter = class {
336
340
  function getContentTypeDefinition(contentType) {
337
341
  const ct = contentType.toLowerCase();
338
342
  if (ct.startsWith("application/") && ct.includes("xml")) {
339
- return "xml" /* Xml */;
343
+ return "text" /* Text */;
340
344
  }
341
345
  if (ct === "application/x-www-form-urlencoded") {
342
346
  return "form" /* FormUrlEncoded */;
@@ -375,14 +379,13 @@ var HookHandler = class {
375
379
  }
376
380
  /**
377
381
  * Handles a standard HTTP request with hook invocation.
378
- * Calls beforeRequest hook, processes the request, and calls afterResponse or onError hooks.
382
+ * Calls beforeRequest hook, processes the request, and calls the afterResponse hook.
379
383
  * @template T - The expected response data type
380
384
  * @param request - The HTTP request to process
381
385
  * @returns A promise that resolves to the HTTP response
382
386
  * @throws Error if no next handler is set, or if error handling fails
383
387
  */
384
388
  async handle(request) {
385
- var _a;
386
389
  if (!this.next) {
387
390
  throw new Error("No next handler set in hook handler.");
388
391
  }
@@ -393,6 +396,10 @@ var HookHandler = class {
393
396
  if (response.metadata.status < 400) {
394
397
  return await hook.afterResponse(nextRequest, response, hookParams);
395
398
  }
399
+ return await this.throwErrorResponse(request, response);
400
+ }
401
+ async throwErrorResponse(request, response, resolveUndeclaredError) {
402
+ var _a;
396
403
  const arrayBuffer = response.raw;
397
404
  const rawContentType = ((_a = response.metadata.headers["content-type"]) == null ? void 0 : _a.toLocaleLowerCase()) || "";
398
405
  const contentType = getContentTypeDefinition(rawContentType);
@@ -409,10 +416,13 @@ var HookHandler = class {
409
416
  } catch (e) {
410
417
  }
411
418
  }
412
- const customError = new error.error((json == null ? void 0 : json.message) || "", json);
419
+ const customError = error.error.from((json == null ? void 0 : json.message) || "", json);
413
420
  customError.metadata = response.metadata;
414
421
  customError.throw();
415
422
  }
423
+ if (resolveUndeclaredError) {
424
+ throw await resolveUndeclaredError();
425
+ }
416
426
  const decodedBody = new TextDecoder().decode(arrayBuffer);
417
427
  throw new HttpError(
418
428
  response.metadata,
@@ -442,7 +452,11 @@ Body: ${decodedBody}`
442
452
  if (response.metadata.status < 400) {
443
453
  yield await hook.afterResponse(nextRequest, response, hookParams);
444
454
  } else {
445
- throw await hook.onError(nextRequest, response, hookParams);
455
+ return await this.throwErrorResponse(
456
+ request,
457
+ response,
458
+ () => hook.onError(nextRequest, response, hookParams)
459
+ );
446
460
  }
447
461
  }
448
462
  }
@@ -546,7 +560,6 @@ var ResponseValidationHandler = class {
546
560
  ["image" /* Image */]: this.decodeFile,
547
561
  ["multipartFormData" /* MultipartFormData */]: this.decodeMultipartFormData,
548
562
  ["text" /* Text */]: this.decodeText,
549
- ["xml" /* Xml */]: this.decodeText,
550
563
  ["form" /* FormUrlEncoded */]: this.decodeFormUrlEncoded,
551
564
  ["eventStream" /* EventStream */]: this.decodeEventStream
552
565
  };
@@ -728,7 +741,7 @@ var RequestValidationHandler = class {
728
741
  if (!this.next) {
729
742
  throw new Error("No next handler set in ContentTypeHandler.");
730
743
  }
731
- this.validateRequest(request);
744
+ await this.validateRequest(request);
732
745
  return this.next.handle(request);
733
746
  }
734
747
  /**
@@ -742,7 +755,7 @@ var RequestValidationHandler = class {
742
755
  if (!this.next) {
743
756
  throw new Error("No next handler set in ContentTypeHandler.");
744
757
  }
745
- this.validateRequest(request);
758
+ await this.validateRequest(request);
746
759
  yield* this.next.stream(request);
747
760
  }
748
761
  /**
@@ -752,33 +765,41 @@ var RequestValidationHandler = class {
752
765
  */
753
766
  validateRequest(request) {
754
767
  var _a, _b;
755
- if (request.requestContentType === "json" /* Json */) {
756
- try {
757
- const parsedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
758
- request.body = JSON.stringify(parsedBody);
759
- } catch (error) {
760
- if (error instanceof ZodError) {
761
- throw new ValidationError(error, request.body);
762
- }
763
- throw error;
764
- }
765
- } else if (request.requestContentType === "xml" /* Xml */ || request.requestContentType === "text" /* Text */ || request.requestContentType === "image" /* Image */ || request.requestContentType === "binary" /* Binary */) {
768
+ const requestValidationEnabled = (_b = (_a = request.config.validation) == null ? void 0 : _a.requestValidation) != null ? _b : true;
769
+ if (request.requestContentType === "text" /* Text */ || request.requestContentType === "image" /* Image */ || request.requestContentType === "binary" /* Binary */) {
766
770
  request.body = request.body;
767
771
  } else if (request.requestContentType === "form" /* FormUrlEncoded */) {
768
- request.body = this.toFormUrlEncoded(request);
772
+ request.body = this.toFormUrlEncoded(request, requestValidationEnabled);
769
773
  } else if (request.requestContentType === "multipartFormData" /* MultipartFormData */) {
770
774
  request.body = this.toFormData(request.body, request.filename, request.filenames);
771
775
  } else {
772
- request.body = JSON.stringify((_b = request.requestSchema) == null ? void 0 : _b.parse(request.body));
776
+ request.body = requestValidationEnabled ? JSON.stringify(this.validateBody(request, request.body)) : JSON.stringify(request.body);
777
+ }
778
+ }
779
+ /**
780
+ * Validates a request body against its schema.
781
+ * @throws ValidationError if Zod schema validation fails
782
+ */
783
+ validateBody(request, body) {
784
+ if (!request.requestSchema) {
785
+ return body;
786
+ }
787
+ try {
788
+ return request.requestSchema.parse(body);
789
+ } catch (error) {
790
+ if (error instanceof ZodError) {
791
+ throw new ValidationError(error, body);
792
+ }
793
+ throw error;
773
794
  }
774
795
  }
775
796
  /**
776
797
  * Converts request body to URL-encoded form data format.
777
798
  * @param request - The HTTP request with body to convert
799
+ * @param requestValidationEnabled - Whether to validate the body against its schema first
778
800
  * @returns URL-encoded string representation of the body
779
801
  */
780
- toFormUrlEncoded(request) {
781
- var _a;
802
+ toFormUrlEncoded(request, requestValidationEnabled) {
782
803
  if (request.body === void 0) {
783
804
  return "";
784
805
  }
@@ -788,7 +809,7 @@ var RequestValidationHandler = class {
788
809
  if (request.body instanceof URLSearchParams) {
789
810
  return request.body.toString();
790
811
  }
791
- const validatedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
812
+ const validatedBody = requestValidationEnabled ? this.validateBody(request, request.body) : request.body;
792
813
  if (validatedBody instanceof FormData) {
793
814
  const params = new URLSearchParams();
794
815
  validatedBody.forEach((value, key) => {
@@ -798,12 +819,12 @@ var RequestValidationHandler = class {
798
819
  });
799
820
  return params.toString();
800
821
  }
801
- if (typeof validatedBody === "object" && !Array.isArray(validatedBody)) {
822
+ if (typeof validatedBody === "object" && validatedBody !== null && !Array.isArray(validatedBody)) {
802
823
  const params = new URLSearchParams();
803
824
  for (const [key, value] of Object.entries(validatedBody)) {
804
- if (value != null) {
805
- params.append(key, `${value}`);
806
- }
825
+ if (value == null)
826
+ continue;
827
+ params.append(key, `${value}`);
807
828
  }
808
829
  return params.toString();
809
830
  }
@@ -811,7 +832,8 @@ var RequestValidationHandler = class {
811
832
  }
812
833
  /**
813
834
  * Converts request body to multipart form data format.
814
- * Handles files (ArrayBuffer), arrays, and regular values.
835
+ * Handles files (ArrayBuffer, Uint8Array, Buffer, or Blob — see `isFileLike` below), arrays,
836
+ * and regular values.
815
837
  * @param body - The request body object
816
838
  * @param filename - Optional filename for single file uploads
817
839
  * @param filenames - Optional filenames array for array of file uploads
@@ -823,16 +845,16 @@ var RequestValidationHandler = class {
823
845
  const value = body[key];
824
846
  if (Array.isArray(value)) {
825
847
  value.forEach((v, i) => {
826
- if (v instanceof ArrayBuffer) {
848
+ if (isFileLike(v)) {
827
849
  const fileFilename = filenames && filenames[i] ? filenames[i] : `${key}[${i}]`;
828
- formData.append(`${key}[${i}]`, new Blob([v]), fileFilename);
850
+ formData.append(`${key}[${i}]`, toBlob(v), fileFilename);
829
851
  } else {
830
852
  formData.append(`${key}[${i}]`, v);
831
853
  }
832
854
  });
833
- } else if (value instanceof ArrayBuffer) {
855
+ } else if (isFileLike(value)) {
834
856
  const fileFilename = filename || key;
835
- formData.append(key, new Blob([value]), fileFilename);
857
+ formData.append(key, toBlob(value), fileFilename);
836
858
  } else {
837
859
  formData.append(key, value);
838
860
  }
@@ -840,6 +862,12 @@ var RequestValidationHandler = class {
840
862
  return formData;
841
863
  }
842
864
  };
865
+ function isFileLike(value) {
866
+ return value instanceof ArrayBuffer || ArrayBuffer.isView(value) || typeof Blob !== "undefined" && value instanceof Blob;
867
+ }
868
+ function toBlob(value) {
869
+ return value instanceof Blob ? value : new Blob([value]);
870
+ }
843
871
 
844
872
  // src/http/utils/line-decoder.ts
845
873
  var LineDecoder = class {
@@ -856,7 +884,7 @@ var LineDecoder = class {
856
884
  * @returns An array of complete lines as Uint8Array
857
885
  */
858
886
  splitLines(chunk) {
859
- this.lineBuffer += this.decoder.decode(chunk);
887
+ this.lineBuffer += this.decoder.decode(chunk, { stream: true });
860
888
  let lineEndIndex;
861
889
  const lines = [];
862
890
  while ((lineEndIndex = this.lineBuffer.indexOf("\n")) >= 0) {
@@ -928,7 +956,10 @@ var RequestFetchAdapter = class {
928
956
  headers: this.getHeaders(response)
929
957
  };
930
958
  if (response.status >= 400) {
931
- throw new HttpError(metadata, await response.clone().arrayBuffer());
959
+ return yield {
960
+ metadata,
961
+ raw: await response.clone().arrayBuffer()
962
+ };
932
963
  }
933
964
  if (!response.body) {
934
965
  return yield {
@@ -1014,10 +1045,7 @@ var RequestFetchAdapter = class {
1014
1045
  return headers;
1015
1046
  }
1016
1047
  toArrayBuffer(uint8Array) {
1017
- return uint8Array.buffer.slice(
1018
- uint8Array.byteOffset,
1019
- uint8Array.byteOffset + uint8Array.byteLength
1020
- );
1048
+ return new Uint8Array(uint8Array).buffer;
1021
1049
  }
1022
1050
  };
1023
1051
 
@@ -1067,7 +1095,7 @@ var RetryHandler = class {
1067
1095
  if (!this.shouldRetry(error, request) || attempt === maxAttempts) {
1068
1096
  throw error;
1069
1097
  }
1070
- const delayMs = this.calculateDelay(attempt, request);
1098
+ const delayMs = this.calculateDelay(attempt, request, error);
1071
1099
  await this.delay(delayMs);
1072
1100
  }
1073
1101
  }
@@ -1094,7 +1122,7 @@ var RetryHandler = class {
1094
1122
  if (!this.shouldRetry(error, request) || attempt === maxAttempts) {
1095
1123
  throw error;
1096
1124
  }
1097
- const delayMs = this.calculateDelay(attempt, request);
1125
+ const delayMs = this.calculateDelay(attempt, request, error);
1098
1126
  await this.delay(delayMs);
1099
1127
  }
1100
1128
  }
@@ -1115,10 +1143,8 @@ var RetryHandler = class {
1115
1143
  }
1116
1144
  const httpMethodsToRetry = (_b = (_a = request.config.retry) == null ? void 0 : _a.httpMethodsToRetry) != null ? _b : [
1117
1145
  "GET",
1118
- "POST",
1119
1146
  "PUT",
1120
1147
  "DELETE",
1121
- "PATCH",
1122
1148
  "HEAD",
1123
1149
  "OPTIONS"
1124
1150
  ];
@@ -1127,18 +1153,25 @@ var RetryHandler = class {
1127
1153
  return shouldRetryStatus && shouldRetryMethod;
1128
1154
  }
1129
1155
  /**
1130
- * Calculates the delay before the next retry attempt using exponential backoff.
1131
- * Optionally adds jitter to prevent thundering herd problems.
1156
+ * Calculates the delay before the next retry attempt. A server rate-limit timing header
1157
+ * (Retry-After / X-RateLimit-Reset) on the error, when present, overrides the computed
1158
+ * exponential backoff; otherwise falls back to exponential backoff with optional jitter.
1132
1159
  * @param attempt - The current retry attempt number (1-indexed)
1133
1160
  * @param request - The HTTP request being retried
1161
+ * @param error - The error that triggered the retry (carries the response headers)
1134
1162
  * @returns The delay in milliseconds, capped at the configured maximum delay
1135
1163
  */
1136
- calculateDelay(attempt, request) {
1137
- var _a, _b, _c, _d, _e, _f, _g, _h;
1138
- const baseDelay = (_b = (_a = request.config.retry) == null ? void 0 : _a.delayMs) != null ? _b : 150;
1139
- const backoffFactor = (_d = (_c = request.config.retry) == null ? void 0 : _c.backoffFactor) != null ? _d : 2;
1140
- const maxDelay = (_f = (_e = request.config.retry) == null ? void 0 : _e.maxDelayMs) != null ? _f : 5e3;
1141
- const jitter = (_h = (_g = request.config.retry) == null ? void 0 : _g.jitterMs) != null ? _h : 50;
1164
+ calculateDelay(attempt, request, error) {
1165
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
1166
+ const maxRetryAfterDelay = (_b = (_a = request.config.retry) == null ? void 0 : _a.maxRetryAfterDelayMs) != null ? _b : 6e4;
1167
+ const headerDelay = this.retryAfterDelay(error, maxRetryAfterDelay);
1168
+ if (headerDelay !== null) {
1169
+ return Math.floor(headerDelay);
1170
+ }
1171
+ const baseDelay = (_d = (_c = request.config.retry) == null ? void 0 : _c.delayMs) != null ? _d : 150;
1172
+ const backoffFactor = (_f = (_e = request.config.retry) == null ? void 0 : _e.backoffFactor) != null ? _f : 2;
1173
+ const maxDelay = (_h = (_g = request.config.retry) == null ? void 0 : _g.maxDelayMs) != null ? _h : 5e3;
1174
+ const jitter = (_j = (_i = request.config.retry) == null ? void 0 : _i.jitterMs) != null ? _j : 50;
1142
1175
  let delay = baseDelay * Math.pow(backoffFactor, attempt - 1);
1143
1176
  delay = Math.min(delay, maxDelay);
1144
1177
  if (jitter > 0) {
@@ -1146,6 +1179,66 @@ var RetryHandler = class {
1146
1179
  }
1147
1180
  return Math.floor(delay);
1148
1181
  }
1182
+ /**
1183
+ * Returns the server-directed retry delay (ms) from rate-limit response headers,
1184
+ * honoring Retry-After (delta-seconds or HTTP-date) and, when absent, X-RateLimit-Reset
1185
+ * (epoch seconds), clamped to maxRetryAfterDelayMs. Returns null when no usable header is
1186
+ * present so the caller falls back to the computed exponential backoff.
1187
+ * @param error - The error that triggered the retry (carries the response headers)
1188
+ * @param maxRetryAfterDelayMs - Upper bound for a server-directed delay
1189
+ * @returns The delay in milliseconds, or null to use exponential backoff
1190
+ */
1191
+ retryAfterDelay(error, maxRetryAfterDelayMs) {
1192
+ var _a;
1193
+ const headers = (_a = error == null ? void 0 : error.metadata) == null ? void 0 : _a.headers;
1194
+ if (!headers || maxRetryAfterDelayMs <= 0) {
1195
+ return null;
1196
+ }
1197
+ const getHeader = (name) => headers[name];
1198
+ const retryAfterMs = getHeader("retry-after-ms");
1199
+ if (retryAfterMs !== void 0 && /^\d+(\.\d+)?$/.test(retryAfterMs.trim())) {
1200
+ return Math.min(Number(retryAfterMs.trim()), maxRetryAfterDelayMs);
1201
+ }
1202
+ const seconds = this.parseRetryAfter(getHeader("retry-after"));
1203
+ if (seconds !== null) {
1204
+ return Math.min(Math.max(seconds * 1e3, 0), maxRetryAfterDelayMs);
1205
+ }
1206
+ const reset = getHeader("x-ratelimit-reset");
1207
+ if (reset !== void 0 && reset.trim() !== "") {
1208
+ const epoch = Number(reset);
1209
+ if (Number.isFinite(epoch)) {
1210
+ const deltaMs = epoch * 1e3 - Date.now();
1211
+ if (deltaMs > 0) {
1212
+ return Math.min(deltaMs, maxRetryAfterDelayMs);
1213
+ }
1214
+ }
1215
+ }
1216
+ return null;
1217
+ }
1218
+ /**
1219
+ * Parses a Retry-After header value: an integer/float number of seconds, or an HTTP-date
1220
+ * (a past date yields 0). Returns the delay in seconds, or null if empty/unparseable.
1221
+ * @param value - The raw Retry-After header value
1222
+ * @returns The delay in seconds, or null
1223
+ */
1224
+ parseRetryAfter(value) {
1225
+ if (value === void 0) {
1226
+ return null;
1227
+ }
1228
+ const trimmed = value.trim();
1229
+ if (trimmed === "") {
1230
+ return null;
1231
+ }
1232
+ if (/^\d+(\.\d+)?$/.test(trimmed)) {
1233
+ return Number(trimmed);
1234
+ }
1235
+ const dateMs = Date.parse(trimmed);
1236
+ if (!Number.isNaN(dateMs)) {
1237
+ const deltaSeconds = (dateMs - Date.now()) / 1e3;
1238
+ return deltaSeconds > 0 ? deltaSeconds : 0;
1239
+ }
1240
+ return null;
1241
+ }
1149
1242
  /**
1150
1243
  * Delays execution for a specified duration before retrying.
1151
1244
  * @param delayMs - The delay in milliseconds
@@ -1385,6 +1478,78 @@ var HttpClient = class {
1385
1478
  }
1386
1479
  };
1387
1480
 
1481
+ // src/http/utils/runtime.ts
1482
+ var RUNTIME = evaluateRuntime();
1483
+ function evaluateRuntime() {
1484
+ var _a, _b, _c, _d, _e, _f, _g;
1485
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
1486
+ if (isBrowser) {
1487
+ return { type: "browser", version: window.navigator.userAgent };
1488
+ }
1489
+ const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis == null ? void 0 : globalThis.navigator) == null ? void 0 : _a.userAgent) === "Cloudflare-Workers";
1490
+ if (isCloudflare) {
1491
+ return { type: "workerd" };
1492
+ }
1493
+ const isEdgeRuntime = typeof EdgeRuntime === "string";
1494
+ if (isEdgeRuntime) {
1495
+ return { type: "edge-runtime" };
1496
+ }
1497
+ 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");
1498
+ if (isWebWorker) {
1499
+ return { type: "web-worker" };
1500
+ }
1501
+ const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
1502
+ if (isDeno) {
1503
+ return {
1504
+ type: "deno",
1505
+ version: Deno.version.deno,
1506
+ os: (_e = Deno.build) == null ? void 0 : _e.os,
1507
+ arch: (_f = Deno.build) == null ? void 0 : _f.arch
1508
+ };
1509
+ }
1510
+ const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
1511
+ if (isBun) {
1512
+ return {
1513
+ type: "bun",
1514
+ version: Bun.version,
1515
+ os: typeof process !== "undefined" ? process.platform : void 0,
1516
+ arch: typeof process !== "undefined" ? process.arch : void 0
1517
+ };
1518
+ }
1519
+ const isReactNative = typeof navigator !== "undefined" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
1520
+ if (isReactNative) {
1521
+ return { type: "react-native" };
1522
+ }
1523
+ const localProcess = typeof process !== "undefined" ? process : void 0;
1524
+ const isNode = typeof localProcess !== "undefined" && typeof ((_g = localProcess.versions) == null ? void 0 : _g.node) === "string";
1525
+ if (isNode) {
1526
+ return {
1527
+ type: "node",
1528
+ version: localProcess.versions.node,
1529
+ parsedVersion: Number(localProcess.versions.node.split(".")[0]),
1530
+ os: localProcess.platform,
1531
+ arch: localProcess.arch
1532
+ };
1533
+ }
1534
+ return { type: "unknown" };
1535
+ }
1536
+ function toBase64(str) {
1537
+ if (typeof Buffer !== "undefined") {
1538
+ return Buffer.from(str, "utf-8").toString("base64");
1539
+ }
1540
+ if (typeof btoa === "function") {
1541
+ const bytes = new TextEncoder().encode(str);
1542
+ let binary = "";
1543
+ for (const byte of bytes) {
1544
+ binary += String.fromCharCode(byte);
1545
+ }
1546
+ return btoa(binary);
1547
+ }
1548
+ throw new Error(
1549
+ `No base64 encoder available in this runtime (${RUNTIME.type}): neither Buffer nor btoa is defined.`
1550
+ );
1551
+ }
1552
+
1388
1553
  // src/services/base-service.ts
1389
1554
  var BaseService = class {
1390
1555
  constructor(config, tokenManager) {
@@ -1447,6 +1612,9 @@ var BaseService = class {
1447
1612
  }
1448
1613
  return merged;
1449
1614
  }
1615
+ toBase64(str) {
1616
+ return toBase64(str);
1617
+ }
1450
1618
  set baseUrl(baseUrl) {
1451
1619
  this.config.baseUrl = baseUrl;
1452
1620
  }
@@ -1507,7 +1675,7 @@ var QuerySerializer = class extends Serializer {
1507
1675
  }
1508
1676
  const query = [];
1509
1677
  queryParams.forEach((param) => {
1510
- if (param.value === void 0) {
1678
+ if (param.value === void 0 || param.value === null) {
1511
1679
  return;
1512
1680
  }
1513
1681
  return query.push(`${this.serializeValue(param)}`);
@@ -1529,7 +1697,7 @@ var HeaderSerializer = class extends Serializer {
1529
1697
  }
1530
1698
  const headers = {};
1531
1699
  headerParams.forEach((param) => {
1532
- if (!param.key) {
1700
+ if (!param.key || param.value === void 0 || param.value === null) {
1533
1701
  return;
1534
1702
  }
1535
1703
  headers[param.key] = this.serializeValue(param);
@@ -1551,7 +1719,7 @@ var CookieSerializer = class {
1551
1719
  }
1552
1720
  const cookies = {};
1553
1721
  cookieParams.forEach((param) => {
1554
- if (!param.key || param.value === void 0) {
1722
+ if (!param.key || param.value === void 0 || param.value === null) {
1555
1723
  return;
1556
1724
  }
1557
1725
  cookies[param.key] = this.serializeCookieValue(param);
@@ -1801,8 +1969,12 @@ var Request = class {
1801
1969
  * Handles both cursor-based and limit-offset pagination strategies.
1802
1970
  *
1803
1971
  * @param cursor - The cursor value for cursor-based pagination (optional for limit-offset)
1972
+ * @param offsetIncrement - Fallback increment for offset pagination with no declared `pageSize`
1973
+ * (stepless offset — gap doc row 200), where the caller only learns the increment after fetching
1974
+ * a page (its item count). Ignored whenever `pageSize` is set, which always wins.
1804
1975
  */
1805
- nextPage(cursor) {
1976
+ nextPage(cursor, offsetIncrement) {
1977
+ var _a;
1806
1978
  if (!this.pagination) {
1807
1979
  return;
1808
1980
  }
@@ -1815,10 +1987,11 @@ var Request = class {
1815
1987
  }
1816
1988
  const offsetParam = this.getOffsetParam();
1817
1989
  if (offsetParam) {
1818
- if (this.pagination.pageSize === void 0) {
1990
+ const increment = (_a = this.pagination.pageSize) != null ? _a : offsetIncrement;
1991
+ if (increment === void 0) {
1819
1992
  throw new Error("pageSize is required for limit-offset pagination");
1820
1993
  }
1821
- offsetParam.value = Number(offsetParam.value) + this.pagination.pageSize;
1994
+ offsetParam.value = Number(offsetParam.value) + increment;
1822
1995
  }
1823
1996
  }
1824
1997
  constructPath() {
@@ -1871,14 +2044,13 @@ var RequestBuilder = class {
1871
2044
  clientId: "",
1872
2045
  clientSecret: "",
1873
2046
  retry: {
1874
- attempts: 3,
1875
2047
  delayMs: 150,
1876
2048
  maxDelayMs: 5e3,
1877
2049
  backoffFactor: 2,
1878
2050
  jitterMs: 50,
1879
- httpMethodsToRetry: ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]
2051
+ httpMethodsToRetry: ["GET", "PUT", "DELETE", "HEAD", "OPTIONS"]
1880
2052
  },
1881
- validation: { responseValidation: true }
2053
+ validation: { responseValidation: true, requestValidation: true }
1882
2054
  },
1883
2055
  responses: [],
1884
2056
  errors: [],
@@ -1892,7 +2064,7 @@ var RequestBuilder = class {
1892
2064
  };
1893
2065
  this.addHeaderParam({
1894
2066
  key: "User-Agent",
1895
- value: "postman-codegen/1.7.0 celitech-sdk/2.0.6 (typescript)"
2067
+ value: "postman-codegen/3.7.0 celitech-sdk/2.0.10 (typescript)"
1896
2068
  });
1897
2069
  }
1898
2070
  setConfig(config) {
@@ -1990,7 +2162,8 @@ var RequestBuilder = class {
1990
2162
  value: `${prefix != null ? prefix : "Bearer"} ${accessToken}`,
1991
2163
  explode: false,
1992
2164
  style: "simple" /* SIMPLE */,
1993
- encode: true,
2165
+ // Header values are not URL-encoded; `encode` only means something for path/query params.
2166
+ encode: false,
1994
2167
  isLimit: false,
1995
2168
  isOffset: false,
1996
2169
  isCursor: false
@@ -2006,7 +2179,8 @@ var RequestBuilder = class {
2006
2179
  value: `Basic ${this.toBase64(`${username}:${password}`)}`,
2007
2180
  explode: false,
2008
2181
  style: "simple" /* SIMPLE */,
2009
- encode: true,
2182
+ // Header values are not URL-encoded; `encode` only means something for path/query params.
2183
+ encode: false,
2010
2184
  isLimit: false,
2011
2185
  isOffset: false,
2012
2186
  isCursor: false
@@ -2025,7 +2199,9 @@ var RequestBuilder = class {
2025
2199
  value: apiKey,
2026
2200
  explode: isQuery,
2027
2201
  style: isQuery ? "form" /* FORM */ : "simple" /* SIMPLE */,
2028
- encode: true,
2202
+ // Query values go through the FORM branch, which always URL-encodes regardless of this flag.
2203
+ // Header/cookie values are not URL-encoded, so `encode` must be false for those locations.
2204
+ encode: isQuery,
2029
2205
  isLimit: false,
2030
2206
  isOffset: false,
2031
2207
  isCursor: false
@@ -2129,18 +2305,8 @@ var RequestBuilder = class {
2129
2305
  build() {
2130
2306
  return new Request(this.params);
2131
2307
  }
2132
- /**
2133
- * Converts a string to Base64 encoding.
2134
- * Works in both Node.js and browser environments.
2135
- * @param str - The string to encode
2136
- * @returns The Base64-encoded string
2137
- */
2138
2308
  toBase64(str) {
2139
- if (typeof window === "undefined") {
2140
- return Buffer.from(str, "utf-8").toString("base64");
2141
- } else {
2142
- return btoa(unescape(encodeURIComponent(str)));
2143
- }
2309
+ return toBase64(str);
2144
2310
  }
2145
2311
  };
2146
2312
 
@@ -2278,14 +2444,14 @@ var OAuthTokenManager = class {
2278
2444
  * @throws Error if client credentials are missing or token request fails
2279
2445
  */
2280
2446
  async getToken(scopes, config) {
2281
- var _a, _b, _c;
2282
- if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && ((_b = this.token) == null ? void 0 : _b.expiresAt) && this.token.expiresAt - Date.now() > 5e3) {
2447
+ var _a, _b;
2448
+ if (((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) && (this.token.expiresAt == null || this.token.expiresAt - Date.now() > 5e3)) {
2283
2449
  return this.token;
2284
2450
  }
2285
2451
  if (!config.clientId || !config.clientSecret) {
2286
2452
  throw new Error("OAuthError: clientId and clientSecret are required for token management.");
2287
2453
  }
2288
- const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_c = this.token) == null ? void 0 : _c.scopes) || []]);
2454
+ const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
2289
2455
  const oAuth = new OAuthService(
2290
2456
  {
2291
2457
  ...config,
@@ -2314,7 +2480,7 @@ var OAuthTokenManager = class {
2314
2480
  };
2315
2481
 
2316
2482
  // src/services/destinations/destinations-service.ts
2317
- import { z as z8 } from "zod";
2483
+ import { z as z7 } from "zod";
2318
2484
 
2319
2485
  // src/services/destinations/models/list-destinations-ok-response.ts
2320
2486
  import { z as z5 } from "zod";
@@ -2377,7 +2543,7 @@ var listDestinationsOkResponseRequest = z5.lazy(() => {
2377
2543
  }));
2378
2544
  });
2379
2545
 
2380
- // src/services/common/bad-request.ts
2546
+ // src/services/common/error-response.ts
2381
2547
  import { z as z6 } from "zod";
2382
2548
 
2383
2549
  // src/http/errors/throwable-error.ts
@@ -2392,6 +2558,22 @@ var ThrowableError = class extends Error {
2392
2558
  this.message = message;
2393
2559
  this.response = response;
2394
2560
  }
2561
+ /**
2562
+ * Creates an error instance from a response body.
2563
+ * Parsing (which can throw) is kept out of the constructor so that constructing
2564
+ * an error while handling an error response never throws. The base implementation
2565
+ * simply constructs the instance; subclasses may override to populate typed fields.
2566
+ *
2567
+ * Contract: every subclass constructor must accept `(message, response?)`. The base
2568
+ * uses `new this(message, response)`, so a subclass with a different constructor
2569
+ * signature must override `from()`.
2570
+ * @param message - The error message
2571
+ * @param response - Optional response data associated with the error
2572
+ * @returns A new error instance
2573
+ */
2574
+ static from(message, response) {
2575
+ return new this(message, response);
2576
+ }
2395
2577
  /**
2396
2578
  * Throws this error instance.
2397
2579
  * Convenience method for explicitly throwing the error.
@@ -2402,48 +2584,29 @@ var ThrowableError = class extends Error {
2402
2584
  }
2403
2585
  };
2404
2586
 
2405
- // src/services/common/bad-request.ts
2406
- var badRequestResponse = z6.lazy(() => {
2587
+ // src/services/common/error-response.ts
2588
+ var errorResponseResponse = z6.lazy(() => {
2407
2589
  return z6.object({
2408
2590
  message: z6.string().optional()
2409
2591
  }).transform((data) => ({
2410
2592
  message: data["message"]
2411
2593
  }));
2412
2594
  });
2413
- var BadRequest = class extends ThrowableError {
2595
+ var ErrorResponse = class extends ThrowableError {
2414
2596
  constructor(message, response) {
2415
2597
  super(message);
2416
2598
  this.message = message;
2417
2599
  this.response = response;
2418
- const parsedResponse = badRequestResponse.parse(response);
2419
- this.message = parsedResponse.message || "";
2420
- }
2421
- throw() {
2422
- const error = new BadRequest(this.message, this.response);
2423
- error.metadata = this.metadata;
2424
- throw error;
2425
2600
  }
2426
- };
2427
-
2428
- // src/services/common/unauthorized.ts
2429
- import { z as z7 } from "zod";
2430
- var unauthorizedResponse = z7.lazy(() => {
2431
- return z7.object({
2432
- message: z7.string().optional()
2433
- }).transform((data) => ({
2434
- message: data["message"]
2435
- }));
2436
- });
2437
- var Unauthorized = class extends ThrowableError {
2438
- constructor(message, response) {
2439
- super(message);
2440
- this.message = message;
2441
- this.response = response;
2442
- const parsedResponse = unauthorizedResponse.parse(response);
2443
- this.message = parsedResponse.message || "";
2601
+ static from(message, response) {
2602
+ const error = new ErrorResponse(message, response);
2603
+ const result = errorResponseResponse.safeParse(response);
2604
+ const parsedResponse = result.success ? result.data : response || {};
2605
+ error.message = parsedResponse.message || "";
2606
+ return error;
2444
2607
  }
2445
2608
  throw() {
2446
- const error = new Unauthorized(this.message, this.response);
2609
+ const error = ErrorResponse.from(this.message, this.response);
2447
2610
  error.metadata = this.metadata;
2448
2611
  throw error;
2449
2612
  }
@@ -2467,53 +2630,65 @@ var DestinationsService = class extends BaseService {
2467
2630
  */
2468
2631
  async listDestinations(requestConfig) {
2469
2632
  const resolvedConfig = this.getResolvedConfig(this.listDestinationsConfig, requestConfig);
2470
- const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/destinations").setRequestSchema(z8.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
2633
+ const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/destinations").setRequestSchema(z7.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
2471
2634
  schema: listDestinationsOkResponseResponse,
2472
2635
  contentType: "json" /* Json */,
2473
2636
  status: 200
2474
2637
  }).addError({
2475
- error: BadRequest,
2638
+ error: ErrorResponse,
2476
2639
  contentType: "json" /* Json */,
2477
2640
  status: 400
2478
2641
  }).addError({
2479
- error: Unauthorized,
2642
+ error: ErrorResponse,
2480
2643
  contentType: "json" /* Json */,
2481
2644
  status: 401
2645
+ }).addError({
2646
+ error: ErrorResponse,
2647
+ contentType: "json" /* Json */,
2648
+ status: 409
2649
+ }).addError({
2650
+ error: ErrorResponse,
2651
+ contentType: "json" /* Json */,
2652
+ status: 422
2653
+ }).addError({
2654
+ error: ErrorResponse,
2655
+ contentType: "json" /* Json */,
2656
+ status: 503
2482
2657
  }).build();
2483
2658
  return this.client.callDirect(request);
2484
2659
  }
2485
2660
  };
2486
2661
 
2487
2662
  // src/services/packages/packages-service.ts
2488
- import { z as z11 } from "zod";
2663
+ import { z as z10 } from "zod";
2489
2664
 
2490
2665
  // src/services/packages/models/list-packages-ok-response.ts
2491
- import { z as z10 } from "zod";
2666
+ import { z as z9 } from "zod";
2492
2667
 
2493
2668
  // src/services/packages/models/packages.ts
2494
- import { z as z9 } from "zod";
2495
- var packages = z9.lazy(() => {
2496
- return z9.object({
2497
- id: z9.string(),
2498
- destination: z9.string(),
2499
- destinationIso2: z9.string(),
2500
- dataLimitInBytes: z9.number(),
2501
- dataLimitInGb: z9.number(),
2502
- minDays: z9.number(),
2503
- maxDays: z9.number(),
2504
- priceInCents: z9.number()
2669
+ import { z as z8 } from "zod";
2670
+ var packages = z8.lazy(() => {
2671
+ return z8.object({
2672
+ id: z8.string(),
2673
+ destination: z8.string(),
2674
+ destinationIso2: z8.string(),
2675
+ dataLimitInBytes: z8.number(),
2676
+ dataLimitInGb: z8.number(),
2677
+ minDays: z8.number(),
2678
+ maxDays: z8.number(),
2679
+ priceInCents: z8.number()
2505
2680
  });
2506
2681
  });
2507
- var packagesResponse = z9.lazy(() => {
2508
- return z9.object({
2509
- id: z9.string(),
2510
- destination: z9.string(),
2511
- destinationISO2: z9.string(),
2512
- dataLimitInBytes: z9.number(),
2513
- dataLimitInGB: z9.number(),
2514
- minDays: z9.number(),
2515
- maxDays: z9.number(),
2516
- priceInCents: z9.number()
2682
+ var packagesResponse = z8.lazy(() => {
2683
+ return z8.object({
2684
+ id: z8.string(),
2685
+ destination: z8.string(),
2686
+ destinationISO2: z8.string(),
2687
+ dataLimitInBytes: z8.number(),
2688
+ dataLimitInGB: z8.number(),
2689
+ minDays: z8.number(),
2690
+ maxDays: z8.number(),
2691
+ priceInCents: z8.number()
2517
2692
  }).transform((data) => ({
2518
2693
  id: data["id"],
2519
2694
  destination: data["destination"],
@@ -2525,16 +2700,16 @@ var packagesResponse = z9.lazy(() => {
2525
2700
  priceInCents: data["priceInCents"]
2526
2701
  }));
2527
2702
  });
2528
- var packagesRequest = z9.lazy(() => {
2529
- return z9.object({
2530
- id: z9.string(),
2531
- destination: z9.string(),
2532
- destinationIso2: z9.string(),
2533
- dataLimitInBytes: z9.number(),
2534
- dataLimitInGb: z9.number(),
2535
- minDays: z9.number(),
2536
- maxDays: z9.number(),
2537
- priceInCents: z9.number()
2703
+ var packagesRequest = z8.lazy(() => {
2704
+ return z8.object({
2705
+ id: z8.string(),
2706
+ destination: z8.string(),
2707
+ destinationIso2: z8.string(),
2708
+ dataLimitInBytes: z8.number(),
2709
+ dataLimitInGb: z8.number(),
2710
+ minDays: z8.number(),
2711
+ maxDays: z8.number(),
2712
+ priceInCents: z8.number()
2538
2713
  }).transform((data) => ({
2539
2714
  id: data["id"],
2540
2715
  destination: data["destination"],
@@ -2548,25 +2723,25 @@ var packagesRequest = z9.lazy(() => {
2548
2723
  });
2549
2724
 
2550
2725
  // src/services/packages/models/list-packages-ok-response.ts
2551
- var listPackagesOkResponse = z10.lazy(() => {
2552
- return z10.object({
2553
- packages: z10.array(packages),
2554
- afterCursor: z10.string().nullable()
2726
+ var listPackagesOkResponse = z9.lazy(() => {
2727
+ return z9.object({
2728
+ packages: z9.array(packages),
2729
+ afterCursor: z9.string().nullable()
2555
2730
  });
2556
2731
  });
2557
- var listPackagesOkResponseResponse = z10.lazy(() => {
2558
- return z10.object({
2559
- packages: z10.array(packagesResponse),
2560
- afterCursor: z10.string().nullable()
2732
+ var listPackagesOkResponseResponse = z9.lazy(() => {
2733
+ return z9.object({
2734
+ packages: z9.array(packagesResponse),
2735
+ afterCursor: z9.string().nullable()
2561
2736
  }).transform((data) => ({
2562
2737
  packages: data["packages"],
2563
2738
  afterCursor: data["afterCursor"]
2564
2739
  }));
2565
2740
  });
2566
- var listPackagesOkResponseRequest = z10.lazy(() => {
2567
- return z10.object({
2568
- packages: z10.array(packagesRequest),
2569
- afterCursor: z10.string().nullable()
2741
+ var listPackagesOkResponseRequest = z9.lazy(() => {
2742
+ return z9.object({
2743
+ packages: z9.array(packagesRequest),
2744
+ afterCursor: z9.string().nullable()
2570
2745
  }).transform((data) => ({
2571
2746
  packages: data["packages"],
2572
2747
  afterCursor: data["afterCursor"]
@@ -2600,29 +2775,41 @@ var PackagesService = class extends BaseService {
2600
2775
  */
2601
2776
  async listPackages(params, requestConfig) {
2602
2777
  const resolvedConfig = this.getResolvedConfig(this.listPackagesConfig, requestConfig);
2603
- z11.object({
2604
- destination: z11.string().optional(),
2605
- dataLimitInGb: z11.number().optional(),
2606
- startDate: z11.string().optional(),
2607
- endDate: z11.string().optional(),
2608
- afterCursor: z11.string().optional(),
2609
- limit: z11.number().optional(),
2610
- startTime: z11.number().optional(),
2611
- endTime: z11.number().optional(),
2612
- includeUnlimited: z11.boolean().optional()
2778
+ z10.object({
2779
+ destination: z10.string().optional(),
2780
+ dataLimitInGb: z10.number().optional(),
2781
+ startDate: z10.string().optional(),
2782
+ endDate: z10.string().optional(),
2783
+ afterCursor: z10.string().optional(),
2784
+ limit: z10.number().optional(),
2785
+ startTime: z10.number().optional(),
2786
+ endTime: z10.number().optional(),
2787
+ includeUnlimited: z10.boolean().optional()
2613
2788
  }).parse(params != null ? params : {});
2614
- const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/packages").setRequestSchema(z11.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
2789
+ const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/packages").setRequestSchema(z10.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
2615
2790
  schema: listPackagesOkResponseResponse,
2616
2791
  contentType: "json" /* Json */,
2617
2792
  status: 200
2618
2793
  }).addError({
2619
- error: BadRequest,
2794
+ error: ErrorResponse,
2620
2795
  contentType: "json" /* Json */,
2621
2796
  status: 400
2622
2797
  }).addError({
2623
- error: Unauthorized,
2798
+ error: ErrorResponse,
2624
2799
  contentType: "json" /* Json */,
2625
2800
  status: 401
2801
+ }).addError({
2802
+ error: ErrorResponse,
2803
+ contentType: "json" /* Json */,
2804
+ status: 409
2805
+ }).addError({
2806
+ error: ErrorResponse,
2807
+ contentType: "json" /* Json */,
2808
+ status: 422
2809
+ }).addError({
2810
+ error: ErrorResponse,
2811
+ contentType: "json" /* Json */,
2812
+ status: 503
2626
2813
  }).addQueryParam({
2627
2814
  key: "destination",
2628
2815
  value: params == null ? void 0 : params.destination
@@ -2656,38 +2843,38 @@ var PackagesService = class extends BaseService {
2656
2843
  };
2657
2844
 
2658
2845
  // src/services/purchases/purchases-service.ts
2659
- import { z as z31 } from "zod";
2846
+ import { z as z30 } from "zod";
2660
2847
 
2661
2848
  // src/services/purchases/models/create-purchase-v2-request.ts
2662
- import { z as z12 } from "zod";
2663
- var createPurchaseV2Request = z12.lazy(() => {
2664
- return z12.object({
2665
- destination: z12.string(),
2666
- dataLimitInGb: z12.number(),
2667
- startDate: z12.string().optional(),
2668
- endDate: z12.string().optional(),
2669
- duration: z12.number().optional(),
2670
- quantity: z12.number().gte(1).lte(5),
2671
- email: z12.string().optional(),
2672
- referenceId: z12.string().optional(),
2673
- networkBrand: z12.string().optional(),
2674
- emailBrand: z12.string().optional(),
2675
- language: z12.string().optional()
2849
+ import { z as z11 } from "zod";
2850
+ var createPurchaseV2Request = z11.lazy(() => {
2851
+ return z11.object({
2852
+ destination: z11.string(),
2853
+ dataLimitInGb: z11.number(),
2854
+ startDate: z11.string().optional(),
2855
+ endDate: z11.string().optional(),
2856
+ duration: z11.number().optional(),
2857
+ quantity: z11.number().gte(1).lte(5),
2858
+ email: z11.string().optional(),
2859
+ referenceId: z11.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
2860
+ networkBrand: z11.string().optional(),
2861
+ emailBrand: z11.string().optional(),
2862
+ language: z11.string().optional()
2676
2863
  });
2677
2864
  });
2678
- var createPurchaseV2RequestResponse = z12.lazy(() => {
2679
- return z12.object({
2680
- destination: z12.string(),
2681
- dataLimitInGB: z12.number(),
2682
- startDate: z12.string().optional(),
2683
- endDate: z12.string().optional(),
2684
- duration: z12.number().optional(),
2685
- quantity: z12.number().gte(1).lte(5),
2686
- email: z12.string().optional(),
2687
- referenceId: z12.string().optional(),
2688
- networkBrand: z12.string().optional(),
2689
- emailBrand: z12.string().optional(),
2690
- language: z12.string().optional()
2865
+ var createPurchaseV2RequestResponse = z11.lazy(() => {
2866
+ return z11.object({
2867
+ destination: z11.string(),
2868
+ dataLimitInGB: z11.number(),
2869
+ startDate: z11.string().optional(),
2870
+ endDate: z11.string().optional(),
2871
+ duration: z11.number().optional(),
2872
+ quantity: z11.number().gte(1).lte(5),
2873
+ email: z11.string().optional(),
2874
+ referenceId: z11.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
2875
+ networkBrand: z11.string().optional(),
2876
+ emailBrand: z11.string().optional(),
2877
+ language: z11.string().optional()
2691
2878
  }).transform((data) => ({
2692
2879
  destination: data["destination"],
2693
2880
  dataLimitInGb: data["dataLimitInGB"],
@@ -2702,19 +2889,19 @@ var createPurchaseV2RequestResponse = z12.lazy(() => {
2702
2889
  language: data["language"]
2703
2890
  }));
2704
2891
  });
2705
- var createPurchaseV2RequestRequest = z12.lazy(() => {
2706
- return z12.object({
2707
- destination: z12.string(),
2708
- dataLimitInGb: z12.number(),
2709
- startDate: z12.string().optional(),
2710
- endDate: z12.string().optional(),
2711
- duration: z12.number().optional(),
2712
- quantity: z12.number().gte(1).lte(5),
2713
- email: z12.string().optional(),
2714
- referenceId: z12.string().optional(),
2715
- networkBrand: z12.string().optional(),
2716
- emailBrand: z12.string().optional(),
2717
- language: z12.string().optional()
2892
+ var createPurchaseV2RequestRequest = z11.lazy(() => {
2893
+ return z11.object({
2894
+ destination: z11.string(),
2895
+ dataLimitInGb: z11.number(),
2896
+ startDate: z11.string().optional(),
2897
+ endDate: z11.string().optional(),
2898
+ duration: z11.number().optional(),
2899
+ quantity: z11.number().gte(1).lte(5),
2900
+ email: z11.string().optional(),
2901
+ referenceId: z11.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
2902
+ networkBrand: z11.string().optional(),
2903
+ emailBrand: z11.string().optional(),
2904
+ language: z11.string().optional()
2718
2905
  }).transform((data) => ({
2719
2906
  destination: data["destination"],
2720
2907
  dataLimitInGB: data["dataLimitInGb"],
@@ -2731,33 +2918,33 @@ var createPurchaseV2RequestRequest = z12.lazy(() => {
2731
2918
  });
2732
2919
 
2733
2920
  // src/services/purchases/models/create-purchase-v2-ok-response.ts
2734
- import { z as z15 } from "zod";
2921
+ import { z as z14 } from "zod";
2735
2922
 
2736
2923
  // src/services/purchases/models/create-purchase-v2-ok-response-purchase.ts
2737
- import { z as z13 } from "zod";
2738
- var createPurchaseV2OkResponsePurchase = z13.lazy(() => {
2739
- return z13.object({
2740
- id: z13.string(),
2741
- packageId: z13.string(),
2742
- createdDate: z13.string()
2924
+ import { z as z12 } from "zod";
2925
+ var createPurchaseV2OkResponsePurchase = z12.lazy(() => {
2926
+ return z12.object({
2927
+ id: z12.string(),
2928
+ packageId: z12.string(),
2929
+ createdDate: z12.string()
2743
2930
  });
2744
2931
  });
2745
- var createPurchaseV2OkResponsePurchaseResponse = z13.lazy(() => {
2746
- return z13.object({
2747
- id: z13.string(),
2748
- packageId: z13.string(),
2749
- createdDate: z13.string()
2932
+ var createPurchaseV2OkResponsePurchaseResponse = z12.lazy(() => {
2933
+ return z12.object({
2934
+ id: z12.string(),
2935
+ packageId: z12.string(),
2936
+ createdDate: z12.string()
2750
2937
  }).transform((data) => ({
2751
2938
  id: data["id"],
2752
2939
  packageId: data["packageId"],
2753
2940
  createdDate: data["createdDate"]
2754
2941
  }));
2755
2942
  });
2756
- var createPurchaseV2OkResponsePurchaseRequest = z13.lazy(() => {
2757
- return z13.object({
2758
- id: z13.string(),
2759
- packageId: z13.string(),
2760
- createdDate: z13.string()
2943
+ var createPurchaseV2OkResponsePurchaseRequest = z12.lazy(() => {
2944
+ return z12.object({
2945
+ id: z12.string(),
2946
+ packageId: z12.string(),
2947
+ createdDate: z12.string()
2761
2948
  }).transform((data) => ({
2762
2949
  id: data["id"],
2763
2950
  packageId: data["packageId"],
@@ -2766,23 +2953,23 @@ var createPurchaseV2OkResponsePurchaseRequest = z13.lazy(() => {
2766
2953
  });
2767
2954
 
2768
2955
  // src/services/purchases/models/create-purchase-v2-ok-response-profile.ts
2769
- import { z as z14 } from "zod";
2770
- var createPurchaseV2OkResponseProfile = z14.lazy(() => {
2771
- return z14.object({
2772
- iccid: z14.string().min(18).max(22),
2773
- activationCode: z14.string().min(1e3).max(8e3),
2774
- manualActivationCode: z14.string(),
2775
- iosActivationLink: z14.string(),
2776
- androidActivationLink: z14.string()
2956
+ import { z as z13 } from "zod";
2957
+ var createPurchaseV2OkResponseProfile = z13.lazy(() => {
2958
+ return z13.object({
2959
+ iccid: z13.string().min(18).max(22),
2960
+ activationCode: z13.string().min(1e3).max(8e3),
2961
+ manualActivationCode: z13.string(),
2962
+ iosActivationLink: z13.string(),
2963
+ androidActivationLink: z13.string()
2777
2964
  });
2778
2965
  });
2779
- var createPurchaseV2OkResponseProfileResponse = z14.lazy(() => {
2780
- return z14.object({
2781
- iccid: z14.string().min(18).max(22),
2782
- activationCode: z14.string().min(1e3).max(8e3),
2783
- manualActivationCode: z14.string(),
2784
- iosActivationLink: z14.string(),
2785
- androidActivationLink: z14.string()
2966
+ var createPurchaseV2OkResponseProfileResponse = z13.lazy(() => {
2967
+ return z13.object({
2968
+ iccid: z13.string().min(18).max(22),
2969
+ activationCode: z13.string().min(1e3).max(8e3),
2970
+ manualActivationCode: z13.string(),
2971
+ iosActivationLink: z13.string(),
2972
+ androidActivationLink: z13.string()
2786
2973
  }).transform((data) => ({
2787
2974
  iccid: data["iccid"],
2788
2975
  activationCode: data["activationCode"],
@@ -2791,13 +2978,13 @@ var createPurchaseV2OkResponseProfileResponse = z14.lazy(() => {
2791
2978
  androidActivationLink: data["androidActivationLink"]
2792
2979
  }));
2793
2980
  });
2794
- var createPurchaseV2OkResponseProfileRequest = z14.lazy(() => {
2795
- return z14.object({
2796
- iccid: z14.string().min(18).max(22),
2797
- activationCode: z14.string().min(1e3).max(8e3),
2798
- manualActivationCode: z14.string(),
2799
- iosActivationLink: z14.string(),
2800
- androidActivationLink: z14.string()
2981
+ var createPurchaseV2OkResponseProfileRequest = z13.lazy(() => {
2982
+ return z13.object({
2983
+ iccid: z13.string().min(18).max(22),
2984
+ activationCode: z13.string().min(1e3).max(8e3),
2985
+ manualActivationCode: z13.string(),
2986
+ iosActivationLink: z13.string(),
2987
+ androidActivationLink: z13.string()
2801
2988
  }).transform((data) => ({
2802
2989
  iccid: data["iccid"],
2803
2990
  activationCode: data["activationCode"],
@@ -2808,14 +2995,14 @@ var createPurchaseV2OkResponseProfileRequest = z14.lazy(() => {
2808
2995
  });
2809
2996
 
2810
2997
  // src/services/purchases/models/create-purchase-v2-ok-response.ts
2811
- var createPurchaseV2OkResponse = z15.lazy(() => {
2812
- return z15.object({
2998
+ var createPurchaseV2OkResponse = z14.lazy(() => {
2999
+ return z14.object({
2813
3000
  purchase: createPurchaseV2OkResponsePurchase,
2814
3001
  profile: createPurchaseV2OkResponseProfile
2815
3002
  });
2816
3003
  });
2817
- var createPurchaseV2OkResponseResponse = z15.lazy(() => {
2818
- return z15.object({
3004
+ var createPurchaseV2OkResponseResponse = z14.lazy(() => {
3005
+ return z14.object({
2819
3006
  purchase: createPurchaseV2OkResponsePurchaseResponse,
2820
3007
  profile: createPurchaseV2OkResponseProfileResponse
2821
3008
  }).transform((data) => ({
@@ -2823,8 +3010,8 @@ var createPurchaseV2OkResponseResponse = z15.lazy(() => {
2823
3010
  profile: data["profile"]
2824
3011
  }));
2825
3012
  });
2826
- var createPurchaseV2OkResponseRequest = z15.lazy(() => {
2827
- return z15.object({
3013
+ var createPurchaseV2OkResponseRequest = z14.lazy(() => {
3014
+ return z14.object({
2828
3015
  purchase: createPurchaseV2OkResponsePurchaseRequest,
2829
3016
  profile: createPurchaseV2OkResponseProfileRequest
2830
3017
  }).transform((data) => ({
@@ -2834,33 +3021,33 @@ var createPurchaseV2OkResponseRequest = z15.lazy(() => {
2834
3021
  });
2835
3022
 
2836
3023
  // src/services/purchases/models/list-purchases-ok-response.ts
2837
- import { z as z19 } from "zod";
3024
+ import { z as z18 } from "zod";
2838
3025
 
2839
3026
  // src/services/purchases/models/purchases.ts
2840
- import { z as z18 } from "zod";
3027
+ import { z as z17 } from "zod";
2841
3028
 
2842
3029
  // src/services/purchases/models/package_.ts
2843
- import { z as z16 } from "zod";
2844
- var package_ = z16.lazy(() => {
2845
- return z16.object({
2846
- id: z16.string(),
2847
- dataLimitInBytes: z16.number(),
2848
- dataLimitInGb: z16.number(),
2849
- destination: z16.string(),
2850
- destinationIso2: z16.string(),
2851
- destinationName: z16.string(),
2852
- priceInCents: z16.number()
3030
+ import { z as z15 } from "zod";
3031
+ var package_ = z15.lazy(() => {
3032
+ return z15.object({
3033
+ id: z15.string(),
3034
+ dataLimitInBytes: z15.number(),
3035
+ dataLimitInGb: z15.number(),
3036
+ destination: z15.string(),
3037
+ destinationIso2: z15.string(),
3038
+ destinationName: z15.string(),
3039
+ priceInCents: z15.number()
2853
3040
  });
2854
3041
  });
2855
- var packageResponse = z16.lazy(() => {
2856
- return z16.object({
2857
- id: z16.string(),
2858
- dataLimitInBytes: z16.number(),
2859
- dataLimitInGB: z16.number(),
2860
- destination: z16.string(),
2861
- destinationISO2: z16.string(),
2862
- destinationName: z16.string(),
2863
- priceInCents: z16.number()
3042
+ var packageResponse = z15.lazy(() => {
3043
+ return z15.object({
3044
+ id: z15.string(),
3045
+ dataLimitInBytes: z15.number(),
3046
+ dataLimitInGB: z15.number(),
3047
+ destination: z15.string(),
3048
+ destinationISO2: z15.string(),
3049
+ destinationName: z15.string(),
3050
+ priceInCents: z15.number()
2864
3051
  }).transform((data) => ({
2865
3052
  id: data["id"],
2866
3053
  dataLimitInBytes: data["dataLimitInBytes"],
@@ -2871,15 +3058,15 @@ var packageResponse = z16.lazy(() => {
2871
3058
  priceInCents: data["priceInCents"]
2872
3059
  }));
2873
3060
  });
2874
- var packageRequest = z16.lazy(() => {
2875
- return z16.object({
2876
- id: z16.string(),
2877
- dataLimitInBytes: z16.number(),
2878
- dataLimitInGb: z16.number(),
2879
- destination: z16.string(),
2880
- destinationIso2: z16.string(),
2881
- destinationName: z16.string(),
2882
- priceInCents: z16.number()
3061
+ var packageRequest = z15.lazy(() => {
3062
+ return z15.object({
3063
+ id: z15.string(),
3064
+ dataLimitInBytes: z15.number(),
3065
+ dataLimitInGb: z15.number(),
3066
+ destination: z15.string(),
3067
+ destinationIso2: z15.string(),
3068
+ destinationName: z15.string(),
3069
+ priceInCents: z15.number()
2883
3070
  }).transform((data) => ({
2884
3071
  id: data["id"],
2885
3072
  dataLimitInBytes: data["dataLimitInBytes"],
@@ -2892,60 +3079,60 @@ var packageRequest = z16.lazy(() => {
2892
3079
  });
2893
3080
 
2894
3081
  // src/services/purchases/models/purchases-esim.ts
2895
- import { z as z17 } from "zod";
2896
- var purchasesEsim = z17.lazy(() => {
2897
- return z17.object({
2898
- iccid: z17.string().min(18).max(22)
3082
+ import { z as z16 } from "zod";
3083
+ var purchasesEsim = z16.lazy(() => {
3084
+ return z16.object({
3085
+ iccid: z16.string().min(18).max(22)
2899
3086
  });
2900
3087
  });
2901
- var purchasesEsimResponse = z17.lazy(() => {
2902
- return z17.object({
2903
- iccid: z17.string().min(18).max(22)
3088
+ var purchasesEsimResponse = z16.lazy(() => {
3089
+ return z16.object({
3090
+ iccid: z16.string().min(18).max(22)
2904
3091
  }).transform((data) => ({
2905
3092
  iccid: data["iccid"]
2906
3093
  }));
2907
3094
  });
2908
- var purchasesEsimRequest = z17.lazy(() => {
2909
- return z17.object({
2910
- iccid: z17.string().min(18).max(22)
3095
+ var purchasesEsimRequest = z16.lazy(() => {
3096
+ return z16.object({
3097
+ iccid: z16.string().min(18).max(22)
2911
3098
  }).transform((data) => ({
2912
3099
  iccid: data["iccid"]
2913
3100
  }));
2914
3101
  });
2915
3102
 
2916
3103
  // src/services/purchases/models/purchases.ts
2917
- var purchases = z18.lazy(() => {
2918
- return z18.object({
2919
- id: z18.string(),
2920
- startDate: z18.string().nullable(),
2921
- endDate: z18.string().nullable(),
2922
- duration: z18.number().optional().nullable(),
2923
- createdDate: z18.string(),
2924
- startTime: z18.number().optional().nullable(),
2925
- endTime: z18.number().optional().nullable(),
2926
- createdAt: z18.number().optional(),
3104
+ var purchases = z17.lazy(() => {
3105
+ return z17.object({
3106
+ id: z17.string(),
3107
+ startDate: z17.string().nullable(),
3108
+ endDate: z17.string().nullable(),
3109
+ duration: z17.number().optional().nullable(),
3110
+ createdDate: z17.string(),
3111
+ startTime: z17.number().optional().nullable(),
3112
+ endTime: z17.number().optional().nullable(),
3113
+ createdAt: z17.number().optional(),
2927
3114
  package: package_,
2928
3115
  esim: purchasesEsim,
2929
- source: z18.string(),
2930
- purchaseType: z18.string(),
2931
- referenceId: z18.string().optional().nullable()
3116
+ source: z17.string(),
3117
+ purchaseType: z17.string(),
3118
+ referenceId: z17.string().optional().nullable()
2932
3119
  });
2933
3120
  });
2934
- var purchasesResponse = z18.lazy(() => {
2935
- return z18.object({
2936
- id: z18.string(),
2937
- startDate: z18.string().nullable(),
2938
- endDate: z18.string().nullable(),
2939
- duration: z18.number().optional().nullable(),
2940
- createdDate: z18.string(),
2941
- startTime: z18.number().optional().nullable(),
2942
- endTime: z18.number().optional().nullable(),
2943
- createdAt: z18.number().optional(),
3121
+ var purchasesResponse = z17.lazy(() => {
3122
+ return z17.object({
3123
+ id: z17.string(),
3124
+ startDate: z17.string().nullable(),
3125
+ endDate: z17.string().nullable(),
3126
+ duration: z17.number().optional().nullable(),
3127
+ createdDate: z17.string(),
3128
+ startTime: z17.number().optional().nullable(),
3129
+ endTime: z17.number().optional().nullable(),
3130
+ createdAt: z17.number().optional(),
2944
3131
  package: packageResponse,
2945
3132
  esim: purchasesEsimResponse,
2946
- source: z18.string(),
2947
- purchaseType: z18.string(),
2948
- referenceId: z18.string().optional().nullable()
3133
+ source: z17.string(),
3134
+ purchaseType: z17.string(),
3135
+ referenceId: z17.string().optional().nullable()
2949
3136
  }).transform((data) => ({
2950
3137
  id: data["id"],
2951
3138
  startDate: data["startDate"],
@@ -2962,21 +3149,21 @@ var purchasesResponse = z18.lazy(() => {
2962
3149
  referenceId: data["referenceId"]
2963
3150
  }));
2964
3151
  });
2965
- var purchasesRequest = z18.lazy(() => {
2966
- return z18.object({
2967
- id: z18.string(),
2968
- startDate: z18.string().nullable(),
2969
- endDate: z18.string().nullable(),
2970
- duration: z18.number().optional().nullable(),
2971
- createdDate: z18.string(),
2972
- startTime: z18.number().optional().nullable(),
2973
- endTime: z18.number().optional().nullable(),
2974
- createdAt: z18.number().optional(),
3152
+ var purchasesRequest = z17.lazy(() => {
3153
+ return z17.object({
3154
+ id: z17.string(),
3155
+ startDate: z17.string().nullable(),
3156
+ endDate: z17.string().nullable(),
3157
+ duration: z17.number().optional().nullable(),
3158
+ createdDate: z17.string(),
3159
+ startTime: z17.number().optional().nullable(),
3160
+ endTime: z17.number().optional().nullable(),
3161
+ createdAt: z17.number().optional(),
2975
3162
  package: packageRequest,
2976
3163
  esim: purchasesEsimRequest,
2977
- source: z18.string(),
2978
- purchaseType: z18.string(),
2979
- referenceId: z18.string().optional().nullable()
3164
+ source: z17.string(),
3165
+ purchaseType: z17.string(),
3166
+ referenceId: z17.string().optional().nullable()
2980
3167
  }).transform((data) => ({
2981
3168
  id: data["id"],
2982
3169
  startDate: data["startDate"],
@@ -2995,25 +3182,25 @@ var purchasesRequest = z18.lazy(() => {
2995
3182
  });
2996
3183
 
2997
3184
  // src/services/purchases/models/list-purchases-ok-response.ts
2998
- var listPurchasesOkResponse = z19.lazy(() => {
2999
- return z19.object({
3000
- purchases: z19.array(purchases),
3001
- afterCursor: z19.string().nullable()
3185
+ var listPurchasesOkResponse = z18.lazy(() => {
3186
+ return z18.object({
3187
+ purchases: z18.array(purchases),
3188
+ afterCursor: z18.string().nullable()
3002
3189
  });
3003
3190
  });
3004
- var listPurchasesOkResponseResponse = z19.lazy(() => {
3005
- return z19.object({
3006
- purchases: z19.array(purchasesResponse),
3007
- afterCursor: z19.string().nullable()
3191
+ var listPurchasesOkResponseResponse = z18.lazy(() => {
3192
+ return z18.object({
3193
+ purchases: z18.array(purchasesResponse),
3194
+ afterCursor: z18.string().nullable()
3008
3195
  }).transform((data) => ({
3009
3196
  purchases: data["purchases"],
3010
3197
  afterCursor: data["afterCursor"]
3011
3198
  }));
3012
3199
  });
3013
- var listPurchasesOkResponseRequest = z19.lazy(() => {
3014
- return z19.object({
3015
- purchases: z19.array(purchasesRequest),
3016
- afterCursor: z19.string().nullable()
3200
+ var listPurchasesOkResponseRequest = z18.lazy(() => {
3201
+ return z18.object({
3202
+ purchases: z18.array(purchasesRequest),
3203
+ afterCursor: z18.string().nullable()
3017
3204
  }).transform((data) => ({
3018
3205
  purchases: data["purchases"],
3019
3206
  afterCursor: data["afterCursor"]
@@ -3021,35 +3208,35 @@ var listPurchasesOkResponseRequest = z19.lazy(() => {
3021
3208
  });
3022
3209
 
3023
3210
  // src/services/purchases/models/create-purchase-request.ts
3024
- import { z as z20 } from "zod";
3025
- var createPurchaseRequest = z20.lazy(() => {
3026
- return z20.object({
3027
- destination: z20.string(),
3028
- dataLimitInGb: z20.number(),
3029
- startDate: z20.string(),
3030
- endDate: z20.string(),
3031
- email: z20.string().optional(),
3032
- referenceId: z20.string().optional(),
3033
- networkBrand: z20.string().optional(),
3034
- emailBrand: z20.string().optional(),
3035
- language: z20.string().optional(),
3036
- startTime: z20.number().optional(),
3037
- endTime: z20.number().optional()
3211
+ import { z as z19 } from "zod";
3212
+ var createPurchaseRequest = z19.lazy(() => {
3213
+ return z19.object({
3214
+ destination: z19.string(),
3215
+ dataLimitInGb: z19.number(),
3216
+ startDate: z19.string(),
3217
+ endDate: z19.string(),
3218
+ email: z19.string().optional(),
3219
+ referenceId: z19.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
3220
+ networkBrand: z19.string().optional(),
3221
+ emailBrand: z19.string().optional(),
3222
+ language: z19.string().optional(),
3223
+ startTime: z19.number().optional(),
3224
+ endTime: z19.number().optional()
3038
3225
  });
3039
3226
  });
3040
- var createPurchaseRequestResponse = z20.lazy(() => {
3041
- return z20.object({
3042
- destination: z20.string(),
3043
- dataLimitInGB: z20.number(),
3044
- startDate: z20.string(),
3045
- endDate: z20.string(),
3046
- email: z20.string().optional(),
3047
- referenceId: z20.string().optional(),
3048
- networkBrand: z20.string().optional(),
3049
- emailBrand: z20.string().optional(),
3050
- language: z20.string().optional(),
3051
- startTime: z20.number().optional(),
3052
- endTime: z20.number().optional()
3227
+ var createPurchaseRequestResponse = z19.lazy(() => {
3228
+ return z19.object({
3229
+ destination: z19.string(),
3230
+ dataLimitInGB: z19.number(),
3231
+ startDate: z19.string(),
3232
+ endDate: z19.string(),
3233
+ email: z19.string().optional(),
3234
+ referenceId: z19.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
3235
+ networkBrand: z19.string().optional(),
3236
+ emailBrand: z19.string().optional(),
3237
+ language: z19.string().optional(),
3238
+ startTime: z19.number().optional(),
3239
+ endTime: z19.number().optional()
3053
3240
  }).transform((data) => ({
3054
3241
  destination: data["destination"],
3055
3242
  dataLimitInGb: data["dataLimitInGB"],
@@ -3064,19 +3251,19 @@ var createPurchaseRequestResponse = z20.lazy(() => {
3064
3251
  endTime: data["endTime"]
3065
3252
  }));
3066
3253
  });
3067
- var createPurchaseRequestRequest = z20.lazy(() => {
3068
- return z20.object({
3069
- destination: z20.string(),
3070
- dataLimitInGb: z20.number(),
3071
- startDate: z20.string(),
3072
- endDate: z20.string(),
3073
- email: z20.string().optional(),
3074
- referenceId: z20.string().optional(),
3075
- networkBrand: z20.string().optional(),
3076
- emailBrand: z20.string().optional(),
3077
- language: z20.string().optional(),
3078
- startTime: z20.number().optional(),
3079
- endTime: z20.number().optional()
3254
+ var createPurchaseRequestRequest = z19.lazy(() => {
3255
+ return z19.object({
3256
+ destination: z19.string(),
3257
+ dataLimitInGb: z19.number(),
3258
+ startDate: z19.string(),
3259
+ endDate: z19.string(),
3260
+ email: z19.string().optional(),
3261
+ referenceId: z19.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
3262
+ networkBrand: z19.string().optional(),
3263
+ emailBrand: z19.string().optional(),
3264
+ language: z19.string().optional(),
3265
+ startTime: z19.number().optional(),
3266
+ endTime: z19.number().optional()
3080
3267
  }).transform((data) => ({
3081
3268
  destination: data["destination"],
3082
3269
  dataLimitInGB: data["dataLimitInGb"],
@@ -3093,30 +3280,30 @@ var createPurchaseRequestRequest = z20.lazy(() => {
3093
3280
  });
3094
3281
 
3095
3282
  // src/services/purchases/models/create-purchase-ok-response.ts
3096
- import { z as z23 } from "zod";
3283
+ import { z as z22 } from "zod";
3097
3284
 
3098
3285
  // src/services/purchases/models/create-purchase-ok-response-purchase.ts
3099
- import { z as z21 } from "zod";
3100
- var createPurchaseOkResponsePurchase = z21.lazy(() => {
3101
- return z21.object({
3102
- id: z21.string(),
3103
- packageId: z21.string(),
3104
- startDate: z21.string().nullable(),
3105
- endDate: z21.string().nullable(),
3106
- createdDate: z21.string(),
3107
- startTime: z21.number().optional().nullable(),
3108
- endTime: z21.number().optional().nullable()
3286
+ import { z as z20 } from "zod";
3287
+ var createPurchaseOkResponsePurchase = z20.lazy(() => {
3288
+ return z20.object({
3289
+ id: z20.string(),
3290
+ packageId: z20.string(),
3291
+ startDate: z20.string().nullable(),
3292
+ endDate: z20.string().nullable(),
3293
+ createdDate: z20.string(),
3294
+ startTime: z20.number().optional().nullable(),
3295
+ endTime: z20.number().optional().nullable()
3109
3296
  });
3110
3297
  });
3111
- var createPurchaseOkResponsePurchaseResponse = z21.lazy(() => {
3112
- return z21.object({
3113
- id: z21.string(),
3114
- packageId: z21.string(),
3115
- startDate: z21.string().nullable(),
3116
- endDate: z21.string().nullable(),
3117
- createdDate: z21.string(),
3118
- startTime: z21.number().optional().nullable(),
3119
- endTime: z21.number().optional().nullable()
3298
+ var createPurchaseOkResponsePurchaseResponse = z20.lazy(() => {
3299
+ return z20.object({
3300
+ id: z20.string(),
3301
+ packageId: z20.string(),
3302
+ startDate: z20.string().nullable(),
3303
+ endDate: z20.string().nullable(),
3304
+ createdDate: z20.string(),
3305
+ startTime: z20.number().optional().nullable(),
3306
+ endTime: z20.number().optional().nullable()
3120
3307
  }).transform((data) => ({
3121
3308
  id: data["id"],
3122
3309
  packageId: data["packageId"],
@@ -3127,15 +3314,15 @@ var createPurchaseOkResponsePurchaseResponse = z21.lazy(() => {
3127
3314
  endTime: data["endTime"]
3128
3315
  }));
3129
3316
  });
3130
- var createPurchaseOkResponsePurchaseRequest = z21.lazy(() => {
3131
- return z21.object({
3132
- id: z21.string(),
3133
- packageId: z21.string(),
3134
- startDate: z21.string().nullable(),
3135
- endDate: z21.string().nullable(),
3136
- createdDate: z21.string(),
3137
- startTime: z21.number().optional().nullable(),
3138
- endTime: z21.number().optional().nullable()
3317
+ var createPurchaseOkResponsePurchaseRequest = z20.lazy(() => {
3318
+ return z20.object({
3319
+ id: z20.string(),
3320
+ packageId: z20.string(),
3321
+ startDate: z20.string().nullable(),
3322
+ endDate: z20.string().nullable(),
3323
+ createdDate: z20.string(),
3324
+ startTime: z20.number().optional().nullable(),
3325
+ endTime: z20.number().optional().nullable()
3139
3326
  }).transform((data) => ({
3140
3327
  id: data["id"],
3141
3328
  packageId: data["packageId"],
@@ -3148,30 +3335,30 @@ var createPurchaseOkResponsePurchaseRequest = z21.lazy(() => {
3148
3335
  });
3149
3336
 
3150
3337
  // src/services/purchases/models/create-purchase-ok-response-profile.ts
3151
- import { z as z22 } from "zod";
3152
- var createPurchaseOkResponseProfile = z22.lazy(() => {
3153
- return z22.object({
3154
- iccid: z22.string().min(18).max(22),
3155
- activationCode: z22.string().min(1e3).max(8e3),
3156
- manualActivationCode: z22.string()
3338
+ import { z as z21 } from "zod";
3339
+ var createPurchaseOkResponseProfile = z21.lazy(() => {
3340
+ return z21.object({
3341
+ iccid: z21.string().min(18).max(22),
3342
+ activationCode: z21.string().min(1e3).max(8e3),
3343
+ manualActivationCode: z21.string()
3157
3344
  });
3158
3345
  });
3159
- var createPurchaseOkResponseProfileResponse = z22.lazy(() => {
3160
- return z22.object({
3161
- iccid: z22.string().min(18).max(22),
3162
- activationCode: z22.string().min(1e3).max(8e3),
3163
- manualActivationCode: z22.string()
3346
+ var createPurchaseOkResponseProfileResponse = z21.lazy(() => {
3347
+ return z21.object({
3348
+ iccid: z21.string().min(18).max(22),
3349
+ activationCode: z21.string().min(1e3).max(8e3),
3350
+ manualActivationCode: z21.string()
3164
3351
  }).transform((data) => ({
3165
3352
  iccid: data["iccid"],
3166
3353
  activationCode: data["activationCode"],
3167
3354
  manualActivationCode: data["manualActivationCode"]
3168
3355
  }));
3169
3356
  });
3170
- var createPurchaseOkResponseProfileRequest = z22.lazy(() => {
3171
- return z22.object({
3172
- iccid: z22.string().min(18).max(22),
3173
- activationCode: z22.string().min(1e3).max(8e3),
3174
- manualActivationCode: z22.string()
3357
+ var createPurchaseOkResponseProfileRequest = z21.lazy(() => {
3358
+ return z21.object({
3359
+ iccid: z21.string().min(18).max(22),
3360
+ activationCode: z21.string().min(1e3).max(8e3),
3361
+ manualActivationCode: z21.string()
3175
3362
  }).transform((data) => ({
3176
3363
  iccid: data["iccid"],
3177
3364
  activationCode: data["activationCode"],
@@ -3180,14 +3367,14 @@ var createPurchaseOkResponseProfileRequest = z22.lazy(() => {
3180
3367
  });
3181
3368
 
3182
3369
  // src/services/purchases/models/create-purchase-ok-response.ts
3183
- var createPurchaseOkResponse = z23.lazy(() => {
3184
- return z23.object({
3370
+ var createPurchaseOkResponse = z22.lazy(() => {
3371
+ return z22.object({
3185
3372
  purchase: createPurchaseOkResponsePurchase,
3186
3373
  profile: createPurchaseOkResponseProfile
3187
3374
  });
3188
3375
  });
3189
- var createPurchaseOkResponseResponse = z23.lazy(() => {
3190
- return z23.object({
3376
+ var createPurchaseOkResponseResponse = z22.lazy(() => {
3377
+ return z22.object({
3191
3378
  purchase: createPurchaseOkResponsePurchaseResponse,
3192
3379
  profile: createPurchaseOkResponseProfileResponse
3193
3380
  }).transform((data) => ({
@@ -3195,8 +3382,8 @@ var createPurchaseOkResponseResponse = z23.lazy(() => {
3195
3382
  profile: data["profile"]
3196
3383
  }));
3197
3384
  });
3198
- var createPurchaseOkResponseRequest = z23.lazy(() => {
3199
- return z23.object({
3385
+ var createPurchaseOkResponseRequest = z22.lazy(() => {
3386
+ return z22.object({
3200
3387
  purchase: createPurchaseOkResponsePurchaseRequest,
3201
3388
  profile: createPurchaseOkResponseProfileRequest
3202
3389
  }).transform((data) => ({
@@ -3206,33 +3393,33 @@ var createPurchaseOkResponseRequest = z23.lazy(() => {
3206
3393
  });
3207
3394
 
3208
3395
  // src/services/purchases/models/top-up-esim-request.ts
3209
- import { z as z24 } from "zod";
3210
- var topUpEsimRequest = z24.lazy(() => {
3211
- return z24.object({
3212
- iccid: z24.string().min(18).max(22),
3213
- dataLimitInGb: z24.number(),
3214
- startDate: z24.string().optional(),
3215
- endDate: z24.string().optional(),
3216
- duration: z24.number().optional(),
3217
- email: z24.string().optional(),
3218
- referenceId: z24.string().optional(),
3219
- emailBrand: z24.string().optional(),
3220
- startTime: z24.number().optional(),
3221
- endTime: z24.number().optional()
3396
+ import { z as z23 } from "zod";
3397
+ var topUpEsimRequest = z23.lazy(() => {
3398
+ return z23.object({
3399
+ iccid: z23.string().min(18).max(22),
3400
+ dataLimitInGb: z23.number(),
3401
+ startDate: z23.string().optional(),
3402
+ endDate: z23.string().optional(),
3403
+ duration: z23.number().optional(),
3404
+ email: z23.string().optional(),
3405
+ referenceId: z23.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
3406
+ emailBrand: z23.string().optional(),
3407
+ startTime: z23.number().optional(),
3408
+ endTime: z23.number().optional()
3222
3409
  });
3223
3410
  });
3224
- var topUpEsimRequestResponse = z24.lazy(() => {
3225
- return z24.object({
3226
- iccid: z24.string().min(18).max(22),
3227
- dataLimitInGB: z24.number(),
3228
- startDate: z24.string().optional(),
3229
- endDate: z24.string().optional(),
3230
- duration: z24.number().optional(),
3231
- email: z24.string().optional(),
3232
- referenceId: z24.string().optional(),
3233
- emailBrand: z24.string().optional(),
3234
- startTime: z24.number().optional(),
3235
- endTime: z24.number().optional()
3411
+ var topUpEsimRequestResponse = z23.lazy(() => {
3412
+ return z23.object({
3413
+ iccid: z23.string().min(18).max(22),
3414
+ dataLimitInGB: z23.number(),
3415
+ startDate: z23.string().optional(),
3416
+ endDate: z23.string().optional(),
3417
+ duration: z23.number().optional(),
3418
+ email: z23.string().optional(),
3419
+ referenceId: z23.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
3420
+ emailBrand: z23.string().optional(),
3421
+ startTime: z23.number().optional(),
3422
+ endTime: z23.number().optional()
3236
3423
  }).transform((data) => ({
3237
3424
  iccid: data["iccid"],
3238
3425
  dataLimitInGb: data["dataLimitInGB"],
@@ -3246,18 +3433,18 @@ var topUpEsimRequestResponse = z24.lazy(() => {
3246
3433
  endTime: data["endTime"]
3247
3434
  }));
3248
3435
  });
3249
- var topUpEsimRequestRequest = z24.lazy(() => {
3250
- return z24.object({
3251
- iccid: z24.string().min(18).max(22),
3252
- dataLimitInGb: z24.number(),
3253
- startDate: z24.string().optional(),
3254
- endDate: z24.string().optional(),
3255
- duration: z24.number().optional(),
3256
- email: z24.string().optional(),
3257
- referenceId: z24.string().optional(),
3258
- emailBrand: z24.string().optional(),
3259
- startTime: z24.number().optional(),
3260
- endTime: z24.number().optional()
3436
+ var topUpEsimRequestRequest = z23.lazy(() => {
3437
+ return z23.object({
3438
+ iccid: z23.string().min(18).max(22),
3439
+ dataLimitInGb: z23.number(),
3440
+ startDate: z23.string().optional(),
3441
+ endDate: z23.string().optional(),
3442
+ duration: z23.number().optional(),
3443
+ email: z23.string().optional(),
3444
+ referenceId: z23.string().max(255).regex(/^[a-zA-Z0-9\-_.@+]+$/).optional(),
3445
+ emailBrand: z23.string().optional(),
3446
+ startTime: z23.number().optional(),
3447
+ endTime: z23.number().optional()
3261
3448
  }).transform((data) => ({
3262
3449
  iccid: data["iccid"],
3263
3450
  dataLimitInGB: data["dataLimitInGb"],
@@ -3273,30 +3460,30 @@ var topUpEsimRequestRequest = z24.lazy(() => {
3273
3460
  });
3274
3461
 
3275
3462
  // src/services/purchases/models/top-up-esim-ok-response.ts
3276
- import { z as z27 } from "zod";
3463
+ import { z as z26 } from "zod";
3277
3464
 
3278
3465
  // src/services/purchases/models/top-up-esim-ok-response-purchase.ts
3279
- import { z as z25 } from "zod";
3280
- var topUpEsimOkResponsePurchase = z25.lazy(() => {
3281
- return z25.object({
3282
- id: z25.string(),
3283
- packageId: z25.string(),
3284
- startDate: z25.string().nullable(),
3285
- endDate: z25.string().nullable(),
3286
- createdDate: z25.string(),
3287
- startTime: z25.number().optional().nullable(),
3288
- endTime: z25.number().optional().nullable()
3466
+ import { z as z24 } from "zod";
3467
+ var topUpEsimOkResponsePurchase = z24.lazy(() => {
3468
+ return z24.object({
3469
+ id: z24.string(),
3470
+ packageId: z24.string(),
3471
+ startDate: z24.string().nullable(),
3472
+ endDate: z24.string().nullable(),
3473
+ createdDate: z24.string(),
3474
+ startTime: z24.number().optional().nullable(),
3475
+ endTime: z24.number().optional().nullable()
3289
3476
  });
3290
3477
  });
3291
- var topUpEsimOkResponsePurchaseResponse = z25.lazy(() => {
3292
- return z25.object({
3293
- id: z25.string(),
3294
- packageId: z25.string(),
3295
- startDate: z25.string().nullable(),
3296
- endDate: z25.string().nullable(),
3297
- createdDate: z25.string(),
3298
- startTime: z25.number().optional().nullable(),
3299
- endTime: z25.number().optional().nullable()
3478
+ var topUpEsimOkResponsePurchaseResponse = z24.lazy(() => {
3479
+ return z24.object({
3480
+ id: z24.string(),
3481
+ packageId: z24.string(),
3482
+ startDate: z24.string().nullable(),
3483
+ endDate: z24.string().nullable(),
3484
+ createdDate: z24.string(),
3485
+ startTime: z24.number().optional().nullable(),
3486
+ endTime: z24.number().optional().nullable()
3300
3487
  }).transform((data) => ({
3301
3488
  id: data["id"],
3302
3489
  packageId: data["packageId"],
@@ -3307,15 +3494,15 @@ var topUpEsimOkResponsePurchaseResponse = z25.lazy(() => {
3307
3494
  endTime: data["endTime"]
3308
3495
  }));
3309
3496
  });
3310
- var topUpEsimOkResponsePurchaseRequest = z25.lazy(() => {
3311
- return z25.object({
3312
- id: z25.string(),
3313
- packageId: z25.string(),
3314
- startDate: z25.string().nullable(),
3315
- endDate: z25.string().nullable(),
3316
- createdDate: z25.string(),
3317
- startTime: z25.number().optional().nullable(),
3318
- endTime: z25.number().optional().nullable()
3497
+ var topUpEsimOkResponsePurchaseRequest = z24.lazy(() => {
3498
+ return z24.object({
3499
+ id: z24.string(),
3500
+ packageId: z24.string(),
3501
+ startDate: z24.string().nullable(),
3502
+ endDate: z24.string().nullable(),
3503
+ createdDate: z24.string(),
3504
+ startTime: z24.number().optional().nullable(),
3505
+ endTime: z24.number().optional().nullable()
3319
3506
  }).transform((data) => ({
3320
3507
  id: data["id"],
3321
3508
  packageId: data["packageId"],
@@ -3328,36 +3515,36 @@ var topUpEsimOkResponsePurchaseRequest = z25.lazy(() => {
3328
3515
  });
3329
3516
 
3330
3517
  // src/services/purchases/models/top-up-esim-ok-response-profile.ts
3331
- import { z as z26 } from "zod";
3332
- var topUpEsimOkResponseProfile = z26.lazy(() => {
3333
- return z26.object({
3334
- iccid: z26.string().min(18).max(22)
3518
+ import { z as z25 } from "zod";
3519
+ var topUpEsimOkResponseProfile = z25.lazy(() => {
3520
+ return z25.object({
3521
+ iccid: z25.string().min(18).max(22)
3335
3522
  });
3336
3523
  });
3337
- var topUpEsimOkResponseProfileResponse = z26.lazy(() => {
3338
- return z26.object({
3339
- iccid: z26.string().min(18).max(22)
3524
+ var topUpEsimOkResponseProfileResponse = z25.lazy(() => {
3525
+ return z25.object({
3526
+ iccid: z25.string().min(18).max(22)
3340
3527
  }).transform((data) => ({
3341
3528
  iccid: data["iccid"]
3342
3529
  }));
3343
3530
  });
3344
- var topUpEsimOkResponseProfileRequest = z26.lazy(() => {
3345
- return z26.object({
3346
- iccid: z26.string().min(18).max(22)
3531
+ var topUpEsimOkResponseProfileRequest = z25.lazy(() => {
3532
+ return z25.object({
3533
+ iccid: z25.string().min(18).max(22)
3347
3534
  }).transform((data) => ({
3348
3535
  iccid: data["iccid"]
3349
3536
  }));
3350
3537
  });
3351
3538
 
3352
3539
  // src/services/purchases/models/top-up-esim-ok-response.ts
3353
- var topUpEsimOkResponse = z27.lazy(() => {
3354
- return z27.object({
3540
+ var topUpEsimOkResponse = z26.lazy(() => {
3541
+ return z26.object({
3355
3542
  purchase: topUpEsimOkResponsePurchase,
3356
3543
  profile: topUpEsimOkResponseProfile
3357
3544
  });
3358
3545
  });
3359
- var topUpEsimOkResponseResponse = z27.lazy(() => {
3360
- return z27.object({
3546
+ var topUpEsimOkResponseResponse = z26.lazy(() => {
3547
+ return z26.object({
3361
3548
  purchase: topUpEsimOkResponsePurchaseResponse,
3362
3549
  profile: topUpEsimOkResponseProfileResponse
3363
3550
  }).transform((data) => ({
@@ -3365,8 +3552,8 @@ var topUpEsimOkResponseResponse = z27.lazy(() => {
3365
3552
  profile: data["profile"]
3366
3553
  }));
3367
3554
  });
3368
- var topUpEsimOkResponseRequest = z27.lazy(() => {
3369
- return z27.object({
3555
+ var topUpEsimOkResponseRequest = z26.lazy(() => {
3556
+ return z26.object({
3370
3557
  purchase: topUpEsimOkResponsePurchaseRequest,
3371
3558
  profile: topUpEsimOkResponseProfileRequest
3372
3559
  }).transform((data) => ({
@@ -3376,23 +3563,23 @@ var topUpEsimOkResponseRequest = z27.lazy(() => {
3376
3563
  });
3377
3564
 
3378
3565
  // src/services/purchases/models/edit-purchase-request.ts
3379
- import { z as z28 } from "zod";
3380
- var editPurchaseRequest = z28.lazy(() => {
3381
- return z28.object({
3382
- purchaseId: z28.string(),
3383
- startDate: z28.string(),
3384
- endDate: z28.string(),
3385
- startTime: z28.number().optional(),
3386
- endTime: z28.number().optional()
3566
+ import { z as z27 } from "zod";
3567
+ var editPurchaseRequest = z27.lazy(() => {
3568
+ return z27.object({
3569
+ purchaseId: z27.string(),
3570
+ startDate: z27.string(),
3571
+ endDate: z27.string(),
3572
+ startTime: z27.number().optional(),
3573
+ endTime: z27.number().optional()
3387
3574
  });
3388
3575
  });
3389
- var editPurchaseRequestResponse = z28.lazy(() => {
3390
- return z28.object({
3391
- purchaseId: z28.string(),
3392
- startDate: z28.string(),
3393
- endDate: z28.string(),
3394
- startTime: z28.number().optional(),
3395
- endTime: z28.number().optional()
3576
+ var editPurchaseRequestResponse = z27.lazy(() => {
3577
+ return z27.object({
3578
+ purchaseId: z27.string(),
3579
+ startDate: z27.string(),
3580
+ endDate: z27.string(),
3581
+ startTime: z27.number().optional(),
3582
+ endTime: z27.number().optional()
3396
3583
  }).transform((data) => ({
3397
3584
  purchaseId: data["purchaseId"],
3398
3585
  startDate: data["startDate"],
@@ -3401,13 +3588,13 @@ var editPurchaseRequestResponse = z28.lazy(() => {
3401
3588
  endTime: data["endTime"]
3402
3589
  }));
3403
3590
  });
3404
- var editPurchaseRequestRequest = z28.lazy(() => {
3405
- return z28.object({
3406
- purchaseId: z28.string(),
3407
- startDate: z28.string(),
3408
- endDate: z28.string(),
3409
- startTime: z28.number().optional(),
3410
- endTime: z28.number().optional()
3591
+ var editPurchaseRequestRequest = z27.lazy(() => {
3592
+ return z27.object({
3593
+ purchaseId: z27.string(),
3594
+ startDate: z27.string(),
3595
+ endDate: z27.string(),
3596
+ startTime: z27.number().optional(),
3597
+ endTime: z27.number().optional()
3411
3598
  }).transform((data) => ({
3412
3599
  purchaseId: data["purchaseId"],
3413
3600
  startDate: data["startDate"],
@@ -3418,23 +3605,23 @@ var editPurchaseRequestRequest = z28.lazy(() => {
3418
3605
  });
3419
3606
 
3420
3607
  // src/services/purchases/models/edit-purchase-ok-response.ts
3421
- import { z as z29 } from "zod";
3422
- var editPurchaseOkResponse = z29.lazy(() => {
3423
- return z29.object({
3424
- purchaseId: z29.string(),
3425
- newStartDate: z29.string().nullable(),
3426
- newEndDate: z29.string().nullable(),
3427
- newStartTime: z29.number().optional().nullable(),
3428
- newEndTime: z29.number().optional().nullable()
3608
+ import { z as z28 } from "zod";
3609
+ var editPurchaseOkResponse = z28.lazy(() => {
3610
+ return z28.object({
3611
+ purchaseId: z28.string(),
3612
+ newStartDate: z28.string().nullable(),
3613
+ newEndDate: z28.string().nullable(),
3614
+ newStartTime: z28.number().optional().nullable(),
3615
+ newEndTime: z28.number().optional().nullable()
3429
3616
  });
3430
3617
  });
3431
- var editPurchaseOkResponseResponse = z29.lazy(() => {
3432
- return z29.object({
3433
- purchaseId: z29.string(),
3434
- newStartDate: z29.string().nullable(),
3435
- newEndDate: z29.string().nullable(),
3436
- newStartTime: z29.number().optional().nullable(),
3437
- newEndTime: z29.number().optional().nullable()
3618
+ var editPurchaseOkResponseResponse = z28.lazy(() => {
3619
+ return z28.object({
3620
+ purchaseId: z28.string(),
3621
+ newStartDate: z28.string().nullable(),
3622
+ newEndDate: z28.string().nullable(),
3623
+ newStartTime: z28.number().optional().nullable(),
3624
+ newEndTime: z28.number().optional().nullable()
3438
3625
  }).transform((data) => ({
3439
3626
  purchaseId: data["purchaseId"],
3440
3627
  newStartDate: data["newStartDate"],
@@ -3443,13 +3630,13 @@ var editPurchaseOkResponseResponse = z29.lazy(() => {
3443
3630
  newEndTime: data["newEndTime"]
3444
3631
  }));
3445
3632
  });
3446
- var editPurchaseOkResponseRequest = z29.lazy(() => {
3447
- return z29.object({
3448
- purchaseId: z29.string(),
3449
- newStartDate: z29.string().nullable(),
3450
- newEndDate: z29.string().nullable(),
3451
- newStartTime: z29.number().optional().nullable(),
3452
- newEndTime: z29.number().optional().nullable()
3633
+ var editPurchaseOkResponseRequest = z28.lazy(() => {
3634
+ return z28.object({
3635
+ purchaseId: z28.string(),
3636
+ newStartDate: z28.string().nullable(),
3637
+ newEndDate: z28.string().nullable(),
3638
+ newStartTime: z28.number().optional().nullable(),
3639
+ newEndTime: z28.number().optional().nullable()
3453
3640
  }).transform((data) => ({
3454
3641
  purchaseId: data["purchaseId"],
3455
3642
  newStartDate: data["newStartDate"],
@@ -3460,30 +3647,30 @@ var editPurchaseOkResponseRequest = z29.lazy(() => {
3460
3647
  });
3461
3648
 
3462
3649
  // src/services/purchases/models/get-purchase-consumption-ok-response.ts
3463
- import { z as z30 } from "zod";
3464
- var getPurchaseConsumptionOkResponse = z30.lazy(() => {
3465
- return z30.object({
3466
- dataUsageRemainingInBytes: z30.number(),
3467
- dataUsageRemainingInGb: z30.number(),
3468
- status: z30.string()
3650
+ import { z as z29 } from "zod";
3651
+ var getPurchaseConsumptionOkResponse = z29.lazy(() => {
3652
+ return z29.object({
3653
+ dataUsageRemainingInBytes: z29.number(),
3654
+ dataUsageRemainingInGb: z29.number(),
3655
+ status: z29.string()
3469
3656
  });
3470
3657
  });
3471
- var getPurchaseConsumptionOkResponseResponse = z30.lazy(() => {
3472
- return z30.object({
3473
- dataUsageRemainingInBytes: z30.number(),
3474
- dataUsageRemainingInGB: z30.number(),
3475
- status: z30.string()
3658
+ var getPurchaseConsumptionOkResponseResponse = z29.lazy(() => {
3659
+ return z29.object({
3660
+ dataUsageRemainingInBytes: z29.number(),
3661
+ dataUsageRemainingInGB: z29.number(),
3662
+ status: z29.string()
3476
3663
  }).transform((data) => ({
3477
3664
  dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
3478
3665
  dataUsageRemainingInGb: data["dataUsageRemainingInGB"],
3479
3666
  status: data["status"]
3480
3667
  }));
3481
3668
  });
3482
- var getPurchaseConsumptionOkResponseRequest = z30.lazy(() => {
3483
- return z30.object({
3484
- dataUsageRemainingInBytes: z30.number(),
3485
- dataUsageRemainingInGb: z30.number(),
3486
- status: z30.string()
3669
+ var getPurchaseConsumptionOkResponseRequest = z29.lazy(() => {
3670
+ return z29.object({
3671
+ dataUsageRemainingInBytes: z29.number(),
3672
+ dataUsageRemainingInGb: z29.number(),
3673
+ status: z29.string()
3487
3674
  }).transform((data) => ({
3488
3675
  dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
3489
3676
  dataUsageRemainingInGB: data["dataUsageRemainingInGb"],
@@ -3549,23 +3736,40 @@ var PurchasesService = class extends BaseService {
3549
3736
  }
3550
3737
  /**
3551
3738
  * This endpoint is used to purchase a new eSIM by providing the package details.
3739
+ * @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.
3552
3740
  * @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
3553
3741
  * @returns {Promise<HttpResponse<CreatePurchaseV2OkResponse[]>>} - Successful Response
3554
3742
  */
3555
- async createPurchaseV2(body, requestConfig) {
3743
+ async createPurchaseV2(body, params, requestConfig) {
3556
3744
  const resolvedConfig = this.getResolvedConfig(this.createPurchaseV2Config, requestConfig);
3745
+ z30.object({ idempotencyKey: z30.string().optional() }).parse(params != null ? params : {});
3557
3746
  const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases/v2").setRequestSchema(createPurchaseV2RequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3558
- schema: z31.array(createPurchaseV2OkResponseResponse),
3747
+ schema: z30.array(createPurchaseV2OkResponseResponse),
3559
3748
  contentType: "json" /* Json */,
3560
3749
  status: 200
3561
3750
  }).addError({
3562
- error: BadRequest,
3751
+ error: ErrorResponse,
3563
3752
  contentType: "json" /* Json */,
3564
3753
  status: 400
3565
3754
  }).addError({
3566
- error: Unauthorized,
3755
+ error: ErrorResponse,
3567
3756
  contentType: "json" /* Json */,
3568
3757
  status: 401
3758
+ }).addError({
3759
+ error: ErrorResponse,
3760
+ contentType: "json" /* Json */,
3761
+ status: 409
3762
+ }).addError({
3763
+ error: ErrorResponse,
3764
+ contentType: "json" /* Json */,
3765
+ status: 422
3766
+ }).addError({
3767
+ error: ErrorResponse,
3768
+ contentType: "json" /* Json */,
3769
+ status: 503
3770
+ }).addHeaderParam({
3771
+ key: "Idempotency-Key",
3772
+ value: params == null ? void 0 : params.idempotencyKey
3569
3773
  }).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
3570
3774
  return this.client.callDirect(request);
3571
3775
  }
@@ -3586,30 +3790,42 @@ var PurchasesService = class extends BaseService {
3586
3790
  */
3587
3791
  async listPurchases(params, requestConfig) {
3588
3792
  const resolvedConfig = this.getResolvedConfig(this.listPurchasesConfig, requestConfig);
3589
- z31.object({
3590
- purchaseId: z31.string().optional(),
3591
- iccid: z31.string().optional(),
3592
- afterDate: z31.string().optional(),
3593
- beforeDate: z31.string().optional(),
3594
- email: z31.string().optional(),
3595
- referenceId: z31.string().optional(),
3596
- afterCursor: z31.string().optional(),
3597
- limit: z31.number().optional(),
3598
- after: z31.number().optional(),
3599
- before: z31.number().optional()
3793
+ z30.object({
3794
+ purchaseId: z30.string().optional(),
3795
+ iccid: z30.string().optional(),
3796
+ afterDate: z30.string().optional(),
3797
+ beforeDate: z30.string().optional(),
3798
+ email: z30.string().optional(),
3799
+ referenceId: z30.string().optional(),
3800
+ afterCursor: z30.string().optional(),
3801
+ limit: z30.number().optional(),
3802
+ after: z30.number().optional(),
3803
+ before: z30.number().optional()
3600
3804
  }).parse(params != null ? params : {});
3601
- const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases").setRequestSchema(z31.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3805
+ const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases").setRequestSchema(z30.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3602
3806
  schema: listPurchasesOkResponseResponse,
3603
3807
  contentType: "json" /* Json */,
3604
3808
  status: 200
3605
3809
  }).addError({
3606
- error: BadRequest,
3810
+ error: ErrorResponse,
3607
3811
  contentType: "json" /* Json */,
3608
3812
  status: 400
3609
3813
  }).addError({
3610
- error: Unauthorized,
3814
+ error: ErrorResponse,
3611
3815
  contentType: "json" /* Json */,
3612
3816
  status: 401
3817
+ }).addError({
3818
+ error: ErrorResponse,
3819
+ contentType: "json" /* Json */,
3820
+ status: 409
3821
+ }).addError({
3822
+ error: ErrorResponse,
3823
+ contentType: "json" /* Json */,
3824
+ status: 422
3825
+ }).addError({
3826
+ error: ErrorResponse,
3827
+ contentType: "json" /* Json */,
3828
+ status: 503
3613
3829
  }).addQueryParam({
3614
3830
  key: "purchaseId",
3615
3831
  value: params == null ? void 0 : params.purchaseId
@@ -3645,45 +3861,79 @@ var PurchasesService = class extends BaseService {
3645
3861
  }
3646
3862
  /**
3647
3863
  * This endpoint is used to purchase a new eSIM by providing the package details.
3864
+ * @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.
3648
3865
  * @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
3649
3866
  * @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} - Successful Response
3650
3867
  */
3651
- async createPurchase(body, requestConfig) {
3868
+ async createPurchase(body, params, requestConfig) {
3652
3869
  const resolvedConfig = this.getResolvedConfig(this.createPurchaseConfig, requestConfig);
3870
+ z30.object({ idempotencyKey: z30.string().optional() }).parse(params != null ? params : {});
3653
3871
  const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3654
3872
  schema: createPurchaseOkResponseResponse,
3655
3873
  contentType: "json" /* Json */,
3656
3874
  status: 200
3657
3875
  }).addError({
3658
- error: BadRequest,
3876
+ error: ErrorResponse,
3659
3877
  contentType: "json" /* Json */,
3660
3878
  status: 400
3661
3879
  }).addError({
3662
- error: Unauthorized,
3880
+ error: ErrorResponse,
3663
3881
  contentType: "json" /* Json */,
3664
3882
  status: 401
3883
+ }).addError({
3884
+ error: ErrorResponse,
3885
+ contentType: "json" /* Json */,
3886
+ status: 409
3887
+ }).addError({
3888
+ error: ErrorResponse,
3889
+ contentType: "json" /* Json */,
3890
+ status: 422
3891
+ }).addError({
3892
+ error: ErrorResponse,
3893
+ contentType: "json" /* Json */,
3894
+ status: 503
3895
+ }).addHeaderParam({
3896
+ key: "Idempotency-Key",
3897
+ value: params == null ? void 0 : params.idempotencyKey
3665
3898
  }).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
3666
3899
  return this.client.callDirect(request);
3667
3900
  }
3668
3901
  /**
3669
3902
  * 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.
3903
+ * @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.
3670
3904
  * @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
3671
3905
  * @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} - Successful Response
3672
3906
  */
3673
- async topUpEsim(body, requestConfig) {
3907
+ async topUpEsim(body, params, requestConfig) {
3674
3908
  const resolvedConfig = this.getResolvedConfig(this.topUpEsimConfig, requestConfig);
3909
+ z30.object({ idempotencyKey: z30.string().optional() }).parse(params != null ? params : {});
3675
3910
  const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3676
3911
  schema: topUpEsimOkResponseResponse,
3677
3912
  contentType: "json" /* Json */,
3678
3913
  status: 200
3679
3914
  }).addError({
3680
- error: BadRequest,
3915
+ error: ErrorResponse,
3681
3916
  contentType: "json" /* Json */,
3682
3917
  status: 400
3683
3918
  }).addError({
3684
- error: Unauthorized,
3919
+ error: ErrorResponse,
3685
3920
  contentType: "json" /* Json */,
3686
3921
  status: 401
3922
+ }).addError({
3923
+ error: ErrorResponse,
3924
+ contentType: "json" /* Json */,
3925
+ status: 409
3926
+ }).addError({
3927
+ error: ErrorResponse,
3928
+ contentType: "json" /* Json */,
3929
+ status: 422
3930
+ }).addError({
3931
+ error: ErrorResponse,
3932
+ contentType: "json" /* Json */,
3933
+ status: 503
3934
+ }).addHeaderParam({
3935
+ key: "Idempotency-Key",
3936
+ value: params == null ? void 0 : params.idempotencyKey
3687
3937
  }).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
3688
3938
  return this.client.callDirect(request);
3689
3939
  }
@@ -3696,23 +3946,40 @@ var PurchasesService = class extends BaseService {
3696
3946
 
3697
3947
  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.
3698
3948
 
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.
3699
3950
  * @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
3700
3951
  * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} - Successful Response
3701
3952
  */
3702
- async editPurchase(body, requestConfig) {
3953
+ async editPurchase(body, params, requestConfig) {
3703
3954
  const resolvedConfig = this.getResolvedConfig(this.editPurchaseConfig, requestConfig);
3955
+ z30.object({ idempotencyKey: z30.string().optional() }).parse(params != null ? params : {});
3704
3956
  const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3705
3957
  schema: editPurchaseOkResponseResponse,
3706
3958
  contentType: "json" /* Json */,
3707
3959
  status: 200
3708
3960
  }).addError({
3709
- error: BadRequest,
3961
+ error: ErrorResponse,
3710
3962
  contentType: "json" /* Json */,
3711
3963
  status: 400
3712
3964
  }).addError({
3713
- error: Unauthorized,
3965
+ error: ErrorResponse,
3714
3966
  contentType: "json" /* Json */,
3715
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
3716
3983
  }).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
3717
3984
  return this.client.callDirect(request);
3718
3985
  }
@@ -3724,18 +3991,30 @@ var PurchasesService = class extends BaseService {
3724
3991
  */
3725
3992
  async getPurchaseConsumption(purchaseId, requestConfig) {
3726
3993
  const resolvedConfig = this.getResolvedConfig(this.getPurchaseConsumptionConfig, requestConfig);
3727
- const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(z31.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3994
+ const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(z30.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
3728
3995
  schema: getPurchaseConsumptionOkResponseResponse,
3729
3996
  contentType: "json" /* Json */,
3730
3997
  status: 200
3731
3998
  }).addError({
3732
- error: BadRequest,
3999
+ error: ErrorResponse,
3733
4000
  contentType: "json" /* Json */,
3734
4001
  status: 400
3735
4002
  }).addError({
3736
- error: Unauthorized,
4003
+ error: ErrorResponse,
3737
4004
  contentType: "json" /* Json */,
3738
4005
  status: 401
4006
+ }).addError({
4007
+ error: ErrorResponse,
4008
+ contentType: "json" /* Json */,
4009
+ status: 409
4010
+ }).addError({
4011
+ error: ErrorResponse,
4012
+ contentType: "json" /* Json */,
4013
+ status: 422
4014
+ }).addError({
4015
+ error: ErrorResponse,
4016
+ contentType: "json" /* Json */,
4017
+ status: 503
3739
4018
  }).addPathParam({
3740
4019
  key: "purchaseId",
3741
4020
  value: purchaseId
@@ -3768,30 +4047,30 @@ var CreatePurchaseRequestLanguage = /* @__PURE__ */ ((CreatePurchaseRequestLangu
3768
4047
  import { z as z39 } from "zod";
3769
4048
 
3770
4049
  // src/services/e-sim/models/get-esim-ok-response.ts
3771
- import { z as z33 } from "zod";
4050
+ import { z as z32 } from "zod";
3772
4051
 
3773
4052
  // src/services/e-sim/models/get-esim-ok-response-esim.ts
3774
- import { z as z32 } from "zod";
3775
- var getEsimOkResponseEsim = z32.lazy(() => {
3776
- return z32.object({
3777
- iccid: z32.string().min(18).max(22),
3778
- smdpAddress: z32.string(),
3779
- activationCode: z32.string().min(1e3).max(8e3),
3780
- manualActivationCode: z32.string(),
3781
- status: z32.string(),
3782
- connectivityStatus: z32.string(),
3783
- isTopUpAllowed: z32.boolean()
4053
+ import { z as z31 } from "zod";
4054
+ var getEsimOkResponseEsim = z31.lazy(() => {
4055
+ return z31.object({
4056
+ iccid: z31.string().min(18).max(22),
4057
+ smdpAddress: z31.string(),
4058
+ activationCode: z31.string().min(1e3).max(8e3),
4059
+ manualActivationCode: z31.string(),
4060
+ status: z31.string(),
4061
+ connectivityStatus: z31.string(),
4062
+ isTopUpAllowed: z31.boolean()
3784
4063
  });
3785
4064
  });
3786
- var getEsimOkResponseEsimResponse = z32.lazy(() => {
3787
- return z32.object({
3788
- iccid: z32.string().min(18).max(22),
3789
- smdpAddress: z32.string(),
3790
- activationCode: z32.string().min(1e3).max(8e3),
3791
- manualActivationCode: z32.string(),
3792
- status: z32.string(),
3793
- connectivityStatus: z32.string(),
3794
- isTopUpAllowed: z32.boolean()
4065
+ var getEsimOkResponseEsimResponse = z31.lazy(() => {
4066
+ return z31.object({
4067
+ iccid: z31.string().min(18).max(22),
4068
+ smdpAddress: z31.string(),
4069
+ activationCode: z31.string().min(1e3).max(8e3),
4070
+ manualActivationCode: z31.string(),
4071
+ status: z31.string(),
4072
+ connectivityStatus: z31.string(),
4073
+ isTopUpAllowed: z31.boolean()
3795
4074
  }).transform((data) => ({
3796
4075
  iccid: data["iccid"],
3797
4076
  smdpAddress: data["smdpAddress"],
@@ -3802,15 +4081,15 @@ var getEsimOkResponseEsimResponse = z32.lazy(() => {
3802
4081
  isTopUpAllowed: data["isTopUpAllowed"]
3803
4082
  }));
3804
4083
  });
3805
- var getEsimOkResponseEsimRequest = z32.lazy(() => {
3806
- return z32.object({
3807
- iccid: z32.string().min(18).max(22),
3808
- smdpAddress: z32.string(),
3809
- activationCode: z32.string().min(1e3).max(8e3),
3810
- manualActivationCode: z32.string(),
3811
- status: z32.string(),
3812
- connectivityStatus: z32.string(),
3813
- isTopUpAllowed: z32.boolean()
4084
+ var getEsimOkResponseEsimRequest = z31.lazy(() => {
4085
+ return z31.object({
4086
+ iccid: z31.string().min(18).max(22),
4087
+ smdpAddress: z31.string(),
4088
+ activationCode: z31.string().min(1e3).max(8e3),
4089
+ manualActivationCode: z31.string(),
4090
+ status: z31.string(),
4091
+ connectivityStatus: z31.string(),
4092
+ isTopUpAllowed: z31.boolean()
3814
4093
  }).transform((data) => ({
3815
4094
  iccid: data["iccid"],
3816
4095
  smdpAddress: data["smdpAddress"],
@@ -3823,20 +4102,20 @@ var getEsimOkResponseEsimRequest = z32.lazy(() => {
3823
4102
  });
3824
4103
 
3825
4104
  // src/services/e-sim/models/get-esim-ok-response.ts
3826
- var getEsimOkResponse = z33.lazy(() => {
3827
- return z33.object({
4105
+ var getEsimOkResponse = z32.lazy(() => {
4106
+ return z32.object({
3828
4107
  esim: getEsimOkResponseEsim
3829
4108
  });
3830
4109
  });
3831
- var getEsimOkResponseResponse = z33.lazy(() => {
3832
- return z33.object({
4110
+ var getEsimOkResponseResponse = z32.lazy(() => {
4111
+ return z32.object({
3833
4112
  esim: getEsimOkResponseEsimResponse
3834
4113
  }).transform((data) => ({
3835
4114
  esim: data["esim"]
3836
4115
  }));
3837
4116
  });
3838
- var getEsimOkResponseRequest = z33.lazy(() => {
3839
- return z33.object({
4117
+ var getEsimOkResponseRequest = z32.lazy(() => {
4118
+ return z32.object({
3840
4119
  esim: getEsimOkResponseEsimRequest
3841
4120
  }).transform((data) => ({
3842
4121
  esim: data["esim"]
@@ -3844,24 +4123,24 @@ var getEsimOkResponseRequest = z33.lazy(() => {
3844
4123
  });
3845
4124
 
3846
4125
  // src/services/e-sim/models/get-esim-device-ok-response.ts
3847
- import { z as z35 } from "zod";
4126
+ import { z as z34 } from "zod";
3848
4127
 
3849
4128
  // src/services/e-sim/models/device.ts
3850
- import { z as z34 } from "zod";
3851
- var device = z34.lazy(() => {
3852
- return z34.object({
3853
- oem: z34.string(),
3854
- hardwareName: z34.string(),
3855
- hardwareModel: z34.string(),
3856
- eid: z34.string()
4129
+ import { z as z33 } from "zod";
4130
+ var device = z33.lazy(() => {
4131
+ return z33.object({
4132
+ oem: z33.string(),
4133
+ hardwareName: z33.string(),
4134
+ hardwareModel: z33.string(),
4135
+ eid: z33.string()
3857
4136
  });
3858
4137
  });
3859
- var deviceResponse = z34.lazy(() => {
3860
- return z34.object({
3861
- oem: z34.string(),
3862
- hardwareName: z34.string(),
3863
- hardwareModel: z34.string(),
3864
- eid: z34.string()
4138
+ var deviceResponse = z33.lazy(() => {
4139
+ return z33.object({
4140
+ oem: z33.string(),
4141
+ hardwareName: z33.string(),
4142
+ hardwareModel: z33.string(),
4143
+ eid: z33.string()
3865
4144
  }).transform((data) => ({
3866
4145
  oem: data["oem"],
3867
4146
  hardwareName: data["hardwareName"],
@@ -3869,12 +4148,12 @@ var deviceResponse = z34.lazy(() => {
3869
4148
  eid: data["eid"]
3870
4149
  }));
3871
4150
  });
3872
- var deviceRequest = z34.lazy(() => {
3873
- return z34.object({
3874
- oem: z34.string(),
3875
- hardwareName: z34.string(),
3876
- hardwareModel: z34.string(),
3877
- eid: z34.string()
4151
+ var deviceRequest = z33.lazy(() => {
4152
+ return z33.object({
4153
+ oem: z33.string(),
4154
+ hardwareName: z33.string(),
4155
+ hardwareModel: z33.string(),
4156
+ eid: z33.string()
3878
4157
  }).transform((data) => ({
3879
4158
  oem: data["oem"],
3880
4159
  hardwareName: data["hardwareName"],
@@ -3884,20 +4163,20 @@ var deviceRequest = z34.lazy(() => {
3884
4163
  });
3885
4164
 
3886
4165
  // src/services/e-sim/models/get-esim-device-ok-response.ts
3887
- var getEsimDeviceOkResponse = z35.lazy(() => {
3888
- return z35.object({
4166
+ var getEsimDeviceOkResponse = z34.lazy(() => {
4167
+ return z34.object({
3889
4168
  device
3890
4169
  });
3891
4170
  });
3892
- var getEsimDeviceOkResponseResponse = z35.lazy(() => {
3893
- return z35.object({
4171
+ var getEsimDeviceOkResponseResponse = z34.lazy(() => {
4172
+ return z34.object({
3894
4173
  device: deviceResponse
3895
4174
  }).transform((data) => ({
3896
4175
  device: data["device"]
3897
4176
  }));
3898
4177
  });
3899
- var getEsimDeviceOkResponseRequest = z35.lazy(() => {
3900
- return z35.object({
4178
+ var getEsimDeviceOkResponseRequest = z34.lazy(() => {
4179
+ return z34.object({
3901
4180
  device: deviceRequest
3902
4181
  }).transform((data) => ({
3903
4182
  device: data["device"]
@@ -3905,36 +4184,36 @@ var getEsimDeviceOkResponseRequest = z35.lazy(() => {
3905
4184
  });
3906
4185
 
3907
4186
  // src/services/e-sim/models/get-esim-history-ok-response.ts
3908
- import { z as z38 } from "zod";
4187
+ import { z as z37 } from "zod";
3909
4188
 
3910
4189
  // src/services/e-sim/models/get-esim-history-ok-response-esim.ts
3911
- import { z as z37 } from "zod";
4190
+ import { z as z36 } from "zod";
3912
4191
 
3913
4192
  // src/services/e-sim/models/history.ts
3914
- import { z as z36 } from "zod";
3915
- var history = z36.lazy(() => {
3916
- return z36.object({
3917
- status: z36.string(),
3918
- statusDate: z36.string(),
3919
- date: z36.number().optional()
4193
+ import { z as z35 } from "zod";
4194
+ var history = z35.lazy(() => {
4195
+ return z35.object({
4196
+ status: z35.string(),
4197
+ statusDate: z35.string(),
4198
+ date: z35.number().optional()
3920
4199
  });
3921
4200
  });
3922
- var historyResponse = z36.lazy(() => {
3923
- return z36.object({
3924
- status: z36.string(),
3925
- statusDate: z36.string(),
3926
- date: z36.number().optional()
4201
+ var historyResponse = z35.lazy(() => {
4202
+ return z35.object({
4203
+ status: z35.string(),
4204
+ statusDate: z35.string(),
4205
+ date: z35.number().optional()
3927
4206
  }).transform((data) => ({
3928
4207
  status: data["status"],
3929
4208
  statusDate: data["statusDate"],
3930
4209
  date: data["date"]
3931
4210
  }));
3932
4211
  });
3933
- var historyRequest = z36.lazy(() => {
3934
- return z36.object({
3935
- status: z36.string(),
3936
- statusDate: z36.string(),
3937
- date: z36.number().optional()
4212
+ var historyRequest = z35.lazy(() => {
4213
+ return z35.object({
4214
+ status: z35.string(),
4215
+ statusDate: z35.string(),
4216
+ date: z35.number().optional()
3938
4217
  }).transform((data) => ({
3939
4218
  status: data["status"],
3940
4219
  statusDate: data["statusDate"],
@@ -3943,25 +4222,25 @@ var historyRequest = z36.lazy(() => {
3943
4222
  });
3944
4223
 
3945
4224
  // src/services/e-sim/models/get-esim-history-ok-response-esim.ts
3946
- var getEsimHistoryOkResponseEsim = z37.lazy(() => {
3947
- return z37.object({
3948
- iccid: z37.string().min(18).max(22),
3949
- history: z37.array(history)
4225
+ var getEsimHistoryOkResponseEsim = z36.lazy(() => {
4226
+ return z36.object({
4227
+ iccid: z36.string().min(18).max(22),
4228
+ history: z36.array(history)
3950
4229
  });
3951
4230
  });
3952
- var getEsimHistoryOkResponseEsimResponse = z37.lazy(() => {
3953
- return z37.object({
3954
- iccid: z37.string().min(18).max(22),
3955
- history: z37.array(historyResponse)
4231
+ var getEsimHistoryOkResponseEsimResponse = z36.lazy(() => {
4232
+ return z36.object({
4233
+ iccid: z36.string().min(18).max(22),
4234
+ history: z36.array(historyResponse)
3956
4235
  }).transform((data) => ({
3957
4236
  iccid: data["iccid"],
3958
4237
  history: data["history"]
3959
4238
  }));
3960
4239
  });
3961
- var getEsimHistoryOkResponseEsimRequest = z37.lazy(() => {
3962
- return z37.object({
3963
- iccid: z37.string().min(18).max(22),
3964
- history: z37.array(historyRequest)
4240
+ var getEsimHistoryOkResponseEsimRequest = z36.lazy(() => {
4241
+ return z36.object({
4242
+ iccid: z36.string().min(18).max(22),
4243
+ history: z36.array(historyRequest)
3965
4244
  }).transform((data) => ({
3966
4245
  iccid: data["iccid"],
3967
4246
  history: data["history"]
@@ -3969,26 +4248,48 @@ var getEsimHistoryOkResponseEsimRequest = z37.lazy(() => {
3969
4248
  });
3970
4249
 
3971
4250
  // src/services/e-sim/models/get-esim-history-ok-response.ts
3972
- var getEsimHistoryOkResponse = z38.lazy(() => {
3973
- return z38.object({
4251
+ var getEsimHistoryOkResponse = z37.lazy(() => {
4252
+ return z37.object({
3974
4253
  esim: getEsimHistoryOkResponseEsim
3975
4254
  });
3976
4255
  });
3977
- var getEsimHistoryOkResponseResponse = z38.lazy(() => {
3978
- return z38.object({
4256
+ var getEsimHistoryOkResponseResponse = z37.lazy(() => {
4257
+ return z37.object({
3979
4258
  esim: getEsimHistoryOkResponseEsimResponse
3980
4259
  }).transform((data) => ({
3981
4260
  esim: data["esim"]
3982
4261
  }));
3983
4262
  });
3984
- var getEsimHistoryOkResponseRequest = z38.lazy(() => {
3985
- return z38.object({
4263
+ var getEsimHistoryOkResponseRequest = z37.lazy(() => {
4264
+ return z37.object({
3986
4265
  esim: getEsimHistoryOkResponseEsimRequest
3987
4266
  }).transform((data) => ({
3988
4267
  esim: data["esim"]
3989
4268
  }));
3990
4269
  });
3991
4270
 
4271
+ // src/services/e-sim/models/suspend-esim-ok-response.ts
4272
+ import { z as z38 } from "zod";
4273
+ var suspendEsimOkResponse = z38.lazy(() => {
4274
+ return z38.object({
4275
+ message: z38.string()
4276
+ });
4277
+ });
4278
+ var suspendEsimOkResponseResponse = z38.lazy(() => {
4279
+ return z38.object({
4280
+ message: z38.string()
4281
+ }).transform((data) => ({
4282
+ message: data["message"]
4283
+ }));
4284
+ });
4285
+ var suspendEsimOkResponseRequest = z38.lazy(() => {
4286
+ return z38.object({
4287
+ message: z38.string()
4288
+ }).transform((data) => ({
4289
+ message: data["message"]
4290
+ }));
4291
+ });
4292
+
3992
4293
  // src/services/e-sim/e-sim-service.ts
3993
4294
  var ESimService = class extends BaseService {
3994
4295
  /**
@@ -4018,6 +4319,15 @@ var ESimService = class extends BaseService {
4018
4319
  this.getEsimHistoryConfig = config;
4019
4320
  return this;
4020
4321
  }
4322
+ /**
4323
+ * Sets method-level configuration for suspendEsim.
4324
+ * @param config - Partial configuration to override service-level defaults
4325
+ * @returns This service instance for method chaining
4326
+ */
4327
+ setSuspendEsimConfig(config) {
4328
+ this.suspendEsimConfig = config;
4329
+ return this;
4330
+ }
4021
4331
  /**
4022
4332
  * Get eSIM
4023
4333
  * @param {string} params.iccid - ID of the eSIM
@@ -4032,13 +4342,25 @@ var ESimService = class extends BaseService {
4032
4342
  contentType: "json" /* Json */,
4033
4343
  status: 200
4034
4344
  }).addError({
4035
- error: BadRequest,
4345
+ error: ErrorResponse,
4036
4346
  contentType: "json" /* Json */,
4037
4347
  status: 400
4038
4348
  }).addError({
4039
- error: Unauthorized,
4349
+ error: ErrorResponse,
4040
4350
  contentType: "json" /* Json */,
4041
4351
  status: 401
4352
+ }).addError({
4353
+ error: ErrorResponse,
4354
+ contentType: "json" /* Json */,
4355
+ status: 409
4356
+ }).addError({
4357
+ error: ErrorResponse,
4358
+ contentType: "json" /* Json */,
4359
+ status: 422
4360
+ }).addError({
4361
+ error: ErrorResponse,
4362
+ contentType: "json" /* Json */,
4363
+ status: 503
4042
4364
  }).addQueryParam({
4043
4365
  key: "iccid",
4044
4366
  value: params == null ? void 0 : params.iccid
@@ -4058,13 +4380,25 @@ var ESimService = class extends BaseService {
4058
4380
  contentType: "json" /* Json */,
4059
4381
  status: 200
4060
4382
  }).addError({
4061
- error: BadRequest,
4383
+ error: ErrorResponse,
4062
4384
  contentType: "json" /* Json */,
4063
4385
  status: 400
4064
4386
  }).addError({
4065
- error: Unauthorized,
4387
+ error: ErrorResponse,
4066
4388
  contentType: "json" /* Json */,
4067
4389
  status: 401
4390
+ }).addError({
4391
+ error: ErrorResponse,
4392
+ contentType: "json" /* Json */,
4393
+ status: 409
4394
+ }).addError({
4395
+ error: ErrorResponse,
4396
+ contentType: "json" /* Json */,
4397
+ status: 422
4398
+ }).addError({
4399
+ error: ErrorResponse,
4400
+ contentType: "json" /* Json */,
4401
+ status: 503
4068
4402
  }).addPathParam({
4069
4403
  key: "iccid",
4070
4404
  value: iccid
@@ -4084,19 +4418,74 @@ var ESimService = class extends BaseService {
4084
4418
  contentType: "json" /* Json */,
4085
4419
  status: 200
4086
4420
  }).addError({
4087
- error: BadRequest,
4421
+ error: ErrorResponse,
4088
4422
  contentType: "json" /* Json */,
4089
4423
  status: 400
4090
4424
  }).addError({
4091
- error: Unauthorized,
4425
+ error: ErrorResponse,
4092
4426
  contentType: "json" /* Json */,
4093
4427
  status: 401
4428
+ }).addError({
4429
+ error: ErrorResponse,
4430
+ contentType: "json" /* Json */,
4431
+ status: 409
4432
+ }).addError({
4433
+ error: ErrorResponse,
4434
+ contentType: "json" /* Json */,
4435
+ status: 422
4436
+ }).addError({
4437
+ error: ErrorResponse,
4438
+ contentType: "json" /* Json */,
4439
+ status: 503
4094
4440
  }).addPathParam({
4095
4441
  key: "iccid",
4096
4442
  value: iccid
4097
4443
  }).build();
4098
4444
  return this.client.callDirect(request);
4099
4445
  }
4446
+ /**
4447
+ * 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.
4448
+ * @param {string} iccid - ID of the eSIM
4449
+ * @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.
4450
+ * @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
4451
+ * @returns {Promise<HttpResponse<SuspendEsimOkResponse>>} - Successful Response
4452
+ */
4453
+ async suspendEsim(iccid, params, requestConfig) {
4454
+ const resolvedConfig = this.getResolvedConfig(this.suspendEsimConfig, requestConfig);
4455
+ z39.object({ idempotencyKey: z39.string().optional() }).parse(params != null ? params : {});
4456
+ const request = new RequestBuilder().setConfig(resolvedConfig).setBaseUrl(resolvedConfig).setMethod("POST").setPath("/esim/{iccid}/suspend").setRequestSchema(z39.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
4457
+ schema: suspendEsimOkResponseResponse,
4458
+ contentType: "json" /* Json */,
4459
+ status: 200
4460
+ }).addError({
4461
+ error: ErrorResponse,
4462
+ contentType: "json" /* Json */,
4463
+ status: 400
4464
+ }).addError({
4465
+ error: ErrorResponse,
4466
+ contentType: "json" /* Json */,
4467
+ status: 401
4468
+ }).addError({
4469
+ error: ErrorResponse,
4470
+ contentType: "json" /* Json */,
4471
+ status: 409
4472
+ }).addError({
4473
+ error: ErrorResponse,
4474
+ contentType: "json" /* Json */,
4475
+ status: 422
4476
+ }).addError({
4477
+ error: ErrorResponse,
4478
+ contentType: "json" /* Json */,
4479
+ status: 503
4480
+ }).addPathParam({
4481
+ key: "iccid",
4482
+ value: iccid
4483
+ }).addHeaderParam({
4484
+ key: "Idempotency-Key",
4485
+ value: params == null ? void 0 : params.idempotencyKey
4486
+ }).build();
4487
+ return this.client.callDirect(request);
4488
+ }
4100
4489
  };
4101
4490
 
4102
4491
  // src/services/i-frame/i-frame-service.ts
@@ -4147,13 +4536,25 @@ var IFrameService = class extends BaseService {
4147
4536
  contentType: "json" /* Json */,
4148
4537
  status: 200
4149
4538
  }).addError({
4150
- error: BadRequest,
4539
+ error: ErrorResponse,
4151
4540
  contentType: "json" /* Json */,
4152
4541
  status: 400
4153
4542
  }).addError({
4154
- error: Unauthorized,
4543
+ error: ErrorResponse,
4155
4544
  contentType: "json" /* Json */,
4156
4545
  status: 401
4546
+ }).addError({
4547
+ error: ErrorResponse,
4548
+ contentType: "json" /* Json */,
4549
+ status: 409
4550
+ }).addError({
4551
+ error: ErrorResponse,
4552
+ contentType: "json" /* Json */,
4553
+ status: 422
4554
+ }).addError({
4555
+ error: ErrorResponse,
4556
+ contentType: "json" /* Json */,
4557
+ status: 503
4157
4558
  }).build();
4158
4559
  return this.client.callDirect(request);
4159
4560
  }