celitech-sdk 1.3.61 → 1.3.64
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/LICENSE +1 -1
- package/README.md +7 -7
- package/dist/index.d.ts +602 -41
- package/dist/index.js +695 -19
- package/dist/index.mjs +693 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,81 +1,221 @@
|
|
|
1
1
|
import { ZodType, z } from 'zod';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Available API environments with their base URLs.
|
|
5
|
+
* Use these constants to configure the SDK for different environments (production, staging, etc.).
|
|
6
|
+
*/
|
|
3
7
|
declare enum Environment {
|
|
8
|
+
/** DEFAULT environment base URL */
|
|
4
9
|
DEFAULT = "https://api.celitech.net/v1"
|
|
5
10
|
}
|
|
6
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Standard HTTP methods supported by the SDK.
|
|
14
|
+
*/
|
|
7
15
|
type HttpMethod$1 = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
16
|
+
/**
|
|
17
|
+
* Represents an HTTP request with all its components.
|
|
18
|
+
*/
|
|
8
19
|
interface HttpRequest {
|
|
20
|
+
/** Base URL of the API endpoint */
|
|
9
21
|
baseUrl: string;
|
|
22
|
+
/** HTTP method for the request */
|
|
10
23
|
method: HttpMethod$1;
|
|
24
|
+
/** Request path (relative to base URL) */
|
|
11
25
|
path: string;
|
|
26
|
+
/** Request headers as key-value pairs */
|
|
12
27
|
headers: Map<string, unknown>;
|
|
28
|
+
/** Request body payload (optional) */
|
|
13
29
|
body?: BodyInit;
|
|
30
|
+
/** Signal to abort the request (optional) */
|
|
14
31
|
abortSignal?: AbortSignal;
|
|
32
|
+
/** Query string parameters */
|
|
15
33
|
queryParams: Map<string, unknown>;
|
|
34
|
+
/** Path parameters for URL templating */
|
|
16
35
|
pathParams: Map<string, unknown>;
|
|
17
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Metadata about an HTTP response.
|
|
39
|
+
*/
|
|
18
40
|
interface HttpMetadata$1 {
|
|
41
|
+
/** HTTP status code */
|
|
19
42
|
status: number;
|
|
43
|
+
/** HTTP status text message */
|
|
20
44
|
statusText: string;
|
|
45
|
+
/** Response headers as key-value pairs */
|
|
21
46
|
headers: Record<string, string>;
|
|
22
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Represents an HTTP response with typed data.
|
|
50
|
+
* @template T - The type of the response data
|
|
51
|
+
*/
|
|
23
52
|
interface HttpResponse$1<T> {
|
|
53
|
+
/** Parsed response data (optional) */
|
|
24
54
|
data?: T;
|
|
55
|
+
/** Response metadata (status, headers, etc.) */
|
|
25
56
|
metadata: HttpMetadata$1;
|
|
57
|
+
/** Raw response object from the HTTP client */
|
|
26
58
|
raw: ArrayBuffer;
|
|
27
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Represents an HTTP error response.
|
|
62
|
+
*/
|
|
28
63
|
interface HttpError$1 {
|
|
64
|
+
/** Error message or description */
|
|
29
65
|
error: string;
|
|
66
|
+
/** Response metadata (status, headers, etc.) */
|
|
30
67
|
metadata: HttpMetadata$1;
|
|
31
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Hook interface for intercepting and modifying HTTP requests and responses.
|
|
71
|
+
* Allows custom logic to be executed at different stages of the request lifecycle.
|
|
72
|
+
*/
|
|
32
73
|
interface Hook {
|
|
74
|
+
/**
|
|
75
|
+
* Called before an HTTP request is sent.
|
|
76
|
+
* Allows modification of the request before execution.
|
|
77
|
+
* @param request - The HTTP request to be sent
|
|
78
|
+
* @param params - Additional custom parameters
|
|
79
|
+
* @returns A promise that resolves to the potentially modified request
|
|
80
|
+
*/
|
|
33
81
|
beforeRequest(request: HttpRequest, params: Map<string, string>): Promise<HttpRequest>;
|
|
82
|
+
/**
|
|
83
|
+
* Called after a successful HTTP response is received.
|
|
84
|
+
* Allows processing or modification of the response.
|
|
85
|
+
* @param request - The original HTTP request
|
|
86
|
+
* @param response - The HTTP response received
|
|
87
|
+
* @param params - Additional custom parameters
|
|
88
|
+
* @returns A promise that resolves to the potentially modified response
|
|
89
|
+
*/
|
|
34
90
|
afterResponse(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpResponse$1<any>>;
|
|
91
|
+
/**
|
|
92
|
+
* Called when an HTTP request results in an error.
|
|
93
|
+
* Allows custom error handling and transformation.
|
|
94
|
+
* @param request - The original HTTP request
|
|
95
|
+
* @param response - The error response received
|
|
96
|
+
* @param params - Additional custom parameters
|
|
97
|
+
* @returns A promise that resolves to an error object
|
|
98
|
+
*/
|
|
35
99
|
onError(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpError$1>;
|
|
36
100
|
}
|
|
37
101
|
|
|
102
|
+
/**
|
|
103
|
+
* OpenAPI parameter serialization styles.
|
|
104
|
+
* Defines how parameters should be formatted in the request.
|
|
105
|
+
*/
|
|
38
106
|
declare enum SerializationStyle {
|
|
107
|
+
/** Simple comma-separated values (e.g., "3,4,5") */
|
|
39
108
|
SIMPLE = "simple",
|
|
109
|
+
/** Label prefix with dot notation (e.g., ".3.4.5") */
|
|
40
110
|
LABEL = "label",
|
|
111
|
+
/** Matrix semicolon-prefixed (e.g., ";id=3;id=4") */
|
|
41
112
|
MATRIX = "matrix",
|
|
113
|
+
/** Form-style ampersand-separated (e.g., "id=3&id=4") */
|
|
42
114
|
FORM = "form",
|
|
115
|
+
/** Space-delimited values (e.g., "id=3 4 5") */
|
|
43
116
|
SPACE_DELIMITED = "space_delimited",
|
|
117
|
+
/** Pipe-delimited values (e.g., "id=3|4|5") */
|
|
44
118
|
PIPE_DELIMITED = "pipe_delimited",
|
|
119
|
+
/** Deep object notation (e.g., "id[role]=admin") */
|
|
45
120
|
DEEP_OBJECT = "deep_object",
|
|
121
|
+
/** No specific style applied */
|
|
46
122
|
NONE = "none"
|
|
47
123
|
}
|
|
48
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Represents an OAuth 2.0 access token with its associated metadata.
|
|
127
|
+
* Stores the token, granted scopes, and expiration time.
|
|
128
|
+
*/
|
|
49
129
|
declare class OAuthToken {
|
|
50
130
|
accessToken: string;
|
|
51
131
|
scopes: Set<string>;
|
|
52
132
|
expiresAt: number | null;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new OAuth token.
|
|
135
|
+
* @param accessToken - The access token string
|
|
136
|
+
* @param scopes - Set of OAuth scopes granted to this token
|
|
137
|
+
* @param expiresAt - Timestamp when the token expires (milliseconds since epoch), or null if no expiration
|
|
138
|
+
*/
|
|
53
139
|
constructor(accessToken: string, scopes: Set<string>, expiresAt: number | null);
|
|
140
|
+
/**
|
|
141
|
+
* Checks if this token has all the required scopes.
|
|
142
|
+
* @param scopes - Set of scopes to check for
|
|
143
|
+
* @returns True if the token has all required scopes, false otherwise
|
|
144
|
+
*/
|
|
54
145
|
hasAllScopes(scopes: Set<string>): boolean;
|
|
55
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Manages OAuth 2.0 access tokens for the SDK.
|
|
149
|
+
* Handles token retrieval, caching, and automatic refresh when tokens expire.
|
|
150
|
+
* Implements a singleton pattern to share tokens across the SDK.
|
|
151
|
+
*/
|
|
56
152
|
declare class OAuthTokenManager {
|
|
153
|
+
/** Singleton instance of the token manager */
|
|
57
154
|
private static instance;
|
|
155
|
+
/** Currently cached OAuth token */
|
|
58
156
|
private token?;
|
|
157
|
+
/**
|
|
158
|
+
* Gets a valid access token for the specified scopes.
|
|
159
|
+
* Returns a cached token if available and not expired, otherwise requests a new one.
|
|
160
|
+
* @param scopes - Set of OAuth scopes required for the token
|
|
161
|
+
* @param config - SDK configuration containing client credentials
|
|
162
|
+
* @returns A promise that resolves to a valid OAuth token
|
|
163
|
+
* @throws Error if client credentials are missing or token request fails
|
|
164
|
+
*/
|
|
59
165
|
getToken(scopes: Set<string>, config: SdkConfig): Promise<OAuthToken>;
|
|
60
166
|
}
|
|
61
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Error class that can be thrown explicitly via a throw() method.
|
|
170
|
+
* Extends the built-in Error class with a convenience method for throwing.
|
|
171
|
+
*/
|
|
62
172
|
declare class ThrowableError extends Error {
|
|
63
173
|
message: string;
|
|
64
174
|
protected response?: unknown;
|
|
175
|
+
/**
|
|
176
|
+
* Creates a new throwable error.
|
|
177
|
+
* @param message - The error message
|
|
178
|
+
* @param response - Optional response data associated with the error
|
|
179
|
+
*/
|
|
65
180
|
constructor(message: string, response?: unknown);
|
|
181
|
+
/**
|
|
182
|
+
* Throws this error instance.
|
|
183
|
+
* Convenience method for explicitly throwing the error.
|
|
184
|
+
* @throws This error instance
|
|
185
|
+
*/
|
|
66
186
|
throw(): void;
|
|
67
187
|
}
|
|
68
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Defines an expected response format with schema validation.
|
|
191
|
+
* Used to match and validate responses based on content type and status code.
|
|
192
|
+
*/
|
|
69
193
|
interface ResponseDefinition {
|
|
194
|
+
/** Zod schema for validating the response body */
|
|
70
195
|
schema: ZodType;
|
|
196
|
+
/** The content type of this response (e.g., 'application/json') */
|
|
71
197
|
contentType: ContentType;
|
|
198
|
+
/** The HTTP status code this definition applies to */
|
|
72
199
|
status: number;
|
|
73
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Defines an error response format with custom error class.
|
|
203
|
+
* Used to throw typed errors based on content type and status code.
|
|
204
|
+
*/
|
|
74
205
|
interface ErrorDefinition {
|
|
206
|
+
/** Constructor for the error class to instantiate */
|
|
75
207
|
error: new (...args: any[]) => ThrowableError;
|
|
208
|
+
/** The content type of this error response */
|
|
76
209
|
contentType: ContentType;
|
|
210
|
+
/** The HTTP status code this error applies to */
|
|
77
211
|
status: number;
|
|
78
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Parameters required to create a Request instance.
|
|
215
|
+
* Contains all configuration needed for HTTP execution, validation, and error handling.
|
|
216
|
+
*
|
|
217
|
+
* @template Page - The type of paginated data items
|
|
218
|
+
*/
|
|
79
219
|
interface CreateRequestParameters<Page = unknown[]> {
|
|
80
220
|
baseUrl: string;
|
|
81
221
|
method: HttpMethod;
|
|
@@ -83,6 +223,7 @@ interface CreateRequestParameters<Page = unknown[]> {
|
|
|
83
223
|
headers: Map<string, RequestParameter>;
|
|
84
224
|
queryParams: Map<string, RequestParameter>;
|
|
85
225
|
pathParams: Map<string, RequestParameter>;
|
|
226
|
+
cookies: Map<string, RequestParameter>;
|
|
86
227
|
path: string;
|
|
87
228
|
config: SdkConfig;
|
|
88
229
|
responses: ResponseDefinition[];
|
|
@@ -97,33 +238,72 @@ interface CreateRequestParameters<Page = unknown[]> {
|
|
|
97
238
|
scopes?: Set<string>;
|
|
98
239
|
tokenManager: OAuthTokenManager;
|
|
99
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Represents a request parameter with serialization metadata.
|
|
243
|
+
* Wraps a value with OpenAPI serialization instructions for proper encoding.
|
|
244
|
+
*/
|
|
100
245
|
interface RequestParameter {
|
|
246
|
+
/** The parameter name (may be undefined for path substitution) */
|
|
101
247
|
key: string | undefined;
|
|
248
|
+
/** The actual parameter value */
|
|
102
249
|
value: unknown;
|
|
250
|
+
/** Whether to explode arrays/objects into multiple parameters */
|
|
103
251
|
explode: boolean;
|
|
252
|
+
/** Whether to URL-encode the value */
|
|
104
253
|
encode: boolean;
|
|
254
|
+
/** The OpenAPI serialization style (e.g., SIMPLE, FORM, MATRIX) */
|
|
105
255
|
style: SerializationStyle;
|
|
256
|
+
/** Whether this parameter is a pagination limit */
|
|
106
257
|
isLimit: boolean;
|
|
258
|
+
/** Whether this parameter is a pagination offset */
|
|
107
259
|
isOffset: boolean;
|
|
260
|
+
/** Whether this parameter is a pagination cursor */
|
|
108
261
|
isCursor: boolean;
|
|
109
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Configuration for limit-offset pagination.
|
|
265
|
+
* Used for traditional page-based pagination with size and offset.
|
|
266
|
+
*
|
|
267
|
+
* @template Page - The type of page data
|
|
268
|
+
*/
|
|
110
269
|
interface RequestPagination<Page> {
|
|
270
|
+
/** The number of items per page */
|
|
111
271
|
pageSize?: number;
|
|
272
|
+
/** JSON path to extract page data from response */
|
|
112
273
|
pagePath: string[];
|
|
274
|
+
/** Zod schema for validating page data */
|
|
113
275
|
pageSchema?: ZodType<Page, any, any>;
|
|
114
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* Configuration for cursor-based pagination.
|
|
279
|
+
* Used for stateless pagination with cursor tokens.
|
|
280
|
+
*
|
|
281
|
+
* @template Page - The type of page data
|
|
282
|
+
*/
|
|
115
283
|
interface RequestCursorPagination<Page> {
|
|
284
|
+
/** JSON path to extract page data from response */
|
|
116
285
|
pagePath: string[];
|
|
286
|
+
/** Zod schema for validating page data */
|
|
117
287
|
pageSchema?: ZodType<Page, any, any>;
|
|
288
|
+
/** JSON path to extract next cursor from response */
|
|
118
289
|
cursorPath: string[];
|
|
290
|
+
/** Zod schema for validating cursor value */
|
|
119
291
|
cursorSchema?: ZodType<string | null | undefined>;
|
|
120
292
|
}
|
|
121
293
|
|
|
294
|
+
/**
|
|
295
|
+
* Represents an HTTP request with all necessary configuration and parameters.
|
|
296
|
+
* Handles path/query/header/cookie serialization, pagination, validation, and retry logic.
|
|
297
|
+
* This is the core request object passed through the handler chain for execution.
|
|
298
|
+
*
|
|
299
|
+
* @template PageSchema - The type of paginated data returned by this request
|
|
300
|
+
*/
|
|
122
301
|
declare class Request<PageSchema = unknown[]> {
|
|
123
302
|
baseUrl: string;
|
|
124
303
|
headers: Map<string, RequestParameter>;
|
|
125
304
|
queryParams: Map<string, RequestParameter>;
|
|
126
305
|
pathParams: Map<string, RequestParameter>;
|
|
306
|
+
cookies: Map<string, RequestParameter>;
|
|
127
307
|
body?: any;
|
|
128
308
|
method: HttpMethod;
|
|
129
309
|
path: string;
|
|
@@ -141,14 +321,73 @@ declare class Request<PageSchema = unknown[]> {
|
|
|
141
321
|
tokenManager: OAuthTokenManager;
|
|
142
322
|
private readonly pathPattern;
|
|
143
323
|
constructor(params: CreateRequestParameters<PageSchema>);
|
|
324
|
+
/**
|
|
325
|
+
* Adds a header parameter to the request with OpenAPI serialization rules.
|
|
326
|
+
*
|
|
327
|
+
* @param key - The header name
|
|
328
|
+
* @param param - The parameter configuration including value, style, and encoding options
|
|
329
|
+
*/
|
|
144
330
|
addHeaderParam(key: string, param: RequestParameter): void;
|
|
331
|
+
/**
|
|
332
|
+
* Adds a query parameter to the request with OpenAPI serialization rules.
|
|
333
|
+
*
|
|
334
|
+
* @param key - The query parameter name
|
|
335
|
+
* @param param - The parameter configuration including value, style, and encoding options
|
|
336
|
+
*/
|
|
145
337
|
addQueryParam(key: string, param: RequestParameter): void;
|
|
338
|
+
/**
|
|
339
|
+
* Adds a path parameter to the request with OpenAPI serialization rules.
|
|
340
|
+
*
|
|
341
|
+
* @param key - The path parameter name (matches template variable in path pattern)
|
|
342
|
+
* @param param - The parameter configuration including value, style, and encoding options
|
|
343
|
+
*/
|
|
146
344
|
addPathParam(key: string, param: RequestParameter): void;
|
|
345
|
+
/**
|
|
346
|
+
* Sets the request body if the value is defined.
|
|
347
|
+
*
|
|
348
|
+
* @param body - The request body to send
|
|
349
|
+
*/
|
|
147
350
|
addBody(body: any): void;
|
|
351
|
+
/**
|
|
352
|
+
* Updates this request from a modified hook request.
|
|
353
|
+
* Used after hooks modify the request to sync changes back to the internal Request object.
|
|
354
|
+
*
|
|
355
|
+
* @param hookRequest - The modified request from hook processing
|
|
356
|
+
*/
|
|
148
357
|
updateFromHookRequest(hookRequest: HttpRequest): void;
|
|
358
|
+
/**
|
|
359
|
+
* Constructs the complete URL by combining base URL, path with substituted parameters,
|
|
360
|
+
* and serialized query string.
|
|
361
|
+
*
|
|
362
|
+
* @returns The fully constructed URL ready for HTTP execution
|
|
363
|
+
*/
|
|
149
364
|
constructFullUrl(): string;
|
|
365
|
+
/**
|
|
366
|
+
* Creates a copy of this request with optional parameter overrides.
|
|
367
|
+
* Useful for pagination where you need to modify parameters while keeping the rest intact.
|
|
368
|
+
*
|
|
369
|
+
* @param overrides - Optional parameters to override in the copied request
|
|
370
|
+
* @returns A new Request instance with the specified overrides
|
|
371
|
+
*/
|
|
150
372
|
copy(overrides?: Partial<CreateRequestParameters>): Request<unknown[]>;
|
|
373
|
+
/**
|
|
374
|
+
* Serializes headers to a format suitable for HTTP execution.
|
|
375
|
+
*
|
|
376
|
+
* @returns Serialized headers as HeadersInit, or undefined if no headers
|
|
377
|
+
*/
|
|
151
378
|
getHeaders(): HeadersInit | undefined;
|
|
379
|
+
/**
|
|
380
|
+
* Serializes cookies to a format suitable for HTTP execution.
|
|
381
|
+
*
|
|
382
|
+
* @returns Serialized cookies as a record, or undefined if no cookies
|
|
383
|
+
*/
|
|
384
|
+
getCookies(): Record<string, string> | undefined;
|
|
385
|
+
/**
|
|
386
|
+
* Advances pagination parameters to fetch the next page.
|
|
387
|
+
* Handles both cursor-based and limit-offset pagination strategies.
|
|
388
|
+
*
|
|
389
|
+
* @param cursor - The cursor value for cursor-based pagination (optional for limit-offset)
|
|
390
|
+
*/
|
|
152
391
|
nextPage(cursor?: string): void;
|
|
153
392
|
private constructPath;
|
|
154
393
|
private getOffsetParam;
|
|
@@ -156,7 +395,14 @@ declare class Request<PageSchema = unknown[]> {
|
|
|
156
395
|
private getAllParams;
|
|
157
396
|
}
|
|
158
397
|
|
|
398
|
+
/**
|
|
399
|
+
* Standard HTTP methods supported by the SDK.
|
|
400
|
+
*/
|
|
159
401
|
type HttpMethod = 'CONNECT' | 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT' | 'TRACE';
|
|
402
|
+
/**
|
|
403
|
+
* SDK configuration interface.
|
|
404
|
+
* Contains all settings required to initialize and configure the SDK.
|
|
405
|
+
*/
|
|
160
406
|
interface BaseConfig {
|
|
161
407
|
retry?: RetryOptions;
|
|
162
408
|
validation?: ValidationOptions;
|
|
@@ -176,32 +422,72 @@ interface TokenAuthConfig extends BaseConfig {
|
|
|
176
422
|
accessToken: string;
|
|
177
423
|
}
|
|
178
424
|
type SdkConfig = ClientCredentialAuthConfig | TokenAuthConfig;
|
|
425
|
+
/**
|
|
426
|
+
* Metadata about an HTTP response.
|
|
427
|
+
* Contains status information and headers from the server response.
|
|
428
|
+
*/
|
|
179
429
|
interface HttpMetadata {
|
|
430
|
+
/** HTTP status code (e.g., 200, 404, 500) */
|
|
180
431
|
status: number;
|
|
432
|
+
/** HTTP status text message (e.g., "OK", "Not Found") */
|
|
181
433
|
statusText: string;
|
|
434
|
+
/** Response headers as key-value pairs */
|
|
182
435
|
headers: Record<string, string>;
|
|
183
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Standard HTTP response with typed data.
|
|
439
|
+
* @template T - The type of the response data
|
|
440
|
+
*/
|
|
184
441
|
interface HttpResponse<T = unknown> {
|
|
442
|
+
/** Parsed response data (optional) */
|
|
185
443
|
data?: T;
|
|
444
|
+
/** Response metadata (status, headers, etc.) */
|
|
186
445
|
metadata: HttpMetadata;
|
|
446
|
+
/** Raw response object from the HTTP client */
|
|
187
447
|
raw: ArrayBuffer;
|
|
188
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* HTTP response for paginated API endpoints.
|
|
451
|
+
* Marker interface extending HttpResponse for type safety with pagination.
|
|
452
|
+
* @template T - The type of a single page of data
|
|
453
|
+
*/
|
|
189
454
|
interface PaginatedHttpResponse<T = unknown> extends HttpResponse<T> {
|
|
190
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* HTTP response for cursor-paginated API endpoints.
|
|
458
|
+
* Includes a cursor for fetching the next page of results.
|
|
459
|
+
* @template T - The type of a single page of data
|
|
460
|
+
*/
|
|
191
461
|
interface CursorPaginatedHttpResponse<T = unknown> extends HttpResponse<T> {
|
|
462
|
+
/** Cursor string for fetching the next page, null if no more pages, undefined if not applicable */
|
|
192
463
|
nextCursor?: string | null;
|
|
193
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Supported content types for HTTP requests and responses.
|
|
467
|
+
* Determines how the SDK serializes requests and parses responses.
|
|
468
|
+
*/
|
|
194
469
|
declare enum ContentType {
|
|
470
|
+
/** JSON format (application/json) */
|
|
195
471
|
Json = "json",
|
|
472
|
+
/** XML format (application/xml, text/xml) */
|
|
196
473
|
Xml = "xml",
|
|
474
|
+
/** PDF document (application/pdf) */
|
|
197
475
|
Pdf = "pdf",
|
|
476
|
+
/** Image file (image/*) */
|
|
198
477
|
Image = "image",
|
|
478
|
+
/** Generic file */
|
|
199
479
|
File = "file",
|
|
480
|
+
/** Binary data (application/octet-stream) */
|
|
200
481
|
Binary = "binary",
|
|
482
|
+
/** URL-encoded form data (application/x-www-form-urlencoded) */
|
|
201
483
|
FormUrlEncoded = "form",
|
|
484
|
+
/** Plain text (text/plain) */
|
|
202
485
|
Text = "text",
|
|
486
|
+
/** Multipart form data for file uploads (multipart/form-data) */
|
|
203
487
|
MultipartFormData = "multipartFormData",
|
|
488
|
+
/** Server-sent events stream (text/event-stream) */
|
|
204
489
|
EventStream = "eventStream",
|
|
490
|
+
/** No content (HTTP 204) */
|
|
205
491
|
NoContent = "noContent"
|
|
206
492
|
}
|
|
207
493
|
interface RequestConfig {
|
|
@@ -217,36 +503,144 @@ interface ValidationOptions {
|
|
|
217
503
|
responseValidation?: boolean;
|
|
218
504
|
}
|
|
219
505
|
|
|
506
|
+
/**
|
|
507
|
+
* Error class for HTTP request failures.
|
|
508
|
+
* Captures error details including status, metadata, and the raw response.
|
|
509
|
+
*/
|
|
220
510
|
declare class HttpError extends Error {
|
|
511
|
+
/** Error message or status text */
|
|
221
512
|
readonly error: string;
|
|
513
|
+
/** HTTP response metadata (status, headers, etc.) */
|
|
222
514
|
readonly metadata: HttpMetadata;
|
|
515
|
+
/** Raw response object from the HTTP client */
|
|
223
516
|
readonly raw?: ArrayBuffer;
|
|
517
|
+
/**
|
|
518
|
+
* Creates a new HTTP error.
|
|
519
|
+
* @param metadata - HTTP response metadata
|
|
520
|
+
* @param raw - Raw response object (optional)
|
|
521
|
+
* @param error - Custom error message (optional, defaults to status text)
|
|
522
|
+
*/
|
|
224
523
|
constructor(metadata: HttpMetadata, raw?: ArrayBuffer, error?: string);
|
|
225
524
|
}
|
|
226
525
|
|
|
526
|
+
/**
|
|
527
|
+
* Default implementation of the Hook interface that provides pass-through behavior.
|
|
528
|
+
* This hook can be extended to add custom logic for request/response interception.
|
|
529
|
+
*/
|
|
227
530
|
declare class CustomHook implements Hook {
|
|
531
|
+
/**
|
|
532
|
+
* Called before an HTTP request is sent.
|
|
533
|
+
* Default implementation returns the request unchanged.
|
|
534
|
+
* @param request - The HTTP request to be sent
|
|
535
|
+
* @param params - Additional custom parameters
|
|
536
|
+
* @returns A promise that resolves to the unmodified request
|
|
537
|
+
*/
|
|
228
538
|
beforeRequest(request: HttpRequest, params: Map<string, string>): Promise<HttpRequest>;
|
|
539
|
+
/**
|
|
540
|
+
* Called after a successful HTTP response is received.
|
|
541
|
+
* Default implementation returns the response unchanged.
|
|
542
|
+
* @param request - The original HTTP request
|
|
543
|
+
* @param response - The HTTP response received
|
|
544
|
+
* @param params - Additional custom parameters
|
|
545
|
+
* @returns A promise that resolves to the unmodified response
|
|
546
|
+
*/
|
|
229
547
|
afterResponse(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpResponse$1<any>>;
|
|
548
|
+
/**
|
|
549
|
+
* Called when an HTTP request results in an error.
|
|
550
|
+
* Default implementation wraps the error response in an HttpError object.
|
|
551
|
+
* @param request - The original HTTP request
|
|
552
|
+
* @param response - The error response received
|
|
553
|
+
* @param params - Additional custom parameters
|
|
554
|
+
* @returns A promise that resolves to an HttpError object
|
|
555
|
+
*/
|
|
230
556
|
onError(request: HttpRequest, response: HttpResponse$1<any>, params: Map<string, string>): Promise<HttpError>;
|
|
231
557
|
}
|
|
232
558
|
|
|
559
|
+
/**
|
|
560
|
+
* Core HTTP client for making API requests.
|
|
561
|
+
* Manages request/response handling through a chain of handlers for validation, retry, hooks, and more.
|
|
562
|
+
*/
|
|
233
563
|
declare class HttpClient {
|
|
234
564
|
private config;
|
|
565
|
+
/** Chain of request handlers that process requests in sequence */
|
|
235
566
|
private readonly requestHandlerChain;
|
|
567
|
+
/**
|
|
568
|
+
* Creates a new HTTP client with configured request handlers.
|
|
569
|
+
* @param config - SDK configuration including base URL and authentication
|
|
570
|
+
* @param hook - Optional custom hook for request/response interception
|
|
571
|
+
*/
|
|
236
572
|
constructor(config: SdkConfig, hook?: CustomHook);
|
|
573
|
+
/**
|
|
574
|
+
* Executes a standard HTTP request.
|
|
575
|
+
* @template T - The expected response data type
|
|
576
|
+
* @param request - The HTTP request to execute
|
|
577
|
+
* @returns A promise that resolves to the HTTP response
|
|
578
|
+
*/
|
|
237
579
|
call<T>(request: Request): Promise<HttpResponse<T>>;
|
|
580
|
+
/**
|
|
581
|
+
* Executes a streaming HTTP request that yields responses incrementally.
|
|
582
|
+
* @template T - The expected response data type for each chunk
|
|
583
|
+
* @param request - The HTTP request to execute
|
|
584
|
+
* @returns An async generator that yields HTTP responses
|
|
585
|
+
*/
|
|
238
586
|
stream<T>(request: Request): AsyncGenerator<HttpResponse<T>>;
|
|
587
|
+
/**
|
|
588
|
+
* Executes a paginated HTTP request and extracts the page data from the response.
|
|
589
|
+
* @template FullResponse - The complete response type from the API
|
|
590
|
+
* @template Page - The type of a single page of data
|
|
591
|
+
* @param request - The paginated HTTP request to execute
|
|
592
|
+
* @returns A promise that resolves to the paginated HTTP response
|
|
593
|
+
* @throws Error if the response contains no data to paginate through
|
|
594
|
+
*/
|
|
239
595
|
callPaginated<FullResponse, Page>(request: Request<Page>): Promise<PaginatedHttpResponse<Page>>;
|
|
596
|
+
/**
|
|
597
|
+
* Executes a cursor-paginated HTTP request and extracts both page data and the next cursor.
|
|
598
|
+
* @template FullResponse - The complete response type from the API
|
|
599
|
+
* @template Page - The type of a single page of data
|
|
600
|
+
* @param request - The cursor-paginated HTTP request to execute
|
|
601
|
+
* @returns A promise that resolves to the cursor-paginated HTTP response with next cursor
|
|
602
|
+
* @throws Error if the response contains no data to paginate through
|
|
603
|
+
*/
|
|
240
604
|
callCursorPaginated<FullResponse, Page>(request: Request<Page>): Promise<CursorPaginatedHttpResponse<Page>>;
|
|
605
|
+
/**
|
|
606
|
+
* Updates the base URL for all subsequent requests.
|
|
607
|
+
* @param url - The new base URL to use
|
|
608
|
+
*/
|
|
241
609
|
setBaseUrl(url: string): void;
|
|
610
|
+
/**
|
|
611
|
+
* Updates the SDK configuration.
|
|
612
|
+
* @param config - The new SDK configuration
|
|
613
|
+
*/
|
|
242
614
|
setConfig(config: SdkConfig): void;
|
|
615
|
+
/**
|
|
616
|
+
* Extracts page data from a full API response using the configured pagination path.
|
|
617
|
+
* @template FullResponse - The complete response type from the API
|
|
618
|
+
* @template Page - The type of a single page of data
|
|
619
|
+
* @param request - The request containing pagination configuration
|
|
620
|
+
* @param data - The full response data to extract the page from
|
|
621
|
+
* @returns The extracted and parsed page data
|
|
622
|
+
* @throws Error if pagination is not configured or page extraction fails
|
|
623
|
+
*/
|
|
243
624
|
private getPage;
|
|
625
|
+
/**
|
|
626
|
+
* Extracts the next cursor from a full API response for cursor-based pagination.
|
|
627
|
+
* @template FullResponse - The complete response type from the API
|
|
628
|
+
* @template Page - The type of a single page of data
|
|
629
|
+
* @param request - The request containing cursor pagination configuration
|
|
630
|
+
* @param data - The full response data to extract the cursor from
|
|
631
|
+
* @returns The next cursor string, null if no more pages, or undefined if not cursor pagination
|
|
632
|
+
*/
|
|
244
633
|
private getNextCursor;
|
|
245
634
|
}
|
|
246
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Base service class that all API service classes extend.
|
|
638
|
+
* Provides common functionality including HTTP client management and configuration.
|
|
639
|
+
*/
|
|
247
640
|
declare class BaseService {
|
|
248
641
|
config: SdkConfig;
|
|
249
642
|
protected tokenManager: OAuthTokenManager;
|
|
643
|
+
/** The HTTP client instance used to make API requests */
|
|
250
644
|
client: HttpClient;
|
|
251
645
|
constructor(config: SdkConfig, tokenManager: OAuthTokenManager);
|
|
252
646
|
set baseUrl(baseUrl: string);
|
|
@@ -259,7 +653,9 @@ declare class BaseService {
|
|
|
259
653
|
}
|
|
260
654
|
|
|
261
655
|
/**
|
|
262
|
-
*
|
|
656
|
+
* Zod schema for the ListDestinationsOkResponse model.
|
|
657
|
+
* Defines the structure and validation rules for this data type.
|
|
658
|
+
* This is the shape used in application code - what developers interact with.
|
|
263
659
|
*/
|
|
264
660
|
declare const listDestinationsOkResponse: z.ZodLazy<z.ZodObject<{
|
|
265
661
|
destinations: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
@@ -300,6 +696,11 @@ declare const listDestinationsOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
300
696
|
*/
|
|
301
697
|
type ListDestinationsOkResponse = z.infer<typeof listDestinationsOkResponse>;
|
|
302
698
|
|
|
699
|
+
/**
|
|
700
|
+
* Service class for DestinationsService operations.
|
|
701
|
+
* Provides methods to interact with DestinationsService-related API endpoints.
|
|
702
|
+
* All methods return promises and handle request/response serialization automatically.
|
|
703
|
+
*/
|
|
303
704
|
declare class DestinationsService extends BaseService {
|
|
304
705
|
/**
|
|
305
706
|
* List Destinations
|
|
@@ -310,7 +711,9 @@ declare class DestinationsService extends BaseService {
|
|
|
310
711
|
}
|
|
311
712
|
|
|
312
713
|
/**
|
|
313
|
-
*
|
|
714
|
+
* Zod schema for the Destinations model.
|
|
715
|
+
* Defines the structure and validation rules for this data type.
|
|
716
|
+
* This is the shape used in application code - what developers interact with.
|
|
314
717
|
*/
|
|
315
718
|
declare const destinations: z.ZodLazy<z.ZodObject<{
|
|
316
719
|
name: z.ZodString;
|
|
@@ -339,7 +742,9 @@ declare const destinations: z.ZodLazy<z.ZodObject<{
|
|
|
339
742
|
type Destinations = z.infer<typeof destinations>;
|
|
340
743
|
|
|
341
744
|
/**
|
|
342
|
-
*
|
|
745
|
+
* Zod schema for the ListPackagesOkResponse model.
|
|
746
|
+
* Defines the structure and validation rules for this data type.
|
|
747
|
+
* This is the shape used in application code - what developers interact with.
|
|
343
748
|
*/
|
|
344
749
|
declare const listPackagesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
345
750
|
packages: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
@@ -347,6 +752,7 @@ declare const listPackagesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
347
752
|
destination: z.ZodString;
|
|
348
753
|
destinationIso2: z.ZodString;
|
|
349
754
|
dataLimitInBytes: z.ZodNumber;
|
|
755
|
+
dataLimitInGb: z.ZodNumber;
|
|
350
756
|
minDays: z.ZodNumber;
|
|
351
757
|
maxDays: z.ZodNumber;
|
|
352
758
|
priceInCents: z.ZodNumber;
|
|
@@ -355,6 +761,7 @@ declare const listPackagesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
355
761
|
destinationIso2: string;
|
|
356
762
|
id: string;
|
|
357
763
|
dataLimitInBytes: number;
|
|
764
|
+
dataLimitInGb: number;
|
|
358
765
|
minDays: number;
|
|
359
766
|
maxDays: number;
|
|
360
767
|
priceInCents: number;
|
|
@@ -363,6 +770,7 @@ declare const listPackagesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
363
770
|
destinationIso2: string;
|
|
364
771
|
id: string;
|
|
365
772
|
dataLimitInBytes: number;
|
|
773
|
+
dataLimitInGb: number;
|
|
366
774
|
minDays: number;
|
|
367
775
|
maxDays: number;
|
|
368
776
|
priceInCents: number;
|
|
@@ -374,6 +782,7 @@ declare const listPackagesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
374
782
|
destinationIso2: string;
|
|
375
783
|
id: string;
|
|
376
784
|
dataLimitInBytes: number;
|
|
785
|
+
dataLimitInGb: number;
|
|
377
786
|
minDays: number;
|
|
378
787
|
maxDays: number;
|
|
379
788
|
priceInCents: number;
|
|
@@ -385,6 +794,7 @@ declare const listPackagesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
385
794
|
destinationIso2: string;
|
|
386
795
|
id: string;
|
|
387
796
|
dataLimitInBytes: number;
|
|
797
|
+
dataLimitInGb: number;
|
|
388
798
|
minDays: number;
|
|
389
799
|
maxDays: number;
|
|
390
800
|
priceInCents: number;
|
|
@@ -409,6 +819,11 @@ interface ListPackagesParams {
|
|
|
409
819
|
endTime?: number;
|
|
410
820
|
}
|
|
411
821
|
|
|
822
|
+
/**
|
|
823
|
+
* Service class for PackagesService operations.
|
|
824
|
+
* Provides methods to interact with PackagesService-related API endpoints.
|
|
825
|
+
* All methods return promises and handle request/response serialization automatically.
|
|
826
|
+
*/
|
|
412
827
|
declare class PackagesService extends BaseService {
|
|
413
828
|
/**
|
|
414
829
|
* List Packages
|
|
@@ -426,13 +841,16 @@ declare class PackagesService extends BaseService {
|
|
|
426
841
|
}
|
|
427
842
|
|
|
428
843
|
/**
|
|
429
|
-
*
|
|
844
|
+
* Zod schema for the Packages model.
|
|
845
|
+
* Defines the structure and validation rules for this data type.
|
|
846
|
+
* This is the shape used in application code - what developers interact with.
|
|
430
847
|
*/
|
|
431
848
|
declare const packages: z.ZodLazy<z.ZodObject<{
|
|
432
849
|
id: z.ZodString;
|
|
433
850
|
destination: z.ZodString;
|
|
434
851
|
destinationIso2: z.ZodString;
|
|
435
852
|
dataLimitInBytes: z.ZodNumber;
|
|
853
|
+
dataLimitInGb: z.ZodNumber;
|
|
436
854
|
minDays: z.ZodNumber;
|
|
437
855
|
maxDays: z.ZodNumber;
|
|
438
856
|
priceInCents: z.ZodNumber;
|
|
@@ -441,6 +859,7 @@ declare const packages: z.ZodLazy<z.ZodObject<{
|
|
|
441
859
|
destinationIso2: string;
|
|
442
860
|
id: string;
|
|
443
861
|
dataLimitInBytes: number;
|
|
862
|
+
dataLimitInGb: number;
|
|
444
863
|
minDays: number;
|
|
445
864
|
maxDays: number;
|
|
446
865
|
priceInCents: number;
|
|
@@ -449,6 +868,7 @@ declare const packages: z.ZodLazy<z.ZodObject<{
|
|
|
449
868
|
destinationIso2: string;
|
|
450
869
|
id: string;
|
|
451
870
|
dataLimitInBytes: number;
|
|
871
|
+
dataLimitInGb: number;
|
|
452
872
|
minDays: number;
|
|
453
873
|
maxDays: number;
|
|
454
874
|
priceInCents: number;
|
|
@@ -460,6 +880,7 @@ declare const packages: z.ZodLazy<z.ZodObject<{
|
|
|
460
880
|
* @property {string} - ISO3 representation of the package's destination.
|
|
461
881
|
* @property {string} - ISO2 representation of the package's destination.
|
|
462
882
|
* @property {number} - Size of the package in Bytes
|
|
883
|
+
* @property {number} - Size of the package in GB
|
|
463
884
|
* @property {number} - Min number of days for the package
|
|
464
885
|
* @property {number} - Max number of days for the package
|
|
465
886
|
* @property {number} - Price of the package in cents
|
|
@@ -467,7 +888,9 @@ declare const packages: z.ZodLazy<z.ZodObject<{
|
|
|
467
888
|
type Packages = z.infer<typeof packages>;
|
|
468
889
|
|
|
469
890
|
/**
|
|
470
|
-
*
|
|
891
|
+
* Zod schema for the CreatePurchaseV2Request model.
|
|
892
|
+
* Defines the structure and validation rules for this data type.
|
|
893
|
+
* This is the shape used in application code - what developers interact with.
|
|
471
894
|
*/
|
|
472
895
|
declare const createPurchaseV2Request: z.ZodLazy<z.ZodObject<{
|
|
473
896
|
destination: z.ZodString;
|
|
@@ -480,6 +903,7 @@ declare const createPurchaseV2Request: z.ZodLazy<z.ZodObject<{
|
|
|
480
903
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
481
904
|
networkBrand: z.ZodOptional<z.ZodString>;
|
|
482
905
|
emailBrand: z.ZodOptional<z.ZodString>;
|
|
906
|
+
language: z.ZodOptional<z.ZodString>;
|
|
483
907
|
}, "strip", z.ZodTypeAny, {
|
|
484
908
|
destination: string;
|
|
485
909
|
dataLimitInGb: number;
|
|
@@ -491,6 +915,7 @@ declare const createPurchaseV2Request: z.ZodLazy<z.ZodObject<{
|
|
|
491
915
|
referenceId?: string | undefined;
|
|
492
916
|
networkBrand?: string | undefined;
|
|
493
917
|
emailBrand?: string | undefined;
|
|
918
|
+
language?: string | undefined;
|
|
494
919
|
}, {
|
|
495
920
|
destination: string;
|
|
496
921
|
dataLimitInGb: number;
|
|
@@ -502,25 +927,29 @@ declare const createPurchaseV2Request: z.ZodLazy<z.ZodObject<{
|
|
|
502
927
|
referenceId?: string | undefined;
|
|
503
928
|
networkBrand?: string | undefined;
|
|
504
929
|
emailBrand?: string | undefined;
|
|
930
|
+
language?: string | undefined;
|
|
505
931
|
}>>;
|
|
506
932
|
/**
|
|
507
933
|
*
|
|
508
934
|
* @typedef {CreatePurchaseV2Request} createPurchaseV2Request
|
|
509
935
|
* @property {string} - ISO representation of the package's destination. Supports both ISO2 (e.g., 'FR') and ISO3 (e.g., 'FRA') country codes.
|
|
510
|
-
* @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8,
|
|
936
|
+
* @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8, 20, 50GB
|
|
511
937
|
* @property {string} - Start date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months.
|
|
512
938
|
* @property {string} - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
|
|
513
939
|
* @property {number} - Duration of the package in days. Available values are 1, 2, 7, 14, 30, or 90. Either provide startDate/endDate or duration.
|
|
514
940
|
* @property {number} - Number of eSIMs to purchase.
|
|
515
941
|
* @property {string} - Email address where the purchase confirmation email will be sent (including QR Code & activation steps)
|
|
516
942
|
* @property {string} - An identifier provided by the partner to link this purchase to their booking or transaction for analytics and debugging purposes.
|
|
517
|
-
* @property {string} - Customize the network brand of the issued eSIM. The `networkBrand` parameter cannot exceed 15 characters in length and must contain only letters and
|
|
943
|
+
* @property {string} - Customize the network brand of the issued eSIM. The `networkBrand` parameter cannot exceed 15 characters in length and must contain only letters, numbers, dots (.), ampersands (&), and spaces. This feature is available to platforms with Diamond tier only.
|
|
518
944
|
* @property {string} - Customize the email subject brand. The `emailBrand` parameter cannot exceed 25 characters in length and must contain only letters, numbers, and spaces. This feature is available to platforms with Diamond tier only.
|
|
945
|
+
* @property {CreatePurchaseV2RequestLanguage} - Language of the confirmation email sent to the customer.
|
|
519
946
|
*/
|
|
520
947
|
type CreatePurchaseV2Request = z.infer<typeof createPurchaseV2Request>;
|
|
521
948
|
|
|
522
949
|
/**
|
|
523
|
-
*
|
|
950
|
+
* Zod schema for the CreatePurchaseV2OkResponse model.
|
|
951
|
+
* Defines the structure and validation rules for this data type.
|
|
952
|
+
* This is the shape used in application code - what developers interact with.
|
|
524
953
|
*/
|
|
525
954
|
declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
|
|
526
955
|
purchase: z.ZodLazy<z.ZodObject<{
|
|
@@ -540,14 +969,20 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
540
969
|
iccid: z.ZodString;
|
|
541
970
|
activationCode: z.ZodString;
|
|
542
971
|
manualActivationCode: z.ZodString;
|
|
972
|
+
iosActivationLink: z.ZodString;
|
|
973
|
+
androidActivationLink: z.ZodString;
|
|
543
974
|
}, "strip", z.ZodTypeAny, {
|
|
544
975
|
iccid: string;
|
|
545
976
|
activationCode: string;
|
|
546
977
|
manualActivationCode: string;
|
|
978
|
+
iosActivationLink: string;
|
|
979
|
+
androidActivationLink: string;
|
|
547
980
|
}, {
|
|
548
981
|
iccid: string;
|
|
549
982
|
activationCode: string;
|
|
550
983
|
manualActivationCode: string;
|
|
984
|
+
iosActivationLink: string;
|
|
985
|
+
androidActivationLink: string;
|
|
551
986
|
}>>;
|
|
552
987
|
}, "strip", z.ZodTypeAny, {
|
|
553
988
|
purchase: {
|
|
@@ -559,6 +994,8 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
559
994
|
iccid: string;
|
|
560
995
|
activationCode: string;
|
|
561
996
|
manualActivationCode: string;
|
|
997
|
+
iosActivationLink: string;
|
|
998
|
+
androidActivationLink: string;
|
|
562
999
|
};
|
|
563
1000
|
}, {
|
|
564
1001
|
purchase: {
|
|
@@ -570,6 +1007,8 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
570
1007
|
iccid: string;
|
|
571
1008
|
activationCode: string;
|
|
572
1009
|
manualActivationCode: string;
|
|
1010
|
+
iosActivationLink: string;
|
|
1011
|
+
androidActivationLink: string;
|
|
573
1012
|
};
|
|
574
1013
|
}>>;
|
|
575
1014
|
/**
|
|
@@ -581,7 +1020,9 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
581
1020
|
type CreatePurchaseV2OkResponse = z.infer<typeof createPurchaseV2OkResponse>;
|
|
582
1021
|
|
|
583
1022
|
/**
|
|
584
|
-
*
|
|
1023
|
+
* Zod schema for the ListPurchasesOkResponse model.
|
|
1024
|
+
* Defines the structure and validation rules for this data type.
|
|
1025
|
+
* This is the shape used in application code - what developers interact with.
|
|
585
1026
|
*/
|
|
586
1027
|
declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
587
1028
|
purchases: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
@@ -596,6 +1037,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
596
1037
|
package: z.ZodLazy<z.ZodObject<{
|
|
597
1038
|
id: z.ZodString;
|
|
598
1039
|
dataLimitInBytes: z.ZodNumber;
|
|
1040
|
+
dataLimitInGb: z.ZodNumber;
|
|
599
1041
|
destination: z.ZodString;
|
|
600
1042
|
destinationIso2: z.ZodString;
|
|
601
1043
|
destinationName: z.ZodString;
|
|
@@ -605,6 +1047,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
605
1047
|
destinationIso2: string;
|
|
606
1048
|
id: string;
|
|
607
1049
|
dataLimitInBytes: number;
|
|
1050
|
+
dataLimitInGb: number;
|
|
608
1051
|
priceInCents: number;
|
|
609
1052
|
destinationName: string;
|
|
610
1053
|
}, {
|
|
@@ -612,6 +1055,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
612
1055
|
destinationIso2: string;
|
|
613
1056
|
id: string;
|
|
614
1057
|
dataLimitInBytes: number;
|
|
1058
|
+
dataLimitInGb: number;
|
|
615
1059
|
priceInCents: number;
|
|
616
1060
|
destinationName: string;
|
|
617
1061
|
}>>;
|
|
@@ -635,6 +1079,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
635
1079
|
destinationIso2: string;
|
|
636
1080
|
id: string;
|
|
637
1081
|
dataLimitInBytes: number;
|
|
1082
|
+
dataLimitInGb: number;
|
|
638
1083
|
priceInCents: number;
|
|
639
1084
|
destinationName: string;
|
|
640
1085
|
};
|
|
@@ -658,6 +1103,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
658
1103
|
destinationIso2: string;
|
|
659
1104
|
id: string;
|
|
660
1105
|
dataLimitInBytes: number;
|
|
1106
|
+
dataLimitInGb: number;
|
|
661
1107
|
priceInCents: number;
|
|
662
1108
|
destinationName: string;
|
|
663
1109
|
};
|
|
@@ -685,6 +1131,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
685
1131
|
destinationIso2: string;
|
|
686
1132
|
id: string;
|
|
687
1133
|
dataLimitInBytes: number;
|
|
1134
|
+
dataLimitInGb: number;
|
|
688
1135
|
priceInCents: number;
|
|
689
1136
|
destinationName: string;
|
|
690
1137
|
};
|
|
@@ -711,6 +1158,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
711
1158
|
destinationIso2: string;
|
|
712
1159
|
id: string;
|
|
713
1160
|
dataLimitInBytes: number;
|
|
1161
|
+
dataLimitInGb: number;
|
|
714
1162
|
priceInCents: number;
|
|
715
1163
|
destinationName: string;
|
|
716
1164
|
};
|
|
@@ -748,7 +1196,9 @@ interface ListPurchasesParams {
|
|
|
748
1196
|
}
|
|
749
1197
|
|
|
750
1198
|
/**
|
|
751
|
-
*
|
|
1199
|
+
* Zod schema for the CreatePurchaseRequest model.
|
|
1200
|
+
* Defines the structure and validation rules for this data type.
|
|
1201
|
+
* This is the shape used in application code - what developers interact with.
|
|
752
1202
|
*/
|
|
753
1203
|
declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
|
|
754
1204
|
destination: z.ZodString;
|
|
@@ -759,28 +1209,31 @@ declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
|
|
|
759
1209
|
referenceId: z.ZodOptional<z.ZodString>;
|
|
760
1210
|
networkBrand: z.ZodOptional<z.ZodString>;
|
|
761
1211
|
emailBrand: z.ZodOptional<z.ZodString>;
|
|
1212
|
+
language: z.ZodOptional<z.ZodString>;
|
|
762
1213
|
startTime: z.ZodOptional<z.ZodNumber>;
|
|
763
1214
|
endTime: z.ZodOptional<z.ZodNumber>;
|
|
764
1215
|
}, "strip", z.ZodTypeAny, {
|
|
765
1216
|
destination: string;
|
|
1217
|
+
dataLimitInGb: number;
|
|
766
1218
|
startDate: string;
|
|
767
1219
|
endDate: string;
|
|
768
|
-
dataLimitInGb: number;
|
|
769
1220
|
email?: string | undefined;
|
|
770
1221
|
referenceId?: string | undefined;
|
|
771
1222
|
networkBrand?: string | undefined;
|
|
772
1223
|
emailBrand?: string | undefined;
|
|
1224
|
+
language?: string | undefined;
|
|
773
1225
|
startTime?: number | undefined;
|
|
774
1226
|
endTime?: number | undefined;
|
|
775
1227
|
}, {
|
|
776
1228
|
destination: string;
|
|
1229
|
+
dataLimitInGb: number;
|
|
777
1230
|
startDate: string;
|
|
778
1231
|
endDate: string;
|
|
779
|
-
dataLimitInGb: number;
|
|
780
1232
|
email?: string | undefined;
|
|
781
1233
|
referenceId?: string | undefined;
|
|
782
1234
|
networkBrand?: string | undefined;
|
|
783
1235
|
emailBrand?: string | undefined;
|
|
1236
|
+
language?: string | undefined;
|
|
784
1237
|
startTime?: number | undefined;
|
|
785
1238
|
endTime?: number | undefined;
|
|
786
1239
|
}>>;
|
|
@@ -788,20 +1241,23 @@ declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
|
|
|
788
1241
|
*
|
|
789
1242
|
* @typedef {CreatePurchaseRequest} createPurchaseRequest
|
|
790
1243
|
* @property {string} - ISO representation of the package's destination. Supports both ISO2 (e.g., 'FR') and ISO3 (e.g., 'FRA') country codes.
|
|
791
|
-
* @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8,
|
|
1244
|
+
* @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8, 20, 50GB
|
|
792
1245
|
* @property {string} - Start date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months.
|
|
793
1246
|
* @property {string} - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
|
|
794
1247
|
* @property {string} - Email address where the purchase confirmation email will be sent (including QR Code & activation steps)
|
|
795
1248
|
* @property {string} - An identifier provided by the partner to link this purchase to their booking or transaction for analytics and debugging purposes.
|
|
796
|
-
* @property {string} - Customize the network brand of the issued eSIM. The `networkBrand` parameter cannot exceed 15 characters in length and must contain only letters and
|
|
1249
|
+
* @property {string} - Customize the network brand of the issued eSIM. The `networkBrand` parameter cannot exceed 15 characters in length and must contain only letters, numbers, dots (.), ampersands (&), and spaces. This feature is available to platforms with Diamond tier only.
|
|
797
1250
|
* @property {string} - Customize the email subject brand. The `emailBrand` parameter cannot exceed 25 characters in length and must contain only letters, numbers, and spaces. This feature is available to platforms with Diamond tier only.
|
|
1251
|
+
* @property {CreatePurchaseRequestLanguage} - Language of the confirmation email sent to the customer.
|
|
798
1252
|
* @property {number} - 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.
|
|
799
1253
|
* @property {number} - Epoch value representing the end time of the package's validity. End time can be maximum 90 days after Start time.
|
|
800
1254
|
*/
|
|
801
1255
|
type CreatePurchaseRequest = z.infer<typeof createPurchaseRequest>;
|
|
802
1256
|
|
|
803
1257
|
/**
|
|
804
|
-
*
|
|
1258
|
+
* Zod schema for the CreatePurchaseOkResponse model.
|
|
1259
|
+
* Defines the structure and validation rules for this data type.
|
|
1260
|
+
* This is the shape used in application code - what developers interact with.
|
|
805
1261
|
*/
|
|
806
1262
|
declare const createPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
|
|
807
1263
|
purchase: z.ZodLazy<z.ZodObject<{
|
|
@@ -882,7 +1338,9 @@ declare const createPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
882
1338
|
type CreatePurchaseOkResponse = z.infer<typeof createPurchaseOkResponse>;
|
|
883
1339
|
|
|
884
1340
|
/**
|
|
885
|
-
*
|
|
1341
|
+
* Zod schema for the TopUpEsimRequest model.
|
|
1342
|
+
* Defines the structure and validation rules for this data type.
|
|
1343
|
+
* This is the shape used in application code - what developers interact with.
|
|
886
1344
|
*/
|
|
887
1345
|
declare const topUpEsimRequest: z.ZodLazy<z.ZodObject<{
|
|
888
1346
|
iccid: z.ZodString;
|
|
@@ -922,7 +1380,7 @@ declare const topUpEsimRequest: z.ZodLazy<z.ZodObject<{
|
|
|
922
1380
|
*
|
|
923
1381
|
* @typedef {TopUpEsimRequest} topUpEsimRequest
|
|
924
1382
|
* @property {string} - ID of the eSIM
|
|
925
|
-
* @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8,
|
|
1383
|
+
* @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8, 20, 50GB
|
|
926
1384
|
* @property {string} - Start date of the package's validity in the format 'yyyy-MM-dd'. This date can be set to the current day or any day within the next 12 months.
|
|
927
1385
|
* @property {string} - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
|
|
928
1386
|
* @property {number} - Duration of the package in days. Available values are 1, 2, 7, 14, 30, or 90. Either provide startDate/endDate or duration.
|
|
@@ -935,7 +1393,9 @@ declare const topUpEsimRequest: z.ZodLazy<z.ZodObject<{
|
|
|
935
1393
|
type TopUpEsimRequest = z.infer<typeof topUpEsimRequest>;
|
|
936
1394
|
|
|
937
1395
|
/**
|
|
938
|
-
*
|
|
1396
|
+
* Zod schema for the TopUpEsimOkResponse model.
|
|
1397
|
+
* Defines the structure and validation rules for this data type.
|
|
1398
|
+
* This is the shape used in application code - what developers interact with.
|
|
939
1399
|
*/
|
|
940
1400
|
declare const topUpEsimOkResponse: z.ZodLazy<z.ZodObject<{
|
|
941
1401
|
purchase: z.ZodLazy<z.ZodObject<{
|
|
@@ -1006,7 +1466,9 @@ declare const topUpEsimOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
1006
1466
|
type TopUpEsimOkResponse = z.infer<typeof topUpEsimOkResponse>;
|
|
1007
1467
|
|
|
1008
1468
|
/**
|
|
1009
|
-
*
|
|
1469
|
+
* Zod schema for the EditPurchaseRequest model.
|
|
1470
|
+
* Defines the structure and validation rules for this data type.
|
|
1471
|
+
* This is the shape used in application code - what developers interact with.
|
|
1010
1472
|
*/
|
|
1011
1473
|
declare const editPurchaseRequest: z.ZodLazy<z.ZodObject<{
|
|
1012
1474
|
purchaseId: z.ZodString;
|
|
@@ -1039,7 +1501,9 @@ declare const editPurchaseRequest: z.ZodLazy<z.ZodObject<{
|
|
|
1039
1501
|
type EditPurchaseRequest = z.infer<typeof editPurchaseRequest>;
|
|
1040
1502
|
|
|
1041
1503
|
/**
|
|
1042
|
-
*
|
|
1504
|
+
* Zod schema for the EditPurchaseOkResponse model.
|
|
1505
|
+
* Defines the structure and validation rules for this data type.
|
|
1506
|
+
* This is the shape used in application code - what developers interact with.
|
|
1043
1507
|
*/
|
|
1044
1508
|
declare const editPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1045
1509
|
purchaseId: z.ZodString;
|
|
@@ -1072,26 +1536,37 @@ declare const editPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
1072
1536
|
type EditPurchaseOkResponse = z.infer<typeof editPurchaseOkResponse>;
|
|
1073
1537
|
|
|
1074
1538
|
/**
|
|
1075
|
-
*
|
|
1539
|
+
* Zod schema for the GetPurchaseConsumptionOkResponse model.
|
|
1540
|
+
* Defines the structure and validation rules for this data type.
|
|
1541
|
+
* This is the shape used in application code - what developers interact with.
|
|
1076
1542
|
*/
|
|
1077
1543
|
declare const getPurchaseConsumptionOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1078
1544
|
dataUsageRemainingInBytes: z.ZodNumber;
|
|
1545
|
+
dataUsageRemainingInGb: z.ZodNumber;
|
|
1079
1546
|
status: z.ZodString;
|
|
1080
1547
|
}, "strip", z.ZodTypeAny, {
|
|
1081
1548
|
status: string;
|
|
1082
1549
|
dataUsageRemainingInBytes: number;
|
|
1550
|
+
dataUsageRemainingInGb: number;
|
|
1083
1551
|
}, {
|
|
1084
1552
|
status: string;
|
|
1085
1553
|
dataUsageRemainingInBytes: number;
|
|
1554
|
+
dataUsageRemainingInGb: number;
|
|
1086
1555
|
}>>;
|
|
1087
1556
|
/**
|
|
1088
1557
|
*
|
|
1089
1558
|
* @typedef {GetPurchaseConsumptionOkResponse} getPurchaseConsumptionOkResponse
|
|
1090
1559
|
* @property {number} - Remaining balance of the package in bytes
|
|
1560
|
+
* @property {number} - Remaining balance of the package in GB
|
|
1091
1561
|
* @property {string} - Status of the connectivity, possible values are 'ACTIVE' or 'NOT_ACTIVE'
|
|
1092
1562
|
*/
|
|
1093
1563
|
type GetPurchaseConsumptionOkResponse = z.infer<typeof getPurchaseConsumptionOkResponse>;
|
|
1094
1564
|
|
|
1565
|
+
/**
|
|
1566
|
+
* Service class for PurchasesService operations.
|
|
1567
|
+
* Provides methods to interact with PurchasesService-related API endpoints.
|
|
1568
|
+
* All methods return promises and handle request/response serialization automatically.
|
|
1569
|
+
*/
|
|
1095
1570
|
declare class PurchasesService extends BaseService {
|
|
1096
1571
|
/**
|
|
1097
1572
|
* This endpoint is used to purchase a new eSIM by providing the package details.
|
|
@@ -1150,7 +1625,9 @@ declare class PurchasesService extends BaseService {
|
|
|
1150
1625
|
}
|
|
1151
1626
|
|
|
1152
1627
|
/**
|
|
1153
|
-
*
|
|
1628
|
+
* Zod schema for the CreatePurchaseV2OkResponsePurchase model.
|
|
1629
|
+
* Defines the structure and validation rules for this data type.
|
|
1630
|
+
* This is the shape used in application code - what developers interact with.
|
|
1154
1631
|
*/
|
|
1155
1632
|
declare const createPurchaseV2OkResponsePurchase: z.ZodLazy<z.ZodObject<{
|
|
1156
1633
|
id: z.ZodString;
|
|
@@ -1175,20 +1652,28 @@ declare const createPurchaseV2OkResponsePurchase: z.ZodLazy<z.ZodObject<{
|
|
|
1175
1652
|
type CreatePurchaseV2OkResponsePurchase = z.infer<typeof createPurchaseV2OkResponsePurchase>;
|
|
1176
1653
|
|
|
1177
1654
|
/**
|
|
1178
|
-
*
|
|
1655
|
+
* Zod schema for the CreatePurchaseV2OkResponseProfile model.
|
|
1656
|
+
* Defines the structure and validation rules for this data type.
|
|
1657
|
+
* This is the shape used in application code - what developers interact with.
|
|
1179
1658
|
*/
|
|
1180
1659
|
declare const createPurchaseV2OkResponseProfile: z.ZodLazy<z.ZodObject<{
|
|
1181
1660
|
iccid: z.ZodString;
|
|
1182
1661
|
activationCode: z.ZodString;
|
|
1183
1662
|
manualActivationCode: z.ZodString;
|
|
1663
|
+
iosActivationLink: z.ZodString;
|
|
1664
|
+
androidActivationLink: z.ZodString;
|
|
1184
1665
|
}, "strip", z.ZodTypeAny, {
|
|
1185
1666
|
iccid: string;
|
|
1186
1667
|
activationCode: string;
|
|
1187
1668
|
manualActivationCode: string;
|
|
1669
|
+
iosActivationLink: string;
|
|
1670
|
+
androidActivationLink: string;
|
|
1188
1671
|
}, {
|
|
1189
1672
|
iccid: string;
|
|
1190
1673
|
activationCode: string;
|
|
1191
1674
|
manualActivationCode: string;
|
|
1675
|
+
iosActivationLink: string;
|
|
1676
|
+
androidActivationLink: string;
|
|
1192
1677
|
}>>;
|
|
1193
1678
|
/**
|
|
1194
1679
|
*
|
|
@@ -1196,11 +1681,23 @@ declare const createPurchaseV2OkResponseProfile: z.ZodLazy<z.ZodObject<{
|
|
|
1196
1681
|
* @property {string} - ID of the eSIM
|
|
1197
1682
|
* @property {string} - QR Code of the eSIM as base64
|
|
1198
1683
|
* @property {string} - Manual Activation Code of the eSIM
|
|
1684
|
+
* @property {string} - iOS Activation Link of the eSIM
|
|
1685
|
+
* @property {string} - Android Activation Link of the eSIM
|
|
1199
1686
|
*/
|
|
1200
1687
|
type CreatePurchaseV2OkResponseProfile = z.infer<typeof createPurchaseV2OkResponseProfile>;
|
|
1201
1688
|
|
|
1689
|
+
declare enum CreatePurchaseV2RequestLanguage {
|
|
1690
|
+
EN = "en",
|
|
1691
|
+
ES = "es",
|
|
1692
|
+
FR = "fr",
|
|
1693
|
+
DE = "de",
|
|
1694
|
+
PT_BR = "pt-br"
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1202
1697
|
/**
|
|
1203
|
-
*
|
|
1698
|
+
* Zod schema for the Purchases model.
|
|
1699
|
+
* Defines the structure and validation rules for this data type.
|
|
1700
|
+
* This is the shape used in application code - what developers interact with.
|
|
1204
1701
|
*/
|
|
1205
1702
|
declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
1206
1703
|
id: z.ZodString;
|
|
@@ -1214,6 +1711,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
|
1214
1711
|
package: z.ZodLazy<z.ZodObject<{
|
|
1215
1712
|
id: z.ZodString;
|
|
1216
1713
|
dataLimitInBytes: z.ZodNumber;
|
|
1714
|
+
dataLimitInGb: z.ZodNumber;
|
|
1217
1715
|
destination: z.ZodString;
|
|
1218
1716
|
destinationIso2: z.ZodString;
|
|
1219
1717
|
destinationName: z.ZodString;
|
|
@@ -1223,6 +1721,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
|
1223
1721
|
destinationIso2: string;
|
|
1224
1722
|
id: string;
|
|
1225
1723
|
dataLimitInBytes: number;
|
|
1724
|
+
dataLimitInGb: number;
|
|
1226
1725
|
priceInCents: number;
|
|
1227
1726
|
destinationName: string;
|
|
1228
1727
|
}, {
|
|
@@ -1230,6 +1729,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
|
1230
1729
|
destinationIso2: string;
|
|
1231
1730
|
id: string;
|
|
1232
1731
|
dataLimitInBytes: number;
|
|
1732
|
+
dataLimitInGb: number;
|
|
1233
1733
|
priceInCents: number;
|
|
1234
1734
|
destinationName: string;
|
|
1235
1735
|
}>>;
|
|
@@ -1253,6 +1753,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
|
1253
1753
|
destinationIso2: string;
|
|
1254
1754
|
id: string;
|
|
1255
1755
|
dataLimitInBytes: number;
|
|
1756
|
+
dataLimitInGb: number;
|
|
1256
1757
|
priceInCents: number;
|
|
1257
1758
|
destinationName: string;
|
|
1258
1759
|
};
|
|
@@ -1276,6 +1777,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
|
1276
1777
|
destinationIso2: string;
|
|
1277
1778
|
id: string;
|
|
1278
1779
|
dataLimitInBytes: number;
|
|
1780
|
+
dataLimitInGb: number;
|
|
1279
1781
|
priceInCents: number;
|
|
1280
1782
|
destinationName: string;
|
|
1281
1783
|
};
|
|
@@ -1310,11 +1812,14 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
|
|
|
1310
1812
|
type Purchases = z.infer<typeof purchases>;
|
|
1311
1813
|
|
|
1312
1814
|
/**
|
|
1313
|
-
*
|
|
1815
|
+
* Zod schema for the Package_ model.
|
|
1816
|
+
* Defines the structure and validation rules for this data type.
|
|
1817
|
+
* This is the shape used in application code - what developers interact with.
|
|
1314
1818
|
*/
|
|
1315
1819
|
declare const package_: z.ZodLazy<z.ZodObject<{
|
|
1316
1820
|
id: z.ZodString;
|
|
1317
1821
|
dataLimitInBytes: z.ZodNumber;
|
|
1822
|
+
dataLimitInGb: z.ZodNumber;
|
|
1318
1823
|
destination: z.ZodString;
|
|
1319
1824
|
destinationIso2: z.ZodString;
|
|
1320
1825
|
destinationName: z.ZodString;
|
|
@@ -1324,6 +1829,7 @@ declare const package_: z.ZodLazy<z.ZodObject<{
|
|
|
1324
1829
|
destinationIso2: string;
|
|
1325
1830
|
id: string;
|
|
1326
1831
|
dataLimitInBytes: number;
|
|
1832
|
+
dataLimitInGb: number;
|
|
1327
1833
|
priceInCents: number;
|
|
1328
1834
|
destinationName: string;
|
|
1329
1835
|
}, {
|
|
@@ -1331,6 +1837,7 @@ declare const package_: z.ZodLazy<z.ZodObject<{
|
|
|
1331
1837
|
destinationIso2: string;
|
|
1332
1838
|
id: string;
|
|
1333
1839
|
dataLimitInBytes: number;
|
|
1840
|
+
dataLimitInGb: number;
|
|
1334
1841
|
priceInCents: number;
|
|
1335
1842
|
destinationName: string;
|
|
1336
1843
|
}>>;
|
|
@@ -1339,6 +1846,7 @@ declare const package_: z.ZodLazy<z.ZodObject<{
|
|
|
1339
1846
|
* @typedef {Package_} package_
|
|
1340
1847
|
* @property {string} - ID of the package
|
|
1341
1848
|
* @property {number} - Size of the package in Bytes
|
|
1849
|
+
* @property {number} - Size of the package in GB
|
|
1342
1850
|
* @property {string} - ISO3 representation of the package's destination.
|
|
1343
1851
|
* @property {string} - ISO2 representation of the package's destination.
|
|
1344
1852
|
* @property {string} - Name of the package's destination
|
|
@@ -1347,7 +1855,9 @@ declare const package_: z.ZodLazy<z.ZodObject<{
|
|
|
1347
1855
|
type Package_ = z.infer<typeof package_>;
|
|
1348
1856
|
|
|
1349
1857
|
/**
|
|
1350
|
-
*
|
|
1858
|
+
* Zod schema for the PurchasesEsim model.
|
|
1859
|
+
* Defines the structure and validation rules for this data type.
|
|
1860
|
+
* This is the shape used in application code - what developers interact with.
|
|
1351
1861
|
*/
|
|
1352
1862
|
declare const purchasesEsim: z.ZodLazy<z.ZodObject<{
|
|
1353
1863
|
iccid: z.ZodString;
|
|
@@ -1364,7 +1874,9 @@ declare const purchasesEsim: z.ZodLazy<z.ZodObject<{
|
|
|
1364
1874
|
type PurchasesEsim = z.infer<typeof purchasesEsim>;
|
|
1365
1875
|
|
|
1366
1876
|
/**
|
|
1367
|
-
*
|
|
1877
|
+
* Zod schema for the CreatePurchaseOkResponsePurchase model.
|
|
1878
|
+
* Defines the structure and validation rules for this data type.
|
|
1879
|
+
* This is the shape used in application code - what developers interact with.
|
|
1368
1880
|
*/
|
|
1369
1881
|
declare const createPurchaseOkResponsePurchase: z.ZodLazy<z.ZodObject<{
|
|
1370
1882
|
id: z.ZodString;
|
|
@@ -1405,7 +1917,9 @@ declare const createPurchaseOkResponsePurchase: z.ZodLazy<z.ZodObject<{
|
|
|
1405
1917
|
type CreatePurchaseOkResponsePurchase = z.infer<typeof createPurchaseOkResponsePurchase>;
|
|
1406
1918
|
|
|
1407
1919
|
/**
|
|
1408
|
-
*
|
|
1920
|
+
* Zod schema for the CreatePurchaseOkResponseProfile model.
|
|
1921
|
+
* Defines the structure and validation rules for this data type.
|
|
1922
|
+
* This is the shape used in application code - what developers interact with.
|
|
1409
1923
|
*/
|
|
1410
1924
|
declare const createPurchaseOkResponseProfile: z.ZodLazy<z.ZodObject<{
|
|
1411
1925
|
iccid: z.ZodString;
|
|
@@ -1429,8 +1943,18 @@ declare const createPurchaseOkResponseProfile: z.ZodLazy<z.ZodObject<{
|
|
|
1429
1943
|
*/
|
|
1430
1944
|
type CreatePurchaseOkResponseProfile = z.infer<typeof createPurchaseOkResponseProfile>;
|
|
1431
1945
|
|
|
1946
|
+
declare enum CreatePurchaseRequestLanguage {
|
|
1947
|
+
EN = "en",
|
|
1948
|
+
ES = "es",
|
|
1949
|
+
FR = "fr",
|
|
1950
|
+
DE = "de",
|
|
1951
|
+
PT_BR = "pt-br"
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1432
1954
|
/**
|
|
1433
|
-
*
|
|
1955
|
+
* Zod schema for the TopUpEsimOkResponsePurchase model.
|
|
1956
|
+
* Defines the structure and validation rules for this data type.
|
|
1957
|
+
* This is the shape used in application code - what developers interact with.
|
|
1434
1958
|
*/
|
|
1435
1959
|
declare const topUpEsimOkResponsePurchase: z.ZodLazy<z.ZodObject<{
|
|
1436
1960
|
id: z.ZodString;
|
|
@@ -1471,7 +1995,9 @@ declare const topUpEsimOkResponsePurchase: z.ZodLazy<z.ZodObject<{
|
|
|
1471
1995
|
type TopUpEsimOkResponsePurchase = z.infer<typeof topUpEsimOkResponsePurchase>;
|
|
1472
1996
|
|
|
1473
1997
|
/**
|
|
1474
|
-
*
|
|
1998
|
+
* Zod schema for the TopUpEsimOkResponseProfile model.
|
|
1999
|
+
* Defines the structure and validation rules for this data type.
|
|
2000
|
+
* This is the shape used in application code - what developers interact with.
|
|
1475
2001
|
*/
|
|
1476
2002
|
declare const topUpEsimOkResponseProfile: z.ZodLazy<z.ZodObject<{
|
|
1477
2003
|
iccid: z.ZodString;
|
|
@@ -1488,7 +2014,9 @@ declare const topUpEsimOkResponseProfile: z.ZodLazy<z.ZodObject<{
|
|
|
1488
2014
|
type TopUpEsimOkResponseProfile = z.infer<typeof topUpEsimOkResponseProfile>;
|
|
1489
2015
|
|
|
1490
2016
|
/**
|
|
1491
|
-
*
|
|
2017
|
+
* Zod schema for the GetEsimOkResponse model.
|
|
2018
|
+
* Defines the structure and validation rules for this data type.
|
|
2019
|
+
* This is the shape used in application code - what developers interact with.
|
|
1492
2020
|
*/
|
|
1493
2021
|
declare const getEsimOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1494
2022
|
esim: z.ZodLazy<z.ZodObject<{
|
|
@@ -1549,7 +2077,9 @@ interface GetEsimParams {
|
|
|
1549
2077
|
}
|
|
1550
2078
|
|
|
1551
2079
|
/**
|
|
1552
|
-
*
|
|
2080
|
+
* Zod schema for the GetEsimDeviceOkResponse model.
|
|
2081
|
+
* Defines the structure and validation rules for this data type.
|
|
2082
|
+
* This is the shape used in application code - what developers interact with.
|
|
1553
2083
|
*/
|
|
1554
2084
|
declare const getEsimDeviceOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1555
2085
|
device: z.ZodLazy<z.ZodObject<{
|
|
@@ -1591,7 +2121,9 @@ declare const getEsimDeviceOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
1591
2121
|
type GetEsimDeviceOkResponse = z.infer<typeof getEsimDeviceOkResponse>;
|
|
1592
2122
|
|
|
1593
2123
|
/**
|
|
1594
|
-
*
|
|
2124
|
+
* Zod schema for the GetEsimHistoryOkResponse model.
|
|
2125
|
+
* Defines the structure and validation rules for this data type.
|
|
2126
|
+
* This is the shape used in application code - what developers interact with.
|
|
1595
2127
|
*/
|
|
1596
2128
|
declare const getEsimHistoryOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1597
2129
|
esim: z.ZodLazy<z.ZodObject<{
|
|
@@ -1650,6 +2182,11 @@ declare const getEsimHistoryOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
1650
2182
|
*/
|
|
1651
2183
|
type GetEsimHistoryOkResponse = z.infer<typeof getEsimHistoryOkResponse>;
|
|
1652
2184
|
|
|
2185
|
+
/**
|
|
2186
|
+
* Service class for ESimService operations.
|
|
2187
|
+
* Provides methods to interact with ESimService-related API endpoints.
|
|
2188
|
+
* All methods return promises and handle request/response serialization automatically.
|
|
2189
|
+
*/
|
|
1653
2190
|
declare class ESimService extends BaseService {
|
|
1654
2191
|
/**
|
|
1655
2192
|
* Get eSIM
|
|
@@ -1675,7 +2212,9 @@ declare class ESimService extends BaseService {
|
|
|
1675
2212
|
}
|
|
1676
2213
|
|
|
1677
2214
|
/**
|
|
1678
|
-
*
|
|
2215
|
+
* Zod schema for the GetEsimOkResponseEsim model.
|
|
2216
|
+
* Defines the structure and validation rules for this data type.
|
|
2217
|
+
* This is the shape used in application code - what developers interact with.
|
|
1679
2218
|
*/
|
|
1680
2219
|
declare const getEsimOkResponseEsim: z.ZodLazy<z.ZodObject<{
|
|
1681
2220
|
iccid: z.ZodString;
|
|
@@ -1716,7 +2255,9 @@ declare const getEsimOkResponseEsim: z.ZodLazy<z.ZodObject<{
|
|
|
1716
2255
|
type GetEsimOkResponseEsim = z.infer<typeof getEsimOkResponseEsim>;
|
|
1717
2256
|
|
|
1718
2257
|
/**
|
|
1719
|
-
*
|
|
2258
|
+
* Zod schema for the Device model.
|
|
2259
|
+
* Defines the structure and validation rules for this data type.
|
|
2260
|
+
* This is the shape used in application code - what developers interact with.
|
|
1720
2261
|
*/
|
|
1721
2262
|
declare const device: z.ZodLazy<z.ZodObject<{
|
|
1722
2263
|
oem: z.ZodString;
|
|
@@ -1745,7 +2286,9 @@ declare const device: z.ZodLazy<z.ZodObject<{
|
|
|
1745
2286
|
type Device = z.infer<typeof device>;
|
|
1746
2287
|
|
|
1747
2288
|
/**
|
|
1748
|
-
*
|
|
2289
|
+
* Zod schema for the GetEsimHistoryOkResponseEsim model.
|
|
2290
|
+
* Defines the structure and validation rules for this data type.
|
|
2291
|
+
* This is the shape used in application code - what developers interact with.
|
|
1749
2292
|
*/
|
|
1750
2293
|
declare const getEsimHistoryOkResponseEsim: z.ZodLazy<z.ZodObject<{
|
|
1751
2294
|
iccid: z.ZodString;
|
|
@@ -1786,7 +2329,9 @@ declare const getEsimHistoryOkResponseEsim: z.ZodLazy<z.ZodObject<{
|
|
|
1786
2329
|
type GetEsimHistoryOkResponseEsim = z.infer<typeof getEsimHistoryOkResponseEsim>;
|
|
1787
2330
|
|
|
1788
2331
|
/**
|
|
1789
|
-
*
|
|
2332
|
+
* Zod schema for the History model.
|
|
2333
|
+
* Defines the structure and validation rules for this data type.
|
|
2334
|
+
* This is the shape used in application code - what developers interact with.
|
|
1790
2335
|
*/
|
|
1791
2336
|
declare const history: z.ZodLazy<z.ZodObject<{
|
|
1792
2337
|
status: z.ZodString;
|
|
@@ -1811,7 +2356,9 @@ declare const history: z.ZodLazy<z.ZodObject<{
|
|
|
1811
2356
|
type History = z.infer<typeof history>;
|
|
1812
2357
|
|
|
1813
2358
|
/**
|
|
1814
|
-
*
|
|
2359
|
+
* Zod schema for the TokenOkResponse model.
|
|
2360
|
+
* Defines the structure and validation rules for this data type.
|
|
2361
|
+
* This is the shape used in application code - what developers interact with.
|
|
1815
2362
|
*/
|
|
1816
2363
|
declare const tokenOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1817
2364
|
token: z.ZodString;
|
|
@@ -1827,6 +2374,11 @@ declare const tokenOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
1827
2374
|
*/
|
|
1828
2375
|
type TokenOkResponse = z.infer<typeof tokenOkResponse>;
|
|
1829
2376
|
|
|
2377
|
+
/**
|
|
2378
|
+
* Service class for IFrameService operations.
|
|
2379
|
+
* Provides methods to interact with IFrameService-related API endpoints.
|
|
2380
|
+
* All methods return promises and handle request/response serialization automatically.
|
|
2381
|
+
*/
|
|
1830
2382
|
declare class IFrameService extends BaseService {
|
|
1831
2383
|
/**
|
|
1832
2384
|
* Generate a new token to be used in the iFrame
|
|
@@ -1837,7 +2389,9 @@ declare class IFrameService extends BaseService {
|
|
|
1837
2389
|
}
|
|
1838
2390
|
|
|
1839
2391
|
/**
|
|
1840
|
-
*
|
|
2392
|
+
* Zod schema for the GetAccessTokenRequest model.
|
|
2393
|
+
* Defines the structure and validation rules for this data type.
|
|
2394
|
+
* This is the shape used in application code - what developers interact with.
|
|
1841
2395
|
*/
|
|
1842
2396
|
declare const getAccessTokenRequest: z.ZodLazy<z.ZodObject<{
|
|
1843
2397
|
grantType: z.ZodOptional<z.ZodString>;
|
|
@@ -1862,7 +2416,9 @@ declare const getAccessTokenRequest: z.ZodLazy<z.ZodObject<{
|
|
|
1862
2416
|
type GetAccessTokenRequest = z.infer<typeof getAccessTokenRequest>;
|
|
1863
2417
|
|
|
1864
2418
|
/**
|
|
1865
|
-
*
|
|
2419
|
+
* Zod schema for the GetAccessTokenOkResponse model.
|
|
2420
|
+
* Defines the structure and validation rules for this data type.
|
|
2421
|
+
* This is the shape used in application code - what developers interact with.
|
|
1866
2422
|
*/
|
|
1867
2423
|
declare const getAccessTokenOkResponse: z.ZodLazy<z.ZodObject<{
|
|
1868
2424
|
accessToken: z.ZodOptional<z.ZodString>;
|
|
@@ -1886,6 +2442,11 @@ declare const getAccessTokenOkResponse: z.ZodLazy<z.ZodObject<{
|
|
|
1886
2442
|
*/
|
|
1887
2443
|
type GetAccessTokenOkResponse = z.infer<typeof getAccessTokenOkResponse>;
|
|
1888
2444
|
|
|
2445
|
+
/**
|
|
2446
|
+
* Service class for OAuthService operations.
|
|
2447
|
+
* Provides methods to interact with OAuthService-related API endpoints.
|
|
2448
|
+
* All methods return promises and handle request/response serialization automatically.
|
|
2449
|
+
*/
|
|
1889
2450
|
declare class OAuthService extends BaseService {
|
|
1890
2451
|
/**
|
|
1891
2452
|
* This endpoint was added by liblab
|
|
@@ -1931,4 +2492,4 @@ declare class Celitech {
|
|
|
1931
2492
|
set accessToken(accessToken: string);
|
|
1932
2493
|
}
|
|
1933
2494
|
|
|
1934
|
-
export { BadRequest, Celitech, CreatePurchaseOkResponse, CreatePurchaseOkResponseProfile, CreatePurchaseOkResponsePurchase, CreatePurchaseRequest, CreatePurchaseV2OkResponse, CreatePurchaseV2OkResponseProfile, CreatePurchaseV2OkResponsePurchase, CreatePurchaseV2Request, Destinations, DestinationsService, Device, ESimService, EditPurchaseOkResponse, EditPurchaseRequest, Environment, GetAccessTokenOkResponse, GetAccessTokenRequest, GetEsimDeviceOkResponse, GetEsimHistoryOkResponse, GetEsimHistoryOkResponseEsim, 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, Unauthorized, ValidationOptions };
|
|
2495
|
+
export { BadRequest, Celitech, CreatePurchaseOkResponse, CreatePurchaseOkResponseProfile, CreatePurchaseOkResponsePurchase, CreatePurchaseRequest, CreatePurchaseRequestLanguage, CreatePurchaseV2OkResponse, CreatePurchaseV2OkResponseProfile, CreatePurchaseV2OkResponsePurchase, CreatePurchaseV2Request, CreatePurchaseV2RequestLanguage, Destinations, DestinationsService, Device, ESimService, EditPurchaseOkResponse, EditPurchaseRequest, Environment, GetAccessTokenOkResponse, GetAccessTokenRequest, GetEsimDeviceOkResponse, GetEsimHistoryOkResponse, GetEsimHistoryOkResponseEsim, 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, Unauthorized, ValidationOptions };
|