celitech-sdk 1.2.1 → 1.3.3

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
@@ -1,6 +1,3 @@
1
- // src/services/destinations/destinations.ts
2
- import { z as z4 } from "zod";
3
-
4
1
  // src/http/handlers/handler-chain.ts
5
2
  var RequestHandlerChain = class {
6
3
  constructor() {
@@ -21,63 +18,26 @@ var RequestHandlerChain = class {
21
18
  }
22
19
  };
23
20
 
21
+ // src/http/error.ts
22
+ var HttpError = class extends Error {
23
+ constructor(metadata, raw, error) {
24
+ super(error);
25
+ this.error = metadata.statusText;
26
+ this.metadata = metadata;
27
+ this.raw = raw;
28
+ }
29
+ };
30
+
24
31
  // src/http/hooks/custom-hook.ts
25
- var CURRENT_TOKEN = "";
26
- var CURRENT_EXPIRY = -1;
27
32
  var CustomHook = class {
28
- async getToken(clientId, clientSecret) {
29
- const tokenUrl = "https://auth.celitech.net/oauth2/token";
30
- const headers = {
31
- "Content-Type": "application/x-www-form-urlencoded"
32
- };
33
- const body = {
34
- client_id: clientId,
35
- client_secret: clientSecret,
36
- grant_type: "client_credentials"
37
- };
38
- const response = await fetch(tokenUrl, {
39
- method: "POST",
40
- headers,
41
- body: new URLSearchParams(body)
42
- });
43
- return response.json();
44
- }
45
33
  async beforeRequest(request, params) {
46
- const clientId = params.get("clientId") || "";
47
- const clientSecret = params.get("clientSecret") || "";
48
- if (!clientId || !clientSecret) {
49
- throw new Error("Missing clientId and/or clientSecret constructor parameters");
50
- }
51
- if (!CURRENT_TOKEN || CURRENT_EXPIRY < Date.now()) {
52
- const tokenResponse = await this.getToken(clientId, clientSecret);
53
- if (tokenResponse.error) {
54
- throw new Error(tokenResponse.error);
55
- }
56
- const { expires_in, access_token } = tokenResponse;
57
- if (!expires_in || !access_token) {
58
- throw new Error("There is an issue with getting the oauth token");
59
- }
60
- CURRENT_EXPIRY = Date.now() + expires_in * 1e3;
61
- CURRENT_TOKEN = access_token;
62
- }
63
- const authorization = `Bearer ${CURRENT_TOKEN}`;
64
- if (!request.headers) {
65
- request.headers = /* @__PURE__ */ new Map();
66
- }
67
- request.headers.set("Authorization", authorization);
68
34
  return request;
69
35
  }
70
36
  async afterResponse(request, response, params) {
71
37
  return response;
72
38
  }
73
39
  async onError(request, response, params) {
74
- return new CustomHttpError("a custom error message", response.metadata);
75
- }
76
- };
77
- var CustomHttpError = class {
78
- constructor(error, metadata) {
79
- this.error = error;
80
- this.metadata = metadata;
40
+ return new HttpError(response.metadata, response.raw);
81
41
  }
82
42
  };
83
43
 
@@ -254,10 +214,8 @@ var HookHandler = class {
254
214
  }
255
215
  throw await hook.onError(nextRequest, response, hookParams);
256
216
  }
257
- getHookParams(request) {
217
+ getHookParams(_request) {
258
218
  const hookParams = /* @__PURE__ */ new Map();
259
- hookParams.set("clientId", request.config.clientId || "");
260
- hookParams.set("clientSecret", request.config.clientSecret || "");
261
219
  return hookParams;
262
220
  }
263
221
  };
@@ -484,16 +442,6 @@ var TerminatingHandler = class {
484
442
  }
485
443
  };
486
444
 
487
- // src/http/error.ts
488
- var HttpError = class extends Error {
489
- constructor(metadata, raw, error) {
490
- super(error);
491
- this.error = metadata.statusText;
492
- this.metadata = metadata;
493
- this.raw = raw;
494
- }
495
- };
496
-
497
445
  // src/http/handlers/retry-handler.ts
498
446
  var RetryHandler = class {
499
447
  async handle(request) {
@@ -525,6 +473,32 @@ var RetryHandler = class {
525
473
  }
526
474
  };
527
475
 
476
+ // src/http/handlers/oauth-handler.ts
477
+ var OAuthHandler = class {
478
+ async handle(request) {
479
+ var _a;
480
+ if (!this.next) {
481
+ throw new Error(`No next handler set in OAuthHandler`);
482
+ }
483
+ if (!request.scopes) {
484
+ return (_a = this.next) == null ? void 0 : _a.handle(request);
485
+ }
486
+ const token = await request.tokenManager.getToken(request.scopes, request.config);
487
+ if (token.accessToken) {
488
+ request.addHeaderParam("Authorization", {
489
+ key: "Authorization",
490
+ value: `Bearer ${token.accessToken}`,
491
+ explode: false,
492
+ encode: false,
493
+ style: "simple" /* SIMPLE */,
494
+ isLimit: false,
495
+ isOffset: false
496
+ });
497
+ }
498
+ return this.next.handle(request);
499
+ }
500
+ };
501
+
528
502
  // src/http/client.ts
529
503
  var HttpClient = class {
530
504
  constructor(config, hook = new CustomHook()) {
@@ -532,6 +506,7 @@ var HttpClient = class {
532
506
  this.requestHandlerChain = new RequestHandlerChain();
533
507
  this.requestHandlerChain.addHandler(new ResponseValidationHandler());
534
508
  this.requestHandlerChain.addHandler(new RequestValidationHandler());
509
+ this.requestHandlerChain.addHandler(new OAuthHandler());
535
510
  this.requestHandlerChain.addHandler(new RetryHandler());
536
511
  this.requestHandlerChain.addHandler(new HookHandler(hook));
537
512
  this.requestHandlerChain.addHandler(new TerminatingHandler());
@@ -576,8 +551,9 @@ var HttpClient = class {
576
551
 
577
552
  // src/services/base-service.ts
578
553
  var BaseService = class {
579
- constructor(config) {
554
+ constructor(config, tokenManager) {
580
555
  this.config = config;
556
+ this.tokenManager = tokenManager;
581
557
  this.client = new HttpClient(this.config);
582
558
  }
583
559
  set baseUrl(baseUrl) {
@@ -667,6 +643,8 @@ var Request = class {
667
643
  this.retry = params.retry;
668
644
  this.validation = params.validation;
669
645
  this.pagination = params.pagination;
646
+ this.scopes = params.scopes;
647
+ this.tokenManager = params.tokenManager;
670
648
  }
671
649
  addHeaderParam(key, param) {
672
650
  if (param.value === void 0) {
@@ -731,7 +709,7 @@ var Request = class {
731
709
  return `${this.baseUrl}${path}${queryString}`;
732
710
  }
733
711
  copy(overrides) {
734
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
712
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
735
713
  const createRequestParams = {
736
714
  baseUrl: (_a = overrides == null ? void 0 : overrides.baseUrl) != null ? _a : this.baseUrl,
737
715
  method: (_b = overrides == null ? void 0 : overrides.method) != null ? _b : this.method,
@@ -746,7 +724,9 @@ var Request = class {
746
724
  requestContentType: (_k = overrides == null ? void 0 : overrides.requestContentType) != null ? _k : this.requestContentType,
747
725
  responseContentType: (_l = overrides == null ? void 0 : overrides.responseContentType) != null ? _l : this.responseContentType,
748
726
  retry: (_m = overrides == null ? void 0 : overrides.retry) != null ? _m : this.retry,
749
- validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation
727
+ validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation,
728
+ scopes: (_o = overrides == null ? void 0 : overrides.scopes) != null ? _o : /* @__PURE__ */ new Set(),
729
+ tokenManager: this.tokenManager
750
730
  };
751
731
  return new Request({
752
732
  ...createRequestParams,
@@ -798,7 +778,7 @@ var RequestBuilder = class {
798
778
  baseUrl: "https://api.celitech.net/v1" /* DEFAULT */,
799
779
  method: "GET",
800
780
  path: "",
801
- config: {},
781
+ config: { clientId: "", clientSecret: "" },
802
782
  responseSchema: z.any(),
803
783
  requestSchema: z.any(),
804
784
  requestContentType: "json" /* Json */,
@@ -812,7 +792,9 @@ var RequestBuilder = class {
812
792
  },
813
793
  pathParams: /* @__PURE__ */ new Map(),
814
794
  queryParams: /* @__PURE__ */ new Map(),
815
- headers: /* @__PURE__ */ new Map()
795
+ headers: /* @__PURE__ */ new Map(),
796
+ scopes: /* @__PURE__ */ new Set(),
797
+ tokenManager: new OAuthTokenManager()
816
798
  };
817
799
  }
818
800
  setRetryAttempts(sdkConfig, requestConfig) {
@@ -880,6 +862,14 @@ var RequestBuilder = class {
880
862
  this.params.pagination = pagination;
881
863
  return this;
882
864
  }
865
+ setScopes(scopes) {
866
+ this.params.scopes = new Set(scopes);
867
+ return this;
868
+ }
869
+ setTokenManager(tokenManager) {
870
+ this.params.tokenManager = tokenManager;
871
+ return this;
872
+ }
883
873
  addBody(body) {
884
874
  if (body !== void 0) {
885
875
  this.params.body = body;
@@ -939,34 +929,166 @@ var RequestBuilder = class {
939
929
  }
940
930
  };
941
931
 
942
- // src/services/destinations/models/list-destinations-ok-response.ts
943
- import { z as z3 } from "zod";
944
-
945
- // src/services/destinations/models/destinations.ts
932
+ // src/services/o-auth/models/get-access-token-request.ts
946
933
  import { z as z2 } from "zod";
947
- var destinations = z2.lazy(() => {
934
+ var getAccessTokenRequest = z2.lazy(() => {
948
935
  return z2.object({
949
- name: z2.string().optional(),
950
- destination: z2.string().optional(),
951
- supportedCountries: z2.array(z2.string()).optional()
936
+ grantType: z2.string().optional(),
937
+ clientId: z2.string().optional(),
938
+ clientSecret: z2.string().optional()
952
939
  });
953
940
  });
954
- var destinationsResponse = z2.lazy(() => {
941
+ var getAccessTokenRequestResponse = z2.lazy(() => {
955
942
  return z2.object({
956
- name: z2.string().optional(),
957
- destination: z2.string().optional(),
958
- supportedCountries: z2.array(z2.string()).optional()
943
+ grant_type: z2.string().optional(),
944
+ client_id: z2.string().optional(),
945
+ client_secret: z2.string().optional()
946
+ }).transform((data) => ({
947
+ grantType: data["grant_type"],
948
+ clientId: data["client_id"],
949
+ clientSecret: data["client_secret"]
950
+ }));
951
+ });
952
+ var getAccessTokenRequestRequest = z2.lazy(() => {
953
+ return z2.object({ grantType: z2.string().nullish(), clientId: z2.string().nullish(), clientSecret: z2.string().nullish() }).transform((data) => ({
954
+ grant_type: data["grantType"],
955
+ client_id: data["clientId"],
956
+ client_secret: data["clientSecret"]
957
+ }));
958
+ });
959
+
960
+ // src/services/o-auth/models/get-access-token-ok-response.ts
961
+ import { z as z3 } from "zod";
962
+ var getAccessTokenOkResponse = z3.lazy(() => {
963
+ return z3.object({
964
+ accessToken: z3.string().optional(),
965
+ tokenType: z3.string().optional(),
966
+ expiresIn: z3.number().optional()
967
+ });
968
+ });
969
+ var getAccessTokenOkResponseResponse = z3.lazy(() => {
970
+ return z3.object({
971
+ access_token: z3.string().optional(),
972
+ token_type: z3.string().optional(),
973
+ expires_in: z3.number().optional()
974
+ }).transform((data) => ({
975
+ accessToken: data["access_token"],
976
+ tokenType: data["token_type"],
977
+ expiresIn: data["expires_in"]
978
+ }));
979
+ });
980
+ var getAccessTokenOkResponseRequest = z3.lazy(() => {
981
+ return z3.object({ accessToken: z3.string().nullish(), tokenType: z3.string().nullish(), expiresIn: z3.number().nullish() }).transform((data) => ({
982
+ access_token: data["accessToken"],
983
+ token_type: data["tokenType"],
984
+ expires_in: data["expiresIn"]
985
+ }));
986
+ });
987
+
988
+ // src/services/o-auth/o-auth.ts
989
+ var OAuthService = class extends BaseService {
990
+ /**
991
+ * This endpoint was added by liblab
992
+ * @returns {Promise<HttpResponse<GetAccessTokenOkResponse>>} Successful Response
993
+ */
994
+ async getAccessToken(body, requestConfig) {
995
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/oauth2/token").setRequestSchema(getAccessTokenRequestRequest).setResponseSchema(getAccessTokenOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("form" /* FormUrlEncoded */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/x-www-form-urlencoded" }).addBody(body).build();
996
+ return this.client.call(request);
997
+ }
998
+ };
999
+
1000
+ // src/services/o-auth/models/grant-type.ts
1001
+ var GrantType = /* @__PURE__ */ ((GrantType2) => {
1002
+ GrantType2["CLIENT_CREDENTIALS"] = "client_credentials";
1003
+ return GrantType2;
1004
+ })(GrantType || {});
1005
+
1006
+ // src/http/oauth/token-manager.ts
1007
+ var OAuthToken = class {
1008
+ constructor(accessToken, scopes, expiresAt) {
1009
+ this.accessToken = accessToken;
1010
+ this.scopes = scopes;
1011
+ this.expiresAt = expiresAt;
1012
+ }
1013
+ hasAllScopes(scopes) {
1014
+ for (const scope of scopes) {
1015
+ if (!this.scopes.has(scope)) {
1016
+ return false;
1017
+ }
1018
+ }
1019
+ return true;
1020
+ }
1021
+ };
1022
+ var OAuthTokenManager = class {
1023
+ constructor() {
1024
+ this.token = new OAuthToken("", /* @__PURE__ */ new Set(), null);
1025
+ }
1026
+ async getToken(scopes, config) {
1027
+ var _a, _b, _c, _d, _e;
1028
+ if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
1029
+ return this.token;
1030
+ }
1031
+ const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
1032
+ const oAuth = new OAuthService(
1033
+ {
1034
+ ...config,
1035
+ baseUrl: "https://auth.celitech.net"
1036
+ },
1037
+ this
1038
+ );
1039
+ const response = await oAuth.getAccessToken(
1040
+ {
1041
+ grantType: "client_credentials",
1042
+ clientId: config.clientId,
1043
+ clientSecret: config.clientSecret
1044
+ },
1045
+ {}
1046
+ );
1047
+ if (!((_c = response.data) == null ? void 0 : _c.accessToken)) {
1048
+ throw new Error(
1049
+ `OAuthError: token endpoint response did not return access token. Response: ${JSON.stringify(response), void 0, 2}.`
1050
+ );
1051
+ }
1052
+ this.token = new OAuthToken(
1053
+ response.data.accessToken,
1054
+ updatedScopes,
1055
+ ((_d = response.data) == null ? void 0 : _d.expiresIn) ? ((_e = response.data) == null ? void 0 : _e.expiresIn) + Math.floor(Date.now() / 1e3) : null
1056
+ );
1057
+ return this.token;
1058
+ }
1059
+ };
1060
+
1061
+ // src/services/destinations/destinations.ts
1062
+ import { z as z6 } from "zod";
1063
+
1064
+ // src/services/destinations/models/list-destinations-ok-response.ts
1065
+ import { z as z5 } from "zod";
1066
+
1067
+ // src/services/destinations/models/destinations.ts
1068
+ import { z as z4 } from "zod";
1069
+ var destinations = z4.lazy(() => {
1070
+ return z4.object({
1071
+ name: z4.string().optional(),
1072
+ destination: z4.string().optional(),
1073
+ supportedCountries: z4.array(z4.string()).optional()
1074
+ });
1075
+ });
1076
+ var destinationsResponse = z4.lazy(() => {
1077
+ return z4.object({
1078
+ name: z4.string().optional(),
1079
+ destination: z4.string().optional(),
1080
+ supportedCountries: z4.array(z4.string()).optional()
959
1081
  }).transform((data) => ({
960
1082
  name: data["name"],
961
1083
  destination: data["destination"],
962
1084
  supportedCountries: data["supportedCountries"]
963
1085
  }));
964
1086
  });
965
- var destinationsRequest = z2.lazy(() => {
966
- return z2.object({
967
- name: z2.string().nullish(),
968
- destination: z2.string().nullish(),
969
- supportedCountries: z2.array(z2.string()).nullish()
1087
+ var destinationsRequest = z4.lazy(() => {
1088
+ return z4.object({
1089
+ name: z4.string().nullish(),
1090
+ destination: z4.string().nullish(),
1091
+ supportedCountries: z4.array(z4.string()).nullish()
970
1092
  }).transform((data) => ({
971
1093
  name: data["name"],
972
1094
  destination: data["destination"],
@@ -975,20 +1097,20 @@ var destinationsRequest = z2.lazy(() => {
975
1097
  });
976
1098
 
977
1099
  // src/services/destinations/models/list-destinations-ok-response.ts
978
- var listDestinationsOkResponse = z3.lazy(() => {
979
- return z3.object({
980
- destinations: z3.array(destinations).optional()
1100
+ var listDestinationsOkResponse = z5.lazy(() => {
1101
+ return z5.object({
1102
+ destinations: z5.array(destinations).optional()
981
1103
  });
982
1104
  });
983
- var listDestinationsOkResponseResponse = z3.lazy(() => {
984
- return z3.object({
985
- destinations: z3.array(destinationsResponse).optional()
1105
+ var listDestinationsOkResponseResponse = z5.lazy(() => {
1106
+ return z5.object({
1107
+ destinations: z5.array(destinationsResponse).optional()
986
1108
  }).transform((data) => ({
987
1109
  destinations: data["destinations"]
988
1110
  }));
989
1111
  });
990
- var listDestinationsOkResponseRequest = z3.lazy(() => {
991
- return z3.object({ destinations: z3.array(destinationsRequest).nullish() }).transform((data) => ({
1112
+ var listDestinationsOkResponseRequest = z5.lazy(() => {
1113
+ return z5.object({ destinations: z5.array(destinationsRequest).nullish() }).transform((data) => ({
992
1114
  destinations: data["destinations"]
993
1115
  }));
994
1116
  });
@@ -1000,37 +1122,37 @@ var DestinationsService = class extends BaseService {
1000
1122
  * @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} Successful Response
1001
1123
  */
1002
1124
  async listDestinations(requestConfig) {
1003
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(z4.any()).setResponseSchema(listDestinationsOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
1125
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(z6.any()).setResponseSchema(listDestinationsOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
1004
1126
  return this.client.call(request);
1005
1127
  }
1006
1128
  };
1007
1129
 
1008
1130
  // src/services/packages/packages.ts
1009
- import { z as z7 } from "zod";
1131
+ import { z as z9 } from "zod";
1010
1132
 
1011
1133
  // src/services/packages/models/list-packages-ok-response.ts
1012
- import { z as z6 } from "zod";
1134
+ import { z as z8 } from "zod";
1013
1135
 
1014
1136
  // src/services/packages/models/packages.ts
1015
- import { z as z5 } from "zod";
1016
- var packages = z5.lazy(() => {
1017
- return z5.object({
1018
- id: z5.string().optional(),
1019
- destination: z5.string().optional(),
1020
- dataLimitInBytes: z5.number().optional(),
1021
- minDays: z5.number().optional(),
1022
- maxDays: z5.number().optional(),
1023
- priceInCents: z5.number().optional()
1137
+ import { z as z7 } from "zod";
1138
+ var packages = z7.lazy(() => {
1139
+ return z7.object({
1140
+ id: z7.string().optional(),
1141
+ destination: z7.string().optional(),
1142
+ dataLimitInBytes: z7.number().optional(),
1143
+ minDays: z7.number().optional(),
1144
+ maxDays: z7.number().optional(),
1145
+ priceInCents: z7.number().optional()
1024
1146
  });
1025
1147
  });
1026
- var packagesResponse = z5.lazy(() => {
1027
- return z5.object({
1028
- id: z5.string().optional(),
1029
- destination: z5.string().optional(),
1030
- dataLimitInBytes: z5.number().optional(),
1031
- minDays: z5.number().optional(),
1032
- maxDays: z5.number().optional(),
1033
- priceInCents: z5.number().optional()
1148
+ var packagesResponse = z7.lazy(() => {
1149
+ return z7.object({
1150
+ id: z7.string().optional(),
1151
+ destination: z7.string().optional(),
1152
+ dataLimitInBytes: z7.number().optional(),
1153
+ minDays: z7.number().optional(),
1154
+ maxDays: z7.number().optional(),
1155
+ priceInCents: z7.number().optional()
1034
1156
  }).transform((data) => ({
1035
1157
  id: data["id"],
1036
1158
  destination: data["destination"],
@@ -1040,14 +1162,14 @@ var packagesResponse = z5.lazy(() => {
1040
1162
  priceInCents: data["priceInCents"]
1041
1163
  }));
1042
1164
  });
1043
- var packagesRequest = z5.lazy(() => {
1044
- return z5.object({
1045
- id: z5.string().nullish(),
1046
- destination: z5.string().nullish(),
1047
- dataLimitInBytes: z5.number().nullish(),
1048
- minDays: z5.number().nullish(),
1049
- maxDays: z5.number().nullish(),
1050
- priceInCents: z5.number().nullish()
1165
+ var packagesRequest = z7.lazy(() => {
1166
+ return z7.object({
1167
+ id: z7.string().nullish(),
1168
+ destination: z7.string().nullish(),
1169
+ dataLimitInBytes: z7.number().nullish(),
1170
+ minDays: z7.number().nullish(),
1171
+ maxDays: z7.number().nullish(),
1172
+ priceInCents: z7.number().nullish()
1051
1173
  }).transform((data) => ({
1052
1174
  id: data["id"],
1053
1175
  destination: data["destination"],
@@ -1059,23 +1181,23 @@ var packagesRequest = z5.lazy(() => {
1059
1181
  });
1060
1182
 
1061
1183
  // src/services/packages/models/list-packages-ok-response.ts
1062
- var listPackagesOkResponse = z6.lazy(() => {
1063
- return z6.object({
1064
- packages: z6.array(packages).optional(),
1065
- afterCursor: z6.string().optional().nullable()
1184
+ var listPackagesOkResponse = z8.lazy(() => {
1185
+ return z8.object({
1186
+ packages: z8.array(packages).optional(),
1187
+ afterCursor: z8.string().optional().nullable()
1066
1188
  });
1067
1189
  });
1068
- var listPackagesOkResponseResponse = z6.lazy(() => {
1069
- return z6.object({
1070
- packages: z6.array(packagesResponse).optional(),
1071
- afterCursor: z6.string().optional().nullable()
1190
+ var listPackagesOkResponseResponse = z8.lazy(() => {
1191
+ return z8.object({
1192
+ packages: z8.array(packagesResponse).optional(),
1193
+ afterCursor: z8.string().optional().nullable()
1072
1194
  }).transform((data) => ({
1073
1195
  packages: data["packages"],
1074
1196
  afterCursor: data["afterCursor"]
1075
1197
  }));
1076
1198
  });
1077
- var listPackagesOkResponseRequest = z6.lazy(() => {
1078
- return z6.object({ packages: z6.array(packagesRequest).nullish(), afterCursor: z6.string().nullish() }).transform((data) => ({
1199
+ var listPackagesOkResponseRequest = z8.lazy(() => {
1200
+ return z8.object({ packages: z8.array(packagesRequest).nullish(), afterCursor: z8.string().nullish() }).transform((data) => ({
1079
1201
  packages: data["packages"],
1080
1202
  afterCursor: data["afterCursor"]
1081
1203
  }));
@@ -1096,7 +1218,7 @@ var PackagesService = class extends BaseService {
1096
1218
  * @returns {Promise<HttpResponse<ListPackagesOkResponse>>} Successful Response
1097
1219
  */
1098
1220
  async listPackages(params, requestConfig) {
1099
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(z7.any()).setResponseSchema(listPackagesOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1221
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(z9.any()).setResponseSchema(listPackagesOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1100
1222
  key: "destination",
1101
1223
  value: params == null ? void 0 : params.destination
1102
1224
  }).addQueryParam({
@@ -1126,32 +1248,32 @@ var PackagesService = class extends BaseService {
1126
1248
  };
1127
1249
 
1128
1250
  // src/services/purchases/purchases.ts
1129
- import { z as z23 } from "zod";
1251
+ import { z as z25 } from "zod";
1130
1252
 
1131
1253
  // src/services/purchases/models/list-purchases-ok-response.ts
1132
- import { z as z11 } from "zod";
1254
+ import { z as z13 } from "zod";
1133
1255
 
1134
1256
  // src/services/purchases/models/purchases.ts
1135
- import { z as z10 } from "zod";
1257
+ import { z as z12 } from "zod";
1136
1258
 
1137
1259
  // src/services/purchases/models/package_.ts
1138
- import { z as z8 } from "zod";
1139
- var package_ = z8.lazy(() => {
1140
- return z8.object({
1141
- id: z8.string().optional(),
1142
- dataLimitInBytes: z8.number().optional(),
1143
- destination: z8.string().optional(),
1144
- destinationName: z8.string().optional(),
1145
- priceInCents: z8.number().optional()
1260
+ import { z as z10 } from "zod";
1261
+ var package_ = z10.lazy(() => {
1262
+ return z10.object({
1263
+ id: z10.string().optional(),
1264
+ dataLimitInBytes: z10.number().optional(),
1265
+ destination: z10.string().optional(),
1266
+ destinationName: z10.string().optional(),
1267
+ priceInCents: z10.number().optional()
1146
1268
  });
1147
1269
  });
1148
- var packageResponse = z8.lazy(() => {
1149
- return z8.object({
1150
- id: z8.string().optional(),
1151
- dataLimitInBytes: z8.number().optional(),
1152
- destination: z8.string().optional(),
1153
- destinationName: z8.string().optional(),
1154
- priceInCents: z8.number().optional()
1270
+ var packageResponse = z10.lazy(() => {
1271
+ return z10.object({
1272
+ id: z10.string().optional(),
1273
+ dataLimitInBytes: z10.number().optional(),
1274
+ destination: z10.string().optional(),
1275
+ destinationName: z10.string().optional(),
1276
+ priceInCents: z10.number().optional()
1155
1277
  }).transform((data) => ({
1156
1278
  id: data["id"],
1157
1279
  dataLimitInBytes: data["dataLimitInBytes"],
@@ -1160,13 +1282,13 @@ var packageResponse = z8.lazy(() => {
1160
1282
  priceInCents: data["priceInCents"]
1161
1283
  }));
1162
1284
  });
1163
- var packageRequest = z8.lazy(() => {
1164
- return z8.object({
1165
- id: z8.string().nullish(),
1166
- dataLimitInBytes: z8.number().nullish(),
1167
- destination: z8.string().nullish(),
1168
- destinationName: z8.string().nullish(),
1169
- priceInCents: z8.number().nullish()
1285
+ var packageRequest = z10.lazy(() => {
1286
+ return z10.object({
1287
+ id: z10.string().nullish(),
1288
+ dataLimitInBytes: z10.number().nullish(),
1289
+ destination: z10.string().nullish(),
1290
+ destinationName: z10.string().nullish(),
1291
+ priceInCents: z10.number().nullish()
1170
1292
  }).transform((data) => ({
1171
1293
  id: data["id"],
1172
1294
  dataLimitInBytes: data["dataLimitInBytes"],
@@ -1177,54 +1299,54 @@ var packageRequest = z8.lazy(() => {
1177
1299
  });
1178
1300
 
1179
1301
  // src/services/purchases/models/purchases-esim.ts
1180
- import { z as z9 } from "zod";
1181
- var purchasesEsim = z9.lazy(() => {
1182
- return z9.object({
1183
- iccid: z9.string().min(18).max(22).optional()
1302
+ import { z as z11 } from "zod";
1303
+ var purchasesEsim = z11.lazy(() => {
1304
+ return z11.object({
1305
+ iccid: z11.string().min(18).max(22).optional()
1184
1306
  });
1185
1307
  });
1186
- var purchasesEsimResponse = z9.lazy(() => {
1187
- return z9.object({
1188
- iccid: z9.string().min(18).max(22).optional()
1308
+ var purchasesEsimResponse = z11.lazy(() => {
1309
+ return z11.object({
1310
+ iccid: z11.string().min(18).max(22).optional()
1189
1311
  }).transform((data) => ({
1190
1312
  iccid: data["iccid"]
1191
1313
  }));
1192
1314
  });
1193
- var purchasesEsimRequest = z9.lazy(() => {
1194
- return z9.object({ iccid: z9.string().nullish() }).transform((data) => ({
1315
+ var purchasesEsimRequest = z11.lazy(() => {
1316
+ return z11.object({ iccid: z11.string().nullish() }).transform((data) => ({
1195
1317
  iccid: data["iccid"]
1196
1318
  }));
1197
1319
  });
1198
1320
 
1199
1321
  // src/services/purchases/models/purchases.ts
1200
- var purchases = z10.lazy(() => {
1201
- return z10.object({
1202
- id: z10.string().optional(),
1203
- startDate: z10.string().optional(),
1204
- endDate: z10.string().optional(),
1205
- createdDate: z10.string().optional(),
1206
- startTime: z10.number().optional(),
1207
- endTime: z10.number().optional(),
1208
- createdAt: z10.number().optional(),
1322
+ var purchases = z12.lazy(() => {
1323
+ return z12.object({
1324
+ id: z12.string().optional(),
1325
+ startDate: z12.string().optional(),
1326
+ endDate: z12.string().optional(),
1327
+ createdDate: z12.string().optional(),
1328
+ startTime: z12.number().optional(),
1329
+ endTime: z12.number().optional(),
1330
+ createdAt: z12.number().optional(),
1209
1331
  package: package_.optional(),
1210
1332
  esim: purchasesEsim.optional(),
1211
- source: z10.string().optional(),
1212
- referenceId: z10.string().optional()
1333
+ source: z12.string().optional(),
1334
+ referenceId: z12.string().optional()
1213
1335
  });
1214
1336
  });
1215
- var purchasesResponse = z10.lazy(() => {
1216
- return z10.object({
1217
- id: z10.string().optional(),
1218
- startDate: z10.string().optional(),
1219
- endDate: z10.string().optional(),
1220
- createdDate: z10.string().optional(),
1221
- startTime: z10.number().optional(),
1222
- endTime: z10.number().optional(),
1223
- createdAt: z10.number().optional(),
1337
+ var purchasesResponse = z12.lazy(() => {
1338
+ return z12.object({
1339
+ id: z12.string().optional(),
1340
+ startDate: z12.string().optional(),
1341
+ endDate: z12.string().optional(),
1342
+ createdDate: z12.string().optional(),
1343
+ startTime: z12.number().optional(),
1344
+ endTime: z12.number().optional(),
1345
+ createdAt: z12.number().optional(),
1224
1346
  package: packageResponse.optional(),
1225
1347
  esim: purchasesEsimResponse.optional(),
1226
- source: z10.string().optional(),
1227
- referenceId: z10.string().optional()
1348
+ source: z12.string().optional(),
1349
+ referenceId: z12.string().optional()
1228
1350
  }).transform((data) => ({
1229
1351
  id: data["id"],
1230
1352
  startDate: data["startDate"],
@@ -1239,19 +1361,19 @@ var purchasesResponse = z10.lazy(() => {
1239
1361
  referenceId: data["referenceId"]
1240
1362
  }));
1241
1363
  });
1242
- var purchasesRequest = z10.lazy(() => {
1243
- return z10.object({
1244
- id: z10.string().nullish(),
1245
- startDate: z10.string().nullish(),
1246
- endDate: z10.string().nullish(),
1247
- createdDate: z10.string().nullish(),
1248
- startTime: z10.number().nullish(),
1249
- endTime: z10.number().nullish(),
1250
- createdAt: z10.number().nullish(),
1364
+ var purchasesRequest = z12.lazy(() => {
1365
+ return z12.object({
1366
+ id: z12.string().nullish(),
1367
+ startDate: z12.string().nullish(),
1368
+ endDate: z12.string().nullish(),
1369
+ createdDate: z12.string().nullish(),
1370
+ startTime: z12.number().nullish(),
1371
+ endTime: z12.number().nullish(),
1372
+ createdAt: z12.number().nullish(),
1251
1373
  package: packageRequest.nullish(),
1252
1374
  esim: purchasesEsimRequest.nullish(),
1253
- source: z10.string().nullish(),
1254
- referenceId: z10.string().nullish()
1375
+ source: z12.string().nullish(),
1376
+ referenceId: z12.string().nullish()
1255
1377
  }).transform((data) => ({
1256
1378
  id: data["id"],
1257
1379
  startDate: data["startDate"],
@@ -1268,54 +1390,54 @@ var purchasesRequest = z10.lazy(() => {
1268
1390
  });
1269
1391
 
1270
1392
  // src/services/purchases/models/list-purchases-ok-response.ts
1271
- var listPurchasesOkResponse = z11.lazy(() => {
1272
- return z11.object({
1273
- purchases: z11.array(purchases).optional(),
1274
- afterCursor: z11.string().optional().nullable()
1393
+ var listPurchasesOkResponse = z13.lazy(() => {
1394
+ return z13.object({
1395
+ purchases: z13.array(purchases).optional(),
1396
+ afterCursor: z13.string().optional().nullable()
1275
1397
  });
1276
1398
  });
1277
- var listPurchasesOkResponseResponse = z11.lazy(() => {
1278
- return z11.object({
1279
- purchases: z11.array(purchasesResponse).optional(),
1280
- afterCursor: z11.string().optional().nullable()
1399
+ var listPurchasesOkResponseResponse = z13.lazy(() => {
1400
+ return z13.object({
1401
+ purchases: z13.array(purchasesResponse).optional(),
1402
+ afterCursor: z13.string().optional().nullable()
1281
1403
  }).transform((data) => ({
1282
1404
  purchases: data["purchases"],
1283
1405
  afterCursor: data["afterCursor"]
1284
1406
  }));
1285
1407
  });
1286
- var listPurchasesOkResponseRequest = z11.lazy(() => {
1287
- return z11.object({ purchases: z11.array(purchasesRequest).nullish(), afterCursor: z11.string().nullish() }).transform((data) => ({
1408
+ var listPurchasesOkResponseRequest = z13.lazy(() => {
1409
+ return z13.object({ purchases: z13.array(purchasesRequest).nullish(), afterCursor: z13.string().nullish() }).transform((data) => ({
1288
1410
  purchases: data["purchases"],
1289
1411
  afterCursor: data["afterCursor"]
1290
1412
  }));
1291
1413
  });
1292
1414
 
1293
1415
  // src/services/purchases/models/create-purchase-request.ts
1294
- import { z as z12 } from "zod";
1295
- var createPurchaseRequest = z12.lazy(() => {
1296
- return z12.object({
1297
- destination: z12.string(),
1298
- dataLimitInGb: z12.number(),
1299
- startDate: z12.string(),
1300
- endDate: z12.string(),
1301
- email: z12.string().optional(),
1302
- referenceId: z12.string().optional(),
1303
- networkBrand: z12.string().optional(),
1304
- startTime: z12.number().optional(),
1305
- endTime: z12.number().optional()
1416
+ import { z as z14 } from "zod";
1417
+ var createPurchaseRequest = z14.lazy(() => {
1418
+ return z14.object({
1419
+ destination: z14.string(),
1420
+ dataLimitInGb: z14.number(),
1421
+ startDate: z14.string(),
1422
+ endDate: z14.string(),
1423
+ email: z14.string().optional(),
1424
+ referenceId: z14.string().optional(),
1425
+ networkBrand: z14.string().optional(),
1426
+ startTime: z14.number().optional(),
1427
+ endTime: z14.number().optional()
1306
1428
  });
1307
1429
  });
1308
- var createPurchaseRequestResponse = z12.lazy(() => {
1309
- return z12.object({
1310
- destination: z12.string(),
1311
- dataLimitInGB: z12.number(),
1312
- startDate: z12.string(),
1313
- endDate: z12.string(),
1314
- email: z12.string().optional(),
1315
- referenceId: z12.string().optional(),
1316
- networkBrand: z12.string().optional(),
1317
- startTime: z12.number().optional(),
1318
- endTime: z12.number().optional()
1430
+ var createPurchaseRequestResponse = z14.lazy(() => {
1431
+ return z14.object({
1432
+ destination: z14.string(),
1433
+ dataLimitInGB: z14.number(),
1434
+ startDate: z14.string(),
1435
+ endDate: z14.string(),
1436
+ email: z14.string().optional(),
1437
+ referenceId: z14.string().optional(),
1438
+ networkBrand: z14.string().optional(),
1439
+ startTime: z14.number().optional(),
1440
+ endTime: z14.number().optional()
1319
1441
  }).transform((data) => ({
1320
1442
  destination: data["destination"],
1321
1443
  dataLimitInGb: data["dataLimitInGB"],
@@ -1328,17 +1450,17 @@ var createPurchaseRequestResponse = z12.lazy(() => {
1328
1450
  endTime: data["endTime"]
1329
1451
  }));
1330
1452
  });
1331
- var createPurchaseRequestRequest = z12.lazy(() => {
1332
- return z12.object({
1333
- destination: z12.string().nullish(),
1334
- dataLimitInGb: z12.number().nullish(),
1335
- startDate: z12.string().nullish(),
1336
- endDate: z12.string().nullish(),
1337
- email: z12.string().nullish(),
1338
- referenceId: z12.string().nullish(),
1339
- networkBrand: z12.string().nullish(),
1340
- startTime: z12.number().nullish(),
1341
- endTime: z12.number().nullish()
1453
+ var createPurchaseRequestRequest = z14.lazy(() => {
1454
+ return z14.object({
1455
+ destination: z14.string().nullish(),
1456
+ dataLimitInGb: z14.number().nullish(),
1457
+ startDate: z14.string().nullish(),
1458
+ endDate: z14.string().nullish(),
1459
+ email: z14.string().nullish(),
1460
+ referenceId: z14.string().nullish(),
1461
+ networkBrand: z14.string().nullish(),
1462
+ startTime: z14.number().nullish(),
1463
+ endTime: z14.number().nullish()
1342
1464
  }).transform((data) => ({
1343
1465
  destination: data["destination"],
1344
1466
  dataLimitInGB: data["dataLimitInGb"],
@@ -1353,30 +1475,30 @@ var createPurchaseRequestRequest = z12.lazy(() => {
1353
1475
  });
1354
1476
 
1355
1477
  // src/services/purchases/models/create-purchase-ok-response.ts
1356
- import { z as z15 } from "zod";
1478
+ import { z as z17 } from "zod";
1357
1479
 
1358
1480
  // src/services/purchases/models/create-purchase-ok-response-purchase.ts
1359
- import { z as z13 } from "zod";
1360
- var createPurchaseOkResponsePurchase = z13.lazy(() => {
1361
- return z13.object({
1362
- id: z13.string().optional(),
1363
- packageId: z13.string().optional(),
1364
- startDate: z13.string().optional(),
1365
- endDate: z13.string().optional(),
1366
- createdDate: z13.string().optional(),
1367
- startTime: z13.number().optional(),
1368
- endTime: z13.number().optional()
1481
+ import { z as z15 } from "zod";
1482
+ var createPurchaseOkResponsePurchase = z15.lazy(() => {
1483
+ return z15.object({
1484
+ id: z15.string().optional(),
1485
+ packageId: z15.string().optional(),
1486
+ startDate: z15.string().optional(),
1487
+ endDate: z15.string().optional(),
1488
+ createdDate: z15.string().optional(),
1489
+ startTime: z15.number().optional(),
1490
+ endTime: z15.number().optional()
1369
1491
  });
1370
1492
  });
1371
- var createPurchaseOkResponsePurchaseResponse = z13.lazy(() => {
1372
- return z13.object({
1373
- id: z13.string().optional(),
1374
- packageId: z13.string().optional(),
1375
- startDate: z13.string().optional(),
1376
- endDate: z13.string().optional(),
1377
- createdDate: z13.string().optional(),
1378
- startTime: z13.number().optional(),
1379
- endTime: z13.number().optional()
1493
+ var createPurchaseOkResponsePurchaseResponse = z15.lazy(() => {
1494
+ return z15.object({
1495
+ id: z15.string().optional(),
1496
+ packageId: z15.string().optional(),
1497
+ startDate: z15.string().optional(),
1498
+ endDate: z15.string().optional(),
1499
+ createdDate: z15.string().optional(),
1500
+ startTime: z15.number().optional(),
1501
+ endTime: z15.number().optional()
1380
1502
  }).transform((data) => ({
1381
1503
  id: data["id"],
1382
1504
  packageId: data["packageId"],
@@ -1387,15 +1509,15 @@ var createPurchaseOkResponsePurchaseResponse = z13.lazy(() => {
1387
1509
  endTime: data["endTime"]
1388
1510
  }));
1389
1511
  });
1390
- var createPurchaseOkResponsePurchaseRequest = z13.lazy(() => {
1391
- return z13.object({
1392
- id: z13.string().nullish(),
1393
- packageId: z13.string().nullish(),
1394
- startDate: z13.string().nullish(),
1395
- endDate: z13.string().nullish(),
1396
- createdDate: z13.string().nullish(),
1397
- startTime: z13.number().nullish(),
1398
- endTime: z13.number().nullish()
1512
+ var createPurchaseOkResponsePurchaseRequest = z15.lazy(() => {
1513
+ return z15.object({
1514
+ id: z15.string().nullish(),
1515
+ packageId: z15.string().nullish(),
1516
+ startDate: z15.string().nullish(),
1517
+ endDate: z15.string().nullish(),
1518
+ createdDate: z15.string().nullish(),
1519
+ startTime: z15.number().nullish(),
1520
+ endTime: z15.number().nullish()
1399
1521
  }).transform((data) => ({
1400
1522
  id: data["id"],
1401
1523
  packageId: data["packageId"],
@@ -1408,30 +1530,30 @@ var createPurchaseOkResponsePurchaseRequest = z13.lazy(() => {
1408
1530
  });
1409
1531
 
1410
1532
  // src/services/purchases/models/create-purchase-ok-response-profile.ts
1411
- import { z as z14 } from "zod";
1412
- var createPurchaseOkResponseProfile = z14.lazy(() => {
1413
- return z14.object({
1414
- iccid: z14.string().min(18).max(22).optional(),
1415
- activationCode: z14.string().min(1e3).max(8e3).optional(),
1416
- manualActivationCode: z14.string().optional()
1533
+ import { z as z16 } from "zod";
1534
+ var createPurchaseOkResponseProfile = z16.lazy(() => {
1535
+ return z16.object({
1536
+ iccid: z16.string().min(18).max(22).optional(),
1537
+ activationCode: z16.string().min(1e3).max(8e3).optional(),
1538
+ manualActivationCode: z16.string().optional()
1417
1539
  });
1418
1540
  });
1419
- var createPurchaseOkResponseProfileResponse = z14.lazy(() => {
1420
- return z14.object({
1421
- iccid: z14.string().min(18).max(22).optional(),
1422
- activationCode: z14.string().min(1e3).max(8e3).optional(),
1423
- manualActivationCode: z14.string().optional()
1541
+ var createPurchaseOkResponseProfileResponse = z16.lazy(() => {
1542
+ return z16.object({
1543
+ iccid: z16.string().min(18).max(22).optional(),
1544
+ activationCode: z16.string().min(1e3).max(8e3).optional(),
1545
+ manualActivationCode: z16.string().optional()
1424
1546
  }).transform((data) => ({
1425
1547
  iccid: data["iccid"],
1426
1548
  activationCode: data["activationCode"],
1427
1549
  manualActivationCode: data["manualActivationCode"]
1428
1550
  }));
1429
1551
  });
1430
- var createPurchaseOkResponseProfileRequest = z14.lazy(() => {
1431
- return z14.object({
1432
- iccid: z14.string().nullish(),
1433
- activationCode: z14.string().nullish(),
1434
- manualActivationCode: z14.string().nullish()
1552
+ var createPurchaseOkResponseProfileRequest = z16.lazy(() => {
1553
+ return z16.object({
1554
+ iccid: z16.string().nullish(),
1555
+ activationCode: z16.string().nullish(),
1556
+ manualActivationCode: z16.string().nullish()
1435
1557
  }).transform((data) => ({
1436
1558
  iccid: data["iccid"],
1437
1559
  activationCode: data["activationCode"],
@@ -1440,14 +1562,14 @@ var createPurchaseOkResponseProfileRequest = z14.lazy(() => {
1440
1562
  });
1441
1563
 
1442
1564
  // src/services/purchases/models/create-purchase-ok-response.ts
1443
- var createPurchaseOkResponse = z15.lazy(() => {
1444
- return z15.object({
1565
+ var createPurchaseOkResponse = z17.lazy(() => {
1566
+ return z17.object({
1445
1567
  purchase: createPurchaseOkResponsePurchase.optional(),
1446
1568
  profile: createPurchaseOkResponseProfile.optional()
1447
1569
  });
1448
1570
  });
1449
- var createPurchaseOkResponseResponse = z15.lazy(() => {
1450
- return z15.object({
1571
+ var createPurchaseOkResponseResponse = z17.lazy(() => {
1572
+ return z17.object({
1451
1573
  purchase: createPurchaseOkResponsePurchaseResponse.optional(),
1452
1574
  profile: createPurchaseOkResponseProfileResponse.optional()
1453
1575
  }).transform((data) => ({
@@ -1455,8 +1577,8 @@ var createPurchaseOkResponseResponse = z15.lazy(() => {
1455
1577
  profile: data["profile"]
1456
1578
  }));
1457
1579
  });
1458
- var createPurchaseOkResponseRequest = z15.lazy(() => {
1459
- return z15.object({
1580
+ var createPurchaseOkResponseRequest = z17.lazy(() => {
1581
+ return z17.object({
1460
1582
  purchase: createPurchaseOkResponsePurchaseRequest.nullish(),
1461
1583
  profile: createPurchaseOkResponseProfileRequest.nullish()
1462
1584
  }).transform((data) => ({
@@ -1466,29 +1588,29 @@ var createPurchaseOkResponseRequest = z15.lazy(() => {
1466
1588
  });
1467
1589
 
1468
1590
  // src/services/purchases/models/top-up-esim-request.ts
1469
- import { z as z16 } from "zod";
1470
- var topUpEsimRequest = z16.lazy(() => {
1471
- return z16.object({
1472
- iccid: z16.string().min(18).max(22),
1473
- dataLimitInGb: z16.number(),
1474
- startDate: z16.string(),
1475
- endDate: z16.string(),
1476
- email: z16.string().optional(),
1477
- referenceId: z16.string().optional(),
1478
- startTime: z16.number().optional(),
1479
- endTime: z16.number().optional()
1591
+ import { z as z18 } from "zod";
1592
+ var topUpEsimRequest = z18.lazy(() => {
1593
+ return z18.object({
1594
+ iccid: z18.string().min(18).max(22),
1595
+ dataLimitInGb: z18.number(),
1596
+ startDate: z18.string(),
1597
+ endDate: z18.string(),
1598
+ email: z18.string().optional(),
1599
+ referenceId: z18.string().optional(),
1600
+ startTime: z18.number().optional(),
1601
+ endTime: z18.number().optional()
1480
1602
  });
1481
1603
  });
1482
- var topUpEsimRequestResponse = z16.lazy(() => {
1483
- return z16.object({
1484
- iccid: z16.string().min(18).max(22),
1485
- dataLimitInGB: z16.number(),
1486
- startDate: z16.string(),
1487
- endDate: z16.string(),
1488
- email: z16.string().optional(),
1489
- referenceId: z16.string().optional(),
1490
- startTime: z16.number().optional(),
1491
- endTime: z16.number().optional()
1604
+ var topUpEsimRequestResponse = z18.lazy(() => {
1605
+ return z18.object({
1606
+ iccid: z18.string().min(18).max(22),
1607
+ dataLimitInGB: z18.number(),
1608
+ startDate: z18.string(),
1609
+ endDate: z18.string(),
1610
+ email: z18.string().optional(),
1611
+ referenceId: z18.string().optional(),
1612
+ startTime: z18.number().optional(),
1613
+ endTime: z18.number().optional()
1492
1614
  }).transform((data) => ({
1493
1615
  iccid: data["iccid"],
1494
1616
  dataLimitInGb: data["dataLimitInGB"],
@@ -1500,16 +1622,16 @@ var topUpEsimRequestResponse = z16.lazy(() => {
1500
1622
  endTime: data["endTime"]
1501
1623
  }));
1502
1624
  });
1503
- var topUpEsimRequestRequest = z16.lazy(() => {
1504
- return z16.object({
1505
- iccid: z16.string().nullish(),
1506
- dataLimitInGb: z16.number().nullish(),
1507
- startDate: z16.string().nullish(),
1508
- endDate: z16.string().nullish(),
1509
- email: z16.string().nullish(),
1510
- referenceId: z16.string().nullish(),
1511
- startTime: z16.number().nullish(),
1512
- endTime: z16.number().nullish()
1625
+ var topUpEsimRequestRequest = z18.lazy(() => {
1626
+ return z18.object({
1627
+ iccid: z18.string().nullish(),
1628
+ dataLimitInGb: z18.number().nullish(),
1629
+ startDate: z18.string().nullish(),
1630
+ endDate: z18.string().nullish(),
1631
+ email: z18.string().nullish(),
1632
+ referenceId: z18.string().nullish(),
1633
+ startTime: z18.number().nullish(),
1634
+ endTime: z18.number().nullish()
1513
1635
  }).transform((data) => ({
1514
1636
  iccid: data["iccid"],
1515
1637
  dataLimitInGB: data["dataLimitInGb"],
@@ -1523,30 +1645,30 @@ var topUpEsimRequestRequest = z16.lazy(() => {
1523
1645
  });
1524
1646
 
1525
1647
  // src/services/purchases/models/top-up-esim-ok-response.ts
1526
- import { z as z19 } from "zod";
1648
+ import { z as z21 } from "zod";
1527
1649
 
1528
1650
  // src/services/purchases/models/top-up-esim-ok-response-purchase.ts
1529
- import { z as z17 } from "zod";
1530
- var topUpEsimOkResponsePurchase = z17.lazy(() => {
1531
- return z17.object({
1532
- id: z17.string().optional(),
1533
- packageId: z17.string().optional(),
1534
- startDate: z17.string().optional(),
1535
- endDate: z17.string().optional(),
1536
- createdDate: z17.string().optional(),
1537
- startTime: z17.number().optional(),
1538
- endTime: z17.number().optional()
1651
+ import { z as z19 } from "zod";
1652
+ var topUpEsimOkResponsePurchase = z19.lazy(() => {
1653
+ return z19.object({
1654
+ id: z19.string().optional(),
1655
+ packageId: z19.string().optional(),
1656
+ startDate: z19.string().optional(),
1657
+ endDate: z19.string().optional(),
1658
+ createdDate: z19.string().optional(),
1659
+ startTime: z19.number().optional(),
1660
+ endTime: z19.number().optional()
1539
1661
  });
1540
1662
  });
1541
- var topUpEsimOkResponsePurchaseResponse = z17.lazy(() => {
1542
- return z17.object({
1543
- id: z17.string().optional(),
1544
- packageId: z17.string().optional(),
1545
- startDate: z17.string().optional(),
1546
- endDate: z17.string().optional(),
1547
- createdDate: z17.string().optional(),
1548
- startTime: z17.number().optional(),
1549
- endTime: z17.number().optional()
1663
+ var topUpEsimOkResponsePurchaseResponse = z19.lazy(() => {
1664
+ return z19.object({
1665
+ id: z19.string().optional(),
1666
+ packageId: z19.string().optional(),
1667
+ startDate: z19.string().optional(),
1668
+ endDate: z19.string().optional(),
1669
+ createdDate: z19.string().optional(),
1670
+ startTime: z19.number().optional(),
1671
+ endTime: z19.number().optional()
1550
1672
  }).transform((data) => ({
1551
1673
  id: data["id"],
1552
1674
  packageId: data["packageId"],
@@ -1557,15 +1679,15 @@ var topUpEsimOkResponsePurchaseResponse = z17.lazy(() => {
1557
1679
  endTime: data["endTime"]
1558
1680
  }));
1559
1681
  });
1560
- var topUpEsimOkResponsePurchaseRequest = z17.lazy(() => {
1561
- return z17.object({
1562
- id: z17.string().nullish(),
1563
- packageId: z17.string().nullish(),
1564
- startDate: z17.string().nullish(),
1565
- endDate: z17.string().nullish(),
1566
- createdDate: z17.string().nullish(),
1567
- startTime: z17.number().nullish(),
1568
- endTime: z17.number().nullish()
1682
+ var topUpEsimOkResponsePurchaseRequest = z19.lazy(() => {
1683
+ return z19.object({
1684
+ id: z19.string().nullish(),
1685
+ packageId: z19.string().nullish(),
1686
+ startDate: z19.string().nullish(),
1687
+ endDate: z19.string().nullish(),
1688
+ createdDate: z19.string().nullish(),
1689
+ startTime: z19.number().nullish(),
1690
+ endTime: z19.number().nullish()
1569
1691
  }).transform((data) => ({
1570
1692
  id: data["id"],
1571
1693
  packageId: data["packageId"],
@@ -1578,34 +1700,34 @@ var topUpEsimOkResponsePurchaseRequest = z17.lazy(() => {
1578
1700
  });
1579
1701
 
1580
1702
  // src/services/purchases/models/top-up-esim-ok-response-profile.ts
1581
- import { z as z18 } from "zod";
1582
- var topUpEsimOkResponseProfile = z18.lazy(() => {
1583
- return z18.object({
1584
- iccid: z18.string().min(18).max(22).optional()
1703
+ import { z as z20 } from "zod";
1704
+ var topUpEsimOkResponseProfile = z20.lazy(() => {
1705
+ return z20.object({
1706
+ iccid: z20.string().min(18).max(22).optional()
1585
1707
  });
1586
1708
  });
1587
- var topUpEsimOkResponseProfileResponse = z18.lazy(() => {
1588
- return z18.object({
1589
- iccid: z18.string().min(18).max(22).optional()
1709
+ var topUpEsimOkResponseProfileResponse = z20.lazy(() => {
1710
+ return z20.object({
1711
+ iccid: z20.string().min(18).max(22).optional()
1590
1712
  }).transform((data) => ({
1591
1713
  iccid: data["iccid"]
1592
1714
  }));
1593
1715
  });
1594
- var topUpEsimOkResponseProfileRequest = z18.lazy(() => {
1595
- return z18.object({ iccid: z18.string().nullish() }).transform((data) => ({
1716
+ var topUpEsimOkResponseProfileRequest = z20.lazy(() => {
1717
+ return z20.object({ iccid: z20.string().nullish() }).transform((data) => ({
1596
1718
  iccid: data["iccid"]
1597
1719
  }));
1598
1720
  });
1599
1721
 
1600
1722
  // src/services/purchases/models/top-up-esim-ok-response.ts
1601
- var topUpEsimOkResponse = z19.lazy(() => {
1602
- return z19.object({
1723
+ var topUpEsimOkResponse = z21.lazy(() => {
1724
+ return z21.object({
1603
1725
  purchase: topUpEsimOkResponsePurchase.optional(),
1604
1726
  profile: topUpEsimOkResponseProfile.optional()
1605
1727
  });
1606
1728
  });
1607
- var topUpEsimOkResponseResponse = z19.lazy(() => {
1608
- return z19.object({
1729
+ var topUpEsimOkResponseResponse = z21.lazy(() => {
1730
+ return z21.object({
1609
1731
  purchase: topUpEsimOkResponsePurchaseResponse.optional(),
1610
1732
  profile: topUpEsimOkResponseProfileResponse.optional()
1611
1733
  }).transform((data) => ({
@@ -1613,8 +1735,8 @@ var topUpEsimOkResponseResponse = z19.lazy(() => {
1613
1735
  profile: data["profile"]
1614
1736
  }));
1615
1737
  });
1616
- var topUpEsimOkResponseRequest = z19.lazy(() => {
1617
- return z19.object({
1738
+ var topUpEsimOkResponseRequest = z21.lazy(() => {
1739
+ return z21.object({
1618
1740
  purchase: topUpEsimOkResponsePurchaseRequest.nullish(),
1619
1741
  profile: topUpEsimOkResponseProfileRequest.nullish()
1620
1742
  }).transform((data) => ({
@@ -1624,23 +1746,23 @@ var topUpEsimOkResponseRequest = z19.lazy(() => {
1624
1746
  });
1625
1747
 
1626
1748
  // src/services/purchases/models/edit-purchase-request.ts
1627
- import { z as z20 } from "zod";
1628
- var editPurchaseRequest = z20.lazy(() => {
1629
- return z20.object({
1630
- purchaseId: z20.string(),
1631
- startDate: z20.string(),
1632
- endDate: z20.string(),
1633
- startTime: z20.number().optional(),
1634
- endTime: z20.number().optional()
1749
+ import { z as z22 } from "zod";
1750
+ var editPurchaseRequest = z22.lazy(() => {
1751
+ return z22.object({
1752
+ purchaseId: z22.string(),
1753
+ startDate: z22.string(),
1754
+ endDate: z22.string(),
1755
+ startTime: z22.number().optional(),
1756
+ endTime: z22.number().optional()
1635
1757
  });
1636
1758
  });
1637
- var editPurchaseRequestResponse = z20.lazy(() => {
1638
- return z20.object({
1639
- purchaseId: z20.string(),
1640
- startDate: z20.string(),
1641
- endDate: z20.string(),
1642
- startTime: z20.number().optional(),
1643
- endTime: z20.number().optional()
1759
+ var editPurchaseRequestResponse = z22.lazy(() => {
1760
+ return z22.object({
1761
+ purchaseId: z22.string(),
1762
+ startDate: z22.string(),
1763
+ endDate: z22.string(),
1764
+ startTime: z22.number().optional(),
1765
+ endTime: z22.number().optional()
1644
1766
  }).transform((data) => ({
1645
1767
  purchaseId: data["purchaseId"],
1646
1768
  startDate: data["startDate"],
@@ -1649,13 +1771,13 @@ var editPurchaseRequestResponse = z20.lazy(() => {
1649
1771
  endTime: data["endTime"]
1650
1772
  }));
1651
1773
  });
1652
- var editPurchaseRequestRequest = z20.lazy(() => {
1653
- return z20.object({
1654
- purchaseId: z20.string().nullish(),
1655
- startDate: z20.string().nullish(),
1656
- endDate: z20.string().nullish(),
1657
- startTime: z20.number().nullish(),
1658
- endTime: z20.number().nullish()
1774
+ var editPurchaseRequestRequest = z22.lazy(() => {
1775
+ return z22.object({
1776
+ purchaseId: z22.string().nullish(),
1777
+ startDate: z22.string().nullish(),
1778
+ endDate: z22.string().nullish(),
1779
+ startTime: z22.number().nullish(),
1780
+ endTime: z22.number().nullish()
1659
1781
  }).transform((data) => ({
1660
1782
  purchaseId: data["purchaseId"],
1661
1783
  startDate: data["startDate"],
@@ -1666,23 +1788,23 @@ var editPurchaseRequestRequest = z20.lazy(() => {
1666
1788
  });
1667
1789
 
1668
1790
  // src/services/purchases/models/edit-purchase-ok-response.ts
1669
- import { z as z21 } from "zod";
1670
- var editPurchaseOkResponse = z21.lazy(() => {
1671
- return z21.object({
1672
- purchaseId: z21.string().optional(),
1673
- newStartDate: z21.string().optional(),
1674
- newEndDate: z21.string().optional(),
1675
- newStartTime: z21.number().optional(),
1676
- newEndTime: z21.number().optional()
1791
+ import { z as z23 } from "zod";
1792
+ var editPurchaseOkResponse = z23.lazy(() => {
1793
+ return z23.object({
1794
+ purchaseId: z23.string().optional(),
1795
+ newStartDate: z23.string().optional(),
1796
+ newEndDate: z23.string().optional(),
1797
+ newStartTime: z23.number().optional(),
1798
+ newEndTime: z23.number().optional()
1677
1799
  });
1678
1800
  });
1679
- var editPurchaseOkResponseResponse = z21.lazy(() => {
1680
- return z21.object({
1681
- purchaseId: z21.string().optional(),
1682
- newStartDate: z21.string().optional(),
1683
- newEndDate: z21.string().optional(),
1684
- newStartTime: z21.number().optional(),
1685
- newEndTime: z21.number().optional()
1801
+ var editPurchaseOkResponseResponse = z23.lazy(() => {
1802
+ return z23.object({
1803
+ purchaseId: z23.string().optional(),
1804
+ newStartDate: z23.string().optional(),
1805
+ newEndDate: z23.string().optional(),
1806
+ newStartTime: z23.number().optional(),
1807
+ newEndTime: z23.number().optional()
1686
1808
  }).transform((data) => ({
1687
1809
  purchaseId: data["purchaseId"],
1688
1810
  newStartDate: data["newStartDate"],
@@ -1691,13 +1813,13 @@ var editPurchaseOkResponseResponse = z21.lazy(() => {
1691
1813
  newEndTime: data["newEndTime"]
1692
1814
  }));
1693
1815
  });
1694
- var editPurchaseOkResponseRequest = z21.lazy(() => {
1695
- return z21.object({
1696
- purchaseId: z21.string().nullish(),
1697
- newStartDate: z21.string().nullish(),
1698
- newEndDate: z21.string().nullish(),
1699
- newStartTime: z21.number().nullish(),
1700
- newEndTime: z21.number().nullish()
1816
+ var editPurchaseOkResponseRequest = z23.lazy(() => {
1817
+ return z23.object({
1818
+ purchaseId: z23.string().nullish(),
1819
+ newStartDate: z23.string().nullish(),
1820
+ newEndDate: z23.string().nullish(),
1821
+ newStartTime: z23.number().nullish(),
1822
+ newEndTime: z23.number().nullish()
1701
1823
  }).transform((data) => ({
1702
1824
  purchaseId: data["purchaseId"],
1703
1825
  newStartDate: data["newStartDate"],
@@ -1708,24 +1830,24 @@ var editPurchaseOkResponseRequest = z21.lazy(() => {
1708
1830
  });
1709
1831
 
1710
1832
  // src/services/purchases/models/get-purchase-consumption-ok-response.ts
1711
- import { z as z22 } from "zod";
1712
- var getPurchaseConsumptionOkResponse = z22.lazy(() => {
1713
- return z22.object({
1714
- dataUsageRemainingInBytes: z22.number().optional(),
1715
- status: z22.string().optional()
1833
+ import { z as z24 } from "zod";
1834
+ var getPurchaseConsumptionOkResponse = z24.lazy(() => {
1835
+ return z24.object({
1836
+ dataUsageRemainingInBytes: z24.number().optional(),
1837
+ status: z24.string().optional()
1716
1838
  });
1717
1839
  });
1718
- var getPurchaseConsumptionOkResponseResponse = z22.lazy(() => {
1719
- return z22.object({
1720
- dataUsageRemainingInBytes: z22.number().optional(),
1721
- status: z22.string().optional()
1840
+ var getPurchaseConsumptionOkResponseResponse = z24.lazy(() => {
1841
+ return z24.object({
1842
+ dataUsageRemainingInBytes: z24.number().optional(),
1843
+ status: z24.string().optional()
1722
1844
  }).transform((data) => ({
1723
1845
  dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
1724
1846
  status: data["status"]
1725
1847
  }));
1726
1848
  });
1727
- var getPurchaseConsumptionOkResponseRequest = z22.lazy(() => {
1728
- return z22.object({ dataUsageRemainingInBytes: z22.number().nullish(), status: z22.string().nullish() }).transform((data) => ({
1849
+ var getPurchaseConsumptionOkResponseRequest = z24.lazy(() => {
1850
+ return z24.object({ dataUsageRemainingInBytes: z24.number().nullish(), status: z24.string().nullish() }).transform((data) => ({
1729
1851
  dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
1730
1852
  status: data["status"]
1731
1853
  }));
@@ -1746,7 +1868,7 @@ var PurchasesService = class extends BaseService {
1746
1868
  * @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} Successful Response
1747
1869
  */
1748
1870
  async listPurchases(params, requestConfig) {
1749
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(z23.any()).setResponseSchema(listPurchasesOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1871
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(z25.any()).setResponseSchema(listPurchasesOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1750
1872
  key: "iccid",
1751
1873
  value: params == null ? void 0 : params.iccid
1752
1874
  }).addQueryParam({
@@ -1778,7 +1900,7 @@ var PurchasesService = class extends BaseService {
1778
1900
  * @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} Successful Response
1779
1901
  */
1780
1902
  async createPurchase(body, requestConfig) {
1781
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1903
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1782
1904
  return this.client.call(request);
1783
1905
  }
1784
1906
  /**
@@ -1786,7 +1908,7 @@ var PurchasesService = class extends BaseService {
1786
1908
  * @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
1787
1909
  */
1788
1910
  async topUpEsim(body, requestConfig) {
1789
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1911
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1790
1912
  return this.client.call(request);
1791
1913
  }
1792
1914
  /**
@@ -1794,7 +1916,7 @@ var PurchasesService = class extends BaseService {
1794
1916
  * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
1795
1917
  */
1796
1918
  async editPurchase(body, requestConfig) {
1797
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1919
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1798
1920
  return this.client.call(request);
1799
1921
  }
1800
1922
  /**
@@ -1803,7 +1925,7 @@ var PurchasesService = class extends BaseService {
1803
1925
  * @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} Successful Response
1804
1926
  */
1805
1927
  async getPurchaseConsumption(purchaseId, requestConfig) {
1806
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(z23.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
1928
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(z25.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
1807
1929
  key: "purchaseId",
1808
1930
  value: purchaseId
1809
1931
  }).build();
@@ -1812,27 +1934,27 @@ var PurchasesService = class extends BaseService {
1812
1934
  };
1813
1935
 
1814
1936
  // src/services/e-sim/e-sim.ts
1815
- import { z as z33 } from "zod";
1937
+ import { z as z35 } from "zod";
1816
1938
 
1817
1939
  // src/services/e-sim/models/get-esim-ok-response.ts
1818
- import { z as z25 } from "zod";
1940
+ import { z as z27 } from "zod";
1819
1941
 
1820
1942
  // src/services/e-sim/models/get-esim-ok-response-esim.ts
1821
- import { z as z24 } from "zod";
1822
- var getEsimOkResponseEsim = z24.lazy(() => {
1823
- return z24.object({
1824
- iccid: z24.string().min(18).max(22).optional(),
1825
- smdpAddress: z24.string().optional(),
1826
- manualActivationCode: z24.string().optional(),
1827
- status: z24.string().optional()
1943
+ import { z as z26 } from "zod";
1944
+ var getEsimOkResponseEsim = z26.lazy(() => {
1945
+ return z26.object({
1946
+ iccid: z26.string().min(18).max(22).optional(),
1947
+ smdpAddress: z26.string().optional(),
1948
+ manualActivationCode: z26.string().optional(),
1949
+ status: z26.string().optional()
1828
1950
  });
1829
1951
  });
1830
- var getEsimOkResponseEsimResponse = z24.lazy(() => {
1831
- return z24.object({
1832
- iccid: z24.string().min(18).max(22).optional(),
1833
- smdpAddress: z24.string().optional(),
1834
- manualActivationCode: z24.string().optional(),
1835
- status: z24.string().optional()
1952
+ var getEsimOkResponseEsimResponse = z26.lazy(() => {
1953
+ return z26.object({
1954
+ iccid: z26.string().min(18).max(22).optional(),
1955
+ smdpAddress: z26.string().optional(),
1956
+ manualActivationCode: z26.string().optional(),
1957
+ status: z26.string().optional()
1836
1958
  }).transform((data) => ({
1837
1959
  iccid: data["iccid"],
1838
1960
  smdpAddress: data["smdpAddress"],
@@ -1840,12 +1962,12 @@ var getEsimOkResponseEsimResponse = z24.lazy(() => {
1840
1962
  status: data["status"]
1841
1963
  }));
1842
1964
  });
1843
- var getEsimOkResponseEsimRequest = z24.lazy(() => {
1844
- return z24.object({
1845
- iccid: z24.string().nullish(),
1846
- smdpAddress: z24.string().nullish(),
1847
- manualActivationCode: z24.string().nullish(),
1848
- status: z24.string().nullish()
1965
+ var getEsimOkResponseEsimRequest = z26.lazy(() => {
1966
+ return z26.object({
1967
+ iccid: z26.string().nullish(),
1968
+ smdpAddress: z26.string().nullish(),
1969
+ manualActivationCode: z26.string().nullish(),
1970
+ status: z26.string().nullish()
1849
1971
  }).transform((data) => ({
1850
1972
  iccid: data["iccid"],
1851
1973
  smdpAddress: data["smdpAddress"],
@@ -1855,43 +1977,43 @@ var getEsimOkResponseEsimRequest = z24.lazy(() => {
1855
1977
  });
1856
1978
 
1857
1979
  // src/services/e-sim/models/get-esim-ok-response.ts
1858
- var getEsimOkResponse = z25.lazy(() => {
1859
- return z25.object({
1980
+ var getEsimOkResponse = z27.lazy(() => {
1981
+ return z27.object({
1860
1982
  esim: getEsimOkResponseEsim.optional()
1861
1983
  });
1862
1984
  });
1863
- var getEsimOkResponseResponse = z25.lazy(() => {
1864
- return z25.object({
1985
+ var getEsimOkResponseResponse = z27.lazy(() => {
1986
+ return z27.object({
1865
1987
  esim: getEsimOkResponseEsimResponse.optional()
1866
1988
  }).transform((data) => ({
1867
1989
  esim: data["esim"]
1868
1990
  }));
1869
1991
  });
1870
- var getEsimOkResponseRequest = z25.lazy(() => {
1871
- return z25.object({ esim: getEsimOkResponseEsimRequest.nullish() }).transform((data) => ({
1992
+ var getEsimOkResponseRequest = z27.lazy(() => {
1993
+ return z27.object({ esim: getEsimOkResponseEsimRequest.nullish() }).transform((data) => ({
1872
1994
  esim: data["esim"]
1873
1995
  }));
1874
1996
  });
1875
1997
 
1876
1998
  // src/services/e-sim/models/get-esim-device-ok-response.ts
1877
- import { z as z27 } from "zod";
1999
+ import { z as z29 } from "zod";
1878
2000
 
1879
2001
  // src/services/e-sim/models/device.ts
1880
- import { z as z26 } from "zod";
1881
- var device = z26.lazy(() => {
1882
- return z26.object({
1883
- oem: z26.string().optional(),
1884
- hardwareName: z26.string().optional(),
1885
- hardwareModel: z26.string().optional(),
1886
- eid: z26.string().optional()
2002
+ import { z as z28 } from "zod";
2003
+ var device = z28.lazy(() => {
2004
+ return z28.object({
2005
+ oem: z28.string().optional(),
2006
+ hardwareName: z28.string().optional(),
2007
+ hardwareModel: z28.string().optional(),
2008
+ eid: z28.string().optional()
1887
2009
  });
1888
2010
  });
1889
- var deviceResponse = z26.lazy(() => {
1890
- return z26.object({
1891
- oem: z26.string().optional(),
1892
- hardwareName: z26.string().optional(),
1893
- hardwareModel: z26.string().optional(),
1894
- eid: z26.string().optional()
2011
+ var deviceResponse = z28.lazy(() => {
2012
+ return z28.object({
2013
+ oem: z28.string().optional(),
2014
+ hardwareName: z28.string().optional(),
2015
+ hardwareModel: z28.string().optional(),
2016
+ eid: z28.string().optional()
1895
2017
  }).transform((data) => ({
1896
2018
  oem: data["oem"],
1897
2019
  hardwareName: data["hardwareName"],
@@ -1899,12 +2021,12 @@ var deviceResponse = z26.lazy(() => {
1899
2021
  eid: data["eid"]
1900
2022
  }));
1901
2023
  });
1902
- var deviceRequest = z26.lazy(() => {
1903
- return z26.object({
1904
- oem: z26.string().nullish(),
1905
- hardwareName: z26.string().nullish(),
1906
- hardwareModel: z26.string().nullish(),
1907
- eid: z26.string().nullish()
2024
+ var deviceRequest = z28.lazy(() => {
2025
+ return z28.object({
2026
+ oem: z28.string().nullish(),
2027
+ hardwareName: z28.string().nullish(),
2028
+ hardwareModel: z28.string().nullish(),
2029
+ eid: z28.string().nullish()
1908
2030
  }).transform((data) => ({
1909
2031
  oem: data["oem"],
1910
2032
  hardwareName: data["hardwareName"],
@@ -1914,52 +2036,52 @@ var deviceRequest = z26.lazy(() => {
1914
2036
  });
1915
2037
 
1916
2038
  // src/services/e-sim/models/get-esim-device-ok-response.ts
1917
- var getEsimDeviceOkResponse = z27.lazy(() => {
1918
- return z27.object({
2039
+ var getEsimDeviceOkResponse = z29.lazy(() => {
2040
+ return z29.object({
1919
2041
  device: device.optional()
1920
2042
  });
1921
2043
  });
1922
- var getEsimDeviceOkResponseResponse = z27.lazy(() => {
1923
- return z27.object({
2044
+ var getEsimDeviceOkResponseResponse = z29.lazy(() => {
2045
+ return z29.object({
1924
2046
  device: deviceResponse.optional()
1925
2047
  }).transform((data) => ({
1926
2048
  device: data["device"]
1927
2049
  }));
1928
2050
  });
1929
- var getEsimDeviceOkResponseRequest = z27.lazy(() => {
1930
- return z27.object({ device: deviceRequest.nullish() }).transform((data) => ({
2051
+ var getEsimDeviceOkResponseRequest = z29.lazy(() => {
2052
+ return z29.object({ device: deviceRequest.nullish() }).transform((data) => ({
1931
2053
  device: data["device"]
1932
2054
  }));
1933
2055
  });
1934
2056
 
1935
2057
  // src/services/e-sim/models/get-esim-history-ok-response.ts
1936
- import { z as z30 } from "zod";
2058
+ import { z as z32 } from "zod";
1937
2059
 
1938
2060
  // src/services/e-sim/models/get-esim-history-ok-response-esim.ts
1939
- import { z as z29 } from "zod";
2061
+ import { z as z31 } from "zod";
1940
2062
 
1941
2063
  // src/services/e-sim/models/history.ts
1942
- import { z as z28 } from "zod";
1943
- var history = z28.lazy(() => {
1944
- return z28.object({
1945
- status: z28.string().optional(),
1946
- statusDate: z28.string().optional(),
1947
- date: z28.number().optional()
2064
+ import { z as z30 } from "zod";
2065
+ var history = z30.lazy(() => {
2066
+ return z30.object({
2067
+ status: z30.string().optional(),
2068
+ statusDate: z30.string().optional(),
2069
+ date: z30.number().optional()
1948
2070
  });
1949
2071
  });
1950
- var historyResponse = z28.lazy(() => {
1951
- return z28.object({
1952
- status: z28.string().optional(),
1953
- statusDate: z28.string().optional(),
1954
- date: z28.number().optional()
2072
+ var historyResponse = z30.lazy(() => {
2073
+ return z30.object({
2074
+ status: z30.string().optional(),
2075
+ statusDate: z30.string().optional(),
2076
+ date: z30.number().optional()
1955
2077
  }).transform((data) => ({
1956
2078
  status: data["status"],
1957
2079
  statusDate: data["statusDate"],
1958
2080
  date: data["date"]
1959
2081
  }));
1960
2082
  });
1961
- var historyRequest = z28.lazy(() => {
1962
- return z28.object({ status: z28.string().nullish(), statusDate: z28.string().nullish(), date: z28.number().nullish() }).transform((data) => ({
2083
+ var historyRequest = z30.lazy(() => {
2084
+ return z30.object({ status: z30.string().nullish(), statusDate: z30.string().nullish(), date: z30.number().nullish() }).transform((data) => ({
1963
2085
  status: data["status"],
1964
2086
  statusDate: data["statusDate"],
1965
2087
  date: data["date"]
@@ -1967,75 +2089,75 @@ var historyRequest = z28.lazy(() => {
1967
2089
  });
1968
2090
 
1969
2091
  // src/services/e-sim/models/get-esim-history-ok-response-esim.ts
1970
- var getEsimHistoryOkResponseEsim = z29.lazy(() => {
1971
- return z29.object({
1972
- iccid: z29.string().min(18).max(22).optional(),
1973
- history: z29.array(history).optional()
2092
+ var getEsimHistoryOkResponseEsim = z31.lazy(() => {
2093
+ return z31.object({
2094
+ iccid: z31.string().min(18).max(22).optional(),
2095
+ history: z31.array(history).optional()
1974
2096
  });
1975
2097
  });
1976
- var getEsimHistoryOkResponseEsimResponse = z29.lazy(() => {
1977
- return z29.object({
1978
- iccid: z29.string().min(18).max(22).optional(),
1979
- history: z29.array(historyResponse).optional()
2098
+ var getEsimHistoryOkResponseEsimResponse = z31.lazy(() => {
2099
+ return z31.object({
2100
+ iccid: z31.string().min(18).max(22).optional(),
2101
+ history: z31.array(historyResponse).optional()
1980
2102
  }).transform((data) => ({
1981
2103
  iccid: data["iccid"],
1982
2104
  history: data["history"]
1983
2105
  }));
1984
2106
  });
1985
- var getEsimHistoryOkResponseEsimRequest = z29.lazy(() => {
1986
- return z29.object({ iccid: z29.string().nullish(), history: z29.array(historyRequest).nullish() }).transform((data) => ({
2107
+ var getEsimHistoryOkResponseEsimRequest = z31.lazy(() => {
2108
+ return z31.object({ iccid: z31.string().nullish(), history: z31.array(historyRequest).nullish() }).transform((data) => ({
1987
2109
  iccid: data["iccid"],
1988
2110
  history: data["history"]
1989
2111
  }));
1990
2112
  });
1991
2113
 
1992
2114
  // src/services/e-sim/models/get-esim-history-ok-response.ts
1993
- var getEsimHistoryOkResponse = z30.lazy(() => {
1994
- return z30.object({
2115
+ var getEsimHistoryOkResponse = z32.lazy(() => {
2116
+ return z32.object({
1995
2117
  esim: getEsimHistoryOkResponseEsim.optional()
1996
2118
  });
1997
2119
  });
1998
- var getEsimHistoryOkResponseResponse = z30.lazy(() => {
1999
- return z30.object({
2120
+ var getEsimHistoryOkResponseResponse = z32.lazy(() => {
2121
+ return z32.object({
2000
2122
  esim: getEsimHistoryOkResponseEsimResponse.optional()
2001
2123
  }).transform((data) => ({
2002
2124
  esim: data["esim"]
2003
2125
  }));
2004
2126
  });
2005
- var getEsimHistoryOkResponseRequest = z30.lazy(() => {
2006
- return z30.object({ esim: getEsimHistoryOkResponseEsimRequest.nullish() }).transform((data) => ({
2127
+ var getEsimHistoryOkResponseRequest = z32.lazy(() => {
2128
+ return z32.object({ esim: getEsimHistoryOkResponseEsimRequest.nullish() }).transform((data) => ({
2007
2129
  esim: data["esim"]
2008
2130
  }));
2009
2131
  });
2010
2132
 
2011
2133
  // src/services/e-sim/models/get-esim-mac-ok-response.ts
2012
- import { z as z32 } from "zod";
2134
+ import { z as z34 } from "zod";
2013
2135
 
2014
2136
  // src/services/e-sim/models/get-esim-mac-ok-response-esim.ts
2015
- import { z as z31 } from "zod";
2016
- var getEsimMacOkResponseEsim = z31.lazy(() => {
2017
- return z31.object({
2018
- iccid: z31.string().min(18).max(22).optional(),
2019
- smdpAddress: z31.string().optional(),
2020
- manualActivationCode: z31.string().optional()
2137
+ import { z as z33 } from "zod";
2138
+ var getEsimMacOkResponseEsim = z33.lazy(() => {
2139
+ return z33.object({
2140
+ iccid: z33.string().min(18).max(22).optional(),
2141
+ smdpAddress: z33.string().optional(),
2142
+ manualActivationCode: z33.string().optional()
2021
2143
  });
2022
2144
  });
2023
- var getEsimMacOkResponseEsimResponse = z31.lazy(() => {
2024
- return z31.object({
2025
- iccid: z31.string().min(18).max(22).optional(),
2026
- smdpAddress: z31.string().optional(),
2027
- manualActivationCode: z31.string().optional()
2145
+ var getEsimMacOkResponseEsimResponse = z33.lazy(() => {
2146
+ return z33.object({
2147
+ iccid: z33.string().min(18).max(22).optional(),
2148
+ smdpAddress: z33.string().optional(),
2149
+ manualActivationCode: z33.string().optional()
2028
2150
  }).transform((data) => ({
2029
2151
  iccid: data["iccid"],
2030
2152
  smdpAddress: data["smdpAddress"],
2031
2153
  manualActivationCode: data["manualActivationCode"]
2032
2154
  }));
2033
2155
  });
2034
- var getEsimMacOkResponseEsimRequest = z31.lazy(() => {
2035
- return z31.object({
2036
- iccid: z31.string().nullish(),
2037
- smdpAddress: z31.string().nullish(),
2038
- manualActivationCode: z31.string().nullish()
2156
+ var getEsimMacOkResponseEsimRequest = z33.lazy(() => {
2157
+ return z33.object({
2158
+ iccid: z33.string().nullish(),
2159
+ smdpAddress: z33.string().nullish(),
2160
+ manualActivationCode: z33.string().nullish()
2039
2161
  }).transform((data) => ({
2040
2162
  iccid: data["iccid"],
2041
2163
  smdpAddress: data["smdpAddress"],
@@ -2044,20 +2166,20 @@ var getEsimMacOkResponseEsimRequest = z31.lazy(() => {
2044
2166
  });
2045
2167
 
2046
2168
  // src/services/e-sim/models/get-esim-mac-ok-response.ts
2047
- var getEsimMacOkResponse = z32.lazy(() => {
2048
- return z32.object({
2169
+ var getEsimMacOkResponse = z34.lazy(() => {
2170
+ return z34.object({
2049
2171
  esim: getEsimMacOkResponseEsim.optional()
2050
2172
  });
2051
2173
  });
2052
- var getEsimMacOkResponseResponse = z32.lazy(() => {
2053
- return z32.object({
2174
+ var getEsimMacOkResponseResponse = z34.lazy(() => {
2175
+ return z34.object({
2054
2176
  esim: getEsimMacOkResponseEsimResponse.optional()
2055
2177
  }).transform((data) => ({
2056
2178
  esim: data["esim"]
2057
2179
  }));
2058
2180
  });
2059
- var getEsimMacOkResponseRequest = z32.lazy(() => {
2060
- return z32.object({ esim: getEsimMacOkResponseEsimRequest.nullish() }).transform((data) => ({
2181
+ var getEsimMacOkResponseRequest = z34.lazy(() => {
2182
+ return z34.object({ esim: getEsimMacOkResponseEsimRequest.nullish() }).transform((data) => ({
2061
2183
  esim: data["esim"]
2062
2184
  }));
2063
2185
  });
@@ -2070,7 +2192,7 @@ var ESimService = class extends BaseService {
2070
2192
  * @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
2071
2193
  */
2072
2194
  async getEsim(params, requestConfig) {
2073
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(z33.any()).setResponseSchema(getEsimOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2195
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(z35.any()).setResponseSchema(getEsimOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2074
2196
  key: "iccid",
2075
2197
  value: params == null ? void 0 : params.iccid
2076
2198
  }).build();
@@ -2082,7 +2204,7 @@ var ESimService = class extends BaseService {
2082
2204
  * @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
2083
2205
  */
2084
2206
  async getEsimDevice(iccid, requestConfig) {
2085
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(z33.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2207
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(z35.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2086
2208
  key: "iccid",
2087
2209
  value: iccid
2088
2210
  }).build();
@@ -2094,7 +2216,7 @@ var ESimService = class extends BaseService {
2094
2216
  * @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
2095
2217
  */
2096
2218
  async getEsimHistory(iccid, requestConfig) {
2097
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(z33.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2219
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(z35.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2098
2220
  key: "iccid",
2099
2221
  value: iccid
2100
2222
  }).build();
@@ -2106,7 +2228,7 @@ var ESimService = class extends BaseService {
2106
2228
  * @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
2107
2229
  */
2108
2230
  async getEsimMac(iccid, requestConfig) {
2109
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(z33.any()).setResponseSchema(getEsimMacOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2231
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(z35.any()).setResponseSchema(getEsimMacOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2110
2232
  key: "iccid",
2111
2233
  value: iccid
2112
2234
  }).build();
@@ -2118,41 +2240,48 @@ var ESimService = class extends BaseService {
2118
2240
  var Celitech = class {
2119
2241
  constructor(config) {
2120
2242
  this.config = config;
2243
+ this.tokenManager = new OAuthTokenManager();
2121
2244
  const baseUrl = config.environment || config.baseUrl || "https://api.celitech.net/v1" /* DEFAULT */;
2122
2245
  this.config = {
2123
2246
  ...config,
2124
2247
  baseUrl
2125
2248
  };
2126
- this.destinations = new DestinationsService(this.config);
2127
- this.packages = new PackagesService(this.config);
2128
- this.purchases = new PurchasesService(this.config);
2129
- this.eSim = new ESimService(this.config);
2249
+ this.oAuth = new OAuthService(this.config, this.tokenManager);
2250
+ this.destinations = new DestinationsService(this.config, this.tokenManager);
2251
+ this.packages = new PackagesService(this.config, this.tokenManager);
2252
+ this.purchases = new PurchasesService(this.config, this.tokenManager);
2253
+ this.eSim = new ESimService(this.config, this.tokenManager);
2130
2254
  }
2131
2255
  set baseUrl(baseUrl) {
2256
+ this.oAuth.baseUrl = baseUrl;
2132
2257
  this.destinations.baseUrl = baseUrl;
2133
2258
  this.packages.baseUrl = baseUrl;
2134
2259
  this.purchases.baseUrl = baseUrl;
2135
2260
  this.eSim.baseUrl = baseUrl;
2136
2261
  }
2137
2262
  set environment(environment) {
2263
+ this.oAuth.baseUrl = environment;
2138
2264
  this.destinations.baseUrl = environment;
2139
2265
  this.packages.baseUrl = environment;
2140
2266
  this.purchases.baseUrl = environment;
2141
2267
  this.eSim.baseUrl = environment;
2142
2268
  }
2143
2269
  set timeoutMs(timeoutMs) {
2270
+ this.oAuth.timeoutMs = timeoutMs;
2144
2271
  this.destinations.timeoutMs = timeoutMs;
2145
2272
  this.packages.timeoutMs = timeoutMs;
2146
2273
  this.purchases.timeoutMs = timeoutMs;
2147
2274
  this.eSim.timeoutMs = timeoutMs;
2148
2275
  }
2149
2276
  set clientId(clientId) {
2277
+ this.oAuth.clientId = clientId;
2150
2278
  this.destinations.clientId = clientId;
2151
2279
  this.packages.clientId = clientId;
2152
2280
  this.purchases.clientId = clientId;
2153
2281
  this.eSim.clientId = clientId;
2154
2282
  }
2155
2283
  set clientSecret(clientSecret) {
2284
+ this.oAuth.clientSecret = clientSecret;
2156
2285
  this.destinations.clientSecret = clientSecret;
2157
2286
  this.packages.clientSecret = clientSecret;
2158
2287
  this.purchases.clientSecret = clientSecret;
@@ -2163,6 +2292,8 @@ export {
2163
2292
  Celitech,
2164
2293
  DestinationsService,
2165
2294
  ESimService,
2295
+ GrantType,
2296
+ OAuthService,
2166
2297
  PackagesService,
2167
2298
  PurchasesService
2168
2299
  };