celitech-sdk 1.3.34 → 1.3.38

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,4 +1,4 @@
1
- # Celitech TypeScript SDK 1.3.34
1
+ # Celitech TypeScript SDK 1.3.38
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
 
@@ -7,11 +7,13 @@ Welcome to the Celitech SDK documentation. This guide will help you get started
7
7
  ## Versions
8
8
 
9
9
  - API version: `1.1.0`
10
- - SDK version: `1.3.34`
10
+ - SDK version: `1.3.38`
11
11
 
12
12
  ## About the API
13
13
 
14
- 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/)
14
+ Welcome to the CELITECH API documentation!
15
+
16
+ Useful links: [Homepage](https://www.celitech.com) | [Support email](mailto:support@celitech.com) | [Blog](https://www.celitech.com/blog/)
15
17
 
16
18
  ## Table of Contents
17
19
 
@@ -50,7 +52,7 @@ The Celitech API uses OAuth for authentication.
50
52
  You need to provide the OAuth parameters when initializing the SDK.
51
53
 
52
54
  ```ts
53
- const sdk = new Celitech({ clientSecret: 'CLIENT_SECRET', clientId: 'CLIENT_ID' });
55
+ const sdk = new Celitech({ clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET' });
54
56
  ```
55
57
 
56
58
  If you need to set or update the OAuth parameters after the SDK initialization, you can use:
@@ -115,6 +117,7 @@ The SDK provides various services to interact with the API.
115
117
  | [PackagesService](documentation/services/PackagesService.md) |
116
118
  | [PurchasesService](documentation/services/PurchasesService.md) |
117
119
  | [ESimService](documentation/services/ESimService.md) |
120
+ | [IFrameService](documentation/services/IFrameService.md) |
118
121
 
119
122
  </details>
120
123
 
@@ -143,6 +146,7 @@ The SDK includes several models that represent the data structures used in API r
143
146
  | [GetEsimDeviceOkResponse](documentation/models/GetEsimDeviceOkResponse.md) | |
144
147
  | [GetEsimHistoryOkResponse](documentation/models/GetEsimHistoryOkResponse.md) | |
145
148
  | [GetEsimMacOkResponse](documentation/models/GetEsimMacOkResponse.md) | |
149
+ | [TokenOkResponse](documentation/models/TokenOkResponse.md) | |
146
150
 
147
151
  </details>
148
152
 
package/dist/index.d.ts CHANGED
@@ -1615,6 +1615,31 @@ declare const getEsimMacOkResponseEsim: z.ZodLazy<z.ZodObject<{
1615
1615
  */
1616
1616
  type GetEsimMacOkResponseEsim = z.infer<typeof getEsimMacOkResponseEsim>;
1617
1617
 
1618
+ /**
1619
+ * The shape of the model inside the application code - what the users use
1620
+ */
1621
+ declare const tokenOkResponse: z.ZodLazy<z.ZodObject<{
1622
+ token: z.ZodOptional<z.ZodString>;
1623
+ }, "strip", z.ZodTypeAny, {
1624
+ token?: string | undefined;
1625
+ }, {
1626
+ token?: string | undefined;
1627
+ }>>;
1628
+ /**
1629
+ *
1630
+ * @typedef {TokenOkResponse} tokenOkResponse
1631
+ * @property {string} - The generated token
1632
+ */
1633
+ type TokenOkResponse = z.infer<typeof tokenOkResponse>;
1634
+
1635
+ declare class IFrameService extends BaseService {
1636
+ /**
1637
+ * Generate a new token to be used in the iFrame
1638
+ * @returns {Promise<HttpResponse<TokenOkResponse>>} Successful Response
1639
+ */
1640
+ token(requestConfig?: RequestConfig): Promise<HttpResponse<TokenOkResponse>>;
1641
+ }
1642
+
1618
1643
  declare class Celitech {
1619
1644
  config: SdkConfig;
1620
1645
  readonly oAuth: OAuthService;
@@ -1622,6 +1647,7 @@ declare class Celitech {
1622
1647
  readonly packages: PackagesService;
1623
1648
  readonly purchases: PurchasesService;
1624
1649
  readonly eSim: ESimService;
1650
+ readonly iFrame: IFrameService;
1625
1651
  protected tokenManager: OAuthTokenManager;
1626
1652
  constructor(config: SdkConfig);
1627
1653
  set baseUrl(baseUrl: string);
@@ -1632,4 +1658,4 @@ declare class Celitech {
1632
1658
  set oAuthBaseUrl(oAuthBaseUrl: string);
1633
1659
  }
1634
1660
 
1635
- export { Celitech, CreatePurchaseOkResponse, CreatePurchaseOkResponseProfile, CreatePurchaseOkResponsePurchase, CreatePurchaseRequest, Destinations, DestinationsService, Device, ESimService, EditPurchaseOkResponse, EditPurchaseRequest, Environment, GetAccessTokenOkResponse, GetAccessTokenRequest, GetEsimDeviceOkResponse, GetEsimHistoryOkResponse, GetEsimHistoryOkResponseEsim, GetEsimMacOkResponse, GetEsimMacOkResponseEsim, GetEsimOkResponse, GetEsimOkResponseEsim, GetPurchaseConsumptionOkResponse, GrantType, History, HttpError, HttpMetadata, HttpMethod, HttpResponse, ListDestinationsOkResponse, ListPackagesOkResponse, ListPurchasesOkResponse, OAuthService, Package_, Packages, PackagesService, Purchases, PurchasesEsim, PurchasesService, RequestConfig, RetryOptions, SdkConfig, TopUpEsimOkResponse, TopUpEsimOkResponseProfile, TopUpEsimOkResponsePurchase, TopUpEsimRequest, ValidationOptions };
1661
+ export { Celitech, CreatePurchaseOkResponse, CreatePurchaseOkResponseProfile, CreatePurchaseOkResponsePurchase, CreatePurchaseRequest, Destinations, DestinationsService, Device, ESimService, EditPurchaseOkResponse, EditPurchaseRequest, Environment, GetAccessTokenOkResponse, GetAccessTokenRequest, GetEsimDeviceOkResponse, GetEsimHistoryOkResponse, GetEsimHistoryOkResponseEsim, GetEsimMacOkResponse, GetEsimMacOkResponseEsim, GetEsimOkResponse, GetEsimOkResponseEsim, GetPurchaseConsumptionOkResponse, GrantType, History, HttpError, HttpMetadata, HttpMethod, HttpResponse, IFrameService, ListDestinationsOkResponse, ListPackagesOkResponse, ListPurchasesOkResponse, OAuthService, Package_, Packages, PackagesService, Purchases, PurchasesEsim, PurchasesService, RequestConfig, RetryOptions, SdkConfig, TokenOkResponse, TopUpEsimOkResponse, TopUpEsimOkResponseProfile, TopUpEsimOkResponsePurchase, TopUpEsimRequest, ValidationOptions };
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ __export(src_exports, {
34
34
  DestinationsService: () => DestinationsService,
35
35
  ESimService: () => ESimService,
36
36
  GrantType: () => GrantType,
37
+ IFrameService: () => IFrameService,
37
38
  OAuthService: () => OAuthService,
38
39
  PackagesService: () => PackagesService,
39
40
  PurchasesService: () => PurchasesService
@@ -2557,6 +2558,45 @@ var ESimService = class extends BaseService {
2557
2558
  }
2558
2559
  };
2559
2560
 
2561
+ // src/services/i-frame/i-frame.ts
2562
+ var import_zod38 = require("zod");
2563
+
2564
+ // src/services/i-frame/models/token-ok-response.ts
2565
+ var import_zod37 = require("zod");
2566
+ var tokenOkResponse = import_zod37.z.lazy(() => {
2567
+ return import_zod37.z.object({
2568
+ token: import_zod37.z.string().optional()
2569
+ });
2570
+ });
2571
+ var tokenOkResponseResponse = import_zod37.z.lazy(() => {
2572
+ return import_zod37.z.object({
2573
+ token: import_zod37.z.string().optional()
2574
+ }).transform((data) => ({
2575
+ token: data["token"]
2576
+ }));
2577
+ });
2578
+ var tokenOkResponseRequest = import_zod37.z.lazy(() => {
2579
+ return import_zod37.z.object({ token: import_zod37.z.string().nullish() }).transform((data) => ({
2580
+ token: data["token"]
2581
+ }));
2582
+ });
2583
+
2584
+ // src/services/i-frame/i-frame.ts
2585
+ var IFrameService = class extends BaseService {
2586
+ /**
2587
+ * Generate a new token to be used in the iFrame
2588
+ * @returns {Promise<HttpResponse<TokenOkResponse>>} Successful Response
2589
+ */
2590
+ async token(requestConfig) {
2591
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/iframe/token").setRequestSchema(import_zod38.z.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
2592
+ schema: tokenOkResponseResponse,
2593
+ contentType: "json" /* Json */,
2594
+ status: 200
2595
+ }).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
2596
+ return this.client.call(request);
2597
+ }
2598
+ };
2599
+
2560
2600
  // src/index.ts
2561
2601
  var Celitech = class {
2562
2602
  constructor(config) {
@@ -2572,6 +2612,7 @@ var Celitech = class {
2572
2612
  this.packages = new PackagesService(this.config, this.tokenManager);
2573
2613
  this.purchases = new PurchasesService(this.config, this.tokenManager);
2574
2614
  this.eSim = new ESimService(this.config, this.tokenManager);
2615
+ this.iFrame = new IFrameService(this.config, this.tokenManager);
2575
2616
  }
2576
2617
  set baseUrl(baseUrl) {
2577
2618
  this.oAuth.baseUrl = baseUrl;
@@ -2579,6 +2620,7 @@ var Celitech = class {
2579
2620
  this.packages.baseUrl = baseUrl;
2580
2621
  this.purchases.baseUrl = baseUrl;
2581
2622
  this.eSim.baseUrl = baseUrl;
2623
+ this.iFrame.baseUrl = baseUrl;
2582
2624
  }
2583
2625
  set environment(environment) {
2584
2626
  this.oAuth.baseUrl = environment;
@@ -2586,6 +2628,7 @@ var Celitech = class {
2586
2628
  this.packages.baseUrl = environment;
2587
2629
  this.purchases.baseUrl = environment;
2588
2630
  this.eSim.baseUrl = environment;
2631
+ this.iFrame.baseUrl = environment;
2589
2632
  }
2590
2633
  set timeoutMs(timeoutMs) {
2591
2634
  this.oAuth.timeoutMs = timeoutMs;
@@ -2593,6 +2636,7 @@ var Celitech = class {
2593
2636
  this.packages.timeoutMs = timeoutMs;
2594
2637
  this.purchases.timeoutMs = timeoutMs;
2595
2638
  this.eSim.timeoutMs = timeoutMs;
2639
+ this.iFrame.timeoutMs = timeoutMs;
2596
2640
  }
2597
2641
  set clientId(clientId) {
2598
2642
  this.oAuth.clientId = clientId;
@@ -2600,6 +2644,7 @@ var Celitech = class {
2600
2644
  this.packages.clientId = clientId;
2601
2645
  this.purchases.clientId = clientId;
2602
2646
  this.eSim.clientId = clientId;
2647
+ this.iFrame.clientId = clientId;
2603
2648
  }
2604
2649
  set clientSecret(clientSecret) {
2605
2650
  this.oAuth.clientSecret = clientSecret;
@@ -2607,6 +2652,7 @@ var Celitech = class {
2607
2652
  this.packages.clientSecret = clientSecret;
2608
2653
  this.purchases.clientSecret = clientSecret;
2609
2654
  this.eSim.clientSecret = clientSecret;
2655
+ this.iFrame.clientSecret = clientSecret;
2610
2656
  }
2611
2657
  set oAuthBaseUrl(oAuthBaseUrl) {
2612
2658
  this.oAuth.oAuthBaseUrl = oAuthBaseUrl;
@@ -2614,6 +2660,7 @@ var Celitech = class {
2614
2660
  this.packages.oAuthBaseUrl = oAuthBaseUrl;
2615
2661
  this.purchases.oAuthBaseUrl = oAuthBaseUrl;
2616
2662
  this.eSim.oAuthBaseUrl = oAuthBaseUrl;
2663
+ this.iFrame.oAuthBaseUrl = oAuthBaseUrl;
2617
2664
  }
2618
2665
  };
2619
2666
  // Annotate the CommonJS export names for ESM import in node:
@@ -2622,6 +2669,7 @@ var Celitech = class {
2622
2669
  DestinationsService,
2623
2670
  ESimService,
2624
2671
  GrantType,
2672
+ IFrameService,
2625
2673
  OAuthService,
2626
2674
  PackagesService,
2627
2675
  PurchasesService
package/dist/index.mjs CHANGED
@@ -2515,6 +2515,45 @@ var ESimService = class extends BaseService {
2515
2515
  }
2516
2516
  };
2517
2517
 
2518
+ // src/services/i-frame/i-frame.ts
2519
+ import { z as z37 } from "zod";
2520
+
2521
+ // src/services/i-frame/models/token-ok-response.ts
2522
+ import { z as z36 } from "zod";
2523
+ var tokenOkResponse = z36.lazy(() => {
2524
+ return z36.object({
2525
+ token: z36.string().optional()
2526
+ });
2527
+ });
2528
+ var tokenOkResponseResponse = z36.lazy(() => {
2529
+ return z36.object({
2530
+ token: z36.string().optional()
2531
+ }).transform((data) => ({
2532
+ token: data["token"]
2533
+ }));
2534
+ });
2535
+ var tokenOkResponseRequest = z36.lazy(() => {
2536
+ return z36.object({ token: z36.string().nullish() }).transform((data) => ({
2537
+ token: data["token"]
2538
+ }));
2539
+ });
2540
+
2541
+ // src/services/i-frame/i-frame.ts
2542
+ var IFrameService = class extends BaseService {
2543
+ /**
2544
+ * Generate a new token to be used in the iFrame
2545
+ * @returns {Promise<HttpResponse<TokenOkResponse>>} Successful Response
2546
+ */
2547
+ async token(requestConfig) {
2548
+ const request = new RequestBuilder().setBaseUrl(this.config).setConfig(this.config).setMethod("POST").setPath("/iframe/token").setRequestSchema(z37.any()).setScopes([]).setTokenManager(this.tokenManager).setRequestContentType("json" /* Json */).addResponse({
2549
+ schema: tokenOkResponseResponse,
2550
+ contentType: "json" /* Json */,
2551
+ status: 200
2552
+ }).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
2553
+ return this.client.call(request);
2554
+ }
2555
+ };
2556
+
2518
2557
  // src/index.ts
2519
2558
  var Celitech = class {
2520
2559
  constructor(config) {
@@ -2530,6 +2569,7 @@ var Celitech = class {
2530
2569
  this.packages = new PackagesService(this.config, this.tokenManager);
2531
2570
  this.purchases = new PurchasesService(this.config, this.tokenManager);
2532
2571
  this.eSim = new ESimService(this.config, this.tokenManager);
2572
+ this.iFrame = new IFrameService(this.config, this.tokenManager);
2533
2573
  }
2534
2574
  set baseUrl(baseUrl) {
2535
2575
  this.oAuth.baseUrl = baseUrl;
@@ -2537,6 +2577,7 @@ var Celitech = class {
2537
2577
  this.packages.baseUrl = baseUrl;
2538
2578
  this.purchases.baseUrl = baseUrl;
2539
2579
  this.eSim.baseUrl = baseUrl;
2580
+ this.iFrame.baseUrl = baseUrl;
2540
2581
  }
2541
2582
  set environment(environment) {
2542
2583
  this.oAuth.baseUrl = environment;
@@ -2544,6 +2585,7 @@ var Celitech = class {
2544
2585
  this.packages.baseUrl = environment;
2545
2586
  this.purchases.baseUrl = environment;
2546
2587
  this.eSim.baseUrl = environment;
2588
+ this.iFrame.baseUrl = environment;
2547
2589
  }
2548
2590
  set timeoutMs(timeoutMs) {
2549
2591
  this.oAuth.timeoutMs = timeoutMs;
@@ -2551,6 +2593,7 @@ var Celitech = class {
2551
2593
  this.packages.timeoutMs = timeoutMs;
2552
2594
  this.purchases.timeoutMs = timeoutMs;
2553
2595
  this.eSim.timeoutMs = timeoutMs;
2596
+ this.iFrame.timeoutMs = timeoutMs;
2554
2597
  }
2555
2598
  set clientId(clientId) {
2556
2599
  this.oAuth.clientId = clientId;
@@ -2558,6 +2601,7 @@ var Celitech = class {
2558
2601
  this.packages.clientId = clientId;
2559
2602
  this.purchases.clientId = clientId;
2560
2603
  this.eSim.clientId = clientId;
2604
+ this.iFrame.clientId = clientId;
2561
2605
  }
2562
2606
  set clientSecret(clientSecret) {
2563
2607
  this.oAuth.clientSecret = clientSecret;
@@ -2565,6 +2609,7 @@ var Celitech = class {
2565
2609
  this.packages.clientSecret = clientSecret;
2566
2610
  this.purchases.clientSecret = clientSecret;
2567
2611
  this.eSim.clientSecret = clientSecret;
2612
+ this.iFrame.clientSecret = clientSecret;
2568
2613
  }
2569
2614
  set oAuthBaseUrl(oAuthBaseUrl) {
2570
2615
  this.oAuth.oAuthBaseUrl = oAuthBaseUrl;
@@ -2572,6 +2617,7 @@ var Celitech = class {
2572
2617
  this.packages.oAuthBaseUrl = oAuthBaseUrl;
2573
2618
  this.purchases.oAuthBaseUrl = oAuthBaseUrl;
2574
2619
  this.eSim.oAuthBaseUrl = oAuthBaseUrl;
2620
+ this.iFrame.oAuthBaseUrl = oAuthBaseUrl;
2575
2621
  }
2576
2622
  };
2577
2623
  export {
@@ -2579,6 +2625,7 @@ export {
2579
2625
  DestinationsService,
2580
2626
  ESimService,
2581
2627
  GrantType,
2628
+ IFrameService,
2582
2629
  OAuthService,
2583
2630
  PackagesService,
2584
2631
  PurchasesService
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "celitech-sdk",
3
- "version": "1.3.34",
3
+ "version": "1.3.38",
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",