celitech-sdk 1.3.7 → 1.3.8

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 CHANGED
@@ -1,11 +1,11 @@
1
- # Celitech TypeScript SDK 1.3.7
1
+ # Celitech TypeScript SDK 1.3.8
2
2
 
3
3
  Welcome to the Celitech SDK documentation. This guide will help you get started with integrating and using the Celitech SDK in your project.
4
4
 
5
5
  ## Versions
6
6
 
7
7
  - API version: `1.1.0`
8
- - SDK version: `1.3.7`
8
+ - SDK version: `1.3.8`
9
9
 
10
10
  ## About the API
11
11
 
@@ -48,13 +48,15 @@ The Celitech API uses OAuth for authentication.
48
48
  You need to provide the OAuth parameters when initializing the SDK.
49
49
 
50
50
  ```ts
51
-
51
+ const sdk = new Celitech({ clientSecret: 'CLIENT_SECRET', clientId: 'CLIENT_ID' });
52
52
  ```
53
53
 
54
54
  If you need to set or update the OAuth parameters after the SDK initialization, you can use:
55
55
 
56
56
  ```ts
57
-
57
+ const sdk = new Celitech();
58
+ sdk.clientId = 'CLIENT_ID';
59
+ sdk.clientSecret = 'CLIENT_SECRET';
58
60
  ```
59
61
 
60
62
  ## Environment Variables
@@ -86,7 +88,10 @@ Below is a comprehensive example demonstrating how to authenticate and call a si
86
88
  import { Celitech } from 'celitech-sdk';
87
89
 
88
90
  (async () => {
89
- const celitech = new Celitech({});
91
+ const celitech = new Celitech({
92
+ clientSecret: 'CLIENT_SECRET',
93
+ clientId: 'CLIENT_ID',
94
+ });
90
95
 
91
96
  const { data } = await celitech.destinations.listDestinations();
92
97
 
package/dist/index.d.ts CHANGED
@@ -75,7 +75,7 @@ interface CreateRequestParameters<FullResponse, Page = unknown[]> {
75
75
  validation: ValidationOptions;
76
76
  retry: RetryOptions;
77
77
  pagination?: RequestPagination<Page>;
78
- scopes: Set<string>;
78
+ scopes?: Set<string>;
79
79
  tokenManager: OAuthTokenManager;
80
80
  }
81
81
  interface RequestParameter {
@@ -108,7 +108,7 @@ declare class Request<T = unknown, PageSchema = unknown[]> {
108
108
  validation: ValidationOptions;
109
109
  retry: RetryOptions;
110
110
  pagination?: RequestPagination<PageSchema>;
111
- scopes: Set<string>;
111
+ scopes?: Set<string>;
112
112
  tokenManager: OAuthTokenManager;
113
113
  private readonly pathPattern;
114
114
  constructor(params: CreateRequestParameters<T, PageSchema>);
@@ -169,11 +169,17 @@ interface ValidationOptions {
169
169
  responseValidation?: boolean;
170
170
  }
171
171
 
172
+ declare class HttpError extends Error {
173
+ readonly error: string;
174
+ readonly metadata: HttpMetadata;
175
+ readonly raw?: ArrayBuffer;
176
+ constructor(metadata: HttpMetadata, raw?: ArrayBuffer, error?: string);
177
+ }
178
+
172
179
  declare class CustomHook implements Hook {
173
- getToken(clientId: string, clientSecret: string): Promise<any>;
174
180
  beforeRequest(request: HttpRequest, params: Map<string, string>): Promise<HttpRequest>;
175
181
  afterResponse(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpResponse$1<any>>;
176
- onError(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpError$1>;
182
+ onError(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpError>;
177
183
  }
178
184
 
179
185
  declare class HttpClient {
@@ -1601,13 +1607,6 @@ declare const getEsimMacOkResponseEsim: z.ZodLazy<z.ZodObject<{
1601
1607
  */
1602
1608
  type GetEsimMacOkResponseEsim = z.infer<typeof getEsimMacOkResponseEsim>;
1603
1609
 
1604
- declare class HttpError extends Error {
1605
- readonly error: string;
1606
- readonly metadata: HttpMetadata;
1607
- readonly raw?: ArrayBuffer;
1608
- constructor(metadata: HttpMetadata, raw?: ArrayBuffer, error?: string);
1609
- }
1610
-
1611
1610
  declare class Celitech {
1612
1611
  config: SdkConfig;
1613
1612
  readonly oAuth: OAuthService;
package/dist/index.js CHANGED
@@ -60,63 +60,26 @@ var RequestHandlerChain = class {
60
60
  }
61
61
  };
62
62
 
63
+ // src/http/error.ts
64
+ var HttpError = class extends Error {
65
+ constructor(metadata, raw, error) {
66
+ super(error);
67
+ this.error = metadata.statusText;
68
+ this.metadata = metadata;
69
+ this.raw = raw;
70
+ }
71
+ };
72
+
63
73
  // src/http/hooks/custom-hook.ts
64
- var CURRENT_TOKEN = "";
65
- var CURRENT_EXPIRY = -1;
66
74
  var CustomHook = class {
67
- async getToken(clientId, clientSecret) {
68
- const tokenUrl = "https://auth.celitech.net/oauth2/token";
69
- const headers = {
70
- "Content-Type": "application/x-www-form-urlencoded"
71
- };
72
- const body = {
73
- client_id: clientId,
74
- client_secret: clientSecret,
75
- grant_type: "client_credentials"
76
- };
77
- const response = await fetch(tokenUrl, {
78
- method: "POST",
79
- headers,
80
- body: new URLSearchParams(body)
81
- });
82
- return response.json();
83
- }
84
75
  async beforeRequest(request, params) {
85
- const clientId = params.get("clientId") || "";
86
- const clientSecret = params.get("clientSecret") || "";
87
- if (!clientId || !clientSecret) {
88
- throw new Error("Missing clientId and/or clientSecret constructor parameters");
89
- }
90
- if (!CURRENT_TOKEN || CURRENT_EXPIRY < Date.now()) {
91
- const tokenResponse = await this.getToken(clientId, clientSecret);
92
- if (tokenResponse.error) {
93
- throw new Error(tokenResponse.error);
94
- }
95
- const { expires_in, access_token } = tokenResponse;
96
- if (!expires_in || !access_token) {
97
- throw new Error("There is an issue with getting the oauth token");
98
- }
99
- CURRENT_EXPIRY = Date.now() + expires_in * 1e3;
100
- CURRENT_TOKEN = access_token;
101
- }
102
- const authorization = `Bearer ${CURRENT_TOKEN}`;
103
- if (!request.headers) {
104
- request.headers = /* @__PURE__ */ new Map();
105
- }
106
- request.headers.set("Authorization", authorization);
107
76
  return request;
108
77
  }
109
78
  async afterResponse(request, response, params) {
110
79
  return response;
111
80
  }
112
81
  async onError(request, response, params) {
113
- return new CustomHttpError("a custom error message", response.metadata);
114
- }
115
- };
116
- var CustomHttpError = class {
117
- constructor(error, metadata) {
118
- this.error = error;
119
- this.metadata = metadata;
82
+ return new HttpError(response.metadata, response.raw);
120
83
  }
121
84
  };
122
85
 
@@ -397,7 +360,7 @@ var RequestValidationHandler = class {
397
360
  } else if (request.requestContentType === "xml" /* Xml */ || request.requestContentType === "binary" /* Binary */ || request.requestContentType === "text" /* Text */) {
398
361
  request.body = request.body;
399
362
  } else if (request.requestContentType === "form" /* FormUrlEncoded */) {
400
- request.body = this.toFormUrlEncoded(request.body);
363
+ request.body = this.toFormUrlEncoded(request);
401
364
  } else if (request.requestContentType === "multipartFormData" /* MultipartFormData */) {
402
365
  request.body = this.toFormData(request.body);
403
366
  } else {
@@ -405,27 +368,29 @@ var RequestValidationHandler = class {
405
368
  }
406
369
  return await this.next.handle(request);
407
370
  }
408
- toFormUrlEncoded(body) {
409
- if (body === void 0) {
371
+ toFormUrlEncoded(request) {
372
+ var _a;
373
+ if (request.body === void 0) {
410
374
  return "";
411
375
  }
412
- if (typeof body === "string") {
413
- return body;
376
+ if (typeof request.body === "string") {
377
+ return request.body;
414
378
  }
415
- if (body instanceof URLSearchParams) {
416
- return body.toString();
379
+ if (request.body instanceof URLSearchParams) {
380
+ return request.body.toString();
417
381
  }
418
- if (body instanceof FormData) {
382
+ const validatedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
383
+ if (validatedBody instanceof FormData) {
419
384
  const params = new URLSearchParams();
420
- body.forEach((value, key) => {
385
+ validatedBody.forEach((value, key) => {
421
386
  params.append(key, value.toString());
422
387
  });
423
388
  return params.toString();
424
389
  }
425
- if (typeof body === "object" && !Array.isArray(body)) {
390
+ if (typeof validatedBody === "object" && !Array.isArray(validatedBody)) {
426
391
  const params = new URLSearchParams();
427
- for (const [key, value] of Object.entries(body)) {
428
- params.append(key, value.toString());
392
+ for (const [key, value] of Object.entries(validatedBody)) {
393
+ params.append(key, `${value}`);
429
394
  }
430
395
  return params.toString();
431
396
  }
@@ -521,16 +486,6 @@ var TerminatingHandler = class {
521
486
  }
522
487
  };
523
488
 
524
- // src/http/error.ts
525
- var HttpError = class extends Error {
526
- constructor(metadata, raw, error) {
527
- super(error);
528
- this.error = metadata.statusText;
529
- this.metadata = metadata;
530
- this.raw = raw;
531
- }
532
- };
533
-
534
489
  // src/http/handlers/retry-handler.ts
535
490
  var RetryHandler = class {
536
491
  async handle(request) {
@@ -798,7 +753,7 @@ var Request = class {
798
753
  return `${this.baseUrl}${path}${queryString}`;
799
754
  }
800
755
  copy(overrides) {
801
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
756
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
802
757
  const createRequestParams = {
803
758
  baseUrl: (_a = overrides == null ? void 0 : overrides.baseUrl) != null ? _a : this.baseUrl,
804
759
  method: (_b = overrides == null ? void 0 : overrides.method) != null ? _b : this.method,
@@ -814,7 +769,7 @@ var Request = class {
814
769
  responseContentType: (_l = overrides == null ? void 0 : overrides.responseContentType) != null ? _l : this.responseContentType,
815
770
  retry: (_m = overrides == null ? void 0 : overrides.retry) != null ? _m : this.retry,
816
771
  validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation,
817
- scopes: (_o = overrides == null ? void 0 : overrides.scopes) != null ? _o : /* @__PURE__ */ new Set(),
772
+ scopes: overrides == null ? void 0 : overrides.scopes,
818
773
  tokenManager: this.tokenManager
819
774
  };
820
775
  return new Request({
@@ -882,7 +837,6 @@ var RequestBuilder = class {
882
837
  pathParams: /* @__PURE__ */ new Map(),
883
838
  queryParams: /* @__PURE__ */ new Map(),
884
839
  headers: /* @__PURE__ */ new Map(),
885
- scopes: /* @__PURE__ */ new Set(),
886
840
  tokenManager: new OAuthTokenManager()
887
841
  };
888
842
  }
@@ -1109,9 +1063,6 @@ var OAuthToken = class {
1109
1063
  }
1110
1064
  };
1111
1065
  var OAuthTokenManager = class {
1112
- constructor() {
1113
- this.token = new OAuthToken("", /* @__PURE__ */ new Set(), null);
1114
- }
1115
1066
  async getToken(scopes, config) {
1116
1067
  var _a, _b, _c, _d, _e;
1117
1068
  if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
@@ -1211,7 +1162,7 @@ var DestinationsService = class extends BaseService {
1211
1162
  * @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} Successful Response
1212
1163
  */
1213
1164
  async listDestinations(requestConfig) {
1214
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(import_zod7.z.any()).setResponseSchema(listDestinationsOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
1165
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(import_zod7.z.any()).setResponseSchema(listDestinationsOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
1215
1166
  return this.client.call(request);
1216
1167
  }
1217
1168
  };
@@ -1307,7 +1258,7 @@ var PackagesService = class extends BaseService {
1307
1258
  * @returns {Promise<HttpResponse<ListPackagesOkResponse>>} Successful Response
1308
1259
  */
1309
1260
  async listPackages(params, requestConfig) {
1310
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(import_zod10.z.any()).setResponseSchema(listPackagesOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1261
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(import_zod10.z.any()).setResponseSchema(listPackagesOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1311
1262
  key: "destination",
1312
1263
  value: params == null ? void 0 : params.destination
1313
1264
  }).addQueryParam({
@@ -1957,7 +1908,7 @@ var PurchasesService = class extends BaseService {
1957
1908
  * @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} Successful Response
1958
1909
  */
1959
1910
  async listPurchases(params, requestConfig) {
1960
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(import_zod26.z.any()).setResponseSchema(listPurchasesOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1911
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(import_zod26.z.any()).setResponseSchema(listPurchasesOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1961
1912
  key: "iccid",
1962
1913
  value: params == null ? void 0 : params.iccid
1963
1914
  }).addQueryParam({
@@ -1989,7 +1940,7 @@ var PurchasesService = class extends BaseService {
1989
1940
  * @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} Successful Response
1990
1941
  */
1991
1942
  async createPurchase(body, requestConfig) {
1992
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1943
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1993
1944
  return this.client.call(request);
1994
1945
  }
1995
1946
  /**
@@ -1997,7 +1948,7 @@ var PurchasesService = class extends BaseService {
1997
1948
  * @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
1998
1949
  */
1999
1950
  async topUpEsim(body, requestConfig) {
2000
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1951
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
2001
1952
  return this.client.call(request);
2002
1953
  }
2003
1954
  /**
@@ -2005,7 +1956,7 @@ var PurchasesService = class extends BaseService {
2005
1956
  * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
2006
1957
  */
2007
1958
  async editPurchase(body, requestConfig) {
2008
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1959
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
2009
1960
  return this.client.call(request);
2010
1961
  }
2011
1962
  /**
@@ -2014,7 +1965,7 @@ var PurchasesService = class extends BaseService {
2014
1965
  * @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} Successful Response
2015
1966
  */
2016
1967
  async getPurchaseConsumption(purchaseId, requestConfig) {
2017
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(import_zod26.z.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
1968
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(import_zod26.z.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2018
1969
  key: "purchaseId",
2019
1970
  value: purchaseId
2020
1971
  }).build();
@@ -2281,7 +2232,7 @@ var ESimService = class extends BaseService {
2281
2232
  * @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
2282
2233
  */
2283
2234
  async getEsim(params, requestConfig) {
2284
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2235
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2285
2236
  key: "iccid",
2286
2237
  value: params == null ? void 0 : params.iccid
2287
2238
  }).build();
@@ -2293,7 +2244,7 @@ var ESimService = class extends BaseService {
2293
2244
  * @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
2294
2245
  */
2295
2246
  async getEsimDevice(iccid, requestConfig) {
2296
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2247
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2297
2248
  key: "iccid",
2298
2249
  value: iccid
2299
2250
  }).build();
@@ -2305,7 +2256,7 @@ var ESimService = class extends BaseService {
2305
2256
  * @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
2306
2257
  */
2307
2258
  async getEsimHistory(iccid, requestConfig) {
2308
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2259
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2309
2260
  key: "iccid",
2310
2261
  value: iccid
2311
2262
  }).build();
@@ -2317,7 +2268,7 @@ var ESimService = class extends BaseService {
2317
2268
  * @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
2318
2269
  */
2319
2270
  async getEsimMac(iccid, requestConfig) {
2320
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimMacOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2271
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(import_zod36.z.any()).setResponseSchema(getEsimMacOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2321
2272
  key: "iccid",
2322
2273
  value: iccid
2323
2274
  }).build();
package/dist/index.mjs CHANGED
@@ -18,63 +18,26 @@ var RequestHandlerChain = class {
18
18
  }
19
19
  };
20
20
 
21
+ // src/http/error.ts
22
+ var HttpError = class extends Error {
23
+ constructor(metadata, raw, error) {
24
+ super(error);
25
+ this.error = metadata.statusText;
26
+ this.metadata = metadata;
27
+ this.raw = raw;
28
+ }
29
+ };
30
+
21
31
  // src/http/hooks/custom-hook.ts
22
- var CURRENT_TOKEN = "";
23
- var CURRENT_EXPIRY = -1;
24
32
  var CustomHook = class {
25
- async getToken(clientId, clientSecret) {
26
- const tokenUrl = "https://auth.celitech.net/oauth2/token";
27
- const headers = {
28
- "Content-Type": "application/x-www-form-urlencoded"
29
- };
30
- const body = {
31
- client_id: clientId,
32
- client_secret: clientSecret,
33
- grant_type: "client_credentials"
34
- };
35
- const response = await fetch(tokenUrl, {
36
- method: "POST",
37
- headers,
38
- body: new URLSearchParams(body)
39
- });
40
- return response.json();
41
- }
42
33
  async beforeRequest(request, params) {
43
- const clientId = params.get("clientId") || "";
44
- const clientSecret = params.get("clientSecret") || "";
45
- if (!clientId || !clientSecret) {
46
- throw new Error("Missing clientId and/or clientSecret constructor parameters");
47
- }
48
- if (!CURRENT_TOKEN || CURRENT_EXPIRY < Date.now()) {
49
- const tokenResponse = await this.getToken(clientId, clientSecret);
50
- if (tokenResponse.error) {
51
- throw new Error(tokenResponse.error);
52
- }
53
- const { expires_in, access_token } = tokenResponse;
54
- if (!expires_in || !access_token) {
55
- throw new Error("There is an issue with getting the oauth token");
56
- }
57
- CURRENT_EXPIRY = Date.now() + expires_in * 1e3;
58
- CURRENT_TOKEN = access_token;
59
- }
60
- const authorization = `Bearer ${CURRENT_TOKEN}`;
61
- if (!request.headers) {
62
- request.headers = /* @__PURE__ */ new Map();
63
- }
64
- request.headers.set("Authorization", authorization);
65
34
  return request;
66
35
  }
67
36
  async afterResponse(request, response, params) {
68
37
  return response;
69
38
  }
70
39
  async onError(request, response, params) {
71
- return new CustomHttpError("a custom error message", response.metadata);
72
- }
73
- };
74
- var CustomHttpError = class {
75
- constructor(error, metadata) {
76
- this.error = error;
77
- this.metadata = metadata;
40
+ return new HttpError(response.metadata, response.raw);
78
41
  }
79
42
  };
80
43
 
@@ -355,7 +318,7 @@ var RequestValidationHandler = class {
355
318
  } else if (request.requestContentType === "xml" /* Xml */ || request.requestContentType === "binary" /* Binary */ || request.requestContentType === "text" /* Text */) {
356
319
  request.body = request.body;
357
320
  } else if (request.requestContentType === "form" /* FormUrlEncoded */) {
358
- request.body = this.toFormUrlEncoded(request.body);
321
+ request.body = this.toFormUrlEncoded(request);
359
322
  } else if (request.requestContentType === "multipartFormData" /* MultipartFormData */) {
360
323
  request.body = this.toFormData(request.body);
361
324
  } else {
@@ -363,27 +326,29 @@ var RequestValidationHandler = class {
363
326
  }
364
327
  return await this.next.handle(request);
365
328
  }
366
- toFormUrlEncoded(body) {
367
- if (body === void 0) {
329
+ toFormUrlEncoded(request) {
330
+ var _a;
331
+ if (request.body === void 0) {
368
332
  return "";
369
333
  }
370
- if (typeof body === "string") {
371
- return body;
334
+ if (typeof request.body === "string") {
335
+ return request.body;
372
336
  }
373
- if (body instanceof URLSearchParams) {
374
- return body.toString();
337
+ if (request.body instanceof URLSearchParams) {
338
+ return request.body.toString();
375
339
  }
376
- if (body instanceof FormData) {
340
+ const validatedBody = (_a = request.requestSchema) == null ? void 0 : _a.parse(request.body);
341
+ if (validatedBody instanceof FormData) {
377
342
  const params = new URLSearchParams();
378
- body.forEach((value, key) => {
343
+ validatedBody.forEach((value, key) => {
379
344
  params.append(key, value.toString());
380
345
  });
381
346
  return params.toString();
382
347
  }
383
- if (typeof body === "object" && !Array.isArray(body)) {
348
+ if (typeof validatedBody === "object" && !Array.isArray(validatedBody)) {
384
349
  const params = new URLSearchParams();
385
- for (const [key, value] of Object.entries(body)) {
386
- params.append(key, value.toString());
350
+ for (const [key, value] of Object.entries(validatedBody)) {
351
+ params.append(key, `${value}`);
387
352
  }
388
353
  return params.toString();
389
354
  }
@@ -479,16 +444,6 @@ var TerminatingHandler = class {
479
444
  }
480
445
  };
481
446
 
482
- // src/http/error.ts
483
- var HttpError = class extends Error {
484
- constructor(metadata, raw, error) {
485
- super(error);
486
- this.error = metadata.statusText;
487
- this.metadata = metadata;
488
- this.raw = raw;
489
- }
490
- };
491
-
492
447
  // src/http/handlers/retry-handler.ts
493
448
  var RetryHandler = class {
494
449
  async handle(request) {
@@ -756,7 +711,7 @@ var Request = class {
756
711
  return `${this.baseUrl}${path}${queryString}`;
757
712
  }
758
713
  copy(overrides) {
759
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
714
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
760
715
  const createRequestParams = {
761
716
  baseUrl: (_a = overrides == null ? void 0 : overrides.baseUrl) != null ? _a : this.baseUrl,
762
717
  method: (_b = overrides == null ? void 0 : overrides.method) != null ? _b : this.method,
@@ -772,7 +727,7 @@ var Request = class {
772
727
  responseContentType: (_l = overrides == null ? void 0 : overrides.responseContentType) != null ? _l : this.responseContentType,
773
728
  retry: (_m = overrides == null ? void 0 : overrides.retry) != null ? _m : this.retry,
774
729
  validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation,
775
- scopes: (_o = overrides == null ? void 0 : overrides.scopes) != null ? _o : /* @__PURE__ */ new Set(),
730
+ scopes: overrides == null ? void 0 : overrides.scopes,
776
731
  tokenManager: this.tokenManager
777
732
  };
778
733
  return new Request({
@@ -840,7 +795,6 @@ var RequestBuilder = class {
840
795
  pathParams: /* @__PURE__ */ new Map(),
841
796
  queryParams: /* @__PURE__ */ new Map(),
842
797
  headers: /* @__PURE__ */ new Map(),
843
- scopes: /* @__PURE__ */ new Set(),
844
798
  tokenManager: new OAuthTokenManager()
845
799
  };
846
800
  }
@@ -1067,9 +1021,6 @@ var OAuthToken = class {
1067
1021
  }
1068
1022
  };
1069
1023
  var OAuthTokenManager = class {
1070
- constructor() {
1071
- this.token = new OAuthToken("", /* @__PURE__ */ new Set(), null);
1072
- }
1073
1024
  async getToken(scopes, config) {
1074
1025
  var _a, _b, _c, _d, _e;
1075
1026
  if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
@@ -1169,7 +1120,7 @@ var DestinationsService = class extends BaseService {
1169
1120
  * @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} Successful Response
1170
1121
  */
1171
1122
  async listDestinations(requestConfig) {
1172
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(z6.any()).setResponseSchema(listDestinationsOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
1123
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(z6.any()).setResponseSchema(listDestinationsOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
1173
1124
  return this.client.call(request);
1174
1125
  }
1175
1126
  };
@@ -1265,7 +1216,7 @@ var PackagesService = class extends BaseService {
1265
1216
  * @returns {Promise<HttpResponse<ListPackagesOkResponse>>} Successful Response
1266
1217
  */
1267
1218
  async listPackages(params, requestConfig) {
1268
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(z9.any()).setResponseSchema(listPackagesOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1219
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/packages").setRequestSchema(z9.any()).setResponseSchema(listPackagesOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1269
1220
  key: "destination",
1270
1221
  value: params == null ? void 0 : params.destination
1271
1222
  }).addQueryParam({
@@ -1915,7 +1866,7 @@ var PurchasesService = class extends BaseService {
1915
1866
  * @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} Successful Response
1916
1867
  */
1917
1868
  async listPurchases(params, requestConfig) {
1918
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(z25.any()).setResponseSchema(listPurchasesOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1869
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(z25.any()).setResponseSchema(listPurchasesOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1919
1870
  key: "iccid",
1920
1871
  value: params == null ? void 0 : params.iccid
1921
1872
  }).addQueryParam({
@@ -1947,7 +1898,7 @@ var PurchasesService = class extends BaseService {
1947
1898
  * @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} Successful Response
1948
1899
  */
1949
1900
  async createPurchase(body, requestConfig) {
1950
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1901
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1951
1902
  return this.client.call(request);
1952
1903
  }
1953
1904
  /**
@@ -1955,7 +1906,7 @@ var PurchasesService = class extends BaseService {
1955
1906
  * @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
1956
1907
  */
1957
1908
  async topUpEsim(body, requestConfig) {
1958
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1909
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1959
1910
  return this.client.call(request);
1960
1911
  }
1961
1912
  /**
@@ -1963,7 +1914,7 @@ var PurchasesService = class extends BaseService {
1963
1914
  * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
1964
1915
  */
1965
1916
  async editPurchase(body, requestConfig) {
1966
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1917
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1967
1918
  return this.client.call(request);
1968
1919
  }
1969
1920
  /**
@@ -1972,7 +1923,7 @@ var PurchasesService = class extends BaseService {
1972
1923
  * @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} Successful Response
1973
1924
  */
1974
1925
  async getPurchaseConsumption(purchaseId, requestConfig) {
1975
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(z25.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
1926
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(z25.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
1976
1927
  key: "purchaseId",
1977
1928
  value: purchaseId
1978
1929
  }).build();
@@ -2239,7 +2190,7 @@ var ESimService = class extends BaseService {
2239
2190
  * @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
2240
2191
  */
2241
2192
  async getEsim(params, requestConfig) {
2242
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(z35.any()).setResponseSchema(getEsimOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2193
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim").setRequestSchema(z35.any()).setResponseSchema(getEsimOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2243
2194
  key: "iccid",
2244
2195
  value: params == null ? void 0 : params.iccid
2245
2196
  }).build();
@@ -2251,7 +2202,7 @@ var ESimService = class extends BaseService {
2251
2202
  * @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
2252
2203
  */
2253
2204
  async getEsimDevice(iccid, requestConfig) {
2254
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(z35.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2205
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(z35.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2255
2206
  key: "iccid",
2256
2207
  value: iccid
2257
2208
  }).build();
@@ -2263,7 +2214,7 @@ var ESimService = class extends BaseService {
2263
2214
  * @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
2264
2215
  */
2265
2216
  async getEsimHistory(iccid, requestConfig) {
2266
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(z35.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2217
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(z35.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2267
2218
  key: "iccid",
2268
2219
  value: iccid
2269
2220
  }).build();
@@ -2275,7 +2226,7 @@ var ESimService = class extends BaseService {
2275
2226
  * @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
2276
2227
  */
2277
2228
  async getEsimMac(iccid, requestConfig) {
2278
- const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(z35.any()).setResponseSchema(getEsimMacOkResponseResponse).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2229
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(z35.any()).setResponseSchema(getEsimMacOkResponseResponse).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2279
2230
  key: "iccid",
2280
2231
  value: iccid
2281
2232
  }).build();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "celitech-sdk",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Welcome to the CELITECH API documentation! Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/) ",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",