celitech-sdk 1.3.64 → 2.0.0
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 +8 -9
- package/dist/index.d.ts +189 -62
- package/dist/index.js +440 -159
- package/dist/index.mjs +440 -159
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
# Celitech TypeScript SDK
|
|
1
|
+
# Celitech TypeScript SDK 2.0.0
|
|
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
|
-
[](https://liblab.com/?utm_source=readme)
|
|
6
|
-
|
|
7
5
|
## Versions
|
|
8
6
|
|
|
9
|
-
- API version: `
|
|
10
|
-
- SDK version: `
|
|
7
|
+
- API version: `2.0.0`
|
|
8
|
+
- SDK version: `2.0.0`
|
|
11
9
|
|
|
12
10
|
## About the API
|
|
13
11
|
|
|
@@ -53,15 +51,15 @@ yarn add celitech-sdk
|
|
|
53
51
|
|
|
54
52
|
### OAuth Authentication
|
|
55
53
|
|
|
56
|
-
The Celitech API uses OAuth for authentication.
|
|
54
|
+
The Celitech API uses OAuth 2.0 for authentication.
|
|
57
55
|
|
|
58
|
-
You need to provide
|
|
56
|
+
You need to provide your OAuth credentials when initializing the SDK. Tokens are automatically fetched, cached, and refreshed — you do not need to manage them yourself.
|
|
59
57
|
|
|
60
58
|
```ts
|
|
61
59
|
const sdk = new Celitech({ clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET' });
|
|
62
60
|
```
|
|
63
61
|
|
|
64
|
-
If you need to set or update the OAuth
|
|
62
|
+
If you need to set or update the OAuth credentials after the SDK initialization, you can use:
|
|
65
63
|
|
|
66
64
|
```ts
|
|
67
65
|
const sdk = new Celitech();
|
|
@@ -103,7 +101,7 @@ import { Celitech } from 'celitech-sdk';
|
|
|
103
101
|
clientSecret: 'CLIENT_SECRET',
|
|
104
102
|
});
|
|
105
103
|
|
|
106
|
-
const
|
|
104
|
+
const data = await celitech.destinations.listDestinations();
|
|
107
105
|
|
|
108
106
|
console.log(data);
|
|
109
107
|
})();
|
|
@@ -161,6 +159,7 @@ The SDK includes several models that represent the data structures used in API r
|
|
|
161
159
|
| TokenOkResponse | |
|
|
162
160
|
| BadRequest | |
|
|
163
161
|
| Unauthorized | |
|
|
162
|
+
| GrantType | |
|
|
164
163
|
|
|
165
164
|
</details>
|
|
166
165
|
|
package/dist/index.d.ts
CHANGED
|
@@ -172,6 +172,10 @@ declare class OAuthTokenManager {
|
|
|
172
172
|
declare class ThrowableError extends Error {
|
|
173
173
|
message: string;
|
|
174
174
|
protected response?: unknown;
|
|
175
|
+
/**
|
|
176
|
+
* Optional metadata about the HTTP response that triggered this error.
|
|
177
|
+
*/
|
|
178
|
+
metadata?: HttpMetadata;
|
|
175
179
|
/**
|
|
176
180
|
* Creates a new throwable error.
|
|
177
181
|
* @param message - The error message
|
|
@@ -230,8 +234,6 @@ interface CreateRequestParameters<Page = unknown[]> {
|
|
|
230
234
|
errors: ErrorDefinition[];
|
|
231
235
|
requestSchema: ZodType;
|
|
232
236
|
requestContentType: ContentType;
|
|
233
|
-
validation: ValidationOptions;
|
|
234
|
-
retry: RetryOptions;
|
|
235
237
|
pagination?: RequestPagination<Page> | RequestCursorPagination<Page>;
|
|
236
238
|
filename?: string;
|
|
237
239
|
filenames?: string[];
|
|
@@ -312,8 +314,6 @@ declare class Request<PageSchema = unknown[]> {
|
|
|
312
314
|
errors: ErrorDefinition[];
|
|
313
315
|
requestSchema: ZodType;
|
|
314
316
|
requestContentType: ContentType;
|
|
315
|
-
validation: ValidationOptions;
|
|
316
|
-
retry: RetryOptions;
|
|
317
317
|
pagination?: RequestPagination<PageSchema> | RequestCursorPagination<PageSchema>;
|
|
318
318
|
filename?: string;
|
|
319
319
|
filenames?: string[];
|
|
@@ -490,14 +490,14 @@ declare enum ContentType {
|
|
|
490
490
|
/** No content (HTTP 204) */
|
|
491
491
|
NoContent = "noContent"
|
|
492
492
|
}
|
|
493
|
-
interface RequestConfig {
|
|
494
|
-
retry?: RetryOptions;
|
|
495
|
-
validation?: ValidationOptions;
|
|
496
|
-
baseUrl?: string;
|
|
497
|
-
}
|
|
498
493
|
interface RetryOptions {
|
|
499
494
|
attempts: number;
|
|
500
495
|
delayMs?: number;
|
|
496
|
+
maxDelayMs?: number;
|
|
497
|
+
backoffFactor?: number;
|
|
498
|
+
jitterMs?: number;
|
|
499
|
+
statusCodesToRetry?: number[];
|
|
500
|
+
httpMethodsToRetry?: HttpMethod[];
|
|
501
501
|
}
|
|
502
502
|
interface ValidationOptions {
|
|
503
503
|
responseValidation?: boolean;
|
|
@@ -577,6 +577,13 @@ declare class HttpClient {
|
|
|
577
577
|
* @returns A promise that resolves to the HTTP response
|
|
578
578
|
*/
|
|
579
579
|
call<T>(request: Request): Promise<HttpResponse<T>>;
|
|
580
|
+
/**
|
|
581
|
+
* Executes a standard HTTP request and returns only the data directly.
|
|
582
|
+
* @template T - The expected response data type
|
|
583
|
+
* @param request - The HTTP request to execute
|
|
584
|
+
* @returns A promise that resolves to the response data
|
|
585
|
+
*/
|
|
586
|
+
callDirect<T>(request: Request): Promise<T>;
|
|
580
587
|
/**
|
|
581
588
|
* Executes a streaming HTTP request that yields responses incrementally.
|
|
582
589
|
* @template T - The expected response data type for each chunk
|
|
@@ -642,7 +649,36 @@ declare class BaseService {
|
|
|
642
649
|
protected tokenManager: OAuthTokenManager;
|
|
643
650
|
/** The HTTP client instance used to make API requests */
|
|
644
651
|
client: HttpClient;
|
|
652
|
+
/** Service-level configuration overrides */
|
|
653
|
+
protected serviceConfig?: Partial<SdkConfig>;
|
|
645
654
|
constructor(config: SdkConfig, tokenManager: OAuthTokenManager);
|
|
655
|
+
/**
|
|
656
|
+
* Sets service-level configuration that applies to all methods in this service.
|
|
657
|
+
* @param config - Partial configuration to override SDK-level defaults
|
|
658
|
+
* @returns This service instance for method chaining
|
|
659
|
+
*/
|
|
660
|
+
setConfig(config: Partial<SdkConfig>): this;
|
|
661
|
+
/**
|
|
662
|
+
* Recursively merges two objects. Plain nested objects are merged key-by-key so a
|
|
663
|
+
* partial override (e.g. `{ retry: { attempts: 5 } }`) only overwrites the specified
|
|
664
|
+
* keys instead of replacing the whole nested object. Arrays and non-plain values are
|
|
665
|
+
* replaced wholesale.
|
|
666
|
+
*
|
|
667
|
+
* Override keys with the value `undefined` are skipped so the base value is preserved,
|
|
668
|
+
* matching the common JS merge idiom (e.g. lodash.merge). To explicitly clear a key,
|
|
669
|
+
* assign `null` or omit the key from the override entirely.
|
|
670
|
+
*/
|
|
671
|
+
private static deepMerge;
|
|
672
|
+
private static isPlainObject;
|
|
673
|
+
/**
|
|
674
|
+
* Resolves configuration from the hierarchy: requestConfig > methodConfig > serviceConfig > sdkConfig
|
|
675
|
+
* Deep-merges all config levels so partial nested overrides (e.g. `{ retry: { attempts: 5 } }`)
|
|
676
|
+
* preserve unoverridden sibling keys from the SDK default.
|
|
677
|
+
* @param methodConfig - Method-level configuration override
|
|
678
|
+
* @param requestConfig - Request-level configuration override
|
|
679
|
+
* @returns Merged configuration with all overrides applied
|
|
680
|
+
*/
|
|
681
|
+
protected getResolvedConfig(methodConfig?: Partial<SdkConfig>, requestConfig?: Partial<SdkConfig>): SdkConfig;
|
|
646
682
|
set baseUrl(baseUrl: string);
|
|
647
683
|
set environment(environment: Environment);
|
|
648
684
|
set timeoutMs(timeoutMs: number);
|
|
@@ -702,12 +738,19 @@ type ListDestinationsOkResponse = z.infer<typeof listDestinationsOkResponse>;
|
|
|
702
738
|
* All methods return promises and handle request/response serialization automatically.
|
|
703
739
|
*/
|
|
704
740
|
declare class DestinationsService extends BaseService {
|
|
741
|
+
protected listDestinationsConfig?: Partial<SdkConfig>;
|
|
742
|
+
/**
|
|
743
|
+
* Sets method-level configuration for listDestinations.
|
|
744
|
+
* @param config - Partial configuration to override service-level defaults
|
|
745
|
+
* @returns This service instance for method chaining
|
|
746
|
+
*/
|
|
747
|
+
setListDestinationsConfig(config: Partial<SdkConfig>): this;
|
|
705
748
|
/**
|
|
706
749
|
* List Destinations
|
|
707
|
-
* @param {
|
|
750
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
708
751
|
* @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} - Successful Response
|
|
709
752
|
*/
|
|
710
|
-
listDestinations(requestConfig?:
|
|
753
|
+
listDestinations(requestConfig?: Partial<SdkConfig>): Promise<ListDestinationsOkResponse>;
|
|
711
754
|
}
|
|
712
755
|
|
|
713
756
|
/**
|
|
@@ -825,6 +868,13 @@ interface ListPackagesParams {
|
|
|
825
868
|
* All methods return promises and handle request/response serialization automatically.
|
|
826
869
|
*/
|
|
827
870
|
declare class PackagesService extends BaseService {
|
|
871
|
+
protected listPackagesConfig?: Partial<SdkConfig>;
|
|
872
|
+
/**
|
|
873
|
+
* Sets method-level configuration for listPackages.
|
|
874
|
+
* @param config - Partial configuration to override service-level defaults
|
|
875
|
+
* @returns This service instance for method chaining
|
|
876
|
+
*/
|
|
877
|
+
setListPackagesConfig(config: Partial<SdkConfig>): this;
|
|
828
878
|
/**
|
|
829
879
|
* List Packages
|
|
830
880
|
* @param {string} [params.destination] - ISO representation of the package's destination. Supports both ISO2 (e.g., 'FR') and ISO3 (e.g., 'FRA') country codes.
|
|
@@ -834,10 +884,10 @@ declare class PackagesService extends BaseService {
|
|
|
834
884
|
* @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
|
|
835
885
|
* @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
|
|
836
886
|
* @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
|
|
837
|
-
* @param {
|
|
887
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
838
888
|
* @returns {Promise<HttpResponse<ListPackagesOkResponse>>} - Successful Response
|
|
839
889
|
*/
|
|
840
|
-
listPackages(params?: ListPackagesParams, requestConfig?:
|
|
890
|
+
listPackages(params?: ListPackagesParams, requestConfig?: Partial<SdkConfig>): Promise<ListPackagesOkResponse>;
|
|
841
891
|
}
|
|
842
892
|
|
|
843
893
|
/**
|
|
@@ -1568,12 +1618,54 @@ type GetPurchaseConsumptionOkResponse = z.infer<typeof getPurchaseConsumptionOkR
|
|
|
1568
1618
|
* All methods return promises and handle request/response serialization automatically.
|
|
1569
1619
|
*/
|
|
1570
1620
|
declare class PurchasesService extends BaseService {
|
|
1621
|
+
protected createPurchaseV2Config?: Partial<SdkConfig>;
|
|
1622
|
+
protected listPurchasesConfig?: Partial<SdkConfig>;
|
|
1623
|
+
protected createPurchaseConfig?: Partial<SdkConfig>;
|
|
1624
|
+
protected topUpEsimConfig?: Partial<SdkConfig>;
|
|
1625
|
+
protected editPurchaseConfig?: Partial<SdkConfig>;
|
|
1626
|
+
protected getPurchaseConsumptionConfig?: Partial<SdkConfig>;
|
|
1627
|
+
/**
|
|
1628
|
+
* Sets method-level configuration for createPurchaseV2.
|
|
1629
|
+
* @param config - Partial configuration to override service-level defaults
|
|
1630
|
+
* @returns This service instance for method chaining
|
|
1631
|
+
*/
|
|
1632
|
+
setCreatePurchaseV2Config(config: Partial<SdkConfig>): this;
|
|
1633
|
+
/**
|
|
1634
|
+
* Sets method-level configuration for listPurchases.
|
|
1635
|
+
* @param config - Partial configuration to override service-level defaults
|
|
1636
|
+
* @returns This service instance for method chaining
|
|
1637
|
+
*/
|
|
1638
|
+
setListPurchasesConfig(config: Partial<SdkConfig>): this;
|
|
1639
|
+
/**
|
|
1640
|
+
* Sets method-level configuration for createPurchase.
|
|
1641
|
+
* @param config - Partial configuration to override service-level defaults
|
|
1642
|
+
* @returns This service instance for method chaining
|
|
1643
|
+
*/
|
|
1644
|
+
setCreatePurchaseConfig(config: Partial<SdkConfig>): this;
|
|
1645
|
+
/**
|
|
1646
|
+
* Sets method-level configuration for topUpEsim.
|
|
1647
|
+
* @param config - Partial configuration to override service-level defaults
|
|
1648
|
+
* @returns This service instance for method chaining
|
|
1649
|
+
*/
|
|
1650
|
+
setTopUpEsimConfig(config: Partial<SdkConfig>): this;
|
|
1651
|
+
/**
|
|
1652
|
+
* Sets method-level configuration for editPurchase.
|
|
1653
|
+
* @param config - Partial configuration to override service-level defaults
|
|
1654
|
+
* @returns This service instance for method chaining
|
|
1655
|
+
*/
|
|
1656
|
+
setEditPurchaseConfig(config: Partial<SdkConfig>): this;
|
|
1657
|
+
/**
|
|
1658
|
+
* Sets method-level configuration for getPurchaseConsumption.
|
|
1659
|
+
* @param config - Partial configuration to override service-level defaults
|
|
1660
|
+
* @returns This service instance for method chaining
|
|
1661
|
+
*/
|
|
1662
|
+
setGetPurchaseConsumptionConfig(config: Partial<SdkConfig>): this;
|
|
1571
1663
|
/**
|
|
1572
1664
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
|
1573
|
-
* @param {
|
|
1665
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
1574
1666
|
* @returns {Promise<HttpResponse<CreatePurchaseV2OkResponse[]>>} - Successful Response
|
|
1575
1667
|
*/
|
|
1576
|
-
createPurchaseV2(body: CreatePurchaseV2Request, requestConfig?:
|
|
1668
|
+
createPurchaseV2(body: CreatePurchaseV2Request, requestConfig?: Partial<SdkConfig>): Promise<CreatePurchaseV2OkResponse[]>;
|
|
1577
1669
|
/**
|
|
1578
1670
|
* This endpoint can be used to list all the successful purchases made between a given interval.
|
|
1579
1671
|
* @param {string} [params.purchaseId] - ID of the purchase
|
|
@@ -1586,22 +1678,22 @@ declare class PurchasesService extends BaseService {
|
|
|
1586
1678
|
* @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
|
|
1587
1679
|
* @param {number} [params.after] - Epoch value representing the start of the time interval for filtering purchases
|
|
1588
1680
|
* @param {number} [params.before] - Epoch value representing the end of the time interval for filtering purchases
|
|
1589
|
-
* @param {
|
|
1681
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
1590
1682
|
* @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} - Successful Response
|
|
1591
1683
|
*/
|
|
1592
|
-
listPurchases(params?: ListPurchasesParams, requestConfig?:
|
|
1684
|
+
listPurchases(params?: ListPurchasesParams, requestConfig?: Partial<SdkConfig>): Promise<ListPurchasesOkResponse>;
|
|
1593
1685
|
/**
|
|
1594
1686
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
|
1595
|
-
* @param {
|
|
1687
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
1596
1688
|
* @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} - Successful Response
|
|
1597
1689
|
*/
|
|
1598
|
-
createPurchase(body: CreatePurchaseRequest, requestConfig?:
|
|
1690
|
+
createPurchase(body: CreatePurchaseRequest, requestConfig?: Partial<SdkConfig>): Promise<CreatePurchaseOkResponse>;
|
|
1599
1691
|
/**
|
|
1600
1692
|
* This endpoint is used to top-up an existing eSIM with the previously associated destination by providing its ICCID and package details. To determine if an eSIM can be topped up, use the Get eSIM endpoint, which returns the `isTopUpAllowed` flag.
|
|
1601
|
-
* @param {
|
|
1693
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
1602
1694
|
* @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} - Successful Response
|
|
1603
1695
|
*/
|
|
1604
|
-
topUpEsim(body: TopUpEsimRequest, requestConfig?:
|
|
1696
|
+
topUpEsim(body: TopUpEsimRequest, requestConfig?: Partial<SdkConfig>): Promise<TopUpEsimOkResponse>;
|
|
1605
1697
|
/**
|
|
1606
1698
|
* This endpoint allows you to modify the validity dates of an existing purchase.
|
|
1607
1699
|
**Behavior:**
|
|
@@ -1611,17 +1703,17 @@ declare class PurchasesService extends BaseService {
|
|
|
1611
1703
|
|
|
1612
1704
|
The end date can be extended or shortened as long as it adheres to the same pricing category and does not exceed the allowed duration limits.
|
|
1613
1705
|
|
|
1614
|
-
* @param {
|
|
1706
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
1615
1707
|
* @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} - Successful Response
|
|
1616
1708
|
*/
|
|
1617
|
-
editPurchase(body: EditPurchaseRequest, requestConfig?:
|
|
1709
|
+
editPurchase(body: EditPurchaseRequest, requestConfig?: Partial<SdkConfig>): Promise<EditPurchaseOkResponse>;
|
|
1618
1710
|
/**
|
|
1619
1711
|
* 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.
|
|
1620
1712
|
* @param {string} purchaseId - ID of the purchase
|
|
1621
|
-
* @param {
|
|
1713
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
1622
1714
|
* @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} - Successful Response
|
|
1623
1715
|
*/
|
|
1624
|
-
getPurchaseConsumption(purchaseId: string, requestConfig?:
|
|
1716
|
+
getPurchaseConsumption(purchaseId: string, requestConfig?: Partial<SdkConfig>): Promise<GetPurchaseConsumptionOkResponse>;
|
|
1625
1717
|
}
|
|
1626
1718
|
|
|
1627
1719
|
/**
|
|
@@ -2188,27 +2280,48 @@ type GetEsimHistoryOkResponse = z.infer<typeof getEsimHistoryOkResponse>;
|
|
|
2188
2280
|
* All methods return promises and handle request/response serialization automatically.
|
|
2189
2281
|
*/
|
|
2190
2282
|
declare class ESimService extends BaseService {
|
|
2283
|
+
protected getEsimConfig?: Partial<SdkConfig>;
|
|
2284
|
+
protected getEsimDeviceConfig?: Partial<SdkConfig>;
|
|
2285
|
+
protected getEsimHistoryConfig?: Partial<SdkConfig>;
|
|
2286
|
+
/**
|
|
2287
|
+
* Sets method-level configuration for getEsim.
|
|
2288
|
+
* @param config - Partial configuration to override service-level defaults
|
|
2289
|
+
* @returns This service instance for method chaining
|
|
2290
|
+
*/
|
|
2291
|
+
setGetEsimConfig(config: Partial<SdkConfig>): this;
|
|
2292
|
+
/**
|
|
2293
|
+
* Sets method-level configuration for getEsimDevice.
|
|
2294
|
+
* @param config - Partial configuration to override service-level defaults
|
|
2295
|
+
* @returns This service instance for method chaining
|
|
2296
|
+
*/
|
|
2297
|
+
setGetEsimDeviceConfig(config: Partial<SdkConfig>): this;
|
|
2298
|
+
/**
|
|
2299
|
+
* Sets method-level configuration for getEsimHistory.
|
|
2300
|
+
* @param config - Partial configuration to override service-level defaults
|
|
2301
|
+
* @returns This service instance for method chaining
|
|
2302
|
+
*/
|
|
2303
|
+
setGetEsimHistoryConfig(config: Partial<SdkConfig>): this;
|
|
2191
2304
|
/**
|
|
2192
2305
|
* Get eSIM
|
|
2193
2306
|
* @param {string} params.iccid - ID of the eSIM
|
|
2194
|
-
* @param {
|
|
2307
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
2195
2308
|
* @returns {Promise<HttpResponse<GetEsimOkResponse>>} - Successful Response
|
|
2196
2309
|
*/
|
|
2197
|
-
getEsim(params: GetEsimParams, requestConfig?:
|
|
2310
|
+
getEsim(params: GetEsimParams, requestConfig?: Partial<SdkConfig>): Promise<GetEsimOkResponse>;
|
|
2198
2311
|
/**
|
|
2199
2312
|
* Get eSIM Device
|
|
2200
2313
|
* @param {string} iccid - ID of the eSIM
|
|
2201
|
-
* @param {
|
|
2314
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
2202
2315
|
* @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} - Successful Response
|
|
2203
2316
|
*/
|
|
2204
|
-
getEsimDevice(iccid: string, requestConfig?:
|
|
2317
|
+
getEsimDevice(iccid: string, requestConfig?: Partial<SdkConfig>): Promise<GetEsimDeviceOkResponse>;
|
|
2205
2318
|
/**
|
|
2206
2319
|
* Get eSIM History
|
|
2207
2320
|
* @param {string} iccid - ID of the eSIM
|
|
2208
|
-
* @param {
|
|
2321
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
2209
2322
|
* @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} - Successful Response
|
|
2210
2323
|
*/
|
|
2211
|
-
getEsimHistory(iccid: string, requestConfig?:
|
|
2324
|
+
getEsimHistory(iccid: string, requestConfig?: Partial<SdkConfig>): Promise<GetEsimHistoryOkResponse>;
|
|
2212
2325
|
}
|
|
2213
2326
|
|
|
2214
2327
|
/**
|
|
@@ -2380,67 +2493,74 @@ type TokenOkResponse = z.infer<typeof tokenOkResponse>;
|
|
|
2380
2493
|
* All methods return promises and handle request/response serialization automatically.
|
|
2381
2494
|
*/
|
|
2382
2495
|
declare class IFrameService extends BaseService {
|
|
2496
|
+
protected tokenConfig?: Partial<SdkConfig>;
|
|
2497
|
+
/**
|
|
2498
|
+
* Sets method-level configuration for token.
|
|
2499
|
+
* @param config - Partial configuration to override service-level defaults
|
|
2500
|
+
* @returns This service instance for method chaining
|
|
2501
|
+
*/
|
|
2502
|
+
setTokenConfig(config: Partial<SdkConfig>): this;
|
|
2383
2503
|
/**
|
|
2384
2504
|
* Generate a new token to be used in the iFrame
|
|
2385
|
-
* @param {
|
|
2505
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
2386
2506
|
* @returns {Promise<HttpResponse<TokenOkResponse>>} - Successful Response
|
|
2387
2507
|
*/
|
|
2388
|
-
token(requestConfig?:
|
|
2508
|
+
token(requestConfig?: Partial<SdkConfig>): Promise<TokenOkResponse>;
|
|
2389
2509
|
}
|
|
2390
2510
|
|
|
2391
2511
|
/**
|
|
2392
|
-
* Zod schema for the
|
|
2512
|
+
* Zod schema for the OAuthTokenRequest model.
|
|
2393
2513
|
* Defines the structure and validation rules for this data type.
|
|
2394
2514
|
* This is the shape used in application code - what developers interact with.
|
|
2395
2515
|
*/
|
|
2396
|
-
declare const
|
|
2397
|
-
grantType: z.
|
|
2398
|
-
clientId: z.
|
|
2399
|
-
clientSecret: z.
|
|
2516
|
+
declare const oAuthTokenRequest: z.ZodLazy<z.ZodObject<{
|
|
2517
|
+
grantType: z.ZodString;
|
|
2518
|
+
clientId: z.ZodString;
|
|
2519
|
+
clientSecret: z.ZodString;
|
|
2520
|
+
scope: z.ZodString;
|
|
2400
2521
|
}, "strip", z.ZodTypeAny, {
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2522
|
+
clientId: string;
|
|
2523
|
+
clientSecret: string;
|
|
2524
|
+
grantType: string;
|
|
2525
|
+
scope: string;
|
|
2404
2526
|
}, {
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2527
|
+
clientId: string;
|
|
2528
|
+
clientSecret: string;
|
|
2529
|
+
grantType: string;
|
|
2530
|
+
scope: string;
|
|
2408
2531
|
}>>;
|
|
2409
2532
|
/**
|
|
2410
2533
|
*
|
|
2411
|
-
* @typedef {
|
|
2534
|
+
* @typedef {OAuthTokenRequest} oAuthTokenRequest
|
|
2412
2535
|
* @property {GrantType}
|
|
2413
2536
|
* @property {string}
|
|
2414
2537
|
* @property {string}
|
|
2538
|
+
* @property {string}
|
|
2415
2539
|
*/
|
|
2416
|
-
type
|
|
2540
|
+
type OAuthTokenRequest = z.infer<typeof oAuthTokenRequest>;
|
|
2417
2541
|
|
|
2418
2542
|
/**
|
|
2419
|
-
* Zod schema for the
|
|
2543
|
+
* Zod schema for the OAuthTokenResponse model.
|
|
2420
2544
|
* Defines the structure and validation rules for this data type.
|
|
2421
2545
|
* This is the shape used in application code - what developers interact with.
|
|
2422
2546
|
*/
|
|
2423
|
-
declare const
|
|
2547
|
+
declare const oAuthTokenResponse: z.ZodLazy<z.ZodObject<{
|
|
2424
2548
|
accessToken: z.ZodOptional<z.ZodString>;
|
|
2425
|
-
|
|
2426
|
-
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
2549
|
+
expiresIn: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
2427
2550
|
}, "strip", z.ZodTypeAny, {
|
|
2428
2551
|
accessToken?: string | undefined;
|
|
2429
|
-
|
|
2430
|
-
expiresIn?: number | undefined;
|
|
2552
|
+
expiresIn?: number | null | undefined;
|
|
2431
2553
|
}, {
|
|
2432
2554
|
accessToken?: string | undefined;
|
|
2433
|
-
|
|
2434
|
-
expiresIn?: number | undefined;
|
|
2555
|
+
expiresIn?: number | null | undefined;
|
|
2435
2556
|
}>>;
|
|
2436
2557
|
/**
|
|
2437
2558
|
*
|
|
2438
|
-
* @typedef {
|
|
2439
|
-
* @property {string}
|
|
2559
|
+
* @typedef {OAuthTokenResponse} oAuthTokenResponse
|
|
2440
2560
|
* @property {string}
|
|
2441
2561
|
* @property {number}
|
|
2442
2562
|
*/
|
|
2443
|
-
type
|
|
2563
|
+
type OAuthTokenResponse = z.infer<typeof oAuthTokenResponse>;
|
|
2444
2564
|
|
|
2445
2565
|
/**
|
|
2446
2566
|
* Service class for OAuthService operations.
|
|
@@ -2448,12 +2568,19 @@ type GetAccessTokenOkResponse = z.infer<typeof getAccessTokenOkResponse>;
|
|
|
2448
2568
|
* All methods return promises and handle request/response serialization automatically.
|
|
2449
2569
|
*/
|
|
2450
2570
|
declare class OAuthService extends BaseService {
|
|
2571
|
+
protected getAccessTokenConfig?: Partial<SdkConfig>;
|
|
2451
2572
|
/**
|
|
2452
|
-
*
|
|
2453
|
-
* @param
|
|
2454
|
-
* @returns
|
|
2573
|
+
* Sets method-level configuration for getAccessToken.
|
|
2574
|
+
* @param config - Partial configuration to override service-level defaults
|
|
2575
|
+
* @returns This service instance for method chaining
|
|
2576
|
+
*/
|
|
2577
|
+
setGetAccessTokenConfig(config: Partial<SdkConfig>): this;
|
|
2578
|
+
/**
|
|
2579
|
+
*
|
|
2580
|
+
* @param {Partial<SdkConfig>} [requestConfig] - The request configuration for retry and validation.
|
|
2581
|
+
* @returns {Promise<HttpResponse<OAuthTokenResponse>>} - OAuth token
|
|
2455
2582
|
*/
|
|
2456
|
-
getAccessToken(body:
|
|
2583
|
+
getAccessToken(body: OAuthTokenRequest, requestConfig?: Partial<SdkConfig>): Promise<OAuthTokenResponse>;
|
|
2457
2584
|
}
|
|
2458
2585
|
|
|
2459
2586
|
declare enum GrantType {
|
|
@@ -2492,4 +2619,4 @@ declare class Celitech {
|
|
|
2492
2619
|
set accessToken(accessToken: string);
|
|
2493
2620
|
}
|
|
2494
2621
|
|
|
2495
|
-
export { BadRequest, Celitech, CreatePurchaseOkResponse, CreatePurchaseOkResponseProfile, CreatePurchaseOkResponsePurchase, CreatePurchaseRequest, CreatePurchaseRequestLanguage, CreatePurchaseV2OkResponse, CreatePurchaseV2OkResponseProfile, CreatePurchaseV2OkResponsePurchase, CreatePurchaseV2Request, CreatePurchaseV2RequestLanguage, Destinations, DestinationsService, Device, ESimService, EditPurchaseOkResponse, EditPurchaseRequest, Environment,
|
|
2622
|
+
export { BadRequest, Celitech, CreatePurchaseOkResponse, CreatePurchaseOkResponseProfile, CreatePurchaseOkResponsePurchase, CreatePurchaseRequest, CreatePurchaseRequestLanguage, CreatePurchaseV2OkResponse, CreatePurchaseV2OkResponseProfile, CreatePurchaseV2OkResponsePurchase, CreatePurchaseV2Request, CreatePurchaseV2RequestLanguage, Destinations, DestinationsService, Device, ESimService, EditPurchaseOkResponse, EditPurchaseRequest, Environment, GetEsimDeviceOkResponse, GetEsimHistoryOkResponse, GetEsimHistoryOkResponseEsim, GetEsimOkResponse, GetEsimOkResponseEsim, GetPurchaseConsumptionOkResponse, GrantType, History, HttpError, HttpMetadata, HttpMethod, HttpResponse, IFrameService, ListDestinationsOkResponse, ListPackagesOkResponse, ListPurchasesOkResponse, OAuthService, OAuthTokenRequest, OAuthTokenResponse, Package_, Packages, PackagesService, Purchases, PurchasesEsim, PurchasesService, RetryOptions, SdkConfig, TokenOkResponse, TopUpEsimOkResponse, TopUpEsimOkResponseProfile, TopUpEsimOkResponsePurchase, TopUpEsimRequest, Unauthorized, ValidationOptions };
|