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.mjs
CHANGED
@@ -202,12 +202,39 @@ var TransportHookAdapter = class {
|
|
202
202
|
}
|
203
203
|
};
|
204
204
|
|
205
|
+
// src/http/utils/content-type.ts
|
206
|
+
function getContentTypeDefinition(contentType) {
|
207
|
+
if (contentType.startsWith("application/") && contentType.includes("xml")) {
|
208
|
+
return "xml" /* Xml */;
|
209
|
+
}
|
210
|
+
if (contentType.toLowerCase() === "application/x-www-form-urlencoded") {
|
211
|
+
return "form" /* FormUrlEncoded */;
|
212
|
+
}
|
213
|
+
if (contentType.toLowerCase() === "text/event-stream") {
|
214
|
+
return "eventStream" /* EventStream */;
|
215
|
+
}
|
216
|
+
if (contentType.toLowerCase().startsWith("text/")) {
|
217
|
+
return "text" /* Text */;
|
218
|
+
}
|
219
|
+
if (contentType.toLowerCase().startsWith("image/")) {
|
220
|
+
return "image" /* Image */;
|
221
|
+
}
|
222
|
+
if (contentType.toLowerCase() === "application/octet-stream") {
|
223
|
+
return "binary" /* Binary */;
|
224
|
+
}
|
225
|
+
if (contentType.toLowerCase() === "application/json") {
|
226
|
+
return "json" /* Json */;
|
227
|
+
}
|
228
|
+
return "json" /* Json */;
|
229
|
+
}
|
230
|
+
|
205
231
|
// src/http/handlers/hook-handler.ts
|
206
232
|
var HookHandler = class {
|
207
233
|
constructor(hook) {
|
208
234
|
this.hook = hook;
|
209
235
|
}
|
210
236
|
async handle(request) {
|
237
|
+
var _a;
|
211
238
|
if (!this.next) {
|
212
239
|
throw new Error("No next handler set in hook handler.");
|
213
240
|
}
|
@@ -218,7 +245,25 @@ var HookHandler = class {
|
|
218
245
|
if (response.metadata.status < 400) {
|
219
246
|
return await hook.afterResponse(nextRequest, response, hookParams);
|
220
247
|
}
|
221
|
-
|
248
|
+
const rawContentType = ((_a = response.metadata.headers["content-type"]) == null ? void 0 : _a.toLocaleLowerCase()) || "";
|
249
|
+
const contentType = getContentTypeDefinition(rawContentType);
|
250
|
+
const statusCode = response.metadata.status;
|
251
|
+
const error = request.errors.find((error2) => {
|
252
|
+
return error2.contentType === contentType && error2.status === statusCode;
|
253
|
+
});
|
254
|
+
if (error) {
|
255
|
+
const decodedBody2 = new TextDecoder().decode(response.raw);
|
256
|
+
const json = JSON.parse(decodedBody2);
|
257
|
+
new error.error((json == null ? void 0 : json.message) || "", json).throw();
|
258
|
+
}
|
259
|
+
const decodedBody = new TextDecoder().decode(response.raw);
|
260
|
+
throw new HttpError(
|
261
|
+
response.metadata,
|
262
|
+
response.raw,
|
263
|
+
`Unexpected response body for error status.
|
264
|
+
StatusCode: ${response.metadata.status}
|
265
|
+
Body: ${decodedBody}`
|
266
|
+
);
|
222
267
|
}
|
223
268
|
async *stream(request) {
|
224
269
|
if (!this.next) {
|
@@ -253,7 +298,7 @@ var ResponseMatcher = class {
|
|
253
298
|
getResponseDefinition(response) {
|
254
299
|
var _a;
|
255
300
|
const rawContentType = ((_a = response.metadata.headers["content-type"]) == null ? void 0 : _a.toLocaleLowerCase()) || "";
|
256
|
-
const contentType =
|
301
|
+
const contentType = getContentTypeDefinition(rawContentType);
|
257
302
|
const statusCode = response.metadata.status;
|
258
303
|
if (!this.responses.length) {
|
259
304
|
return;
|
@@ -265,30 +310,6 @@ var ResponseMatcher = class {
|
|
265
310
|
return response2.contentType === contentType && response2.status === statusCode;
|
266
311
|
});
|
267
312
|
}
|
268
|
-
getContentTypeDefinition(contentType) {
|
269
|
-
if (contentType.startsWith("application/") && contentType.includes("xml")) {
|
270
|
-
return "xml" /* Xml */;
|
271
|
-
}
|
272
|
-
if (contentType.toLowerCase() === "application/x-www-form-urlencoded") {
|
273
|
-
return "form" /* FormUrlEncoded */;
|
274
|
-
}
|
275
|
-
if (contentType.toLowerCase() === "text/event-stream") {
|
276
|
-
return "eventStream" /* EventStream */;
|
277
|
-
}
|
278
|
-
if (contentType.toLowerCase().startsWith("text/")) {
|
279
|
-
return "text" /* Text */;
|
280
|
-
}
|
281
|
-
if (contentType.toLowerCase().startsWith("image/")) {
|
282
|
-
return "image" /* Image */;
|
283
|
-
}
|
284
|
-
if (contentType.toLowerCase() === "application/octet-stream") {
|
285
|
-
return "binary" /* Binary */;
|
286
|
-
}
|
287
|
-
if (contentType.toLowerCase() === "application/json") {
|
288
|
-
return "json" /* Json */;
|
289
|
-
}
|
290
|
-
return "json" /* Json */;
|
291
|
-
}
|
292
313
|
};
|
293
314
|
|
294
315
|
// src/http/handlers/response-validation-handler.ts
|
@@ -428,6 +449,29 @@ var ResponseValidationHandler = class {
|
|
428
449
|
}
|
429
450
|
};
|
430
451
|
|
452
|
+
// src/http/handlers/request-validation-handler.ts
|
453
|
+
import { ZodError } from "zod";
|
454
|
+
|
455
|
+
// src/http/errors/validation-error.ts
|
456
|
+
var ValidationError = class extends Error {
|
457
|
+
constructor(zodError, object) {
|
458
|
+
let actual;
|
459
|
+
try {
|
460
|
+
actual = JSON.stringify(object, void 0, 2);
|
461
|
+
} catch (err) {
|
462
|
+
actual = object;
|
463
|
+
}
|
464
|
+
const error = [
|
465
|
+
`ValidationError:`,
|
466
|
+
...zodError.issues.map((issue) => ` Property: ${issue.path.join(".")}. Message: ${issue.message}`),
|
467
|
+
" Validated:",
|
468
|
+
...actual.split("\n").map((line) => ` ${line}`)
|
469
|
+
].join("\n");
|
470
|
+
super(error);
|
471
|
+
this.error = error;
|
472
|
+
}
|
473
|
+
};
|
474
|
+
|
431
475
|
// src/http/handlers/request-validation-handler.ts
|
432
476
|
var RequestValidationHandler = class {
|
433
477
|
async handle(request) {
|
@@ -447,8 +491,16 @@ var RequestValidationHandler = class {
|
|
447
491
|
validateRequest(request) {
|
448
492
|
var _a, _b;
|
449
493
|
if (request.requestContentType === "json" /* Json */) {
|
450
|
-
|
451
|
-
|
494
|
+
try {
|
495
|
+
const parsedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
|
496
|
+
request.body = JSON.stringify(parsedBody);
|
497
|
+
} catch (error) {
|
498
|
+
if (error instanceof ZodError) {
|
499
|
+
throw new ValidationError(error, request.body);
|
500
|
+
}
|
501
|
+
throw error;
|
502
|
+
}
|
503
|
+
} else if (request.requestContentType === "xml" /* Xml */ || request.requestContentType === "text" /* Text */ || request.requestContentType === "image" /* Image */ || request.requestContentType === "binary" /* Binary */) {
|
452
504
|
request.body = request.body;
|
453
505
|
} else if (request.requestContentType === "form" /* FormUrlEncoded */) {
|
454
506
|
request.body = this.toFormUrlEncoded(request);
|
@@ -473,14 +525,18 @@ var RequestValidationHandler = class {
|
|
473
525
|
if (validatedBody instanceof FormData) {
|
474
526
|
const params = new URLSearchParams();
|
475
527
|
validatedBody.forEach((value, key) => {
|
476
|
-
|
528
|
+
if (value != null) {
|
529
|
+
params.append(key, value.toString());
|
530
|
+
}
|
477
531
|
});
|
478
532
|
return params.toString();
|
479
533
|
}
|
480
534
|
if (typeof validatedBody === "object" && !Array.isArray(validatedBody)) {
|
481
535
|
const params = new URLSearchParams();
|
482
536
|
for (const [key, value] of Object.entries(validatedBody)) {
|
483
|
-
|
537
|
+
if (value != null) {
|
538
|
+
params.append(key, `${value}`);
|
539
|
+
}
|
484
540
|
}
|
485
541
|
return params.toString();
|
486
542
|
}
|
@@ -705,32 +761,42 @@ var OAuthHandler = class {
|
|
705
761
|
if (!this.next) {
|
706
762
|
throw new Error(`No next handler set in OAuthHandler`);
|
707
763
|
}
|
708
|
-
|
764
|
+
if (!!request.config.accessToken) {
|
765
|
+
this.addAccessTokenHeader(request, request.config.accessToken);
|
766
|
+
return this.next.handle(request);
|
767
|
+
}
|
768
|
+
if (!request.config.clientId || !request.config.clientSecret) {
|
769
|
+
return this.next.handle(request);
|
770
|
+
}
|
771
|
+
await this.manageToken(request);
|
709
772
|
return this.next.handle(request);
|
710
773
|
}
|
711
774
|
async *stream(request) {
|
712
775
|
if (!this.next) {
|
713
776
|
throw new Error(`No next handler set in OAuthHandler`);
|
714
777
|
}
|
715
|
-
await this.
|
778
|
+
await this.manageToken(request);
|
716
779
|
yield* this.next.stream(request);
|
717
780
|
}
|
718
|
-
async
|
781
|
+
async manageToken(request) {
|
719
782
|
if (!request.scopes) {
|
720
783
|
return;
|
721
784
|
}
|
722
785
|
const token = await request.tokenManager.getToken(request.scopes, request.config);
|
723
786
|
if (token.accessToken) {
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
787
|
+
this.addAccessTokenHeader(request, token.accessToken);
|
788
|
+
}
|
789
|
+
}
|
790
|
+
addAccessTokenHeader(request, token) {
|
791
|
+
request.addHeaderParam("Authorization", {
|
792
|
+
key: "Authorization",
|
793
|
+
value: `Bearer ${token}`,
|
794
|
+
explode: false,
|
795
|
+
encode: false,
|
796
|
+
style: "simple" /* SIMPLE */,
|
797
|
+
isLimit: false,
|
798
|
+
isOffset: false
|
799
|
+
});
|
734
800
|
}
|
735
801
|
};
|
736
802
|
|
@@ -812,6 +878,9 @@ var BaseService = class {
|
|
812
878
|
set oAuthBaseUrl(oAuthBaseUrl) {
|
813
879
|
this.config.oAuthBaseUrl = oAuthBaseUrl;
|
814
880
|
}
|
881
|
+
set accessToken(accessToken) {
|
882
|
+
this.config.accessToken = accessToken;
|
883
|
+
}
|
815
884
|
};
|
816
885
|
|
817
886
|
// src/http/transport/request-builder.ts
|
@@ -878,6 +947,7 @@ var Request = class {
|
|
878
947
|
this.headers = params.headers;
|
879
948
|
this.queryParams = params.queryParams;
|
880
949
|
this.responses = params.responses;
|
950
|
+
this.errors = params.errors;
|
881
951
|
this.requestSchema = params.requestSchema;
|
882
952
|
this.requestContentType = params.requestContentType;
|
883
953
|
this.retry = params.retry;
|
@@ -950,21 +1020,22 @@ var Request = class {
|
|
950
1020
|
return `${baseUrl}${path}${queryString}`;
|
951
1021
|
}
|
952
1022
|
copy(overrides) {
|
953
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
1023
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
954
1024
|
const createRequestParams = {
|
955
1025
|
baseUrl: (_a = overrides == null ? void 0 : overrides.baseUrl) != null ? _a : this.baseUrl,
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
1026
|
+
errors: (_b = overrides == null ? void 0 : overrides.errors) != null ? _b : this.errors,
|
1027
|
+
method: (_c = overrides == null ? void 0 : overrides.method) != null ? _c : this.method,
|
1028
|
+
path: (_d = overrides == null ? void 0 : overrides.path) != null ? _d : this.path,
|
1029
|
+
body: (_e = overrides == null ? void 0 : overrides.body) != null ? _e : this.body,
|
1030
|
+
config: (_f = overrides == null ? void 0 : overrides.config) != null ? _f : this.config,
|
1031
|
+
pathParams: (_g = overrides == null ? void 0 : overrides.pathParams) != null ? _g : this.pathParams,
|
1032
|
+
queryParams: (_h = overrides == null ? void 0 : overrides.queryParams) != null ? _h : this.queryParams,
|
1033
|
+
headers: (_i = overrides == null ? void 0 : overrides.headers) != null ? _i : this.headers,
|
1034
|
+
responses: (_j = overrides == null ? void 0 : overrides.responses) != null ? _j : this.responses,
|
1035
|
+
requestSchema: (_k = overrides == null ? void 0 : overrides.requestSchema) != null ? _k : this.requestSchema,
|
1036
|
+
requestContentType: (_l = overrides == null ? void 0 : overrides.requestContentType) != null ? _l : this.requestContentType,
|
1037
|
+
retry: (_m = overrides == null ? void 0 : overrides.retry) != null ? _m : this.retry,
|
1038
|
+
validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation,
|
968
1039
|
scopes: overrides == null ? void 0 : overrides.scopes,
|
969
1040
|
tokenManager: this.tokenManager
|
970
1041
|
};
|
@@ -1011,6 +1082,12 @@ var Request = class {
|
|
1011
1082
|
}
|
1012
1083
|
};
|
1013
1084
|
|
1085
|
+
// src/http/environment.ts
|
1086
|
+
var Environment = /* @__PURE__ */ ((Environment2) => {
|
1087
|
+
Environment2["DEFAULT"] = "https://api.celitech.net/v1";
|
1088
|
+
return Environment2;
|
1089
|
+
})(Environment || {});
|
1090
|
+
|
1014
1091
|
// src/http/transport/request-builder.ts
|
1015
1092
|
var RequestBuilder = class {
|
1016
1093
|
constructor() {
|
@@ -1020,11 +1097,12 @@ var RequestBuilder = class {
|
|
1020
1097
|
path: "",
|
1021
1098
|
config: { clientId: "", clientSecret: "" },
|
1022
1099
|
responses: [],
|
1100
|
+
errors: [],
|
1023
1101
|
requestSchema: z.any(),
|
1024
1102
|
requestContentType: "json" /* Json */,
|
1025
1103
|
retry: {
|
1026
|
-
attempts:
|
1027
|
-
delayMs:
|
1104
|
+
attempts: 1,
|
1105
|
+
delayMs: 0
|
1028
1106
|
},
|
1029
1107
|
validation: {
|
1030
1108
|
responseValidation: true
|
@@ -1062,9 +1140,9 @@ var RequestBuilder = class {
|
|
1062
1140
|
}
|
1063
1141
|
return this;
|
1064
1142
|
}
|
1065
|
-
setBaseUrl(
|
1066
|
-
if (
|
1067
|
-
this.params.baseUrl =
|
1143
|
+
setBaseUrl(baseUrl) {
|
1144
|
+
if (baseUrl) {
|
1145
|
+
this.params.baseUrl = baseUrl;
|
1068
1146
|
}
|
1069
1147
|
return this;
|
1070
1148
|
}
|
@@ -1100,10 +1178,59 @@ var RequestBuilder = class {
|
|
1100
1178
|
this.params.tokenManager = tokenManager;
|
1101
1179
|
return this;
|
1102
1180
|
}
|
1181
|
+
addAccessTokenAuth(accessToken, prefix) {
|
1182
|
+
if (accessToken === void 0) {
|
1183
|
+
return this;
|
1184
|
+
}
|
1185
|
+
this.params.headers.set("Authorization", {
|
1186
|
+
key: "Authorization",
|
1187
|
+
value: `${prefix != null ? prefix : "BEARER"} ${accessToken}`,
|
1188
|
+
explode: false,
|
1189
|
+
style: "simple" /* SIMPLE */,
|
1190
|
+
encode: true,
|
1191
|
+
isLimit: false,
|
1192
|
+
isOffset: false
|
1193
|
+
});
|
1194
|
+
return this;
|
1195
|
+
}
|
1196
|
+
addBasicAuth(username, password) {
|
1197
|
+
if (username === void 0 || password === void 0) {
|
1198
|
+
return this;
|
1199
|
+
}
|
1200
|
+
this.params.headers.set("Authorization", {
|
1201
|
+
key: "Authorization",
|
1202
|
+
value: `Basic ${this.toBase64(`${username}:${password}`)}`,
|
1203
|
+
explode: false,
|
1204
|
+
style: "simple" /* SIMPLE */,
|
1205
|
+
encode: true,
|
1206
|
+
isLimit: false,
|
1207
|
+
isOffset: false
|
1208
|
+
});
|
1209
|
+
return this;
|
1210
|
+
}
|
1211
|
+
addApiKeyAuth(apiKey, keyName) {
|
1212
|
+
if (apiKey === void 0) {
|
1213
|
+
return this;
|
1214
|
+
}
|
1215
|
+
this.params.headers.set(keyName != null ? keyName : "X-API-KEY", {
|
1216
|
+
key: keyName != null ? keyName : "X-API-KEY",
|
1217
|
+
value: apiKey,
|
1218
|
+
explode: false,
|
1219
|
+
style: "simple" /* SIMPLE */,
|
1220
|
+
encode: true,
|
1221
|
+
isLimit: false,
|
1222
|
+
isOffset: false
|
1223
|
+
});
|
1224
|
+
return this;
|
1225
|
+
}
|
1103
1226
|
addResponse(response) {
|
1104
1227
|
this.params.responses.push(response);
|
1105
1228
|
return this;
|
1106
1229
|
}
|
1230
|
+
addError(error) {
|
1231
|
+
this.params.errors.push(error);
|
1232
|
+
return this;
|
1233
|
+
}
|
1107
1234
|
addBody(body) {
|
1108
1235
|
if (body !== void 0) {
|
1109
1236
|
this.params.body = body;
|
@@ -1161,6 +1288,13 @@ var RequestBuilder = class {
|
|
1161
1288
|
build() {
|
1162
1289
|
return new Request(this.params);
|
1163
1290
|
}
|
1291
|
+
toBase64(str) {
|
1292
|
+
if (typeof window === "undefined") {
|
1293
|
+
return Buffer.from(str, "utf-8").toString("base64");
|
1294
|
+
} else {
|
1295
|
+
return btoa(unescape(encodeURIComponent(str)));
|
1296
|
+
}
|
1297
|
+
}
|
1164
1298
|
};
|
1165
1299
|
|
1166
1300
|
// src/services/o-auth/models/get-access-token-request.ts
|
@@ -1184,7 +1318,11 @@ var getAccessTokenRequestResponse = z2.lazy(() => {
|
|
1184
1318
|
}));
|
1185
1319
|
});
|
1186
1320
|
var getAccessTokenRequestRequest = z2.lazy(() => {
|
1187
|
-
return z2.object({
|
1321
|
+
return z2.object({
|
1322
|
+
grantType: z2.string().optional(),
|
1323
|
+
clientId: z2.string().optional(),
|
1324
|
+
clientSecret: z2.string().optional()
|
1325
|
+
}).transform((data) => ({
|
1188
1326
|
grant_type: data["grantType"],
|
1189
1327
|
client_id: data["clientId"],
|
1190
1328
|
client_secret: data["clientSecret"]
|
@@ -1212,21 +1350,26 @@ var getAccessTokenOkResponseResponse = z3.lazy(() => {
|
|
1212
1350
|
}));
|
1213
1351
|
});
|
1214
1352
|
var getAccessTokenOkResponseRequest = z3.lazy(() => {
|
1215
|
-
return z3.object({
|
1353
|
+
return z3.object({
|
1354
|
+
accessToken: z3.string().optional(),
|
1355
|
+
tokenType: z3.string().optional(),
|
1356
|
+
expiresIn: z3.number().optional()
|
1357
|
+
}).transform((data) => ({
|
1216
1358
|
access_token: data["accessToken"],
|
1217
1359
|
token_type: data["tokenType"],
|
1218
1360
|
expires_in: data["expiresIn"]
|
1219
1361
|
}));
|
1220
1362
|
});
|
1221
1363
|
|
1222
|
-
// src/services/o-auth/o-auth.ts
|
1364
|
+
// src/services/o-auth/o-auth-service.ts
|
1223
1365
|
var OAuthService = class extends BaseService {
|
1224
1366
|
/**
|
1225
1367
|
* This endpoint was added by liblab
|
1368
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
1226
1369
|
* @returns {Promise<HttpResponse<GetAccessTokenOkResponse>>} Successful Response
|
1227
1370
|
*/
|
1228
1371
|
async getAccessToken(body, requestConfig) {
|
1229
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/oauth2/token").setRequestSchema(getAccessTokenRequestRequest).setTokenManager(this.tokenManager).setRequestContentType("form" /* FormUrlEncoded */).addResponse({
|
1372
|
+
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({
|
1230
1373
|
schema: getAccessTokenOkResponseResponse,
|
1231
1374
|
contentType: "json" /* Json */,
|
1232
1375
|
status: 200
|
@@ -1263,11 +1406,14 @@ var OAuthTokenManager = class {
|
|
1263
1406
|
if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
|
1264
1407
|
return this.token;
|
1265
1408
|
}
|
1409
|
+
if (!config.clientId || !config.clientSecret) {
|
1410
|
+
throw new Error("OAuthError: clientId and clientSecret are required for token management.");
|
1411
|
+
}
|
1266
1412
|
const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
|
1267
1413
|
const oAuth = new OAuthService(
|
1268
1414
|
{
|
1269
1415
|
...config,
|
1270
|
-
baseUrl: config.oAuthBaseUrl || "https://auth.celitech.net"
|
1416
|
+
baseUrl: config.oAuthBaseUrl || config.baseUrl || config.environment || "https://auth.celitech.net"
|
1271
1417
|
},
|
1272
1418
|
this
|
1273
1419
|
);
|
@@ -1293,8 +1439,8 @@ var OAuthTokenManager = class {
|
|
1293
1439
|
}
|
1294
1440
|
};
|
1295
1441
|
|
1296
|
-
// src/services/destinations/destinations.ts
|
1297
|
-
import { z as
|
1442
|
+
// src/services/destinations/destinations-service.ts
|
1443
|
+
import { z as z8 } from "zod";
|
1298
1444
|
|
1299
1445
|
// src/services/destinations/models/list-destinations-ok-response.ts
|
1300
1446
|
import { z as z5 } from "zod";
|
@@ -1321,9 +1467,9 @@ var destinationsResponse = z4.lazy(() => {
|
|
1321
1467
|
});
|
1322
1468
|
var destinationsRequest = z4.lazy(() => {
|
1323
1469
|
return z4.object({
|
1324
|
-
name: z4.string().
|
1325
|
-
destination: z4.string().
|
1326
|
-
supportedCountries: z4.array(z4.string()).
|
1470
|
+
name: z4.string().optional(),
|
1471
|
+
destination: z4.string().optional(),
|
1472
|
+
supportedCountries: z4.array(z4.string()).optional()
|
1327
1473
|
}).transform((data) => ({
|
1328
1474
|
name: data["name"],
|
1329
1475
|
destination: data["destination"],
|
@@ -1345,53 +1491,122 @@ var listDestinationsOkResponseResponse = z5.lazy(() => {
|
|
1345
1491
|
}));
|
1346
1492
|
});
|
1347
1493
|
var listDestinationsOkResponseRequest = z5.lazy(() => {
|
1348
|
-
return z5.object({
|
1494
|
+
return z5.object({
|
1495
|
+
destinations: z5.array(destinationsRequest).optional()
|
1496
|
+
}).transform((data) => ({
|
1349
1497
|
destinations: data["destinations"]
|
1350
1498
|
}));
|
1351
1499
|
});
|
1352
1500
|
|
1353
|
-
// src/services/destinations/
|
1501
|
+
// src/services/destinations/models/__.ts
|
1502
|
+
import { z as z6 } from "zod";
|
1503
|
+
|
1504
|
+
// src/http/errors/throwable-error.ts
|
1505
|
+
var ThrowableError = class extends Error {
|
1506
|
+
constructor(message, response) {
|
1507
|
+
super(message);
|
1508
|
+
this.message = message;
|
1509
|
+
this.response = response;
|
1510
|
+
}
|
1511
|
+
throw() {
|
1512
|
+
throw this;
|
1513
|
+
}
|
1514
|
+
};
|
1515
|
+
|
1516
|
+
// src/services/destinations/models/__.ts
|
1517
|
+
var _response = z6.lazy(() => {
|
1518
|
+
return z6.object({
|
1519
|
+
message: z6.string().optional()
|
1520
|
+
}).transform((data) => ({
|
1521
|
+
message: data["message"]
|
1522
|
+
}));
|
1523
|
+
});
|
1524
|
+
var __ = class extends ThrowableError {
|
1525
|
+
constructor(message, response) {
|
1526
|
+
super(message);
|
1527
|
+
this.message = message;
|
1528
|
+
this.response = response;
|
1529
|
+
const parsedResponse = _response.parse(response);
|
1530
|
+
this.message = parsedResponse.message || "";
|
1531
|
+
}
|
1532
|
+
throw() {
|
1533
|
+
throw new __(this.message, this.response);
|
1534
|
+
}
|
1535
|
+
};
|
1536
|
+
|
1537
|
+
// src/services/destinations/models/_1.ts
|
1538
|
+
import { z as z7 } from "zod";
|
1539
|
+
var _1Response = z7.lazy(() => {
|
1540
|
+
return z7.object({
|
1541
|
+
message: z7.string().optional()
|
1542
|
+
}).transform((data) => ({
|
1543
|
+
message: data["message"]
|
1544
|
+
}));
|
1545
|
+
});
|
1546
|
+
var _1 = class extends ThrowableError {
|
1547
|
+
constructor(message, response) {
|
1548
|
+
super(message);
|
1549
|
+
this.message = message;
|
1550
|
+
this.response = response;
|
1551
|
+
const parsedResponse = _1Response.parse(response);
|
1552
|
+
this.message = parsedResponse.message || "";
|
1553
|
+
}
|
1554
|
+
throw() {
|
1555
|
+
throw new _1(this.message, this.response);
|
1556
|
+
}
|
1557
|
+
};
|
1558
|
+
|
1559
|
+
// src/services/destinations/destinations-service.ts
|
1354
1560
|
var DestinationsService = class extends BaseService {
|
1355
1561
|
/**
|
1356
1562
|
* List Destinations
|
1563
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
1357
1564
|
* @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} Successful Response
|
1358
1565
|
*/
|
1359
1566
|
async listDestinations(requestConfig) {
|
1360
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(
|
1567
|
+
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(z8.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
1361
1568
|
schema: listDestinationsOkResponseResponse,
|
1362
1569
|
contentType: "json" /* Json */,
|
1363
1570
|
status: 200
|
1571
|
+
}).addError({
|
1572
|
+
error: __,
|
1573
|
+
contentType: "json" /* Json */,
|
1574
|
+
status: 400
|
1575
|
+
}).addError({
|
1576
|
+
error: _1,
|
1577
|
+
contentType: "json" /* Json */,
|
1578
|
+
status: 401
|
1364
1579
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
|
1365
1580
|
return this.client.call(request);
|
1366
1581
|
}
|
1367
1582
|
};
|
1368
1583
|
|
1369
|
-
// src/services/packages/packages.ts
|
1370
|
-
import { z as
|
1584
|
+
// src/services/packages/packages-service.ts
|
1585
|
+
import { z as z13 } from "zod";
|
1371
1586
|
|
1372
1587
|
// src/services/packages/models/list-packages-ok-response.ts
|
1373
|
-
import { z as
|
1588
|
+
import { z as z10 } from "zod";
|
1374
1589
|
|
1375
1590
|
// src/services/packages/models/packages.ts
|
1376
|
-
import { z as
|
1377
|
-
var packages =
|
1378
|
-
return
|
1379
|
-
id:
|
1380
|
-
destination:
|
1381
|
-
dataLimitInBytes:
|
1382
|
-
minDays:
|
1383
|
-
maxDays:
|
1384
|
-
priceInCents:
|
1591
|
+
import { z as z9 } from "zod";
|
1592
|
+
var packages = z9.lazy(() => {
|
1593
|
+
return z9.object({
|
1594
|
+
id: z9.string().optional(),
|
1595
|
+
destination: z9.string().optional(),
|
1596
|
+
dataLimitInBytes: z9.number().optional(),
|
1597
|
+
minDays: z9.number().optional(),
|
1598
|
+
maxDays: z9.number().optional(),
|
1599
|
+
priceInCents: z9.number().optional()
|
1385
1600
|
});
|
1386
1601
|
});
|
1387
|
-
var packagesResponse =
|
1388
|
-
return
|
1389
|
-
id:
|
1390
|
-
destination:
|
1391
|
-
dataLimitInBytes:
|
1392
|
-
minDays:
|
1393
|
-
maxDays:
|
1394
|
-
priceInCents:
|
1602
|
+
var packagesResponse = z9.lazy(() => {
|
1603
|
+
return z9.object({
|
1604
|
+
id: z9.string().optional(),
|
1605
|
+
destination: z9.string().optional(),
|
1606
|
+
dataLimitInBytes: z9.number().optional(),
|
1607
|
+
minDays: z9.number().optional(),
|
1608
|
+
maxDays: z9.number().optional(),
|
1609
|
+
priceInCents: z9.number().optional()
|
1395
1610
|
}).transform((data) => ({
|
1396
1611
|
id: data["id"],
|
1397
1612
|
destination: data["destination"],
|
@@ -1401,14 +1616,14 @@ var packagesResponse = z7.lazy(() => {
|
|
1401
1616
|
priceInCents: data["priceInCents"]
|
1402
1617
|
}));
|
1403
1618
|
});
|
1404
|
-
var packagesRequest =
|
1405
|
-
return
|
1406
|
-
id:
|
1407
|
-
destination:
|
1408
|
-
dataLimitInBytes:
|
1409
|
-
minDays:
|
1410
|
-
maxDays:
|
1411
|
-
priceInCents:
|
1619
|
+
var packagesRequest = z9.lazy(() => {
|
1620
|
+
return z9.object({
|
1621
|
+
id: z9.string().optional(),
|
1622
|
+
destination: z9.string().optional(),
|
1623
|
+
dataLimitInBytes: z9.number().optional(),
|
1624
|
+
minDays: z9.number().optional(),
|
1625
|
+
maxDays: z9.number().optional(),
|
1626
|
+
priceInCents: z9.number().optional()
|
1412
1627
|
}).transform((data) => ({
|
1413
1628
|
id: data["id"],
|
1414
1629
|
destination: data["destination"],
|
@@ -1420,47 +1635,110 @@ var packagesRequest = z7.lazy(() => {
|
|
1420
1635
|
});
|
1421
1636
|
|
1422
1637
|
// src/services/packages/models/list-packages-ok-response.ts
|
1423
|
-
var listPackagesOkResponse =
|
1424
|
-
return
|
1425
|
-
packages:
|
1426
|
-
afterCursor:
|
1638
|
+
var listPackagesOkResponse = z10.lazy(() => {
|
1639
|
+
return z10.object({
|
1640
|
+
packages: z10.array(packages).optional(),
|
1641
|
+
afterCursor: z10.string().optional().nullable()
|
1427
1642
|
});
|
1428
1643
|
});
|
1429
|
-
var listPackagesOkResponseResponse =
|
1430
|
-
return
|
1431
|
-
packages:
|
1432
|
-
afterCursor:
|
1644
|
+
var listPackagesOkResponseResponse = z10.lazy(() => {
|
1645
|
+
return z10.object({
|
1646
|
+
packages: z10.array(packagesResponse).optional(),
|
1647
|
+
afterCursor: z10.string().optional().nullable()
|
1433
1648
|
}).transform((data) => ({
|
1434
1649
|
packages: data["packages"],
|
1435
1650
|
afterCursor: data["afterCursor"]
|
1436
1651
|
}));
|
1437
1652
|
});
|
1438
|
-
var listPackagesOkResponseRequest =
|
1439
|
-
return
|
1653
|
+
var listPackagesOkResponseRequest = z10.lazy(() => {
|
1654
|
+
return z10.object({
|
1655
|
+
packages: z10.array(packagesRequest).optional(),
|
1656
|
+
afterCursor: z10.string().optional().nullable()
|
1657
|
+
}).transform((data) => ({
|
1440
1658
|
packages: data["packages"],
|
1441
1659
|
afterCursor: data["afterCursor"]
|
1442
1660
|
}));
|
1443
1661
|
});
|
1444
1662
|
|
1445
|
-
// src/services/packages/
|
1663
|
+
// src/services/packages/models/_2.ts
|
1664
|
+
import { z as z11 } from "zod";
|
1665
|
+
var _2Response = z11.lazy(() => {
|
1666
|
+
return z11.object({
|
1667
|
+
message: z11.string().optional()
|
1668
|
+
}).transform((data) => ({
|
1669
|
+
message: data["message"]
|
1670
|
+
}));
|
1671
|
+
});
|
1672
|
+
var _2 = class extends ThrowableError {
|
1673
|
+
constructor(message, response) {
|
1674
|
+
super(message);
|
1675
|
+
this.message = message;
|
1676
|
+
this.response = response;
|
1677
|
+
const parsedResponse = _2Response.parse(response);
|
1678
|
+
this.message = parsedResponse.message || "";
|
1679
|
+
}
|
1680
|
+
throw() {
|
1681
|
+
throw new _2(this.message, this.response);
|
1682
|
+
}
|
1683
|
+
};
|
1684
|
+
|
1685
|
+
// src/services/packages/models/_3.ts
|
1686
|
+
import { z as z12 } from "zod";
|
1687
|
+
var _3Response = z12.lazy(() => {
|
1688
|
+
return z12.object({
|
1689
|
+
message: z12.string().optional()
|
1690
|
+
}).transform((data) => ({
|
1691
|
+
message: data["message"]
|
1692
|
+
}));
|
1693
|
+
});
|
1694
|
+
var _3 = class extends ThrowableError {
|
1695
|
+
constructor(message, response) {
|
1696
|
+
super(message);
|
1697
|
+
this.message = message;
|
1698
|
+
this.response = response;
|
1699
|
+
const parsedResponse = _3Response.parse(response);
|
1700
|
+
this.message = parsedResponse.message || "";
|
1701
|
+
}
|
1702
|
+
throw() {
|
1703
|
+
throw new _3(this.message, this.response);
|
1704
|
+
}
|
1705
|
+
};
|
1706
|
+
|
1707
|
+
// src/services/packages/packages-service.ts
|
1446
1708
|
var PackagesService = class extends BaseService {
|
1447
1709
|
/**
|
1448
1710
|
* List Packages
|
1449
|
-
* @param {string} [destination] - ISO representation of the package's destination.
|
1450
|
-
* @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.
|
1451
|
-
* @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.
|
1452
|
-
* @param {
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1711
|
+
* @param {string} [params.destination] - ISO representation of the package's destination.
|
1712
|
+
* @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.
|
1713
|
+
* @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.
|
1714
|
+
* @param {number} [params.dataLimitInGb] - Size of the package in GB.
|
1715
|
+
|
1716
|
+
For **limited packages**, the available options are: **0.5, 1, 2, 3, 5, 8, 20GB**.
|
1717
|
+
|
1718
|
+
For **unlimited packages** (available to Region-3), please use **-1** as an identifier.
|
1719
|
+
|
1720
|
+
* @param {boolean} [params.includeUnlimited] - A boolean flag to include the **unlimited packages** in the response. The flag is false by default.
|
1721
|
+
* @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.
|
1722
|
+
* @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
|
1723
|
+
* @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
|
1724
|
+
* @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
|
1725
|
+
* @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
|
1726
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
1457
1727
|
* @returns {Promise<HttpResponse<ListPackagesOkResponse>>} Successful Response
|
1458
1728
|
*/
|
1459
1729
|
async listPackages(params, requestConfig) {
|
1460
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(
|
1730
|
+
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(z13.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
1461
1731
|
schema: listPackagesOkResponseResponse,
|
1462
1732
|
contentType: "json" /* Json */,
|
1463
1733
|
status: 200
|
1734
|
+
}).addError({
|
1735
|
+
error: _2,
|
1736
|
+
contentType: "json" /* Json */,
|
1737
|
+
status: 400
|
1738
|
+
}).addError({
|
1739
|
+
error: _3,
|
1740
|
+
contentType: "json" /* Json */,
|
1741
|
+
status: 401
|
1464
1742
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
|
1465
1743
|
key: "destination",
|
1466
1744
|
value: params == null ? void 0 : params.destination
|
@@ -1470,6 +1748,12 @@ var PackagesService = class extends BaseService {
|
|
1470
1748
|
}).addQueryParam({
|
1471
1749
|
key: "endDate",
|
1472
1750
|
value: params == null ? void 0 : params.endDate
|
1751
|
+
}).addQueryParam({
|
1752
|
+
key: "dataLimitInGB",
|
1753
|
+
value: params == null ? void 0 : params.dataLimitInGb
|
1754
|
+
}).addQueryParam({
|
1755
|
+
key: "includeUnlimited",
|
1756
|
+
value: params == null ? void 0 : params.includeUnlimited
|
1473
1757
|
}).addQueryParam({
|
1474
1758
|
key: "afterCursor",
|
1475
1759
|
value: params == null ? void 0 : params.afterCursor
|
@@ -1490,298 +1774,106 @@ var PackagesService = class extends BaseService {
|
|
1490
1774
|
}
|
1491
1775
|
};
|
1492
1776
|
|
1493
|
-
// src/services/purchases/purchases.ts
|
1494
|
-
import { z as
|
1495
|
-
|
1496
|
-
// src/services/purchases/models/list-purchases-ok-response.ts
|
1497
|
-
import { z as z13 } from "zod";
|
1498
|
-
|
1499
|
-
// src/services/purchases/models/purchases.ts
|
1500
|
-
import { z as z12 } from "zod";
|
1501
|
-
|
1502
|
-
// src/services/purchases/models/package_.ts
|
1503
|
-
import { z as z10 } from "zod";
|
1504
|
-
var package_ = z10.lazy(() => {
|
1505
|
-
return z10.object({
|
1506
|
-
id: z10.string().optional(),
|
1507
|
-
dataLimitInBytes: z10.number().optional(),
|
1508
|
-
destination: z10.string().optional(),
|
1509
|
-
destinationName: z10.string().optional(),
|
1510
|
-
priceInCents: z10.number().optional()
|
1511
|
-
});
|
1512
|
-
});
|
1513
|
-
var packageResponse = z10.lazy(() => {
|
1514
|
-
return z10.object({
|
1515
|
-
id: z10.string().optional(),
|
1516
|
-
dataLimitInBytes: z10.number().optional(),
|
1517
|
-
destination: z10.string().optional(),
|
1518
|
-
destinationName: z10.string().optional(),
|
1519
|
-
priceInCents: z10.number().optional()
|
1520
|
-
}).transform((data) => ({
|
1521
|
-
id: data["id"],
|
1522
|
-
dataLimitInBytes: data["dataLimitInBytes"],
|
1523
|
-
destination: data["destination"],
|
1524
|
-
destinationName: data["destinationName"],
|
1525
|
-
priceInCents: data["priceInCents"]
|
1526
|
-
}));
|
1527
|
-
});
|
1528
|
-
var packageRequest = z10.lazy(() => {
|
1529
|
-
return z10.object({
|
1530
|
-
id: z10.string().nullish(),
|
1531
|
-
dataLimitInBytes: z10.number().nullish(),
|
1532
|
-
destination: z10.string().nullish(),
|
1533
|
-
destinationName: z10.string().nullish(),
|
1534
|
-
priceInCents: z10.number().nullish()
|
1535
|
-
}).transform((data) => ({
|
1536
|
-
id: data["id"],
|
1537
|
-
dataLimitInBytes: data["dataLimitInBytes"],
|
1538
|
-
destination: data["destination"],
|
1539
|
-
destinationName: data["destinationName"],
|
1540
|
-
priceInCents: data["priceInCents"]
|
1541
|
-
}));
|
1542
|
-
});
|
1543
|
-
|
1544
|
-
// src/services/purchases/models/purchases-esim.ts
|
1545
|
-
import { z as z11 } from "zod";
|
1546
|
-
var purchasesEsim = z11.lazy(() => {
|
1547
|
-
return z11.object({
|
1548
|
-
iccid: z11.string().min(18).max(22).optional()
|
1549
|
-
});
|
1550
|
-
});
|
1551
|
-
var purchasesEsimResponse = z11.lazy(() => {
|
1552
|
-
return z11.object({
|
1553
|
-
iccid: z11.string().min(18).max(22).optional()
|
1554
|
-
}).transform((data) => ({
|
1555
|
-
iccid: data["iccid"]
|
1556
|
-
}));
|
1557
|
-
});
|
1558
|
-
var purchasesEsimRequest = z11.lazy(() => {
|
1559
|
-
return z11.object({ iccid: z11.string().nullish() }).transform((data) => ({
|
1560
|
-
iccid: data["iccid"]
|
1561
|
-
}));
|
1562
|
-
});
|
1563
|
-
|
1564
|
-
// src/services/purchases/models/purchases.ts
|
1565
|
-
var purchases = z12.lazy(() => {
|
1566
|
-
return z12.object({
|
1567
|
-
id: z12.string().optional(),
|
1568
|
-
startDate: z12.string().optional(),
|
1569
|
-
endDate: z12.string().optional(),
|
1570
|
-
createdDate: z12.string().optional(),
|
1571
|
-
startTime: z12.number().optional(),
|
1572
|
-
endTime: z12.number().optional(),
|
1573
|
-
createdAt: z12.number().optional(),
|
1574
|
-
package: package_.optional(),
|
1575
|
-
esim: purchasesEsim.optional(),
|
1576
|
-
source: z12.string().optional(),
|
1577
|
-
referenceId: z12.string().optional()
|
1578
|
-
});
|
1579
|
-
});
|
1580
|
-
var purchasesResponse = z12.lazy(() => {
|
1581
|
-
return z12.object({
|
1582
|
-
id: z12.string().optional(),
|
1583
|
-
startDate: z12.string().optional(),
|
1584
|
-
endDate: z12.string().optional(),
|
1585
|
-
createdDate: z12.string().optional(),
|
1586
|
-
startTime: z12.number().optional(),
|
1587
|
-
endTime: z12.number().optional(),
|
1588
|
-
createdAt: z12.number().optional(),
|
1589
|
-
package: packageResponse.optional(),
|
1590
|
-
esim: purchasesEsimResponse.optional(),
|
1591
|
-
source: z12.string().optional(),
|
1592
|
-
referenceId: z12.string().optional()
|
1593
|
-
}).transform((data) => ({
|
1594
|
-
id: data["id"],
|
1595
|
-
startDate: data["startDate"],
|
1596
|
-
endDate: data["endDate"],
|
1597
|
-
createdDate: data["createdDate"],
|
1598
|
-
startTime: data["startTime"],
|
1599
|
-
endTime: data["endTime"],
|
1600
|
-
createdAt: data["createdAt"],
|
1601
|
-
package: data["package"],
|
1602
|
-
esim: data["esim"],
|
1603
|
-
source: data["source"],
|
1604
|
-
referenceId: data["referenceId"]
|
1605
|
-
}));
|
1606
|
-
});
|
1607
|
-
var purchasesRequest = z12.lazy(() => {
|
1608
|
-
return z12.object({
|
1609
|
-
id: z12.string().nullish(),
|
1610
|
-
startDate: z12.string().nullish(),
|
1611
|
-
endDate: z12.string().nullish(),
|
1612
|
-
createdDate: z12.string().nullish(),
|
1613
|
-
startTime: z12.number().nullish(),
|
1614
|
-
endTime: z12.number().nullish(),
|
1615
|
-
createdAt: z12.number().nullish(),
|
1616
|
-
package: packageRequest.nullish(),
|
1617
|
-
esim: purchasesEsimRequest.nullish(),
|
1618
|
-
source: z12.string().nullish(),
|
1619
|
-
referenceId: z12.string().nullish()
|
1620
|
-
}).transform((data) => ({
|
1621
|
-
id: data["id"],
|
1622
|
-
startDate: data["startDate"],
|
1623
|
-
endDate: data["endDate"],
|
1624
|
-
createdDate: data["createdDate"],
|
1625
|
-
startTime: data["startTime"],
|
1626
|
-
endTime: data["endTime"],
|
1627
|
-
createdAt: data["createdAt"],
|
1628
|
-
package: data["package"],
|
1629
|
-
esim: data["esim"],
|
1630
|
-
source: data["source"],
|
1631
|
-
referenceId: data["referenceId"]
|
1632
|
-
}));
|
1633
|
-
});
|
1634
|
-
|
1635
|
-
// src/services/purchases/models/list-purchases-ok-response.ts
|
1636
|
-
var listPurchasesOkResponse = z13.lazy(() => {
|
1637
|
-
return z13.object({
|
1638
|
-
purchases: z13.array(purchases).optional(),
|
1639
|
-
afterCursor: z13.string().optional().nullable()
|
1640
|
-
});
|
1641
|
-
});
|
1642
|
-
var listPurchasesOkResponseResponse = z13.lazy(() => {
|
1643
|
-
return z13.object({
|
1644
|
-
purchases: z13.array(purchasesResponse).optional(),
|
1645
|
-
afterCursor: z13.string().optional().nullable()
|
1646
|
-
}).transform((data) => ({
|
1647
|
-
purchases: data["purchases"],
|
1648
|
-
afterCursor: data["afterCursor"]
|
1649
|
-
}));
|
1650
|
-
});
|
1651
|
-
var listPurchasesOkResponseRequest = z13.lazy(() => {
|
1652
|
-
return z13.object({ purchases: z13.array(purchasesRequest).nullish(), afterCursor: z13.string().nullish() }).transform((data) => ({
|
1653
|
-
purchases: data["purchases"],
|
1654
|
-
afterCursor: data["afterCursor"]
|
1655
|
-
}));
|
1656
|
-
});
|
1777
|
+
// src/services/purchases/purchases-service.ts
|
1778
|
+
import { z as z45 } from "zod";
|
1657
1779
|
|
1658
|
-
// src/services/purchases/models/create-purchase-request.ts
|
1780
|
+
// src/services/purchases/models/create-purchase-v2-request.ts
|
1659
1781
|
import { z as z14 } from "zod";
|
1660
|
-
var
|
1782
|
+
var createPurchaseV2Request = z14.lazy(() => {
|
1661
1783
|
return z14.object({
|
1662
1784
|
destination: z14.string(),
|
1663
1785
|
dataLimitInGb: z14.number(),
|
1664
|
-
|
1665
|
-
endDate: z14.string(),
|
1786
|
+
quantity: z14.number().gte(1).lte(5),
|
1666
1787
|
email: z14.string().optional(),
|
1667
1788
|
referenceId: z14.string().optional(),
|
1668
1789
|
networkBrand: z14.string().optional(),
|
1669
|
-
|
1670
|
-
endTime: z14.number().optional()
|
1790
|
+
emailBrand: z14.string().optional()
|
1671
1791
|
});
|
1672
1792
|
});
|
1673
|
-
var
|
1793
|
+
var createPurchaseV2RequestResponse = z14.lazy(() => {
|
1674
1794
|
return z14.object({
|
1675
1795
|
destination: z14.string(),
|
1676
1796
|
dataLimitInGB: z14.number(),
|
1677
|
-
|
1678
|
-
endDate: z14.string(),
|
1797
|
+
quantity: z14.number().gte(1).lte(5),
|
1679
1798
|
email: z14.string().optional(),
|
1680
1799
|
referenceId: z14.string().optional(),
|
1681
1800
|
networkBrand: z14.string().optional(),
|
1682
|
-
|
1683
|
-
endTime: z14.number().optional()
|
1801
|
+
emailBrand: z14.string().optional()
|
1684
1802
|
}).transform((data) => ({
|
1685
1803
|
destination: data["destination"],
|
1686
1804
|
dataLimitInGb: data["dataLimitInGB"],
|
1687
|
-
|
1688
|
-
endDate: data["endDate"],
|
1805
|
+
quantity: data["quantity"],
|
1689
1806
|
email: data["email"],
|
1690
1807
|
referenceId: data["referenceId"],
|
1691
1808
|
networkBrand: data["networkBrand"],
|
1692
|
-
|
1693
|
-
endTime: data["endTime"]
|
1809
|
+
emailBrand: data["emailBrand"]
|
1694
1810
|
}));
|
1695
1811
|
});
|
1696
|
-
var
|
1812
|
+
var createPurchaseV2RequestRequest = z14.lazy(() => {
|
1697
1813
|
return z14.object({
|
1698
|
-
destination: z14.string()
|
1699
|
-
dataLimitInGb: z14.number()
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
startTime: z14.number().nullish(),
|
1706
|
-
endTime: z14.number().nullish()
|
1814
|
+
destination: z14.string(),
|
1815
|
+
dataLimitInGb: z14.number(),
|
1816
|
+
quantity: z14.number().gte(1).lte(5),
|
1817
|
+
email: z14.string().optional(),
|
1818
|
+
referenceId: z14.string().optional(),
|
1819
|
+
networkBrand: z14.string().optional(),
|
1820
|
+
emailBrand: z14.string().optional()
|
1707
1821
|
}).transform((data) => ({
|
1708
1822
|
destination: data["destination"],
|
1709
1823
|
dataLimitInGB: data["dataLimitInGb"],
|
1710
|
-
|
1711
|
-
endDate: data["endDate"],
|
1824
|
+
quantity: data["quantity"],
|
1712
1825
|
email: data["email"],
|
1713
1826
|
referenceId: data["referenceId"],
|
1714
1827
|
networkBrand: data["networkBrand"],
|
1715
|
-
|
1716
|
-
endTime: data["endTime"]
|
1828
|
+
emailBrand: data["emailBrand"]
|
1717
1829
|
}));
|
1718
1830
|
});
|
1719
1831
|
|
1720
|
-
// src/services/purchases/models/create-purchase-ok-response.ts
|
1832
|
+
// src/services/purchases/models/create-purchase-v2-ok-response.ts
|
1721
1833
|
import { z as z17 } from "zod";
|
1722
1834
|
|
1723
|
-
// src/services/purchases/models/create-purchase-ok-response-purchase.ts
|
1835
|
+
// src/services/purchases/models/create-purchase-v2-ok-response-purchase.ts
|
1724
1836
|
import { z as z15 } from "zod";
|
1725
|
-
var
|
1837
|
+
var createPurchaseV2OkResponsePurchase = z15.lazy(() => {
|
1726
1838
|
return z15.object({
|
1727
1839
|
id: z15.string().optional(),
|
1728
1840
|
packageId: z15.string().optional(),
|
1729
|
-
|
1730
|
-
endDate: z15.string().optional(),
|
1731
|
-
createdDate: z15.string().optional(),
|
1732
|
-
startTime: z15.number().optional(),
|
1733
|
-
endTime: z15.number().optional()
|
1841
|
+
createdDate: z15.string().optional()
|
1734
1842
|
});
|
1735
1843
|
});
|
1736
|
-
var
|
1844
|
+
var createPurchaseV2OkResponsePurchaseResponse = z15.lazy(() => {
|
1737
1845
|
return z15.object({
|
1738
1846
|
id: z15.string().optional(),
|
1739
1847
|
packageId: z15.string().optional(),
|
1740
|
-
|
1741
|
-
endDate: z15.string().optional(),
|
1742
|
-
createdDate: z15.string().optional(),
|
1743
|
-
startTime: z15.number().optional(),
|
1744
|
-
endTime: z15.number().optional()
|
1848
|
+
createdDate: z15.string().optional()
|
1745
1849
|
}).transform((data) => ({
|
1746
1850
|
id: data["id"],
|
1747
1851
|
packageId: data["packageId"],
|
1748
|
-
|
1749
|
-
endDate: data["endDate"],
|
1750
|
-
createdDate: data["createdDate"],
|
1751
|
-
startTime: data["startTime"],
|
1752
|
-
endTime: data["endTime"]
|
1852
|
+
createdDate: data["createdDate"]
|
1753
1853
|
}));
|
1754
1854
|
});
|
1755
|
-
var
|
1855
|
+
var createPurchaseV2OkResponsePurchaseRequest = z15.lazy(() => {
|
1756
1856
|
return z15.object({
|
1757
|
-
id: z15.string().
|
1758
|
-
packageId: z15.string().
|
1759
|
-
|
1760
|
-
endDate: z15.string().nullish(),
|
1761
|
-
createdDate: z15.string().nullish(),
|
1762
|
-
startTime: z15.number().nullish(),
|
1763
|
-
endTime: z15.number().nullish()
|
1857
|
+
id: z15.string().optional(),
|
1858
|
+
packageId: z15.string().optional(),
|
1859
|
+
createdDate: z15.string().optional()
|
1764
1860
|
}).transform((data) => ({
|
1765
1861
|
id: data["id"],
|
1766
1862
|
packageId: data["packageId"],
|
1767
|
-
|
1768
|
-
endDate: data["endDate"],
|
1769
|
-
createdDate: data["createdDate"],
|
1770
|
-
startTime: data["startTime"],
|
1771
|
-
endTime: data["endTime"]
|
1863
|
+
createdDate: data["createdDate"]
|
1772
1864
|
}));
|
1773
1865
|
});
|
1774
1866
|
|
1775
|
-
// src/services/purchases/models/create-purchase-ok-response-profile.ts
|
1867
|
+
// src/services/purchases/models/create-purchase-v2-ok-response-profile.ts
|
1776
1868
|
import { z as z16 } from "zod";
|
1777
|
-
var
|
1869
|
+
var createPurchaseV2OkResponseProfile = z16.lazy(() => {
|
1778
1870
|
return z16.object({
|
1779
1871
|
iccid: z16.string().min(18).max(22).optional(),
|
1780
1872
|
activationCode: z16.string().min(1e3).max(8e3).optional(),
|
1781
1873
|
manualActivationCode: z16.string().optional()
|
1782
1874
|
});
|
1783
1875
|
});
|
1784
|
-
var
|
1876
|
+
var createPurchaseV2OkResponseProfileResponse = z16.lazy(() => {
|
1785
1877
|
return z16.object({
|
1786
1878
|
iccid: z16.string().min(18).max(22).optional(),
|
1787
1879
|
activationCode: z16.string().min(1e3).max(8e3).optional(),
|
@@ -1792,11 +1884,11 @@ var createPurchaseOkResponseProfileResponse = z16.lazy(() => {
|
|
1792
1884
|
manualActivationCode: data["manualActivationCode"]
|
1793
1885
|
}));
|
1794
1886
|
});
|
1795
|
-
var
|
1887
|
+
var createPurchaseV2OkResponseProfileRequest = z16.lazy(() => {
|
1796
1888
|
return z16.object({
|
1797
|
-
iccid: z16.string().
|
1798
|
-
activationCode: z16.string().
|
1799
|
-
manualActivationCode: z16.string().
|
1889
|
+
iccid: z16.string().min(18).max(22).optional(),
|
1890
|
+
activationCode: z16.string().min(1e3).max(8e3).optional(),
|
1891
|
+
manualActivationCode: z16.string().optional()
|
1800
1892
|
}).transform((data) => ({
|
1801
1893
|
iccid: data["iccid"],
|
1802
1894
|
activationCode: data["activationCode"],
|
@@ -1804,138 +1896,627 @@ var createPurchaseOkResponseProfileRequest = z16.lazy(() => {
|
|
1804
1896
|
}));
|
1805
1897
|
});
|
1806
1898
|
|
1807
|
-
// src/services/purchases/models/create-purchase-ok-response.ts
|
1808
|
-
var
|
1899
|
+
// src/services/purchases/models/create-purchase-v2-ok-response.ts
|
1900
|
+
var createPurchaseV2OkResponse = z17.lazy(() => {
|
1809
1901
|
return z17.object({
|
1810
|
-
purchase:
|
1811
|
-
profile:
|
1902
|
+
purchase: createPurchaseV2OkResponsePurchase.optional(),
|
1903
|
+
profile: createPurchaseV2OkResponseProfile.optional()
|
1812
1904
|
});
|
1813
1905
|
});
|
1814
|
-
var
|
1906
|
+
var createPurchaseV2OkResponseResponse = z17.lazy(() => {
|
1815
1907
|
return z17.object({
|
1816
|
-
purchase:
|
1817
|
-
profile:
|
1908
|
+
purchase: createPurchaseV2OkResponsePurchaseResponse.optional(),
|
1909
|
+
profile: createPurchaseV2OkResponseProfileResponse.optional()
|
1818
1910
|
}).transform((data) => ({
|
1819
1911
|
purchase: data["purchase"],
|
1820
1912
|
profile: data["profile"]
|
1821
1913
|
}));
|
1822
1914
|
});
|
1823
|
-
var
|
1915
|
+
var createPurchaseV2OkResponseRequest = z17.lazy(() => {
|
1824
1916
|
return z17.object({
|
1825
|
-
purchase:
|
1826
|
-
profile:
|
1917
|
+
purchase: createPurchaseV2OkResponsePurchaseRequest.optional(),
|
1918
|
+
profile: createPurchaseV2OkResponseProfileRequest.optional()
|
1827
1919
|
}).transform((data) => ({
|
1828
1920
|
purchase: data["purchase"],
|
1829
1921
|
profile: data["profile"]
|
1830
1922
|
}));
|
1831
1923
|
});
|
1832
1924
|
|
1833
|
-
// src/services/purchases/models/
|
1925
|
+
// src/services/purchases/models/_4.ts
|
1834
1926
|
import { z as z18 } from "zod";
|
1835
|
-
var
|
1927
|
+
var _4Response = z18.lazy(() => {
|
1836
1928
|
return z18.object({
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1929
|
+
message: z18.string().optional()
|
1930
|
+
}).transform((data) => ({
|
1931
|
+
message: data["message"]
|
1932
|
+
}));
|
1933
|
+
});
|
1934
|
+
var _4 = class extends ThrowableError {
|
1935
|
+
constructor(message, response) {
|
1936
|
+
super(message);
|
1937
|
+
this.message = message;
|
1938
|
+
this.response = response;
|
1939
|
+
const parsedResponse = _4Response.parse(response);
|
1940
|
+
this.message = parsedResponse.message || "";
|
1941
|
+
}
|
1942
|
+
throw() {
|
1943
|
+
throw new _4(this.message, this.response);
|
1944
|
+
}
|
1945
|
+
};
|
1946
|
+
|
1947
|
+
// src/services/purchases/models/_5.ts
|
1948
|
+
import { z as z19 } from "zod";
|
1949
|
+
var _5Response = z19.lazy(() => {
|
1950
|
+
return z19.object({
|
1951
|
+
message: z19.string().optional()
|
1952
|
+
}).transform((data) => ({
|
1953
|
+
message: data["message"]
|
1954
|
+
}));
|
1955
|
+
});
|
1956
|
+
var _5 = class extends ThrowableError {
|
1957
|
+
constructor(message, response) {
|
1958
|
+
super(message);
|
1959
|
+
this.message = message;
|
1960
|
+
this.response = response;
|
1961
|
+
const parsedResponse = _5Response.parse(response);
|
1962
|
+
this.message = parsedResponse.message || "";
|
1963
|
+
}
|
1964
|
+
throw() {
|
1965
|
+
throw new _5(this.message, this.response);
|
1966
|
+
}
|
1967
|
+
};
|
1968
|
+
|
1969
|
+
// src/services/purchases/models/list-purchases-ok-response.ts
|
1970
|
+
import { z as z23 } from "zod";
|
1971
|
+
|
1972
|
+
// src/services/purchases/models/purchases.ts
|
1973
|
+
import { z as z22 } from "zod";
|
1974
|
+
|
1975
|
+
// src/services/purchases/models/package_.ts
|
1976
|
+
import { z as z20 } from "zod";
|
1977
|
+
var package_ = z20.lazy(() => {
|
1978
|
+
return z20.object({
|
1979
|
+
id: z20.string().optional(),
|
1980
|
+
dataLimitInBytes: z20.number().optional(),
|
1981
|
+
destination: z20.string().optional(),
|
1982
|
+
destinationName: z20.string().optional(),
|
1983
|
+
priceInCents: z20.number().optional()
|
1845
1984
|
});
|
1846
1985
|
});
|
1847
|
-
var
|
1848
|
-
return
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
referenceId: z18.string().optional(),
|
1855
|
-
startTime: z18.number().optional(),
|
1856
|
-
endTime: z18.number().optional()
|
1986
|
+
var packageResponse = z20.lazy(() => {
|
1987
|
+
return z20.object({
|
1988
|
+
id: z20.string().optional(),
|
1989
|
+
dataLimitInBytes: z20.number().optional(),
|
1990
|
+
destination: z20.string().optional(),
|
1991
|
+
destinationName: z20.string().optional(),
|
1992
|
+
priceInCents: z20.number().optional()
|
1857
1993
|
}).transform((data) => ({
|
1858
|
-
|
1994
|
+
id: data["id"],
|
1995
|
+
dataLimitInBytes: data["dataLimitInBytes"],
|
1996
|
+
destination: data["destination"],
|
1997
|
+
destinationName: data["destinationName"],
|
1998
|
+
priceInCents: data["priceInCents"]
|
1999
|
+
}));
|
2000
|
+
});
|
2001
|
+
var packageRequest = z20.lazy(() => {
|
2002
|
+
return z20.object({
|
2003
|
+
id: z20.string().optional(),
|
2004
|
+
dataLimitInBytes: z20.number().optional(),
|
2005
|
+
destination: z20.string().optional(),
|
2006
|
+
destinationName: z20.string().optional(),
|
2007
|
+
priceInCents: z20.number().optional()
|
2008
|
+
}).transform((data) => ({
|
2009
|
+
id: data["id"],
|
2010
|
+
dataLimitInBytes: data["dataLimitInBytes"],
|
2011
|
+
destination: data["destination"],
|
2012
|
+
destinationName: data["destinationName"],
|
2013
|
+
priceInCents: data["priceInCents"]
|
2014
|
+
}));
|
2015
|
+
});
|
2016
|
+
|
2017
|
+
// src/services/purchases/models/purchases-esim.ts
|
2018
|
+
import { z as z21 } from "zod";
|
2019
|
+
var purchasesEsim = z21.lazy(() => {
|
2020
|
+
return z21.object({
|
2021
|
+
iccid: z21.string().min(18).max(22).optional()
|
2022
|
+
});
|
2023
|
+
});
|
2024
|
+
var purchasesEsimResponse = z21.lazy(() => {
|
2025
|
+
return z21.object({
|
2026
|
+
iccid: z21.string().min(18).max(22).optional()
|
2027
|
+
}).transform((data) => ({
|
2028
|
+
iccid: data["iccid"]
|
2029
|
+
}));
|
2030
|
+
});
|
2031
|
+
var purchasesEsimRequest = z21.lazy(() => {
|
2032
|
+
return z21.object({
|
2033
|
+
iccid: z21.string().min(18).max(22).optional()
|
2034
|
+
}).transform((data) => ({
|
2035
|
+
iccid: data["iccid"]
|
2036
|
+
}));
|
2037
|
+
});
|
2038
|
+
|
2039
|
+
// src/services/purchases/models/purchases.ts
|
2040
|
+
var purchases = z22.lazy(() => {
|
2041
|
+
return z22.object({
|
2042
|
+
id: z22.string().optional(),
|
2043
|
+
startDate: z22.string().optional().nullable(),
|
2044
|
+
endDate: z22.string().optional().nullable(),
|
2045
|
+
duration: z22.number().optional().nullable(),
|
2046
|
+
createdDate: z22.string().optional(),
|
2047
|
+
startTime: z22.number().optional().nullable(),
|
2048
|
+
endTime: z22.number().optional().nullable(),
|
2049
|
+
createdAt: z22.number().optional(),
|
2050
|
+
package: package_.optional(),
|
2051
|
+
esim: purchasesEsim.optional(),
|
2052
|
+
source: z22.string().optional(),
|
2053
|
+
purchaseType: z22.string().optional(),
|
2054
|
+
referenceId: z22.string().optional()
|
2055
|
+
});
|
2056
|
+
});
|
2057
|
+
var purchasesResponse = z22.lazy(() => {
|
2058
|
+
return z22.object({
|
2059
|
+
id: z22.string().optional(),
|
2060
|
+
startDate: z22.string().optional().nullable(),
|
2061
|
+
endDate: z22.string().optional().nullable(),
|
2062
|
+
duration: z22.number().optional().nullable(),
|
2063
|
+
createdDate: z22.string().optional(),
|
2064
|
+
startTime: z22.number().optional().nullable(),
|
2065
|
+
endTime: z22.number().optional().nullable(),
|
2066
|
+
createdAt: z22.number().optional(),
|
2067
|
+
package: packageResponse.optional(),
|
2068
|
+
esim: purchasesEsimResponse.optional(),
|
2069
|
+
source: z22.string().optional(),
|
2070
|
+
purchaseType: z22.string().optional(),
|
2071
|
+
referenceId: z22.string().optional()
|
2072
|
+
}).transform((data) => ({
|
2073
|
+
id: data["id"],
|
2074
|
+
startDate: data["startDate"],
|
2075
|
+
endDate: data["endDate"],
|
2076
|
+
duration: data["duration"],
|
2077
|
+
createdDate: data["createdDate"],
|
2078
|
+
startTime: data["startTime"],
|
2079
|
+
endTime: data["endTime"],
|
2080
|
+
createdAt: data["createdAt"],
|
2081
|
+
package: data["package"],
|
2082
|
+
esim: data["esim"],
|
2083
|
+
source: data["source"],
|
2084
|
+
purchaseType: data["purchaseType"],
|
2085
|
+
referenceId: data["referenceId"]
|
2086
|
+
}));
|
2087
|
+
});
|
2088
|
+
var purchasesRequest = z22.lazy(() => {
|
2089
|
+
return z22.object({
|
2090
|
+
id: z22.string().optional(),
|
2091
|
+
startDate: z22.string().optional().nullable(),
|
2092
|
+
endDate: z22.string().optional().nullable(),
|
2093
|
+
duration: z22.number().optional().nullable(),
|
2094
|
+
createdDate: z22.string().optional(),
|
2095
|
+
startTime: z22.number().optional().nullable(),
|
2096
|
+
endTime: z22.number().optional().nullable(),
|
2097
|
+
createdAt: z22.number().optional(),
|
2098
|
+
package: packageRequest.optional(),
|
2099
|
+
esim: purchasesEsimRequest.optional(),
|
2100
|
+
source: z22.string().optional(),
|
2101
|
+
purchaseType: z22.string().optional(),
|
2102
|
+
referenceId: z22.string().optional()
|
2103
|
+
}).transform((data) => ({
|
2104
|
+
id: data["id"],
|
2105
|
+
startDate: data["startDate"],
|
2106
|
+
endDate: data["endDate"],
|
2107
|
+
duration: data["duration"],
|
2108
|
+
createdDate: data["createdDate"],
|
2109
|
+
startTime: data["startTime"],
|
2110
|
+
endTime: data["endTime"],
|
2111
|
+
createdAt: data["createdAt"],
|
2112
|
+
package: data["package"],
|
2113
|
+
esim: data["esim"],
|
2114
|
+
source: data["source"],
|
2115
|
+
purchaseType: data["purchaseType"],
|
2116
|
+
referenceId: data["referenceId"]
|
2117
|
+
}));
|
2118
|
+
});
|
2119
|
+
|
2120
|
+
// src/services/purchases/models/list-purchases-ok-response.ts
|
2121
|
+
var listPurchasesOkResponse = z23.lazy(() => {
|
2122
|
+
return z23.object({
|
2123
|
+
purchases: z23.array(purchases).optional(),
|
2124
|
+
afterCursor: z23.string().optional().nullable()
|
2125
|
+
});
|
2126
|
+
});
|
2127
|
+
var listPurchasesOkResponseResponse = z23.lazy(() => {
|
2128
|
+
return z23.object({
|
2129
|
+
purchases: z23.array(purchasesResponse).optional(),
|
2130
|
+
afterCursor: z23.string().optional().nullable()
|
2131
|
+
}).transform((data) => ({
|
2132
|
+
purchases: data["purchases"],
|
2133
|
+
afterCursor: data["afterCursor"]
|
2134
|
+
}));
|
2135
|
+
});
|
2136
|
+
var listPurchasesOkResponseRequest = z23.lazy(() => {
|
2137
|
+
return z23.object({
|
2138
|
+
purchases: z23.array(purchasesRequest).optional(),
|
2139
|
+
afterCursor: z23.string().optional().nullable()
|
2140
|
+
}).transform((data) => ({
|
2141
|
+
purchases: data["purchases"],
|
2142
|
+
afterCursor: data["afterCursor"]
|
2143
|
+
}));
|
2144
|
+
});
|
2145
|
+
|
2146
|
+
// src/services/purchases/models/_6.ts
|
2147
|
+
import { z as z24 } from "zod";
|
2148
|
+
var _6Response = z24.lazy(() => {
|
2149
|
+
return z24.object({
|
2150
|
+
message: z24.string().optional()
|
2151
|
+
}).transform((data) => ({
|
2152
|
+
message: data["message"]
|
2153
|
+
}));
|
2154
|
+
});
|
2155
|
+
var _6 = class extends ThrowableError {
|
2156
|
+
constructor(message, response) {
|
2157
|
+
super(message);
|
2158
|
+
this.message = message;
|
2159
|
+
this.response = response;
|
2160
|
+
const parsedResponse = _6Response.parse(response);
|
2161
|
+
this.message = parsedResponse.message || "";
|
2162
|
+
}
|
2163
|
+
throw() {
|
2164
|
+
throw new _6(this.message, this.response);
|
2165
|
+
}
|
2166
|
+
};
|
2167
|
+
|
2168
|
+
// src/services/purchases/models/_7.ts
|
2169
|
+
import { z as z25 } from "zod";
|
2170
|
+
var _7Response = z25.lazy(() => {
|
2171
|
+
return z25.object({
|
2172
|
+
message: z25.string().optional()
|
2173
|
+
}).transform((data) => ({
|
2174
|
+
message: data["message"]
|
2175
|
+
}));
|
2176
|
+
});
|
2177
|
+
var _7 = class extends ThrowableError {
|
2178
|
+
constructor(message, response) {
|
2179
|
+
super(message);
|
2180
|
+
this.message = message;
|
2181
|
+
this.response = response;
|
2182
|
+
const parsedResponse = _7Response.parse(response);
|
2183
|
+
this.message = parsedResponse.message || "";
|
2184
|
+
}
|
2185
|
+
throw() {
|
2186
|
+
throw new _7(this.message, this.response);
|
2187
|
+
}
|
2188
|
+
};
|
2189
|
+
|
2190
|
+
// src/services/purchases/models/create-purchase-request.ts
|
2191
|
+
import { z as z26 } from "zod";
|
2192
|
+
var createPurchaseRequest = z26.lazy(() => {
|
2193
|
+
return z26.object({
|
2194
|
+
destination: z26.string(),
|
2195
|
+
dataLimitInGb: z26.number(),
|
2196
|
+
startDate: z26.string(),
|
2197
|
+
endDate: z26.string(),
|
2198
|
+
email: z26.string().optional(),
|
2199
|
+
referenceId: z26.string().optional(),
|
2200
|
+
networkBrand: z26.string().optional(),
|
2201
|
+
emailBrand: z26.string().optional(),
|
2202
|
+
startTime: z26.number().optional(),
|
2203
|
+
endTime: z26.number().optional()
|
2204
|
+
});
|
2205
|
+
});
|
2206
|
+
var createPurchaseRequestResponse = z26.lazy(() => {
|
2207
|
+
return z26.object({
|
2208
|
+
destination: z26.string(),
|
2209
|
+
dataLimitInGB: z26.number(),
|
2210
|
+
startDate: z26.string(),
|
2211
|
+
endDate: z26.string(),
|
2212
|
+
email: z26.string().optional(),
|
2213
|
+
referenceId: z26.string().optional(),
|
2214
|
+
networkBrand: z26.string().optional(),
|
2215
|
+
emailBrand: z26.string().optional(),
|
2216
|
+
startTime: z26.number().optional(),
|
2217
|
+
endTime: z26.number().optional()
|
2218
|
+
}).transform((data) => ({
|
2219
|
+
destination: data["destination"],
|
1859
2220
|
dataLimitInGb: data["dataLimitInGB"],
|
1860
2221
|
startDate: data["startDate"],
|
1861
2222
|
endDate: data["endDate"],
|
1862
2223
|
email: data["email"],
|
1863
2224
|
referenceId: data["referenceId"],
|
2225
|
+
networkBrand: data["networkBrand"],
|
2226
|
+
emailBrand: data["emailBrand"],
|
1864
2227
|
startTime: data["startTime"],
|
1865
2228
|
endTime: data["endTime"]
|
1866
2229
|
}));
|
1867
2230
|
});
|
1868
|
-
var
|
1869
|
-
return
|
1870
|
-
|
1871
|
-
dataLimitInGb:
|
1872
|
-
startDate:
|
1873
|
-
endDate:
|
1874
|
-
email:
|
1875
|
-
referenceId:
|
1876
|
-
|
1877
|
-
|
2231
|
+
var createPurchaseRequestRequest = z26.lazy(() => {
|
2232
|
+
return z26.object({
|
2233
|
+
destination: z26.string(),
|
2234
|
+
dataLimitInGb: z26.number(),
|
2235
|
+
startDate: z26.string(),
|
2236
|
+
endDate: z26.string(),
|
2237
|
+
email: z26.string().optional(),
|
2238
|
+
referenceId: z26.string().optional(),
|
2239
|
+
networkBrand: z26.string().optional(),
|
2240
|
+
emailBrand: z26.string().optional(),
|
2241
|
+
startTime: z26.number().optional(),
|
2242
|
+
endTime: z26.number().optional()
|
1878
2243
|
}).transform((data) => ({
|
1879
|
-
|
2244
|
+
destination: data["destination"],
|
1880
2245
|
dataLimitInGB: data["dataLimitInGb"],
|
1881
2246
|
startDate: data["startDate"],
|
1882
2247
|
endDate: data["endDate"],
|
1883
2248
|
email: data["email"],
|
1884
2249
|
referenceId: data["referenceId"],
|
2250
|
+
networkBrand: data["networkBrand"],
|
2251
|
+
emailBrand: data["emailBrand"],
|
2252
|
+
startTime: data["startTime"],
|
2253
|
+
endTime: data["endTime"]
|
2254
|
+
}));
|
2255
|
+
});
|
2256
|
+
|
2257
|
+
// src/services/purchases/models/create-purchase-ok-response.ts
|
2258
|
+
import { z as z29 } from "zod";
|
2259
|
+
|
2260
|
+
// src/services/purchases/models/create-purchase-ok-response-purchase.ts
|
2261
|
+
import { z as z27 } from "zod";
|
2262
|
+
var createPurchaseOkResponsePurchase = z27.lazy(() => {
|
2263
|
+
return z27.object({
|
2264
|
+
id: z27.string().optional(),
|
2265
|
+
packageId: z27.string().optional(),
|
2266
|
+
startDate: z27.string().optional().nullable(),
|
2267
|
+
endDate: z27.string().optional().nullable(),
|
2268
|
+
createdDate: z27.string().optional(),
|
2269
|
+
startTime: z27.number().optional().nullable(),
|
2270
|
+
endTime: z27.number().optional().nullable()
|
2271
|
+
});
|
2272
|
+
});
|
2273
|
+
var createPurchaseOkResponsePurchaseResponse = z27.lazy(() => {
|
2274
|
+
return z27.object({
|
2275
|
+
id: z27.string().optional(),
|
2276
|
+
packageId: z27.string().optional(),
|
2277
|
+
startDate: z27.string().optional().nullable(),
|
2278
|
+
endDate: z27.string().optional().nullable(),
|
2279
|
+
createdDate: z27.string().optional(),
|
2280
|
+
startTime: z27.number().optional().nullable(),
|
2281
|
+
endTime: z27.number().optional().nullable()
|
2282
|
+
}).transform((data) => ({
|
2283
|
+
id: data["id"],
|
2284
|
+
packageId: data["packageId"],
|
2285
|
+
startDate: data["startDate"],
|
2286
|
+
endDate: data["endDate"],
|
2287
|
+
createdDate: data["createdDate"],
|
2288
|
+
startTime: data["startTime"],
|
2289
|
+
endTime: data["endTime"]
|
2290
|
+
}));
|
2291
|
+
});
|
2292
|
+
var createPurchaseOkResponsePurchaseRequest = z27.lazy(() => {
|
2293
|
+
return z27.object({
|
2294
|
+
id: z27.string().optional(),
|
2295
|
+
packageId: z27.string().optional(),
|
2296
|
+
startDate: z27.string().optional().nullable(),
|
2297
|
+
endDate: z27.string().optional().nullable(),
|
2298
|
+
createdDate: z27.string().optional(),
|
2299
|
+
startTime: z27.number().optional().nullable(),
|
2300
|
+
endTime: z27.number().optional().nullable()
|
2301
|
+
}).transform((data) => ({
|
2302
|
+
id: data["id"],
|
2303
|
+
packageId: data["packageId"],
|
2304
|
+
startDate: data["startDate"],
|
2305
|
+
endDate: data["endDate"],
|
2306
|
+
createdDate: data["createdDate"],
|
2307
|
+
startTime: data["startTime"],
|
2308
|
+
endTime: data["endTime"]
|
2309
|
+
}));
|
2310
|
+
});
|
2311
|
+
|
2312
|
+
// src/services/purchases/models/create-purchase-ok-response-profile.ts
|
2313
|
+
import { z as z28 } from "zod";
|
2314
|
+
var createPurchaseOkResponseProfile = z28.lazy(() => {
|
2315
|
+
return z28.object({
|
2316
|
+
iccid: z28.string().min(18).max(22).optional(),
|
2317
|
+
activationCode: z28.string().min(1e3).max(8e3).optional(),
|
2318
|
+
manualActivationCode: z28.string().optional()
|
2319
|
+
});
|
2320
|
+
});
|
2321
|
+
var createPurchaseOkResponseProfileResponse = z28.lazy(() => {
|
2322
|
+
return z28.object({
|
2323
|
+
iccid: z28.string().min(18).max(22).optional(),
|
2324
|
+
activationCode: z28.string().min(1e3).max(8e3).optional(),
|
2325
|
+
manualActivationCode: z28.string().optional()
|
2326
|
+
}).transform((data) => ({
|
2327
|
+
iccid: data["iccid"],
|
2328
|
+
activationCode: data["activationCode"],
|
2329
|
+
manualActivationCode: data["manualActivationCode"]
|
2330
|
+
}));
|
2331
|
+
});
|
2332
|
+
var createPurchaseOkResponseProfileRequest = z28.lazy(() => {
|
2333
|
+
return z28.object({
|
2334
|
+
iccid: z28.string().min(18).max(22).optional(),
|
2335
|
+
activationCode: z28.string().min(1e3).max(8e3).optional(),
|
2336
|
+
manualActivationCode: z28.string().optional()
|
2337
|
+
}).transform((data) => ({
|
2338
|
+
iccid: data["iccid"],
|
2339
|
+
activationCode: data["activationCode"],
|
2340
|
+
manualActivationCode: data["manualActivationCode"]
|
2341
|
+
}));
|
2342
|
+
});
|
2343
|
+
|
2344
|
+
// src/services/purchases/models/create-purchase-ok-response.ts
|
2345
|
+
var createPurchaseOkResponse = z29.lazy(() => {
|
2346
|
+
return z29.object({
|
2347
|
+
purchase: createPurchaseOkResponsePurchase.optional(),
|
2348
|
+
profile: createPurchaseOkResponseProfile.optional()
|
2349
|
+
});
|
2350
|
+
});
|
2351
|
+
var createPurchaseOkResponseResponse = z29.lazy(() => {
|
2352
|
+
return z29.object({
|
2353
|
+
purchase: createPurchaseOkResponsePurchaseResponse.optional(),
|
2354
|
+
profile: createPurchaseOkResponseProfileResponse.optional()
|
2355
|
+
}).transform((data) => ({
|
2356
|
+
purchase: data["purchase"],
|
2357
|
+
profile: data["profile"]
|
2358
|
+
}));
|
2359
|
+
});
|
2360
|
+
var createPurchaseOkResponseRequest = z29.lazy(() => {
|
2361
|
+
return z29.object({
|
2362
|
+
purchase: createPurchaseOkResponsePurchaseRequest.optional(),
|
2363
|
+
profile: createPurchaseOkResponseProfileRequest.optional()
|
2364
|
+
}).transform((data) => ({
|
2365
|
+
purchase: data["purchase"],
|
2366
|
+
profile: data["profile"]
|
2367
|
+
}));
|
2368
|
+
});
|
2369
|
+
|
2370
|
+
// src/services/purchases/models/_8.ts
|
2371
|
+
import { z as z30 } from "zod";
|
2372
|
+
var _8Response = z30.lazy(() => {
|
2373
|
+
return z30.object({
|
2374
|
+
message: z30.string().optional()
|
2375
|
+
}).transform((data) => ({
|
2376
|
+
message: data["message"]
|
2377
|
+
}));
|
2378
|
+
});
|
2379
|
+
var _8 = class extends ThrowableError {
|
2380
|
+
constructor(message, response) {
|
2381
|
+
super(message);
|
2382
|
+
this.message = message;
|
2383
|
+
this.response = response;
|
2384
|
+
const parsedResponse = _8Response.parse(response);
|
2385
|
+
this.message = parsedResponse.message || "";
|
2386
|
+
}
|
2387
|
+
throw() {
|
2388
|
+
throw new _8(this.message, this.response);
|
2389
|
+
}
|
2390
|
+
};
|
2391
|
+
|
2392
|
+
// src/services/purchases/models/_9.ts
|
2393
|
+
import { z as z31 } from "zod";
|
2394
|
+
var _9Response = z31.lazy(() => {
|
2395
|
+
return z31.object({
|
2396
|
+
message: z31.string().optional()
|
2397
|
+
}).transform((data) => ({
|
2398
|
+
message: data["message"]
|
2399
|
+
}));
|
2400
|
+
});
|
2401
|
+
var _9 = class extends ThrowableError {
|
2402
|
+
constructor(message, response) {
|
2403
|
+
super(message);
|
2404
|
+
this.message = message;
|
2405
|
+
this.response = response;
|
2406
|
+
const parsedResponse = _9Response.parse(response);
|
2407
|
+
this.message = parsedResponse.message || "";
|
2408
|
+
}
|
2409
|
+
throw() {
|
2410
|
+
throw new _9(this.message, this.response);
|
2411
|
+
}
|
2412
|
+
};
|
2413
|
+
|
2414
|
+
// src/services/purchases/models/top-up-esim-request.ts
|
2415
|
+
import { z as z32 } from "zod";
|
2416
|
+
var topUpEsimRequest = z32.lazy(() => {
|
2417
|
+
return z32.object({
|
2418
|
+
iccid: z32.string().min(18).max(22),
|
2419
|
+
dataLimitInGb: z32.number(),
|
2420
|
+
email: z32.string().optional(),
|
2421
|
+
referenceId: z32.string().optional(),
|
2422
|
+
emailBrand: z32.string().optional(),
|
2423
|
+
startTime: z32.number().optional(),
|
2424
|
+
endTime: z32.number().optional()
|
2425
|
+
});
|
2426
|
+
});
|
2427
|
+
var topUpEsimRequestResponse = z32.lazy(() => {
|
2428
|
+
return z32.object({
|
2429
|
+
iccid: z32.string().min(18).max(22),
|
2430
|
+
dataLimitInGB: z32.number(),
|
2431
|
+
email: z32.string().optional(),
|
2432
|
+
referenceId: z32.string().optional(),
|
2433
|
+
emailBrand: z32.string().optional(),
|
2434
|
+
startTime: z32.number().optional(),
|
2435
|
+
endTime: z32.number().optional()
|
2436
|
+
}).transform((data) => ({
|
2437
|
+
iccid: data["iccid"],
|
2438
|
+
dataLimitInGb: data["dataLimitInGB"],
|
2439
|
+
email: data["email"],
|
2440
|
+
referenceId: data["referenceId"],
|
2441
|
+
emailBrand: data["emailBrand"],
|
2442
|
+
startTime: data["startTime"],
|
2443
|
+
endTime: data["endTime"]
|
2444
|
+
}));
|
2445
|
+
});
|
2446
|
+
var topUpEsimRequestRequest = z32.lazy(() => {
|
2447
|
+
return z32.object({
|
2448
|
+
iccid: z32.string().min(18).max(22),
|
2449
|
+
dataLimitInGb: z32.number(),
|
2450
|
+
email: z32.string().optional(),
|
2451
|
+
referenceId: z32.string().optional(),
|
2452
|
+
emailBrand: z32.string().optional(),
|
2453
|
+
startTime: z32.number().optional(),
|
2454
|
+
endTime: z32.number().optional()
|
2455
|
+
}).transform((data) => ({
|
2456
|
+
iccid: data["iccid"],
|
2457
|
+
dataLimitInGB: data["dataLimitInGb"],
|
2458
|
+
email: data["email"],
|
2459
|
+
referenceId: data["referenceId"],
|
2460
|
+
emailBrand: data["emailBrand"],
|
1885
2461
|
startTime: data["startTime"],
|
1886
2462
|
endTime: data["endTime"]
|
1887
2463
|
}));
|
1888
2464
|
});
|
1889
2465
|
|
1890
2466
|
// src/services/purchases/models/top-up-esim-ok-response.ts
|
1891
|
-
import { z as
|
2467
|
+
import { z as z35 } from "zod";
|
1892
2468
|
|
1893
2469
|
// src/services/purchases/models/top-up-esim-ok-response-purchase.ts
|
1894
|
-
import { z as
|
1895
|
-
var topUpEsimOkResponsePurchase =
|
1896
|
-
return
|
1897
|
-
id:
|
1898
|
-
packageId:
|
1899
|
-
startDate:
|
1900
|
-
endDate:
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
2470
|
+
import { z as z33 } from "zod";
|
2471
|
+
var topUpEsimOkResponsePurchase = z33.lazy(() => {
|
2472
|
+
return z33.object({
|
2473
|
+
id: z33.string().optional(),
|
2474
|
+
packageId: z33.string().optional(),
|
2475
|
+
startDate: z33.string().optional().nullable(),
|
2476
|
+
endDate: z33.string().optional().nullable(),
|
2477
|
+
duration: z33.number().optional().nullable(),
|
2478
|
+
createdDate: z33.string().optional(),
|
2479
|
+
startTime: z33.number().optional().nullable(),
|
2480
|
+
endTime: z33.number().optional().nullable()
|
1904
2481
|
});
|
1905
2482
|
});
|
1906
|
-
var topUpEsimOkResponsePurchaseResponse =
|
1907
|
-
return
|
1908
|
-
id:
|
1909
|
-
packageId:
|
1910
|
-
startDate:
|
1911
|
-
endDate:
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
2483
|
+
var topUpEsimOkResponsePurchaseResponse = z33.lazy(() => {
|
2484
|
+
return z33.object({
|
2485
|
+
id: z33.string().optional(),
|
2486
|
+
packageId: z33.string().optional(),
|
2487
|
+
startDate: z33.string().optional().nullable(),
|
2488
|
+
endDate: z33.string().optional().nullable(),
|
2489
|
+
duration: z33.number().optional().nullable(),
|
2490
|
+
createdDate: z33.string().optional(),
|
2491
|
+
startTime: z33.number().optional().nullable(),
|
2492
|
+
endTime: z33.number().optional().nullable()
|
1915
2493
|
}).transform((data) => ({
|
1916
2494
|
id: data["id"],
|
1917
2495
|
packageId: data["packageId"],
|
1918
2496
|
startDate: data["startDate"],
|
1919
2497
|
endDate: data["endDate"],
|
2498
|
+
duration: data["duration"],
|
1920
2499
|
createdDate: data["createdDate"],
|
1921
2500
|
startTime: data["startTime"],
|
1922
2501
|
endTime: data["endTime"]
|
1923
2502
|
}));
|
1924
2503
|
});
|
1925
|
-
var topUpEsimOkResponsePurchaseRequest =
|
1926
|
-
return
|
1927
|
-
id:
|
1928
|
-
packageId:
|
1929
|
-
startDate:
|
1930
|
-
endDate:
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
2504
|
+
var topUpEsimOkResponsePurchaseRequest = z33.lazy(() => {
|
2505
|
+
return z33.object({
|
2506
|
+
id: z33.string().optional(),
|
2507
|
+
packageId: z33.string().optional(),
|
2508
|
+
startDate: z33.string().optional().nullable(),
|
2509
|
+
endDate: z33.string().optional().nullable(),
|
2510
|
+
duration: z33.number().optional().nullable(),
|
2511
|
+
createdDate: z33.string().optional(),
|
2512
|
+
startTime: z33.number().optional().nullable(),
|
2513
|
+
endTime: z33.number().optional().nullable()
|
1934
2514
|
}).transform((data) => ({
|
1935
2515
|
id: data["id"],
|
1936
2516
|
packageId: data["packageId"],
|
1937
2517
|
startDate: data["startDate"],
|
1938
2518
|
endDate: data["endDate"],
|
2519
|
+
duration: data["duration"],
|
1939
2520
|
createdDate: data["createdDate"],
|
1940
2521
|
startTime: data["startTime"],
|
1941
2522
|
endTime: data["endTime"]
|
@@ -1943,34 +2524,36 @@ var topUpEsimOkResponsePurchaseRequest = z19.lazy(() => {
|
|
1943
2524
|
});
|
1944
2525
|
|
1945
2526
|
// src/services/purchases/models/top-up-esim-ok-response-profile.ts
|
1946
|
-
import { z as
|
1947
|
-
var topUpEsimOkResponseProfile =
|
1948
|
-
return
|
1949
|
-
iccid:
|
2527
|
+
import { z as z34 } from "zod";
|
2528
|
+
var topUpEsimOkResponseProfile = z34.lazy(() => {
|
2529
|
+
return z34.object({
|
2530
|
+
iccid: z34.string().min(18).max(22).optional()
|
1950
2531
|
});
|
1951
2532
|
});
|
1952
|
-
var topUpEsimOkResponseProfileResponse =
|
1953
|
-
return
|
1954
|
-
iccid:
|
2533
|
+
var topUpEsimOkResponseProfileResponse = z34.lazy(() => {
|
2534
|
+
return z34.object({
|
2535
|
+
iccid: z34.string().min(18).max(22).optional()
|
1955
2536
|
}).transform((data) => ({
|
1956
2537
|
iccid: data["iccid"]
|
1957
2538
|
}));
|
1958
2539
|
});
|
1959
|
-
var topUpEsimOkResponseProfileRequest =
|
1960
|
-
return
|
2540
|
+
var topUpEsimOkResponseProfileRequest = z34.lazy(() => {
|
2541
|
+
return z34.object({
|
2542
|
+
iccid: z34.string().min(18).max(22).optional()
|
2543
|
+
}).transform((data) => ({
|
1961
2544
|
iccid: data["iccid"]
|
1962
2545
|
}));
|
1963
2546
|
});
|
1964
2547
|
|
1965
2548
|
// src/services/purchases/models/top-up-esim-ok-response.ts
|
1966
|
-
var topUpEsimOkResponse =
|
1967
|
-
return
|
2549
|
+
var topUpEsimOkResponse = z35.lazy(() => {
|
2550
|
+
return z35.object({
|
1968
2551
|
purchase: topUpEsimOkResponsePurchase.optional(),
|
1969
2552
|
profile: topUpEsimOkResponseProfile.optional()
|
1970
2553
|
});
|
1971
2554
|
});
|
1972
|
-
var topUpEsimOkResponseResponse =
|
1973
|
-
return
|
2555
|
+
var topUpEsimOkResponseResponse = z35.lazy(() => {
|
2556
|
+
return z35.object({
|
1974
2557
|
purchase: topUpEsimOkResponsePurchaseResponse.optional(),
|
1975
2558
|
profile: topUpEsimOkResponseProfileResponse.optional()
|
1976
2559
|
}).transform((data) => ({
|
@@ -1978,34 +2561,78 @@ var topUpEsimOkResponseResponse = z21.lazy(() => {
|
|
1978
2561
|
profile: data["profile"]
|
1979
2562
|
}));
|
1980
2563
|
});
|
1981
|
-
var topUpEsimOkResponseRequest =
|
1982
|
-
return
|
1983
|
-
purchase: topUpEsimOkResponsePurchaseRequest.
|
1984
|
-
profile: topUpEsimOkResponseProfileRequest.
|
2564
|
+
var topUpEsimOkResponseRequest = z35.lazy(() => {
|
2565
|
+
return z35.object({
|
2566
|
+
purchase: topUpEsimOkResponsePurchaseRequest.optional(),
|
2567
|
+
profile: topUpEsimOkResponseProfileRequest.optional()
|
1985
2568
|
}).transform((data) => ({
|
1986
2569
|
purchase: data["purchase"],
|
1987
2570
|
profile: data["profile"]
|
1988
2571
|
}));
|
1989
2572
|
});
|
1990
2573
|
|
2574
|
+
// src/services/purchases/models/_10.ts
|
2575
|
+
import { z as z36 } from "zod";
|
2576
|
+
var _10Response = z36.lazy(() => {
|
2577
|
+
return z36.object({
|
2578
|
+
message: z36.string().optional()
|
2579
|
+
}).transform((data) => ({
|
2580
|
+
message: data["message"]
|
2581
|
+
}));
|
2582
|
+
});
|
2583
|
+
var _10 = class extends ThrowableError {
|
2584
|
+
constructor(message, response) {
|
2585
|
+
super(message);
|
2586
|
+
this.message = message;
|
2587
|
+
this.response = response;
|
2588
|
+
const parsedResponse = _10Response.parse(response);
|
2589
|
+
this.message = parsedResponse.message || "";
|
2590
|
+
}
|
2591
|
+
throw() {
|
2592
|
+
throw new _10(this.message, this.response);
|
2593
|
+
}
|
2594
|
+
};
|
2595
|
+
|
2596
|
+
// src/services/purchases/models/_11.ts
|
2597
|
+
import { z as z37 } from "zod";
|
2598
|
+
var _11Response = z37.lazy(() => {
|
2599
|
+
return z37.object({
|
2600
|
+
message: z37.string().optional()
|
2601
|
+
}).transform((data) => ({
|
2602
|
+
message: data["message"]
|
2603
|
+
}));
|
2604
|
+
});
|
2605
|
+
var _11 = class extends ThrowableError {
|
2606
|
+
constructor(message, response) {
|
2607
|
+
super(message);
|
2608
|
+
this.message = message;
|
2609
|
+
this.response = response;
|
2610
|
+
const parsedResponse = _11Response.parse(response);
|
2611
|
+
this.message = parsedResponse.message || "";
|
2612
|
+
}
|
2613
|
+
throw() {
|
2614
|
+
throw new _11(this.message, this.response);
|
2615
|
+
}
|
2616
|
+
};
|
2617
|
+
|
1991
2618
|
// src/services/purchases/models/edit-purchase-request.ts
|
1992
|
-
import { z as
|
1993
|
-
var editPurchaseRequest =
|
1994
|
-
return
|
1995
|
-
purchaseId:
|
1996
|
-
startDate:
|
1997
|
-
endDate:
|
1998
|
-
startTime:
|
1999
|
-
endTime:
|
2619
|
+
import { z as z38 } from "zod";
|
2620
|
+
var editPurchaseRequest = z38.lazy(() => {
|
2621
|
+
return z38.object({
|
2622
|
+
purchaseId: z38.string(),
|
2623
|
+
startDate: z38.string(),
|
2624
|
+
endDate: z38.string(),
|
2625
|
+
startTime: z38.number().optional(),
|
2626
|
+
endTime: z38.number().optional()
|
2000
2627
|
});
|
2001
2628
|
});
|
2002
|
-
var editPurchaseRequestResponse =
|
2003
|
-
return
|
2004
|
-
purchaseId:
|
2005
|
-
startDate:
|
2006
|
-
endDate:
|
2007
|
-
startTime:
|
2008
|
-
endTime:
|
2629
|
+
var editPurchaseRequestResponse = z38.lazy(() => {
|
2630
|
+
return z38.object({
|
2631
|
+
purchaseId: z38.string(),
|
2632
|
+
startDate: z38.string(),
|
2633
|
+
endDate: z38.string(),
|
2634
|
+
startTime: z38.number().optional(),
|
2635
|
+
endTime: z38.number().optional()
|
2009
2636
|
}).transform((data) => ({
|
2010
2637
|
purchaseId: data["purchaseId"],
|
2011
2638
|
startDate: data["startDate"],
|
@@ -2014,13 +2641,13 @@ var editPurchaseRequestResponse = z22.lazy(() => {
|
|
2014
2641
|
endTime: data["endTime"]
|
2015
2642
|
}));
|
2016
2643
|
});
|
2017
|
-
var editPurchaseRequestRequest =
|
2018
|
-
return
|
2019
|
-
purchaseId:
|
2020
|
-
startDate:
|
2021
|
-
endDate:
|
2022
|
-
startTime:
|
2023
|
-
endTime:
|
2644
|
+
var editPurchaseRequestRequest = z38.lazy(() => {
|
2645
|
+
return z38.object({
|
2646
|
+
purchaseId: z38.string(),
|
2647
|
+
startDate: z38.string(),
|
2648
|
+
endDate: z38.string(),
|
2649
|
+
startTime: z38.number().optional(),
|
2650
|
+
endTime: z38.number().optional()
|
2024
2651
|
}).transform((data) => ({
|
2025
2652
|
purchaseId: data["purchaseId"],
|
2026
2653
|
startDate: data["startDate"],
|
@@ -2031,23 +2658,23 @@ var editPurchaseRequestRequest = z22.lazy(() => {
|
|
2031
2658
|
});
|
2032
2659
|
|
2033
2660
|
// src/services/purchases/models/edit-purchase-ok-response.ts
|
2034
|
-
import { z as
|
2035
|
-
var editPurchaseOkResponse =
|
2036
|
-
return
|
2037
|
-
purchaseId:
|
2038
|
-
newStartDate:
|
2039
|
-
newEndDate:
|
2040
|
-
newStartTime:
|
2041
|
-
newEndTime:
|
2661
|
+
import { z as z39 } from "zod";
|
2662
|
+
var editPurchaseOkResponse = z39.lazy(() => {
|
2663
|
+
return z39.object({
|
2664
|
+
purchaseId: z39.string().optional(),
|
2665
|
+
newStartDate: z39.string().optional().nullable(),
|
2666
|
+
newEndDate: z39.string().optional().nullable(),
|
2667
|
+
newStartTime: z39.number().optional().nullable(),
|
2668
|
+
newEndTime: z39.number().optional().nullable()
|
2042
2669
|
});
|
2043
2670
|
});
|
2044
|
-
var editPurchaseOkResponseResponse =
|
2045
|
-
return
|
2046
|
-
purchaseId:
|
2047
|
-
newStartDate:
|
2048
|
-
newEndDate:
|
2049
|
-
newStartTime:
|
2050
|
-
newEndTime:
|
2671
|
+
var editPurchaseOkResponseResponse = z39.lazy(() => {
|
2672
|
+
return z39.object({
|
2673
|
+
purchaseId: z39.string().optional(),
|
2674
|
+
newStartDate: z39.string().optional().nullable(),
|
2675
|
+
newEndDate: z39.string().optional().nullable(),
|
2676
|
+
newStartTime: z39.number().optional().nullable(),
|
2677
|
+
newEndTime: z39.number().optional().nullable()
|
2051
2678
|
}).transform((data) => ({
|
2052
2679
|
purchaseId: data["purchaseId"],
|
2053
2680
|
newStartDate: data["newStartDate"],
|
@@ -2056,13 +2683,13 @@ var editPurchaseOkResponseResponse = z23.lazy(() => {
|
|
2056
2683
|
newEndTime: data["newEndTime"]
|
2057
2684
|
}));
|
2058
2685
|
});
|
2059
|
-
var editPurchaseOkResponseRequest =
|
2060
|
-
return
|
2061
|
-
purchaseId:
|
2062
|
-
newStartDate:
|
2063
|
-
newEndDate:
|
2064
|
-
newStartTime:
|
2065
|
-
newEndTime:
|
2686
|
+
var editPurchaseOkResponseRequest = z39.lazy(() => {
|
2687
|
+
return z39.object({
|
2688
|
+
purchaseId: z39.string().optional(),
|
2689
|
+
newStartDate: z39.string().optional().nullable(),
|
2690
|
+
newEndDate: z39.string().optional().nullable(),
|
2691
|
+
newStartTime: z39.number().optional().nullable(),
|
2692
|
+
newEndTime: z39.number().optional().nullable()
|
2066
2693
|
}).transform((data) => ({
|
2067
2694
|
purchaseId: data["purchaseId"],
|
2068
2695
|
newStartDate: data["newStartDate"],
|
@@ -2072,49 +2699,170 @@ var editPurchaseOkResponseRequest = z23.lazy(() => {
|
|
2072
2699
|
}));
|
2073
2700
|
});
|
2074
2701
|
|
2702
|
+
// src/services/purchases/models/_12.ts
|
2703
|
+
import { z as z40 } from "zod";
|
2704
|
+
var _12Response = z40.lazy(() => {
|
2705
|
+
return z40.object({
|
2706
|
+
message: z40.string().optional()
|
2707
|
+
}).transform((data) => ({
|
2708
|
+
message: data["message"]
|
2709
|
+
}));
|
2710
|
+
});
|
2711
|
+
var _12 = class extends ThrowableError {
|
2712
|
+
constructor(message, response) {
|
2713
|
+
super(message);
|
2714
|
+
this.message = message;
|
2715
|
+
this.response = response;
|
2716
|
+
const parsedResponse = _12Response.parse(response);
|
2717
|
+
this.message = parsedResponse.message || "";
|
2718
|
+
}
|
2719
|
+
throw() {
|
2720
|
+
throw new _12(this.message, this.response);
|
2721
|
+
}
|
2722
|
+
};
|
2723
|
+
|
2724
|
+
// src/services/purchases/models/_13.ts
|
2725
|
+
import { z as z41 } from "zod";
|
2726
|
+
var _13Response = z41.lazy(() => {
|
2727
|
+
return z41.object({
|
2728
|
+
message: z41.string().optional()
|
2729
|
+
}).transform((data) => ({
|
2730
|
+
message: data["message"]
|
2731
|
+
}));
|
2732
|
+
});
|
2733
|
+
var _13 = class extends ThrowableError {
|
2734
|
+
constructor(message, response) {
|
2735
|
+
super(message);
|
2736
|
+
this.message = message;
|
2737
|
+
this.response = response;
|
2738
|
+
const parsedResponse = _13Response.parse(response);
|
2739
|
+
this.message = parsedResponse.message || "";
|
2740
|
+
}
|
2741
|
+
throw() {
|
2742
|
+
throw new _13(this.message, this.response);
|
2743
|
+
}
|
2744
|
+
};
|
2745
|
+
|
2075
2746
|
// src/services/purchases/models/get-purchase-consumption-ok-response.ts
|
2076
|
-
import { z as
|
2077
|
-
var getPurchaseConsumptionOkResponse =
|
2078
|
-
return
|
2079
|
-
dataUsageRemainingInBytes:
|
2080
|
-
status:
|
2747
|
+
import { z as z42 } from "zod";
|
2748
|
+
var getPurchaseConsumptionOkResponse = z42.lazy(() => {
|
2749
|
+
return z42.object({
|
2750
|
+
dataUsageRemainingInBytes: z42.number().optional(),
|
2751
|
+
status: z42.string().optional()
|
2081
2752
|
});
|
2082
2753
|
});
|
2083
|
-
var getPurchaseConsumptionOkResponseResponse =
|
2084
|
-
return
|
2085
|
-
dataUsageRemainingInBytes:
|
2086
|
-
status:
|
2754
|
+
var getPurchaseConsumptionOkResponseResponse = z42.lazy(() => {
|
2755
|
+
return z42.object({
|
2756
|
+
dataUsageRemainingInBytes: z42.number().optional(),
|
2757
|
+
status: z42.string().optional()
|
2087
2758
|
}).transform((data) => ({
|
2088
2759
|
dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
|
2089
2760
|
status: data["status"]
|
2090
2761
|
}));
|
2091
2762
|
});
|
2092
|
-
var getPurchaseConsumptionOkResponseRequest =
|
2093
|
-
return
|
2763
|
+
var getPurchaseConsumptionOkResponseRequest = z42.lazy(() => {
|
2764
|
+
return z42.object({
|
2765
|
+
dataUsageRemainingInBytes: z42.number().optional(),
|
2766
|
+
status: z42.string().optional()
|
2767
|
+
}).transform((data) => ({
|
2094
2768
|
dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
|
2095
2769
|
status: data["status"]
|
2096
2770
|
}));
|
2097
2771
|
});
|
2098
2772
|
|
2099
|
-
// src/services/purchases/
|
2773
|
+
// src/services/purchases/models/_14.ts
|
2774
|
+
import { z as z43 } from "zod";
|
2775
|
+
var _14Response = z43.lazy(() => {
|
2776
|
+
return z43.object({
|
2777
|
+
message: z43.string().optional()
|
2778
|
+
}).transform((data) => ({
|
2779
|
+
message: data["message"]
|
2780
|
+
}));
|
2781
|
+
});
|
2782
|
+
var _14 = class extends ThrowableError {
|
2783
|
+
constructor(message, response) {
|
2784
|
+
super(message);
|
2785
|
+
this.message = message;
|
2786
|
+
this.response = response;
|
2787
|
+
const parsedResponse = _14Response.parse(response);
|
2788
|
+
this.message = parsedResponse.message || "";
|
2789
|
+
}
|
2790
|
+
throw() {
|
2791
|
+
throw new _14(this.message, this.response);
|
2792
|
+
}
|
2793
|
+
};
|
2794
|
+
|
2795
|
+
// src/services/purchases/models/_15.ts
|
2796
|
+
import { z as z44 } from "zod";
|
2797
|
+
var _15Response = z44.lazy(() => {
|
2798
|
+
return z44.object({
|
2799
|
+
message: z44.string().optional()
|
2800
|
+
}).transform((data) => ({
|
2801
|
+
message: data["message"]
|
2802
|
+
}));
|
2803
|
+
});
|
2804
|
+
var _15 = class extends ThrowableError {
|
2805
|
+
constructor(message, response) {
|
2806
|
+
super(message);
|
2807
|
+
this.message = message;
|
2808
|
+
this.response = response;
|
2809
|
+
const parsedResponse = _15Response.parse(response);
|
2810
|
+
this.message = parsedResponse.message || "";
|
2811
|
+
}
|
2812
|
+
throw() {
|
2813
|
+
throw new _15(this.message, this.response);
|
2814
|
+
}
|
2815
|
+
};
|
2816
|
+
|
2817
|
+
// src/services/purchases/purchases-service.ts
|
2100
2818
|
var PurchasesService = class extends BaseService {
|
2819
|
+
/**
|
2820
|
+
* This endpoint is used to purchase a new eSIM by providing the package details.
|
2821
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2822
|
+
* @returns {Promise<HttpResponse<CreatePurchaseV2OkResponse[]>>} Successful Response
|
2823
|
+
*/
|
2824
|
+
async createPurchaseV2(body, requestConfig) {
|
2825
|
+
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({
|
2826
|
+
schema: z45.array(createPurchaseV2OkResponseResponse),
|
2827
|
+
contentType: "json" /* Json */,
|
2828
|
+
status: 200
|
2829
|
+
}).addError({
|
2830
|
+
error: _4,
|
2831
|
+
contentType: "json" /* Json */,
|
2832
|
+
status: 400
|
2833
|
+
}).addError({
|
2834
|
+
error: _5,
|
2835
|
+
contentType: "json" /* Json */,
|
2836
|
+
status: 401
|
2837
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2838
|
+
return this.client.call(request);
|
2839
|
+
}
|
2101
2840
|
/**
|
2102
2841
|
* This endpoint can be used to list all the successful purchases made between a given interval.
|
2103
|
-
* @param {string} [iccid] - ID of the eSIM
|
2104
|
-
* @param {string} [afterDate] - Start date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2105
|
-
* @param {string} [beforeDate] - End date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2106
|
-
* @param {string} [referenceId] - The referenceId that was provided by the partner during the purchase or topup flow.
|
2107
|
-
* @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.
|
2108
|
-
* @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
|
2109
|
-
* @param {number} [after] - Epoch value representing the start of the time interval for filtering purchases
|
2110
|
-
* @param {number} [before] - Epoch value representing the end of the time interval for filtering purchases
|
2842
|
+
* @param {string} [params.iccid] - ID of the eSIM
|
2843
|
+
* @param {string} [params.afterDate] - Start date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2844
|
+
* @param {string} [params.beforeDate] - End date of the interval for filtering purchases in the format 'yyyy-MM-dd'
|
2845
|
+
* @param {string} [params.referenceId] - The referenceId that was provided by the partner during the purchase or topup flow.
|
2846
|
+
* @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.
|
2847
|
+
* @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
|
2848
|
+
* @param {number} [params.after] - Epoch value representing the start of the time interval for filtering purchases
|
2849
|
+
* @param {number} [params.before] - Epoch value representing the end of the time interval for filtering purchases
|
2850
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2111
2851
|
* @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} Successful Response
|
2112
2852
|
*/
|
2113
2853
|
async listPurchases(params, requestConfig) {
|
2114
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(
|
2854
|
+
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(z45.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2115
2855
|
schema: listPurchasesOkResponseResponse,
|
2116
2856
|
contentType: "json" /* Json */,
|
2117
2857
|
status: 200
|
2858
|
+
}).addError({
|
2859
|
+
error: _6,
|
2860
|
+
contentType: "json" /* Json */,
|
2861
|
+
status: 400
|
2862
|
+
}).addError({
|
2863
|
+
error: _7,
|
2864
|
+
contentType: "json" /* Json */,
|
2865
|
+
status: 401
|
2118
2866
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
|
2119
2867
|
key: "iccid",
|
2120
2868
|
value: params == null ? void 0 : params.iccid
|
@@ -2144,50 +2892,86 @@ var PurchasesService = class extends BaseService {
|
|
2144
2892
|
}
|
2145
2893
|
/**
|
2146
2894
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
2895
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2147
2896
|
* @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} Successful Response
|
2148
2897
|
*/
|
2149
2898
|
async createPurchase(body, requestConfig) {
|
2150
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2899
|
+
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({
|
2151
2900
|
schema: createPurchaseOkResponseResponse,
|
2152
2901
|
contentType: "json" /* Json */,
|
2153
2902
|
status: 200
|
2903
|
+
}).addError({
|
2904
|
+
error: _8,
|
2905
|
+
contentType: "json" /* Json */,
|
2906
|
+
status: 400
|
2907
|
+
}).addError({
|
2908
|
+
error: _9,
|
2909
|
+
contentType: "json" /* Json */,
|
2910
|
+
status: 401
|
2154
2911
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2155
2912
|
return this.client.call(request);
|
2156
2913
|
}
|
2157
2914
|
/**
|
2158
|
-
* 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
|
2915
|
+
* 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.
|
2916
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2159
2917
|
* @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
|
2160
2918
|
*/
|
2161
2919
|
async topUpEsim(body, requestConfig) {
|
2162
|
-
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({
|
2920
|
+
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({
|
2163
2921
|
schema: topUpEsimOkResponseResponse,
|
2164
2922
|
contentType: "json" /* Json */,
|
2165
2923
|
status: 200
|
2924
|
+
}).addError({
|
2925
|
+
error: _10,
|
2926
|
+
contentType: "json" /* Json */,
|
2927
|
+
status: 400
|
2928
|
+
}).addError({
|
2929
|
+
error: _11,
|
2930
|
+
contentType: "json" /* Json */,
|
2931
|
+
status: 401
|
2166
2932
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2167
2933
|
return this.client.call(request);
|
2168
2934
|
}
|
2169
2935
|
/**
|
2170
|
-
* 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.
|
2936
|
+
* 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.
|
2937
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2171
2938
|
* @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
|
2172
2939
|
*/
|
2173
2940
|
async editPurchase(body, requestConfig) {
|
2174
|
-
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({
|
2941
|
+
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({
|
2175
2942
|
schema: editPurchaseOkResponseResponse,
|
2176
2943
|
contentType: "json" /* Json */,
|
2177
2944
|
status: 200
|
2945
|
+
}).addError({
|
2946
|
+
error: _12,
|
2947
|
+
contentType: "json" /* Json */,
|
2948
|
+
status: 400
|
2949
|
+
}).addError({
|
2950
|
+
error: _13,
|
2951
|
+
contentType: "json" /* Json */,
|
2952
|
+
status: 401
|
2178
2953
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
2179
2954
|
return this.client.call(request);
|
2180
2955
|
}
|
2181
2956
|
/**
|
2182
2957
|
* 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.
|
2183
2958
|
* @param {string} purchaseId - ID of the purchase
|
2959
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2184
2960
|
* @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} Successful Response
|
2185
2961
|
*/
|
2186
2962
|
async getPurchaseConsumption(purchaseId, requestConfig) {
|
2187
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(
|
2963
|
+
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(z45.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2188
2964
|
schema: getPurchaseConsumptionOkResponseResponse,
|
2189
2965
|
contentType: "json" /* Json */,
|
2190
2966
|
status: 200
|
2967
|
+
}).addError({
|
2968
|
+
error: _14,
|
2969
|
+
contentType: "json" /* Json */,
|
2970
|
+
status: 400
|
2971
|
+
}).addError({
|
2972
|
+
error: _15,
|
2973
|
+
contentType: "json" /* Json */,
|
2974
|
+
status: 401
|
2191
2975
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2192
2976
|
key: "purchaseId",
|
2193
2977
|
value: purchaseId
|
@@ -2196,28 +2980,28 @@ var PurchasesService = class extends BaseService {
|
|
2196
2980
|
}
|
2197
2981
|
};
|
2198
2982
|
|
2199
|
-
// src/services/e-sim/e-sim.ts
|
2200
|
-
import { z as
|
2983
|
+
// src/services/e-sim/e-sim-service.ts
|
2984
|
+
import { z as z63 } from "zod";
|
2201
2985
|
|
2202
2986
|
// src/services/e-sim/models/get-esim-ok-response.ts
|
2203
|
-
import { z as
|
2987
|
+
import { z as z47 } from "zod";
|
2204
2988
|
|
2205
2989
|
// src/services/e-sim/models/get-esim-ok-response-esim.ts
|
2206
|
-
import { z as
|
2207
|
-
var getEsimOkResponseEsim =
|
2208
|
-
return
|
2209
|
-
iccid:
|
2210
|
-
smdpAddress:
|
2211
|
-
manualActivationCode:
|
2212
|
-
status:
|
2990
|
+
import { z as z46 } from "zod";
|
2991
|
+
var getEsimOkResponseEsim = z46.lazy(() => {
|
2992
|
+
return z46.object({
|
2993
|
+
iccid: z46.string().min(18).max(22).optional(),
|
2994
|
+
smdpAddress: z46.string().optional(),
|
2995
|
+
manualActivationCode: z46.string().optional(),
|
2996
|
+
status: z46.string().optional()
|
2213
2997
|
});
|
2214
2998
|
});
|
2215
|
-
var getEsimOkResponseEsimResponse =
|
2216
|
-
return
|
2217
|
-
iccid:
|
2218
|
-
smdpAddress:
|
2219
|
-
manualActivationCode:
|
2220
|
-
status:
|
2999
|
+
var getEsimOkResponseEsimResponse = z46.lazy(() => {
|
3000
|
+
return z46.object({
|
3001
|
+
iccid: z46.string().min(18).max(22).optional(),
|
3002
|
+
smdpAddress: z46.string().optional(),
|
3003
|
+
manualActivationCode: z46.string().optional(),
|
3004
|
+
status: z46.string().optional()
|
2221
3005
|
}).transform((data) => ({
|
2222
3006
|
iccid: data["iccid"],
|
2223
3007
|
smdpAddress: data["smdpAddress"],
|
@@ -2225,12 +3009,12 @@ var getEsimOkResponseEsimResponse = z26.lazy(() => {
|
|
2225
3009
|
status: data["status"]
|
2226
3010
|
}));
|
2227
3011
|
});
|
2228
|
-
var getEsimOkResponseEsimRequest =
|
2229
|
-
return
|
2230
|
-
iccid:
|
2231
|
-
smdpAddress:
|
2232
|
-
manualActivationCode:
|
2233
|
-
status:
|
3012
|
+
var getEsimOkResponseEsimRequest = z46.lazy(() => {
|
3013
|
+
return z46.object({
|
3014
|
+
iccid: z46.string().min(18).max(22).optional(),
|
3015
|
+
smdpAddress: z46.string().optional(),
|
3016
|
+
manualActivationCode: z46.string().optional(),
|
3017
|
+
status: z46.string().optional()
|
2234
3018
|
}).transform((data) => ({
|
2235
3019
|
iccid: data["iccid"],
|
2236
3020
|
smdpAddress: data["smdpAddress"],
|
@@ -2240,43 +3024,89 @@ var getEsimOkResponseEsimRequest = z26.lazy(() => {
|
|
2240
3024
|
});
|
2241
3025
|
|
2242
3026
|
// src/services/e-sim/models/get-esim-ok-response.ts
|
2243
|
-
var getEsimOkResponse =
|
2244
|
-
return
|
3027
|
+
var getEsimOkResponse = z47.lazy(() => {
|
3028
|
+
return z47.object({
|
2245
3029
|
esim: getEsimOkResponseEsim.optional()
|
2246
3030
|
});
|
2247
3031
|
});
|
2248
|
-
var getEsimOkResponseResponse =
|
2249
|
-
return
|
3032
|
+
var getEsimOkResponseResponse = z47.lazy(() => {
|
3033
|
+
return z47.object({
|
2250
3034
|
esim: getEsimOkResponseEsimResponse.optional()
|
2251
3035
|
}).transform((data) => ({
|
2252
3036
|
esim: data["esim"]
|
2253
3037
|
}));
|
2254
3038
|
});
|
2255
|
-
var getEsimOkResponseRequest =
|
2256
|
-
return
|
3039
|
+
var getEsimOkResponseRequest = z47.lazy(() => {
|
3040
|
+
return z47.object({
|
3041
|
+
esim: getEsimOkResponseEsimRequest.optional()
|
3042
|
+
}).transform((data) => ({
|
2257
3043
|
esim: data["esim"]
|
2258
3044
|
}));
|
2259
3045
|
});
|
2260
3046
|
|
3047
|
+
// src/services/e-sim/models/_16.ts
|
3048
|
+
import { z as z48 } from "zod";
|
3049
|
+
var _16Response = z48.lazy(() => {
|
3050
|
+
return z48.object({
|
3051
|
+
message: z48.string().optional()
|
3052
|
+
}).transform((data) => ({
|
3053
|
+
message: data["message"]
|
3054
|
+
}));
|
3055
|
+
});
|
3056
|
+
var _16 = class extends ThrowableError {
|
3057
|
+
constructor(message, response) {
|
3058
|
+
super(message);
|
3059
|
+
this.message = message;
|
3060
|
+
this.response = response;
|
3061
|
+
const parsedResponse = _16Response.parse(response);
|
3062
|
+
this.message = parsedResponse.message || "";
|
3063
|
+
}
|
3064
|
+
throw() {
|
3065
|
+
throw new _16(this.message, this.response);
|
3066
|
+
}
|
3067
|
+
};
|
3068
|
+
|
3069
|
+
// src/services/e-sim/models/_17.ts
|
3070
|
+
import { z as z49 } from "zod";
|
3071
|
+
var _17Response = z49.lazy(() => {
|
3072
|
+
return z49.object({
|
3073
|
+
message: z49.string().optional()
|
3074
|
+
}).transform((data) => ({
|
3075
|
+
message: data["message"]
|
3076
|
+
}));
|
3077
|
+
});
|
3078
|
+
var _17 = class extends ThrowableError {
|
3079
|
+
constructor(message, response) {
|
3080
|
+
super(message);
|
3081
|
+
this.message = message;
|
3082
|
+
this.response = response;
|
3083
|
+
const parsedResponse = _17Response.parse(response);
|
3084
|
+
this.message = parsedResponse.message || "";
|
3085
|
+
}
|
3086
|
+
throw() {
|
3087
|
+
throw new _17(this.message, this.response);
|
3088
|
+
}
|
3089
|
+
};
|
3090
|
+
|
2261
3091
|
// src/services/e-sim/models/get-esim-device-ok-response.ts
|
2262
|
-
import { z as
|
3092
|
+
import { z as z51 } from "zod";
|
2263
3093
|
|
2264
3094
|
// src/services/e-sim/models/device.ts
|
2265
|
-
import { z as
|
2266
|
-
var device =
|
2267
|
-
return
|
2268
|
-
oem:
|
2269
|
-
hardwareName:
|
2270
|
-
hardwareModel:
|
2271
|
-
eid:
|
3095
|
+
import { z as z50 } from "zod";
|
3096
|
+
var device = z50.lazy(() => {
|
3097
|
+
return z50.object({
|
3098
|
+
oem: z50.string().optional(),
|
3099
|
+
hardwareName: z50.string().optional(),
|
3100
|
+
hardwareModel: z50.string().optional(),
|
3101
|
+
eid: z50.string().optional()
|
2272
3102
|
});
|
2273
3103
|
});
|
2274
|
-
var deviceResponse =
|
2275
|
-
return
|
2276
|
-
oem:
|
2277
|
-
hardwareName:
|
2278
|
-
hardwareModel:
|
2279
|
-
eid:
|
3104
|
+
var deviceResponse = z50.lazy(() => {
|
3105
|
+
return z50.object({
|
3106
|
+
oem: z50.string().optional(),
|
3107
|
+
hardwareName: z50.string().optional(),
|
3108
|
+
hardwareModel: z50.string().optional(),
|
3109
|
+
eid: z50.string().optional()
|
2280
3110
|
}).transform((data) => ({
|
2281
3111
|
oem: data["oem"],
|
2282
3112
|
hardwareName: data["hardwareName"],
|
@@ -2284,12 +3114,12 @@ var deviceResponse = z28.lazy(() => {
|
|
2284
3114
|
eid: data["eid"]
|
2285
3115
|
}));
|
2286
3116
|
});
|
2287
|
-
var deviceRequest =
|
2288
|
-
return
|
2289
|
-
oem:
|
2290
|
-
hardwareName:
|
2291
|
-
hardwareModel:
|
2292
|
-
eid:
|
3117
|
+
var deviceRequest = z50.lazy(() => {
|
3118
|
+
return z50.object({
|
3119
|
+
oem: z50.string().optional(),
|
3120
|
+
hardwareName: z50.string().optional(),
|
3121
|
+
hardwareModel: z50.string().optional(),
|
3122
|
+
eid: z50.string().optional()
|
2293
3123
|
}).transform((data) => ({
|
2294
3124
|
oem: data["oem"],
|
2295
3125
|
hardwareName: data["hardwareName"],
|
@@ -2299,52 +3129,102 @@ var deviceRequest = z28.lazy(() => {
|
|
2299
3129
|
});
|
2300
3130
|
|
2301
3131
|
// src/services/e-sim/models/get-esim-device-ok-response.ts
|
2302
|
-
var getEsimDeviceOkResponse =
|
2303
|
-
return
|
3132
|
+
var getEsimDeviceOkResponse = z51.lazy(() => {
|
3133
|
+
return z51.object({
|
2304
3134
|
device: device.optional()
|
2305
3135
|
});
|
2306
3136
|
});
|
2307
|
-
var getEsimDeviceOkResponseResponse =
|
2308
|
-
return
|
3137
|
+
var getEsimDeviceOkResponseResponse = z51.lazy(() => {
|
3138
|
+
return z51.object({
|
2309
3139
|
device: deviceResponse.optional()
|
2310
3140
|
}).transform((data) => ({
|
2311
3141
|
device: data["device"]
|
2312
3142
|
}));
|
2313
3143
|
});
|
2314
|
-
var getEsimDeviceOkResponseRequest =
|
2315
|
-
return
|
3144
|
+
var getEsimDeviceOkResponseRequest = z51.lazy(() => {
|
3145
|
+
return z51.object({
|
3146
|
+
device: deviceRequest.optional()
|
3147
|
+
}).transform((data) => ({
|
2316
3148
|
device: data["device"]
|
2317
3149
|
}));
|
2318
3150
|
});
|
2319
3151
|
|
3152
|
+
// src/services/e-sim/models/_18.ts
|
3153
|
+
import { z as z52 } from "zod";
|
3154
|
+
var _18Response = z52.lazy(() => {
|
3155
|
+
return z52.object({
|
3156
|
+
message: z52.string().optional()
|
3157
|
+
}).transform((data) => ({
|
3158
|
+
message: data["message"]
|
3159
|
+
}));
|
3160
|
+
});
|
3161
|
+
var _18 = class extends ThrowableError {
|
3162
|
+
constructor(message, response) {
|
3163
|
+
super(message);
|
3164
|
+
this.message = message;
|
3165
|
+
this.response = response;
|
3166
|
+
const parsedResponse = _18Response.parse(response);
|
3167
|
+
this.message = parsedResponse.message || "";
|
3168
|
+
}
|
3169
|
+
throw() {
|
3170
|
+
throw new _18(this.message, this.response);
|
3171
|
+
}
|
3172
|
+
};
|
3173
|
+
|
3174
|
+
// src/services/e-sim/models/_19.ts
|
3175
|
+
import { z as z53 } from "zod";
|
3176
|
+
var _19Response = z53.lazy(() => {
|
3177
|
+
return z53.object({
|
3178
|
+
message: z53.string().optional()
|
3179
|
+
}).transform((data) => ({
|
3180
|
+
message: data["message"]
|
3181
|
+
}));
|
3182
|
+
});
|
3183
|
+
var _19 = class extends ThrowableError {
|
3184
|
+
constructor(message, response) {
|
3185
|
+
super(message);
|
3186
|
+
this.message = message;
|
3187
|
+
this.response = response;
|
3188
|
+
const parsedResponse = _19Response.parse(response);
|
3189
|
+
this.message = parsedResponse.message || "";
|
3190
|
+
}
|
3191
|
+
throw() {
|
3192
|
+
throw new _19(this.message, this.response);
|
3193
|
+
}
|
3194
|
+
};
|
3195
|
+
|
2320
3196
|
// src/services/e-sim/models/get-esim-history-ok-response.ts
|
2321
|
-
import { z as
|
3197
|
+
import { z as z56 } from "zod";
|
2322
3198
|
|
2323
3199
|
// src/services/e-sim/models/get-esim-history-ok-response-esim.ts
|
2324
|
-
import { z as
|
3200
|
+
import { z as z55 } from "zod";
|
2325
3201
|
|
2326
3202
|
// src/services/e-sim/models/history.ts
|
2327
|
-
import { z as
|
2328
|
-
var history =
|
2329
|
-
return
|
2330
|
-
status:
|
2331
|
-
statusDate:
|
2332
|
-
date:
|
3203
|
+
import { z as z54 } from "zod";
|
3204
|
+
var history = z54.lazy(() => {
|
3205
|
+
return z54.object({
|
3206
|
+
status: z54.string().optional(),
|
3207
|
+
statusDate: z54.string().optional(),
|
3208
|
+
date: z54.number().optional()
|
2333
3209
|
});
|
2334
3210
|
});
|
2335
|
-
var historyResponse =
|
2336
|
-
return
|
2337
|
-
status:
|
2338
|
-
statusDate:
|
2339
|
-
date:
|
3211
|
+
var historyResponse = z54.lazy(() => {
|
3212
|
+
return z54.object({
|
3213
|
+
status: z54.string().optional(),
|
3214
|
+
statusDate: z54.string().optional(),
|
3215
|
+
date: z54.number().optional()
|
2340
3216
|
}).transform((data) => ({
|
2341
3217
|
status: data["status"],
|
2342
3218
|
statusDate: data["statusDate"],
|
2343
3219
|
date: data["date"]
|
2344
3220
|
}));
|
2345
3221
|
});
|
2346
|
-
var historyRequest =
|
2347
|
-
return
|
3222
|
+
var historyRequest = z54.lazy(() => {
|
3223
|
+
return z54.object({
|
3224
|
+
status: z54.string().optional(),
|
3225
|
+
statusDate: z54.string().optional(),
|
3226
|
+
date: z54.number().optional()
|
3227
|
+
}).transform((data) => ({
|
2348
3228
|
status: data["status"],
|
2349
3229
|
statusDate: data["statusDate"],
|
2350
3230
|
date: data["date"]
|
@@ -2352,75 +3232,124 @@ var historyRequest = z30.lazy(() => {
|
|
2352
3232
|
});
|
2353
3233
|
|
2354
3234
|
// src/services/e-sim/models/get-esim-history-ok-response-esim.ts
|
2355
|
-
var getEsimHistoryOkResponseEsim =
|
2356
|
-
return
|
2357
|
-
iccid:
|
2358
|
-
history:
|
3235
|
+
var getEsimHistoryOkResponseEsim = z55.lazy(() => {
|
3236
|
+
return z55.object({
|
3237
|
+
iccid: z55.string().min(18).max(22).optional(),
|
3238
|
+
history: z55.array(history).optional()
|
2359
3239
|
});
|
2360
3240
|
});
|
2361
|
-
var getEsimHistoryOkResponseEsimResponse =
|
2362
|
-
return
|
2363
|
-
iccid:
|
2364
|
-
history:
|
3241
|
+
var getEsimHistoryOkResponseEsimResponse = z55.lazy(() => {
|
3242
|
+
return z55.object({
|
3243
|
+
iccid: z55.string().min(18).max(22).optional(),
|
3244
|
+
history: z55.array(historyResponse).optional()
|
2365
3245
|
}).transform((data) => ({
|
2366
3246
|
iccid: data["iccid"],
|
2367
3247
|
history: data["history"]
|
2368
3248
|
}));
|
2369
3249
|
});
|
2370
|
-
var getEsimHistoryOkResponseEsimRequest =
|
2371
|
-
return
|
3250
|
+
var getEsimHistoryOkResponseEsimRequest = z55.lazy(() => {
|
3251
|
+
return z55.object({
|
3252
|
+
iccid: z55.string().min(18).max(22).optional(),
|
3253
|
+
history: z55.array(historyRequest).optional()
|
3254
|
+
}).transform((data) => ({
|
2372
3255
|
iccid: data["iccid"],
|
2373
3256
|
history: data["history"]
|
2374
3257
|
}));
|
2375
3258
|
});
|
2376
3259
|
|
2377
3260
|
// src/services/e-sim/models/get-esim-history-ok-response.ts
|
2378
|
-
var getEsimHistoryOkResponse =
|
2379
|
-
return
|
3261
|
+
var getEsimHistoryOkResponse = z56.lazy(() => {
|
3262
|
+
return z56.object({
|
2380
3263
|
esim: getEsimHistoryOkResponseEsim.optional()
|
2381
3264
|
});
|
2382
3265
|
});
|
2383
|
-
var getEsimHistoryOkResponseResponse =
|
2384
|
-
return
|
3266
|
+
var getEsimHistoryOkResponseResponse = z56.lazy(() => {
|
3267
|
+
return z56.object({
|
2385
3268
|
esim: getEsimHistoryOkResponseEsimResponse.optional()
|
2386
3269
|
}).transform((data) => ({
|
2387
3270
|
esim: data["esim"]
|
2388
3271
|
}));
|
2389
3272
|
});
|
2390
|
-
var getEsimHistoryOkResponseRequest =
|
2391
|
-
return
|
3273
|
+
var getEsimHistoryOkResponseRequest = z56.lazy(() => {
|
3274
|
+
return z56.object({
|
3275
|
+
esim: getEsimHistoryOkResponseEsimRequest.optional()
|
3276
|
+
}).transform((data) => ({
|
2392
3277
|
esim: data["esim"]
|
2393
3278
|
}));
|
2394
3279
|
});
|
2395
3280
|
|
3281
|
+
// src/services/e-sim/models/_20.ts
|
3282
|
+
import { z as z57 } from "zod";
|
3283
|
+
var _20Response = z57.lazy(() => {
|
3284
|
+
return z57.object({
|
3285
|
+
message: z57.string().optional()
|
3286
|
+
}).transform((data) => ({
|
3287
|
+
message: data["message"]
|
3288
|
+
}));
|
3289
|
+
});
|
3290
|
+
var _20 = class extends ThrowableError {
|
3291
|
+
constructor(message, response) {
|
3292
|
+
super(message);
|
3293
|
+
this.message = message;
|
3294
|
+
this.response = response;
|
3295
|
+
const parsedResponse = _20Response.parse(response);
|
3296
|
+
this.message = parsedResponse.message || "";
|
3297
|
+
}
|
3298
|
+
throw() {
|
3299
|
+
throw new _20(this.message, this.response);
|
3300
|
+
}
|
3301
|
+
};
|
3302
|
+
|
3303
|
+
// src/services/e-sim/models/_21.ts
|
3304
|
+
import { z as z58 } from "zod";
|
3305
|
+
var _21Response = z58.lazy(() => {
|
3306
|
+
return z58.object({
|
3307
|
+
message: z58.string().optional()
|
3308
|
+
}).transform((data) => ({
|
3309
|
+
message: data["message"]
|
3310
|
+
}));
|
3311
|
+
});
|
3312
|
+
var _21 = class extends ThrowableError {
|
3313
|
+
constructor(message, response) {
|
3314
|
+
super(message);
|
3315
|
+
this.message = message;
|
3316
|
+
this.response = response;
|
3317
|
+
const parsedResponse = _21Response.parse(response);
|
3318
|
+
this.message = parsedResponse.message || "";
|
3319
|
+
}
|
3320
|
+
throw() {
|
3321
|
+
throw new _21(this.message, this.response);
|
3322
|
+
}
|
3323
|
+
};
|
3324
|
+
|
2396
3325
|
// src/services/e-sim/models/get-esim-mac-ok-response.ts
|
2397
|
-
import { z as
|
3326
|
+
import { z as z60 } from "zod";
|
2398
3327
|
|
2399
3328
|
// src/services/e-sim/models/get-esim-mac-ok-response-esim.ts
|
2400
|
-
import { z as
|
2401
|
-
var getEsimMacOkResponseEsim =
|
2402
|
-
return
|
2403
|
-
iccid:
|
2404
|
-
smdpAddress:
|
2405
|
-
manualActivationCode:
|
3329
|
+
import { z as z59 } from "zod";
|
3330
|
+
var getEsimMacOkResponseEsim = z59.lazy(() => {
|
3331
|
+
return z59.object({
|
3332
|
+
iccid: z59.string().min(18).max(22).optional(),
|
3333
|
+
smdpAddress: z59.string().optional(),
|
3334
|
+
manualActivationCode: z59.string().optional()
|
2406
3335
|
});
|
2407
3336
|
});
|
2408
|
-
var getEsimMacOkResponseEsimResponse =
|
2409
|
-
return
|
2410
|
-
iccid:
|
2411
|
-
smdpAddress:
|
2412
|
-
manualActivationCode:
|
3337
|
+
var getEsimMacOkResponseEsimResponse = z59.lazy(() => {
|
3338
|
+
return z59.object({
|
3339
|
+
iccid: z59.string().min(18).max(22).optional(),
|
3340
|
+
smdpAddress: z59.string().optional(),
|
3341
|
+
manualActivationCode: z59.string().optional()
|
2413
3342
|
}).transform((data) => ({
|
2414
3343
|
iccid: data["iccid"],
|
2415
3344
|
smdpAddress: data["smdpAddress"],
|
2416
3345
|
manualActivationCode: data["manualActivationCode"]
|
2417
3346
|
}));
|
2418
3347
|
});
|
2419
|
-
var getEsimMacOkResponseEsimRequest =
|
2420
|
-
return
|
2421
|
-
iccid:
|
2422
|
-
smdpAddress:
|
2423
|
-
manualActivationCode:
|
3348
|
+
var getEsimMacOkResponseEsimRequest = z59.lazy(() => {
|
3349
|
+
return z59.object({
|
3350
|
+
iccid: z59.string().min(18).max(22).optional(),
|
3351
|
+
smdpAddress: z59.string().optional(),
|
3352
|
+
manualActivationCode: z59.string().optional()
|
2424
3353
|
}).transform((data) => ({
|
2425
3354
|
iccid: data["iccid"],
|
2426
3355
|
smdpAddress: data["smdpAddress"],
|
@@ -2429,36 +3358,91 @@ var getEsimMacOkResponseEsimRequest = z33.lazy(() => {
|
|
2429
3358
|
});
|
2430
3359
|
|
2431
3360
|
// src/services/e-sim/models/get-esim-mac-ok-response.ts
|
2432
|
-
var getEsimMacOkResponse =
|
2433
|
-
return
|
3361
|
+
var getEsimMacOkResponse = z60.lazy(() => {
|
3362
|
+
return z60.object({
|
2434
3363
|
esim: getEsimMacOkResponseEsim.optional()
|
2435
3364
|
});
|
2436
3365
|
});
|
2437
|
-
var getEsimMacOkResponseResponse =
|
2438
|
-
return
|
3366
|
+
var getEsimMacOkResponseResponse = z60.lazy(() => {
|
3367
|
+
return z60.object({
|
2439
3368
|
esim: getEsimMacOkResponseEsimResponse.optional()
|
2440
3369
|
}).transform((data) => ({
|
2441
3370
|
esim: data["esim"]
|
2442
3371
|
}));
|
2443
3372
|
});
|
2444
|
-
var getEsimMacOkResponseRequest =
|
2445
|
-
return
|
3373
|
+
var getEsimMacOkResponseRequest = z60.lazy(() => {
|
3374
|
+
return z60.object({
|
3375
|
+
esim: getEsimMacOkResponseEsimRequest.optional()
|
3376
|
+
}).transform((data) => ({
|
2446
3377
|
esim: data["esim"]
|
2447
3378
|
}));
|
2448
3379
|
});
|
2449
3380
|
|
2450
|
-
// src/services/e-sim/
|
3381
|
+
// src/services/e-sim/models/_22.ts
|
3382
|
+
import { z as z61 } from "zod";
|
3383
|
+
var _22Response = z61.lazy(() => {
|
3384
|
+
return z61.object({
|
3385
|
+
message: z61.string().optional()
|
3386
|
+
}).transform((data) => ({
|
3387
|
+
message: data["message"]
|
3388
|
+
}));
|
3389
|
+
});
|
3390
|
+
var _22 = class extends ThrowableError {
|
3391
|
+
constructor(message, response) {
|
3392
|
+
super(message);
|
3393
|
+
this.message = message;
|
3394
|
+
this.response = response;
|
3395
|
+
const parsedResponse = _22Response.parse(response);
|
3396
|
+
this.message = parsedResponse.message || "";
|
3397
|
+
}
|
3398
|
+
throw() {
|
3399
|
+
throw new _22(this.message, this.response);
|
3400
|
+
}
|
3401
|
+
};
|
3402
|
+
|
3403
|
+
// src/services/e-sim/models/_23.ts
|
3404
|
+
import { z as z62 } from "zod";
|
3405
|
+
var _23Response = z62.lazy(() => {
|
3406
|
+
return z62.object({
|
3407
|
+
message: z62.string().optional()
|
3408
|
+
}).transform((data) => ({
|
3409
|
+
message: data["message"]
|
3410
|
+
}));
|
3411
|
+
});
|
3412
|
+
var _23 = class extends ThrowableError {
|
3413
|
+
constructor(message, response) {
|
3414
|
+
super(message);
|
3415
|
+
this.message = message;
|
3416
|
+
this.response = response;
|
3417
|
+
const parsedResponse = _23Response.parse(response);
|
3418
|
+
this.message = parsedResponse.message || "";
|
3419
|
+
}
|
3420
|
+
throw() {
|
3421
|
+
throw new _23(this.message, this.response);
|
3422
|
+
}
|
3423
|
+
};
|
3424
|
+
|
3425
|
+
// src/services/e-sim/e-sim-service.ts
|
2451
3426
|
var ESimService = class extends BaseService {
|
2452
3427
|
/**
|
2453
3428
|
* Get eSIM Status
|
2454
3429
|
* @param {string} iccid - ID of the eSIM
|
3430
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2455
3431
|
* @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
|
2456
3432
|
*/
|
2457
3433
|
async getEsim(params, requestConfig) {
|
2458
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(
|
3434
|
+
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(z63.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2459
3435
|
schema: getEsimOkResponseResponse,
|
2460
3436
|
contentType: "json" /* Json */,
|
2461
3437
|
status: 200
|
3438
|
+
}).addError({
|
3439
|
+
error: _16,
|
3440
|
+
contentType: "json" /* Json */,
|
3441
|
+
status: 400
|
3442
|
+
}).addError({
|
3443
|
+
error: _17,
|
3444
|
+
contentType: "json" /* Json */,
|
3445
|
+
status: 401
|
2462
3446
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
|
2463
3447
|
key: "iccid",
|
2464
3448
|
value: params == null ? void 0 : params.iccid
|
@@ -2468,13 +3452,22 @@ var ESimService = class extends BaseService {
|
|
2468
3452
|
/**
|
2469
3453
|
* Get eSIM Device
|
2470
3454
|
* @param {string} iccid - ID of the eSIM
|
3455
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2471
3456
|
* @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
|
2472
3457
|
*/
|
2473
3458
|
async getEsimDevice(iccid, requestConfig) {
|
2474
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(
|
3459
|
+
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(z63.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2475
3460
|
schema: getEsimDeviceOkResponseResponse,
|
2476
3461
|
contentType: "json" /* Json */,
|
2477
3462
|
status: 200
|
3463
|
+
}).addError({
|
3464
|
+
error: _18,
|
3465
|
+
contentType: "json" /* Json */,
|
3466
|
+
status: 400
|
3467
|
+
}).addError({
|
3468
|
+
error: _19,
|
3469
|
+
contentType: "json" /* Json */,
|
3470
|
+
status: 401
|
2478
3471
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2479
3472
|
key: "iccid",
|
2480
3473
|
value: iccid
|
@@ -2484,13 +3477,22 @@ var ESimService = class extends BaseService {
|
|
2484
3477
|
/**
|
2485
3478
|
* Get eSIM History
|
2486
3479
|
* @param {string} iccid - ID of the eSIM
|
3480
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2487
3481
|
* @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
|
2488
3482
|
*/
|
2489
3483
|
async getEsimHistory(iccid, requestConfig) {
|
2490
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(
|
3484
|
+
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(z63.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2491
3485
|
schema: getEsimHistoryOkResponseResponse,
|
2492
3486
|
contentType: "json" /* Json */,
|
2493
3487
|
status: 200
|
3488
|
+
}).addError({
|
3489
|
+
error: _20,
|
3490
|
+
contentType: "json" /* Json */,
|
3491
|
+
status: 400
|
3492
|
+
}).addError({
|
3493
|
+
error: _21,
|
3494
|
+
contentType: "json" /* Json */,
|
3495
|
+
status: 401
|
2494
3496
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2495
3497
|
key: "iccid",
|
2496
3498
|
value: iccid
|
@@ -2500,13 +3502,22 @@ var ESimService = class extends BaseService {
|
|
2500
3502
|
/**
|
2501
3503
|
* Get eSIM MAC
|
2502
3504
|
* @param {string} iccid - ID of the eSIM
|
3505
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2503
3506
|
* @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
|
2504
3507
|
*/
|
2505
3508
|
async getEsimMac(iccid, requestConfig) {
|
2506
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(
|
3509
|
+
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(z63.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2507
3510
|
schema: getEsimMacOkResponseResponse,
|
2508
3511
|
contentType: "json" /* Json */,
|
2509
3512
|
status: 200
|
3513
|
+
}).addError({
|
3514
|
+
error: _22,
|
3515
|
+
contentType: "json" /* Json */,
|
3516
|
+
status: 400
|
3517
|
+
}).addError({
|
3518
|
+
error: _23,
|
3519
|
+
contentType: "json" /* Json */,
|
3520
|
+
status: 401
|
2510
3521
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
2511
3522
|
key: "iccid",
|
2512
3523
|
value: iccid
|
@@ -2515,40 +3526,95 @@ var ESimService = class extends BaseService {
|
|
2515
3526
|
}
|
2516
3527
|
};
|
2517
3528
|
|
2518
|
-
// src/services/i-frame/i-frame.ts
|
2519
|
-
import { z as
|
3529
|
+
// src/services/i-frame/i-frame-service.ts
|
3530
|
+
import { z as z67 } from "zod";
|
2520
3531
|
|
2521
3532
|
// src/services/i-frame/models/token-ok-response.ts
|
2522
|
-
import { z as
|
2523
|
-
var tokenOkResponse =
|
2524
|
-
return
|
2525
|
-
token:
|
3533
|
+
import { z as z64 } from "zod";
|
3534
|
+
var tokenOkResponse = z64.lazy(() => {
|
3535
|
+
return z64.object({
|
3536
|
+
token: z64.string().optional()
|
2526
3537
|
});
|
2527
3538
|
});
|
2528
|
-
var tokenOkResponseResponse =
|
2529
|
-
return
|
2530
|
-
token:
|
3539
|
+
var tokenOkResponseResponse = z64.lazy(() => {
|
3540
|
+
return z64.object({
|
3541
|
+
token: z64.string().optional()
|
2531
3542
|
}).transform((data) => ({
|
2532
3543
|
token: data["token"]
|
2533
3544
|
}));
|
2534
3545
|
});
|
2535
|
-
var tokenOkResponseRequest =
|
2536
|
-
return
|
3546
|
+
var tokenOkResponseRequest = z64.lazy(() => {
|
3547
|
+
return z64.object({
|
3548
|
+
token: z64.string().optional()
|
3549
|
+
}).transform((data) => ({
|
2537
3550
|
token: data["token"]
|
2538
3551
|
}));
|
2539
3552
|
});
|
2540
3553
|
|
2541
|
-
// src/services/i-frame/
|
3554
|
+
// src/services/i-frame/models/_24.ts
|
3555
|
+
import { z as z65 } from "zod";
|
3556
|
+
var _24Response = z65.lazy(() => {
|
3557
|
+
return z65.object({
|
3558
|
+
message: z65.string().optional()
|
3559
|
+
}).transform((data) => ({
|
3560
|
+
message: data["message"]
|
3561
|
+
}));
|
3562
|
+
});
|
3563
|
+
var _24 = class extends ThrowableError {
|
3564
|
+
constructor(message, response) {
|
3565
|
+
super(message);
|
3566
|
+
this.message = message;
|
3567
|
+
this.response = response;
|
3568
|
+
const parsedResponse = _24Response.parse(response);
|
3569
|
+
this.message = parsedResponse.message || "";
|
3570
|
+
}
|
3571
|
+
throw() {
|
3572
|
+
throw new _24(this.message, this.response);
|
3573
|
+
}
|
3574
|
+
};
|
3575
|
+
|
3576
|
+
// src/services/i-frame/models/_25.ts
|
3577
|
+
import { z as z66 } from "zod";
|
3578
|
+
var _25Response = z66.lazy(() => {
|
3579
|
+
return z66.object({
|
3580
|
+
message: z66.string().optional()
|
3581
|
+
}).transform((data) => ({
|
3582
|
+
message: data["message"]
|
3583
|
+
}));
|
3584
|
+
});
|
3585
|
+
var _25 = class extends ThrowableError {
|
3586
|
+
constructor(message, response) {
|
3587
|
+
super(message);
|
3588
|
+
this.message = message;
|
3589
|
+
this.response = response;
|
3590
|
+
const parsedResponse = _25Response.parse(response);
|
3591
|
+
this.message = parsedResponse.message || "";
|
3592
|
+
}
|
3593
|
+
throw() {
|
3594
|
+
throw new _25(this.message, this.response);
|
3595
|
+
}
|
3596
|
+
};
|
3597
|
+
|
3598
|
+
// src/services/i-frame/i-frame-service.ts
|
2542
3599
|
var IFrameService = class extends BaseService {
|
2543
3600
|
/**
|
2544
3601
|
* Generate a new token to be used in the iFrame
|
3602
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
2545
3603
|
* @returns {Promise<HttpResponse<TokenOkResponse>>} Successful Response
|
2546
3604
|
*/
|
2547
3605
|
async token(requestConfig) {
|
2548
|
-
const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/iframe/token").setRequestSchema(
|
3606
|
+
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(z67.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
|
2549
3607
|
schema: tokenOkResponseResponse,
|
2550
3608
|
contentType: "json" /* Json */,
|
2551
3609
|
status: 200
|
3610
|
+
}).addError({
|
3611
|
+
error: _24,
|
3612
|
+
contentType: "json" /* Json */,
|
3613
|
+
status: 400
|
3614
|
+
}).addError({
|
3615
|
+
error: _25,
|
3616
|
+
contentType: "json" /* Json */,
|
3617
|
+
status: 401
|
2552
3618
|
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
|
2553
3619
|
return this.client.call(request);
|
2554
3620
|
}
|
@@ -2559,11 +3625,6 @@ var Celitech = class {
|
|
2559
3625
|
constructor(config) {
|
2560
3626
|
this.config = config;
|
2561
3627
|
this.tokenManager = new OAuthTokenManager();
|
2562
|
-
const baseUrl = config.environment || config.baseUrl || "https://api.celitech.net/v1" /* DEFAULT */;
|
2563
|
-
this.config = {
|
2564
|
-
...config,
|
2565
|
-
baseUrl
|
2566
|
-
};
|
2567
3628
|
this.oAuth = new OAuthService(this.config, this.tokenManager);
|
2568
3629
|
this.destinations = new DestinationsService(this.config, this.tokenManager);
|
2569
3630
|
this.packages = new PackagesService(this.config, this.tokenManager);
|
@@ -2619,11 +3680,20 @@ var Celitech = class {
|
|
2619
3680
|
this.eSim.oAuthBaseUrl = oAuthBaseUrl;
|
2620
3681
|
this.iFrame.oAuthBaseUrl = oAuthBaseUrl;
|
2621
3682
|
}
|
3683
|
+
set accessToken(accessToken) {
|
3684
|
+
this.oAuth.accessToken = accessToken;
|
3685
|
+
this.destinations.accessToken = accessToken;
|
3686
|
+
this.packages.accessToken = accessToken;
|
3687
|
+
this.purchases.accessToken = accessToken;
|
3688
|
+
this.eSim.accessToken = accessToken;
|
3689
|
+
this.iFrame.accessToken = accessToken;
|
3690
|
+
}
|
2622
3691
|
};
|
2623
3692
|
export {
|
2624
3693
|
Celitech,
|
2625
3694
|
DestinationsService,
|
2626
3695
|
ESimService,
|
3696
|
+
Environment,
|
2627
3697
|
GrantType,
|
2628
3698
|
IFrameService,
|
2629
3699
|
OAuthService,
|