celitech-sdk 1.3.61 → 1.3.63

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/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
- * The shape of the model inside the application code - what the users use
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
- * The shape of the model inside the application code - what the users use
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
- * The shape of the model inside the application code - what the users use
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
- * The shape of the model inside the application code - what the users use
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
- * The shape of the model inside the application code - what the users use
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;
@@ -507,20 +930,22 @@ declare const createPurchaseV2Request: z.ZodLazy<z.ZodObject<{
507
930
  *
508
931
  * @typedef {CreatePurchaseV2Request} createPurchaseV2Request
509
932
  * @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, 20GB
933
+ * @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8, 20, 50GB
511
934
  * @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
935
  * @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
936
  * @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
937
  * @property {number} - Number of eSIMs to purchase.
515
938
  * @property {string} - Email address where the purchase confirmation email will be sent (including QR Code & activation steps)
516
939
  * @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 numbers. This feature is available to platforms with Diamond tier only.
940
+ * @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
941
  * @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.
519
942
  */
520
943
  type CreatePurchaseV2Request = z.infer<typeof createPurchaseV2Request>;
521
944
 
522
945
  /**
523
- * The shape of the model inside the application code - what the users use
946
+ * Zod schema for the CreatePurchaseV2OkResponse model.
947
+ * Defines the structure and validation rules for this data type.
948
+ * This is the shape used in application code - what developers interact with.
524
949
  */
525
950
  declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
526
951
  purchase: z.ZodLazy<z.ZodObject<{
@@ -540,14 +965,20 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
540
965
  iccid: z.ZodString;
541
966
  activationCode: z.ZodString;
542
967
  manualActivationCode: z.ZodString;
968
+ iosActivationLink: z.ZodString;
969
+ androidActivationLink: z.ZodString;
543
970
  }, "strip", z.ZodTypeAny, {
544
971
  iccid: string;
545
972
  activationCode: string;
546
973
  manualActivationCode: string;
974
+ iosActivationLink: string;
975
+ androidActivationLink: string;
547
976
  }, {
548
977
  iccid: string;
549
978
  activationCode: string;
550
979
  manualActivationCode: string;
980
+ iosActivationLink: string;
981
+ androidActivationLink: string;
551
982
  }>>;
552
983
  }, "strip", z.ZodTypeAny, {
553
984
  purchase: {
@@ -559,6 +990,8 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
559
990
  iccid: string;
560
991
  activationCode: string;
561
992
  manualActivationCode: string;
993
+ iosActivationLink: string;
994
+ androidActivationLink: string;
562
995
  };
563
996
  }, {
564
997
  purchase: {
@@ -570,6 +1003,8 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
570
1003
  iccid: string;
571
1004
  activationCode: string;
572
1005
  manualActivationCode: string;
1006
+ iosActivationLink: string;
1007
+ androidActivationLink: string;
573
1008
  };
574
1009
  }>>;
575
1010
  /**
@@ -581,7 +1016,9 @@ declare const createPurchaseV2OkResponse: z.ZodLazy<z.ZodObject<{
581
1016
  type CreatePurchaseV2OkResponse = z.infer<typeof createPurchaseV2OkResponse>;
582
1017
 
583
1018
  /**
584
- * The shape of the model inside the application code - what the users use
1019
+ * Zod schema for the ListPurchasesOkResponse model.
1020
+ * Defines the structure and validation rules for this data type.
1021
+ * This is the shape used in application code - what developers interact with.
585
1022
  */
586
1023
  declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
587
1024
  purchases: z.ZodArray<z.ZodLazy<z.ZodObject<{
@@ -596,6 +1033,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
596
1033
  package: z.ZodLazy<z.ZodObject<{
597
1034
  id: z.ZodString;
598
1035
  dataLimitInBytes: z.ZodNumber;
1036
+ dataLimitInGb: z.ZodNumber;
599
1037
  destination: z.ZodString;
600
1038
  destinationIso2: z.ZodString;
601
1039
  destinationName: z.ZodString;
@@ -605,6 +1043,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
605
1043
  destinationIso2: string;
606
1044
  id: string;
607
1045
  dataLimitInBytes: number;
1046
+ dataLimitInGb: number;
608
1047
  priceInCents: number;
609
1048
  destinationName: string;
610
1049
  }, {
@@ -612,6 +1051,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
612
1051
  destinationIso2: string;
613
1052
  id: string;
614
1053
  dataLimitInBytes: number;
1054
+ dataLimitInGb: number;
615
1055
  priceInCents: number;
616
1056
  destinationName: string;
617
1057
  }>>;
@@ -635,6 +1075,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
635
1075
  destinationIso2: string;
636
1076
  id: string;
637
1077
  dataLimitInBytes: number;
1078
+ dataLimitInGb: number;
638
1079
  priceInCents: number;
639
1080
  destinationName: string;
640
1081
  };
@@ -658,6 +1099,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
658
1099
  destinationIso2: string;
659
1100
  id: string;
660
1101
  dataLimitInBytes: number;
1102
+ dataLimitInGb: number;
661
1103
  priceInCents: number;
662
1104
  destinationName: string;
663
1105
  };
@@ -685,6 +1127,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
685
1127
  destinationIso2: string;
686
1128
  id: string;
687
1129
  dataLimitInBytes: number;
1130
+ dataLimitInGb: number;
688
1131
  priceInCents: number;
689
1132
  destinationName: string;
690
1133
  };
@@ -711,6 +1154,7 @@ declare const listPurchasesOkResponse: z.ZodLazy<z.ZodObject<{
711
1154
  destinationIso2: string;
712
1155
  id: string;
713
1156
  dataLimitInBytes: number;
1157
+ dataLimitInGb: number;
714
1158
  priceInCents: number;
715
1159
  destinationName: string;
716
1160
  };
@@ -748,7 +1192,9 @@ interface ListPurchasesParams {
748
1192
  }
749
1193
 
750
1194
  /**
751
- * The shape of the model inside the application code - what the users use
1195
+ * Zod schema for the CreatePurchaseRequest model.
1196
+ * Defines the structure and validation rules for this data type.
1197
+ * This is the shape used in application code - what developers interact with.
752
1198
  */
753
1199
  declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
754
1200
  destination: z.ZodString;
@@ -763,9 +1209,9 @@ declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
763
1209
  endTime: z.ZodOptional<z.ZodNumber>;
764
1210
  }, "strip", z.ZodTypeAny, {
765
1211
  destination: string;
1212
+ dataLimitInGb: number;
766
1213
  startDate: string;
767
1214
  endDate: string;
768
- dataLimitInGb: number;
769
1215
  email?: string | undefined;
770
1216
  referenceId?: string | undefined;
771
1217
  networkBrand?: string | undefined;
@@ -774,9 +1220,9 @@ declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
774
1220
  endTime?: number | undefined;
775
1221
  }, {
776
1222
  destination: string;
1223
+ dataLimitInGb: number;
777
1224
  startDate: string;
778
1225
  endDate: string;
779
- dataLimitInGb: number;
780
1226
  email?: string | undefined;
781
1227
  referenceId?: string | undefined;
782
1228
  networkBrand?: string | undefined;
@@ -788,12 +1234,12 @@ declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
788
1234
  *
789
1235
  * @typedef {CreatePurchaseRequest} createPurchaseRequest
790
1236
  * @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, 20GB
1237
+ * @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8, 20, 50GB
792
1238
  * @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
1239
  * @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
1240
  * @property {string} - Email address where the purchase confirmation email will be sent (including QR Code & activation steps)
795
1241
  * @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 numbers. This feature is available to platforms with Diamond tier only.
1242
+ * @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
1243
  * @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.
798
1244
  * @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
1245
  * @property {number} - Epoch value representing the end time of the package's validity. End time can be maximum 90 days after Start time.
@@ -801,7 +1247,9 @@ declare const createPurchaseRequest: z.ZodLazy<z.ZodObject<{
801
1247
  type CreatePurchaseRequest = z.infer<typeof createPurchaseRequest>;
802
1248
 
803
1249
  /**
804
- * The shape of the model inside the application code - what the users use
1250
+ * Zod schema for the CreatePurchaseOkResponse model.
1251
+ * Defines the structure and validation rules for this data type.
1252
+ * This is the shape used in application code - what developers interact with.
805
1253
  */
806
1254
  declare const createPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
807
1255
  purchase: z.ZodLazy<z.ZodObject<{
@@ -882,7 +1330,9 @@ declare const createPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
882
1330
  type CreatePurchaseOkResponse = z.infer<typeof createPurchaseOkResponse>;
883
1331
 
884
1332
  /**
885
- * The shape of the model inside the application code - what the users use
1333
+ * Zod schema for the TopUpEsimRequest model.
1334
+ * Defines the structure and validation rules for this data type.
1335
+ * This is the shape used in application code - what developers interact with.
886
1336
  */
887
1337
  declare const topUpEsimRequest: z.ZodLazy<z.ZodObject<{
888
1338
  iccid: z.ZodString;
@@ -922,7 +1372,7 @@ declare const topUpEsimRequest: z.ZodLazy<z.ZodObject<{
922
1372
  *
923
1373
  * @typedef {TopUpEsimRequest} topUpEsimRequest
924
1374
  * @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, 20GB
1375
+ * @property {number} - Size of the package in GB. The available options are 0.5, 1, 2, 3, 5, 8, 20, 50GB
926
1376
  * @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
1377
  * @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
1378
  * @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 +1385,9 @@ declare const topUpEsimRequest: z.ZodLazy<z.ZodObject<{
935
1385
  type TopUpEsimRequest = z.infer<typeof topUpEsimRequest>;
936
1386
 
937
1387
  /**
938
- * The shape of the model inside the application code - what the users use
1388
+ * Zod schema for the TopUpEsimOkResponse model.
1389
+ * Defines the structure and validation rules for this data type.
1390
+ * This is the shape used in application code - what developers interact with.
939
1391
  */
940
1392
  declare const topUpEsimOkResponse: z.ZodLazy<z.ZodObject<{
941
1393
  purchase: z.ZodLazy<z.ZodObject<{
@@ -1006,7 +1458,9 @@ declare const topUpEsimOkResponse: z.ZodLazy<z.ZodObject<{
1006
1458
  type TopUpEsimOkResponse = z.infer<typeof topUpEsimOkResponse>;
1007
1459
 
1008
1460
  /**
1009
- * The shape of the model inside the application code - what the users use
1461
+ * Zod schema for the EditPurchaseRequest model.
1462
+ * Defines the structure and validation rules for this data type.
1463
+ * This is the shape used in application code - what developers interact with.
1010
1464
  */
1011
1465
  declare const editPurchaseRequest: z.ZodLazy<z.ZodObject<{
1012
1466
  purchaseId: z.ZodString;
@@ -1039,7 +1493,9 @@ declare const editPurchaseRequest: z.ZodLazy<z.ZodObject<{
1039
1493
  type EditPurchaseRequest = z.infer<typeof editPurchaseRequest>;
1040
1494
 
1041
1495
  /**
1042
- * The shape of the model inside the application code - what the users use
1496
+ * Zod schema for the EditPurchaseOkResponse model.
1497
+ * Defines the structure and validation rules for this data type.
1498
+ * This is the shape used in application code - what developers interact with.
1043
1499
  */
1044
1500
  declare const editPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
1045
1501
  purchaseId: z.ZodString;
@@ -1072,26 +1528,37 @@ declare const editPurchaseOkResponse: z.ZodLazy<z.ZodObject<{
1072
1528
  type EditPurchaseOkResponse = z.infer<typeof editPurchaseOkResponse>;
1073
1529
 
1074
1530
  /**
1075
- * The shape of the model inside the application code - what the users use
1531
+ * Zod schema for the GetPurchaseConsumptionOkResponse model.
1532
+ * Defines the structure and validation rules for this data type.
1533
+ * This is the shape used in application code - what developers interact with.
1076
1534
  */
1077
1535
  declare const getPurchaseConsumptionOkResponse: z.ZodLazy<z.ZodObject<{
1078
1536
  dataUsageRemainingInBytes: z.ZodNumber;
1537
+ dataUsageRemainingInGb: z.ZodNumber;
1079
1538
  status: z.ZodString;
1080
1539
  }, "strip", z.ZodTypeAny, {
1081
1540
  status: string;
1082
1541
  dataUsageRemainingInBytes: number;
1542
+ dataUsageRemainingInGb: number;
1083
1543
  }, {
1084
1544
  status: string;
1085
1545
  dataUsageRemainingInBytes: number;
1546
+ dataUsageRemainingInGb: number;
1086
1547
  }>>;
1087
1548
  /**
1088
1549
  *
1089
1550
  * @typedef {GetPurchaseConsumptionOkResponse} getPurchaseConsumptionOkResponse
1090
1551
  * @property {number} - Remaining balance of the package in bytes
1552
+ * @property {number} - Remaining balance of the package in GB
1091
1553
  * @property {string} - Status of the connectivity, possible values are 'ACTIVE' or 'NOT_ACTIVE'
1092
1554
  */
1093
1555
  type GetPurchaseConsumptionOkResponse = z.infer<typeof getPurchaseConsumptionOkResponse>;
1094
1556
 
1557
+ /**
1558
+ * Service class for PurchasesService operations.
1559
+ * Provides methods to interact with PurchasesService-related API endpoints.
1560
+ * All methods return promises and handle request/response serialization automatically.
1561
+ */
1095
1562
  declare class PurchasesService extends BaseService {
1096
1563
  /**
1097
1564
  * This endpoint is used to purchase a new eSIM by providing the package details.
@@ -1150,7 +1617,9 @@ declare class PurchasesService extends BaseService {
1150
1617
  }
1151
1618
 
1152
1619
  /**
1153
- * The shape of the model inside the application code - what the users use
1620
+ * Zod schema for the CreatePurchaseV2OkResponsePurchase model.
1621
+ * Defines the structure and validation rules for this data type.
1622
+ * This is the shape used in application code - what developers interact with.
1154
1623
  */
1155
1624
  declare const createPurchaseV2OkResponsePurchase: z.ZodLazy<z.ZodObject<{
1156
1625
  id: z.ZodString;
@@ -1175,20 +1644,28 @@ declare const createPurchaseV2OkResponsePurchase: z.ZodLazy<z.ZodObject<{
1175
1644
  type CreatePurchaseV2OkResponsePurchase = z.infer<typeof createPurchaseV2OkResponsePurchase>;
1176
1645
 
1177
1646
  /**
1178
- * The shape of the model inside the application code - what the users use
1647
+ * Zod schema for the CreatePurchaseV2OkResponseProfile model.
1648
+ * Defines the structure and validation rules for this data type.
1649
+ * This is the shape used in application code - what developers interact with.
1179
1650
  */
1180
1651
  declare const createPurchaseV2OkResponseProfile: z.ZodLazy<z.ZodObject<{
1181
1652
  iccid: z.ZodString;
1182
1653
  activationCode: z.ZodString;
1183
1654
  manualActivationCode: z.ZodString;
1655
+ iosActivationLink: z.ZodString;
1656
+ androidActivationLink: z.ZodString;
1184
1657
  }, "strip", z.ZodTypeAny, {
1185
1658
  iccid: string;
1186
1659
  activationCode: string;
1187
1660
  manualActivationCode: string;
1661
+ iosActivationLink: string;
1662
+ androidActivationLink: string;
1188
1663
  }, {
1189
1664
  iccid: string;
1190
1665
  activationCode: string;
1191
1666
  manualActivationCode: string;
1667
+ iosActivationLink: string;
1668
+ androidActivationLink: string;
1192
1669
  }>>;
1193
1670
  /**
1194
1671
  *
@@ -1196,11 +1673,15 @@ declare const createPurchaseV2OkResponseProfile: z.ZodLazy<z.ZodObject<{
1196
1673
  * @property {string} - ID of the eSIM
1197
1674
  * @property {string} - QR Code of the eSIM as base64
1198
1675
  * @property {string} - Manual Activation Code of the eSIM
1676
+ * @property {string} - iOS Activation Link of the eSIM
1677
+ * @property {string} - Android Activation Link of the eSIM
1199
1678
  */
1200
1679
  type CreatePurchaseV2OkResponseProfile = z.infer<typeof createPurchaseV2OkResponseProfile>;
1201
1680
 
1202
1681
  /**
1203
- * The shape of the model inside the application code - what the users use
1682
+ * Zod schema for the Purchases model.
1683
+ * Defines the structure and validation rules for this data type.
1684
+ * This is the shape used in application code - what developers interact with.
1204
1685
  */
1205
1686
  declare const purchases: z.ZodLazy<z.ZodObject<{
1206
1687
  id: z.ZodString;
@@ -1214,6 +1695,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
1214
1695
  package: z.ZodLazy<z.ZodObject<{
1215
1696
  id: z.ZodString;
1216
1697
  dataLimitInBytes: z.ZodNumber;
1698
+ dataLimitInGb: z.ZodNumber;
1217
1699
  destination: z.ZodString;
1218
1700
  destinationIso2: z.ZodString;
1219
1701
  destinationName: z.ZodString;
@@ -1223,6 +1705,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
1223
1705
  destinationIso2: string;
1224
1706
  id: string;
1225
1707
  dataLimitInBytes: number;
1708
+ dataLimitInGb: number;
1226
1709
  priceInCents: number;
1227
1710
  destinationName: string;
1228
1711
  }, {
@@ -1230,6 +1713,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
1230
1713
  destinationIso2: string;
1231
1714
  id: string;
1232
1715
  dataLimitInBytes: number;
1716
+ dataLimitInGb: number;
1233
1717
  priceInCents: number;
1234
1718
  destinationName: string;
1235
1719
  }>>;
@@ -1253,6 +1737,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
1253
1737
  destinationIso2: string;
1254
1738
  id: string;
1255
1739
  dataLimitInBytes: number;
1740
+ dataLimitInGb: number;
1256
1741
  priceInCents: number;
1257
1742
  destinationName: string;
1258
1743
  };
@@ -1276,6 +1761,7 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
1276
1761
  destinationIso2: string;
1277
1762
  id: string;
1278
1763
  dataLimitInBytes: number;
1764
+ dataLimitInGb: number;
1279
1765
  priceInCents: number;
1280
1766
  destinationName: string;
1281
1767
  };
@@ -1310,11 +1796,14 @@ declare const purchases: z.ZodLazy<z.ZodObject<{
1310
1796
  type Purchases = z.infer<typeof purchases>;
1311
1797
 
1312
1798
  /**
1313
- * The shape of the model inside the application code - what the users use
1799
+ * Zod schema for the Package_ model.
1800
+ * Defines the structure and validation rules for this data type.
1801
+ * This is the shape used in application code - what developers interact with.
1314
1802
  */
1315
1803
  declare const package_: z.ZodLazy<z.ZodObject<{
1316
1804
  id: z.ZodString;
1317
1805
  dataLimitInBytes: z.ZodNumber;
1806
+ dataLimitInGb: z.ZodNumber;
1318
1807
  destination: z.ZodString;
1319
1808
  destinationIso2: z.ZodString;
1320
1809
  destinationName: z.ZodString;
@@ -1324,6 +1813,7 @@ declare const package_: z.ZodLazy<z.ZodObject<{
1324
1813
  destinationIso2: string;
1325
1814
  id: string;
1326
1815
  dataLimitInBytes: number;
1816
+ dataLimitInGb: number;
1327
1817
  priceInCents: number;
1328
1818
  destinationName: string;
1329
1819
  }, {
@@ -1331,6 +1821,7 @@ declare const package_: z.ZodLazy<z.ZodObject<{
1331
1821
  destinationIso2: string;
1332
1822
  id: string;
1333
1823
  dataLimitInBytes: number;
1824
+ dataLimitInGb: number;
1334
1825
  priceInCents: number;
1335
1826
  destinationName: string;
1336
1827
  }>>;
@@ -1339,6 +1830,7 @@ declare const package_: z.ZodLazy<z.ZodObject<{
1339
1830
  * @typedef {Package_} package_
1340
1831
  * @property {string} - ID of the package
1341
1832
  * @property {number} - Size of the package in Bytes
1833
+ * @property {number} - Size of the package in GB
1342
1834
  * @property {string} - ISO3 representation of the package's destination.
1343
1835
  * @property {string} - ISO2 representation of the package's destination.
1344
1836
  * @property {string} - Name of the package's destination
@@ -1347,7 +1839,9 @@ declare const package_: z.ZodLazy<z.ZodObject<{
1347
1839
  type Package_ = z.infer<typeof package_>;
1348
1840
 
1349
1841
  /**
1350
- * The shape of the model inside the application code - what the users use
1842
+ * Zod schema for the PurchasesEsim model.
1843
+ * Defines the structure and validation rules for this data type.
1844
+ * This is the shape used in application code - what developers interact with.
1351
1845
  */
1352
1846
  declare const purchasesEsim: z.ZodLazy<z.ZodObject<{
1353
1847
  iccid: z.ZodString;
@@ -1364,7 +1858,9 @@ declare const purchasesEsim: z.ZodLazy<z.ZodObject<{
1364
1858
  type PurchasesEsim = z.infer<typeof purchasesEsim>;
1365
1859
 
1366
1860
  /**
1367
- * The shape of the model inside the application code - what the users use
1861
+ * Zod schema for the CreatePurchaseOkResponsePurchase model.
1862
+ * Defines the structure and validation rules for this data type.
1863
+ * This is the shape used in application code - what developers interact with.
1368
1864
  */
1369
1865
  declare const createPurchaseOkResponsePurchase: z.ZodLazy<z.ZodObject<{
1370
1866
  id: z.ZodString;
@@ -1405,7 +1901,9 @@ declare const createPurchaseOkResponsePurchase: z.ZodLazy<z.ZodObject<{
1405
1901
  type CreatePurchaseOkResponsePurchase = z.infer<typeof createPurchaseOkResponsePurchase>;
1406
1902
 
1407
1903
  /**
1408
- * The shape of the model inside the application code - what the users use
1904
+ * Zod schema for the CreatePurchaseOkResponseProfile model.
1905
+ * Defines the structure and validation rules for this data type.
1906
+ * This is the shape used in application code - what developers interact with.
1409
1907
  */
1410
1908
  declare const createPurchaseOkResponseProfile: z.ZodLazy<z.ZodObject<{
1411
1909
  iccid: z.ZodString;
@@ -1430,7 +1928,9 @@ declare const createPurchaseOkResponseProfile: z.ZodLazy<z.ZodObject<{
1430
1928
  type CreatePurchaseOkResponseProfile = z.infer<typeof createPurchaseOkResponseProfile>;
1431
1929
 
1432
1930
  /**
1433
- * The shape of the model inside the application code - what the users use
1931
+ * Zod schema for the TopUpEsimOkResponsePurchase model.
1932
+ * Defines the structure and validation rules for this data type.
1933
+ * This is the shape used in application code - what developers interact with.
1434
1934
  */
1435
1935
  declare const topUpEsimOkResponsePurchase: z.ZodLazy<z.ZodObject<{
1436
1936
  id: z.ZodString;
@@ -1471,7 +1971,9 @@ declare const topUpEsimOkResponsePurchase: z.ZodLazy<z.ZodObject<{
1471
1971
  type TopUpEsimOkResponsePurchase = z.infer<typeof topUpEsimOkResponsePurchase>;
1472
1972
 
1473
1973
  /**
1474
- * The shape of the model inside the application code - what the users use
1974
+ * Zod schema for the TopUpEsimOkResponseProfile model.
1975
+ * Defines the structure and validation rules for this data type.
1976
+ * This is the shape used in application code - what developers interact with.
1475
1977
  */
1476
1978
  declare const topUpEsimOkResponseProfile: z.ZodLazy<z.ZodObject<{
1477
1979
  iccid: z.ZodString;
@@ -1488,7 +1990,9 @@ declare const topUpEsimOkResponseProfile: z.ZodLazy<z.ZodObject<{
1488
1990
  type TopUpEsimOkResponseProfile = z.infer<typeof topUpEsimOkResponseProfile>;
1489
1991
 
1490
1992
  /**
1491
- * The shape of the model inside the application code - what the users use
1993
+ * Zod schema for the GetEsimOkResponse model.
1994
+ * Defines the structure and validation rules for this data type.
1995
+ * This is the shape used in application code - what developers interact with.
1492
1996
  */
1493
1997
  declare const getEsimOkResponse: z.ZodLazy<z.ZodObject<{
1494
1998
  esim: z.ZodLazy<z.ZodObject<{
@@ -1549,7 +2053,9 @@ interface GetEsimParams {
1549
2053
  }
1550
2054
 
1551
2055
  /**
1552
- * The shape of the model inside the application code - what the users use
2056
+ * Zod schema for the GetEsimDeviceOkResponse model.
2057
+ * Defines the structure and validation rules for this data type.
2058
+ * This is the shape used in application code - what developers interact with.
1553
2059
  */
1554
2060
  declare const getEsimDeviceOkResponse: z.ZodLazy<z.ZodObject<{
1555
2061
  device: z.ZodLazy<z.ZodObject<{
@@ -1591,7 +2097,9 @@ declare const getEsimDeviceOkResponse: z.ZodLazy<z.ZodObject<{
1591
2097
  type GetEsimDeviceOkResponse = z.infer<typeof getEsimDeviceOkResponse>;
1592
2098
 
1593
2099
  /**
1594
- * The shape of the model inside the application code - what the users use
2100
+ * Zod schema for the GetEsimHistoryOkResponse model.
2101
+ * Defines the structure and validation rules for this data type.
2102
+ * This is the shape used in application code - what developers interact with.
1595
2103
  */
1596
2104
  declare const getEsimHistoryOkResponse: z.ZodLazy<z.ZodObject<{
1597
2105
  esim: z.ZodLazy<z.ZodObject<{
@@ -1650,6 +2158,11 @@ declare const getEsimHistoryOkResponse: z.ZodLazy<z.ZodObject<{
1650
2158
  */
1651
2159
  type GetEsimHistoryOkResponse = z.infer<typeof getEsimHistoryOkResponse>;
1652
2160
 
2161
+ /**
2162
+ * Service class for ESimService operations.
2163
+ * Provides methods to interact with ESimService-related API endpoints.
2164
+ * All methods return promises and handle request/response serialization automatically.
2165
+ */
1653
2166
  declare class ESimService extends BaseService {
1654
2167
  /**
1655
2168
  * Get eSIM
@@ -1675,7 +2188,9 @@ declare class ESimService extends BaseService {
1675
2188
  }
1676
2189
 
1677
2190
  /**
1678
- * The shape of the model inside the application code - what the users use
2191
+ * Zod schema for the GetEsimOkResponseEsim model.
2192
+ * Defines the structure and validation rules for this data type.
2193
+ * This is the shape used in application code - what developers interact with.
1679
2194
  */
1680
2195
  declare const getEsimOkResponseEsim: z.ZodLazy<z.ZodObject<{
1681
2196
  iccid: z.ZodString;
@@ -1716,7 +2231,9 @@ declare const getEsimOkResponseEsim: z.ZodLazy<z.ZodObject<{
1716
2231
  type GetEsimOkResponseEsim = z.infer<typeof getEsimOkResponseEsim>;
1717
2232
 
1718
2233
  /**
1719
- * The shape of the model inside the application code - what the users use
2234
+ * Zod schema for the Device model.
2235
+ * Defines the structure and validation rules for this data type.
2236
+ * This is the shape used in application code - what developers interact with.
1720
2237
  */
1721
2238
  declare const device: z.ZodLazy<z.ZodObject<{
1722
2239
  oem: z.ZodString;
@@ -1745,7 +2262,9 @@ declare const device: z.ZodLazy<z.ZodObject<{
1745
2262
  type Device = z.infer<typeof device>;
1746
2263
 
1747
2264
  /**
1748
- * The shape of the model inside the application code - what the users use
2265
+ * Zod schema for the GetEsimHistoryOkResponseEsim model.
2266
+ * Defines the structure and validation rules for this data type.
2267
+ * This is the shape used in application code - what developers interact with.
1749
2268
  */
1750
2269
  declare const getEsimHistoryOkResponseEsim: z.ZodLazy<z.ZodObject<{
1751
2270
  iccid: z.ZodString;
@@ -1786,7 +2305,9 @@ declare const getEsimHistoryOkResponseEsim: z.ZodLazy<z.ZodObject<{
1786
2305
  type GetEsimHistoryOkResponseEsim = z.infer<typeof getEsimHistoryOkResponseEsim>;
1787
2306
 
1788
2307
  /**
1789
- * The shape of the model inside the application code - what the users use
2308
+ * Zod schema for the History model.
2309
+ * Defines the structure and validation rules for this data type.
2310
+ * This is the shape used in application code - what developers interact with.
1790
2311
  */
1791
2312
  declare const history: z.ZodLazy<z.ZodObject<{
1792
2313
  status: z.ZodString;
@@ -1811,7 +2332,9 @@ declare const history: z.ZodLazy<z.ZodObject<{
1811
2332
  type History = z.infer<typeof history>;
1812
2333
 
1813
2334
  /**
1814
- * The shape of the model inside the application code - what the users use
2335
+ * Zod schema for the TokenOkResponse model.
2336
+ * Defines the structure and validation rules for this data type.
2337
+ * This is the shape used in application code - what developers interact with.
1815
2338
  */
1816
2339
  declare const tokenOkResponse: z.ZodLazy<z.ZodObject<{
1817
2340
  token: z.ZodString;
@@ -1827,6 +2350,11 @@ declare const tokenOkResponse: z.ZodLazy<z.ZodObject<{
1827
2350
  */
1828
2351
  type TokenOkResponse = z.infer<typeof tokenOkResponse>;
1829
2352
 
2353
+ /**
2354
+ * Service class for IFrameService operations.
2355
+ * Provides methods to interact with IFrameService-related API endpoints.
2356
+ * All methods return promises and handle request/response serialization automatically.
2357
+ */
1830
2358
  declare class IFrameService extends BaseService {
1831
2359
  /**
1832
2360
  * Generate a new token to be used in the iFrame
@@ -1837,7 +2365,9 @@ declare class IFrameService extends BaseService {
1837
2365
  }
1838
2366
 
1839
2367
  /**
1840
- * The shape of the model inside the application code - what the users use
2368
+ * Zod schema for the GetAccessTokenRequest model.
2369
+ * Defines the structure and validation rules for this data type.
2370
+ * This is the shape used in application code - what developers interact with.
1841
2371
  */
1842
2372
  declare const getAccessTokenRequest: z.ZodLazy<z.ZodObject<{
1843
2373
  grantType: z.ZodOptional<z.ZodString>;
@@ -1862,7 +2392,9 @@ declare const getAccessTokenRequest: z.ZodLazy<z.ZodObject<{
1862
2392
  type GetAccessTokenRequest = z.infer<typeof getAccessTokenRequest>;
1863
2393
 
1864
2394
  /**
1865
- * The shape of the model inside the application code - what the users use
2395
+ * Zod schema for the GetAccessTokenOkResponse model.
2396
+ * Defines the structure and validation rules for this data type.
2397
+ * This is the shape used in application code - what developers interact with.
1866
2398
  */
1867
2399
  declare const getAccessTokenOkResponse: z.ZodLazy<z.ZodObject<{
1868
2400
  accessToken: z.ZodOptional<z.ZodString>;
@@ -1886,6 +2418,11 @@ declare const getAccessTokenOkResponse: z.ZodLazy<z.ZodObject<{
1886
2418
  */
1887
2419
  type GetAccessTokenOkResponse = z.infer<typeof getAccessTokenOkResponse>;
1888
2420
 
2421
+ /**
2422
+ * Service class for OAuthService operations.
2423
+ * Provides methods to interact with OAuthService-related API endpoints.
2424
+ * All methods return promises and handle request/response serialization automatically.
2425
+ */
1889
2426
  declare class OAuthService extends BaseService {
1890
2427
  /**
1891
2428
  * This endpoint was added by liblab