celitech-sdk 1.1.71 → 1.1.72

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.
Files changed (45) hide show
  1. package/.manifest.json +12 -12
  2. package/README.md +2 -2
  3. package/documentation/services/PurchasesService.md +6 -6
  4. package/examples/package.json +1 -1
  5. package/package.json +1 -1
  6. package/src/http/handlers/hook-handler.ts +6 -4
  7. package/src/http/handlers/response-validation-handler.ts +1 -1
  8. package/src/http/handlers/retry-handler.ts +8 -5
  9. package/src/http/hooks/hook.ts +3 -2
  10. package/src/http/serializer.ts +7 -4
  11. package/src/http/transport/request-builder.ts +145 -0
  12. package/src/http/transport/request.ts +45 -36
  13. package/src/services/destinations/destinations.ts +14 -11
  14. package/src/services/destinations/models/destinations.ts +3 -3
  15. package/src/services/destinations/models/list-destinations-ok-response.ts +3 -3
  16. package/src/services/e-sim/e-sim.ts +57 -45
  17. package/src/services/e-sim/models/device.ts +3 -3
  18. package/src/services/e-sim/models/get-esim-device-ok-response.ts +3 -3
  19. package/src/services/e-sim/models/get-esim-history-ok-response-esim.ts +3 -3
  20. package/src/services/e-sim/models/get-esim-history-ok-response.ts +3 -3
  21. package/src/services/e-sim/models/get-esim-mac-ok-response-esim.ts +3 -3
  22. package/src/services/e-sim/models/get-esim-mac-ok-response.ts +3 -3
  23. package/src/services/e-sim/models/get-esim-ok-response-esim.ts +3 -3
  24. package/src/services/e-sim/models/get-esim-ok-response.ts +3 -3
  25. package/src/services/e-sim/models/history.ts +3 -3
  26. package/src/services/packages/models/list-packages-ok-response.ts +3 -3
  27. package/src/services/packages/models/packages.ts +3 -3
  28. package/src/services/packages/packages.ts +22 -19
  29. package/src/services/purchases/models/create-purchase-ok-response-profile.ts +3 -3
  30. package/src/services/purchases/models/create-purchase-ok-response-purchase.ts +3 -3
  31. package/src/services/purchases/models/create-purchase-ok-response.ts +3 -3
  32. package/src/services/purchases/models/create-purchase-request.ts +3 -3
  33. package/src/services/purchases/models/edit-purchase-ok-response.ts +3 -3
  34. package/src/services/purchases/models/edit-purchase-request.ts +3 -3
  35. package/src/services/purchases/models/get-purchase-consumption-ok-response.ts +3 -3
  36. package/src/services/purchases/models/list-purchases-ok-response.ts +3 -3
  37. package/src/services/purchases/models/package_.ts +3 -3
  38. package/src/services/purchases/models/purchases-esim.ts +3 -3
  39. package/src/services/purchases/models/purchases.ts +3 -3
  40. package/src/services/purchases/models/top-up-esim-ok-response-profile.ts +3 -3
  41. package/src/services/purchases/models/top-up-esim-ok-response-purchase.ts +3 -3
  42. package/src/services/purchases/models/top-up-esim-ok-response.ts +3 -3
  43. package/src/services/purchases/models/top-up-esim-request.ts +3 -3
  44. package/src/services/purchases/purchases.ts +81 -66
  45. package/.github/PROTECTED_BRANCHES.txt +0 -1
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { BaseService } from '../base-service';
3
3
  import { ContentType, HttpResponse } from '../../http';
4
4
  import { RequestConfig } from '../../http/types';
5
- import { Request } from '../../http/transport/request';
5
+ import { RequestBuilder } from '../../http/transport/request-builder';
6
6
  import { GetEsimOkResponse, getEsimOkResponseResponse } from './models/get-esim-ok-response';
7
7
  import { GetEsimParams } from './request-params';
8
8
  import { GetEsimDeviceOkResponse, getEsimDeviceOkResponseResponse } from './models/get-esim-device-ok-response';
@@ -16,17 +16,20 @@ export class ESimService extends BaseService {
16
16
  * @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
17
17
  */
18
18
  async getEsim(params: GetEsimParams, requestConfig?: RequestConfig): Promise<HttpResponse<GetEsimOkResponse>> {
19
- const request = new Request({
20
- method: 'GET',
21
- path: '/esim',
22
- config: this.config,
23
- responseSchema: getEsimOkResponseResponse,
24
- requestSchema: z.any(),
25
- requestContentType: ContentType.Json,
26
- responseContentType: ContentType.Json,
27
- requestConfig,
28
- });
29
- request.addQueryParam('iccid', params?.iccid);
19
+ const request = new RequestBuilder<GetEsimOkResponse>()
20
+ .setConfig(this.config)
21
+ .setBaseUrl(this.config)
22
+ .setMethod('GET')
23
+ .setPath('/esim')
24
+ .setRequestSchema(z.any())
25
+ .setResponseSchema(getEsimOkResponseResponse)
26
+ .setRequestContentType(ContentType.Json)
27
+ .setResponseContentType(ContentType.Json)
28
+ .setRetryAttempts(this.config, requestConfig)
29
+ .setRetryDelayMs(this.config, requestConfig)
30
+ .setResponseValidation(this.config, requestConfig)
31
+ .addQueryParam('iccid', params?.iccid)
32
+ .build();
30
33
  return this.client.call<GetEsimOkResponse>(request);
31
34
  }
32
35
 
@@ -36,17 +39,20 @@ export class ESimService extends BaseService {
36
39
  * @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
37
40
  */
38
41
  async getEsimDevice(iccid: string, requestConfig?: RequestConfig): Promise<HttpResponse<GetEsimDeviceOkResponse>> {
39
- const request = new Request({
40
- method: 'GET',
41
- path: '/esim/{iccid}/device',
42
- config: this.config,
43
- responseSchema: getEsimDeviceOkResponseResponse,
44
- requestSchema: z.any(),
45
- requestContentType: ContentType.Json,
46
- responseContentType: ContentType.Json,
47
- requestConfig,
48
- });
49
- request.addPathParam('iccid', iccid);
42
+ const request = new RequestBuilder<GetEsimDeviceOkResponse>()
43
+ .setConfig(this.config)
44
+ .setBaseUrl(this.config)
45
+ .setMethod('GET')
46
+ .setPath('/esim/{iccid}/device')
47
+ .setRequestSchema(z.any())
48
+ .setResponseSchema(getEsimDeviceOkResponseResponse)
49
+ .setRequestContentType(ContentType.Json)
50
+ .setResponseContentType(ContentType.Json)
51
+ .setRetryAttempts(this.config, requestConfig)
52
+ .setRetryDelayMs(this.config, requestConfig)
53
+ .setResponseValidation(this.config, requestConfig)
54
+ .addPathParam('iccid', iccid)
55
+ .build();
50
56
  return this.client.call<GetEsimDeviceOkResponse>(request);
51
57
  }
52
58
 
@@ -56,17 +62,20 @@ export class ESimService extends BaseService {
56
62
  * @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
57
63
  */
58
64
  async getEsimHistory(iccid: string, requestConfig?: RequestConfig): Promise<HttpResponse<GetEsimHistoryOkResponse>> {
59
- const request = new Request({
60
- method: 'GET',
61
- path: '/esim/{iccid}/history',
62
- config: this.config,
63
- responseSchema: getEsimHistoryOkResponseResponse,
64
- requestSchema: z.any(),
65
- requestContentType: ContentType.Json,
66
- responseContentType: ContentType.Json,
67
- requestConfig,
68
- });
69
- request.addPathParam('iccid', iccid);
65
+ const request = new RequestBuilder<GetEsimHistoryOkResponse>()
66
+ .setConfig(this.config)
67
+ .setBaseUrl(this.config)
68
+ .setMethod('GET')
69
+ .setPath('/esim/{iccid}/history')
70
+ .setRequestSchema(z.any())
71
+ .setResponseSchema(getEsimHistoryOkResponseResponse)
72
+ .setRequestContentType(ContentType.Json)
73
+ .setResponseContentType(ContentType.Json)
74
+ .setRetryAttempts(this.config, requestConfig)
75
+ .setRetryDelayMs(this.config, requestConfig)
76
+ .setResponseValidation(this.config, requestConfig)
77
+ .addPathParam('iccid', iccid)
78
+ .build();
70
79
  return this.client.call<GetEsimHistoryOkResponse>(request);
71
80
  }
72
81
 
@@ -76,17 +85,20 @@ export class ESimService extends BaseService {
76
85
  * @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
77
86
  */
78
87
  async getEsimMac(iccid: string, requestConfig?: RequestConfig): Promise<HttpResponse<GetEsimMacOkResponse>> {
79
- const request = new Request({
80
- method: 'GET',
81
- path: '/esim/{iccid}/mac',
82
- config: this.config,
83
- responseSchema: getEsimMacOkResponseResponse,
84
- requestSchema: z.any(),
85
- requestContentType: ContentType.Json,
86
- responseContentType: ContentType.Json,
87
- requestConfig,
88
- });
89
- request.addPathParam('iccid', iccid);
88
+ const request = new RequestBuilder<GetEsimMacOkResponse>()
89
+ .setConfig(this.config)
90
+ .setBaseUrl(this.config)
91
+ .setMethod('GET')
92
+ .setPath('/esim/{iccid}/mac')
93
+ .setRequestSchema(z.any())
94
+ .setResponseSchema(getEsimMacOkResponseResponse)
95
+ .setRequestContentType(ContentType.Json)
96
+ .setResponseContentType(ContentType.Json)
97
+ .setRetryAttempts(this.config, requestConfig)
98
+ .setRetryDelayMs(this.config, requestConfig)
99
+ .setResponseValidation(this.config, requestConfig)
100
+ .addPathParam('iccid', iccid)
101
+ .build();
90
102
  return this.client.call<GetEsimMacOkResponse>(request);
91
103
  }
92
104
  }
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const device: any = z.lazy(() => {
6
+ export const device = z.lazy(() => {
7
7
  return z.object({
8
8
  oem: z.string().optional(),
9
9
  hardwareName: z.string().optional(),
@@ -26,7 +26,7 @@ export type Device = z.infer<typeof device>;
26
26
  * The shape of the model mapping from the api schema into the application shape.
27
27
  * Is equal to application shape if all property names match the api schema
28
28
  */
29
- export const deviceResponse: any = z.lazy(() => {
29
+ export const deviceResponse = z.lazy(() => {
30
30
  return z
31
31
  .object({
32
32
  oem: z.string().optional(),
@@ -46,7 +46,7 @@ export const deviceResponse: any = z.lazy(() => {
46
46
  * The shape of the model mapping from the application shape into the api schema.
47
47
  * Is equal to application shape if all property names match the api schema
48
48
  */
49
- export const deviceRequest: any = z.lazy(() => {
49
+ export const deviceRequest = z.lazy(() => {
50
50
  return z
51
51
  .object({
52
52
  oem: z.string().nullish(),
@@ -4,7 +4,7 @@ import { device, deviceRequest, deviceResponse } from './device';
4
4
  /**
5
5
  * The shape of the model inside the application code - what the users use
6
6
  */
7
- export const getEsimDeviceOkResponse: any = z.lazy(() => {
7
+ export const getEsimDeviceOkResponse = z.lazy(() => {
8
8
  return z.object({
9
9
  device: device.optional(),
10
10
  });
@@ -21,7 +21,7 @@ export type GetEsimDeviceOkResponse = z.infer<typeof getEsimDeviceOkResponse>;
21
21
  * The shape of the model mapping from the api schema into the application shape.
22
22
  * Is equal to application shape if all property names match the api schema
23
23
  */
24
- export const getEsimDeviceOkResponseResponse: any = z.lazy(() => {
24
+ export const getEsimDeviceOkResponseResponse = z.lazy(() => {
25
25
  return z
26
26
  .object({
27
27
  device: deviceResponse.optional(),
@@ -35,7 +35,7 @@ export const getEsimDeviceOkResponseResponse: any = z.lazy(() => {
35
35
  * The shape of the model mapping from the application shape into the api schema.
36
36
  * Is equal to application shape if all property names match the api schema
37
37
  */
38
- export const getEsimDeviceOkResponseRequest: any = z.lazy(() => {
38
+ export const getEsimDeviceOkResponseRequest = z.lazy(() => {
39
39
  return z.object({ device: deviceRequest.nullish() }).transform((data) => ({
40
40
  device: data['device'],
41
41
  }));
@@ -4,7 +4,7 @@ import { history, historyRequest, historyResponse } from './history';
4
4
  /**
5
5
  * The shape of the model inside the application code - what the users use
6
6
  */
7
- export const getEsimHistoryOkResponseEsim: any = z.lazy(() => {
7
+ export const getEsimHistoryOkResponseEsim = z.lazy(() => {
8
8
  return z.object({
9
9
  iccid: z.string().min(18).max(22).optional(),
10
10
  history: z.array(history).optional(),
@@ -23,7 +23,7 @@ export type GetEsimHistoryOkResponseEsim = z.infer<typeof getEsimHistoryOkRespon
23
23
  * The shape of the model mapping from the api schema into the application shape.
24
24
  * Is equal to application shape if all property names match the api schema
25
25
  */
26
- export const getEsimHistoryOkResponseEsimResponse: any = z.lazy(() => {
26
+ export const getEsimHistoryOkResponseEsimResponse = z.lazy(() => {
27
27
  return z
28
28
  .object({
29
29
  iccid: z.string().min(18).max(22).optional(),
@@ -39,7 +39,7 @@ export const getEsimHistoryOkResponseEsimResponse: any = z.lazy(() => {
39
39
  * The shape of the model mapping from the application shape into the api schema.
40
40
  * Is equal to application shape if all property names match the api schema
41
41
  */
42
- export const getEsimHistoryOkResponseEsimRequest: any = z.lazy(() => {
42
+ export const getEsimHistoryOkResponseEsimRequest = z.lazy(() => {
43
43
  return z.object({ iccid: z.string().nullish(), history: z.array(historyRequest).nullish() }).transform((data) => ({
44
44
  iccid: data['iccid'],
45
45
  history: data['history'],
@@ -8,7 +8,7 @@ import {
8
8
  /**
9
9
  * The shape of the model inside the application code - what the users use
10
10
  */
11
- export const getEsimHistoryOkResponse: any = z.lazy(() => {
11
+ export const getEsimHistoryOkResponse = z.lazy(() => {
12
12
  return z.object({
13
13
  esim: getEsimHistoryOkResponseEsim.optional(),
14
14
  });
@@ -25,7 +25,7 @@ export type GetEsimHistoryOkResponse = z.infer<typeof getEsimHistoryOkResponse>;
25
25
  * The shape of the model mapping from the api schema into the application shape.
26
26
  * Is equal to application shape if all property names match the api schema
27
27
  */
28
- export const getEsimHistoryOkResponseResponse: any = z.lazy(() => {
28
+ export const getEsimHistoryOkResponseResponse = z.lazy(() => {
29
29
  return z
30
30
  .object({
31
31
  esim: getEsimHistoryOkResponseEsimResponse.optional(),
@@ -39,7 +39,7 @@ export const getEsimHistoryOkResponseResponse: any = z.lazy(() => {
39
39
  * The shape of the model mapping from the application shape into the api schema.
40
40
  * Is equal to application shape if all property names match the api schema
41
41
  */
42
- export const getEsimHistoryOkResponseRequest: any = z.lazy(() => {
42
+ export const getEsimHistoryOkResponseRequest = z.lazy(() => {
43
43
  return z.object({ esim: getEsimHistoryOkResponseEsimRequest.nullish() }).transform((data) => ({
44
44
  esim: data['esim'],
45
45
  }));
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const getEsimMacOkResponseEsim: any = z.lazy(() => {
6
+ export const getEsimMacOkResponseEsim = z.lazy(() => {
7
7
  return z.object({
8
8
  iccid: z.string().min(18).max(22).optional(),
9
9
  smdpAddress: z.string().optional(),
@@ -24,7 +24,7 @@ export type GetEsimMacOkResponseEsim = z.infer<typeof getEsimMacOkResponseEsim>;
24
24
  * The shape of the model mapping from the api schema into the application shape.
25
25
  * Is equal to application shape if all property names match the api schema
26
26
  */
27
- export const getEsimMacOkResponseEsimResponse: any = z.lazy(() => {
27
+ export const getEsimMacOkResponseEsimResponse = z.lazy(() => {
28
28
  return z
29
29
  .object({
30
30
  iccid: z.string().min(18).max(22).optional(),
@@ -42,7 +42,7 @@ export const getEsimMacOkResponseEsimResponse: any = z.lazy(() => {
42
42
  * The shape of the model mapping from the application shape into the api schema.
43
43
  * Is equal to application shape if all property names match the api schema
44
44
  */
45
- export const getEsimMacOkResponseEsimRequest: any = z.lazy(() => {
45
+ export const getEsimMacOkResponseEsimRequest = z.lazy(() => {
46
46
  return z
47
47
  .object({
48
48
  iccid: z.string().nullish(),
@@ -8,7 +8,7 @@ import {
8
8
  /**
9
9
  * The shape of the model inside the application code - what the users use
10
10
  */
11
- export const getEsimMacOkResponse: any = z.lazy(() => {
11
+ export const getEsimMacOkResponse = z.lazy(() => {
12
12
  return z.object({
13
13
  esim: getEsimMacOkResponseEsim.optional(),
14
14
  });
@@ -25,7 +25,7 @@ export type GetEsimMacOkResponse = z.infer<typeof getEsimMacOkResponse>;
25
25
  * The shape of the model mapping from the api schema into the application shape.
26
26
  * Is equal to application shape if all property names match the api schema
27
27
  */
28
- export const getEsimMacOkResponseResponse: any = z.lazy(() => {
28
+ export const getEsimMacOkResponseResponse = z.lazy(() => {
29
29
  return z
30
30
  .object({
31
31
  esim: getEsimMacOkResponseEsimResponse.optional(),
@@ -39,7 +39,7 @@ export const getEsimMacOkResponseResponse: any = z.lazy(() => {
39
39
  * The shape of the model mapping from the application shape into the api schema.
40
40
  * Is equal to application shape if all property names match the api schema
41
41
  */
42
- export const getEsimMacOkResponseRequest: any = z.lazy(() => {
42
+ export const getEsimMacOkResponseRequest = z.lazy(() => {
43
43
  return z.object({ esim: getEsimMacOkResponseEsimRequest.nullish() }).transform((data) => ({
44
44
  esim: data['esim'],
45
45
  }));
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const getEsimOkResponseEsim: any = z.lazy(() => {
6
+ export const getEsimOkResponseEsim = z.lazy(() => {
7
7
  return z.object({
8
8
  iccid: z.string().min(18).max(22).optional(),
9
9
  smdpAddress: z.string().optional(),
@@ -26,7 +26,7 @@ export type GetEsimOkResponseEsim = z.infer<typeof getEsimOkResponseEsim>;
26
26
  * The shape of the model mapping from the api schema into the application shape.
27
27
  * Is equal to application shape if all property names match the api schema
28
28
  */
29
- export const getEsimOkResponseEsimResponse: any = z.lazy(() => {
29
+ export const getEsimOkResponseEsimResponse = z.lazy(() => {
30
30
  return z
31
31
  .object({
32
32
  iccid: z.string().min(18).max(22).optional(),
@@ -46,7 +46,7 @@ export const getEsimOkResponseEsimResponse: any = z.lazy(() => {
46
46
  * The shape of the model mapping from the application shape into the api schema.
47
47
  * Is equal to application shape if all property names match the api schema
48
48
  */
49
- export const getEsimOkResponseEsimRequest: any = z.lazy(() => {
49
+ export const getEsimOkResponseEsimRequest = z.lazy(() => {
50
50
  return z
51
51
  .object({
52
52
  iccid: z.string().nullish(),
@@ -8,7 +8,7 @@ import {
8
8
  /**
9
9
  * The shape of the model inside the application code - what the users use
10
10
  */
11
- export const getEsimOkResponse: any = z.lazy(() => {
11
+ export const getEsimOkResponse = z.lazy(() => {
12
12
  return z.object({
13
13
  esim: getEsimOkResponseEsim.optional(),
14
14
  });
@@ -25,7 +25,7 @@ export type GetEsimOkResponse = z.infer<typeof getEsimOkResponse>;
25
25
  * The shape of the model mapping from the api schema into the application shape.
26
26
  * Is equal to application shape if all property names match the api schema
27
27
  */
28
- export const getEsimOkResponseResponse: any = z.lazy(() => {
28
+ export const getEsimOkResponseResponse = z.lazy(() => {
29
29
  return z
30
30
  .object({
31
31
  esim: getEsimOkResponseEsimResponse.optional(),
@@ -39,7 +39,7 @@ export const getEsimOkResponseResponse: any = z.lazy(() => {
39
39
  * The shape of the model mapping from the application shape into the api schema.
40
40
  * Is equal to application shape if all property names match the api schema
41
41
  */
42
- export const getEsimOkResponseRequest: any = z.lazy(() => {
42
+ export const getEsimOkResponseRequest = z.lazy(() => {
43
43
  return z.object({ esim: getEsimOkResponseEsimRequest.nullish() }).transform((data) => ({
44
44
  esim: data['esim'],
45
45
  }));
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const history: any = z.lazy(() => {
6
+ export const history = z.lazy(() => {
7
7
  return z.object({
8
8
  status: z.string().optional(),
9
9
  statusDate: z.string().optional(),
@@ -24,7 +24,7 @@ export type History = z.infer<typeof history>;
24
24
  * The shape of the model mapping from the api schema into the application shape.
25
25
  * Is equal to application shape if all property names match the api schema
26
26
  */
27
- export const historyResponse: any = z.lazy(() => {
27
+ export const historyResponse = z.lazy(() => {
28
28
  return z
29
29
  .object({
30
30
  status: z.string().optional(),
@@ -42,7 +42,7 @@ export const historyResponse: any = z.lazy(() => {
42
42
  * The shape of the model mapping from the application shape into the api schema.
43
43
  * Is equal to application shape if all property names match the api schema
44
44
  */
45
- export const historyRequest: any = z.lazy(() => {
45
+ export const historyRequest = z.lazy(() => {
46
46
  return z
47
47
  .object({ status: z.string().nullish(), statusDate: z.string().nullish(), date: z.number().nullish() })
48
48
  .transform((data) => ({
@@ -4,7 +4,7 @@ import { packages, packagesRequest, packagesResponse } from './packages';
4
4
  /**
5
5
  * The shape of the model inside the application code - what the users use
6
6
  */
7
- export const listPackagesOkResponse: any = z.lazy(() => {
7
+ export const listPackagesOkResponse = z.lazy(() => {
8
8
  return z.object({
9
9
  packages: z.array(packages).optional(),
10
10
  afterCursor: z.string().optional().nullable(),
@@ -23,7 +23,7 @@ export type ListPackagesOkResponse = z.infer<typeof listPackagesOkResponse>;
23
23
  * The shape of the model mapping from the api schema into the application shape.
24
24
  * Is equal to application shape if all property names match the api schema
25
25
  */
26
- export const listPackagesOkResponseResponse: any = z.lazy(() => {
26
+ export const listPackagesOkResponseResponse = z.lazy(() => {
27
27
  return z
28
28
  .object({
29
29
  packages: z.array(packagesResponse).optional(),
@@ -39,7 +39,7 @@ export const listPackagesOkResponseResponse: any = z.lazy(() => {
39
39
  * The shape of the model mapping from the application shape into the api schema.
40
40
  * Is equal to application shape if all property names match the api schema
41
41
  */
42
- export const listPackagesOkResponseRequest: any = z.lazy(() => {
42
+ export const listPackagesOkResponseRequest = z.lazy(() => {
43
43
  return z
44
44
  .object({ packages: z.array(packagesRequest).nullish(), afterCursor: z.string().nullish() })
45
45
  .transform((data) => ({
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const packages: any = z.lazy(() => {
6
+ export const packages = z.lazy(() => {
7
7
  return z.object({
8
8
  id: z.string().optional(),
9
9
  destination: z.string().optional(),
@@ -30,7 +30,7 @@ export type Packages = z.infer<typeof packages>;
30
30
  * The shape of the model mapping from the api schema into the application shape.
31
31
  * Is equal to application shape if all property names match the api schema
32
32
  */
33
- export const packagesResponse: any = z.lazy(() => {
33
+ export const packagesResponse = z.lazy(() => {
34
34
  return z
35
35
  .object({
36
36
  id: z.string().optional(),
@@ -54,7 +54,7 @@ export const packagesResponse: any = z.lazy(() => {
54
54
  * The shape of the model mapping from the application shape into the api schema.
55
55
  * Is equal to application shape if all property names match the api schema
56
56
  */
57
- export const packagesRequest: any = z.lazy(() => {
57
+ export const packagesRequest = z.lazy(() => {
58
58
  return z
59
59
  .object({
60
60
  id: z.string().nullish(),
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { BaseService } from '../base-service';
3
3
  import { ContentType, HttpResponse } from '../../http';
4
4
  import { RequestConfig } from '../../http/types';
5
- import { Request } from '../../http/transport/request';
5
+ import { RequestBuilder } from '../../http/transport/request-builder';
6
6
  import { ListPackagesOkResponse, listPackagesOkResponseResponse } from './models/list-packages-ok-response';
7
7
  import { ListPackagesParams } from './request-params';
8
8
 
@@ -23,24 +23,27 @@ export class PackagesService extends BaseService {
23
23
  params?: ListPackagesParams,
24
24
  requestConfig?: RequestConfig,
25
25
  ): Promise<HttpResponse<ListPackagesOkResponse>> {
26
- const request = new Request({
27
- method: 'GET',
28
- path: '/packages',
29
- config: this.config,
30
- responseSchema: listPackagesOkResponseResponse,
31
- requestSchema: z.any(),
32
- requestContentType: ContentType.Json,
33
- responseContentType: ContentType.Json,
34
- requestConfig,
35
- });
36
- request.addQueryParam('destination', params?.destination);
37
- request.addQueryParam('startDate', params?.startDate);
38
- request.addQueryParam('endDate', params?.endDate);
39
- request.addQueryParam('afterCursor', params?.afterCursor);
40
- request.addQueryParam('limit', params?.limit);
41
- request.addQueryParam('startTime', params?.startTime);
42
- request.addQueryParam('endTime', params?.endTime);
43
- request.addQueryParam('duration', params?.duration);
26
+ const request = new RequestBuilder<ListPackagesOkResponse>()
27
+ .setConfig(this.config)
28
+ .setBaseUrl(this.config)
29
+ .setMethod('GET')
30
+ .setPath('/packages')
31
+ .setRequestSchema(z.any())
32
+ .setResponseSchema(listPackagesOkResponseResponse)
33
+ .setRequestContentType(ContentType.Json)
34
+ .setResponseContentType(ContentType.Json)
35
+ .setRetryAttempts(this.config, requestConfig)
36
+ .setRetryDelayMs(this.config, requestConfig)
37
+ .setResponseValidation(this.config, requestConfig)
38
+ .addQueryParam('destination', params?.destination)
39
+ .addQueryParam('startDate', params?.startDate)
40
+ .addQueryParam('endDate', params?.endDate)
41
+ .addQueryParam('afterCursor', params?.afterCursor)
42
+ .addQueryParam('limit', params?.limit)
43
+ .addQueryParam('startTime', params?.startTime)
44
+ .addQueryParam('endTime', params?.endTime)
45
+ .addQueryParam('duration', params?.duration)
46
+ .build();
44
47
  return this.client.call<ListPackagesOkResponse>(request);
45
48
  }
46
49
  }
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const createPurchaseOkResponseProfile: any = z.lazy(() => {
6
+ export const createPurchaseOkResponseProfile = z.lazy(() => {
7
7
  return z.object({
8
8
  iccid: z.string().min(18).max(22).optional(),
9
9
  activationCode: z.string().min(1000).max(8000).optional(),
@@ -22,7 +22,7 @@ export type CreatePurchaseOkResponseProfile = z.infer<typeof createPurchaseOkRes
22
22
  * The shape of the model mapping from the api schema into the application shape.
23
23
  * Is equal to application shape if all property names match the api schema
24
24
  */
25
- export const createPurchaseOkResponseProfileResponse: any = z.lazy(() => {
25
+ export const createPurchaseOkResponseProfileResponse = z.lazy(() => {
26
26
  return z
27
27
  .object({
28
28
  iccid: z.string().min(18).max(22).optional(),
@@ -38,7 +38,7 @@ export const createPurchaseOkResponseProfileResponse: any = z.lazy(() => {
38
38
  * The shape of the model mapping from the application shape into the api schema.
39
39
  * Is equal to application shape if all property names match the api schema
40
40
  */
41
- export const createPurchaseOkResponseProfileRequest: any = z.lazy(() => {
41
+ export const createPurchaseOkResponseProfileRequest = z.lazy(() => {
42
42
  return z.object({ iccid: z.string().nullish(), activationCode: z.string().nullish() }).transform((data) => ({
43
43
  iccid: data['iccid'],
44
44
  activationCode: data['activationCode'],
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const createPurchaseOkResponsePurchase: any = z.lazy(() => {
6
+ export const createPurchaseOkResponsePurchase = z.lazy(() => {
7
7
  return z.object({
8
8
  id: z.string().optional(),
9
9
  packageId: z.string().optional(),
@@ -32,7 +32,7 @@ export type CreatePurchaseOkResponsePurchase = z.infer<typeof createPurchaseOkRe
32
32
  * The shape of the model mapping from the api schema into the application shape.
33
33
  * Is equal to application shape if all property names match the api schema
34
34
  */
35
- export const createPurchaseOkResponsePurchaseResponse: any = z.lazy(() => {
35
+ export const createPurchaseOkResponsePurchaseResponse = z.lazy(() => {
36
36
  return z
37
37
  .object({
38
38
  id: z.string().optional(),
@@ -58,7 +58,7 @@ export const createPurchaseOkResponsePurchaseResponse: any = z.lazy(() => {
58
58
  * The shape of the model mapping from the application shape into the api schema.
59
59
  * Is equal to application shape if all property names match the api schema
60
60
  */
61
- export const createPurchaseOkResponsePurchaseRequest: any = z.lazy(() => {
61
+ export const createPurchaseOkResponsePurchaseRequest = z.lazy(() => {
62
62
  return z
63
63
  .object({
64
64
  id: z.string().nullish(),
@@ -13,7 +13,7 @@ import {
13
13
  /**
14
14
  * The shape of the model inside the application code - what the users use
15
15
  */
16
- export const createPurchaseOkResponse: any = z.lazy(() => {
16
+ export const createPurchaseOkResponse = z.lazy(() => {
17
17
  return z.object({
18
18
  purchase: createPurchaseOkResponsePurchase.optional(),
19
19
  profile: createPurchaseOkResponseProfile.optional(),
@@ -32,7 +32,7 @@ export type CreatePurchaseOkResponse = z.infer<typeof createPurchaseOkResponse>;
32
32
  * The shape of the model mapping from the api schema into the application shape.
33
33
  * Is equal to application shape if all property names match the api schema
34
34
  */
35
- export const createPurchaseOkResponseResponse: any = z.lazy(() => {
35
+ export const createPurchaseOkResponseResponse = z.lazy(() => {
36
36
  return z
37
37
  .object({
38
38
  purchase: createPurchaseOkResponsePurchaseResponse.optional(),
@@ -48,7 +48,7 @@ export const createPurchaseOkResponseResponse: any = z.lazy(() => {
48
48
  * The shape of the model mapping from the application shape into the api schema.
49
49
  * Is equal to application shape if all property names match the api schema
50
50
  */
51
- export const createPurchaseOkResponseRequest: any = z.lazy(() => {
51
+ export const createPurchaseOkResponseRequest = z.lazy(() => {
52
52
  return z
53
53
  .object({
54
54
  purchase: createPurchaseOkResponsePurchaseRequest.nullish(),
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const createPurchaseRequest: any = z.lazy(() => {
6
+ export const createPurchaseRequest = z.lazy(() => {
7
7
  return z.object({
8
8
  destination: z.string(),
9
9
  dataLimitInGb: z.number(),
@@ -36,7 +36,7 @@ export type CreatePurchaseRequest = z.infer<typeof createPurchaseRequest>;
36
36
  * The shape of the model mapping from the api schema into the application shape.
37
37
  * Is equal to application shape if all property names match the api schema
38
38
  */
39
- export const createPurchaseRequestResponse: any = z.lazy(() => {
39
+ export const createPurchaseRequestResponse = z.lazy(() => {
40
40
  return z
41
41
  .object({
42
42
  destination: z.string(),
@@ -66,7 +66,7 @@ export const createPurchaseRequestResponse: any = z.lazy(() => {
66
66
  * The shape of the model mapping from the application shape into the api schema.
67
67
  * Is equal to application shape if all property names match the api schema
68
68
  */
69
- export const createPurchaseRequestRequest: any = z.lazy(() => {
69
+ export const createPurchaseRequestRequest = z.lazy(() => {
70
70
  return z
71
71
  .object({
72
72
  destination: z.string().nullish(),
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  /**
4
4
  * The shape of the model inside the application code - what the users use
5
5
  */
6
- export const editPurchaseOkResponse: any = z.lazy(() => {
6
+ export const editPurchaseOkResponse = z.lazy(() => {
7
7
  return z.object({
8
8
  purchaseId: z.string().optional(),
9
9
  newStartDate: z.string().optional(),
@@ -28,7 +28,7 @@ export type EditPurchaseOkResponse = z.infer<typeof editPurchaseOkResponse>;
28
28
  * The shape of the model mapping from the api schema into the application shape.
29
29
  * Is equal to application shape if all property names match the api schema
30
30
  */
31
- export const editPurchaseOkResponseResponse: any = z.lazy(() => {
31
+ export const editPurchaseOkResponseResponse = z.lazy(() => {
32
32
  return z
33
33
  .object({
34
34
  purchaseId: z.string().optional(),
@@ -50,7 +50,7 @@ export const editPurchaseOkResponseResponse: any = z.lazy(() => {
50
50
  * The shape of the model mapping from the application shape into the api schema.
51
51
  * Is equal to application shape if all property names match the api schema
52
52
  */
53
- export const editPurchaseOkResponseRequest: any = z.lazy(() => {
53
+ export const editPurchaseOkResponseRequest = z.lazy(() => {
54
54
  return z
55
55
  .object({
56
56
  purchaseId: z.string().nullish(),