celitech-sdk 1.3.38 → 1.3.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -3
- package/dist/index.d.ts +589 -158
- package/dist/index.js +1726 -655
- package/dist/index.mjs +1714 -644
- package/package.json +3 -2
package/dist/index.js
CHANGED
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
33
33
|
Celitech: () => Celitech,
|
34
34
|
DestinationsService: () => DestinationsService,
|
35
35
|
ESimService: () => ESimService,
|
36
|
+
Environment: () => Environment,
|
36
37
|
GrantType: () => GrantType,
|
37
38
|
IFrameService: () => IFrameService,
|
38
39
|
OAuthService: () => OAuthService,
|
@@ -245,12 +246,39 @@ var TransportHookAdapter = class {
|
|
245
246
|
}
|
246
247
|
};
|
247
248
|
|
249
|
+
// src/http/utils/content-type.ts
|
250
|
+
function getContentTypeDefinition(contentType) {
|
251
|
+
if (contentType.startsWith("application/") && contentType.includes("xml")) {
|
252
|
+
return "xml" /* Xml */;
|
253
|
+
}
|
254
|
+
if (contentType.toLowerCase() === "application/x-www-form-urlencoded") {
|
255
|
+
return "form" /* FormUrlEncoded */;
|
256
|
+
}
|
257
|
+
if (contentType.toLowerCase() === "text/event-stream") {
|
258
|
+
return "eventStream" /* EventStream */;
|
259
|
+
}
|
260
|
+
if (contentType.toLowerCase().startsWith("text/")) {
|
261
|
+
return "text" /* Text */;
|
262
|
+
}
|
263
|
+
if (contentType.toLowerCase().startsWith("image/")) {
|
264
|
+
return "image" /* Image */;
|
265
|
+
}
|
266
|
+
if (contentType.toLowerCase() === "application/octet-stream") {
|
267
|
+
return "binary" /* Binary */;
|
268
|
+
}
|
269
|
+
if (contentType.toLowerCase() === "application/json") {
|
270
|
+
return "json" /* Json */;
|
271
|
+
}
|
272
|
+
return "json" /* Json */;
|
273
|
+
}
|
274
|
+
|
248
275
|
// src/http/handlers/hook-handler.ts
|
249
276
|
var HookHandler = class {
|
250
277
|
constructor(hook) {
|
251
278
|
this.hook = hook;
|
252
279
|
}
|
253
280
|
async handle(request) {
|
281
|
+
var _a;
|
254
282
|
if (!this.next) {
|
255
283
|
throw new Error("No next handler set in hook handler.");
|
256
284
|
}
|
@@ -261,7 +289,25 @@ var HookHandler = class {
|
|
261
289
|
if (response.metadata.status < 400) {
|
262
290
|
return await hook.afterResponse(nextRequest, response, hookParams);
|
263
291
|
}
|
264
|
-
|
292
|
+
const rawContentType = ((_a = response.metadata.headers["content-type"]) == null ? void 0 : _a.toLocaleLowerCase()) || "";
|
293
|
+
const contentType = getContentTypeDefinition(rawContentType);
|
294
|
+
const statusCode = response.metadata.status;
|
295
|
+
const error = request.errors.find((error2) => {
|
296
|
+
return error2.contentType === contentType && error2.status === statusCode;
|
297
|
+
});
|
298
|
+
if (error) {
|
299
|
+
const decodedBody2 = new TextDecoder().decode(response.raw);
|
300
|
+
const json = JSON.parse(decodedBody2);
|
301
|
+
new error.error((json == null ? void 0 : json.message) || "", json).throw();
|
302
|
+
}
|
303
|
+
const decodedBody = new TextDecoder().decode(response.raw);
|
304
|
+
throw new HttpError(
|
305
|
+
response.metadata,
|
306
|
+
response.raw,
|
307
|
+
`Unexpected response body for error status.
|
308
|
+
StatusCode: ${response.metadata.status}
|
309
|
+
Body: ${decodedBody}`
|
310
|
+
);
|
265
311
|
}
|
266
312
|
async *stream(request) {
|
267
313
|
if (!this.next) {
|
@@ -296,7 +342,7 @@ var ResponseMatcher = class {
|
|
296
342
|
getResponseDefinition(response) {
|
297
343
|
var _a;
|
298
344
|
const rawContentType = ((_a = response.metadata.headers["content-type"]) == null ? void 0 : _a.toLocaleLowerCase()) || "";
|
299
|
-
const contentType =
|
345
|
+
const contentType = getContentTypeDefinition(rawContentType);
|
300
346
|
const statusCode = response.metadata.status;
|
301
347
|
if (!this.responses.length) {
|
302
348
|
return;
|
@@ -308,30 +354,6 @@ var ResponseMatcher = class {
|
|
308
354
|
return response2.contentType === contentType && response2.status === statusCode;
|
309
355
|
});
|
310
356
|
}
|
311
|
-
getContentTypeDefinition(contentType) {
|
312
|
-
if (contentType.startsWith("application/") && contentType.includes("xml")) {
|
313
|
-
return "xml" /* Xml */;
|
314
|
-
}
|
315
|
-
if (contentType.toLowerCase() === "application/x-www-form-urlencoded") {
|
316
|
-
return "form" /* FormUrlEncoded */;
|
317
|
-
}
|
318
|
-
if (contentType.toLowerCase() === "text/event-stream") {
|
319
|
-
return "eventStream" /* EventStream */;
|
320
|
-
}
|
321
|
-
if (contentType.toLowerCase().startsWith("text/")) {
|
322
|
-
return "text" /* Text */;
|
323
|
-
}
|
324
|
-
if (contentType.toLowerCase().startsWith("image/")) {
|
325
|
-
return "image" /* Image */;
|
326
|
-
}
|
327
|
-
if (contentType.toLowerCase() === "application/octet-stream") {
|
328
|
-
return "binary" /* Binary */;
|
329
|
-
}
|
330
|
-
if (contentType.toLowerCase() === "application/json") {
|
331
|
-
return "json" /* Json */;
|
332
|
-
}
|
333
|
-
return "json" /* Json */;
|
334
|
-
}
|
335
357
|
};
|
336
358
|
|
337
359
|
// src/http/handlers/response-validation-handler.ts
|
@@ -471,6 +493,29 @@ var ResponseValidationHandler = class {
|
|
471
493
|
}
|
472
494
|
};
|
473
495
|
|
496
|
+
// src/http/handlers/request-validation-handler.ts
|
497
|
+
var import_zod2 = require("zod");
|
498
|
+
|
499
|
+
// src/http/errors/validation-error.ts
|
500
|
+
var ValidationError = class extends Error {
|
501
|
+
constructor(zodError, object) {
|
502
|
+
let actual;
|
503
|
+
try {
|
504
|
+
actual = JSON.stringify(object, void 0, 2);
|
505
|
+
} catch (err) {
|
506
|
+
actual = object;
|
507
|
+
}
|
508
|
+
const error = [
|
509
|
+
`ValidationError:`,
|
510
|
+
...zodError.issues.map((issue) => ` Property: ${issue.path.join(".")}. Message: ${issue.message}`),
|
511
|
+
" Validated:",
|
512
|
+
...actual.split("\n").map((line) => ` ${line}`)
|
513
|
+
].join("\n");
|
514
|
+
super(error);
|
515
|
+
this.error = error;
|
516
|
+
}
|
517
|
+
};
|
518
|
+
|
474
519
|
// src/http/handlers/request-validation-handler.ts
|
475
520
|
var RequestValidationHandler = class {
|
476
521
|
async handle(request) {
|
@@ -490,8 +535,16 @@ var RequestValidationHandler = class {
|
|
490
535
|
validateRequest(request) {
|
491
536
|
var _a, _b;
|
492
537
|
if (request.requestContentType === "json" /* Json */) {
|
493
|
-
|
494
|
-
|
538
|
+
try {
|
539
|
+
const parsedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
|
540
|
+
request.body = JSON.stringify(parsedBody);
|
541
|
+
} catch (error) {
|
542
|
+
if (error instanceof import_zod2.ZodError) {
|
543
|
+
throw new ValidationError(error, request.body);
|
544
|
+
}
|
545
|
+
throw error;
|
546
|
+
}
|
547
|
+
} else if (request.requestContentType === "xml" /* Xml */ || request.requestContentType === "text" /* Text */ || request.requestContentType === "image" /* Image */ || request.requestContentType === "binary" /* Binary */) {
|
495
548
|
request.body = request.body;
|
496
549
|
} else if (request.requestContentType === "form" /* FormUrlEncoded */) {
|
497
550
|
request.body = this.toFormUrlEncoded(request);
|
@@ -516,14 +569,18 @@ var RequestValidationHandler = class {
|
|
516
569
|
if (validatedBody instanceof FormData) {
|
517
570
|
const params = new URLSearchParams();
|
518
571
|
validatedBody.forEach((value, key) => {
|
519
|
-
|
572
|
+
if (value != null) {
|
573
|
+
params.append(key, value.toString());
|
574
|
+
}
|
520
575
|
});
|
521
576
|
return params.toString();
|
522
577
|
}
|
523
578
|
if (typeof validatedBody === "object" && !Array.isArray(validatedBody)) {
|
524
579
|
const params = new URLSearchParams();
|
525
580
|
for (const [key, value] of Object.entries(validatedBody)) {
|
526
|
-
|
581
|
+
if (value != null) {
|
582
|
+
params.append(key, `${value}`);
|
583
|
+
}
|
527
584
|
}
|
528
585
|
return params.toString();
|
529
586
|
}
|
@@ -748,32 +805,42 @@ var OAuthHandler = class {
|
|
748
805
|
if (!this.next) {
|
749
806
|
throw new Error(`No next handler set in OAuthHandler`);
|
750
807
|
}
|
751
|
-
|
808
|
+
if (!!request.config.accessToken) {
|
809
|
+
this.addAccessTokenHeader(request, request.config.accessToken);
|
810
|
+
return this.next.handle(request);
|
811
|
+
}
|
812
|
+
if (!request.config.clientId || !request.config.clientSecret) {
|
813
|
+
return this.next.handle(request);
|
814
|
+
}
|
815
|
+
await this.manageToken(request);
|
752
816
|
return this.next.handle(request);
|
753
817
|
}
|
754
818
|
async *stream(request) {
|
755
819
|
if (!this.next) {
|
756
820
|
throw new Error(`No next handler set in OAuthHandler`);
|
757
821
|
}
|
758
|
-
await this.
|
822
|
+
await this.manageToken(request);
|
759
823
|
yield* this.next.stream(request);
|
760
824
|
}
|
761
|
-
async
|
825
|
+
async manageToken(request) {
|
762
826
|
if (!request.scopes) {
|
763
827
|
return;
|
764
828
|
}
|
765
829
|
const token = await request.tokenManager.getToken(request.scopes, request.config);
|
766
830
|
if (token.accessToken) {
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
831
|
+
this.addAccessTokenHeader(request, token.accessToken);
|
832
|
+
}
|
833
|
+
}
|
834
|
+
addAccessTokenHeader(request, token) {
|
835
|
+
request.addHeaderParam("Authorization", {
|
836
|
+
key: "Authorization",
|
837
|
+
value: `Bearer ${token}`,
|
838
|
+
explode: false,
|
839
|
+
encode: false,
|
840
|
+
style: "simple" /* SIMPLE */,
|
841
|
+
isLimit: false,
|
842
|
+
isOffset: false
|
843
|
+
});
|
777
844
|
}
|
778
845
|
};
|
779
846
|
|
@@ -855,10 +922,13 @@ var BaseService = class {
|
|
855
922
|
set oAuthBaseUrl(oAuthBaseUrl) {
|
856
923
|
this.config.oAuthBaseUrl = oAuthBaseUrl;
|
857
924
|
}
|
925
|
+
set accessToken(accessToken) {
|
926
|
+
this.config.accessToken = accessToken;
|
927
|
+
}
|
858
928
|
};
|
859
929
|
|
860
930
|
// src/http/transport/request-builder.ts
|
861
|
-
var
|
931
|
+
var import_zod3 = __toESM(require("zod"));
|
862
932
|
|
863
933
|
// src/http/serialization/path-serializer.ts
|
864
934
|
var PathSerializer = class extends Serializer {
|
@@ -921,6 +991,7 @@ var Request = class {
|
|
921
991
|
this.headers = params.headers;
|
922
992
|
this.queryParams = params.queryParams;
|
923
993
|
this.responses = params.responses;
|
994
|
+
this.errors = params.errors;
|
924
995
|
this.requestSchema = params.requestSchema;
|
925
996
|
this.requestContentType = params.requestContentType;
|
926
997
|
this.retry = params.retry;
|
@@ -993,21 +1064,22 @@ var Request = class {
|
|
993
1064
|
return `${baseUrl}${path}${queryString}`;
|
994
1065
|
}
|
995
1066
|
copy(overrides) {
|
996
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
1067
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
997
1068
|
const createRequestParams = {
|
998
1069
|
baseUrl: (_a = overrides == null ? void 0 : overrides.baseUrl) != null ? _a : this.baseUrl,
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1070
|
+
errors: (_b = overrides == null ? void 0 : overrides.errors) != null ? _b : this.errors,
|
1071
|
+
method: (_c = overrides == null ? void 0 : overrides.method) != null ? _c : this.method,
|
1072
|
+
path: (_d = overrides == null ? void 0 : overrides.path) != null ? _d : this.path,
|
1073
|
+
body: (_e = overrides == null ? void 0 : overrides.body) != null ? _e : this.body,
|
1074
|
+
config: (_f = overrides == null ? void 0 : overrides.config) != null ? _f : this.config,
|
1075
|
+
pathParams: (_g = overrides == null ? void 0 : overrides.pathParams) != null ? _g : this.pathParams,
|
1076
|
+
queryParams: (_h = overrides == null ? void 0 : overrides.queryParams) != null ? _h : this.queryParams,
|
1077
|
+
headers: (_i = overrides == null ? void 0 : overrides.headers) != null ? _i : this.headers,
|
1078
|
+
responses: (_j = overrides == null ? void 0 : overrides.responses) != null ? _j : this.responses,
|
1079
|
+
requestSchema: (_k = overrides == null ? void 0 : overrides.requestSchema) != null ? _k : this.requestSchema,
|
1080
|
+
requestContentType: (_l = overrides == null ? void 0 : overrides.requestContentType) != null ? _l : this.requestContentType,
|
1081
|
+
retry: (_m = overrides == null ? void 0 : overrides.retry) != null ? _m : this.retry,
|
1082
|
+
validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation,
|
1011
1083
|
scopes: overrides == null ? void 0 : overrides.scopes,
|
1012
1084
|
tokenManager: this.tokenManager
|
1013
1085
|
};
|
@@ -1054,6 +1126,12 @@ var Request = class {
|
|
1054
1126
|
}
|
1055
1127
|
};
|
1056
1128
|
|
1129
|
+
// src/http/environment.ts
|
1130
|
+
var Environment = /* @__PURE__ */ ((Environment2) => {
|
1131
|
+
Environment2["DEFAULT"] = "https://api.celitech.net/v1";
|
1132
|
+
return Environment2;
|
1133
|
+
})(Environment || {});
|
1134
|
+
|
1057
1135
|
// src/http/transport/request-builder.ts
|
1058
1136
|
var RequestBuilder = class {
|
1059
1137
|
constructor() {
|
@@ -1063,11 +1141,12 @@ var RequestBuilder = class {
|
|
1063
1141
|
path: "",
|
1064
1142
|
config: { clientId: "", clientSecret: "" },
|
1065
1143
|
responses: [],
|
1066
|
-
|
1144
|
+
errors: [],
|
1145
|
+
requestSchema: import_zod3.default.any(),
|
1067
1146
|
requestContentType: "json" /* Json */,
|
1068
1147
|
retry: {
|
1069
|
-
attempts:
|
1070
|
-
delayMs:
|
1148
|
+
attempts: 1,
|
1149
|
+
delayMs: 0
|
1071
1150
|
},
|
1072
1151
|
validation: {
|
1073
1152
|
responseValidation: true
|
@@ -1105,9 +1184,9 @@ var RequestBuilder = class {
|
|
1105
1184
|
}
|
1106
1185
|
return this;
|
1107
1186
|
}
|
1108
|
-
setBaseUrl(
|
1109
|
-
if (
|
1110
|
-
this.params.baseUrl =
|
1187
|
+
setBaseUrl(baseUrl) {
|
1188
|
+
if (baseUrl) {
|
1189
|
+
this.params.baseUrl = baseUrl;
|
1111
1190
|
}
|
1112
1191
|
return this;
|
1113
1192
|
}
|
@@ -1143,10 +1222,59 @@ var RequestBuilder = class {
|
|
1143
1222
|
this.params.tokenManager = tokenManager;
|
1144
1223
|
return this;
|
1145
1224
|
}
|
1225
|
+
addAccessTokenAuth(accessToken, prefix) {
|
1226
|
+
if (accessToken === void 0) {
|
1227
|
+
return this;
|
1228
|
+
}
|
1229
|
+
this.params.headers.set("Authorization", {
|
1230
|
+
key: "Authorization",
|
1231
|
+
value: `${prefix != null ? prefix : "BEARER"} ${accessToken}`,
|
1232
|
+
explode: false,
|
1233
|
+
style: "simple" /* SIMPLE */,
|
1234
|
+
encode: true,
|
1235
|
+
isLimit: false,
|
1236
|
+
isOffset: false
|
1237
|
+
});
|
1238
|
+
return this;
|
1239
|
+
}
|
1240
|
+
addBasicAuth(username, password) {
|
1241
|
+
if (username === void 0 || password === void 0) {
|
1242
|
+
return this;
|
1243
|
+
}
|
1244
|
+
this.params.headers.set("Authorization", {
|
1245
|
+
key: "Authorization",
|
1246
|
+
value: `Basic ${this.toBase64(`${username}:${password}`)}`,
|
1247
|
+
explode: false,
|
1248
|
+
style: "simple" /* SIMPLE */,
|
1249
|
+
encode: true,
|
1250
|
+
isLimit: false,
|
1251
|
+
isOffset: false
|
1252
|
+
});
|
1253
|
+
return this;
|
1254
|
+
}
|
1255
|
+
addApiKeyAuth(apiKey, keyName) {
|
1256
|
+
if (apiKey === void 0) {
|
1257
|
+
return this;
|
1258
|
+
}
|
1259
|
+
this.params.headers.set(keyName != null ? keyName : "X-API-KEY", {
|
1260
|
+
key: keyName != null ? keyName : "X-API-KEY",
|
1261
|
+
value: apiKey,
|
1262
|
+
explode: false,
|
1263
|
+
style: "simple" /* SIMPLE */,
|
1264
|
+
encode: true,
|
1265
|
+
isLimit: false,
|
1266
|
+
isOffset: false
|
1267
|
+
});
|
1268
|
+
return this;
|
1269
|
+
}
|
1146
1270
|
addResponse(response) {
|
1147
1271
|
this.params.responses.push(response);
|
1148
1272
|
return this;
|
1149
1273
|
}
|
1274
|
+
addError(error) {
|
1275
|
+
this.params.errors.push(error);
|
1276
|
+
return this;
|
1277
|
+
}
|
1150
1278
|
addBody(body) {
|
1151
1279
|
if (body !== void 0) {
|
1152
1280
|
this.params.body = body;
|
@@ -1204,30 +1332,41 @@ var RequestBuilder = class {
|
|
1204
1332
|
build() {
|
1205
1333
|
return new Request(this.params);
|
1206
1334
|
}
|
1335
|
+
toBase64(str) {
|
1336
|
+
if (typeof window === "undefined") {
|
1337
|
+
return Buffer.from(str, "utf-8").toString("base64");
|
1338
|
+
} else {
|
1339
|
+
return btoa(unescape(encodeURIComponent(str)));
|
1340
|
+
}
|
1341
|
+
}
|
1207
1342
|
};
|
1208
1343
|
|
1209
1344
|
// src/services/o-auth/models/get-access-token-request.ts
|
1210
|
-
var
|
1211
|
-
var getAccessTokenRequest =
|
1212
|
-
return
|
1213
|
-
grantType:
|
1214
|
-
clientId:
|
1215
|
-
clientSecret:
|
1345
|
+
var import_zod4 = require("zod");
|
1346
|
+
var getAccessTokenRequest = import_zod4.z.lazy(() => {
|
1347
|
+
return import_zod4.z.object({
|
1348
|
+
grantType: import_zod4.z.string().optional(),
|
1349
|
+
clientId: import_zod4.z.string().optional(),
|
1350
|
+
clientSecret: import_zod4.z.string().optional()
|
1216
1351
|
});
|
1217
1352
|
});
|
1218
|
-
var getAccessTokenRequestResponse =
|
1219
|
-
return
|
1220
|
-
grant_type:
|
1221
|
-
client_id:
|
1222
|
-
client_secret:
|
1353
|
+
var getAccessTokenRequestResponse = import_zod4.z.lazy(() => {
|
1354
|
+
return import_zod4.z.object({
|
1355
|
+
grant_type: import_zod4.z.string().optional(),
|
1356
|
+
client_id: import_zod4.z.string().optional(),
|
1357
|
+
client_secret: import_zod4.z.string().optional()
|
1223
1358
|
}).transform((data) => ({
|
1224
1359
|
grantType: data["grant_type"],
|
1225
1360
|
clientId: data["client_id"],
|
1226
1361
|
clientSecret: data["client_secret"]
|
1227
1362
|
}));
|
1228
1363
|
});
|
1229
|
-
var getAccessTokenRequestRequest =
|
1230
|
-
return
|
1364
|
+
var getAccessTokenRequestRequest = import_zod4.z.lazy(() => {
|
1365
|
+
return import_zod4.z.object({
|
1366
|
+
grantType: import_zod4.z.string().optional(),
|
1367
|
+
clientId: import_zod4.z.string().optional(),
|
1368
|
+
clientSecret: import_zod4.z.string().optional()
|
1369
|
+
}).transform((data) => ({
|
1231
1370
|
grant_type: data["grantType"],
|
1232
1371
|
client_id: data["clientId"],
|
1233
1372
|
client_secret: data["clientSecret"]
|
@@ -1235,41 +1374,46 @@ var getAccessTokenRequestRequest = import_zod3.z.lazy(() => {
|
|
1235
1374
|
});
|
1236
1375
|
|
1237
1376
|
// src/services/o-auth/models/get-access-token-ok-response.ts
|
1238
|
-
var
|
1239
|
-
var getAccessTokenOkResponse =
|
1240
|
-
return
|
1241
|
-
accessToken:
|
1242
|
-
tokenType:
|
1243
|
-
expiresIn:
|
1377
|
+
var import_zod5 = require("zod");
|
1378
|
+
var getAccessTokenOkResponse = import_zod5.z.lazy(() => {
|
1379
|
+
return import_zod5.z.object({
|
1380
|
+
accessToken: import_zod5.z.string().optional(),
|
1381
|
+
tokenType: import_zod5.z.string().optional(),
|
1382
|
+
expiresIn: import_zod5.z.number().optional()
|
1244
1383
|
});
|
1245
1384
|
});
|
1246
|
-
var getAccessTokenOkResponseResponse =
|
1247
|
-
return
|
1248
|
-
access_token:
|
1249
|
-
token_type:
|
1250
|
-
expires_in:
|
1385
|
+
var getAccessTokenOkResponseResponse = import_zod5.z.lazy(() => {
|
1386
|
+
return import_zod5.z.object({
|
1387
|
+
access_token: import_zod5.z.string().optional(),
|
1388
|
+
token_type: import_zod5.z.string().optional(),
|
1389
|
+
expires_in: import_zod5.z.number().optional()
|
1251
1390
|
}).transform((data) => ({
|
1252
1391
|
accessToken: data["access_token"],
|
1253
1392
|
tokenType: data["token_type"],
|
1254
1393
|
expiresIn: data["expires_in"]
|
1255
1394
|
}));
|
1256
1395
|
});
|
1257
|
-
var getAccessTokenOkResponseRequest =
|
1258
|
-
return
|
1396
|
+
var getAccessTokenOkResponseRequest = import_zod5.z.lazy(() => {
|
1397
|
+
return import_zod5.z.object({
|
1398
|
+
accessToken: import_zod5.z.string().optional(),
|
1399
|
+
tokenType: import_zod5.z.string().optional(),
|
1400
|
+
expiresIn: import_zod5.z.number().optional()
|
1401
|
+
}).transform((data) => ({
|
1259
1402
|
access_token: data["accessToken"],
|
1260
1403
|
token_type: data["tokenType"],
|
1261
1404
|
expires_in: data["expiresIn"]
|
1262
1405
|
}));
|
1263
1406
|
});
|
1264
1407
|
|
1265
|
-
// src/services/o-auth/o-auth.ts
|
1408
|
+
// src/services/o-auth/o-auth-service.ts
|
1266
1409
|
var OAuthService = class extends BaseService {
|
1267
1410
|
/**
|
1268
1411
|
* This endpoint was added by liblab
|
1412
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
1269
1413
|
* @returns {Promise<HttpResponse<GetAccessTokenOkResponse>>} Successful Response
|
1270
1414
|
*/
|
1271
1415
|
async getAccessToken(body, requestConfig) {
|
1272
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/oauth2/token").setRequestSchema(getAccessTokenRequestRequest).setTokenManager(this.tokenManager).setRequestContentType("form" /* FormUrlEncoded */).addResponse({
|
1416
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/oauth2/token").setRequestSchema(getAccessTokenRequestRequest).setTokenManager(this.tokenManager).setRequestContentType("form" /* FormUrlEncoded */).addResponse({
|
1273
1417
|
schema: getAccessTokenOkResponseResponse,
|
1274
1418
|
contentType: "json" /* Json */,
|
1275
1419
|
status: 200
|
@@ -1306,11 +1450,14 @@ var OAuthTokenManager = class {
|
|
1306
1450
|
if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
|
1307
1451
|
return this.token;
|
1308
1452
|
}
|
1453
|
+
if (!config.clientId || !config.clientSecret) {
|
1454
|
+
throw new Error("OAuthError: clientId and clientSecret are required for token management.");
|
1455
|
+
}
|
1309
1456
|
const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
|
1310
1457
|
const oAuth = new OAuthService(
|
1311
1458
|
{
|
1312
1459
|
...config,
|
1313
|
-
baseUrl: config.oAuthBaseUrl || "https://auth.celitech.net"
|
1460
|
+
baseUrl: config.oAuthBaseUrl || config.baseUrl || config.environment || "https://auth.celitech.net"
|
1314
1461
|
},
|
1315
1462
|
this
|
1316
1463
|
);
|
@@ -1336,37 +1483,37 @@ var OAuthTokenManager = class {
|
|
1336
1483
|
}
|
1337
1484
|
};
|
1338
1485
|
|
1339
|
-
// src/services/destinations/destinations.ts
|
1340
|
-
var
|
1486
|
+
// src/services/destinations/destinations-service.ts
|
1487
|
+
var import_zod10 = require("zod");
|
1341
1488
|
|
1342
1489
|
// src/services/destinations/models/list-destinations-ok-response.ts
|
1343
|
-
var
|
1490
|
+
var import_zod7 = require("zod");
|
1344
1491
|
|
1345
1492
|
// src/services/destinations/models/destinations.ts
|
1346
|
-
var
|
1347
|
-
var destinations =
|
1348
|
-
return
|
1349
|
-
name:
|
1350
|
-
destination:
|
1351
|
-
supportedCountries:
|
1493
|
+
var import_zod6 = require("zod");
|
1494
|
+
var destinations = import_zod6.z.lazy(() => {
|
1495
|
+
return import_zod6.z.object({
|
1496
|
+
name: import_zod6.z.string().optional(),
|
1497
|
+
destination: import_zod6.z.string().optional(),
|
1498
|
+
supportedCountries: import_zod6.z.array(import_zod6.z.string()).optional()
|
1352
1499
|
});
|
1353
1500
|
});
|
1354
|
-
var destinationsResponse =
|
1355
|
-
return
|
1356
|
-
name:
|
1357
|
-
destination:
|
1358
|
-
supportedCountries:
|
1501
|
+
var destinationsResponse = import_zod6.z.lazy(() => {
|
1502
|
+
return import_zod6.z.object({
|
1503
|
+
name: import_zod6.z.string().optional(),
|
1504
|
+
destination: import_zod6.z.string().optional(),
|
1505
|
+
supportedCountries: import_zod6.z.array(import_zod6.z.string()).optional()
|
1359
1506
|
}).transform((data) => ({
|
1360
1507
|
name: data["name"],
|
1361
1508
|
destination: data["destination"],
|
1362
1509
|
supportedCountries: data["supportedCountries"]
|
1363
1510
|
}));
|
1364
1511
|
});
|
1365
|
-
var destinationsRequest =
|
1366
|
-
return
|
1367
|
-
name:
|
1368
|
-
destination:
|
1369
|
-
supportedCountries:
|
1512
|
+
var destinationsRequest = import_zod6.z.lazy(() => {
|
1513
|
+
return import_zod6.z.object({
|
1514
|
+
name: import_zod6.z.string().optional(),
|
1515
|
+
destination: import_zod6.z.string().optional(),
|
1516
|
+
supportedCountries: import_zod6.z.array(import_zod6.z.string()).optional()
|
1370
1517
|
}).transform((data) => ({
|
1371
1518
|
name: data["name"],
|
1372
1519
|
destination: data["destination"],
|
@@ -1375,66 +1522,135 @@ var destinationsRequest = import_zod5.z.lazy(() => {
|
|
1375
1522
|
});
|
1376
1523
|
|
1377
1524
|
// src/services/destinations/models/list-destinations-ok-response.ts
|
1378
|
-
var listDestinationsOkResponse =
|
1379
|
-
return
|
1380
|
-
destinations:
|
1525
|
+
var listDestinationsOkResponse = import_zod7.z.lazy(() => {
|
1526
|
+
return import_zod7.z.object({
|
1527
|
+
destinations: import_zod7.z.array(destinations).optional()
|
1381
1528
|
});
|
1382
1529
|
});
|
1383
|
-
var listDestinationsOkResponseResponse =
|
1384
|
-
return
|
1385
|
-
destinations:
|
1530
|
+
var listDestinationsOkResponseResponse = import_zod7.z.lazy(() => {
|
1531
|
+
return import_zod7.z.object({
|
1532
|
+
destinations: import_zod7.z.array(destinationsResponse).optional()
|
1386
1533
|
}).transform((data) => ({
|
1387
1534
|
destinations: data["destinations"]
|
1388
1535
|
}));
|
1389
1536
|
});
|
1390
|
-
var listDestinationsOkResponseRequest =
|
1391
|
-
return
|
1537
|
+
var listDestinationsOkResponseRequest = import_zod7.z.lazy(() => {
|
1538
|
+
return import_zod7.z.object({
|
1539
|
+
destinations: import_zod7.z.array(destinationsRequest).optional()
|
1540
|
+
}).transform((data) => ({
|
1392
1541
|
destinations: data["destinations"]
|
1393
1542
|
}));
|
1394
1543
|
});
|
1395
1544
|
|
1396
|
-
// src/services/destinations/
|
1545
|
+
// src/services/destinations/models/__.ts
|
1546
|
+
var import_zod8 = require("zod");
|
1547
|
+
|
1548
|
+
// src/http/errors/throwable-error.ts
|
1549
|
+
var ThrowableError = class extends Error {
|
1550
|
+
constructor(message, response) {
|
1551
|
+
super(message);
|
1552
|
+
this.message = message;
|
1553
|
+
this.response = response;
|
1554
|
+
}
|
1555
|
+
throw() {
|
1556
|
+
throw this;
|
1557
|
+
}
|
1558
|
+
};
|
1559
|
+
|
1560
|
+
// src/services/destinations/models/__.ts
|
1561
|
+
var _response = import_zod8.z.lazy(() => {
|
1562
|
+
return import_zod8.z.object({
|
1563
|
+
message: import_zod8.z.string().optional()
|
1564
|
+
}).transform((data) => ({
|
1565
|
+
message: data["message"]
|
1566
|
+
}));
|
1567
|
+
});
|
1568
|
+
var __ = class extends ThrowableError {
|
1569
|
+
constructor(message, response) {
|
1570
|
+
super(message);
|
1571
|
+
this.message = message;
|
1572
|
+
this.response = response;
|
1573
|
+
const parsedResponse = _response.parse(response);
|
1574
|
+
this.message = parsedResponse.message || "";
|
1575
|
+
}
|
1576
|
+
throw() {
|
1577
|
+
throw new __(this.message, this.response);
|
1578
|
+
}
|
1579
|
+
};
|
1580
|
+
|
1581
|
+
// src/services/destinations/models/_1.ts
|
1582
|
+
var import_zod9 = require("zod");
|
1583
|
+
var _1Response = import_zod9.z.lazy(() => {
|
1584
|
+
return import_zod9.z.object({
|
1585
|
+
message: import_zod9.z.string().optional()
|
1586
|
+
}).transform((data) => ({
|
1587
|
+
message: data["message"]
|
1588
|
+
}));
|
1589
|
+
});
|
1590
|
+
var _1 = class extends ThrowableError {
|
1591
|
+
constructor(message, response) {
|
1592
|
+
super(message);
|
1593
|
+
this.message = message;
|
1594
|
+
this.response = response;
|
1595
|
+
const parsedResponse = _1Response.parse(response);
|
1596
|
+
this.message = parsedResponse.message || "";
|
1597
|
+
}
|
1598
|
+
throw() {
|
1599
|
+
throw new _1(this.message, this.response);
|
1600
|
+
}
|
1601
|
+
};
|
1602
|
+
|
1603
|
+
// src/services/destinations/destinations-service.ts
|
1397
1604
|
var DestinationsService = class extends BaseService {
|
1398
1605
|
/**
|
1399
1606
|
* List Destinations
|
1607
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
1400
1608
|
* @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} Successful Response
|
1401
1609
|
*/
|
1402
1610
|
async listDestinations(requestConfig) {
|
1403
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(
|
1611
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(import_zod10.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
1404
1612
|
schema: listDestinationsOkResponseResponse,
|
1405
1613
|
contentType: "json" /* Json */,
|
1406
1614
|
status: 200
|
1615
|
+
}).addError({
|
1616
|
+
error: __,
|
1617
|
+
contentType: "json" /* Json */,
|
1618
|
+
status: 400
|
1619
|
+
}).addError({
|
1620
|
+
error: _1,
|
1621
|
+
contentType: "json" /* Json */,
|
1622
|
+
status: 401
|
1407
1623
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
|
1408
1624
|
return this.client.call(request);
|
1409
1625
|
}
|
1410
1626
|
};
|
1411
1627
|
|
1412
|
-
// src/services/packages/packages.ts
|
1413
|
-
var
|
1628
|
+
// src/services/packages/packages-service.ts
|
1629
|
+
var import_zod15 = require("zod");
|
1414
1630
|
|
1415
1631
|
// src/services/packages/models/list-packages-ok-response.ts
|
1416
|
-
var
|
1632
|
+
var import_zod12 = require("zod");
|
1417
1633
|
|
1418
1634
|
// src/services/packages/models/packages.ts
|
1419
|
-
var
|
1420
|
-
var packages =
|
1421
|
-
return
|
1422
|
-
id:
|
1423
|
-
destination:
|
1424
|
-
dataLimitInBytes:
|
1425
|
-
minDays:
|
1426
|
-
maxDays:
|
1427
|
-
priceInCents:
|
1635
|
+
var import_zod11 = require("zod");
|
1636
|
+
var packages = import_zod11.z.lazy(() => {
|
1637
|
+
return import_zod11.z.object({
|
1638
|
+
id: import_zod11.z.string().optional(),
|
1639
|
+
destination: import_zod11.z.string().optional(),
|
1640
|
+
dataLimitInBytes: import_zod11.z.number().optional(),
|
1641
|
+
minDays: import_zod11.z.number().optional(),
|
1642
|
+
maxDays: import_zod11.z.number().optional(),
|
1643
|
+
priceInCents: import_zod11.z.number().optional()
|
1428
1644
|
});
|
1429
1645
|
});
|
1430
|
-
var packagesResponse =
|
1431
|
-
return
|
1432
|
-
id:
|
1433
|
-
destination:
|
1434
|
-
dataLimitInBytes:
|
1435
|
-
minDays:
|
1436
|
-
maxDays:
|
1437
|
-
priceInCents:
|
1646
|
+
var packagesResponse = import_zod11.z.lazy(() => {
|
1647
|
+
return import_zod11.z.object({
|
1648
|
+
id: import_zod11.z.string().optional(),
|
1649
|
+
destination: import_zod11.z.string().optional(),
|
1650
|
+
dataLimitInBytes: import_zod11.z.number().optional(),
|
1651
|
+
minDays: import_zod11.z.number().optional(),
|
1652
|
+
maxDays: import_zod11.z.number().optional(),
|
1653
|
+
priceInCents: import_zod11.z.number().optional()
|
1438
1654
|
}).transform((data) => ({
|
1439
1655
|
id: data["id"],
|
1440
1656
|
destination: data["destination"],
|
@@ -1444,14 +1660,14 @@ var packagesResponse = import_zod8.z.lazy(() => {
|
|
1444
1660
|
priceInCents: data["priceInCents"]
|
1445
1661
|
}));
|
1446
1662
|
});
|
1447
|
-
var packagesRequest =
|
1448
|
-
return
|
1449
|
-
id:
|
1450
|
-
destination:
|
1451
|
-
dataLimitInBytes:
|
1452
|
-
minDays:
|
1453
|
-
maxDays:
|
1454
|
-
priceInCents:
|
1663
|
+
var packagesRequest = import_zod11.z.lazy(() => {
|
1664
|
+
return import_zod11.z.object({
|
1665
|
+
id: import_zod11.z.string().optional(),
|
1666
|
+
destination: import_zod11.z.string().optional(),
|
1667
|
+
dataLimitInBytes: import_zod11.z.number().optional(),
|
1668
|
+
minDays: import_zod11.z.number().optional(),
|
1669
|
+
maxDays: import_zod11.z.number().optional(),
|
1670
|
+
priceInCents: import_zod11.z.number().optional()
|
1455
1671
|
}).transform((data) => ({
|
1456
1672
|
id: data["id"],
|
1457
1673
|
destination: data["destination"],
|
@@ -1463,47 +1679,110 @@ var packagesRequest = import_zod8.z.lazy(() => {
|
|
1463
1679
|
});
|
1464
1680
|
|
1465
1681
|
// src/services/packages/models/list-packages-ok-response.ts
|
1466
|
-
var listPackagesOkResponse =
|
1467
|
-
return
|
1468
|
-
packages:
|
1469
|
-
afterCursor:
|
1682
|
+
var listPackagesOkResponse = import_zod12.z.lazy(() => {
|
1683
|
+
return import_zod12.z.object({
|
1684
|
+
packages: import_zod12.z.array(packages).optional(),
|
1685
|
+
afterCursor: import_zod12.z.string().optional().nullable()
|
1470
1686
|
});
|
1471
1687
|
});
|
1472
|
-
var listPackagesOkResponseResponse =
|
1473
|
-
return
|
1474
|
-
packages:
|
1475
|
-
afterCursor:
|
1688
|
+
var listPackagesOkResponseResponse = import_zod12.z.lazy(() => {
|
1689
|
+
return import_zod12.z.object({
|
1690
|
+
packages: import_zod12.z.array(packagesResponse).optional(),
|
1691
|
+
afterCursor: import_zod12.z.string().optional().nullable()
|
1476
1692
|
}).transform((data) => ({
|
1477
1693
|
packages: data["packages"],
|
1478
1694
|
afterCursor: data["afterCursor"]
|
1479
1695
|
}));
|
1480
1696
|
});
|
1481
|
-
var listPackagesOkResponseRequest =
|
1482
|
-
return
|
1697
|
+
var listPackagesOkResponseRequest = import_zod12.z.lazy(() => {
|
1698
|
+
return import_zod12.z.object({
|
1699
|
+
packages: import_zod12.z.array(packagesRequest).optional(),
|
1700
|
+
afterCursor: import_zod12.z.string().optional().nullable()
|
1701
|
+
}).transform((data) => ({
|
1483
1702
|
packages: data["packages"],
|
1484
1703
|
afterCursor: data["afterCursor"]
|
1485
1704
|
}));
|
1486
1705
|
});
|
1487
1706
|
|
1488
|
-
// src/services/packages/
|
1707
|
+
// src/services/packages/models/_2.ts
|
1708
|
+
var import_zod13 = require("zod");
|
1709
|
+
var _2Response = import_zod13.z.lazy(() => {
|
1710
|
+
return import_zod13.z.object({
|
1711
|
+
message: import_zod13.z.string().optional()
|
1712
|
+
}).transform((data) => ({
|
1713
|
+
message: data["message"]
|
1714
|
+
}));
|
1715
|
+
});
|
1716
|
+
var _2 = class extends ThrowableError {
|
1717
|
+
constructor(message, response) {
|
1718
|
+
super(message);
|
1719
|
+
this.message = message;
|
1720
|
+
this.response = response;
|
1721
|
+
const parsedResponse = _2Response.parse(response);
|
1722
|
+
this.message = parsedResponse.message || "";
|
1723
|
+
}
|
1724
|
+
throw() {
|
1725
|
+
throw new _2(this.message, this.response);
|
1726
|
+
}
|
1727
|
+
};
|
1728
|
+
|
1729
|
+
// src/services/packages/models/_3.ts
|
1730
|
+
var import_zod14 = require("zod");
|
1731
|
+
var _3Response = import_zod14.z.lazy(() => {
|
1732
|
+
return import_zod14.z.object({
|
1733
|
+
message: import_zod14.z.string().optional()
|
1734
|
+
}).transform((data) => ({
|
1735
|
+
message: data["message"]
|
1736
|
+
}));
|
1737
|
+
});
|
1738
|
+
var _3 = class extends ThrowableError {
|
1739
|
+
constructor(message, response) {
|
1740
|
+
super(message);
|
1741
|
+
this.message = message;
|
1742
|
+
this.response = response;
|
1743
|
+
const parsedResponse = _3Response.parse(response);
|
1744
|
+
this.message = parsedResponse.message || "";
|
1745
|
+
}
|
1746
|
+
throw() {
|
1747
|
+
throw new _3(this.message, this.response);
|
1748
|
+
}
|
1749
|
+
};
|
1750
|
+
|
1751
|
+
// src/services/packages/packages-service.ts
|
1489
1752
|
var PackagesService = class extends BaseService {
|
1490
1753
|
/**
|
1491
1754
|
* List Packages
|
1492
|
-
* @param {string} [destination] - ISO representation of the package's destination.
|
1493
|
-
* @param {string} [startDate] - Start date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months.
|
1494
|
-
* @param {string} [endDate] - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
|
1495
|
-
* @param {
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1755
|
+
* @param {string} [params.destination] - ISO representation of the package's destination.
|
1756
|
+
* @param {string} [params.startDate] - Start date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months.
|
1757
|
+
* @param {string} [params.endDate] - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
|
1758
|
+
* @param {number} [params.dataLimitInGb] - Size of the package in GB.
|
1759
|
+
|
1760
|
+
For **limited packages**, the available options are: **0.5, 1, 2, 3, 5, 8, 20GB**.
|
1761
|
+
|
1762
|
+
For **unlimited packages** (available to Region-3), please use **-1** as an identifier.
|
1763
|
+
|
1764
|
+
* @param {boolean} [params.includeUnlimited] - A boolean flag to include the **unlimited packages** in the response. The flag is false by default.
|
1765
|
+
* @param {string} [params.afterCursor] - To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
|
1766
|
+
* @param {number} [params.limit] - Maximum number of packages to be returned in the response. The value must be greater than 0 and less than or equal to 160. If not provided, the default value is 20
|
1767
|
+
* @param {number} [params.startTime] - Epoch value representing the start time of the package's validity. This timestamp can be set to the current time or any time within the next 12 months
|
1768
|
+
* @param {number} [params.endTime] - Epoch value representing the end time of the package's validity. End time can be maximum 90 days after Start time
|
1769
|
+
* @param {number} [params.duration] - Duration in seconds for the package's validity. If this parameter is present, it will override the startTime and endTime parameters. The maximum duration for a package's validity period is 90 days
|
1770
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
1500
1771
|
* @returns {Promise<HttpResponse<ListPackagesOkResponse>>} Successful Response
|
1501
1772
|
*/
|
1502
1773
|
async listPackages(params, requestConfig) {
|
1503
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(
|
1774
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(import_zod15.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
1504
1775
|
schema: listPackagesOkResponseResponse,
|
1505
1776
|
contentType: "json" /* Json */,
|
1506
1777
|
status: 200
|
1778
|
+
}).addError({
|
1779
|
+
error: _2,
|
1780
|
+
contentType: "json" /* Json */,
|
1781
|
+
status: 400
|
1782
|
+
}).addError({
|
1783
|
+
error: _3,
|
1784
|
+
contentType: "json" /* Json */,
|
1785
|
+
status: 401
|
1507
1786
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
|
1508
1787
|
key: "destination",
|
1509
1788
|
value: params == null ? void 0 : params.destination
|
@@ -1513,6 +1792,12 @@ var PackagesService = class extends BaseService {
|
|
1513
1792
|
}).addQueryParam({
|
1514
1793
|
key: "endDate",
|
1515
1794
|
value: params == null ? void 0 : params.endDate
|
1795
|
+
}).addQueryParam({
|
1796
|
+
key: "dataLimitInGB",
|
1797
|
+
value: params == null ? void 0 : params.dataLimitInGb
|
1798
|
+
}).addQueryParam({
|
1799
|
+
key: "includeUnlimited",
|
1800
|
+
value: params == null ? void 0 : params.includeUnlimited
|
1516
1801
|
}).addQueryParam({
|
1517
1802
|
key: "afterCursor",
|
1518
1803
|
value: params == null ? void 0 : params.afterCursor
|
@@ -1533,197 +1818,447 @@ var PackagesService = class extends BaseService {
|
|
1533
1818
|
}
|
1534
1819
|
};
|
1535
1820
|
|
1536
|
-
// src/services/purchases/purchases.ts
|
1537
|
-
var
|
1538
|
-
|
1539
|
-
// src/services/purchases/models/list-purchases-ok-response.ts
|
1540
|
-
var import_zod14 = require("zod");
|
1541
|
-
|
1542
|
-
// src/services/purchases/models/purchases.ts
|
1543
|
-
var import_zod13 = require("zod");
|
1821
|
+
// src/services/purchases/purchases-service.ts
|
1822
|
+
var import_zod47 = require("zod");
|
1544
1823
|
|
1545
|
-
// src/services/purchases/models/
|
1546
|
-
var
|
1547
|
-
var
|
1548
|
-
return
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1824
|
+
// src/services/purchases/models/create-purchase-v2-request.ts
|
1825
|
+
var import_zod16 = require("zod");
|
1826
|
+
var createPurchaseV2Request = import_zod16.z.lazy(() => {
|
1827
|
+
return import_zod16.z.object({
|
1828
|
+
destination: import_zod16.z.string(),
|
1829
|
+
dataLimitInGb: import_zod16.z.number(),
|
1830
|
+
quantity: import_zod16.z.number().gte(1).lte(5),
|
1831
|
+
email: import_zod16.z.string().optional(),
|
1832
|
+
referenceId: import_zod16.z.string().optional(),
|
1833
|
+
networkBrand: import_zod16.z.string().optional(),
|
1834
|
+
emailBrand: import_zod16.z.string().optional()
|
1554
1835
|
});
|
1555
1836
|
});
|
1556
|
-
var
|
1557
|
-
return
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1837
|
+
var createPurchaseV2RequestResponse = import_zod16.z.lazy(() => {
|
1838
|
+
return import_zod16.z.object({
|
1839
|
+
destination: import_zod16.z.string(),
|
1840
|
+
dataLimitInGB: import_zod16.z.number(),
|
1841
|
+
quantity: import_zod16.z.number().gte(1).lte(5),
|
1842
|
+
email: import_zod16.z.string().optional(),
|
1843
|
+
referenceId: import_zod16.z.string().optional(),
|
1844
|
+
networkBrand: import_zod16.z.string().optional(),
|
1845
|
+
emailBrand: import_zod16.z.string().optional()
|
1563
1846
|
}).transform((data) => ({
|
1564
|
-
id: data["id"],
|
1565
|
-
dataLimitInBytes: data["dataLimitInBytes"],
|
1566
1847
|
destination: data["destination"],
|
1567
|
-
|
1568
|
-
|
1848
|
+
dataLimitInGb: data["dataLimitInGB"],
|
1849
|
+
quantity: data["quantity"],
|
1850
|
+
email: data["email"],
|
1851
|
+
referenceId: data["referenceId"],
|
1852
|
+
networkBrand: data["networkBrand"],
|
1853
|
+
emailBrand: data["emailBrand"]
|
1569
1854
|
}));
|
1570
1855
|
});
|
1571
|
-
var
|
1572
|
-
return
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1856
|
+
var createPurchaseV2RequestRequest = import_zod16.z.lazy(() => {
|
1857
|
+
return import_zod16.z.object({
|
1858
|
+
destination: import_zod16.z.string(),
|
1859
|
+
dataLimitInGb: import_zod16.z.number(),
|
1860
|
+
quantity: import_zod16.z.number().gte(1).lte(5),
|
1861
|
+
email: import_zod16.z.string().optional(),
|
1862
|
+
referenceId: import_zod16.z.string().optional(),
|
1863
|
+
networkBrand: import_zod16.z.string().optional(),
|
1864
|
+
emailBrand: import_zod16.z.string().optional()
|
1578
1865
|
}).transform((data) => ({
|
1579
|
-
id: data["id"],
|
1580
|
-
dataLimitInBytes: data["dataLimitInBytes"],
|
1581
1866
|
destination: data["destination"],
|
1582
|
-
|
1583
|
-
|
1867
|
+
dataLimitInGB: data["dataLimitInGb"],
|
1868
|
+
quantity: data["quantity"],
|
1869
|
+
email: data["email"],
|
1870
|
+
referenceId: data["referenceId"],
|
1871
|
+
networkBrand: data["networkBrand"],
|
1872
|
+
emailBrand: data["emailBrand"]
|
1584
1873
|
}));
|
1585
1874
|
});
|
1586
1875
|
|
1587
|
-
// src/services/purchases/models/
|
1588
|
-
var
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1876
|
+
// src/services/purchases/models/create-purchase-v2-ok-response.ts
|
1877
|
+
var import_zod19 = require("zod");
|
1878
|
+
|
1879
|
+
// src/services/purchases/models/create-purchase-v2-ok-response-purchase.ts
|
1880
|
+
var import_zod17 = require("zod");
|
1881
|
+
var createPurchaseV2OkResponsePurchase = import_zod17.z.lazy(() => {
|
1882
|
+
return import_zod17.z.object({
|
1883
|
+
id: import_zod17.z.string().optional(),
|
1884
|
+
packageId: import_zod17.z.string().optional(),
|
1885
|
+
createdDate: import_zod17.z.string().optional()
|
1592
1886
|
});
|
1593
1887
|
});
|
1594
|
-
var
|
1595
|
-
return
|
1596
|
-
|
1888
|
+
var createPurchaseV2OkResponsePurchaseResponse = import_zod17.z.lazy(() => {
|
1889
|
+
return import_zod17.z.object({
|
1890
|
+
id: import_zod17.z.string().optional(),
|
1891
|
+
packageId: import_zod17.z.string().optional(),
|
1892
|
+
createdDate: import_zod17.z.string().optional()
|
1597
1893
|
}).transform((data) => ({
|
1598
|
-
|
1894
|
+
id: data["id"],
|
1895
|
+
packageId: data["packageId"],
|
1896
|
+
createdDate: data["createdDate"]
|
1599
1897
|
}));
|
1600
1898
|
});
|
1601
|
-
var
|
1602
|
-
return
|
1603
|
-
|
1899
|
+
var createPurchaseV2OkResponsePurchaseRequest = import_zod17.z.lazy(() => {
|
1900
|
+
return import_zod17.z.object({
|
1901
|
+
id: import_zod17.z.string().optional(),
|
1902
|
+
packageId: import_zod17.z.string().optional(),
|
1903
|
+
createdDate: import_zod17.z.string().optional()
|
1904
|
+
}).transform((data) => ({
|
1905
|
+
id: data["id"],
|
1906
|
+
packageId: data["packageId"],
|
1907
|
+
createdDate: data["createdDate"]
|
1604
1908
|
}));
|
1605
1909
|
});
|
1606
1910
|
|
1607
|
-
// src/services/purchases/models/
|
1608
|
-
var
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
startTime: import_zod13.z.number().optional(),
|
1615
|
-
endTime: import_zod13.z.number().optional(),
|
1616
|
-
createdAt: import_zod13.z.number().optional(),
|
1617
|
-
package: package_.optional(),
|
1618
|
-
esim: purchasesEsim.optional(),
|
1619
|
-
source: import_zod13.z.string().optional(),
|
1620
|
-
referenceId: import_zod13.z.string().optional()
|
1911
|
+
// src/services/purchases/models/create-purchase-v2-ok-response-profile.ts
|
1912
|
+
var import_zod18 = require("zod");
|
1913
|
+
var createPurchaseV2OkResponseProfile = import_zod18.z.lazy(() => {
|
1914
|
+
return import_zod18.z.object({
|
1915
|
+
iccid: import_zod18.z.string().min(18).max(22).optional(),
|
1916
|
+
activationCode: import_zod18.z.string().min(1e3).max(8e3).optional(),
|
1917
|
+
manualActivationCode: import_zod18.z.string().optional()
|
1621
1918
|
});
|
1622
1919
|
});
|
1623
|
-
var
|
1624
|
-
return
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
createdDate: import_zod13.z.string().optional(),
|
1629
|
-
startTime: import_zod13.z.number().optional(),
|
1630
|
-
endTime: import_zod13.z.number().optional(),
|
1631
|
-
createdAt: import_zod13.z.number().optional(),
|
1632
|
-
package: packageResponse.optional(),
|
1633
|
-
esim: purchasesEsimResponse.optional(),
|
1634
|
-
source: import_zod13.z.string().optional(),
|
1635
|
-
referenceId: import_zod13.z.string().optional()
|
1920
|
+
var createPurchaseV2OkResponseProfileResponse = import_zod18.z.lazy(() => {
|
1921
|
+
return import_zod18.z.object({
|
1922
|
+
iccid: import_zod18.z.string().min(18).max(22).optional(),
|
1923
|
+
activationCode: import_zod18.z.string().min(1e3).max(8e3).optional(),
|
1924
|
+
manualActivationCode: import_zod18.z.string().optional()
|
1636
1925
|
}).transform((data) => ({
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
createdDate: data["createdDate"],
|
1641
|
-
startTime: data["startTime"],
|
1642
|
-
endTime: data["endTime"],
|
1643
|
-
createdAt: data["createdAt"],
|
1644
|
-
package: data["package"],
|
1645
|
-
esim: data["esim"],
|
1646
|
-
source: data["source"],
|
1647
|
-
referenceId: data["referenceId"]
|
1926
|
+
iccid: data["iccid"],
|
1927
|
+
activationCode: data["activationCode"],
|
1928
|
+
manualActivationCode: data["manualActivationCode"]
|
1648
1929
|
}));
|
1649
1930
|
});
|
1650
|
-
var
|
1651
|
-
return
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
createdDate: import_zod13.z.string().nullish(),
|
1656
|
-
startTime: import_zod13.z.number().nullish(),
|
1657
|
-
endTime: import_zod13.z.number().nullish(),
|
1658
|
-
createdAt: import_zod13.z.number().nullish(),
|
1659
|
-
package: packageRequest.nullish(),
|
1660
|
-
esim: purchasesEsimRequest.nullish(),
|
1661
|
-
source: import_zod13.z.string().nullish(),
|
1662
|
-
referenceId: import_zod13.z.string().nullish()
|
1931
|
+
var createPurchaseV2OkResponseProfileRequest = import_zod18.z.lazy(() => {
|
1932
|
+
return import_zod18.z.object({
|
1933
|
+
iccid: import_zod18.z.string().min(18).max(22).optional(),
|
1934
|
+
activationCode: import_zod18.z.string().min(1e3).max(8e3).optional(),
|
1935
|
+
manualActivationCode: import_zod18.z.string().optional()
|
1663
1936
|
}).transform((data) => ({
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1937
|
+
iccid: data["iccid"],
|
1938
|
+
activationCode: data["activationCode"],
|
1939
|
+
manualActivationCode: data["manualActivationCode"]
|
1940
|
+
}));
|
1941
|
+
});
|
1942
|
+
|
1943
|
+
// src/services/purchases/models/create-purchase-v2-ok-response.ts
|
1944
|
+
var createPurchaseV2OkResponse = import_zod19.z.lazy(() => {
|
1945
|
+
return import_zod19.z.object({
|
1946
|
+
purchase: createPurchaseV2OkResponsePurchase.optional(),
|
1947
|
+
profile: createPurchaseV2OkResponseProfile.optional()
|
1948
|
+
});
|
1949
|
+
});
|
1950
|
+
var createPurchaseV2OkResponseResponse = import_zod19.z.lazy(() => {
|
1951
|
+
return import_zod19.z.object({
|
1952
|
+
purchase: createPurchaseV2OkResponsePurchaseResponse.optional(),
|
1953
|
+
profile: createPurchaseV2OkResponseProfileResponse.optional()
|
1954
|
+
}).transform((data) => ({
|
1955
|
+
purchase: data["purchase"],
|
1956
|
+
profile: data["profile"]
|
1957
|
+
}));
|
1958
|
+
});
|
1959
|
+
var createPurchaseV2OkResponseRequest = import_zod19.z.lazy(() => {
|
1960
|
+
return import_zod19.z.object({
|
1961
|
+
purchase: createPurchaseV2OkResponsePurchaseRequest.optional(),
|
1962
|
+
profile: createPurchaseV2OkResponseProfileRequest.optional()
|
1963
|
+
}).transform((data) => ({
|
1964
|
+
purchase: data["purchase"],
|
1965
|
+
profile: data["profile"]
|
1966
|
+
}));
|
1967
|
+
});
|
1968
|
+
|
1969
|
+
// src/services/purchases/models/_4.ts
|
1970
|
+
var import_zod20 = require("zod");
|
1971
|
+
var _4Response = import_zod20.z.lazy(() => {
|
1972
|
+
return import_zod20.z.object({
|
1973
|
+
message: import_zod20.z.string().optional()
|
1974
|
+
}).transform((data) => ({
|
1975
|
+
message: data["message"]
|
1976
|
+
}));
|
1977
|
+
});
|
1978
|
+
var _4 = class extends ThrowableError {
|
1979
|
+
constructor(message, response) {
|
1980
|
+
super(message);
|
1981
|
+
this.message = message;
|
1982
|
+
this.response = response;
|
1983
|
+
const parsedResponse = _4Response.parse(response);
|
1984
|
+
this.message = parsedResponse.message || "";
|
1985
|
+
}
|
1986
|
+
throw() {
|
1987
|
+
throw new _4(this.message, this.response);
|
1988
|
+
}
|
1989
|
+
};
|
1990
|
+
|
1991
|
+
// src/services/purchases/models/_5.ts
|
1992
|
+
var import_zod21 = require("zod");
|
1993
|
+
var _5Response = import_zod21.z.lazy(() => {
|
1994
|
+
return import_zod21.z.object({
|
1995
|
+
message: import_zod21.z.string().optional()
|
1996
|
+
}).transform((data) => ({
|
1997
|
+
message: data["message"]
|
1998
|
+
}));
|
1999
|
+
});
|
2000
|
+
var _5 = class extends ThrowableError {
|
2001
|
+
constructor(message, response) {
|
2002
|
+
super(message);
|
2003
|
+
this.message = message;
|
2004
|
+
this.response = response;
|
2005
|
+
const parsedResponse = _5Response.parse(response);
|
2006
|
+
this.message = parsedResponse.message || "";
|
2007
|
+
}
|
2008
|
+
throw() {
|
2009
|
+
throw new _5(this.message, this.response);
|
2010
|
+
}
|
2011
|
+
};
|
2012
|
+
|
2013
|
+
// src/services/purchases/models/list-purchases-ok-response.ts
|
2014
|
+
var import_zod25 = require("zod");
|
2015
|
+
|
2016
|
+
// src/services/purchases/models/purchases.ts
|
2017
|
+
var import_zod24 = require("zod");
|
2018
|
+
|
2019
|
+
// src/services/purchases/models/package_.ts
|
2020
|
+
var import_zod22 = require("zod");
|
2021
|
+
var package_ = import_zod22.z.lazy(() => {
|
2022
|
+
return import_zod22.z.object({
|
2023
|
+
id: import_zod22.z.string().optional(),
|
2024
|
+
dataLimitInBytes: import_zod22.z.number().optional(),
|
2025
|
+
destination: import_zod22.z.string().optional(),
|
2026
|
+
destinationName: import_zod22.z.string().optional(),
|
2027
|
+
priceInCents: import_zod22.z.number().optional()
|
2028
|
+
});
|
2029
|
+
});
|
2030
|
+
var packageResponse = import_zod22.z.lazy(() => {
|
2031
|
+
return import_zod22.z.object({
|
2032
|
+
id: import_zod22.z.string().optional(),
|
2033
|
+
dataLimitInBytes: import_zod22.z.number().optional(),
|
2034
|
+
destination: import_zod22.z.string().optional(),
|
2035
|
+
destinationName: import_zod22.z.string().optional(),
|
2036
|
+
priceInCents: import_zod22.z.number().optional()
|
2037
|
+
}).transform((data) => ({
|
2038
|
+
id: data["id"],
|
2039
|
+
dataLimitInBytes: data["dataLimitInBytes"],
|
2040
|
+
destination: data["destination"],
|
2041
|
+
destinationName: data["destinationName"],
|
2042
|
+
priceInCents: data["priceInCents"]
|
2043
|
+
}));
|
2044
|
+
});
|
2045
|
+
var packageRequest = import_zod22.z.lazy(() => {
|
2046
|
+
return import_zod22.z.object({
|
2047
|
+
id: import_zod22.z.string().optional(),
|
2048
|
+
dataLimitInBytes: import_zod22.z.number().optional(),
|
2049
|
+
destination: import_zod22.z.string().optional(),
|
2050
|
+
destinationName: import_zod22.z.string().optional(),
|
2051
|
+
priceInCents: import_zod22.z.number().optional()
|
2052
|
+
}).transform((data) => ({
|
2053
|
+
id: data["id"],
|
2054
|
+
dataLimitInBytes: data["dataLimitInBytes"],
|
2055
|
+
destination: data["destination"],
|
2056
|
+
destinationName: data["destinationName"],
|
2057
|
+
priceInCents: data["priceInCents"]
|
2058
|
+
}));
|
2059
|
+
});
|
2060
|
+
|
2061
|
+
// src/services/purchases/models/purchases-esim.ts
|
2062
|
+
var import_zod23 = require("zod");
|
2063
|
+
var purchasesEsim = import_zod23.z.lazy(() => {
|
2064
|
+
return import_zod23.z.object({
|
2065
|
+
iccid: import_zod23.z.string().min(18).max(22).optional()
|
2066
|
+
});
|
2067
|
+
});
|
2068
|
+
var purchasesEsimResponse = import_zod23.z.lazy(() => {
|
2069
|
+
return import_zod23.z.object({
|
2070
|
+
iccid: import_zod23.z.string().min(18).max(22).optional()
|
2071
|
+
}).transform((data) => ({
|
2072
|
+
iccid: data["iccid"]
|
2073
|
+
}));
|
2074
|
+
});
|
2075
|
+
var purchasesEsimRequest = import_zod23.z.lazy(() => {
|
2076
|
+
return import_zod23.z.object({
|
2077
|
+
iccid: import_zod23.z.string().min(18).max(22).optional()
|
2078
|
+
}).transform((data) => ({
|
2079
|
+
iccid: data["iccid"]
|
2080
|
+
}));
|
2081
|
+
});
|
2082
|
+
|
2083
|
+
// src/services/purchases/models/purchases.ts
|
2084
|
+
var purchases = import_zod24.z.lazy(() => {
|
2085
|
+
return import_zod24.z.object({
|
2086
|
+
id: import_zod24.z.string().optional(),
|
2087
|
+
startDate: import_zod24.z.string().optional().nullable(),
|
2088
|
+
endDate: import_zod24.z.string().optional().nullable(),
|
2089
|
+
duration: import_zod24.z.number().optional().nullable(),
|
2090
|
+
createdDate: import_zod24.z.string().optional(),
|
2091
|
+
startTime: import_zod24.z.number().optional().nullable(),
|
2092
|
+
endTime: import_zod24.z.number().optional().nullable(),
|
2093
|
+
createdAt: import_zod24.z.number().optional(),
|
2094
|
+
package: package_.optional(),
|
2095
|
+
esim: purchasesEsim.optional(),
|
2096
|
+
source: import_zod24.z.string().optional(),
|
2097
|
+
purchaseType: import_zod24.z.string().optional(),
|
2098
|
+
referenceId: import_zod24.z.string().optional()
|
2099
|
+
});
|
2100
|
+
});
|
2101
|
+
var purchasesResponse = import_zod24.z.lazy(() => {
|
2102
|
+
return import_zod24.z.object({
|
2103
|
+
id: import_zod24.z.string().optional(),
|
2104
|
+
startDate: import_zod24.z.string().optional().nullable(),
|
2105
|
+
endDate: import_zod24.z.string().optional().nullable(),
|
2106
|
+
duration: import_zod24.z.number().optional().nullable(),
|
2107
|
+
createdDate: import_zod24.z.string().optional(),
|
2108
|
+
startTime: import_zod24.z.number().optional().nullable(),
|
2109
|
+
endTime: import_zod24.z.number().optional().nullable(),
|
2110
|
+
createdAt: import_zod24.z.number().optional(),
|
2111
|
+
package: packageResponse.optional(),
|
2112
|
+
esim: purchasesEsimResponse.optional(),
|
2113
|
+
source: import_zod24.z.string().optional(),
|
2114
|
+
purchaseType: import_zod24.z.string().optional(),
|
2115
|
+
referenceId: import_zod24.z.string().optional()
|
2116
|
+
}).transform((data) => ({
|
2117
|
+
id: data["id"],
|
2118
|
+
startDate: data["startDate"],
|
2119
|
+
endDate: data["endDate"],
|
2120
|
+
duration: data["duration"],
|
2121
|
+
createdDate: data["createdDate"],
|
1668
2122
|
startTime: data["startTime"],
|
1669
2123
|
endTime: data["endTime"],
|
1670
2124
|
createdAt: data["createdAt"],
|
1671
2125
|
package: data["package"],
|
1672
2126
|
esim: data["esim"],
|
1673
2127
|
source: data["source"],
|
2128
|
+
purchaseType: data["purchaseType"],
|
2129
|
+
referenceId: data["referenceId"]
|
2130
|
+
}));
|
2131
|
+
});
|
2132
|
+
var purchasesRequest = import_zod24.z.lazy(() => {
|
2133
|
+
return import_zod24.z.object({
|
2134
|
+
id: import_zod24.z.string().optional(),
|
2135
|
+
startDate: import_zod24.z.string().optional().nullable(),
|
2136
|
+
endDate: import_zod24.z.string().optional().nullable(),
|
2137
|
+
duration: import_zod24.z.number().optional().nullable(),
|
2138
|
+
createdDate: import_zod24.z.string().optional(),
|
2139
|
+
startTime: import_zod24.z.number().optional().nullable(),
|
2140
|
+
endTime: import_zod24.z.number().optional().nullable(),
|
2141
|
+
createdAt: import_zod24.z.number().optional(),
|
2142
|
+
package: packageRequest.optional(),
|
2143
|
+
esim: purchasesEsimRequest.optional(),
|
2144
|
+
source: import_zod24.z.string().optional(),
|
2145
|
+
purchaseType: import_zod24.z.string().optional(),
|
2146
|
+
referenceId: import_zod24.z.string().optional()
|
2147
|
+
}).transform((data) => ({
|
2148
|
+
id: data["id"],
|
2149
|
+
startDate: data["startDate"],
|
2150
|
+
endDate: data["endDate"],
|
2151
|
+
duration: data["duration"],
|
2152
|
+
createdDate: data["createdDate"],
|
2153
|
+
startTime: data["startTime"],
|
2154
|
+
endTime: data["endTime"],
|
2155
|
+
createdAt: data["createdAt"],
|
2156
|
+
package: data["package"],
|
2157
|
+
esim: data["esim"],
|
2158
|
+
source: data["source"],
|
2159
|
+
purchaseType: data["purchaseType"],
|
1674
2160
|
referenceId: data["referenceId"]
|
1675
2161
|
}));
|
1676
2162
|
});
|
1677
2163
|
|
1678
2164
|
// src/services/purchases/models/list-purchases-ok-response.ts
|
1679
|
-
var listPurchasesOkResponse =
|
1680
|
-
return
|
1681
|
-
purchases:
|
1682
|
-
afterCursor:
|
2165
|
+
var listPurchasesOkResponse = import_zod25.z.lazy(() => {
|
2166
|
+
return import_zod25.z.object({
|
2167
|
+
purchases: import_zod25.z.array(purchases).optional(),
|
2168
|
+
afterCursor: import_zod25.z.string().optional().nullable()
|
1683
2169
|
});
|
1684
2170
|
});
|
1685
|
-
var listPurchasesOkResponseResponse =
|
1686
|
-
return
|
1687
|
-
purchases:
|
1688
|
-
afterCursor:
|
2171
|
+
var listPurchasesOkResponseResponse = import_zod25.z.lazy(() => {
|
2172
|
+
return import_zod25.z.object({
|
2173
|
+
purchases: import_zod25.z.array(purchasesResponse).optional(),
|
2174
|
+
afterCursor: import_zod25.z.string().optional().nullable()
|
1689
2175
|
}).transform((data) => ({
|
1690
2176
|
purchases: data["purchases"],
|
1691
2177
|
afterCursor: data["afterCursor"]
|
1692
2178
|
}));
|
1693
2179
|
});
|
1694
|
-
var listPurchasesOkResponseRequest =
|
1695
|
-
return
|
2180
|
+
var listPurchasesOkResponseRequest = import_zod25.z.lazy(() => {
|
2181
|
+
return import_zod25.z.object({
|
2182
|
+
purchases: import_zod25.z.array(purchasesRequest).optional(),
|
2183
|
+
afterCursor: import_zod25.z.string().optional().nullable()
|
2184
|
+
}).transform((data) => ({
|
1696
2185
|
purchases: data["purchases"],
|
1697
2186
|
afterCursor: data["afterCursor"]
|
1698
2187
|
}));
|
1699
2188
|
});
|
1700
2189
|
|
2190
|
+
// src/services/purchases/models/_6.ts
|
2191
|
+
var import_zod26 = require("zod");
|
2192
|
+
var _6Response = import_zod26.z.lazy(() => {
|
2193
|
+
return import_zod26.z.object({
|
2194
|
+
message: import_zod26.z.string().optional()
|
2195
|
+
}).transform((data) => ({
|
2196
|
+
message: data["message"]
|
2197
|
+
}));
|
2198
|
+
});
|
2199
|
+
var _6 = class extends ThrowableError {
|
2200
|
+
constructor(message, response) {
|
2201
|
+
super(message);
|
2202
|
+
this.message = message;
|
2203
|
+
this.response = response;
|
2204
|
+
const parsedResponse = _6Response.parse(response);
|
2205
|
+
this.message = parsedResponse.message || "";
|
2206
|
+
}
|
2207
|
+
throw() {
|
2208
|
+
throw new _6(this.message, this.response);
|
2209
|
+
}
|
2210
|
+
};
|
2211
|
+
|
2212
|
+
// src/services/purchases/models/_7.ts
|
2213
|
+
var import_zod27 = require("zod");
|
2214
|
+
var _7Response = import_zod27.z.lazy(() => {
|
2215
|
+
return import_zod27.z.object({
|
2216
|
+
message: import_zod27.z.string().optional()
|
2217
|
+
}).transform((data) => ({
|
2218
|
+
message: data["message"]
|
2219
|
+
}));
|
2220
|
+
});
|
2221
|
+
var _7 = class extends ThrowableError {
|
2222
|
+
constructor(message, response) {
|
2223
|
+
super(message);
|
2224
|
+
this.message = message;
|
2225
|
+
this.response = response;
|
2226
|
+
const parsedResponse = _7Response.parse(response);
|
2227
|
+
this.message = parsedResponse.message || "";
|
2228
|
+
}
|
2229
|
+
throw() {
|
2230
|
+
throw new _7(this.message, this.response);
|
2231
|
+
}
|
2232
|
+
};
|
2233
|
+
|
1701
2234
|
// src/services/purchases/models/create-purchase-request.ts
|
1702
|
-
var
|
1703
|
-
var createPurchaseRequest =
|
1704
|
-
return
|
1705
|
-
destination:
|
1706
|
-
dataLimitInGb:
|
1707
|
-
startDate:
|
1708
|
-
endDate:
|
1709
|
-
email:
|
1710
|
-
referenceId:
|
1711
|
-
networkBrand:
|
1712
|
-
|
1713
|
-
|
2235
|
+
var import_zod28 = require("zod");
|
2236
|
+
var createPurchaseRequest = import_zod28.z.lazy(() => {
|
2237
|
+
return import_zod28.z.object({
|
2238
|
+
destination: import_zod28.z.string(),
|
2239
|
+
dataLimitInGb: import_zod28.z.number(),
|
2240
|
+
startDate: import_zod28.z.string(),
|
2241
|
+
endDate: import_zod28.z.string(),
|
2242
|
+
email: import_zod28.z.string().optional(),
|
2243
|
+
referenceId: import_zod28.z.string().optional(),
|
2244
|
+
networkBrand: import_zod28.z.string().optional(),
|
2245
|
+
emailBrand: import_zod28.z.string().optional(),
|
2246
|
+
startTime: import_zod28.z.number().optional(),
|
2247
|
+
endTime: import_zod28.z.number().optional()
|
1714
2248
|
});
|
1715
2249
|
});
|
1716
|
-
var createPurchaseRequestResponse =
|
1717
|
-
return
|
1718
|
-
destination:
|
1719
|
-
dataLimitInGB:
|
1720
|
-
startDate:
|
1721
|
-
endDate:
|
1722
|
-
email:
|
1723
|
-
referenceId:
|
1724
|
-
networkBrand:
|
1725
|
-
|
1726
|
-
|
2250
|
+
var createPurchaseRequestResponse = import_zod28.z.lazy(() => {
|
2251
|
+
return import_zod28.z.object({
|
2252
|
+
destination: import_zod28.z.string(),
|
2253
|
+
dataLimitInGB: import_zod28.z.number(),
|
2254
|
+
startDate: import_zod28.z.string(),
|
2255
|
+
endDate: import_zod28.z.string(),
|
2256
|
+
email: import_zod28.z.string().optional(),
|
2257
|
+
referenceId: import_zod28.z.string().optional(),
|
2258
|
+
networkBrand: import_zod28.z.string().optional(),
|
2259
|
+
emailBrand: import_zod28.z.string().optional(),
|
2260
|
+
startTime: import_zod28.z.number().optional(),
|
2261
|
+
endTime: import_zod28.z.number().optional()
|
1727
2262
|
}).transform((data) => ({
|
1728
2263
|
destination: data["destination"],
|
1729
2264
|
dataLimitInGb: data["dataLimitInGB"],
|
@@ -1732,21 +2267,23 @@ var createPurchaseRequestResponse = import_zod15.z.lazy(() => {
|
|
1732
2267
|
email: data["email"],
|
1733
2268
|
referenceId: data["referenceId"],
|
1734
2269
|
networkBrand: data["networkBrand"],
|
2270
|
+
emailBrand: data["emailBrand"],
|
1735
2271
|
startTime: data["startTime"],
|
1736
2272
|
endTime: data["endTime"]
|
1737
2273
|
}));
|
1738
2274
|
});
|
1739
|
-
var createPurchaseRequestRequest =
|
1740
|
-
return
|
1741
|
-
destination:
|
1742
|
-
dataLimitInGb:
|
1743
|
-
startDate:
|
1744
|
-
endDate:
|
1745
|
-
email:
|
1746
|
-
referenceId:
|
1747
|
-
networkBrand:
|
1748
|
-
|
1749
|
-
|
2275
|
+
var createPurchaseRequestRequest = import_zod28.z.lazy(() => {
|
2276
|
+
return import_zod28.z.object({
|
2277
|
+
destination: import_zod28.z.string(),
|
2278
|
+
dataLimitInGb: import_zod28.z.number(),
|
2279
|
+
startDate: import_zod28.z.string(),
|
2280
|
+
endDate: import_zod28.z.string(),
|
2281
|
+
email: import_zod28.z.string().optional(),
|
2282
|
+
referenceId: import_zod28.z.string().optional(),
|
2283
|
+
networkBrand: import_zod28.z.string().optional(),
|
2284
|
+
emailBrand: import_zod28.z.string().optional(),
|
2285
|
+
startTime: import_zod28.z.number().optional(),
|
2286
|
+
endTime: import_zod28.z.number().optional()
|
1750
2287
|
}).transform((data) => ({
|
1751
2288
|
destination: data["destination"],
|
1752
2289
|
dataLimitInGB: data["dataLimitInGb"],
|
@@ -1755,36 +2292,37 @@ var createPurchaseRequestRequest = import_zod15.z.lazy(() => {
|
|
1755
2292
|
email: data["email"],
|
1756
2293
|
referenceId: data["referenceId"],
|
1757
2294
|
networkBrand: data["networkBrand"],
|
2295
|
+
emailBrand: data["emailBrand"],
|
1758
2296
|
startTime: data["startTime"],
|
1759
2297
|
endTime: data["endTime"]
|
1760
2298
|
}));
|
1761
2299
|
});
|
1762
2300
|
|
1763
2301
|
// src/services/purchases/models/create-purchase-ok-response.ts
|
1764
|
-
var
|
2302
|
+
var import_zod31 = require("zod");
|
1765
2303
|
|
1766
2304
|
// src/services/purchases/models/create-purchase-ok-response-purchase.ts
|
1767
|
-
var
|
1768
|
-
var createPurchaseOkResponsePurchase =
|
1769
|
-
return
|
1770
|
-
id:
|
1771
|
-
packageId:
|
1772
|
-
startDate:
|
1773
|
-
endDate:
|
1774
|
-
createdDate:
|
1775
|
-
startTime:
|
1776
|
-
endTime:
|
2305
|
+
var import_zod29 = require("zod");
|
2306
|
+
var createPurchaseOkResponsePurchase = import_zod29.z.lazy(() => {
|
2307
|
+
return import_zod29.z.object({
|
2308
|
+
id: import_zod29.z.string().optional(),
|
2309
|
+
packageId: import_zod29.z.string().optional(),
|
2310
|
+
startDate: import_zod29.z.string().optional().nullable(),
|
2311
|
+
endDate: import_zod29.z.string().optional().nullable(),
|
2312
|
+
createdDate: import_zod29.z.string().optional(),
|
2313
|
+
startTime: import_zod29.z.number().optional().nullable(),
|
2314
|
+
endTime: import_zod29.z.number().optional().nullable()
|
1777
2315
|
});
|
1778
2316
|
});
|
1779
|
-
var createPurchaseOkResponsePurchaseResponse =
|
1780
|
-
return
|
1781
|
-
id:
|
1782
|
-
packageId:
|
1783
|
-
startDate:
|
1784
|
-
endDate:
|
1785
|
-
createdDate:
|
1786
|
-
startTime:
|
1787
|
-
endTime:
|
2317
|
+
var createPurchaseOkResponsePurchaseResponse = import_zod29.z.lazy(() => {
|
2318
|
+
return import_zod29.z.object({
|
2319
|
+
id: import_zod29.z.string().optional(),
|
2320
|
+
packageId: import_zod29.z.string().optional(),
|
2321
|
+
startDate: import_zod29.z.string().optional().nullable(),
|
2322
|
+
endDate: import_zod29.z.string().optional().nullable(),
|
2323
|
+
createdDate: import_zod29.z.string().optional(),
|
2324
|
+
startTime: import_zod29.z.number().optional().nullable(),
|
2325
|
+
endTime: import_zod29.z.number().optional().nullable()
|
1788
2326
|
}).transform((data) => ({
|
1789
2327
|
id: data["id"],
|
1790
2328
|
packageId: data["packageId"],
|
@@ -1795,15 +2333,15 @@ var createPurchaseOkResponsePurchaseResponse = import_zod16.z.lazy(() => {
|
|
1795
2333
|
endTime: data["endTime"]
|
1796
2334
|
}));
|
1797
2335
|
});
|
1798
|
-
var createPurchaseOkResponsePurchaseRequest =
|
1799
|
-
return
|
1800
|
-
id:
|
1801
|
-
packageId:
|
1802
|
-
startDate:
|
1803
|
-
endDate:
|
1804
|
-
createdDate:
|
1805
|
-
startTime:
|
1806
|
-
endTime:
|
2336
|
+
var createPurchaseOkResponsePurchaseRequest = import_zod29.z.lazy(() => {
|
2337
|
+
return import_zod29.z.object({
|
2338
|
+
id: import_zod29.z.string().optional(),
|
2339
|
+
packageId: import_zod29.z.string().optional(),
|
2340
|
+
startDate: import_zod29.z.string().optional().nullable(),
|
2341
|
+
endDate: import_zod29.z.string().optional().nullable(),
|
2342
|
+
createdDate: import_zod29.z.string().optional(),
|
2343
|
+
startTime: import_zod29.z.number().optional().nullable(),
|
2344
|
+
endTime: import_zod29.z.number().optional().nullable()
|
1807
2345
|
}).transform((data) => ({
|
1808
2346
|
id: data["id"],
|
1809
2347
|
packageId: data["packageId"],
|
@@ -1816,30 +2354,30 @@ var createPurchaseOkResponsePurchaseRequest = import_zod16.z.lazy(() => {
|
|
1816
2354
|
});
|
1817
2355
|
|
1818
2356
|
// src/services/purchases/models/create-purchase-ok-response-profile.ts
|
1819
|
-
var
|
1820
|
-
var createPurchaseOkResponseProfile =
|
1821
|
-
return
|
1822
|
-
iccid:
|
1823
|
-
activationCode:
|
1824
|
-
manualActivationCode:
|
2357
|
+
var import_zod30 = require("zod");
|
2358
|
+
var createPurchaseOkResponseProfile = import_zod30.z.lazy(() => {
|
2359
|
+
return import_zod30.z.object({
|
2360
|
+
iccid: import_zod30.z.string().min(18).max(22).optional(),
|
2361
|
+
activationCode: import_zod30.z.string().min(1e3).max(8e3).optional(),
|
2362
|
+
manualActivationCode: import_zod30.z.string().optional()
|
1825
2363
|
});
|
1826
2364
|
});
|
1827
|
-
var createPurchaseOkResponseProfileResponse =
|
1828
|
-
return
|
1829
|
-
iccid:
|
1830
|
-
activationCode:
|
1831
|
-
manualActivationCode:
|
2365
|
+
var createPurchaseOkResponseProfileResponse = import_zod30.z.lazy(() => {
|
2366
|
+
return import_zod30.z.object({
|
2367
|
+
iccid: import_zod30.z.string().min(18).max(22).optional(),
|
2368
|
+
activationCode: import_zod30.z.string().min(1e3).max(8e3).optional(),
|
2369
|
+
manualActivationCode: import_zod30.z.string().optional()
|
1832
2370
|
}).transform((data) => ({
|
1833
2371
|
iccid: data["iccid"],
|
1834
2372
|
activationCode: data["activationCode"],
|
1835
2373
|
manualActivationCode: data["manualActivationCode"]
|
1836
2374
|
}));
|
1837
2375
|
});
|
1838
|
-
var createPurchaseOkResponseProfileRequest =
|
1839
|
-
return
|
1840
|
-
iccid:
|
1841
|
-
activationCode:
|
1842
|
-
manualActivationCode:
|
2376
|
+
var createPurchaseOkResponseProfileRequest = import_zod30.z.lazy(() => {
|
2377
|
+
return import_zod30.z.object({
|
2378
|
+
iccid: import_zod30.z.string().min(18).max(22).optional(),
|
2379
|
+
activationCode: import_zod30.z.string().min(1e3).max(8e3).optional(),
|
2380
|
+
manualActivationCode: import_zod30.z.string().optional()
|
1843
2381
|
}).transform((data) => ({
|
1844
2382
|
iccid: data["iccid"],
|
1845
2383
|
activationCode: data["activationCode"],
|
@@ -1848,14 +2386,14 @@ var createPurchaseOkResponseProfileRequest = import_zod17.z.lazy(() => {
|
|
1848
2386
|
});
|
1849
2387
|
|
1850
2388
|
// src/services/purchases/models/create-purchase-ok-response.ts
|
1851
|
-
var createPurchaseOkResponse =
|
1852
|
-
return
|
2389
|
+
var createPurchaseOkResponse = import_zod31.z.lazy(() => {
|
2390
|
+
return import_zod31.z.object({
|
1853
2391
|
purchase: createPurchaseOkResponsePurchase.optional(),
|
1854
2392
|
profile: createPurchaseOkResponseProfile.optional()
|
1855
2393
|
});
|
1856
2394
|
});
|
1857
|
-
var createPurchaseOkResponseResponse =
|
1858
|
-
return
|
2395
|
+
var createPurchaseOkResponseResponse = import_zod31.z.lazy(() => {
|
2396
|
+
return import_zod31.z.object({
|
1859
2397
|
purchase: createPurchaseOkResponsePurchaseResponse.optional(),
|
1860
2398
|
profile: createPurchaseOkResponseProfileResponse.optional()
|
1861
2399
|
}).transform((data) => ({
|
@@ -1863,122 +2401,166 @@ var createPurchaseOkResponseResponse = import_zod18.z.lazy(() => {
|
|
1863
2401
|
profile: data["profile"]
|
1864
2402
|
}));
|
1865
2403
|
});
|
1866
|
-
var createPurchaseOkResponseRequest =
|
1867
|
-
return
|
1868
|
-
purchase: createPurchaseOkResponsePurchaseRequest.
|
1869
|
-
profile: createPurchaseOkResponseProfileRequest.
|
2404
|
+
var createPurchaseOkResponseRequest = import_zod31.z.lazy(() => {
|
2405
|
+
return import_zod31.z.object({
|
2406
|
+
purchase: createPurchaseOkResponsePurchaseRequest.optional(),
|
2407
|
+
profile: createPurchaseOkResponseProfileRequest.optional()
|
1870
2408
|
}).transform((data) => ({
|
1871
2409
|
purchase: data["purchase"],
|
1872
2410
|
profile: data["profile"]
|
1873
2411
|
}));
|
1874
2412
|
});
|
1875
2413
|
|
2414
|
+
// src/services/purchases/models/_8.ts
|
2415
|
+
var import_zod32 = require("zod");
|
2416
|
+
var _8Response = import_zod32.z.lazy(() => {
|
2417
|
+
return import_zod32.z.object({
|
2418
|
+
message: import_zod32.z.string().optional()
|
2419
|
+
}).transform((data) => ({
|
2420
|
+
message: data["message"]
|
2421
|
+
}));
|
2422
|
+
});
|
2423
|
+
var _8 = class extends ThrowableError {
|
2424
|
+
constructor(message, response) {
|
2425
|
+
super(message);
|
2426
|
+
this.message = message;
|
2427
|
+
this.response = response;
|
2428
|
+
const parsedResponse = _8Response.parse(response);
|
2429
|
+
this.message = parsedResponse.message || "";
|
2430
|
+
}
|
2431
|
+
throw() {
|
2432
|
+
throw new _8(this.message, this.response);
|
2433
|
+
}
|
2434
|
+
};
|
2435
|
+
|
2436
|
+
// src/services/purchases/models/_9.ts
|
2437
|
+
var import_zod33 = require("zod");
|
2438
|
+
var _9Response = import_zod33.z.lazy(() => {
|
2439
|
+
return import_zod33.z.object({
|
2440
|
+
message: import_zod33.z.string().optional()
|
2441
|
+
}).transform((data) => ({
|
2442
|
+
message: data["message"]
|
2443
|
+
}));
|
2444
|
+
});
|
2445
|
+
var _9 = class extends ThrowableError {
|
2446
|
+
constructor(message, response) {
|
2447
|
+
super(message);
|
2448
|
+
this.message = message;
|
2449
|
+
this.response = response;
|
2450
|
+
const parsedResponse = _9Response.parse(response);
|
2451
|
+
this.message = parsedResponse.message || "";
|
2452
|
+
}
|
2453
|
+
throw() {
|
2454
|
+
throw new _9(this.message, this.response);
|
2455
|
+
}
|
2456
|
+
};
|
2457
|
+
|
1876
2458
|
// src/services/purchases/models/top-up-esim-request.ts
|
1877
|
-
var
|
1878
|
-
var topUpEsimRequest =
|
1879
|
-
return
|
1880
|
-
iccid:
|
1881
|
-
dataLimitInGb:
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
endTime: import_zod19.z.number().optional()
|
2459
|
+
var import_zod34 = require("zod");
|
2460
|
+
var topUpEsimRequest = import_zod34.z.lazy(() => {
|
2461
|
+
return import_zod34.z.object({
|
2462
|
+
iccid: import_zod34.z.string().min(18).max(22),
|
2463
|
+
dataLimitInGb: import_zod34.z.number(),
|
2464
|
+
email: import_zod34.z.string().optional(),
|
2465
|
+
referenceId: import_zod34.z.string().optional(),
|
2466
|
+
emailBrand: import_zod34.z.string().optional(),
|
2467
|
+
startTime: import_zod34.z.number().optional(),
|
2468
|
+
endTime: import_zod34.z.number().optional()
|
1888
2469
|
});
|
1889
2470
|
});
|
1890
|
-
var topUpEsimRequestResponse =
|
1891
|
-
return
|
1892
|
-
iccid:
|
1893
|
-
dataLimitInGB:
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
|
1899
|
-
endTime: import_zod19.z.number().optional()
|
2471
|
+
var topUpEsimRequestResponse = import_zod34.z.lazy(() => {
|
2472
|
+
return import_zod34.z.object({
|
2473
|
+
iccid: import_zod34.z.string().min(18).max(22),
|
2474
|
+
dataLimitInGB: import_zod34.z.number(),
|
2475
|
+
email: import_zod34.z.string().optional(),
|
2476
|
+
referenceId: import_zod34.z.string().optional(),
|
2477
|
+
emailBrand: import_zod34.z.string().optional(),
|
2478
|
+
startTime: import_zod34.z.number().optional(),
|
2479
|
+
endTime: import_zod34.z.number().optional()
|
1900
2480
|
}).transform((data) => ({
|
1901
2481
|
iccid: data["iccid"],
|
1902
2482
|
dataLimitInGb: data["dataLimitInGB"],
|
1903
|
-
startDate: data["startDate"],
|
1904
|
-
endDate: data["endDate"],
|
1905
2483
|
email: data["email"],
|
1906
2484
|
referenceId: data["referenceId"],
|
2485
|
+
emailBrand: data["emailBrand"],
|
1907
2486
|
startTime: data["startTime"],
|
1908
2487
|
endTime: data["endTime"]
|
1909
2488
|
}));
|
1910
2489
|
});
|
1911
|
-
var topUpEsimRequestRequest =
|
1912
|
-
return
|
1913
|
-
iccid:
|
1914
|
-
dataLimitInGb:
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
endTime: import_zod19.z.number().nullish()
|
2490
|
+
var topUpEsimRequestRequest = import_zod34.z.lazy(() => {
|
2491
|
+
return import_zod34.z.object({
|
2492
|
+
iccid: import_zod34.z.string().min(18).max(22),
|
2493
|
+
dataLimitInGb: import_zod34.z.number(),
|
2494
|
+
email: import_zod34.z.string().optional(),
|
2495
|
+
referenceId: import_zod34.z.string().optional(),
|
2496
|
+
emailBrand: import_zod34.z.string().optional(),
|
2497
|
+
startTime: import_zod34.z.number().optional(),
|
2498
|
+
endTime: import_zod34.z.number().optional()
|
1921
2499
|
}).transform((data) => ({
|
1922
2500
|
iccid: data["iccid"],
|
1923
2501
|
dataLimitInGB: data["dataLimitInGb"],
|
1924
|
-
startDate: data["startDate"],
|
1925
|
-
endDate: data["endDate"],
|
1926
2502
|
email: data["email"],
|
1927
2503
|
referenceId: data["referenceId"],
|
2504
|
+
emailBrand: data["emailBrand"],
|
1928
2505
|
startTime: data["startTime"],
|
1929
2506
|
endTime: data["endTime"]
|
1930
2507
|
}));
|
1931
2508
|
});
|
1932
2509
|
|
1933
2510
|
// src/services/purchases/models/top-up-esim-ok-response.ts
|
1934
|
-
var
|
2511
|
+
var import_zod37 = require("zod");
|
1935
2512
|
|
1936
2513
|
// src/services/purchases/models/top-up-esim-ok-response-purchase.ts
|
1937
|
-
var
|
1938
|
-
var topUpEsimOkResponsePurchase =
|
1939
|
-
return
|
1940
|
-
id:
|
1941
|
-
packageId:
|
1942
|
-
startDate:
|
1943
|
-
endDate:
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
2514
|
+
var import_zod35 = require("zod");
|
2515
|
+
var topUpEsimOkResponsePurchase = import_zod35.z.lazy(() => {
|
2516
|
+
return import_zod35.z.object({
|
2517
|
+
id: import_zod35.z.string().optional(),
|
2518
|
+
packageId: import_zod35.z.string().optional(),
|
2519
|
+
startDate: import_zod35.z.string().optional().nullable(),
|
2520
|
+
endDate: import_zod35.z.string().optional().nullable(),
|
2521
|
+
duration: import_zod35.z.number().optional().nullable(),
|
2522
|
+
createdDate: import_zod35.z.string().optional(),
|
2523
|
+
startTime: import_zod35.z.number().optional().nullable(),
|
2524
|
+
endTime: import_zod35.z.number().optional().nullable()
|
1947
2525
|
});
|
1948
2526
|
});
|
1949
|
-
var topUpEsimOkResponsePurchaseResponse =
|
1950
|
-
return
|
1951
|
-
id:
|
1952
|
-
packageId:
|
1953
|
-
startDate:
|
1954
|
-
endDate:
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
2527
|
+
var topUpEsimOkResponsePurchaseResponse = import_zod35.z.lazy(() => {
|
2528
|
+
return import_zod35.z.object({
|
2529
|
+
id: import_zod35.z.string().optional(),
|
2530
|
+
packageId: import_zod35.z.string().optional(),
|
2531
|
+
startDate: import_zod35.z.string().optional().nullable(),
|
2532
|
+
endDate: import_zod35.z.string().optional().nullable(),
|
2533
|
+
duration: import_zod35.z.number().optional().nullable(),
|
2534
|
+
createdDate: import_zod35.z.string().optional(),
|
2535
|
+
startTime: import_zod35.z.number().optional().nullable(),
|
2536
|
+
endTime: import_zod35.z.number().optional().nullable()
|
1958
2537
|
}).transform((data) => ({
|
1959
2538
|
id: data["id"],
|
1960
2539
|
packageId: data["packageId"],
|
1961
2540
|
startDate: data["startDate"],
|
1962
2541
|
endDate: data["endDate"],
|
2542
|
+
duration: data["duration"],
|
1963
2543
|
createdDate: data["createdDate"],
|
1964
2544
|
startTime: data["startTime"],
|
1965
2545
|
endTime: data["endTime"]
|
1966
2546
|
}));
|
1967
2547
|
});
|
1968
|
-
var topUpEsimOkResponsePurchaseRequest =
|
1969
|
-
return
|
1970
|
-
id:
|
1971
|
-
packageId:
|
1972
|
-
startDate:
|
1973
|
-
endDate:
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
2548
|
+
var topUpEsimOkResponsePurchaseRequest = import_zod35.z.lazy(() => {
|
2549
|
+
return import_zod35.z.object({
|
2550
|
+
id: import_zod35.z.string().optional(),
|
2551
|
+
packageId: import_zod35.z.string().optional(),
|
2552
|
+
startDate: import_zod35.z.string().optional().nullable(),
|
2553
|
+
endDate: import_zod35.z.string().optional().nullable(),
|
2554
|
+
duration: import_zod35.z.number().optional().nullable(),
|
2555
|
+
createdDate: import_zod35.z.string().optional(),
|
2556
|
+
startTime: import_zod35.z.number().optional().nullable(),
|
2557
|
+
endTime: import_zod35.z.number().optional().nullable()
|
1977
2558
|
}).transform((data) => ({
|
1978
2559
|
id: data["id"],
|
1979
2560
|
packageId: data["packageId"],
|
1980
2561
|
startDate: data["startDate"],
|
1981
2562
|
endDate: data["endDate"],
|
2563
|
+
duration: data["duration"],
|
1982
2564
|
createdDate: data["createdDate"],
|
1983
2565
|
startTime: data["startTime"],
|
1984
2566
|
endTime: data["endTime"]
|
@@ -1986,34 +2568,36 @@ var topUpEsimOkResponsePurchaseRequest = import_zod20.z.lazy(() => {
|
|
1986
2568
|
});
|
1987
2569
|
|
1988
2570
|
// src/services/purchases/models/top-up-esim-ok-response-profile.ts
|
1989
|
-
var
|
1990
|
-
var topUpEsimOkResponseProfile =
|
1991
|
-
return
|
1992
|
-
iccid:
|
2571
|
+
var import_zod36 = require("zod");
|
2572
|
+
var topUpEsimOkResponseProfile = import_zod36.z.lazy(() => {
|
2573
|
+
return import_zod36.z.object({
|
2574
|
+
iccid: import_zod36.z.string().min(18).max(22).optional()
|
1993
2575
|
});
|
1994
2576
|
});
|
1995
|
-
var topUpEsimOkResponseProfileResponse =
|
1996
|
-
return
|
1997
|
-
iccid:
|
2577
|
+
var topUpEsimOkResponseProfileResponse = import_zod36.z.lazy(() => {
|
2578
|
+
return import_zod36.z.object({
|
2579
|
+
iccid: import_zod36.z.string().min(18).max(22).optional()
|
1998
2580
|
}).transform((data) => ({
|
1999
2581
|
iccid: data["iccid"]
|
2000
2582
|
}));
|
2001
2583
|
});
|
2002
|
-
var topUpEsimOkResponseProfileRequest =
|
2003
|
-
return
|
2584
|
+
var topUpEsimOkResponseProfileRequest = import_zod36.z.lazy(() => {
|
2585
|
+
return import_zod36.z.object({
|
2586
|
+
iccid: import_zod36.z.string().min(18).max(22).optional()
|
2587
|
+
}).transform((data) => ({
|
2004
2588
|
iccid: data["iccid"]
|
2005
2589
|
}));
|
2006
2590
|
});
|
2007
2591
|
|
2008
2592
|
// src/services/purchases/models/top-up-esim-ok-response.ts
|
2009
|
-
var topUpEsimOkResponse =
|
2010
|
-
return
|
2593
|
+
var topUpEsimOkResponse = import_zod37.z.lazy(() => {
|
2594
|
+
return import_zod37.z.object({
|
2011
2595
|
purchase: topUpEsimOkResponsePurchase.optional(),
|
2012
2596
|
profile: topUpEsimOkResponseProfile.optional()
|
2013
2597
|
});
|
2014
2598
|
});
|
2015
|
-
var topUpEsimOkResponseResponse =
|
2016
|
-
return
|
2599
|
+
var topUpEsimOkResponseResponse = import_zod37.z.lazy(() => {
|
2600
|
+
return import_zod37.z.object({
|
2017
2601
|
purchase: topUpEsimOkResponsePurchaseResponse.optional(),
|
2018
2602
|
profile: topUpEsimOkResponseProfileResponse.optional()
|
2019
2603
|
}).transform((data) => ({
|
@@ -2021,34 +2605,78 @@ var topUpEsimOkResponseResponse = import_zod22.z.lazy(() => {
|
|
2021
2605
|
profile: data["profile"]
|
2022
2606
|
}));
|
2023
2607
|
});
|
2024
|
-
var topUpEsimOkResponseRequest =
|
2025
|
-
return
|
2026
|
-
purchase: topUpEsimOkResponsePurchaseRequest.
|
2027
|
-
profile: topUpEsimOkResponseProfileRequest.
|
2608
|
+
var topUpEsimOkResponseRequest = import_zod37.z.lazy(() => {
|
2609
|
+
return import_zod37.z.object({
|
2610
|
+
purchase: topUpEsimOkResponsePurchaseRequest.optional(),
|
2611
|
+
profile: topUpEsimOkResponseProfileRequest.optional()
|
2028
2612
|
}).transform((data) => ({
|
2029
2613
|
purchase: data["purchase"],
|
2030
2614
|
profile: data["profile"]
|
2031
2615
|
}));
|
2032
2616
|
});
|
2033
2617
|
|
2618
|
+
// src/services/purchases/models/_10.ts
|
2619
|
+
var import_zod38 = require("zod");
|
2620
|
+
var _10Response = import_zod38.z.lazy(() => {
|
2621
|
+
return import_zod38.z.object({
|
2622
|
+
message: import_zod38.z.string().optional()
|
2623
|
+
}).transform((data) => ({
|
2624
|
+
message: data["message"]
|
2625
|
+
}));
|
2626
|
+
});
|
2627
|
+
var _10 = class extends ThrowableError {
|
2628
|
+
constructor(message, response) {
|
2629
|
+
super(message);
|
2630
|
+
this.message = message;
|
2631
|
+
this.response = response;
|
2632
|
+
const parsedResponse = _10Response.parse(response);
|
2633
|
+
this.message = parsedResponse.message || "";
|
2634
|
+
}
|
2635
|
+
throw() {
|
2636
|
+
throw new _10(this.message, this.response);
|
2637
|
+
}
|
2638
|
+
};
|
2639
|
+
|
2640
|
+
// src/services/purchases/models/_11.ts
|
2641
|
+
var import_zod39 = require("zod");
|
2642
|
+
var _11Response = import_zod39.z.lazy(() => {
|
2643
|
+
return import_zod39.z.object({
|
2644
|
+
message: import_zod39.z.string().optional()
|
2645
|
+
}).transform((data) => ({
|
2646
|
+
message: data["message"]
|
2647
|
+
}));
|
2648
|
+
});
|
2649
|
+
var _11 = class extends ThrowableError {
|
2650
|
+
constructor(message, response) {
|
2651
|
+
super(message);
|
2652
|
+
this.message = message;
|
2653
|
+
this.response = response;
|
2654
|
+
const parsedResponse = _11Response.parse(response);
|
2655
|
+
this.message = parsedResponse.message || "";
|
2656
|
+
}
|
2657
|
+
throw() {
|
2658
|
+
throw new _11(this.message, this.response);
|
2659
|
+
}
|
2660
|
+
};
|
2661
|
+
|
2034
2662
|
// src/services/purchases/models/edit-purchase-request.ts
|
2035
|
-
var
|
2036
|
-
var editPurchaseRequest =
|
2037
|
-
return
|
2038
|
-
purchaseId:
|
2039
|
-
startDate:
|
2040
|
-
endDate:
|
2041
|
-
startTime:
|
2042
|
-
endTime:
|
2663
|
+
var import_zod40 = require("zod");
|
2664
|
+
var editPurchaseRequest = import_zod40.z.lazy(() => {
|
2665
|
+
return import_zod40.z.object({
|
2666
|
+
purchaseId: import_zod40.z.string(),
|
2667
|
+
startDate: import_zod40.z.string(),
|
2668
|
+
endDate: import_zod40.z.string(),
|
2669
|
+
startTime: import_zod40.z.number().optional(),
|
2670
|
+
endTime: import_zod40.z.number().optional()
|
2043
2671
|
});
|
2044
2672
|
});
|
2045
|
-
var editPurchaseRequestResponse =
|
2046
|
-
return
|
2047
|
-
purchaseId:
|
2048
|
-
startDate:
|
2049
|
-
endDate:
|
2050
|
-
startTime:
|
2051
|
-
endTime:
|
2673
|
+
var editPurchaseRequestResponse = import_zod40.z.lazy(() => {
|
2674
|
+
return import_zod40.z.object({
|
2675
|
+
purchaseId: import_zod40.z.string(),
|
2676
|
+
startDate: import_zod40.z.string(),
|
2677
|
+
endDate: import_zod40.z.string(),
|
2678
|
+
startTime: import_zod40.z.number().optional(),
|
2679
|
+
endTime: import_zod40.z.number().optional()
|
2052
2680
|
}).transform((data) => ({
|
2053
2681
|
purchaseId: data["purchaseId"],
|
2054
2682
|
startDate: data["startDate"],
|
@@ -2057,13 +2685,13 @@ var editPurchaseRequestResponse = import_zod23.z.lazy(() => {
|
|
2057
2685
|
endTime: data["endTime"]
|
2058
2686
|
}));
|
2059
2687
|
});
|
2060
|
-
var editPurchaseRequestRequest =
|
2061
|
-
return
|
2062
|
-
purchaseId:
|
2063
|
-
startDate:
|
2064
|
-
endDate:
|
2065
|
-
startTime:
|
2066
|
-
endTime:
|
2688
|
+
var editPurchaseRequestRequest = import_zod40.z.lazy(() => {
|
2689
|
+
return import_zod40.z.object({
|
2690
|
+
purchaseId: import_zod40.z.string(),
|
2691
|
+
startDate: import_zod40.z.string(),
|
2692
|
+
endDate: import_zod40.z.string(),
|
2693
|
+
startTime: import_zod40.z.number().optional(),
|
2694
|
+
endTime: import_zod40.z.number().optional()
|
2067
2695
|
}).transform((data) => ({
|
2068
2696
|
purchaseId: data["purchaseId"],
|
2069
2697
|
startDate: data["startDate"],
|
@@ -2074,23 +2702,23 @@ var editPurchaseRequestRequest = import_zod23.z.lazy(() => {
|
|
2074
2702
|
});
|
2075
2703
|
|
2076
2704
|
// src/services/purchases/models/edit-purchase-ok-response.ts
|
2077
|
-
var
|
2078
|
-
var editPurchaseOkResponse =
|
2079
|
-
return
|
2080
|
-
purchaseId:
|
2081
|
-
newStartDate:
|
2082
|
-
newEndDate:
|
2083
|
-
newStartTime:
|
2084
|
-
newEndTime:
|
2705
|
+
var import_zod41 = require("zod");
|
2706
|
+
var editPurchaseOkResponse = import_zod41.z.lazy(() => {
|
2707
|
+
return import_zod41.z.object({
|
2708
|
+
purchaseId: import_zod41.z.string().optional(),
|
2709
|
+
newStartDate: import_zod41.z.string().optional().nullable(),
|
2710
|
+
newEndDate: import_zod41.z.string().optional().nullable(),
|
2711
|
+
newStartTime: import_zod41.z.number().optional().nullable(),
|
2712
|
+
newEndTime: import_zod41.z.number().optional().nullable()
|
2085
2713
|
});
|
2086
2714
|
});
|
2087
|
-
var editPurchaseOkResponseResponse =
|
2088
|
-
return
|
2089
|
-
purchaseId:
|
2090
|
-
newStartDate:
|
2091
|
-
newEndDate:
|
2092
|
-
newStartTime:
|
2093
|
-
newEndTime:
|
2715
|
+
var editPurchaseOkResponseResponse = import_zod41.z.lazy(() => {
|
2716
|
+
return import_zod41.z.object({
|
2717
|
+
purchaseId: import_zod41.z.string().optional(),
|
2718
|
+
newStartDate: import_zod41.z.string().optional().nullable(),
|
2719
|
+
newEndDate: import_zod41.z.string().optional().nullable(),
|
2720
|
+
newStartTime: import_zod41.z.number().optional().nullable(),
|
2721
|
+
newEndTime: import_zod41.z.number().optional().nullable()
|
2094
2722
|
}).transform((data) => ({
|
2095
2723
|
purchaseId: data["purchaseId"],
|
2096
2724
|
newStartDate: data["newStartDate"],
|
@@ -2099,13 +2727,13 @@ var editPurchaseOkResponseResponse = import_zod24.z.lazy(() => {
|
|
2099
2727
|
newEndTime: data["newEndTime"]
|
2100
2728
|
}));
|
2101
2729
|
});
|
2102
|
-
var editPurchaseOkResponseRequest =
|
2103
|
-
return
|
2104
|
-
purchaseId:
|
2105
|
-
newStartDate:
|
2106
|
-
newEndDate:
|
2107
|
-
newStartTime:
|
2108
|
-
newEndTime:
|
2730
|
+
var editPurchaseOkResponseRequest = import_zod41.z.lazy(() => {
|
2731
|
+
return import_zod41.z.object({
|
2732
|
+
purchaseId: import_zod41.z.string().optional(),
|
2733
|
+
newStartDate: import_zod41.z.string().optional().nullable(),
|
2734
|
+
newEndDate: import_zod41.z.string().optional().nullable(),
|
2735
|
+
newStartTime: import_zod41.z.number().optional().nullable(),
|
2736
|
+
newEndTime: import_zod41.z.number().optional().nullable()
|
2109
2737
|
}).transform((data) => ({
|
2110
2738
|
purchaseId: data["purchaseId"],
|
2111
2739
|
newStartDate: data["newStartDate"],
|
@@ -2115,49 +2743,170 @@ var editPurchaseOkResponseRequest = import_zod24.z.lazy(() => {
|
|
2115
2743
|
}));
|
2116
2744
|
});
|
2117
2745
|
|
2746
|
+
// src/services/purchases/models/_12.ts
|
2747
|
+
var import_zod42 = require("zod");
|
2748
|
+
var _12Response = import_zod42.z.lazy(() => {
|
2749
|
+
return import_zod42.z.object({
|
2750
|
+
message: import_zod42.z.string().optional()
|
2751
|
+
}).transform((data) => ({
|
2752
|
+
message: data["message"]
|
2753
|
+
}));
|
2754
|
+
});
|
2755
|
+
var _12 = class extends ThrowableError {
|
2756
|
+
constructor(message, response) {
|
2757
|
+
super(message);
|
2758
|
+
this.message = message;
|
2759
|
+
this.response = response;
|
2760
|
+
const parsedResponse = _12Response.parse(response);
|
2761
|
+
this.message = parsedResponse.message || "";
|
2762
|
+
}
|
2763
|
+
throw() {
|
2764
|
+
throw new _12(this.message, this.response);
|
2765
|
+
}
|
2766
|
+
};
|
2767
|
+
|
2768
|
+
// src/services/purchases/models/_13.ts
|
2769
|
+
var import_zod43 = require("zod");
|
2770
|
+
var _13Response = import_zod43.z.lazy(() => {
|
2771
|
+
return import_zod43.z.object({
|
2772
|
+
message: import_zod43.z.string().optional()
|
2773
|
+
}).transform((data) => ({
|
2774
|
+
message: data["message"]
|
2775
|
+
}));
|
2776
|
+
});
|
2777
|
+
var _13 = class extends ThrowableError {
|
2778
|
+
constructor(message, response) {
|
2779
|
+
super(message);
|
2780
|
+
this.message = message;
|
2781
|
+
this.response = response;
|
2782
|
+
const parsedResponse = _13Response.parse(response);
|
2783
|
+
this.message = parsedResponse.message || "";
|
2784
|
+
}
|
2785
|
+
throw() {
|
2786
|
+
throw new _13(this.message, this.response);
|
2787
|
+
}
|
2788
|
+
};
|
2789
|
+
|
2118
2790
|
// src/services/purchases/models/get-purchase-consumption-ok-response.ts
|
2119
|
-
var
|
2120
|
-
var getPurchaseConsumptionOkResponse =
|
2121
|
-
return
|
2122
|
-
dataUsageRemainingInBytes:
|
2123
|
-
status:
|
2791
|
+
var import_zod44 = require("zod");
|
2792
|
+
var getPurchaseConsumptionOkResponse = import_zod44.z.lazy(() => {
|
2793
|
+
return import_zod44.z.object({
|
2794
|
+
dataUsageRemainingInBytes: import_zod44.z.number().optional(),
|
2795
|
+
status: import_zod44.z.string().optional()
|
2124
2796
|
});
|
2125
2797
|
});
|
2126
|
-
var getPurchaseConsumptionOkResponseResponse =
|
2127
|
-
return
|
2128
|
-
dataUsageRemainingInBytes:
|
2129
|
-
status:
|
2798
|
+
var getPurchaseConsumptionOkResponseResponse = import_zod44.z.lazy(() => {
|
2799
|
+
return import_zod44.z.object({
|
2800
|
+
dataUsageRemainingInBytes: import_zod44.z.number().optional(),
|
2801
|
+
status: import_zod44.z.string().optional()
|
2130
2802
|
}).transform((data) => ({
|
2131
2803
|
dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
|
2132
2804
|
status: data["status"]
|
2133
2805
|
}));
|
2134
2806
|
});
|
2135
|
-
var getPurchaseConsumptionOkResponseRequest =
|
2136
|
-
return
|
2807
|
+
var getPurchaseConsumptionOkResponseRequest = import_zod44.z.lazy(() => {
|
2808
|
+
return import_zod44.z.object({
|
2809
|
+
dataUsageRemainingInBytes: import_zod44.z.number().optional(),
|
2810
|
+
status: import_zod44.z.string().optional()
|
2811
|
+
}).transform((data) => ({
|
2137
2812
|
dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
|
2138
2813
|
status: data["status"]
|
2139
2814
|
}));
|
2140
2815
|
});
|
2141
2816
|
|
2142
|
-
// src/services/purchases/
|
2817
|
+
// src/services/purchases/models/_14.ts
|
2818
|
+
var import_zod45 = require("zod");
|
2819
|
+
var _14Response = import_zod45.z.lazy(() => {
|
2820
|
+
return import_zod45.z.object({
|
2821
|
+
message: import_zod45.z.string().optional()
|
2822
|
+
}).transform((data) => ({
|
2823
|
+
message: data["message"]
|
2824
|
+
}));
|
2825
|
+
});
|
2826
|
+
var _14 = class extends ThrowableError {
|
2827
|
+
constructor(message, response) {
|
2828
|
+
super(message);
|
2829
|
+
this.message = message;
|
2830
|
+
this.response = response;
|
2831
|
+
const parsedResponse = _14Response.parse(response);
|
2832
|
+
this.message = parsedResponse.message || "";
|
2833
|
+
}
|
2834
|
+
throw() {
|
2835
|
+
throw new _14(this.message, this.response);
|
2836
|
+
}
|
2837
|
+
};
|
2838
|
+
|
2839
|
+
// src/services/purchases/models/_15.ts
|
2840
|
+
var import_zod46 = require("zod");
|
2841
|
+
var _15Response = import_zod46.z.lazy(() => {
|
2842
|
+
return import_zod46.z.object({
|
2843
|
+
message: import_zod46.z.string().optional()
|
2844
|
+
}).transform((data) => ({
|
2845
|
+
message: data["message"]
|
2846
|
+
}));
|
2847
|
+
});
|
2848
|
+
var _15 = class extends ThrowableError {
|
2849
|
+
constructor(message, response) {
|
2850
|
+
super(message);
|
2851
|
+
this.message = message;
|
2852
|
+
this.response = response;
|
2853
|
+
const parsedResponse = _15Response.parse(response);
|
2854
|
+
this.message = parsedResponse.message || "";
|
2855
|
+
}
|
2856
|
+
throw() {
|
2857
|
+
throw new _15(this.message, this.response);
|
2858
|
+
}
|
2859
|
+
};
|
2860
|
+
|
2861
|
+
// src/services/purchases/purchases-service.ts
|
2143
2862
|
var PurchasesService = class extends BaseService {
|
2863
|
+
/**
|
2864
|
+
* This endpoint is used to purchase a new eSIM by providing the package details.
|
2865
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2866
|
+
* @returns {Promise<HttpResponse<CreatePurchaseV2OkResponse[]>>} Successful Response
|
2867
|
+
*/
|
2868
|
+
async createPurchaseV2(body, requestConfig) {
|
2869
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/purchases/v2").setRequestSchema(createPurchaseV2RequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2870
|
+
schema: import_zod47.z.array(createPurchaseV2OkResponseResponse),
|
2871
|
+
contentType: "json" /* Json */,
|
2872
|
+
status: 200
|
2873
|
+
}).addError({
|
2874
|
+
error: _4,
|
2875
|
+
contentType: "json" /* Json */,
|
2876
|
+
status: 400
|
2877
|
+
}).addError({
|
2878
|
+
error: _5,
|
2879
|
+
contentType: "json" /* Json */,
|
2880
|
+
status: 401
|
2881
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2882
|
+
return this.client.call(request);
|
2883
|
+
}
|
2144
2884
|
/**
|
2145
2885
|
* This endpoint can be used to list all the successful purchases made between a given interval.
|
2146
|
-
* @param {string} [iccid] - ID of the eSIM
|
2147
|
-
* @param {string} [afterDate] - Start date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2148
|
-
* @param {string} [beforeDate] - End date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2149
|
-
* @param {string} [referenceId] - The referenceId that was provided by the partner during the purchase or topup flow.
|
2150
|
-
* @param {string} [afterCursor] - To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
|
2151
|
-
* @param {number} [limit] - Maximum number of purchases to be returned in the response. The value must be greater than 0 and less than or equal to 100. If not provided, the default value is 20
|
2152
|
-
* @param {number} [after] - Epoch value representing the start of the time interval for filtering purchases
|
2153
|
-
* @param {number} [before] - Epoch value representing the end of the time interval for filtering purchases
|
2886
|
+
* @param {string} [params.iccid] - ID of the eSIM
|
2887
|
+
* @param {string} [params.afterDate] - Start date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2888
|
+
* @param {string} [params.beforeDate] - End date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2889
|
+
* @param {string} [params.referenceId] - The referenceId that was provided by the partner during the purchase or topup flow.
|
2890
|
+
* @param {string} [params.afterCursor] - To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
|
2891
|
+
* @param {number} [params.limit] - Maximum number of purchases to be returned in the response. The value must be greater than 0 and less than or equal to 100. If not provided, the default value is 20
|
2892
|
+
* @param {number} [params.after] - Epoch value representing the start of the time interval for filtering purchases
|
2893
|
+
* @param {number} [params.before] - Epoch value representing the end of the time interval for filtering purchases
|
2894
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2154
2895
|
* @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} Successful Response
|
2155
2896
|
*/
|
2156
2897
|
async listPurchases(params, requestConfig) {
|
2157
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(
|
2898
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(import_zod47.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2158
2899
|
schema: listPurchasesOkResponseResponse,
|
2159
2900
|
contentType: "json" /* Json */,
|
2160
2901
|
status: 200
|
2902
|
+
}).addError({
|
2903
|
+
error: _6,
|
2904
|
+
contentType: "json" /* Json */,
|
2905
|
+
status: 400
|
2906
|
+
}).addError({
|
2907
|
+
error: _7,
|
2908
|
+
contentType: "json" /* Json */,
|
2909
|
+
status: 401
|
2161
2910
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
|
2162
2911
|
key: "iccid",
|
2163
2912
|
value: params == null ? void 0 : params.iccid
|
@@ -2187,50 +2936,86 @@ var PurchasesService = class extends BaseService {
|
|
2187
2936
|
}
|
2188
2937
|
/**
|
2189
2938
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
2939
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2190
2940
|
* @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} Successful Response
|
2191
2941
|
*/
|
2192
2942
|
async createPurchase(body, requestConfig) {
|
2193
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2943
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2194
2944
|
schema: createPurchaseOkResponseResponse,
|
2195
2945
|
contentType: "json" /* Json */,
|
2196
2946
|
status: 200
|
2947
|
+
}).addError({
|
2948
|
+
error: _8,
|
2949
|
+
contentType: "json" /* Json */,
|
2950
|
+
status: 400
|
2951
|
+
}).addError({
|
2952
|
+
error: _9,
|
2953
|
+
contentType: "json" /* Json */,
|
2954
|
+
status: 401
|
2197
2955
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2198
2956
|
return this.client.call(request);
|
2199
2957
|
}
|
2200
2958
|
/**
|
2201
|
-
* This endpoint is used to top-up an eSIM with the previously associated destination by providing an existing ICCID and the package details. The top-up is
|
2959
|
+
* This endpoint is used to top-up an eSIM with the previously associated destination by providing an existing ICCID and the package details. The top-up is only feasible for eSIMs in "ENABLED" or "INSTALLED" state. You can check this state using the Get eSIM Status endpoint.
|
2960
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2202
2961
|
* @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
|
2203
2962
|
*/
|
2204
2963
|
async topUpEsim(body, requestConfig) {
|
2205
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2964
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2206
2965
|
schema: topUpEsimOkResponseResponse,
|
2207
2966
|
contentType: "json" /* Json */,
|
2208
2967
|
status: 200
|
2968
|
+
}).addError({
|
2969
|
+
error: _10,
|
2970
|
+
contentType: "json" /* Json */,
|
2971
|
+
status: 400
|
2972
|
+
}).addError({
|
2973
|
+
error: _11,
|
2974
|
+
contentType: "json" /* Json */,
|
2975
|
+
status: 401
|
2209
2976
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2210
2977
|
return this.client.call(request);
|
2211
2978
|
}
|
2212
2979
|
/**
|
2213
|
-
* This endpoint allows you to modify the dates of an existing package with a future activation start time. Editing can only be performed for packages that have not been activated, and it cannot change the package size. The modification must not change the package duration category to ensure pricing consistency.
|
2980
|
+
* This endpoint allows you to modify the dates of an existing package with a future activation start time. Editing can only be performed for packages that have not been activated, and it cannot change the package size. The modification must not change the package duration category to ensure pricing consistency. Duration based packages cannot be edited.
|
2981
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2214
2982
|
* @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
|
2215
2983
|
*/
|
2216
2984
|
async editPurchase(body, requestConfig) {
|
2217
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2985
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2218
2986
|
schema: editPurchaseOkResponseResponse,
|
2219
2987
|
contentType: "json" /* Json */,
|
2220
2988
|
status: 200
|
2989
|
+
}).addError({
|
2990
|
+
error: _12,
|
2991
|
+
contentType: "json" /* Json */,
|
2992
|
+
status: 400
|
2993
|
+
}).addError({
|
2994
|
+
error: _13,
|
2995
|
+
contentType: "json" /* Json */,
|
2996
|
+
status: 401
|
2221
2997
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2222
2998
|
return this.client.call(request);
|
2223
2999
|
}
|
2224
3000
|
/**
|
2225
3001
|
* This endpoint can be called for consumption notifications (e.g. every 1 hour or when the user clicks a button). It returns the data balance (consumption) of purchased packages.
|
2226
3002
|
* @param {string} purchaseId - ID of the purchase
|
3003
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2227
3004
|
* @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} Successful Response
|
2228
3005
|
*/
|
2229
3006
|
async getPurchaseConsumption(purchaseId, requestConfig) {
|
2230
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(
|
3007
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(import_zod47.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2231
3008
|
schema: getPurchaseConsumptionOkResponseResponse,
|
2232
3009
|
contentType: "json" /* Json */,
|
2233
3010
|
status: 200
|
3011
|
+
}).addError({
|
3012
|
+
error: _14,
|
3013
|
+
contentType: "json" /* Json */,
|
3014
|
+
status: 400
|
3015
|
+
}).addError({
|
3016
|
+
error: _15,
|
3017
|
+
contentType: "json" /* Json */,
|
3018
|
+
status: 401
|
2234
3019
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2235
3020
|
key: "purchaseId",
|
2236
3021
|
value: purchaseId
|
@@ -2239,28 +3024,28 @@ var PurchasesService = class extends BaseService {
|
|
2239
3024
|
}
|
2240
3025
|
};
|
2241
3026
|
|
2242
|
-
// src/services/e-sim/e-sim.ts
|
2243
|
-
var
|
3027
|
+
// src/services/e-sim/e-sim-service.ts
|
3028
|
+
var import_zod65 = require("zod");
|
2244
3029
|
|
2245
3030
|
// src/services/e-sim/models/get-esim-ok-response.ts
|
2246
|
-
var
|
3031
|
+
var import_zod49 = require("zod");
|
2247
3032
|
|
2248
3033
|
// src/services/e-sim/models/get-esim-ok-response-esim.ts
|
2249
|
-
var
|
2250
|
-
var getEsimOkResponseEsim =
|
2251
|
-
return
|
2252
|
-
iccid:
|
2253
|
-
smdpAddress:
|
2254
|
-
manualActivationCode:
|
2255
|
-
status:
|
3034
|
+
var import_zod48 = require("zod");
|
3035
|
+
var getEsimOkResponseEsim = import_zod48.z.lazy(() => {
|
3036
|
+
return import_zod48.z.object({
|
3037
|
+
iccid: import_zod48.z.string().min(18).max(22).optional(),
|
3038
|
+
smdpAddress: import_zod48.z.string().optional(),
|
3039
|
+
manualActivationCode: import_zod48.z.string().optional(),
|
3040
|
+
status: import_zod48.z.string().optional()
|
2256
3041
|
});
|
2257
3042
|
});
|
2258
|
-
var getEsimOkResponseEsimResponse =
|
2259
|
-
return
|
2260
|
-
iccid:
|
2261
|
-
smdpAddress:
|
2262
|
-
manualActivationCode:
|
2263
|
-
status:
|
3043
|
+
var getEsimOkResponseEsimResponse = import_zod48.z.lazy(() => {
|
3044
|
+
return import_zod48.z.object({
|
3045
|
+
iccid: import_zod48.z.string().min(18).max(22).optional(),
|
3046
|
+
smdpAddress: import_zod48.z.string().optional(),
|
3047
|
+
manualActivationCode: import_zod48.z.string().optional(),
|
3048
|
+
status: import_zod48.z.string().optional()
|
2264
3049
|
}).transform((data) => ({
|
2265
3050
|
iccid: data["iccid"],
|
2266
3051
|
smdpAddress: data["smdpAddress"],
|
@@ -2268,12 +3053,12 @@ var getEsimOkResponseEsimResponse = import_zod27.z.lazy(() => {
|
|
2268
3053
|
status: data["status"]
|
2269
3054
|
}));
|
2270
3055
|
});
|
2271
|
-
var getEsimOkResponseEsimRequest =
|
2272
|
-
return
|
2273
|
-
iccid:
|
2274
|
-
smdpAddress:
|
2275
|
-
manualActivationCode:
|
2276
|
-
status:
|
3056
|
+
var getEsimOkResponseEsimRequest = import_zod48.z.lazy(() => {
|
3057
|
+
return import_zod48.z.object({
|
3058
|
+
iccid: import_zod48.z.string().min(18).max(22).optional(),
|
3059
|
+
smdpAddress: import_zod48.z.string().optional(),
|
3060
|
+
manualActivationCode: import_zod48.z.string().optional(),
|
3061
|
+
status: import_zod48.z.string().optional()
|
2277
3062
|
}).transform((data) => ({
|
2278
3063
|
iccid: data["iccid"],
|
2279
3064
|
smdpAddress: data["smdpAddress"],
|
@@ -2283,43 +3068,89 @@ var getEsimOkResponseEsimRequest = import_zod27.z.lazy(() => {
|
|
2283
3068
|
});
|
2284
3069
|
|
2285
3070
|
// src/services/e-sim/models/get-esim-ok-response.ts
|
2286
|
-
var getEsimOkResponse =
|
2287
|
-
return
|
3071
|
+
var getEsimOkResponse = import_zod49.z.lazy(() => {
|
3072
|
+
return import_zod49.z.object({
|
2288
3073
|
esim: getEsimOkResponseEsim.optional()
|
2289
3074
|
});
|
2290
3075
|
});
|
2291
|
-
var getEsimOkResponseResponse =
|
2292
|
-
return
|
3076
|
+
var getEsimOkResponseResponse = import_zod49.z.lazy(() => {
|
3077
|
+
return import_zod49.z.object({
|
2293
3078
|
esim: getEsimOkResponseEsimResponse.optional()
|
2294
3079
|
}).transform((data) => ({
|
2295
3080
|
esim: data["esim"]
|
2296
3081
|
}));
|
2297
3082
|
});
|
2298
|
-
var getEsimOkResponseRequest =
|
2299
|
-
return
|
3083
|
+
var getEsimOkResponseRequest = import_zod49.z.lazy(() => {
|
3084
|
+
return import_zod49.z.object({
|
3085
|
+
esim: getEsimOkResponseEsimRequest.optional()
|
3086
|
+
}).transform((data) => ({
|
2300
3087
|
esim: data["esim"]
|
2301
3088
|
}));
|
2302
3089
|
});
|
2303
3090
|
|
3091
|
+
// src/services/e-sim/models/_16.ts
|
3092
|
+
var import_zod50 = require("zod");
|
3093
|
+
var _16Response = import_zod50.z.lazy(() => {
|
3094
|
+
return import_zod50.z.object({
|
3095
|
+
message: import_zod50.z.string().optional()
|
3096
|
+
}).transform((data) => ({
|
3097
|
+
message: data["message"]
|
3098
|
+
}));
|
3099
|
+
});
|
3100
|
+
var _16 = class extends ThrowableError {
|
3101
|
+
constructor(message, response) {
|
3102
|
+
super(message);
|
3103
|
+
this.message = message;
|
3104
|
+
this.response = response;
|
3105
|
+
const parsedResponse = _16Response.parse(response);
|
3106
|
+
this.message = parsedResponse.message || "";
|
3107
|
+
}
|
3108
|
+
throw() {
|
3109
|
+
throw new _16(this.message, this.response);
|
3110
|
+
}
|
3111
|
+
};
|
3112
|
+
|
3113
|
+
// src/services/e-sim/models/_17.ts
|
3114
|
+
var import_zod51 = require("zod");
|
3115
|
+
var _17Response = import_zod51.z.lazy(() => {
|
3116
|
+
return import_zod51.z.object({
|
3117
|
+
message: import_zod51.z.string().optional()
|
3118
|
+
}).transform((data) => ({
|
3119
|
+
message: data["message"]
|
3120
|
+
}));
|
3121
|
+
});
|
3122
|
+
var _17 = class extends ThrowableError {
|
3123
|
+
constructor(message, response) {
|
3124
|
+
super(message);
|
3125
|
+
this.message = message;
|
3126
|
+
this.response = response;
|
3127
|
+
const parsedResponse = _17Response.parse(response);
|
3128
|
+
this.message = parsedResponse.message || "";
|
3129
|
+
}
|
3130
|
+
throw() {
|
3131
|
+
throw new _17(this.message, this.response);
|
3132
|
+
}
|
3133
|
+
};
|
3134
|
+
|
2304
3135
|
// src/services/e-sim/models/get-esim-device-ok-response.ts
|
2305
|
-
var
|
3136
|
+
var import_zod53 = require("zod");
|
2306
3137
|
|
2307
3138
|
// src/services/e-sim/models/device.ts
|
2308
|
-
var
|
2309
|
-
var device =
|
2310
|
-
return
|
2311
|
-
oem:
|
2312
|
-
hardwareName:
|
2313
|
-
hardwareModel:
|
2314
|
-
eid:
|
3139
|
+
var import_zod52 = require("zod");
|
3140
|
+
var device = import_zod52.z.lazy(() => {
|
3141
|
+
return import_zod52.z.object({
|
3142
|
+
oem: import_zod52.z.string().optional(),
|
3143
|
+
hardwareName: import_zod52.z.string().optional(),
|
3144
|
+
hardwareModel: import_zod52.z.string().optional(),
|
3145
|
+
eid: import_zod52.z.string().optional()
|
2315
3146
|
});
|
2316
3147
|
});
|
2317
|
-
var deviceResponse =
|
2318
|
-
return
|
2319
|
-
oem:
|
2320
|
-
hardwareName:
|
2321
|
-
hardwareModel:
|
2322
|
-
eid:
|
3148
|
+
var deviceResponse = import_zod52.z.lazy(() => {
|
3149
|
+
return import_zod52.z.object({
|
3150
|
+
oem: import_zod52.z.string().optional(),
|
3151
|
+
hardwareName: import_zod52.z.string().optional(),
|
3152
|
+
hardwareModel: import_zod52.z.string().optional(),
|
3153
|
+
eid: import_zod52.z.string().optional()
|
2323
3154
|
}).transform((data) => ({
|
2324
3155
|
oem: data["oem"],
|
2325
3156
|
hardwareName: data["hardwareName"],
|
@@ -2327,12 +3158,12 @@ var deviceResponse = import_zod29.z.lazy(() => {
|
|
2327
3158
|
eid: data["eid"]
|
2328
3159
|
}));
|
2329
3160
|
});
|
2330
|
-
var deviceRequest =
|
2331
|
-
return
|
2332
|
-
oem:
|
2333
|
-
hardwareName:
|
2334
|
-
hardwareModel:
|
2335
|
-
eid:
|
3161
|
+
var deviceRequest = import_zod52.z.lazy(() => {
|
3162
|
+
return import_zod52.z.object({
|
3163
|
+
oem: import_zod52.z.string().optional(),
|
3164
|
+
hardwareName: import_zod52.z.string().optional(),
|
3165
|
+
hardwareModel: import_zod52.z.string().optional(),
|
3166
|
+
eid: import_zod52.z.string().optional()
|
2336
3167
|
}).transform((data) => ({
|
2337
3168
|
oem: data["oem"],
|
2338
3169
|
hardwareName: data["hardwareName"],
|
@@ -2342,52 +3173,102 @@ var deviceRequest = import_zod29.z.lazy(() => {
|
|
2342
3173
|
});
|
2343
3174
|
|
2344
3175
|
// src/services/e-sim/models/get-esim-device-ok-response.ts
|
2345
|
-
var getEsimDeviceOkResponse =
|
2346
|
-
return
|
3176
|
+
var getEsimDeviceOkResponse = import_zod53.z.lazy(() => {
|
3177
|
+
return import_zod53.z.object({
|
2347
3178
|
device: device.optional()
|
2348
3179
|
});
|
2349
3180
|
});
|
2350
|
-
var getEsimDeviceOkResponseResponse =
|
2351
|
-
return
|
3181
|
+
var getEsimDeviceOkResponseResponse = import_zod53.z.lazy(() => {
|
3182
|
+
return import_zod53.z.object({
|
2352
3183
|
device: deviceResponse.optional()
|
2353
3184
|
}).transform((data) => ({
|
2354
3185
|
device: data["device"]
|
2355
3186
|
}));
|
2356
3187
|
});
|
2357
|
-
var getEsimDeviceOkResponseRequest =
|
2358
|
-
return
|
3188
|
+
var getEsimDeviceOkResponseRequest = import_zod53.z.lazy(() => {
|
3189
|
+
return import_zod53.z.object({
|
3190
|
+
device: deviceRequest.optional()
|
3191
|
+
}).transform((data) => ({
|
2359
3192
|
device: data["device"]
|
2360
3193
|
}));
|
2361
3194
|
});
|
2362
3195
|
|
3196
|
+
// src/services/e-sim/models/_18.ts
|
3197
|
+
var import_zod54 = require("zod");
|
3198
|
+
var _18Response = import_zod54.z.lazy(() => {
|
3199
|
+
return import_zod54.z.object({
|
3200
|
+
message: import_zod54.z.string().optional()
|
3201
|
+
}).transform((data) => ({
|
3202
|
+
message: data["message"]
|
3203
|
+
}));
|
3204
|
+
});
|
3205
|
+
var _18 = class extends ThrowableError {
|
3206
|
+
constructor(message, response) {
|
3207
|
+
super(message);
|
3208
|
+
this.message = message;
|
3209
|
+
this.response = response;
|
3210
|
+
const parsedResponse = _18Response.parse(response);
|
3211
|
+
this.message = parsedResponse.message || "";
|
3212
|
+
}
|
3213
|
+
throw() {
|
3214
|
+
throw new _18(this.message, this.response);
|
3215
|
+
}
|
3216
|
+
};
|
3217
|
+
|
3218
|
+
// src/services/e-sim/models/_19.ts
|
3219
|
+
var import_zod55 = require("zod");
|
3220
|
+
var _19Response = import_zod55.z.lazy(() => {
|
3221
|
+
return import_zod55.z.object({
|
3222
|
+
message: import_zod55.z.string().optional()
|
3223
|
+
}).transform((data) => ({
|
3224
|
+
message: data["message"]
|
3225
|
+
}));
|
3226
|
+
});
|
3227
|
+
var _19 = class extends ThrowableError {
|
3228
|
+
constructor(message, response) {
|
3229
|
+
super(message);
|
3230
|
+
this.message = message;
|
3231
|
+
this.response = response;
|
3232
|
+
const parsedResponse = _19Response.parse(response);
|
3233
|
+
this.message = parsedResponse.message || "";
|
3234
|
+
}
|
3235
|
+
throw() {
|
3236
|
+
throw new _19(this.message, this.response);
|
3237
|
+
}
|
3238
|
+
};
|
3239
|
+
|
2363
3240
|
// src/services/e-sim/models/get-esim-history-ok-response.ts
|
2364
|
-
var
|
3241
|
+
var import_zod58 = require("zod");
|
2365
3242
|
|
2366
3243
|
// src/services/e-sim/models/get-esim-history-ok-response-esim.ts
|
2367
|
-
var
|
3244
|
+
var import_zod57 = require("zod");
|
2368
3245
|
|
2369
3246
|
// src/services/e-sim/models/history.ts
|
2370
|
-
var
|
2371
|
-
var history =
|
2372
|
-
return
|
2373
|
-
status:
|
2374
|
-
statusDate:
|
2375
|
-
date:
|
3247
|
+
var import_zod56 = require("zod");
|
3248
|
+
var history = import_zod56.z.lazy(() => {
|
3249
|
+
return import_zod56.z.object({
|
3250
|
+
status: import_zod56.z.string().optional(),
|
3251
|
+
statusDate: import_zod56.z.string().optional(),
|
3252
|
+
date: import_zod56.z.number().optional()
|
2376
3253
|
});
|
2377
3254
|
});
|
2378
|
-
var historyResponse =
|
2379
|
-
return
|
2380
|
-
status:
|
2381
|
-
statusDate:
|
2382
|
-
date:
|
3255
|
+
var historyResponse = import_zod56.z.lazy(() => {
|
3256
|
+
return import_zod56.z.object({
|
3257
|
+
status: import_zod56.z.string().optional(),
|
3258
|
+
statusDate: import_zod56.z.string().optional(),
|
3259
|
+
date: import_zod56.z.number().optional()
|
2383
3260
|
}).transform((data) => ({
|
2384
3261
|
status: data["status"],
|
2385
3262
|
statusDate: data["statusDate"],
|
2386
3263
|
date: data["date"]
|
2387
3264
|
}));
|
2388
3265
|
});
|
2389
|
-
var historyRequest =
|
2390
|
-
return
|
3266
|
+
var historyRequest = import_zod56.z.lazy(() => {
|
3267
|
+
return import_zod56.z.object({
|
3268
|
+
status: import_zod56.z.string().optional(),
|
3269
|
+
statusDate: import_zod56.z.string().optional(),
|
3270
|
+
date: import_zod56.z.number().optional()
|
3271
|
+
}).transform((data) => ({
|
2391
3272
|
status: data["status"],
|
2392
3273
|
statusDate: data["statusDate"],
|
2393
3274
|
date: data["date"]
|
@@ -2395,75 +3276,124 @@ var historyRequest = import_zod31.z.lazy(() => {
|
|
2395
3276
|
});
|
2396
3277
|
|
2397
3278
|
// src/services/e-sim/models/get-esim-history-ok-response-esim.ts
|
2398
|
-
var getEsimHistoryOkResponseEsim =
|
2399
|
-
return
|
2400
|
-
iccid:
|
2401
|
-
history:
|
3279
|
+
var getEsimHistoryOkResponseEsim = import_zod57.z.lazy(() => {
|
3280
|
+
return import_zod57.z.object({
|
3281
|
+
iccid: import_zod57.z.string().min(18).max(22).optional(),
|
3282
|
+
history: import_zod57.z.array(history).optional()
|
2402
3283
|
});
|
2403
3284
|
});
|
2404
|
-
var getEsimHistoryOkResponseEsimResponse =
|
2405
|
-
return
|
2406
|
-
iccid:
|
2407
|
-
history:
|
3285
|
+
var getEsimHistoryOkResponseEsimResponse = import_zod57.z.lazy(() => {
|
3286
|
+
return import_zod57.z.object({
|
3287
|
+
iccid: import_zod57.z.string().min(18).max(22).optional(),
|
3288
|
+
history: import_zod57.z.array(historyResponse).optional()
|
2408
3289
|
}).transform((data) => ({
|
2409
3290
|
iccid: data["iccid"],
|
2410
3291
|
history: data["history"]
|
2411
3292
|
}));
|
2412
3293
|
});
|
2413
|
-
var getEsimHistoryOkResponseEsimRequest =
|
2414
|
-
return
|
3294
|
+
var getEsimHistoryOkResponseEsimRequest = import_zod57.z.lazy(() => {
|
3295
|
+
return import_zod57.z.object({
|
3296
|
+
iccid: import_zod57.z.string().min(18).max(22).optional(),
|
3297
|
+
history: import_zod57.z.array(historyRequest).optional()
|
3298
|
+
}).transform((data) => ({
|
2415
3299
|
iccid: data["iccid"],
|
2416
3300
|
history: data["history"]
|
2417
3301
|
}));
|
2418
3302
|
});
|
2419
3303
|
|
2420
3304
|
// src/services/e-sim/models/get-esim-history-ok-response.ts
|
2421
|
-
var getEsimHistoryOkResponse =
|
2422
|
-
return
|
3305
|
+
var getEsimHistoryOkResponse = import_zod58.z.lazy(() => {
|
3306
|
+
return import_zod58.z.object({
|
2423
3307
|
esim: getEsimHistoryOkResponseEsim.optional()
|
2424
3308
|
});
|
2425
3309
|
});
|
2426
|
-
var getEsimHistoryOkResponseResponse =
|
2427
|
-
return
|
3310
|
+
var getEsimHistoryOkResponseResponse = import_zod58.z.lazy(() => {
|
3311
|
+
return import_zod58.z.object({
|
2428
3312
|
esim: getEsimHistoryOkResponseEsimResponse.optional()
|
2429
3313
|
}).transform((data) => ({
|
2430
3314
|
esim: data["esim"]
|
2431
3315
|
}));
|
2432
3316
|
});
|
2433
|
-
var getEsimHistoryOkResponseRequest =
|
2434
|
-
return
|
3317
|
+
var getEsimHistoryOkResponseRequest = import_zod58.z.lazy(() => {
|
3318
|
+
return import_zod58.z.object({
|
3319
|
+
esim: getEsimHistoryOkResponseEsimRequest.optional()
|
3320
|
+
}).transform((data) => ({
|
2435
3321
|
esim: data["esim"]
|
2436
3322
|
}));
|
2437
3323
|
});
|
2438
3324
|
|
3325
|
+
// src/services/e-sim/models/_20.ts
|
3326
|
+
var import_zod59 = require("zod");
|
3327
|
+
var _20Response = import_zod59.z.lazy(() => {
|
3328
|
+
return import_zod59.z.object({
|
3329
|
+
message: import_zod59.z.string().optional()
|
3330
|
+
}).transform((data) => ({
|
3331
|
+
message: data["message"]
|
3332
|
+
}));
|
3333
|
+
});
|
3334
|
+
var _20 = class extends ThrowableError {
|
3335
|
+
constructor(message, response) {
|
3336
|
+
super(message);
|
3337
|
+
this.message = message;
|
3338
|
+
this.response = response;
|
3339
|
+
const parsedResponse = _20Response.parse(response);
|
3340
|
+
this.message = parsedResponse.message || "";
|
3341
|
+
}
|
3342
|
+
throw() {
|
3343
|
+
throw new _20(this.message, this.response);
|
3344
|
+
}
|
3345
|
+
};
|
3346
|
+
|
3347
|
+
// src/services/e-sim/models/_21.ts
|
3348
|
+
var import_zod60 = require("zod");
|
3349
|
+
var _21Response = import_zod60.z.lazy(() => {
|
3350
|
+
return import_zod60.z.object({
|
3351
|
+
message: import_zod60.z.string().optional()
|
3352
|
+
}).transform((data) => ({
|
3353
|
+
message: data["message"]
|
3354
|
+
}));
|
3355
|
+
});
|
3356
|
+
var _21 = class extends ThrowableError {
|
3357
|
+
constructor(message, response) {
|
3358
|
+
super(message);
|
3359
|
+
this.message = message;
|
3360
|
+
this.response = response;
|
3361
|
+
const parsedResponse = _21Response.parse(response);
|
3362
|
+
this.message = parsedResponse.message || "";
|
3363
|
+
}
|
3364
|
+
throw() {
|
3365
|
+
throw new _21(this.message, this.response);
|
3366
|
+
}
|
3367
|
+
};
|
3368
|
+
|
2439
3369
|
// src/services/e-sim/models/get-esim-mac-ok-response.ts
|
2440
|
-
var
|
3370
|
+
var import_zod62 = require("zod");
|
2441
3371
|
|
2442
3372
|
// src/services/e-sim/models/get-esim-mac-ok-response-esim.ts
|
2443
|
-
var
|
2444
|
-
var getEsimMacOkResponseEsim =
|
2445
|
-
return
|
2446
|
-
iccid:
|
2447
|
-
smdpAddress:
|
2448
|
-
manualActivationCode:
|
3373
|
+
var import_zod61 = require("zod");
|
3374
|
+
var getEsimMacOkResponseEsim = import_zod61.z.lazy(() => {
|
3375
|
+
return import_zod61.z.object({
|
3376
|
+
iccid: import_zod61.z.string().min(18).max(22).optional(),
|
3377
|
+
smdpAddress: import_zod61.z.string().optional(),
|
3378
|
+
manualActivationCode: import_zod61.z.string().optional()
|
2449
3379
|
});
|
2450
3380
|
});
|
2451
|
-
var getEsimMacOkResponseEsimResponse =
|
2452
|
-
return
|
2453
|
-
iccid:
|
2454
|
-
smdpAddress:
|
2455
|
-
manualActivationCode:
|
3381
|
+
var getEsimMacOkResponseEsimResponse = import_zod61.z.lazy(() => {
|
3382
|
+
return import_zod61.z.object({
|
3383
|
+
iccid: import_zod61.z.string().min(18).max(22).optional(),
|
3384
|
+
smdpAddress: import_zod61.z.string().optional(),
|
3385
|
+
manualActivationCode: import_zod61.z.string().optional()
|
2456
3386
|
}).transform((data) => ({
|
2457
3387
|
iccid: data["iccid"],
|
2458
3388
|
smdpAddress: data["smdpAddress"],
|
2459
3389
|
manualActivationCode: data["manualActivationCode"]
|
2460
3390
|
}));
|
2461
3391
|
});
|
2462
|
-
var getEsimMacOkResponseEsimRequest =
|
2463
|
-
return
|
2464
|
-
iccid:
|
2465
|
-
smdpAddress:
|
2466
|
-
manualActivationCode:
|
3392
|
+
var getEsimMacOkResponseEsimRequest = import_zod61.z.lazy(() => {
|
3393
|
+
return import_zod61.z.object({
|
3394
|
+
iccid: import_zod61.z.string().min(18).max(22).optional(),
|
3395
|
+
smdpAddress: import_zod61.z.string().optional(),
|
3396
|
+
manualActivationCode: import_zod61.z.string().optional()
|
2467
3397
|
}).transform((data) => ({
|
2468
3398
|
iccid: data["iccid"],
|
2469
3399
|
smdpAddress: data["smdpAddress"],
|
@@ -2472,36 +3402,91 @@ var getEsimMacOkResponseEsimRequest = import_zod34.z.lazy(() => {
|
|
2472
3402
|
});
|
2473
3403
|
|
2474
3404
|
// src/services/e-sim/models/get-esim-mac-ok-response.ts
|
2475
|
-
var getEsimMacOkResponse =
|
2476
|
-
return
|
3405
|
+
var getEsimMacOkResponse = import_zod62.z.lazy(() => {
|
3406
|
+
return import_zod62.z.object({
|
2477
3407
|
esim: getEsimMacOkResponseEsim.optional()
|
2478
3408
|
});
|
2479
3409
|
});
|
2480
|
-
var getEsimMacOkResponseResponse =
|
2481
|
-
return
|
3410
|
+
var getEsimMacOkResponseResponse = import_zod62.z.lazy(() => {
|
3411
|
+
return import_zod62.z.object({
|
2482
3412
|
esim: getEsimMacOkResponseEsimResponse.optional()
|
2483
3413
|
}).transform((data) => ({
|
2484
3414
|
esim: data["esim"]
|
2485
3415
|
}));
|
2486
3416
|
});
|
2487
|
-
var getEsimMacOkResponseRequest =
|
2488
|
-
return
|
3417
|
+
var getEsimMacOkResponseRequest = import_zod62.z.lazy(() => {
|
3418
|
+
return import_zod62.z.object({
|
3419
|
+
esim: getEsimMacOkResponseEsimRequest.optional()
|
3420
|
+
}).transform((data) => ({
|
2489
3421
|
esim: data["esim"]
|
2490
3422
|
}));
|
2491
3423
|
});
|
2492
3424
|
|
2493
|
-
// src/services/e-sim/
|
3425
|
+
// src/services/e-sim/models/_22.ts
|
3426
|
+
var import_zod63 = require("zod");
|
3427
|
+
var _22Response = import_zod63.z.lazy(() => {
|
3428
|
+
return import_zod63.z.object({
|
3429
|
+
message: import_zod63.z.string().optional()
|
3430
|
+
}).transform((data) => ({
|
3431
|
+
message: data["message"]
|
3432
|
+
}));
|
3433
|
+
});
|
3434
|
+
var _22 = class extends ThrowableError {
|
3435
|
+
constructor(message, response) {
|
3436
|
+
super(message);
|
3437
|
+
this.message = message;
|
3438
|
+
this.response = response;
|
3439
|
+
const parsedResponse = _22Response.parse(response);
|
3440
|
+
this.message = parsedResponse.message || "";
|
3441
|
+
}
|
3442
|
+
throw() {
|
3443
|
+
throw new _22(this.message, this.response);
|
3444
|
+
}
|
3445
|
+
};
|
3446
|
+
|
3447
|
+
// src/services/e-sim/models/_23.ts
|
3448
|
+
var import_zod64 = require("zod");
|
3449
|
+
var _23Response = import_zod64.z.lazy(() => {
|
3450
|
+
return import_zod64.z.object({
|
3451
|
+
message: import_zod64.z.string().optional()
|
3452
|
+
}).transform((data) => ({
|
3453
|
+
message: data["message"]
|
3454
|
+
}));
|
3455
|
+
});
|
3456
|
+
var _23 = class extends ThrowableError {
|
3457
|
+
constructor(message, response) {
|
3458
|
+
super(message);
|
3459
|
+
this.message = message;
|
3460
|
+
this.response = response;
|
3461
|
+
const parsedResponse = _23Response.parse(response);
|
3462
|
+
this.message = parsedResponse.message || "";
|
3463
|
+
}
|
3464
|
+
throw() {
|
3465
|
+
throw new _23(this.message, this.response);
|
3466
|
+
}
|
3467
|
+
};
|
3468
|
+
|
3469
|
+
// src/services/e-sim/e-sim-service.ts
|
2494
3470
|
var ESimService = class extends BaseService {
|
2495
3471
|
/**
|
2496
3472
|
* Get eSIM Status
|
2497
3473
|
* @param {string} iccid - ID of the eSIM
|
3474
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2498
3475
|
* @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
|
2499
3476
|
*/
|
2500
3477
|
async getEsim(params, requestConfig) {
|
2501
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(
|
3478
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(import_zod65.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2502
3479
|
schema: getEsimOkResponseResponse,
|
2503
3480
|
contentType: "json" /* Json */,
|
2504
3481
|
status: 200
|
3482
|
+
}).addError({
|
3483
|
+
error: _16,
|
3484
|
+
contentType: "json" /* Json */,
|
3485
|
+
status: 400
|
3486
|
+
}).addError({
|
3487
|
+
error: _17,
|
3488
|
+
contentType: "json" /* Json */,
|
3489
|
+
status: 401
|
2505
3490
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
|
2506
3491
|
key: "iccid",
|
2507
3492
|
value: params == null ? void 0 : params.iccid
|
@@ -2511,13 +3496,22 @@ var ESimService = class extends BaseService {
|
|
2511
3496
|
/**
|
2512
3497
|
* Get eSIM Device
|
2513
3498
|
* @param {string} iccid - ID of the eSIM
|
3499
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2514
3500
|
* @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
|
2515
3501
|
*/
|
2516
3502
|
async getEsimDevice(iccid, requestConfig) {
|
2517
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(
|
3503
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(import_zod65.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2518
3504
|
schema: getEsimDeviceOkResponseResponse,
|
2519
3505
|
contentType: "json" /* Json */,
|
2520
3506
|
status: 200
|
3507
|
+
}).addError({
|
3508
|
+
error: _18,
|
3509
|
+
contentType: "json" /* Json */,
|
3510
|
+
status: 400
|
3511
|
+
}).addError({
|
3512
|
+
error: _19,
|
3513
|
+
contentType: "json" /* Json */,
|
3514
|
+
status: 401
|
2521
3515
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2522
3516
|
key: "iccid",
|
2523
3517
|
value: iccid
|
@@ -2527,13 +3521,22 @@ var ESimService = class extends BaseService {
|
|
2527
3521
|
/**
|
2528
3522
|
* Get eSIM History
|
2529
3523
|
* @param {string} iccid - ID of the eSIM
|
3524
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2530
3525
|
* @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
|
2531
3526
|
*/
|
2532
3527
|
async getEsimHistory(iccid, requestConfig) {
|
2533
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(
|
3528
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(import_zod65.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2534
3529
|
schema: getEsimHistoryOkResponseResponse,
|
2535
3530
|
contentType: "json" /* Json */,
|
2536
3531
|
status: 200
|
3532
|
+
}).addError({
|
3533
|
+
error: _20,
|
3534
|
+
contentType: "json" /* Json */,
|
3535
|
+
status: 400
|
3536
|
+
}).addError({
|
3537
|
+
error: _21,
|
3538
|
+
contentType: "json" /* Json */,
|
3539
|
+
status: 401
|
2537
3540
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2538
3541
|
key: "iccid",
|
2539
3542
|
value: iccid
|
@@ -2543,13 +3546,22 @@ var ESimService = class extends BaseService {
|
|
2543
3546
|
/**
|
2544
3547
|
* Get eSIM MAC
|
2545
3548
|
* @param {string} iccid - ID of the eSIM
|
3549
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2546
3550
|
* @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
|
2547
3551
|
*/
|
2548
3552
|
async getEsimMac(iccid, requestConfig) {
|
2549
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(
|
3553
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(import_zod65.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2550
3554
|
schema: getEsimMacOkResponseResponse,
|
2551
3555
|
contentType: "json" /* Json */,
|
2552
3556
|
status: 200
|
3557
|
+
}).addError({
|
3558
|
+
error: _22,
|
3559
|
+
contentType: "json" /* Json */,
|
3560
|
+
status: 400
|
3561
|
+
}).addError({
|
3562
|
+
error: _23,
|
3563
|
+
contentType: "json" /* Json */,
|
3564
|
+
status: 401
|
2553
3565
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2554
3566
|
key: "iccid",
|
2555
3567
|
value: iccid
|
@@ -2558,40 +3570,95 @@ var ESimService = class extends BaseService {
|
|
2558
3570
|
}
|
2559
3571
|
};
|
2560
3572
|
|
2561
|
-
// src/services/i-frame/i-frame.ts
|
2562
|
-
var
|
3573
|
+
// src/services/i-frame/i-frame-service.ts
|
3574
|
+
var import_zod69 = require("zod");
|
2563
3575
|
|
2564
3576
|
// src/services/i-frame/models/token-ok-response.ts
|
2565
|
-
var
|
2566
|
-
var tokenOkResponse =
|
2567
|
-
return
|
2568
|
-
token:
|
3577
|
+
var import_zod66 = require("zod");
|
3578
|
+
var tokenOkResponse = import_zod66.z.lazy(() => {
|
3579
|
+
return import_zod66.z.object({
|
3580
|
+
token: import_zod66.z.string().optional()
|
2569
3581
|
});
|
2570
3582
|
});
|
2571
|
-
var tokenOkResponseResponse =
|
2572
|
-
return
|
2573
|
-
token:
|
3583
|
+
var tokenOkResponseResponse = import_zod66.z.lazy(() => {
|
3584
|
+
return import_zod66.z.object({
|
3585
|
+
token: import_zod66.z.string().optional()
|
2574
3586
|
}).transform((data) => ({
|
2575
3587
|
token: data["token"]
|
2576
3588
|
}));
|
2577
3589
|
});
|
2578
|
-
var tokenOkResponseRequest =
|
2579
|
-
return
|
3590
|
+
var tokenOkResponseRequest = import_zod66.z.lazy(() => {
|
3591
|
+
return import_zod66.z.object({
|
3592
|
+
token: import_zod66.z.string().optional()
|
3593
|
+
}).transform((data) => ({
|
2580
3594
|
token: data["token"]
|
2581
3595
|
}));
|
2582
3596
|
});
|
2583
3597
|
|
2584
|
-
// src/services/i-frame/
|
3598
|
+
// src/services/i-frame/models/_24.ts
|
3599
|
+
var import_zod67 = require("zod");
|
3600
|
+
var _24Response = import_zod67.z.lazy(() => {
|
3601
|
+
return import_zod67.z.object({
|
3602
|
+
message: import_zod67.z.string().optional()
|
3603
|
+
}).transform((data) => ({
|
3604
|
+
message: data["message"]
|
3605
|
+
}));
|
3606
|
+
});
|
3607
|
+
var _24 = class extends ThrowableError {
|
3608
|
+
constructor(message, response) {
|
3609
|
+
super(message);
|
3610
|
+
this.message = message;
|
3611
|
+
this.response = response;
|
3612
|
+
const parsedResponse = _24Response.parse(response);
|
3613
|
+
this.message = parsedResponse.message || "";
|
3614
|
+
}
|
3615
|
+
throw() {
|
3616
|
+
throw new _24(this.message, this.response);
|
3617
|
+
}
|
3618
|
+
};
|
3619
|
+
|
3620
|
+
// src/services/i-frame/models/_25.ts
|
3621
|
+
var import_zod68 = require("zod");
|
3622
|
+
var _25Response = import_zod68.z.lazy(() => {
|
3623
|
+
return import_zod68.z.object({
|
3624
|
+
message: import_zod68.z.string().optional()
|
3625
|
+
}).transform((data) => ({
|
3626
|
+
message: data["message"]
|
3627
|
+
}));
|
3628
|
+
});
|
3629
|
+
var _25 = class extends ThrowableError {
|
3630
|
+
constructor(message, response) {
|
3631
|
+
super(message);
|
3632
|
+
this.message = message;
|
3633
|
+
this.response = response;
|
3634
|
+
const parsedResponse = _25Response.parse(response);
|
3635
|
+
this.message = parsedResponse.message || "";
|
3636
|
+
}
|
3637
|
+
throw() {
|
3638
|
+
throw new _25(this.message, this.response);
|
3639
|
+
}
|
3640
|
+
};
|
3641
|
+
|
3642
|
+
// src/services/i-frame/i-frame-service.ts
|
2585
3643
|
var IFrameService = class extends BaseService {
|
2586
3644
|
/**
|
2587
3645
|
* Generate a new token to be used in the iFrame
|
3646
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2588
3647
|
* @returns {Promise<HttpResponse<TokenOkResponse>>} Successful Response
|
2589
3648
|
*/
|
2590
3649
|
async token(requestConfig) {
|
2591
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/iframe/token").setRequestSchema(
|
3650
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "https://api.celitech.net/v1" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/iframe/token").setRequestSchema(import_zod69.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2592
3651
|
schema: tokenOkResponseResponse,
|
2593
3652
|
contentType: "json" /* Json */,
|
2594
3653
|
status: 200
|
3654
|
+
}).addError({
|
3655
|
+
error: _24,
|
3656
|
+
contentType: "json" /* Json */,
|
3657
|
+
status: 400
|
3658
|
+
}).addError({
|
3659
|
+
error: _25,
|
3660
|
+
contentType: "json" /* Json */,
|
3661
|
+
status: 401
|
2595
3662
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
|
2596
3663
|
return this.client.call(request);
|
2597
3664
|
}
|
@@ -2602,11 +3669,6 @@ var Celitech = class {
|
|
2602
3669
|
constructor(config) {
|
2603
3670
|
this.config = config;
|
2604
3671
|
this.tokenManager = new OAuthTokenManager();
|
2605
|
-
const baseUrl = config.environment || config.baseUrl || "https://api.celitech.net/v1" /* DEFAULT */;
|
2606
|
-
this.config = {
|
2607
|
-
...config,
|
2608
|
-
baseUrl
|
2609
|
-
};
|
2610
3672
|
this.oAuth = new OAuthService(this.config, this.tokenManager);
|
2611
3673
|
this.destinations = new DestinationsService(this.config, this.tokenManager);
|
2612
3674
|
this.packages = new PackagesService(this.config, this.tokenManager);
|
@@ -2662,12 +3724,21 @@ var Celitech = class {
|
|
2662
3724
|
this.eSim.oAuthBaseUrl = oAuthBaseUrl;
|
2663
3725
|
this.iFrame.oAuthBaseUrl = oAuthBaseUrl;
|
2664
3726
|
}
|
3727
|
+
set accessToken(accessToken) {
|
3728
|
+
this.oAuth.accessToken = accessToken;
|
3729
|
+
this.destinations.accessToken = accessToken;
|
3730
|
+
this.packages.accessToken = accessToken;
|
3731
|
+
this.purchases.accessToken = accessToken;
|
3732
|
+
this.eSim.accessToken = accessToken;
|
3733
|
+
this.iFrame.accessToken = accessToken;
|
3734
|
+
}
|
2665
3735
|
};
|
2666
3736
|
// Annotate the CommonJS export names for ESM import in node:
|
2667
3737
|
0 && (module.exports = {
|
2668
3738
|
Celitech,
|
2669
3739
|
DestinationsService,
|
2670
3740
|
ESimService,
|
3741
|
+
Environment,
|
2671
3742
|
GrantType,
|
2672
3743
|
IFrameService,
|
2673
3744
|
OAuthService,
|