celitech-sdk 1.1.85 → 1.1.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. package/README.md +24 -18
  2. package/dist/index.d.ts +1503 -12
  3. package/dist/index.js +2152 -76
  4. package/dist/index.mjs +2114 -0
  5. package/package.json +25 -6
  6. package/.devcontainer/devcontainer.json +0 -24
  7. package/.github/workflows/publish_npmjs.yml +0 -32
  8. package/.manifest.json +0 -256
  9. package/dist/http/client.d.ts +0 -14
  10. package/dist/http/client.d.ts.map +0 -1
  11. package/dist/http/client.js +0 -36
  12. package/dist/http/client.js.map +0 -1
  13. package/dist/http/environment.d.ts +0 -4
  14. package/dist/http/environment.d.ts.map +0 -1
  15. package/dist/http/environment.js +0 -8
  16. package/dist/http/environment.js.map +0 -1
  17. package/dist/http/error.d.ts +0 -7
  18. package/dist/http/error.d.ts.map +0 -1
  19. package/dist/http/error.js +0 -12
  20. package/dist/http/error.js.map +0 -1
  21. package/dist/http/handlers/handler-chain.d.ts +0 -8
  22. package/dist/http/handlers/handler-chain.d.ts.map +0 -1
  23. package/dist/http/handlers/handler-chain.js +0 -34
  24. package/dist/http/handlers/handler-chain.js.map +0 -1
  25. package/dist/http/handlers/hook-handler.d.ts +0 -12
  26. package/dist/http/handlers/hook-handler.d.ts.map +0 -1
  27. package/dist/http/handlers/hook-handler.js +0 -49
  28. package/dist/http/handlers/hook-handler.js.map +0 -1
  29. package/dist/http/handlers/request-validation-handler.d.ts +0 -9
  30. package/dist/http/handlers/request-validation-handler.d.ts.map +0 -1
  31. package/dist/http/handlers/request-validation-handler.js +0 -78
  32. package/dist/http/handlers/request-validation-handler.js.map +0 -1
  33. package/dist/http/handlers/response-validation-handler.d.ts +0 -11
  34. package/dist/http/handlers/response-validation-handler.d.ts.map +0 -1
  35. package/dist/http/handlers/response-validation-handler.js +0 -89
  36. package/dist/http/handlers/response-validation-handler.js.map +0 -1
  37. package/dist/http/handlers/retry-handler.d.ts +0 -9
  38. package/dist/http/handlers/retry-handler.d.ts.map +0 -1
  39. package/dist/http/handlers/retry-handler.js +0 -47
  40. package/dist/http/handlers/retry-handler.js.map +0 -1
  41. package/dist/http/handlers/terminating-handler.d.ts +0 -8
  42. package/dist/http/handlers/terminating-handler.d.ts.map +0 -1
  43. package/dist/http/handlers/terminating-handler.js +0 -45
  44. package/dist/http/handlers/terminating-handler.js.map +0 -1
  45. package/dist/http/hooks/custom-hook.d.ts +0 -8
  46. package/dist/http/hooks/custom-hook.d.ts.map +0 -1
  47. package/dist/http/hooks/custom-hook.js +0 -37
  48. package/dist/http/hooks/custom-hook.js.map +0 -1
  49. package/dist/http/hooks/hook.d.ts +0 -31
  50. package/dist/http/hooks/hook.d.ts.map +0 -1
  51. package/dist/http/hooks/hook.js +0 -3
  52. package/dist/http/hooks/hook.js.map +0 -1
  53. package/dist/http/serializer.d.ts +0 -13
  54. package/dist/http/serializer.d.ts.map +0 -1
  55. package/dist/http/serializer.js +0 -150
  56. package/dist/http/serializer.js.map +0 -1
  57. package/dist/http/transport/request-builder.d.ts +0 -24
  58. package/dist/http/transport/request-builder.d.ts.map +0 -1
  59. package/dist/http/transport/request-builder.js +0 -130
  60. package/dist/http/transport/request-builder.js.map +0 -1
  61. package/dist/http/transport/request.d.ts +0 -53
  62. package/dist/http/transport/request.d.ts.map +0 -1
  63. package/dist/http/transport/request.js +0 -116
  64. package/dist/http/transport/request.js.map +0 -1
  65. package/dist/http/types.d.ts +0 -60
  66. package/dist/http/types.d.ts.map +0 -1
  67. package/dist/http/types.js +0 -16
  68. package/dist/http/types.js.map +0 -1
  69. package/dist/index.d.ts.map +0 -1
  70. package/dist/index.js.map +0 -1
  71. package/dist/services/base-service.d.ts +0 -14
  72. package/dist/services/base-service.d.ts.map +0 -1
  73. package/dist/services/base-service.js +0 -27
  74. package/dist/services/base-service.js.map +0 -1
  75. package/dist/services/destinations/destinations.d.ts +0 -11
  76. package/dist/services/destinations/destinations.d.ts.map +0 -1
  77. package/dist/services/destinations/destinations.js +0 -43
  78. package/dist/services/destinations/destinations.js.map +0 -1
  79. package/dist/services/destinations/index.d.ts +0 -3
  80. package/dist/services/destinations/index.d.ts.map +0 -1
  81. package/dist/services/destinations/index.js +0 -21
  82. package/dist/services/destinations/index.js.map +0 -1
  83. package/dist/services/destinations/models/destinations.d.ts +0 -76
  84. package/dist/services/destinations/models/destinations.d.ts.map +0 -1
  85. package/dist/services/destinations/models/destinations.js +0 -49
  86. package/dist/services/destinations/models/destinations.js.map +0 -1
  87. package/dist/services/destinations/models/index.d.ts +0 -3
  88. package/dist/services/destinations/models/index.d.ts.map +0 -1
  89. package/dist/services/destinations/models/index.js +0 -3
  90. package/dist/services/destinations/models/index.js.map +0 -1
  91. package/dist/services/destinations/models/list-destinations-ok-response.d.ts +0 -140
  92. package/dist/services/destinations/models/list-destinations-ok-response.d.ts.map +0 -1
  93. package/dist/services/destinations/models/list-destinations-ok-response.js +0 -36
  94. package/dist/services/destinations/models/list-destinations-ok-response.js.map +0 -1
  95. package/dist/services/e-sim/e-sim.d.ts +0 -34
  96. package/dist/services/e-sim/e-sim.d.ts.map +0 -1
  97. package/dist/services/e-sim/e-sim.js +0 -120
  98. package/dist/services/e-sim/e-sim.js.map +0 -1
  99. package/dist/services/e-sim/index.d.ts +0 -3
  100. package/dist/services/e-sim/index.d.ts.map +0 -1
  101. package/dist/services/e-sim/index.js +0 -21
  102. package/dist/services/e-sim/index.js.map +0 -1
  103. package/dist/services/e-sim/models/device.d.ts +0 -90
  104. package/dist/services/e-sim/models/device.d.ts.map +0 -1
  105. package/dist/services/e-sim/models/device.js +0 -54
  106. package/dist/services/e-sim/models/device.js.map +0 -1
  107. package/dist/services/e-sim/models/get-esim-device-ok-response.d.ts +0 -163
  108. package/dist/services/e-sim/models/get-esim-device-ok-response.d.ts.map +0 -1
  109. package/dist/services/e-sim/models/get-esim-device-ok-response.js +0 -36
  110. package/dist/services/e-sim/models/get-esim-device-ok-response.js.map +0 -1
  111. package/dist/services/e-sim/models/get-esim-history-ok-response-esim.d.ts +0 -154
  112. package/dist/services/e-sim/models/get-esim-history-ok-response-esim.d.ts.map +0 -1
  113. package/dist/services/e-sim/models/get-esim-history-ok-response-esim.js +0 -40
  114. package/dist/services/e-sim/models/get-esim-history-ok-response-esim.js.map +0 -1
  115. package/dist/services/e-sim/models/get-esim-history-ok-response.d.ts +0 -249
  116. package/dist/services/e-sim/models/get-esim-history-ok-response.d.ts.map +0 -1
  117. package/dist/services/e-sim/models/get-esim-history-ok-response.js +0 -36
  118. package/dist/services/e-sim/models/get-esim-history-ok-response.js.map +0 -1
  119. package/dist/services/e-sim/models/get-esim-mac-ok-response-esim.d.ts +0 -76
  120. package/dist/services/e-sim/models/get-esim-mac-ok-response-esim.d.ts.map +0 -1
  121. package/dist/services/e-sim/models/get-esim-mac-ok-response-esim.js +0 -49
  122. package/dist/services/e-sim/models/get-esim-mac-ok-response-esim.js.map +0 -1
  123. package/dist/services/e-sim/models/get-esim-mac-ok-response.d.ts +0 -140
  124. package/dist/services/e-sim/models/get-esim-mac-ok-response.d.ts.map +0 -1
  125. package/dist/services/e-sim/models/get-esim-mac-ok-response.js +0 -36
  126. package/dist/services/e-sim/models/get-esim-mac-ok-response.js.map +0 -1
  127. package/dist/services/e-sim/models/get-esim-ok-response-esim.d.ts +0 -90
  128. package/dist/services/e-sim/models/get-esim-ok-response-esim.d.ts.map +0 -1
  129. package/dist/services/e-sim/models/get-esim-ok-response-esim.js +0 -54
  130. package/dist/services/e-sim/models/get-esim-ok-response-esim.js.map +0 -1
  131. package/dist/services/e-sim/models/get-esim-ok-response.d.ts +0 -163
  132. package/dist/services/e-sim/models/get-esim-ok-response.d.ts.map +0 -1
  133. package/dist/services/e-sim/models/get-esim-ok-response.js +0 -36
  134. package/dist/services/e-sim/models/get-esim-ok-response.js.map +0 -1
  135. package/dist/services/e-sim/models/history.d.ts +0 -76
  136. package/dist/services/e-sim/models/history.d.ts.map +0 -1
  137. package/dist/services/e-sim/models/history.js +0 -45
  138. package/dist/services/e-sim/models/history.js.map +0 -1
  139. package/dist/services/e-sim/models/index.d.ts +0 -10
  140. package/dist/services/e-sim/models/index.d.ts.map +0 -1
  141. package/dist/services/e-sim/models/index.js +0 -3
  142. package/dist/services/e-sim/models/index.js.map +0 -1
  143. package/dist/services/e-sim/request-params.d.ts +0 -4
  144. package/dist/services/e-sim/request-params.d.ts.map +0 -1
  145. package/dist/services/e-sim/request-params.js +0 -3
  146. package/dist/services/e-sim/request-params.js.map +0 -1
  147. package/dist/services/packages/index.d.ts +0 -3
  148. package/dist/services/packages/index.d.ts.map +0 -1
  149. package/dist/services/packages/index.js +0 -21
  150. package/dist/services/packages/index.js.map +0 -1
  151. package/dist/services/packages/models/index.d.ts +0 -3
  152. package/dist/services/packages/models/index.d.ts.map +0 -1
  153. package/dist/services/packages/models/index.js +0 -3
  154. package/dist/services/packages/models/index.js.map +0 -1
  155. package/dist/services/packages/models/list-packages-ok-response.d.ts +0 -223
  156. package/dist/services/packages/models/list-packages-ok-response.d.ts.map +0 -1
  157. package/dist/services/packages/models/list-packages-ok-response.js +0 -42
  158. package/dist/services/packages/models/list-packages-ok-response.js.map +0 -1
  159. package/dist/services/packages/models/packages.d.ts +0 -118
  160. package/dist/services/packages/models/packages.d.ts.map +0 -1
  161. package/dist/services/packages/models/packages.js +0 -64
  162. package/dist/services/packages/models/packages.js.map +0 -1
  163. package/dist/services/packages/packages.d.ts +0 -20
  164. package/dist/services/packages/packages.d.ts.map +0 -1
  165. package/dist/services/packages/packages.js +0 -59
  166. package/dist/services/packages/packages.js.map +0 -1
  167. package/dist/services/packages/request-params.d.ts +0 -11
  168. package/dist/services/packages/request-params.d.ts.map +0 -1
  169. package/dist/services/packages/request-params.js +0 -3
  170. package/dist/services/packages/request-params.js.map +0 -1
  171. package/dist/services/purchases/index.d.ts +0 -3
  172. package/dist/services/purchases/index.d.ts.map +0 -1
  173. package/dist/services/purchases/index.js +0 -21
  174. package/dist/services/purchases/index.js.map +0 -1
  175. package/dist/services/purchases/models/create-purchase-ok-response-profile.d.ts +0 -62
  176. package/dist/services/purchases/models/create-purchase-ok-response-profile.d.ts.map +0 -1
  177. package/dist/services/purchases/models/create-purchase-ok-response-profile.js +0 -39
  178. package/dist/services/purchases/models/create-purchase-ok-response-profile.js.map +0 -1
  179. package/dist/services/purchases/models/create-purchase-ok-response-purchase.d.ts +0 -132
  180. package/dist/services/purchases/models/create-purchase-ok-response-purchase.d.ts.map +0 -1
  181. package/dist/services/purchases/models/create-purchase-ok-response-purchase.js +0 -69
  182. package/dist/services/purchases/models/create-purchase-ok-response-purchase.js.map +0 -1
  183. package/dist/services/purchases/models/create-purchase-ok-response.d.ts +0 -315
  184. package/dist/services/purchases/models/create-purchase-ok-response.d.ts.map +0 -1
  185. package/dist/services/purchases/models/create-purchase-ok-response.js +0 -46
  186. package/dist/services/purchases/models/create-purchase-ok-response.js.map +0 -1
  187. package/dist/services/purchases/models/create-purchase-request.d.ts +0 -160
  188. package/dist/services/purchases/models/create-purchase-request.d.ts.map +0 -1
  189. package/dist/services/purchases/models/create-purchase-request.js +0 -79
  190. package/dist/services/purchases/models/create-purchase-request.js.map +0 -1
  191. package/dist/services/purchases/models/edit-purchase-ok-response.d.ts +0 -104
  192. package/dist/services/purchases/models/edit-purchase-ok-response.d.ts.map +0 -1
  193. package/dist/services/purchases/models/edit-purchase-ok-response.js +0 -59
  194. package/dist/services/purchases/models/edit-purchase-ok-response.js.map +0 -1
  195. package/dist/services/purchases/models/edit-purchase-request.d.ts +0 -104
  196. package/dist/services/purchases/models/edit-purchase-request.d.ts.map +0 -1
  197. package/dist/services/purchases/models/edit-purchase-request.js +0 -59
  198. package/dist/services/purchases/models/edit-purchase-request.js.map +0 -1
  199. package/dist/services/purchases/models/get-purchase-consumption-ok-response.d.ts +0 -62
  200. package/dist/services/purchases/models/get-purchase-consumption-ok-response.d.ts.map +0 -1
  201. package/dist/services/purchases/models/get-purchase-consumption-ok-response.js +0 -41
  202. package/dist/services/purchases/models/get-purchase-consumption-ok-response.js.map +0 -1
  203. package/dist/services/purchases/models/index.d.ts +0 -16
  204. package/dist/services/purchases/models/index.d.ts.map +0 -1
  205. package/dist/services/purchases/models/index.js +0 -3
  206. package/dist/services/purchases/models/index.js.map +0 -1
  207. package/dist/services/purchases/models/list-purchases-ok-response.d.ts +0 -622
  208. package/dist/services/purchases/models/list-purchases-ok-response.d.ts.map +0 -1
  209. package/dist/services/purchases/models/list-purchases-ok-response.js +0 -42
  210. package/dist/services/purchases/models/list-purchases-ok-response.js.map +0 -1
  211. package/dist/services/purchases/models/package_.d.ts +0 -104
  212. package/dist/services/purchases/models/package_.d.ts.map +0 -1
  213. package/dist/services/purchases/models/package_.js +0 -59
  214. package/dist/services/purchases/models/package_.js.map +0 -1
  215. package/dist/services/purchases/models/purchases-esim.d.ts +0 -48
  216. package/dist/services/purchases/models/purchases-esim.d.ts.map +0 -1
  217. package/dist/services/purchases/models/purchases-esim.js +0 -35
  218. package/dist/services/purchases/models/purchases-esim.js.map +0 -1
  219. package/dist/services/purchases/models/purchases.d.ts +0 -372
  220. package/dist/services/purchases/models/purchases.d.ts.map +0 -1
  221. package/dist/services/purchases/models/purchases.js +0 -91
  222. package/dist/services/purchases/models/purchases.js.map +0 -1
  223. package/dist/services/purchases/models/top-up-esim-ok-response-profile.d.ts +0 -48
  224. package/dist/services/purchases/models/top-up-esim-ok-response-profile.d.ts.map +0 -1
  225. package/dist/services/purchases/models/top-up-esim-ok-response-profile.js +0 -35
  226. package/dist/services/purchases/models/top-up-esim-ok-response-profile.js.map +0 -1
  227. package/dist/services/purchases/models/top-up-esim-ok-response-purchase.d.ts +0 -132
  228. package/dist/services/purchases/models/top-up-esim-ok-response-purchase.d.ts.map +0 -1
  229. package/dist/services/purchases/models/top-up-esim-ok-response-purchase.js +0 -69
  230. package/dist/services/purchases/models/top-up-esim-ok-response-purchase.js.map +0 -1
  231. package/dist/services/purchases/models/top-up-esim-ok-response.d.ts +0 -292
  232. package/dist/services/purchases/models/top-up-esim-ok-response.d.ts.map +0 -1
  233. package/dist/services/purchases/models/top-up-esim-ok-response.js +0 -46
  234. package/dist/services/purchases/models/top-up-esim-ok-response.js.map +0 -1
  235. package/dist/services/purchases/models/top-up-esim-request.d.ts +0 -146
  236. package/dist/services/purchases/models/top-up-esim-request.d.ts.map +0 -1
  237. package/dist/services/purchases/models/top-up-esim-request.js +0 -74
  238. package/dist/services/purchases/models/top-up-esim-request.js.map +0 -1
  239. package/dist/services/purchases/purchases.d.ts +0 -48
  240. package/dist/services/purchases/purchases.d.ts.map +0 -1
  241. package/dist/services/purchases/purchases.js +0 -162
  242. package/dist/services/purchases/purchases.js.map +0 -1
  243. package/dist/services/purchases/request-params.d.ts +0 -11
  244. package/dist/services/purchases/request-params.d.ts.map +0 -1
  245. package/dist/services/purchases/request-params.js +0 -3
  246. package/dist/services/purchases/request-params.js.map +0 -1
  247. package/documentation/models/CreatePurchaseOkResponse.md +0 -31
  248. package/documentation/models/CreatePurchaseRequest.md +0 -15
  249. package/documentation/models/EditPurchaseOkResponse.md +0 -11
  250. package/documentation/models/EditPurchaseRequest.md +0 -11
  251. package/documentation/models/GetEsimDeviceOkResponse.md +0 -18
  252. package/documentation/models/GetEsimHistoryOkResponse.md +0 -26
  253. package/documentation/models/GetEsimMacOkResponse.md +0 -17
  254. package/documentation/models/GetEsimOkResponse.md +0 -18
  255. package/documentation/models/GetPurchaseConsumptionOkResponse.md +0 -8
  256. package/documentation/models/ListDestinationsOkResponse.md +0 -17
  257. package/documentation/models/ListPackagesOkResponse.md +0 -21
  258. package/documentation/models/ListPurchasesOkResponse.md +0 -46
  259. package/documentation/models/TopUpEsimOkResponse.md +0 -30
  260. package/documentation/models/TopUpEsimRequest.md +0 -14
  261. package/documentation/services/DestinationsService.md +0 -35
  262. package/documentation/services/ESimService.md +0 -148
  263. package/documentation/services/PackagesService.md +0 -48
  264. package/documentation/services/PurchasesService.md +0 -222
  265. package/documentation/snippets/destinations-get.md +0 -14
  266. package/documentation/snippets/esim-get.md +0 -16
  267. package/documentation/snippets/esim-{iccid}-device-get.md +0 -14
  268. package/documentation/snippets/esim-{iccid}-history-get.md +0 -14
  269. package/documentation/snippets/esim-{iccid}-mac-get.md +0 -14
  270. package/documentation/snippets/packages-get.md +0 -14
  271. package/documentation/snippets/purchases-edit-post.md +0 -23
  272. package/documentation/snippets/purchases-get.md +0 -14
  273. package/documentation/snippets/purchases-post.md +0 -27
  274. package/documentation/snippets/purchases-topup-post.md +0 -26
  275. package/documentation/snippets/purchases-{purchaseId}-consumption-get.md +0 -14
  276. package/examples/README.md +0 -27
  277. package/examples/package.json +0 -18
  278. package/examples/src/index.ts +0 -12
  279. package/examples/tsconfig.json +0 -22
  280. package/src/http/client.ts +0 -46
  281. package/src/http/environment.ts +0 -3
  282. package/src/http/error.ts +0 -12
  283. package/src/http/handlers/handler-chain.ts +0 -22
  284. package/src/http/handlers/hook-handler.ts +0 -47
  285. package/src/http/handlers/request-validation-handler.ts +0 -72
  286. package/src/http/handlers/response-validation-handler.ts +0 -106
  287. package/src/http/handlers/retry-handler.ts +0 -40
  288. package/src/http/handlers/terminating-handler.ts +0 -38
  289. package/src/http/hooks/custom-hook.ts +0 -32
  290. package/src/http/hooks/hook.ts +0 -40
  291. package/src/http/serializer.ts +0 -183
  292. package/src/http/transport/request-builder.ts +0 -145
  293. package/src/http/transport/request.ts +0 -178
  294. package/src/http/types.ts +0 -70
  295. package/src/index.ts +0 -73
  296. package/src/services/base-service.ts +0 -29
  297. package/src/services/destinations/destinations.ts +0 -28
  298. package/src/services/destinations/index.ts +0 -2
  299. package/src/services/destinations/models/destinations.ts +0 -57
  300. package/src/services/destinations/models/index.ts +0 -2
  301. package/src/services/destinations/models/list-destinations-ok-response.ts +0 -42
  302. package/src/services/e-sim/e-sim.ts +0 -103
  303. package/src/services/e-sim/index.ts +0 -2
  304. package/src/services/e-sim/models/device.ts +0 -63
  305. package/src/services/e-sim/models/get-esim-device-ok-response.ts +0 -42
  306. package/src/services/e-sim/models/get-esim-history-ok-response-esim.ts +0 -47
  307. package/src/services/e-sim/models/get-esim-history-ok-response.ts +0 -46
  308. package/src/services/e-sim/models/get-esim-mac-ok-response-esim.ts +0 -57
  309. package/src/services/e-sim/models/get-esim-mac-ok-response.ts +0 -46
  310. package/src/services/e-sim/models/get-esim-ok-response-esim.ts +0 -63
  311. package/src/services/e-sim/models/get-esim-ok-response.ts +0 -46
  312. package/src/services/e-sim/models/history.ts +0 -53
  313. package/src/services/e-sim/models/index.ts +0 -9
  314. package/src/services/e-sim/request-params.ts +0 -3
  315. package/src/services/packages/index.ts +0 -2
  316. package/src/services/packages/models/index.ts +0 -2
  317. package/src/services/packages/models/list-packages-ok-response.ts +0 -49
  318. package/src/services/packages/models/packages.ts +0 -75
  319. package/src/services/packages/packages.ts +0 -48
  320. package/src/services/packages/request-params.ts +0 -10
  321. package/src/services/purchases/index.ts +0 -2
  322. package/src/services/purchases/models/create-purchase-ok-response-profile.ts +0 -46
  323. package/src/services/purchases/models/create-purchase-ok-response-purchase.ts +0 -81
  324. package/src/services/purchases/models/create-purchase-ok-response.ts +0 -61
  325. package/src/services/purchases/models/create-purchase-request.ts +0 -93
  326. package/src/services/purchases/models/edit-purchase-ok-response.ts +0 -69
  327. package/src/services/purchases/models/edit-purchase-request.ts +0 -69
  328. package/src/services/purchases/models/get-purchase-consumption-ok-response.ts +0 -48
  329. package/src/services/purchases/models/index.ts +0 -15
  330. package/src/services/purchases/models/list-purchases-ok-response.ts +0 -49
  331. package/src/services/purchases/models/package_.ts +0 -69
  332. package/src/services/purchases/models/purchases-esim.ts +0 -41
  333. package/src/services/purchases/models/purchases.ts +0 -107
  334. package/src/services/purchases/models/top-up-esim-ok-response-profile.ts +0 -41
  335. package/src/services/purchases/models/top-up-esim-ok-response-purchase.ts +0 -81
  336. package/src/services/purchases/models/top-up-esim-ok-response.ts +0 -61
  337. package/src/services/purchases/models/top-up-esim-request.ts +0 -87
  338. package/src/services/purchases/purchases.ts +0 -159
  339. package/src/services/purchases/request-params.ts +0 -10
  340. package/tsconfig.json +0 -22
package/dist/index.js CHANGED
@@ -1,79 +1,2155 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ Celitech: () => Celitech,
34
+ DestinationsService: () => DestinationsService,
35
+ ESimService: () => ESimService,
36
+ PackagesService: () => PackagesService,
37
+ PurchasesService: () => PurchasesService
38
+ });
39
+ module.exports = __toCommonJS(src_exports);
40
+
41
+ // src/services/destinations/destinations.ts
42
+ var import_zod5 = require("zod");
43
+
44
+ // src/http/handlers/handler-chain.ts
45
+ var RequestHandlerChain = class {
46
+ constructor() {
47
+ this.handlers = [];
48
+ }
49
+ addHandler(handler) {
50
+ if (this.handlers.length > 0) {
51
+ const previousHandler = this.handlers[this.handlers.length - 1];
52
+ previousHandler.next = handler;
53
+ }
54
+ this.handlers.push(handler);
55
+ }
56
+ async callChain(request) {
57
+ if (!this.handlers.length) {
58
+ throw new Error("No handlers added to the chain");
59
+ }
60
+ return this.handlers[0].handle(request);
61
+ }
62
+ };
63
+
64
+ // src/http/error.ts
65
+ var HttpError = class extends Error {
66
+ constructor(metadata, error) {
67
+ super(error);
68
+ this.error = metadata.statusText;
69
+ this.metadata = metadata;
70
+ }
71
+ };
72
+
73
+ // src/http/hooks/custom-hook.ts
74
+ var CURRENT_TOKEN = "";
75
+ var CURRENT_EXPIRY = -1;
76
+ var CustomHook = class {
77
+ async getToken(clientId, clientSecret) {
78
+ const tokenUrl = "https://auth.celitech.net/oauth2/token";
79
+ const headers = {
80
+ "Content-Type": "application/x-www-form-urlencoded"
81
+ };
82
+ const body = {
83
+ client_id: clientId,
84
+ client_secret: clientSecret,
85
+ grant_type: "client_credentials"
86
+ };
87
+ const response = await fetch(tokenUrl, {
88
+ method: "POST",
89
+ headers,
90
+ body: new URLSearchParams(body)
91
+ });
92
+ return response.json();
93
+ }
94
+ async beforeRequest(request, params) {
95
+ console.log("request", request);
96
+ console.log("params", params);
97
+ const clientId = params.get("clientId") || "";
98
+ const clientSecret = params.get("clientSecret") || "";
99
+ console.log("clientId", clientId);
100
+ console.log("clientSecret", clientSecret);
101
+ if (!clientId || !clientSecret) {
102
+ throw new Error("Missing clientId and/or clientSecret constructor parameters");
103
+ }
104
+ if (!CURRENT_TOKEN || CURRENT_EXPIRY < Date.now()) {
105
+ const tokenResponse = await this.getToken(clientId, clientSecret);
106
+ console.log("tokenResponse", tokenResponse);
107
+ if (tokenResponse.error) {
108
+ throw new Error(tokenResponse.error);
109
+ }
110
+ const { expires_in, access_token } = tokenResponse;
111
+ if (!expires_in || !access_token) {
112
+ throw new Error("There is an issue with getting the oauth token");
113
+ }
114
+ CURRENT_EXPIRY = Date.now() + expires_in * 1e3;
115
+ CURRENT_TOKEN = access_token;
116
+ }
117
+ const authorization = `Bearer ${CURRENT_TOKEN}`;
118
+ console.log("authorization", authorization);
119
+ if (!request.headers) {
120
+ request.headers = /* @__PURE__ */ new Map();
121
+ }
122
+ request.headers.set("Authorization", authorization);
123
+ return request;
124
+ }
125
+ async afterResponse(request, response, params) {
126
+ return response;
127
+ }
128
+ async onError(request, response, params) {
129
+ return new CustomHttpError("a custom error message", response.metadata);
130
+ }
131
+ };
132
+ var CustomHttpError = class {
133
+ constructor(error, metadata) {
134
+ this.error = error;
135
+ this.metadata = metadata;
136
+ }
137
+ };
138
+
139
+ // src/http/serialization/base-serializer.ts
140
+ var Serializer = class {
141
+ serializeValue(param) {
142
+ if (Array.isArray(param.value)) {
143
+ return this.serializeArray(param.value, param);
144
+ }
145
+ if (this.isNonNullObject(param.value)) {
146
+ return this.serializeObject(param.value, param);
147
+ }
148
+ return this.serializePrimitive(param);
149
+ }
150
+ serializePrimitive(param) {
151
+ if (param.style === "label" /* LABEL */) {
152
+ return `.${param.value}`;
153
+ } else if (param.style === "matrix" /* MATRIX */) {
154
+ return `;${param.key}=${param.value}`;
155
+ } else if (param.style === "form" /* FORM */) {
156
+ return `${encodeURIComponent(param.key || "")}=${encodeURIComponent(`${param.value}`)}`;
157
+ }
158
+ return `${param.value}`;
159
+ }
160
+ serializeArray(value, param) {
161
+ if (param.explode) {
162
+ this.serializeArrayExploded(value, param);
163
+ return this.serializeArrayExploded(value, param);
164
+ }
165
+ if (param.style === "simple" /* SIMPLE */) {
166
+ return `${value.join(",")}`;
167
+ } else if (param.style === "label" /* LABEL */) {
168
+ return `.${value.join(",")}`;
169
+ } else if (param.style === "matrix" /* MATRIX */) {
170
+ return `;${param.key}=${value.join(",")}`;
171
+ } else if (param.style === "form" /* FORM */) {
172
+ return `${encodeURIComponent(param.key || "")}=${encodeURIComponent(value.join(","))}`;
173
+ } else if (param.style === "space_delimited" /* SPACE_DELIMITED */) {
174
+ return `${param.key}=${value.join(" ")}`;
175
+ } else if (param.style === "pipe_delimited" /* PIPE_DELIMITED */) {
176
+ return `${param.key}=${value.join("|")}`;
177
+ }
178
+ return `${value.join(",")}`;
179
+ }
180
+ serializeArrayExploded(value, param) {
181
+ if (param.style === "simple" /* SIMPLE */) {
182
+ return value.map((val) => `${val}`).join(",");
183
+ } else if (param.style === "label" /* LABEL */) {
184
+ return value.map((val) => `.${val}`).join("");
185
+ } else if (param.style === "matrix" /* MATRIX */) {
186
+ return value.map((val) => `;${param.key}=${val}`).join("");
187
+ } else if (param.style === "form" /* FORM */ || param.style === "space_delimited" /* SPACE_DELIMITED */ || param.style === "pipe_delimited" /* PIPE_DELIMITED */) {
188
+ return value.map((val) => `${encodeURIComponent(param.key || "")}=${encodeURIComponent(`${val}`)}`).join("&");
189
+ }
190
+ return `${value.join(",")}`;
191
+ }
192
+ serializeObject(obj, param) {
193
+ if (param.explode) {
194
+ if (param.style === "simple" /* SIMPLE */) {
195
+ return Object.entries(obj).map(([key, val]) => `${key}=${val}`).join(",");
196
+ } else if (param.style === "label" /* LABEL */) {
197
+ return Object.entries(obj).map(([key, val]) => `.${key}=${val}`).join("");
198
+ } else if (param.style === "matrix" /* MATRIX */) {
199
+ return Object.entries(obj).map(([key, val]) => `;${key}=${val}`).join("");
200
+ } else if (param.style === "form" /* FORM */) {
201
+ return Object.entries(obj).map(([key, val]) => `${key}=${val}`).join("&");
202
+ }
203
+ }
204
+ if (param.style === "simple" /* SIMPLE */) {
205
+ return Object.entries(obj).map(([key, val]) => `${key},${val}`).join(",");
206
+ } else if (param.style === "label" /* LABEL */) {
207
+ return `.${Object.entries(obj).map(([key, val]) => `${key},${val}`).join(",")}`;
208
+ } else if (param.style === "matrix" /* MATRIX */) {
209
+ return `;${param.key}=${Object.entries(obj).map(([key, val]) => `${key},${val}`).join(",")}`;
210
+ } else if (param.style === "form" /* FORM */) {
211
+ return Object.entries(obj).map(([key, val]) => `${key}=${val}`).join("&");
212
+ } else if (param.style === "deep_object" /* DEEP_OBJECT */) {
213
+ return Object.entries(obj).map(([key, val]) => {
214
+ return `${param.key}[${key}]=${val}`;
215
+ }).join("&");
216
+ }
217
+ return Object.entries(obj).map(([key, val]) => `${key}=${val}`).join("&");
218
+ }
219
+ isNonNullObject(value) {
220
+ return typeof value === "object" && value !== null;
221
+ }
222
+ };
223
+
224
+ // src/http/transport/transport-hook-adapter.ts
225
+ var TransportHookAdapter = class {
226
+ constructor() {
227
+ this.hook = new CustomHook();
228
+ }
229
+ async beforeRequest(request, params) {
230
+ const hookRequest = this.requestToHookRequest(request);
231
+ const newRequest = await this.hook.beforeRequest(hookRequest, params);
232
+ const newTransportRequest = request.copy({
233
+ baseUrl: newRequest.baseUrl,
234
+ method: newRequest.method,
235
+ path: newRequest.path,
236
+ body: newRequest.body,
237
+ queryParams: this.hookParamsToTransportParams(newRequest.queryParams, request.queryParams, true),
238
+ headers: this.hookParamsToTransportParams(newRequest.headers, request.headers, false)
239
+ });
240
+ return newTransportRequest;
241
+ }
242
+ async afterResponse(request, response, params) {
243
+ const hookRequest = this.requestToHookRequest(request);
244
+ return this.hook.afterResponse(hookRequest, response, params);
245
+ }
246
+ async onError(request, response, params) {
247
+ const hookRequest = this.requestToHookRequest(request);
248
+ return this.hook.onError(hookRequest, response, params);
249
+ }
250
+ requestToHookRequest(request) {
251
+ const hookHeaders = /* @__PURE__ */ new Map();
252
+ request.headers.forEach((header, key) => {
253
+ hookHeaders.set(key, header.value);
254
+ });
255
+ const hookQueryParams = /* @__PURE__ */ new Map();
256
+ request.queryParams.forEach((queryParam, key) => {
257
+ hookQueryParams.set(key, queryParam.value);
258
+ });
259
+ const hookRequest = {
260
+ baseUrl: request.baseUrl,
261
+ method: request.method,
262
+ path: request.path,
263
+ headers: hookHeaders,
264
+ body: request.body,
265
+ queryParams: hookQueryParams
266
+ };
267
+ return hookRequest;
268
+ }
269
+ hookParamsToTransportParams(hookParams, originalTransportParams, encode) {
270
+ const transportParams = /* @__PURE__ */ new Map();
271
+ hookParams.forEach((hookParamValue, hookParamKey) => {
272
+ var _a, _b;
273
+ const requestParam = originalTransportParams.get(hookParamKey);
274
+ transportParams.set(hookParamKey, {
275
+ key: hookParamKey,
276
+ value: hookParamValue,
277
+ encode: (_a = requestParam == null ? void 0 : requestParam.encode) != null ? _a : false,
278
+ style: (requestParam == null ? void 0 : requestParam.style) || "none" /* NONE */,
279
+ explode: (_b = requestParam == null ? void 0 : requestParam.explode) != null ? _b : false
280
+ });
281
+ });
282
+ return transportParams;
283
+ }
284
+ };
285
+
286
+ // src/http/handlers/hook-handler.ts
287
+ var HookHandler = class {
288
+ constructor(hook) {
289
+ this.hook = hook;
290
+ }
291
+ async handle(request) {
292
+ if (!this.next) {
293
+ throw new Error("No next handler set in hook handler.");
294
+ }
295
+ const hook = new TransportHookAdapter();
296
+ const hookParams = this.getHookParams(request);
297
+ const nextRequest = await hook.beforeRequest(request, hookParams);
298
+ const response = await this.next.handle(nextRequest);
299
+ if (response.metadata.status < 400) {
300
+ return await hook.afterResponse(nextRequest, response, hookParams);
301
+ }
302
+ const error = await hook.onError(nextRequest, response, hookParams);
303
+ throw new HttpError(error.metadata, error.error);
304
+ }
305
+ getHookParams(request) {
306
+ const hookParams = /* @__PURE__ */ new Map();
307
+ hookParams.set("clientId", request.config.clientId || "");
308
+ hookParams.set("clientSecret", request.config.clientSecret || "");
309
+ return hookParams;
310
+ }
311
+ };
312
+
313
+ // src/http/handlers/response-validation-handler.ts
314
+ var import_zod = require("zod");
315
+ var ResponseValidationHandler = class {
316
+ async handle(request) {
317
+ const response = await this.next.handle(request);
318
+ if (!this.hasContent(request, response)) {
319
+ return response;
320
+ }
321
+ if (request.responseContentType === "json" /* Json */) {
322
+ const decodedBody = new TextDecoder().decode(response.raw);
323
+ const json = JSON.parse(decodedBody);
324
+ return {
325
+ ...response,
326
+ data: this.validate(request, json)
327
+ };
328
+ } else if (request.responseContentType === "binary" /* Binary */ || request.responseContentType === "image" /* Image */) {
329
+ return {
330
+ ...response,
331
+ data: this.validate(request, response.raw)
332
+ };
333
+ } else if (request.responseContentType === "text" /* Text */ || request.responseContentType === "xml" /* Xml */) {
334
+ const text = new TextDecoder().decode(response.raw);
335
+ return {
336
+ ...response,
337
+ data: this.validate(request, text)
338
+ };
339
+ } else if (request.responseContentType === "form" /* FormUrlEncoded */) {
340
+ const urlEncoded = this.fromUrlEncoded(new TextDecoder().decode(response.raw));
341
+ return {
342
+ ...response,
343
+ data: this.validate(request, urlEncoded)
344
+ };
345
+ } else if (request.responseContentType === "multipartFormData" /* MultipartFormData */) {
346
+ const formData = this.fromFormData(response.raw);
347
+ return {
348
+ ...response,
349
+ data: this.validate(request, formData)
350
+ };
351
+ } else {
352
+ const decodedBody = new TextDecoder().decode(response.raw);
353
+ const json = JSON.parse(decodedBody);
354
+ return {
355
+ ...response,
356
+ data: this.validate(request, json)
357
+ };
358
+ }
359
+ }
360
+ validate(request, data) {
361
+ var _a;
362
+ if ((_a = request.validation) == null ? void 0 : _a.responseValidation) {
363
+ return request.responseSchema.parse(data);
364
+ }
365
+ return data;
366
+ }
367
+ hasContent(request, response) {
368
+ return !!request.responseSchema && !(request.responseSchema instanceof import_zod.ZodUndefined) && response.metadata.status !== 204;
369
+ }
370
+ fromUrlEncoded(urlEncodedData) {
371
+ const pairs = urlEncodedData.split("&");
372
+ const result = {};
373
+ pairs.forEach((pair) => {
374
+ const [key, value] = pair.split("=");
375
+ if (key && value !== void 0) {
376
+ result[decodeURIComponent(key)] = decodeURIComponent(value);
377
+ }
378
+ });
23
379
  return result;
380
+ }
381
+ fromFormData(arrayBuffer) {
382
+ const decoder = new TextDecoder();
383
+ const text = decoder.decode(arrayBuffer);
384
+ const boundary = text.split("\r\n")[0];
385
+ const parts = text.split(boundary).slice(1, -1);
386
+ const formDataObj = {};
387
+ parts.forEach((part) => {
388
+ const [header, value] = part.split("\r\n\r\n");
389
+ const nameMatch = header.match(/name="([^"]+)"/);
390
+ if (nameMatch) {
391
+ const name = nameMatch[1].trim();
392
+ formDataObj[name] = (value == null ? void 0 : value.trim()) || "";
393
+ }
394
+ });
395
+ return formDataObj;
396
+ }
397
+ };
398
+
399
+ // src/http/handlers/request-validation-handler.ts
400
+ var RequestValidationHandler = class {
401
+ async handle(request) {
402
+ var _a, _b;
403
+ if (!this.next) {
404
+ throw new Error("No next handler set in ContentTypeHandler.");
405
+ }
406
+ if (request.requestContentType === "json" /* Json */) {
407
+ request.body = JSON.stringify((_a = request.requestSchema) == null ? void 0 : _a.parse(request.body));
408
+ } else if (request.requestContentType === "xml" /* Xml */ || request.requestContentType === "binary" /* Binary */ || request.requestContentType === "text" /* Text */) {
409
+ request.body = request.body;
410
+ } else if (request.requestContentType === "form" /* FormUrlEncoded */) {
411
+ request.body = this.toFormUrlEncoded(request.body);
412
+ } else if (request.requestContentType === "multipartFormData" /* MultipartFormData */) {
413
+ request.body = this.toFormData(request.body);
414
+ } else {
415
+ request.body = JSON.stringify((_b = request.requestSchema) == null ? void 0 : _b.parse(request.body));
416
+ }
417
+ return await this.next.handle(request);
418
+ }
419
+ toFormUrlEncoded(body) {
420
+ if (body === void 0) {
421
+ return "";
422
+ }
423
+ if (typeof body === "string") {
424
+ return body;
425
+ }
426
+ if (body instanceof URLSearchParams) {
427
+ return body.toString();
428
+ }
429
+ if (body instanceof FormData) {
430
+ const params = new URLSearchParams();
431
+ body.forEach((value, key) => {
432
+ params.append(key, value.toString());
433
+ });
434
+ return params.toString();
435
+ }
436
+ return "";
437
+ }
438
+ toFormData(body) {
439
+ const formData = new FormData();
440
+ Object.keys(body).forEach((key) => {
441
+ const value = body[key];
442
+ if (Array.isArray(value)) {
443
+ value.forEach((v, i) => formData.append(`${key}[${i}]`, v));
444
+ } else if (value instanceof ArrayBuffer) {
445
+ formData.append(key, new Blob([value]));
446
+ } else {
447
+ formData.append(key, value);
448
+ }
449
+ });
450
+ return formData;
451
+ }
452
+ };
453
+
454
+ // src/http/transport/request-axios-adapter.ts
455
+ var import_axios = __toESM(require("axios"));
456
+ var RequestAxiosAdapter = class {
457
+ constructor(request) {
458
+ this.request = request;
459
+ this.config = {
460
+ responseType: "arraybuffer"
461
+ };
462
+ this.setHeaders();
463
+ this.setTimeout();
464
+ }
465
+ async send() {
466
+ const method = this.getMethod();
467
+ const { body } = this.request;
468
+ let axiosResponse;
469
+ try {
470
+ if (this.request.method === "POST" || this.request.method === "PUT" || this.request.method === "PATCH") {
471
+ axiosResponse = await method(this.request.constructFullUrl(), body, this.config);
472
+ } else {
473
+ axiosResponse = await method(this.request.constructFullUrl(), this.config);
474
+ }
475
+ } catch (err) {
476
+ if ((0, import_axios.isAxiosError)(err) && err.response) {
477
+ axiosResponse = err.response;
478
+ } else {
479
+ throw err;
480
+ }
481
+ }
482
+ const headerRecord = {};
483
+ Object.keys(axiosResponse.headers).forEach((key) => {
484
+ headerRecord[key] = axiosResponse.headers[key];
485
+ });
486
+ const metadata = {
487
+ status: axiosResponse.status,
488
+ statusText: axiosResponse.statusText || "",
489
+ headers: headerRecord
490
+ };
491
+ if (metadata.status >= 400) {
492
+ throw new HttpError(metadata);
493
+ }
494
+ return {
495
+ metadata,
496
+ raw: axiosResponse.data.buffer.slice(
497
+ axiosResponse.data.byteOffset,
498
+ axiosResponse.data.byteOffset + axiosResponse.data.byteLength
499
+ )
500
+ };
501
+ }
502
+ getMethod() {
503
+ if (this.request.method === "POST") {
504
+ return import_axios.default.post;
505
+ } else if (this.request.method === "GET") {
506
+ return import_axios.default.get;
507
+ } else if (this.request.method === "PUT") {
508
+ return import_axios.default.put;
509
+ } else if (this.request.method === "DELETE") {
510
+ return import_axios.default.delete;
511
+ } else if (this.request.method === "PATCH") {
512
+ return import_axios.default.patch;
513
+ } else if (this.request.method === "HEAD") {
514
+ return import_axios.default.head;
515
+ }
516
+ throw new Error("invalid method!!!!");
517
+ }
518
+ setHeaders() {
519
+ if (!this.request.headers) {
520
+ return;
521
+ }
522
+ const headersRecord = {};
523
+ new Headers(this.request.getHeaders()).forEach((value, key) => {
524
+ headersRecord[key] = value;
525
+ });
526
+ this.config = {
527
+ ...this.config,
528
+ headers: headersRecord
529
+ };
530
+ }
531
+ setTimeout() {
532
+ this.config = {
533
+ ...this.config,
534
+ timeout: this.request.config.timeout
535
+ };
536
+ }
537
+ };
538
+
539
+ // src/http/handlers/terminating-handler.ts
540
+ var TerminatingHandler = class {
541
+ async handle(request) {
542
+ return new RequestAxiosAdapter(request).send();
543
+ }
544
+ };
545
+
546
+ // src/http/handlers/retry-handler.ts
547
+ var RetryHandler = class {
548
+ async handle(request) {
549
+ if (!this.next) {
550
+ throw new Error("No next handler set in retry handler.");
551
+ }
552
+ for (let attempt = 1; attempt <= request.retry.attempts; attempt++) {
553
+ try {
554
+ return await this.next.handle(request);
555
+ } catch (error) {
556
+ if (!this.shouldRetry(error) || attempt === request.retry.attempts) {
557
+ throw error;
558
+ }
559
+ await this.delay(request.retry.delayMs);
560
+ }
561
+ }
562
+ throw new Error("Error retrying request.");
563
+ }
564
+ shouldRetry(error) {
565
+ return error instanceof HttpError && (error.metadata.status >= 500 || error.metadata.status === 408);
566
+ }
567
+ delay(delayMs) {
568
+ if (!delayMs) {
569
+ return Promise.resolve();
570
+ }
571
+ return new Promise((resolve, reject) => {
572
+ setTimeout(() => resolve(), delayMs);
573
+ });
574
+ }
575
+ };
576
+
577
+ // src/http/client.ts
578
+ var HttpClient = class {
579
+ constructor(config, hook = new CustomHook()) {
580
+ this.config = config;
581
+ this.requestHandlerChain = new RequestHandlerChain();
582
+ this.requestHandlerChain.addHandler(new ResponseValidationHandler());
583
+ this.requestHandlerChain.addHandler(new RequestValidationHandler());
584
+ this.requestHandlerChain.addHandler(new RetryHandler());
585
+ this.requestHandlerChain.addHandler(new HookHandler(hook));
586
+ this.requestHandlerChain.addHandler(new TerminatingHandler());
587
+ }
588
+ call(request) {
589
+ return this.requestHandlerChain.callChain(request);
590
+ }
591
+ setBaseUrl(url) {
592
+ this.config.baseUrl = url;
593
+ }
594
+ setConfig(config) {
595
+ this.config = config;
596
+ }
597
+ };
598
+
599
+ // src/services/base-service.ts
600
+ var BaseService = class {
601
+ constructor(config) {
602
+ this.config = config;
603
+ this.client = new HttpClient(this.config);
604
+ }
605
+ set baseUrl(baseUrl) {
606
+ this.config.baseUrl = baseUrl;
607
+ }
608
+ set environment(environment) {
609
+ this.config.environment = environment;
610
+ }
611
+ set timeout(timeout) {
612
+ this.config.timeout = timeout;
613
+ }
614
+ set clientId(clientId) {
615
+ this.config.clientId = clientId;
616
+ }
617
+ set clientSecret(clientSecret) {
618
+ this.config.clientSecret = clientSecret;
619
+ }
620
+ };
621
+
622
+ // src/http/transport/request-builder.ts
623
+ var import_zod2 = __toESM(require("zod"));
624
+
625
+ // src/http/serialization/path-serializer.ts
626
+ var PathSerializer = class extends Serializer {
627
+ serialize(pathPattern, pathArguments) {
628
+ let serializedPath = pathPattern;
629
+ pathArguments.forEach((param) => {
630
+ serializedPath = serializedPath.replace(`{${param.key}}`, `${this.serializeValue(param)}`);
631
+ });
632
+ return serializedPath;
633
+ }
634
+ };
635
+
636
+ // src/http/serialization/query-serializer.ts
637
+ var QuerySerializer = class extends Serializer {
638
+ serialize(queryParams) {
639
+ if (!queryParams || !queryParams.size) {
640
+ return "";
641
+ }
642
+ const query = [];
643
+ queryParams.forEach((param) => {
644
+ return query.push(`${this.serializeValue(param)}`);
645
+ });
646
+ return query.length ? `?${query.join("&")}` : "";
647
+ }
648
+ };
649
+
650
+ // src/http/serialization/header-serializer.ts
651
+ var HeaderSerializer = class extends Serializer {
652
+ serialize(headerParams) {
653
+ if (!headerParams || !headerParams.size) {
654
+ return void 0;
655
+ }
656
+ const headers = {};
657
+ headerParams.forEach((param) => {
658
+ if (!param.key) {
659
+ return;
660
+ }
661
+ headers[param.key] = this.serializeValue(param);
662
+ });
663
+ return headers;
664
+ }
665
+ };
666
+
667
+ // src/http/transport/request.ts
668
+ var Request = class {
669
+ constructor(params) {
670
+ this.baseUrl = "";
671
+ this.headers = /* @__PURE__ */ new Map();
672
+ this.queryParams = /* @__PURE__ */ new Map();
673
+ this.pathParams = /* @__PURE__ */ new Map();
674
+ this.validation = {};
675
+ this.retry = {};
676
+ this.baseUrl = params.baseUrl;
677
+ this.method = params.method;
678
+ this.pathPattern = params.path;
679
+ this.body = params.body;
680
+ this.path = this.constructPath();
681
+ this.config = params.config;
682
+ this.pathParams = params.pathParams;
683
+ this.headers = params.headers;
684
+ this.queryParams = params.queryParams;
685
+ this.responseSchema = params.responseSchema;
686
+ this.requestSchema = params.requestSchema;
687
+ this.requestContentType = params.requestContentType;
688
+ this.responseContentType = params.responseContentType;
689
+ this.retry = params.retry;
690
+ this.validation = params.validation;
691
+ }
692
+ addHeaderParam(key, param) {
693
+ if (param.value === void 0) {
694
+ return;
695
+ }
696
+ if (param.explode === void 0) {
697
+ param.explode = false;
698
+ }
699
+ if (param.style === void 0) {
700
+ param.style = "simple" /* SIMPLE */;
701
+ }
702
+ if (param.encode === void 0) {
703
+ param.encode = false;
704
+ }
705
+ this.headers.set(key, param);
706
+ }
707
+ addQueryParam(key, param) {
708
+ if (param.value === void 0) {
709
+ return;
710
+ }
711
+ if (param.explode === void 0) {
712
+ param.explode = true;
713
+ }
714
+ if (param.style === void 0) {
715
+ param.style = "form" /* FORM */;
716
+ }
717
+ if (param.encode === void 0) {
718
+ param.encode = true;
719
+ }
720
+ this.queryParams.set(key, param);
721
+ }
722
+ addPathParam(key, param) {
723
+ if (param.value === void 0) {
724
+ return;
725
+ }
726
+ if (param.explode === void 0) {
727
+ param.explode = false;
728
+ }
729
+ if (param.style === void 0) {
730
+ param.style = "simple" /* SIMPLE */;
731
+ }
732
+ if (param.encode === void 0) {
733
+ param.encode = true;
734
+ }
735
+ this.pathParams.set(key, param);
736
+ }
737
+ addBody(body) {
738
+ if (body === void 0) {
739
+ return;
740
+ }
741
+ this.body = body;
742
+ }
743
+ updateFromHookRequest(hookRequest) {
744
+ this.baseUrl = hookRequest.baseUrl;
745
+ this.method = hookRequest.method;
746
+ this.path = hookRequest.path;
747
+ this.body = hookRequest.body;
748
+ }
749
+ toHookRequest() {
750
+ return {
751
+ baseUrl: this.baseUrl,
752
+ method: this.method,
753
+ path: this.path,
754
+ headers: this.headers,
755
+ body: this.body,
756
+ queryParams: this.queryParams
757
+ };
758
+ }
759
+ constructFullUrl() {
760
+ const queryString = new QuerySerializer().serialize(this.queryParams);
761
+ const path = this.constructPath();
762
+ return `${this.baseUrl}${path}${queryString}`;
763
+ }
764
+ copy(overrides) {
765
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
766
+ const createRequestParams = {
767
+ baseUrl: (_a = overrides == null ? void 0 : overrides.baseUrl) != null ? _a : this.baseUrl,
768
+ method: (_b = overrides == null ? void 0 : overrides.method) != null ? _b : this.method,
769
+ path: (_c = overrides == null ? void 0 : overrides.path) != null ? _c : this.path,
770
+ body: (_d = overrides == null ? void 0 : overrides.body) != null ? _d : this.body,
771
+ config: (_e = overrides == null ? void 0 : overrides.config) != null ? _e : this.config,
772
+ pathParams: (_f = overrides == null ? void 0 : overrides.pathParams) != null ? _f : this.pathParams,
773
+ queryParams: (_g = overrides == null ? void 0 : overrides.queryParams) != null ? _g : this.queryParams,
774
+ headers: (_h = overrides == null ? void 0 : overrides.headers) != null ? _h : this.headers,
775
+ responseSchema: (_i = overrides == null ? void 0 : overrides.responseSchema) != null ? _i : this.responseSchema,
776
+ requestSchema: (_j = overrides == null ? void 0 : overrides.requestSchema) != null ? _j : this.requestSchema,
777
+ requestContentType: (_k = overrides == null ? void 0 : overrides.requestContentType) != null ? _k : this.requestContentType,
778
+ responseContentType: (_l = overrides == null ? void 0 : overrides.responseContentType) != null ? _l : this.responseContentType,
779
+ retry: (_m = overrides == null ? void 0 : overrides.retry) != null ? _m : this.retry,
780
+ validation: (_n = overrides == null ? void 0 : overrides.validation) != null ? _n : this.validation
781
+ };
782
+ return new Request({
783
+ ...createRequestParams,
784
+ ...overrides
785
+ });
786
+ }
787
+ getHeaders() {
788
+ if (!this.headers || !this.headers.size) {
789
+ return void 0;
790
+ }
791
+ return new HeaderSerializer().serialize(this.headers);
792
+ }
793
+ constructPath() {
794
+ return new PathSerializer().serialize(this.pathPattern, this.pathParams);
795
+ }
796
+ };
797
+
798
+ // src/http/transport/request-builder.ts
799
+ var RequestBuilder = class {
800
+ constructor() {
801
+ this.params = {
802
+ baseUrl: "https://api.celitech.net/v1" /* DEFAULT */,
803
+ method: "GET",
804
+ path: "",
805
+ config: {},
806
+ responseSchema: import_zod2.default.any(),
807
+ requestSchema: import_zod2.default.any(),
808
+ requestContentType: "json" /* Json */,
809
+ responseContentType: "json" /* Json */,
810
+ retry: {
811
+ attempts: 3,
812
+ delayMs: 150
813
+ },
814
+ validation: {
815
+ responseValidation: true
816
+ },
817
+ pathParams: /* @__PURE__ */ new Map(),
818
+ queryParams: /* @__PURE__ */ new Map(),
819
+ headers: /* @__PURE__ */ new Map()
820
+ };
821
+ }
822
+ setRetryAttempts(sdkConfig, requestConfig) {
823
+ var _a, _b;
824
+ if (((_a = requestConfig == null ? void 0 : requestConfig.retry) == null ? void 0 : _a.attempts) !== void 0) {
825
+ this.params.retry.attempts = requestConfig.retry.attempts;
826
+ } else if (((_b = sdkConfig == null ? void 0 : sdkConfig.retry) == null ? void 0 : _b.attempts) !== void 0) {
827
+ this.params.retry.attempts = sdkConfig.retry.attempts;
828
+ }
829
+ return this;
830
+ }
831
+ setRetryDelayMs(sdkConfig, requestConfig) {
832
+ var _a, _b;
833
+ if (((_a = requestConfig == null ? void 0 : requestConfig.retry) == null ? void 0 : _a.delayMs) !== void 0) {
834
+ this.params.retry.delayMs = requestConfig.retry.delayMs;
835
+ } else if (((_b = sdkConfig == null ? void 0 : sdkConfig.retry) == null ? void 0 : _b.delayMs) !== void 0) {
836
+ this.params.retry.delayMs = sdkConfig.retry.delayMs;
837
+ }
838
+ return this;
839
+ }
840
+ setResponseValidation(sdkConfig, requestConfig) {
841
+ var _a, _b;
842
+ if (((_a = requestConfig == null ? void 0 : requestConfig.validation) == null ? void 0 : _a.responseValidation) !== void 0) {
843
+ this.params.validation.responseValidation = requestConfig.validation.responseValidation;
844
+ } else if (((_b = sdkConfig == null ? void 0 : sdkConfig.validation) == null ? void 0 : _b.responseValidation) !== void 0) {
845
+ this.params.validation.responseValidation = sdkConfig.validation.responseValidation;
846
+ }
847
+ return this;
848
+ }
849
+ setBaseUrl(sdkConfig) {
850
+ if ((sdkConfig == null ? void 0 : sdkConfig.baseUrl) !== void 0) {
851
+ this.params.baseUrl = sdkConfig.baseUrl;
852
+ }
853
+ return this;
854
+ }
855
+ setMethod(method) {
856
+ this.params.method = method;
857
+ return this;
858
+ }
859
+ setPath(path) {
860
+ this.params.path = path;
861
+ return this;
862
+ }
863
+ setConfig(config) {
864
+ this.params.config = config;
865
+ return this;
866
+ }
867
+ setRequestContentType(contentType) {
868
+ this.params.requestContentType = contentType;
869
+ return this;
870
+ }
871
+ setResponseContentType(contentType) {
872
+ this.params.responseContentType = contentType;
873
+ return this;
874
+ }
875
+ setRequestSchema(requestSchema) {
876
+ this.params.requestSchema = requestSchema;
877
+ return this;
878
+ }
879
+ setResponseSchema(responseSchema) {
880
+ this.params.responseSchema = responseSchema;
881
+ return this;
882
+ }
883
+ addBody(body) {
884
+ if (body !== void 0) {
885
+ this.params.body = body;
886
+ }
887
+ return this;
888
+ }
889
+ addPathParam(param) {
890
+ var _a, _b, _c;
891
+ if (param.value === void 0 || param.key === void 0) {
892
+ return this;
893
+ }
894
+ this.params.pathParams.set(param.key, {
895
+ key: param.key,
896
+ value: param.value,
897
+ explode: (_a = param.explode) != null ? _a : true,
898
+ style: (_b = param.style) != null ? _b : "simple" /* SIMPLE */,
899
+ encode: (_c = param.encode) != null ? _c : true
900
+ });
901
+ return this;
902
+ }
903
+ addQueryParam(param) {
904
+ var _a, _b, _c;
905
+ if (param.value === void 0 || param.key === void 0) {
906
+ return this;
907
+ }
908
+ this.params.queryParams.set(param.key, {
909
+ key: param.key,
910
+ value: param.value,
911
+ explode: (_a = param.explode) != null ? _a : true,
912
+ style: (_b = param.style) != null ? _b : "form" /* FORM */,
913
+ encode: (_c = param.encode) != null ? _c : true
914
+ });
915
+ return this;
916
+ }
917
+ addHeaderParam(param) {
918
+ var _a, _b, _c;
919
+ if (param.value === void 0 || param.key === void 0) {
920
+ return this;
921
+ }
922
+ this.params.headers.set(param.key, {
923
+ key: param.key,
924
+ value: param.value,
925
+ explode: (_a = param.explode) != null ? _a : true,
926
+ style: (_b = param.style) != null ? _b : "simple" /* SIMPLE */,
927
+ encode: (_c = param.encode) != null ? _c : false
928
+ });
929
+ return this;
930
+ }
931
+ build() {
932
+ return new Request(this.params);
933
+ }
934
+ };
935
+
936
+ // src/services/destinations/models/list-destinations-ok-response.ts
937
+ var import_zod4 = require("zod");
938
+
939
+ // src/services/destinations/models/destinations.ts
940
+ var import_zod3 = require("zod");
941
+ var destinations = import_zod3.z.lazy(() => {
942
+ return import_zod3.z.object({
943
+ name: import_zod3.z.string().optional(),
944
+ destination: import_zod3.z.string().optional(),
945
+ supportedCountries: import_zod3.z.array(import_zod3.z.string()).optional()
946
+ });
947
+ });
948
+ var destinationsResponse = import_zod3.z.lazy(() => {
949
+ return import_zod3.z.object({
950
+ name: import_zod3.z.string().optional(),
951
+ destination: import_zod3.z.string().optional(),
952
+ supportedCountries: import_zod3.z.array(import_zod3.z.string()).optional()
953
+ }).transform((data) => ({
954
+ name: data["name"],
955
+ destination: data["destination"],
956
+ supportedCountries: data["supportedCountries"]
957
+ }));
958
+ });
959
+ var destinationsRequest = import_zod3.z.lazy(() => {
960
+ return import_zod3.z.object({
961
+ name: import_zod3.z.string().nullish(),
962
+ destination: import_zod3.z.string().nullish(),
963
+ supportedCountries: import_zod3.z.array(import_zod3.z.string()).nullish()
964
+ }).transform((data) => ({
965
+ name: data["name"],
966
+ destination: data["destination"],
967
+ supportedCountries: data["supportedCountries"]
968
+ }));
969
+ });
970
+
971
+ // src/services/destinations/models/list-destinations-ok-response.ts
972
+ var listDestinationsOkResponse = import_zod4.z.lazy(() => {
973
+ return import_zod4.z.object({
974
+ destinations: import_zod4.z.array(destinations).optional()
975
+ });
976
+ });
977
+ var listDestinationsOkResponseResponse = import_zod4.z.lazy(() => {
978
+ return import_zod4.z.object({
979
+ destinations: import_zod4.z.array(destinationsResponse).optional()
980
+ }).transform((data) => ({
981
+ destinations: data["destinations"]
982
+ }));
983
+ });
984
+ var listDestinationsOkResponseRequest = import_zod4.z.lazy(() => {
985
+ return import_zod4.z.object({ destinations: import_zod4.z.array(destinationsRequest).nullish() }).transform((data) => ({
986
+ destinations: data["destinations"]
987
+ }));
988
+ });
989
+
990
+ // src/services/destinations/destinations.ts
991
+ var DestinationsService = class extends BaseService {
992
+ /**
993
+ * List Destinations
994
+ * @returns {Promise<HttpResponse<ListDestinationsOkResponse>>} Successful Response
995
+ */
996
+ async listDestinations(requestConfig) {
997
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/destinations").setRequestSchema(import_zod5.z.any()).setResponseSchema(listDestinationsOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
998
+ return this.client.call(request);
999
+ }
24
1000
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Celitech = exports.ESim = exports.Purchases = exports.Packages = exports.Destinations = void 0;
27
- const environment_1 = require("./http/environment");
28
- const destinations_1 = require("./services/destinations");
29
- const packages_1 = require("./services/packages");
30
- const purchases_1 = require("./services/purchases");
31
- const e_sim_1 = require("./services/e-sim");
32
- exports.Destinations = __importStar(require("./services/destinations"));
33
- exports.Packages = __importStar(require("./services/packages"));
34
- exports.Purchases = __importStar(require("./services/purchases"));
35
- exports.ESim = __importStar(require("./services/e-sim"));
36
- class Celitech {
37
- constructor(config) {
38
- this.config = config;
39
- const baseUrl = config.environment || config.baseUrl || environment_1.Environment.DEFAULT;
40
- this.config = Object.assign(Object.assign({}, config), { baseUrl });
41
- this.destinations = new destinations_1.DestinationsService(this.config);
42
- this.packages = new packages_1.PackagesService(this.config);
43
- this.purchases = new purchases_1.PurchasesService(this.config);
44
- this.eSim = new e_sim_1.ESimService(this.config);
45
- }
46
- set baseUrl(baseUrl) {
47
- this.destinations.baseUrl = baseUrl;
48
- this.packages.baseUrl = baseUrl;
49
- this.purchases.baseUrl = baseUrl;
50
- this.eSim.baseUrl = baseUrl;
51
- }
52
- set environment(environment) {
53
- this.destinations.baseUrl = environment;
54
- this.packages.baseUrl = environment;
55
- this.purchases.baseUrl = environment;
56
- this.eSim.baseUrl = environment;
57
- }
58
- set timeout(timeout) {
59
- this.destinations.timeout = timeout;
60
- this.packages.timeout = timeout;
61
- this.purchases.timeout = timeout;
62
- this.eSim.timeout = timeout;
63
- }
64
- set clientId(clientId) {
65
- this.destinations.clientId = clientId;
66
- this.packages.clientId = clientId;
67
- this.purchases.clientId = clientId;
68
- this.eSim.clientId = clientId;
69
- }
70
- set clientSecret(clientSecret) {
71
- this.destinations.clientSecret = clientSecret;
72
- this.packages.clientSecret = clientSecret;
73
- this.purchases.clientSecret = clientSecret;
74
- this.eSim.clientSecret = clientSecret;
75
- }
76
- }
77
- exports.Celitech = Celitech;
78
- // c029837e0e474b76bc487506e8799df5e3335891efe4fb02bda7a1441840310c
79
- //# sourceMappingURL=index.js.map
1001
+
1002
+ // src/services/packages/packages.ts
1003
+ var import_zod8 = require("zod");
1004
+
1005
+ // src/services/packages/models/list-packages-ok-response.ts
1006
+ var import_zod7 = require("zod");
1007
+
1008
+ // src/services/packages/models/packages.ts
1009
+ var import_zod6 = require("zod");
1010
+ var packages = import_zod6.z.lazy(() => {
1011
+ return import_zod6.z.object({
1012
+ id: import_zod6.z.string().optional(),
1013
+ destination: import_zod6.z.string().optional(),
1014
+ dataLimitInBytes: import_zod6.z.number().optional(),
1015
+ minDays: import_zod6.z.number().optional(),
1016
+ maxDays: import_zod6.z.number().optional(),
1017
+ priceInCents: import_zod6.z.number().optional()
1018
+ });
1019
+ });
1020
+ var packagesResponse = import_zod6.z.lazy(() => {
1021
+ return import_zod6.z.object({
1022
+ id: import_zod6.z.string().optional(),
1023
+ destination: import_zod6.z.string().optional(),
1024
+ dataLimitInBytes: import_zod6.z.number().optional(),
1025
+ minDays: import_zod6.z.number().optional(),
1026
+ maxDays: import_zod6.z.number().optional(),
1027
+ priceInCents: import_zod6.z.number().optional()
1028
+ }).transform((data) => ({
1029
+ id: data["id"],
1030
+ destination: data["destination"],
1031
+ dataLimitInBytes: data["dataLimitInBytes"],
1032
+ minDays: data["minDays"],
1033
+ maxDays: data["maxDays"],
1034
+ priceInCents: data["priceInCents"]
1035
+ }));
1036
+ });
1037
+ var packagesRequest = import_zod6.z.lazy(() => {
1038
+ return import_zod6.z.object({
1039
+ id: import_zod6.z.string().nullish(),
1040
+ destination: import_zod6.z.string().nullish(),
1041
+ dataLimitInBytes: import_zod6.z.number().nullish(),
1042
+ minDays: import_zod6.z.number().nullish(),
1043
+ maxDays: import_zod6.z.number().nullish(),
1044
+ priceInCents: import_zod6.z.number().nullish()
1045
+ }).transform((data) => ({
1046
+ id: data["id"],
1047
+ destination: data["destination"],
1048
+ dataLimitInBytes: data["dataLimitInBytes"],
1049
+ minDays: data["minDays"],
1050
+ maxDays: data["maxDays"],
1051
+ priceInCents: data["priceInCents"]
1052
+ }));
1053
+ });
1054
+
1055
+ // src/services/packages/models/list-packages-ok-response.ts
1056
+ var listPackagesOkResponse = import_zod7.z.lazy(() => {
1057
+ return import_zod7.z.object({
1058
+ packages: import_zod7.z.array(packages).optional(),
1059
+ afterCursor: import_zod7.z.string().optional().nullable()
1060
+ });
1061
+ });
1062
+ var listPackagesOkResponseResponse = import_zod7.z.lazy(() => {
1063
+ return import_zod7.z.object({
1064
+ packages: import_zod7.z.array(packagesResponse).optional(),
1065
+ afterCursor: import_zod7.z.string().optional().nullable()
1066
+ }).transform((data) => ({
1067
+ packages: data["packages"],
1068
+ afterCursor: data["afterCursor"]
1069
+ }));
1070
+ });
1071
+ var listPackagesOkResponseRequest = import_zod7.z.lazy(() => {
1072
+ return import_zod7.z.object({ packages: import_zod7.z.array(packagesRequest).nullish(), afterCursor: import_zod7.z.string().nullish() }).transform((data) => ({
1073
+ packages: data["packages"],
1074
+ afterCursor: data["afterCursor"]
1075
+ }));
1076
+ });
1077
+
1078
+ // src/services/packages/packages.ts
1079
+ var PackagesService = class extends BaseService {
1080
+ /**
1081
+ * List Packages
1082
+ * @param {string} [destination] - ISO representation of the package's destination.
1083
+ * @param {string} [startDate] - 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.
1084
+ * @param {string} [endDate] - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
1085
+ * @param {string} [afterCursor] - To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
1086
+ * @param {number} [limit] - Maximum number of packages to be returned in the response. The value must be greater than 0 and less than or equal to 160. If not provided, the default value is 20
1087
+ * @param {number} [startTime] - Epoch value representing the start time of the package's validity. This timestamp can be set to the current time or any time within the next 12 months
1088
+ * @param {number} [endTime] - Epoch value representing the end time of the package's validity. End time can be maximum 90 days after Start time
1089
+ * @param {number} [duration] - Duration in seconds for the package's validity. If this parameter is present, it will override the startTime and endTime parameters. The maximum duration for a package's validity period is 90 days
1090
+ * @returns {Promise<HttpResponse<ListPackagesOkResponse>>} Successful Response
1091
+ */
1092
+ async listPackages(params, requestConfig) {
1093
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/packages").setRequestSchema(import_zod8.z.any()).setResponseSchema(listPackagesOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1094
+ key: "destination",
1095
+ value: params == null ? void 0 : params.destination
1096
+ }).addQueryParam({
1097
+ key: "startDate",
1098
+ value: params == null ? void 0 : params.startDate
1099
+ }).addQueryParam({
1100
+ key: "endDate",
1101
+ value: params == null ? void 0 : params.endDate
1102
+ }).addQueryParam({
1103
+ key: "afterCursor",
1104
+ value: params == null ? void 0 : params.afterCursor
1105
+ }).addQueryParam({
1106
+ key: "limit",
1107
+ value: params == null ? void 0 : params.limit
1108
+ }).addQueryParam({
1109
+ key: "startTime",
1110
+ value: params == null ? void 0 : params.startTime
1111
+ }).addQueryParam({
1112
+ key: "endTime",
1113
+ value: params == null ? void 0 : params.endTime
1114
+ }).addQueryParam({
1115
+ key: "duration",
1116
+ value: params == null ? void 0 : params.duration
1117
+ }).build();
1118
+ return this.client.call(request);
1119
+ }
1120
+ };
1121
+
1122
+ // src/services/purchases/purchases.ts
1123
+ var import_zod24 = require("zod");
1124
+
1125
+ // src/services/purchases/models/list-purchases-ok-response.ts
1126
+ var import_zod12 = require("zod");
1127
+
1128
+ // src/services/purchases/models/purchases.ts
1129
+ var import_zod11 = require("zod");
1130
+
1131
+ // src/services/purchases/models/package_.ts
1132
+ var import_zod9 = require("zod");
1133
+ var package_ = import_zod9.z.lazy(() => {
1134
+ return import_zod9.z.object({
1135
+ id: import_zod9.z.string().optional(),
1136
+ dataLimitInBytes: import_zod9.z.number().optional(),
1137
+ destination: import_zod9.z.string().optional(),
1138
+ destinationName: import_zod9.z.string().optional(),
1139
+ priceInCents: import_zod9.z.number().optional()
1140
+ });
1141
+ });
1142
+ var packageResponse = import_zod9.z.lazy(() => {
1143
+ return import_zod9.z.object({
1144
+ id: import_zod9.z.string().optional(),
1145
+ dataLimitInBytes: import_zod9.z.number().optional(),
1146
+ destination: import_zod9.z.string().optional(),
1147
+ destinationName: import_zod9.z.string().optional(),
1148
+ priceInCents: import_zod9.z.number().optional()
1149
+ }).transform((data) => ({
1150
+ id: data["id"],
1151
+ dataLimitInBytes: data["dataLimitInBytes"],
1152
+ destination: data["destination"],
1153
+ destinationName: data["destinationName"],
1154
+ priceInCents: data["priceInCents"]
1155
+ }));
1156
+ });
1157
+ var packageRequest = import_zod9.z.lazy(() => {
1158
+ return import_zod9.z.object({
1159
+ id: import_zod9.z.string().nullish(),
1160
+ dataLimitInBytes: import_zod9.z.number().nullish(),
1161
+ destination: import_zod9.z.string().nullish(),
1162
+ destinationName: import_zod9.z.string().nullish(),
1163
+ priceInCents: import_zod9.z.number().nullish()
1164
+ }).transform((data) => ({
1165
+ id: data["id"],
1166
+ dataLimitInBytes: data["dataLimitInBytes"],
1167
+ destination: data["destination"],
1168
+ destinationName: data["destinationName"],
1169
+ priceInCents: data["priceInCents"]
1170
+ }));
1171
+ });
1172
+
1173
+ // src/services/purchases/models/purchases-esim.ts
1174
+ var import_zod10 = require("zod");
1175
+ var purchasesEsim = import_zod10.z.lazy(() => {
1176
+ return import_zod10.z.object({
1177
+ iccid: import_zod10.z.string().min(18).max(22).optional()
1178
+ });
1179
+ });
1180
+ var purchasesEsimResponse = import_zod10.z.lazy(() => {
1181
+ return import_zod10.z.object({
1182
+ iccid: import_zod10.z.string().min(18).max(22).optional()
1183
+ }).transform((data) => ({
1184
+ iccid: data["iccid"]
1185
+ }));
1186
+ });
1187
+ var purchasesEsimRequest = import_zod10.z.lazy(() => {
1188
+ return import_zod10.z.object({ iccid: import_zod10.z.string().nullish() }).transform((data) => ({
1189
+ iccid: data["iccid"]
1190
+ }));
1191
+ });
1192
+
1193
+ // src/services/purchases/models/purchases.ts
1194
+ var purchases = import_zod11.z.lazy(() => {
1195
+ return import_zod11.z.object({
1196
+ id: import_zod11.z.string().optional(),
1197
+ startDate: import_zod11.z.string().optional(),
1198
+ endDate: import_zod11.z.string().optional(),
1199
+ createdDate: import_zod11.z.string().optional(),
1200
+ startTime: import_zod11.z.number().optional(),
1201
+ endTime: import_zod11.z.number().optional(),
1202
+ createdAt: import_zod11.z.number().optional(),
1203
+ package: package_.optional(),
1204
+ esim: purchasesEsim.optional(),
1205
+ source: import_zod11.z.string().optional(),
1206
+ referenceId: import_zod11.z.string().optional()
1207
+ });
1208
+ });
1209
+ var purchasesResponse = import_zod11.z.lazy(() => {
1210
+ return import_zod11.z.object({
1211
+ id: import_zod11.z.string().optional(),
1212
+ startDate: import_zod11.z.string().optional(),
1213
+ endDate: import_zod11.z.string().optional(),
1214
+ createdDate: import_zod11.z.string().optional(),
1215
+ startTime: import_zod11.z.number().optional(),
1216
+ endTime: import_zod11.z.number().optional(),
1217
+ createdAt: import_zod11.z.number().optional(),
1218
+ package: packageResponse.optional(),
1219
+ esim: purchasesEsimResponse.optional(),
1220
+ source: import_zod11.z.string().optional(),
1221
+ referenceId: import_zod11.z.string().optional()
1222
+ }).transform((data) => ({
1223
+ id: data["id"],
1224
+ startDate: data["startDate"],
1225
+ endDate: data["endDate"],
1226
+ createdDate: data["createdDate"],
1227
+ startTime: data["startTime"],
1228
+ endTime: data["endTime"],
1229
+ createdAt: data["createdAt"],
1230
+ package: data["package"],
1231
+ esim: data["esim"],
1232
+ source: data["source"],
1233
+ referenceId: data["referenceId"]
1234
+ }));
1235
+ });
1236
+ var purchasesRequest = import_zod11.z.lazy(() => {
1237
+ return import_zod11.z.object({
1238
+ id: import_zod11.z.string().nullish(),
1239
+ startDate: import_zod11.z.string().nullish(),
1240
+ endDate: import_zod11.z.string().nullish(),
1241
+ createdDate: import_zod11.z.string().nullish(),
1242
+ startTime: import_zod11.z.number().nullish(),
1243
+ endTime: import_zod11.z.number().nullish(),
1244
+ createdAt: import_zod11.z.number().nullish(),
1245
+ package: packageRequest.nullish(),
1246
+ esim: purchasesEsimRequest.nullish(),
1247
+ source: import_zod11.z.string().nullish(),
1248
+ referenceId: import_zod11.z.string().nullish()
1249
+ }).transform((data) => ({
1250
+ id: data["id"],
1251
+ startDate: data["startDate"],
1252
+ endDate: data["endDate"],
1253
+ createdDate: data["createdDate"],
1254
+ startTime: data["startTime"],
1255
+ endTime: data["endTime"],
1256
+ createdAt: data["createdAt"],
1257
+ package: data["package"],
1258
+ esim: data["esim"],
1259
+ source: data["source"],
1260
+ referenceId: data["referenceId"]
1261
+ }));
1262
+ });
1263
+
1264
+ // src/services/purchases/models/list-purchases-ok-response.ts
1265
+ var listPurchasesOkResponse = import_zod12.z.lazy(() => {
1266
+ return import_zod12.z.object({
1267
+ purchases: import_zod12.z.array(purchases).optional(),
1268
+ afterCursor: import_zod12.z.string().optional().nullable()
1269
+ });
1270
+ });
1271
+ var listPurchasesOkResponseResponse = import_zod12.z.lazy(() => {
1272
+ return import_zod12.z.object({
1273
+ purchases: import_zod12.z.array(purchasesResponse).optional(),
1274
+ afterCursor: import_zod12.z.string().optional().nullable()
1275
+ }).transform((data) => ({
1276
+ purchases: data["purchases"],
1277
+ afterCursor: data["afterCursor"]
1278
+ }));
1279
+ });
1280
+ var listPurchasesOkResponseRequest = import_zod12.z.lazy(() => {
1281
+ return import_zod12.z.object({ purchases: import_zod12.z.array(purchasesRequest).nullish(), afterCursor: import_zod12.z.string().nullish() }).transform((data) => ({
1282
+ purchases: data["purchases"],
1283
+ afterCursor: data["afterCursor"]
1284
+ }));
1285
+ });
1286
+
1287
+ // src/services/purchases/models/create-purchase-request.ts
1288
+ var import_zod13 = require("zod");
1289
+ var createPurchaseRequest = import_zod13.z.lazy(() => {
1290
+ return import_zod13.z.object({
1291
+ destination: import_zod13.z.string(),
1292
+ dataLimitInGb: import_zod13.z.number(),
1293
+ startDate: import_zod13.z.string(),
1294
+ endDate: import_zod13.z.string(),
1295
+ email: import_zod13.z.string().optional(),
1296
+ referenceId: import_zod13.z.string().optional(),
1297
+ networkBrand: import_zod13.z.string().optional(),
1298
+ startTime: import_zod13.z.number().optional(),
1299
+ endTime: import_zod13.z.number().optional()
1300
+ });
1301
+ });
1302
+ var createPurchaseRequestResponse = import_zod13.z.lazy(() => {
1303
+ return import_zod13.z.object({
1304
+ destination: import_zod13.z.string(),
1305
+ dataLimitInGB: import_zod13.z.number(),
1306
+ startDate: import_zod13.z.string(),
1307
+ endDate: import_zod13.z.string(),
1308
+ email: import_zod13.z.string().optional(),
1309
+ referenceId: import_zod13.z.string().optional(),
1310
+ networkBrand: import_zod13.z.string().optional(),
1311
+ startTime: import_zod13.z.number().optional(),
1312
+ endTime: import_zod13.z.number().optional()
1313
+ }).transform((data) => ({
1314
+ destination: data["destination"],
1315
+ dataLimitInGb: data["dataLimitInGB"],
1316
+ startDate: data["startDate"],
1317
+ endDate: data["endDate"],
1318
+ email: data["email"],
1319
+ referenceId: data["referenceId"],
1320
+ networkBrand: data["networkBrand"],
1321
+ startTime: data["startTime"],
1322
+ endTime: data["endTime"]
1323
+ }));
1324
+ });
1325
+ var createPurchaseRequestRequest = import_zod13.z.lazy(() => {
1326
+ return import_zod13.z.object({
1327
+ destination: import_zod13.z.string().nullish(),
1328
+ dataLimitInGb: import_zod13.z.number().nullish(),
1329
+ startDate: import_zod13.z.string().nullish(),
1330
+ endDate: import_zod13.z.string().nullish(),
1331
+ email: import_zod13.z.string().nullish(),
1332
+ referenceId: import_zod13.z.string().nullish(),
1333
+ networkBrand: import_zod13.z.string().nullish(),
1334
+ startTime: import_zod13.z.number().nullish(),
1335
+ endTime: import_zod13.z.number().nullish()
1336
+ }).transform((data) => ({
1337
+ destination: data["destination"],
1338
+ dataLimitInGB: data["dataLimitInGb"],
1339
+ startDate: data["startDate"],
1340
+ endDate: data["endDate"],
1341
+ email: data["email"],
1342
+ referenceId: data["referenceId"],
1343
+ networkBrand: data["networkBrand"],
1344
+ startTime: data["startTime"],
1345
+ endTime: data["endTime"]
1346
+ }));
1347
+ });
1348
+
1349
+ // src/services/purchases/models/create-purchase-ok-response.ts
1350
+ var import_zod16 = require("zod");
1351
+
1352
+ // src/services/purchases/models/create-purchase-ok-response-purchase.ts
1353
+ var import_zod14 = require("zod");
1354
+ var createPurchaseOkResponsePurchase = import_zod14.z.lazy(() => {
1355
+ return import_zod14.z.object({
1356
+ id: import_zod14.z.string().optional(),
1357
+ packageId: import_zod14.z.string().optional(),
1358
+ startDate: import_zod14.z.string().optional(),
1359
+ endDate: import_zod14.z.string().optional(),
1360
+ createdDate: import_zod14.z.string().optional(),
1361
+ startTime: import_zod14.z.number().optional(),
1362
+ endTime: import_zod14.z.number().optional()
1363
+ });
1364
+ });
1365
+ var createPurchaseOkResponsePurchaseResponse = import_zod14.z.lazy(() => {
1366
+ return import_zod14.z.object({
1367
+ id: import_zod14.z.string().optional(),
1368
+ packageId: import_zod14.z.string().optional(),
1369
+ startDate: import_zod14.z.string().optional(),
1370
+ endDate: import_zod14.z.string().optional(),
1371
+ createdDate: import_zod14.z.string().optional(),
1372
+ startTime: import_zod14.z.number().optional(),
1373
+ endTime: import_zod14.z.number().optional()
1374
+ }).transform((data) => ({
1375
+ id: data["id"],
1376
+ packageId: data["packageId"],
1377
+ startDate: data["startDate"],
1378
+ endDate: data["endDate"],
1379
+ createdDate: data["createdDate"],
1380
+ startTime: data["startTime"],
1381
+ endTime: data["endTime"]
1382
+ }));
1383
+ });
1384
+ var createPurchaseOkResponsePurchaseRequest = import_zod14.z.lazy(() => {
1385
+ return import_zod14.z.object({
1386
+ id: import_zod14.z.string().nullish(),
1387
+ packageId: import_zod14.z.string().nullish(),
1388
+ startDate: import_zod14.z.string().nullish(),
1389
+ endDate: import_zod14.z.string().nullish(),
1390
+ createdDate: import_zod14.z.string().nullish(),
1391
+ startTime: import_zod14.z.number().nullish(),
1392
+ endTime: import_zod14.z.number().nullish()
1393
+ }).transform((data) => ({
1394
+ id: data["id"],
1395
+ packageId: data["packageId"],
1396
+ startDate: data["startDate"],
1397
+ endDate: data["endDate"],
1398
+ createdDate: data["createdDate"],
1399
+ startTime: data["startTime"],
1400
+ endTime: data["endTime"]
1401
+ }));
1402
+ });
1403
+
1404
+ // src/services/purchases/models/create-purchase-ok-response-profile.ts
1405
+ var import_zod15 = require("zod");
1406
+ var createPurchaseOkResponseProfile = import_zod15.z.lazy(() => {
1407
+ return import_zod15.z.object({
1408
+ iccid: import_zod15.z.string().min(18).max(22).optional(),
1409
+ activationCode: import_zod15.z.string().min(1e3).max(8e3).optional()
1410
+ });
1411
+ });
1412
+ var createPurchaseOkResponseProfileResponse = import_zod15.z.lazy(() => {
1413
+ return import_zod15.z.object({
1414
+ iccid: import_zod15.z.string().min(18).max(22).optional(),
1415
+ activationCode: import_zod15.z.string().min(1e3).max(8e3).optional()
1416
+ }).transform((data) => ({
1417
+ iccid: data["iccid"],
1418
+ activationCode: data["activationCode"]
1419
+ }));
1420
+ });
1421
+ var createPurchaseOkResponseProfileRequest = import_zod15.z.lazy(() => {
1422
+ return import_zod15.z.object({ iccid: import_zod15.z.string().nullish(), activationCode: import_zod15.z.string().nullish() }).transform((data) => ({
1423
+ iccid: data["iccid"],
1424
+ activationCode: data["activationCode"]
1425
+ }));
1426
+ });
1427
+
1428
+ // src/services/purchases/models/create-purchase-ok-response.ts
1429
+ var createPurchaseOkResponse = import_zod16.z.lazy(() => {
1430
+ return import_zod16.z.object({
1431
+ purchase: createPurchaseOkResponsePurchase.optional(),
1432
+ profile: createPurchaseOkResponseProfile.optional()
1433
+ });
1434
+ });
1435
+ var createPurchaseOkResponseResponse = import_zod16.z.lazy(() => {
1436
+ return import_zod16.z.object({
1437
+ purchase: createPurchaseOkResponsePurchaseResponse.optional(),
1438
+ profile: createPurchaseOkResponseProfileResponse.optional()
1439
+ }).transform((data) => ({
1440
+ purchase: data["purchase"],
1441
+ profile: data["profile"]
1442
+ }));
1443
+ });
1444
+ var createPurchaseOkResponseRequest = import_zod16.z.lazy(() => {
1445
+ return import_zod16.z.object({
1446
+ purchase: createPurchaseOkResponsePurchaseRequest.nullish(),
1447
+ profile: createPurchaseOkResponseProfileRequest.nullish()
1448
+ }).transform((data) => ({
1449
+ purchase: data["purchase"],
1450
+ profile: data["profile"]
1451
+ }));
1452
+ });
1453
+
1454
+ // src/services/purchases/models/top-up-esim-request.ts
1455
+ var import_zod17 = require("zod");
1456
+ var topUpEsimRequest = import_zod17.z.lazy(() => {
1457
+ return import_zod17.z.object({
1458
+ iccid: import_zod17.z.string().min(18).max(22),
1459
+ dataLimitInGb: import_zod17.z.number(),
1460
+ startDate: import_zod17.z.string(),
1461
+ endDate: import_zod17.z.string(),
1462
+ email: import_zod17.z.string().optional(),
1463
+ referenceId: import_zod17.z.string().optional(),
1464
+ startTime: import_zod17.z.number().optional(),
1465
+ endTime: import_zod17.z.number().optional()
1466
+ });
1467
+ });
1468
+ var topUpEsimRequestResponse = import_zod17.z.lazy(() => {
1469
+ return import_zod17.z.object({
1470
+ iccid: import_zod17.z.string().min(18).max(22),
1471
+ dataLimitInGB: import_zod17.z.number(),
1472
+ startDate: import_zod17.z.string(),
1473
+ endDate: import_zod17.z.string(),
1474
+ email: import_zod17.z.string().optional(),
1475
+ referenceId: import_zod17.z.string().optional(),
1476
+ startTime: import_zod17.z.number().optional(),
1477
+ endTime: import_zod17.z.number().optional()
1478
+ }).transform((data) => ({
1479
+ iccid: data["iccid"],
1480
+ dataLimitInGb: data["dataLimitInGB"],
1481
+ startDate: data["startDate"],
1482
+ endDate: data["endDate"],
1483
+ email: data["email"],
1484
+ referenceId: data["referenceId"],
1485
+ startTime: data["startTime"],
1486
+ endTime: data["endTime"]
1487
+ }));
1488
+ });
1489
+ var topUpEsimRequestRequest = import_zod17.z.lazy(() => {
1490
+ return import_zod17.z.object({
1491
+ iccid: import_zod17.z.string().nullish(),
1492
+ dataLimitInGb: import_zod17.z.number().nullish(),
1493
+ startDate: import_zod17.z.string().nullish(),
1494
+ endDate: import_zod17.z.string().nullish(),
1495
+ email: import_zod17.z.string().nullish(),
1496
+ referenceId: import_zod17.z.string().nullish(),
1497
+ startTime: import_zod17.z.number().nullish(),
1498
+ endTime: import_zod17.z.number().nullish()
1499
+ }).transform((data) => ({
1500
+ iccid: data["iccid"],
1501
+ dataLimitInGB: data["dataLimitInGb"],
1502
+ startDate: data["startDate"],
1503
+ endDate: data["endDate"],
1504
+ email: data["email"],
1505
+ referenceId: data["referenceId"],
1506
+ startTime: data["startTime"],
1507
+ endTime: data["endTime"]
1508
+ }));
1509
+ });
1510
+
1511
+ // src/services/purchases/models/top-up-esim-ok-response.ts
1512
+ var import_zod20 = require("zod");
1513
+
1514
+ // src/services/purchases/models/top-up-esim-ok-response-purchase.ts
1515
+ var import_zod18 = require("zod");
1516
+ var topUpEsimOkResponsePurchase = import_zod18.z.lazy(() => {
1517
+ return import_zod18.z.object({
1518
+ id: import_zod18.z.string().optional(),
1519
+ packageId: import_zod18.z.string().optional(),
1520
+ startDate: import_zod18.z.string().optional(),
1521
+ endDate: import_zod18.z.string().optional(),
1522
+ createdDate: import_zod18.z.string().optional(),
1523
+ startTime: import_zod18.z.number().optional(),
1524
+ endTime: import_zod18.z.number().optional()
1525
+ });
1526
+ });
1527
+ var topUpEsimOkResponsePurchaseResponse = import_zod18.z.lazy(() => {
1528
+ return import_zod18.z.object({
1529
+ id: import_zod18.z.string().optional(),
1530
+ packageId: import_zod18.z.string().optional(),
1531
+ startDate: import_zod18.z.string().optional(),
1532
+ endDate: import_zod18.z.string().optional(),
1533
+ createdDate: import_zod18.z.string().optional(),
1534
+ startTime: import_zod18.z.number().optional(),
1535
+ endTime: import_zod18.z.number().optional()
1536
+ }).transform((data) => ({
1537
+ id: data["id"],
1538
+ packageId: data["packageId"],
1539
+ startDate: data["startDate"],
1540
+ endDate: data["endDate"],
1541
+ createdDate: data["createdDate"],
1542
+ startTime: data["startTime"],
1543
+ endTime: data["endTime"]
1544
+ }));
1545
+ });
1546
+ var topUpEsimOkResponsePurchaseRequest = import_zod18.z.lazy(() => {
1547
+ return import_zod18.z.object({
1548
+ id: import_zod18.z.string().nullish(),
1549
+ packageId: import_zod18.z.string().nullish(),
1550
+ startDate: import_zod18.z.string().nullish(),
1551
+ endDate: import_zod18.z.string().nullish(),
1552
+ createdDate: import_zod18.z.string().nullish(),
1553
+ startTime: import_zod18.z.number().nullish(),
1554
+ endTime: import_zod18.z.number().nullish()
1555
+ }).transform((data) => ({
1556
+ id: data["id"],
1557
+ packageId: data["packageId"],
1558
+ startDate: data["startDate"],
1559
+ endDate: data["endDate"],
1560
+ createdDate: data["createdDate"],
1561
+ startTime: data["startTime"],
1562
+ endTime: data["endTime"]
1563
+ }));
1564
+ });
1565
+
1566
+ // src/services/purchases/models/top-up-esim-ok-response-profile.ts
1567
+ var import_zod19 = require("zod");
1568
+ var topUpEsimOkResponseProfile = import_zod19.z.lazy(() => {
1569
+ return import_zod19.z.object({
1570
+ iccid: import_zod19.z.string().min(18).max(22).optional()
1571
+ });
1572
+ });
1573
+ var topUpEsimOkResponseProfileResponse = import_zod19.z.lazy(() => {
1574
+ return import_zod19.z.object({
1575
+ iccid: import_zod19.z.string().min(18).max(22).optional()
1576
+ }).transform((data) => ({
1577
+ iccid: data["iccid"]
1578
+ }));
1579
+ });
1580
+ var topUpEsimOkResponseProfileRequest = import_zod19.z.lazy(() => {
1581
+ return import_zod19.z.object({ iccid: import_zod19.z.string().nullish() }).transform((data) => ({
1582
+ iccid: data["iccid"]
1583
+ }));
1584
+ });
1585
+
1586
+ // src/services/purchases/models/top-up-esim-ok-response.ts
1587
+ var topUpEsimOkResponse = import_zod20.z.lazy(() => {
1588
+ return import_zod20.z.object({
1589
+ purchase: topUpEsimOkResponsePurchase.optional(),
1590
+ profile: topUpEsimOkResponseProfile.optional()
1591
+ });
1592
+ });
1593
+ var topUpEsimOkResponseResponse = import_zod20.z.lazy(() => {
1594
+ return import_zod20.z.object({
1595
+ purchase: topUpEsimOkResponsePurchaseResponse.optional(),
1596
+ profile: topUpEsimOkResponseProfileResponse.optional()
1597
+ }).transform((data) => ({
1598
+ purchase: data["purchase"],
1599
+ profile: data["profile"]
1600
+ }));
1601
+ });
1602
+ var topUpEsimOkResponseRequest = import_zod20.z.lazy(() => {
1603
+ return import_zod20.z.object({
1604
+ purchase: topUpEsimOkResponsePurchaseRequest.nullish(),
1605
+ profile: topUpEsimOkResponseProfileRequest.nullish()
1606
+ }).transform((data) => ({
1607
+ purchase: data["purchase"],
1608
+ profile: data["profile"]
1609
+ }));
1610
+ });
1611
+
1612
+ // src/services/purchases/models/edit-purchase-request.ts
1613
+ var import_zod21 = require("zod");
1614
+ var editPurchaseRequest = import_zod21.z.lazy(() => {
1615
+ return import_zod21.z.object({
1616
+ purchaseId: import_zod21.z.string(),
1617
+ startDate: import_zod21.z.string(),
1618
+ endDate: import_zod21.z.string(),
1619
+ startTime: import_zod21.z.number().optional(),
1620
+ endTime: import_zod21.z.number().optional()
1621
+ });
1622
+ });
1623
+ var editPurchaseRequestResponse = import_zod21.z.lazy(() => {
1624
+ return import_zod21.z.object({
1625
+ purchaseId: import_zod21.z.string(),
1626
+ startDate: import_zod21.z.string(),
1627
+ endDate: import_zod21.z.string(),
1628
+ startTime: import_zod21.z.number().optional(),
1629
+ endTime: import_zod21.z.number().optional()
1630
+ }).transform((data) => ({
1631
+ purchaseId: data["purchaseId"],
1632
+ startDate: data["startDate"],
1633
+ endDate: data["endDate"],
1634
+ startTime: data["startTime"],
1635
+ endTime: data["endTime"]
1636
+ }));
1637
+ });
1638
+ var editPurchaseRequestRequest = import_zod21.z.lazy(() => {
1639
+ return import_zod21.z.object({
1640
+ purchaseId: import_zod21.z.string().nullish(),
1641
+ startDate: import_zod21.z.string().nullish(),
1642
+ endDate: import_zod21.z.string().nullish(),
1643
+ startTime: import_zod21.z.number().nullish(),
1644
+ endTime: import_zod21.z.number().nullish()
1645
+ }).transform((data) => ({
1646
+ purchaseId: data["purchaseId"],
1647
+ startDate: data["startDate"],
1648
+ endDate: data["endDate"],
1649
+ startTime: data["startTime"],
1650
+ endTime: data["endTime"]
1651
+ }));
1652
+ });
1653
+
1654
+ // src/services/purchases/models/edit-purchase-ok-response.ts
1655
+ var import_zod22 = require("zod");
1656
+ var editPurchaseOkResponse = import_zod22.z.lazy(() => {
1657
+ return import_zod22.z.object({
1658
+ purchaseId: import_zod22.z.string().optional(),
1659
+ newStartDate: import_zod22.z.string().optional(),
1660
+ newEndDate: import_zod22.z.string().optional(),
1661
+ newStartTime: import_zod22.z.number().optional(),
1662
+ newEndTime: import_zod22.z.number().optional()
1663
+ });
1664
+ });
1665
+ var editPurchaseOkResponseResponse = import_zod22.z.lazy(() => {
1666
+ return import_zod22.z.object({
1667
+ purchaseId: import_zod22.z.string().optional(),
1668
+ newStartDate: import_zod22.z.string().optional(),
1669
+ newEndDate: import_zod22.z.string().optional(),
1670
+ newStartTime: import_zod22.z.number().optional(),
1671
+ newEndTime: import_zod22.z.number().optional()
1672
+ }).transform((data) => ({
1673
+ purchaseId: data["purchaseId"],
1674
+ newStartDate: data["newStartDate"],
1675
+ newEndDate: data["newEndDate"],
1676
+ newStartTime: data["newStartTime"],
1677
+ newEndTime: data["newEndTime"]
1678
+ }));
1679
+ });
1680
+ var editPurchaseOkResponseRequest = import_zod22.z.lazy(() => {
1681
+ return import_zod22.z.object({
1682
+ purchaseId: import_zod22.z.string().nullish(),
1683
+ newStartDate: import_zod22.z.string().nullish(),
1684
+ newEndDate: import_zod22.z.string().nullish(),
1685
+ newStartTime: import_zod22.z.number().nullish(),
1686
+ newEndTime: import_zod22.z.number().nullish()
1687
+ }).transform((data) => ({
1688
+ purchaseId: data["purchaseId"],
1689
+ newStartDate: data["newStartDate"],
1690
+ newEndDate: data["newEndDate"],
1691
+ newStartTime: data["newStartTime"],
1692
+ newEndTime: data["newEndTime"]
1693
+ }));
1694
+ });
1695
+
1696
+ // src/services/purchases/models/get-purchase-consumption-ok-response.ts
1697
+ var import_zod23 = require("zod");
1698
+ var getPurchaseConsumptionOkResponse = import_zod23.z.lazy(() => {
1699
+ return import_zod23.z.object({
1700
+ dataUsageRemainingInBytes: import_zod23.z.number().optional(),
1701
+ status: import_zod23.z.string().optional()
1702
+ });
1703
+ });
1704
+ var getPurchaseConsumptionOkResponseResponse = import_zod23.z.lazy(() => {
1705
+ return import_zod23.z.object({
1706
+ dataUsageRemainingInBytes: import_zod23.z.number().optional(),
1707
+ status: import_zod23.z.string().optional()
1708
+ }).transform((data) => ({
1709
+ dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
1710
+ status: data["status"]
1711
+ }));
1712
+ });
1713
+ var getPurchaseConsumptionOkResponseRequest = import_zod23.z.lazy(() => {
1714
+ return import_zod23.z.object({ dataUsageRemainingInBytes: import_zod23.z.number().nullish(), status: import_zod23.z.string().nullish() }).transform((data) => ({
1715
+ dataUsageRemainingInBytes: data["dataUsageRemainingInBytes"],
1716
+ status: data["status"]
1717
+ }));
1718
+ });
1719
+
1720
+ // src/services/purchases/purchases.ts
1721
+ var PurchasesService = class extends BaseService {
1722
+ /**
1723
+ * This endpoint can be used to list all the successful purchases made between a given interval.
1724
+ * @param {string} [iccid] - ID of the eSIM
1725
+ * @param {string} [afterDate] - Start date of the interval for filtering purchases in the format 'yyyy-MM-dd'
1726
+ * @param {string} [beforeDate] - End date of the interval for filtering purchases in the format 'yyyy-MM-dd'
1727
+ * @param {string} [referenceId] - The referenceId that was provided by the partner during the purchase or topup flow.
1728
+ * @param {string} [afterCursor] - To get the next batch of results, use this parameter. It tells the API where to start fetching data after the last item you received. It helps you avoid repeats and efficiently browse through large sets of data.
1729
+ * @param {number} [limit] - Maximum number of purchases to be returned in the response. The value must be greater than 0 and less than or equal to 100. If not provided, the default value is 20
1730
+ * @param {number} [after] - Epoch value representing the start of the time interval for filtering purchases
1731
+ * @param {number} [before] - Epoch value representing the end of the time interval for filtering purchases
1732
+ * @returns {Promise<HttpResponse<ListPurchasesOkResponse>>} Successful Response
1733
+ */
1734
+ async listPurchases(params, requestConfig) {
1735
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/purchases").setRequestSchema(import_zod24.z.any()).setResponseSchema(listPurchasesOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
1736
+ key: "iccid",
1737
+ value: params == null ? void 0 : params.iccid
1738
+ }).addQueryParam({
1739
+ key: "afterDate",
1740
+ value: params == null ? void 0 : params.afterDate
1741
+ }).addQueryParam({
1742
+ key: "beforeDate",
1743
+ value: params == null ? void 0 : params.beforeDate
1744
+ }).addQueryParam({
1745
+ key: "referenceId",
1746
+ value: params == null ? void 0 : params.referenceId
1747
+ }).addQueryParam({
1748
+ key: "afterCursor",
1749
+ value: params == null ? void 0 : params.afterCursor
1750
+ }).addQueryParam({
1751
+ key: "limit",
1752
+ value: params == null ? void 0 : params.limit
1753
+ }).addQueryParam({
1754
+ key: "after",
1755
+ value: params == null ? void 0 : params.after
1756
+ }).addQueryParam({
1757
+ key: "before",
1758
+ value: params == null ? void 0 : params.before
1759
+ }).build();
1760
+ return this.client.call(request);
1761
+ }
1762
+ /**
1763
+ * This endpoint is used to purchase a new eSIM by providing the package details.
1764
+ * @returns {Promise<HttpResponse<CreatePurchaseOkResponse>>} Successful Response
1765
+ */
1766
+ async createPurchase(body, requestConfig) {
1767
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("POST").setPath("/purchases").setRequestSchema(createPurchaseRequestRequest).setResponseSchema(createPurchaseOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1768
+ return this.client.call(request);
1769
+ }
1770
+ /**
1771
+ * This endpoint is used to top-up an eSIM with the previously associated destination by providing an existing ICCID and the package details. The top-up is not feasible for eSIMs in "DELETED" or "ERROR" state.
1772
+ * @returns {Promise<HttpResponse<TopUpEsimOkResponse>>} Successful Response
1773
+ */
1774
+ async topUpEsim(body, requestConfig) {
1775
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("POST").setPath("/purchases/topup").setRequestSchema(topUpEsimRequestRequest).setResponseSchema(topUpEsimOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1776
+ return this.client.call(request);
1777
+ }
1778
+ /**
1779
+ * This endpoint allows you to modify the dates of an existing package with a future activation start time. Editing can only be performed for packages that have not been activated, and it cannot change the package size. The modification must not change the package duration category to ensure pricing consistency.
1780
+ * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
1781
+ */
1782
+ async editPurchase(body, requestConfig) {
1783
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("POST").setPath("/purchases/edit").setRequestSchema(editPurchaseRequestRequest).setResponseSchema(editPurchaseOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
1784
+ return this.client.call(request);
1785
+ }
1786
+ /**
1787
+ * This endpoint can be called for consumption notifications (e.g. every 1 hour or when the user clicks a button). It returns the data balance (consumption) of purchased packages.
1788
+ * @param {string} purchaseId - ID of the purchase
1789
+ * @returns {Promise<HttpResponse<GetPurchaseConsumptionOkResponse>>} Successful Response
1790
+ */
1791
+ async getPurchaseConsumption(purchaseId, requestConfig) {
1792
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/purchases/{purchaseId}/consumption").setRequestSchema(import_zod24.z.any()).setResponseSchema(getPurchaseConsumptionOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
1793
+ key: "purchaseId",
1794
+ value: purchaseId
1795
+ }).build();
1796
+ return this.client.call(request);
1797
+ }
1798
+ };
1799
+
1800
+ // src/services/e-sim/e-sim.ts
1801
+ var import_zod34 = require("zod");
1802
+
1803
+ // src/services/e-sim/models/get-esim-ok-response.ts
1804
+ var import_zod26 = require("zod");
1805
+
1806
+ // src/services/e-sim/models/get-esim-ok-response-esim.ts
1807
+ var import_zod25 = require("zod");
1808
+ var getEsimOkResponseEsim = import_zod25.z.lazy(() => {
1809
+ return import_zod25.z.object({
1810
+ iccid: import_zod25.z.string().min(18).max(22).optional(),
1811
+ smdpAddress: import_zod25.z.string().optional(),
1812
+ manualActivationCode: import_zod25.z.string().optional(),
1813
+ status: import_zod25.z.string().optional()
1814
+ });
1815
+ });
1816
+ var getEsimOkResponseEsimResponse = import_zod25.z.lazy(() => {
1817
+ return import_zod25.z.object({
1818
+ iccid: import_zod25.z.string().min(18).max(22).optional(),
1819
+ smdpAddress: import_zod25.z.string().optional(),
1820
+ manualActivationCode: import_zod25.z.string().optional(),
1821
+ status: import_zod25.z.string().optional()
1822
+ }).transform((data) => ({
1823
+ iccid: data["iccid"],
1824
+ smdpAddress: data["smdpAddress"],
1825
+ manualActivationCode: data["manualActivationCode"],
1826
+ status: data["status"]
1827
+ }));
1828
+ });
1829
+ var getEsimOkResponseEsimRequest = import_zod25.z.lazy(() => {
1830
+ return import_zod25.z.object({
1831
+ iccid: import_zod25.z.string().nullish(),
1832
+ smdpAddress: import_zod25.z.string().nullish(),
1833
+ manualActivationCode: import_zod25.z.string().nullish(),
1834
+ status: import_zod25.z.string().nullish()
1835
+ }).transform((data) => ({
1836
+ iccid: data["iccid"],
1837
+ smdpAddress: data["smdpAddress"],
1838
+ manualActivationCode: data["manualActivationCode"],
1839
+ status: data["status"]
1840
+ }));
1841
+ });
1842
+
1843
+ // src/services/e-sim/models/get-esim-ok-response.ts
1844
+ var getEsimOkResponse = import_zod26.z.lazy(() => {
1845
+ return import_zod26.z.object({
1846
+ esim: getEsimOkResponseEsim.optional()
1847
+ });
1848
+ });
1849
+ var getEsimOkResponseResponse = import_zod26.z.lazy(() => {
1850
+ return import_zod26.z.object({
1851
+ esim: getEsimOkResponseEsimResponse.optional()
1852
+ }).transform((data) => ({
1853
+ esim: data["esim"]
1854
+ }));
1855
+ });
1856
+ var getEsimOkResponseRequest = import_zod26.z.lazy(() => {
1857
+ return import_zod26.z.object({ esim: getEsimOkResponseEsimRequest.nullish() }).transform((data) => ({
1858
+ esim: data["esim"]
1859
+ }));
1860
+ });
1861
+
1862
+ // src/services/e-sim/models/get-esim-device-ok-response.ts
1863
+ var import_zod28 = require("zod");
1864
+
1865
+ // src/services/e-sim/models/device.ts
1866
+ var import_zod27 = require("zod");
1867
+ var device = import_zod27.z.lazy(() => {
1868
+ return import_zod27.z.object({
1869
+ oem: import_zod27.z.string().optional(),
1870
+ hardwareName: import_zod27.z.string().optional(),
1871
+ hardwareModel: import_zod27.z.string().optional(),
1872
+ eid: import_zod27.z.string().optional()
1873
+ });
1874
+ });
1875
+ var deviceResponse = import_zod27.z.lazy(() => {
1876
+ return import_zod27.z.object({
1877
+ oem: import_zod27.z.string().optional(),
1878
+ hardwareName: import_zod27.z.string().optional(),
1879
+ hardwareModel: import_zod27.z.string().optional(),
1880
+ eid: import_zod27.z.string().optional()
1881
+ }).transform((data) => ({
1882
+ oem: data["oem"],
1883
+ hardwareName: data["hardwareName"],
1884
+ hardwareModel: data["hardwareModel"],
1885
+ eid: data["eid"]
1886
+ }));
1887
+ });
1888
+ var deviceRequest = import_zod27.z.lazy(() => {
1889
+ return import_zod27.z.object({
1890
+ oem: import_zod27.z.string().nullish(),
1891
+ hardwareName: import_zod27.z.string().nullish(),
1892
+ hardwareModel: import_zod27.z.string().nullish(),
1893
+ eid: import_zod27.z.string().nullish()
1894
+ }).transform((data) => ({
1895
+ oem: data["oem"],
1896
+ hardwareName: data["hardwareName"],
1897
+ hardwareModel: data["hardwareModel"],
1898
+ eid: data["eid"]
1899
+ }));
1900
+ });
1901
+
1902
+ // src/services/e-sim/models/get-esim-device-ok-response.ts
1903
+ var getEsimDeviceOkResponse = import_zod28.z.lazy(() => {
1904
+ return import_zod28.z.object({
1905
+ device: device.optional()
1906
+ });
1907
+ });
1908
+ var getEsimDeviceOkResponseResponse = import_zod28.z.lazy(() => {
1909
+ return import_zod28.z.object({
1910
+ device: deviceResponse.optional()
1911
+ }).transform((data) => ({
1912
+ device: data["device"]
1913
+ }));
1914
+ });
1915
+ var getEsimDeviceOkResponseRequest = import_zod28.z.lazy(() => {
1916
+ return import_zod28.z.object({ device: deviceRequest.nullish() }).transform((data) => ({
1917
+ device: data["device"]
1918
+ }));
1919
+ });
1920
+
1921
+ // src/services/e-sim/models/get-esim-history-ok-response.ts
1922
+ var import_zod31 = require("zod");
1923
+
1924
+ // src/services/e-sim/models/get-esim-history-ok-response-esim.ts
1925
+ var import_zod30 = require("zod");
1926
+
1927
+ // src/services/e-sim/models/history.ts
1928
+ var import_zod29 = require("zod");
1929
+ var history = import_zod29.z.lazy(() => {
1930
+ return import_zod29.z.object({
1931
+ status: import_zod29.z.string().optional(),
1932
+ statusDate: import_zod29.z.string().optional(),
1933
+ date: import_zod29.z.number().optional()
1934
+ });
1935
+ });
1936
+ var historyResponse = import_zod29.z.lazy(() => {
1937
+ return import_zod29.z.object({
1938
+ status: import_zod29.z.string().optional(),
1939
+ statusDate: import_zod29.z.string().optional(),
1940
+ date: import_zod29.z.number().optional()
1941
+ }).transform((data) => ({
1942
+ status: data["status"],
1943
+ statusDate: data["statusDate"],
1944
+ date: data["date"]
1945
+ }));
1946
+ });
1947
+ var historyRequest = import_zod29.z.lazy(() => {
1948
+ return import_zod29.z.object({ status: import_zod29.z.string().nullish(), statusDate: import_zod29.z.string().nullish(), date: import_zod29.z.number().nullish() }).transform((data) => ({
1949
+ status: data["status"],
1950
+ statusDate: data["statusDate"],
1951
+ date: data["date"]
1952
+ }));
1953
+ });
1954
+
1955
+ // src/services/e-sim/models/get-esim-history-ok-response-esim.ts
1956
+ var getEsimHistoryOkResponseEsim = import_zod30.z.lazy(() => {
1957
+ return import_zod30.z.object({
1958
+ iccid: import_zod30.z.string().min(18).max(22).optional(),
1959
+ history: import_zod30.z.array(history).optional()
1960
+ });
1961
+ });
1962
+ var getEsimHistoryOkResponseEsimResponse = import_zod30.z.lazy(() => {
1963
+ return import_zod30.z.object({
1964
+ iccid: import_zod30.z.string().min(18).max(22).optional(),
1965
+ history: import_zod30.z.array(historyResponse).optional()
1966
+ }).transform((data) => ({
1967
+ iccid: data["iccid"],
1968
+ history: data["history"]
1969
+ }));
1970
+ });
1971
+ var getEsimHistoryOkResponseEsimRequest = import_zod30.z.lazy(() => {
1972
+ return import_zod30.z.object({ iccid: import_zod30.z.string().nullish(), history: import_zod30.z.array(historyRequest).nullish() }).transform((data) => ({
1973
+ iccid: data["iccid"],
1974
+ history: data["history"]
1975
+ }));
1976
+ });
1977
+
1978
+ // src/services/e-sim/models/get-esim-history-ok-response.ts
1979
+ var getEsimHistoryOkResponse = import_zod31.z.lazy(() => {
1980
+ return import_zod31.z.object({
1981
+ esim: getEsimHistoryOkResponseEsim.optional()
1982
+ });
1983
+ });
1984
+ var getEsimHistoryOkResponseResponse = import_zod31.z.lazy(() => {
1985
+ return import_zod31.z.object({
1986
+ esim: getEsimHistoryOkResponseEsimResponse.optional()
1987
+ }).transform((data) => ({
1988
+ esim: data["esim"]
1989
+ }));
1990
+ });
1991
+ var getEsimHistoryOkResponseRequest = import_zod31.z.lazy(() => {
1992
+ return import_zod31.z.object({ esim: getEsimHistoryOkResponseEsimRequest.nullish() }).transform((data) => ({
1993
+ esim: data["esim"]
1994
+ }));
1995
+ });
1996
+
1997
+ // src/services/e-sim/models/get-esim-mac-ok-response.ts
1998
+ var import_zod33 = require("zod");
1999
+
2000
+ // src/services/e-sim/models/get-esim-mac-ok-response-esim.ts
2001
+ var import_zod32 = require("zod");
2002
+ var getEsimMacOkResponseEsim = import_zod32.z.lazy(() => {
2003
+ return import_zod32.z.object({
2004
+ iccid: import_zod32.z.string().min(18).max(22).optional(),
2005
+ smdpAddress: import_zod32.z.string().optional(),
2006
+ manualActivationCode: import_zod32.z.string().optional()
2007
+ });
2008
+ });
2009
+ var getEsimMacOkResponseEsimResponse = import_zod32.z.lazy(() => {
2010
+ return import_zod32.z.object({
2011
+ iccid: import_zod32.z.string().min(18).max(22).optional(),
2012
+ smdpAddress: import_zod32.z.string().optional(),
2013
+ manualActivationCode: import_zod32.z.string().optional()
2014
+ }).transform((data) => ({
2015
+ iccid: data["iccid"],
2016
+ smdpAddress: data["smdpAddress"],
2017
+ manualActivationCode: data["manualActivationCode"]
2018
+ }));
2019
+ });
2020
+ var getEsimMacOkResponseEsimRequest = import_zod32.z.lazy(() => {
2021
+ return import_zod32.z.object({
2022
+ iccid: import_zod32.z.string().nullish(),
2023
+ smdpAddress: import_zod32.z.string().nullish(),
2024
+ manualActivationCode: import_zod32.z.string().nullish()
2025
+ }).transform((data) => ({
2026
+ iccid: data["iccid"],
2027
+ smdpAddress: data["smdpAddress"],
2028
+ manualActivationCode: data["manualActivationCode"]
2029
+ }));
2030
+ });
2031
+
2032
+ // src/services/e-sim/models/get-esim-mac-ok-response.ts
2033
+ var getEsimMacOkResponse = import_zod33.z.lazy(() => {
2034
+ return import_zod33.z.object({
2035
+ esim: getEsimMacOkResponseEsim.optional()
2036
+ });
2037
+ });
2038
+ var getEsimMacOkResponseResponse = import_zod33.z.lazy(() => {
2039
+ return import_zod33.z.object({
2040
+ esim: getEsimMacOkResponseEsimResponse.optional()
2041
+ }).transform((data) => ({
2042
+ esim: data["esim"]
2043
+ }));
2044
+ });
2045
+ var getEsimMacOkResponseRequest = import_zod33.z.lazy(() => {
2046
+ return import_zod33.z.object({ esim: getEsimMacOkResponseEsimRequest.nullish() }).transform((data) => ({
2047
+ esim: data["esim"]
2048
+ }));
2049
+ });
2050
+
2051
+ // src/services/e-sim/e-sim.ts
2052
+ var ESimService = class extends BaseService {
2053
+ /**
2054
+ * Get eSIM Status
2055
+ * @param {string} iccid - ID of the eSIM
2056
+ * @returns {Promise<HttpResponse<GetEsimOkResponse>>} Successful Response
2057
+ */
2058
+ async getEsim(params, requestConfig) {
2059
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/esim").setRequestSchema(import_zod34.z.any()).setResponseSchema(getEsimOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addQueryParam({
2060
+ key: "iccid",
2061
+ value: params == null ? void 0 : params.iccid
2062
+ }).build();
2063
+ return this.client.call(request);
2064
+ }
2065
+ /**
2066
+ * Get eSIM Device
2067
+ * @param {string} iccid - ID of the eSIM
2068
+ * @returns {Promise<HttpResponse<GetEsimDeviceOkResponse>>} Successful Response
2069
+ */
2070
+ async getEsimDevice(iccid, requestConfig) {
2071
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/esim/{iccid}/device").setRequestSchema(import_zod34.z.any()).setResponseSchema(getEsimDeviceOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2072
+ key: "iccid",
2073
+ value: iccid
2074
+ }).build();
2075
+ return this.client.call(request);
2076
+ }
2077
+ /**
2078
+ * Get eSIM History
2079
+ * @param {string} iccid - ID of the eSIM
2080
+ * @returns {Promise<HttpResponse<GetEsimHistoryOkResponse>>} Successful Response
2081
+ */
2082
+ async getEsimHistory(iccid, requestConfig) {
2083
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/esim/{iccid}/history").setRequestSchema(import_zod34.z.any()).setResponseSchema(getEsimHistoryOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2084
+ key: "iccid",
2085
+ value: iccid
2086
+ }).build();
2087
+ return this.client.call(request);
2088
+ }
2089
+ /**
2090
+ * Get eSIM MAC
2091
+ * @param {string} iccid - ID of the eSIM
2092
+ * @returns {Promise<HttpResponse<GetEsimMacOkResponse>>} Successful Response
2093
+ */
2094
+ async getEsimMac(iccid, requestConfig) {
2095
+ const request = new RequestBuilder().setConfig(this.config).setBaseUrl(this.config).setMethod("GET").setPath("/esim/{iccid}/mac").setRequestSchema(import_zod34.z.any()).setResponseSchema(getEsimMacOkResponseResponse).setRequestContentType("json" /* Json */).setResponseContentType("json" /* Json */).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
2096
+ key: "iccid",
2097
+ value: iccid
2098
+ }).build();
2099
+ return this.client.call(request);
2100
+ }
2101
+ };
2102
+
2103
+ // src/index.ts
2104
+ var Celitech = class {
2105
+ constructor(config) {
2106
+ this.config = config;
2107
+ const baseUrl = config.environment || config.baseUrl || "https://api.celitech.net/v1" /* DEFAULT */;
2108
+ this.config = {
2109
+ ...config,
2110
+ baseUrl
2111
+ };
2112
+ this.destinations = new DestinationsService(this.config);
2113
+ this.packages = new PackagesService(this.config);
2114
+ this.purchases = new PurchasesService(this.config);
2115
+ this.eSim = new ESimService(this.config);
2116
+ }
2117
+ set baseUrl(baseUrl) {
2118
+ this.destinations.baseUrl = baseUrl;
2119
+ this.packages.baseUrl = baseUrl;
2120
+ this.purchases.baseUrl = baseUrl;
2121
+ this.eSim.baseUrl = baseUrl;
2122
+ }
2123
+ set environment(environment) {
2124
+ this.destinations.baseUrl = environment;
2125
+ this.packages.baseUrl = environment;
2126
+ this.purchases.baseUrl = environment;
2127
+ this.eSim.baseUrl = environment;
2128
+ }
2129
+ set timeout(timeout) {
2130
+ this.destinations.timeout = timeout;
2131
+ this.packages.timeout = timeout;
2132
+ this.purchases.timeout = timeout;
2133
+ this.eSim.timeout = timeout;
2134
+ }
2135
+ set clientId(clientId) {
2136
+ this.destinations.clientId = clientId;
2137
+ this.packages.clientId = clientId;
2138
+ this.purchases.clientId = clientId;
2139
+ this.eSim.clientId = clientId;
2140
+ }
2141
+ set clientSecret(clientSecret) {
2142
+ this.destinations.clientSecret = clientSecret;
2143
+ this.packages.clientSecret = clientSecret;
2144
+ this.purchases.clientSecret = clientSecret;
2145
+ this.eSim.clientSecret = clientSecret;
2146
+ }
2147
+ };
2148
+ // Annotate the CommonJS export names for ESM import in node:
2149
+ 0 && (module.exports = {
2150
+ Celitech,
2151
+ DestinationsService,
2152
+ ESimService,
2153
+ PackagesService,
2154
+ PurchasesService
2155
+ });