celitech-sdk 1.3.42 → 1.3.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -251,10 +251,10 @@ var HookHandler = class {
251
251
  const error = request.errors.find((error2) => {
252
252
  return error2.contentType === contentType && error2.status === statusCode;
253
253
  });
254
- if (error == null ? void 0 : error.error) {
254
+ if (error) {
255
255
  const decodedBody2 = new TextDecoder().decode(response.raw);
256
256
  const json = JSON.parse(decodedBody2);
257
- throw new error.error((json == null ? void 0 : json.message) || "", json);
257
+ new error.error((json == null ? void 0 : json.message) || "", json).throw();
258
258
  }
259
259
  const decodedBody = new TextDecoder().decode(response.raw);
260
260
  throw new HttpError(
@@ -765,6 +765,9 @@ var OAuthHandler = class {
765
765
  this.addAccessTokenHeader(request, request.config.accessToken);
766
766
  return this.next.handle(request);
767
767
  }
768
+ if (!request.config.clientId || !request.config.clientSecret) {
769
+ return this.next.handle(request);
770
+ }
768
771
  await this.manageToken(request);
769
772
  return this.next.handle(request);
770
773
  }
@@ -1098,8 +1101,8 @@ var RequestBuilder = class {
1098
1101
  requestSchema: z.any(),
1099
1102
  requestContentType: "json" /* Json */,
1100
1103
  retry: {
1101
- attempts: 3,
1102
- delayMs: 150
1104
+ attempts: 1,
1105
+ delayMs: 0
1103
1106
  },
1104
1107
  validation: {
1105
1108
  responseValidation: true
@@ -1403,6 +1406,9 @@ var OAuthTokenManager = class {
1403
1406
  if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
1404
1407
  return this.token;
1405
1408
  }
1409
+ if (!config.clientId || !config.clientSecret) {
1410
+ throw new Error("OAuthError: clientId and clientSecret are required for token management.");
1411
+ }
1406
1412
  const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
1407
1413
  const oAuth = new OAuthService(
1408
1414
  {
@@ -1494,6 +1500,20 @@ var listDestinationsOkResponseRequest = z5.lazy(() => {
1494
1500
 
1495
1501
  // src/services/destinations/models/__.ts
1496
1502
  import { z as z6 } from "zod";
1503
+
1504
+ // src/http/errors/throwable-error.ts
1505
+ var ThrowableError = class extends Error {
1506
+ constructor(message, response) {
1507
+ super(message);
1508
+ this.message = message;
1509
+ this.response = response;
1510
+ }
1511
+ throw() {
1512
+ throw this;
1513
+ }
1514
+ };
1515
+
1516
+ // src/services/destinations/models/__.ts
1497
1517
  var _response = z6.lazy(() => {
1498
1518
  return z6.object({
1499
1519
  message: z6.string().optional()
@@ -1501,12 +1521,17 @@ var _response = z6.lazy(() => {
1501
1521
  message: data["message"]
1502
1522
  }));
1503
1523
  });
1504
- var __ = class extends Error {
1524
+ var __ = class extends ThrowableError {
1505
1525
  constructor(message, response) {
1506
1526
  super(message);
1527
+ this.message = message;
1528
+ this.response = response;
1507
1529
  const parsedResponse = _response.parse(response);
1508
1530
  this.message = parsedResponse.message || "";
1509
1531
  }
1532
+ throw() {
1533
+ throw new __(this.message, this.response);
1534
+ }
1510
1535
  };
1511
1536
 
1512
1537
  // src/services/destinations/models/_1.ts
@@ -1518,12 +1543,17 @@ var _1Response = z7.lazy(() => {
1518
1543
  message: data["message"]
1519
1544
  }));
1520
1545
  });
1521
- var _1 = class extends Error {
1546
+ var _1 = class extends ThrowableError {
1522
1547
  constructor(message, response) {
1523
1548
  super(message);
1549
+ this.message = message;
1550
+ this.response = response;
1524
1551
  const parsedResponse = _1Response.parse(response);
1525
1552
  this.message = parsedResponse.message || "";
1526
1553
  }
1554
+ throw() {
1555
+ throw new _1(this.message, this.response);
1556
+ }
1527
1557
  };
1528
1558
 
1529
1559
  // src/services/destinations/destinations-service.ts
@@ -1639,12 +1669,17 @@ var _2Response = z11.lazy(() => {
1639
1669
  message: data["message"]
1640
1670
  }));
1641
1671
  });
1642
- var _2 = class extends Error {
1672
+ var _2 = class extends ThrowableError {
1643
1673
  constructor(message, response) {
1644
1674
  super(message);
1675
+ this.message = message;
1676
+ this.response = response;
1645
1677
  const parsedResponse = _2Response.parse(response);
1646
1678
  this.message = parsedResponse.message || "";
1647
1679
  }
1680
+ throw() {
1681
+ throw new _2(this.message, this.response);
1682
+ }
1648
1683
  };
1649
1684
 
1650
1685
  // src/services/packages/models/_3.ts
@@ -1656,12 +1691,17 @@ var _3Response = z12.lazy(() => {
1656
1691
  message: data["message"]
1657
1692
  }));
1658
1693
  });
1659
- var _3 = class extends Error {
1694
+ var _3 = class extends ThrowableError {
1660
1695
  constructor(message, response) {
1661
1696
  super(message);
1697
+ this.message = message;
1698
+ this.response = response;
1662
1699
  const parsedResponse = _3Response.parse(response);
1663
1700
  this.message = parsedResponse.message || "";
1664
1701
  }
1702
+ throw() {
1703
+ throw new _3(this.message, this.response);
1704
+ }
1665
1705
  };
1666
1706
 
1667
1707
  // src/services/packages/packages-service.ts
@@ -1671,6 +1711,13 @@ var PackagesService = class extends BaseService {
1671
1711
  * @param {string} [params.destination] - ISO representation of the package's destination.
1672
1712
  * @param {string} [params.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.
1673
1713
  * @param {string} [params.endDate] - End date of the package's validity in the format 'yyyy-MM-dd'. End date can be maximum 90 days after Start date.
1714
+ * @param {number} [params.dataLimitInGb] - Size of the package in GB.
1715
+
1716
+ For **limited packages**, the available options are: **0.5, 1, 2, 3, 5, 8, 20GB**.
1717
+
1718
+ For **unlimited packages** (available to Region-3), please use **-1** as an identifier.
1719
+
1720
+ * @param {boolean} [params.includeUnlimited] - A boolean flag to include the **unlimited packages** in the response. The flag is false by default.
1674
1721
  * @param {string} [params.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.
1675
1722
  * @param {number} [params.limit] - Maximum number of packages to be returned in the response. The value must be greater than 0 and less than or equal to 160. If not provided, the default value is 20
1676
1723
  * @param {number} [params.startTime] - Epoch value representing the start time of the package's validity. This timestamp can be set to the current time or any time within the next 12 months
@@ -1701,6 +1748,12 @@ var PackagesService = class extends BaseService {
1701
1748
  }).addQueryParam({
1702
1749
  key: "endDate",
1703
1750
  value: params == null ? void 0 : params.endDate
1751
+ }).addQueryParam({
1752
+ key: "dataLimitInGB",
1753
+ value: params == null ? void 0 : params.dataLimitInGb
1754
+ }).addQueryParam({
1755
+ key: "includeUnlimited",
1756
+ value: params == null ? void 0 : params.includeUnlimited
1704
1757
  }).addQueryParam({
1705
1758
  key: "afterCursor",
1706
1759
  value: params == null ? void 0 : params.afterCursor
@@ -1730,54 +1783,49 @@ var createPurchaseV2Request = z14.lazy(() => {
1730
1783
  return z14.object({
1731
1784
  destination: z14.string(),
1732
1785
  dataLimitInGb: z14.number(),
1733
- startDate: z14.string(),
1734
- endDate: z14.string(),
1735
1786
  quantity: z14.number().gte(1).lte(5),
1736
1787
  email: z14.string().optional(),
1737
1788
  referenceId: z14.string().optional(),
1738
- networkBrand: z14.string().optional()
1789
+ networkBrand: z14.string().optional(),
1790
+ emailBrand: z14.string().optional()
1739
1791
  });
1740
1792
  });
1741
1793
  var createPurchaseV2RequestResponse = z14.lazy(() => {
1742
1794
  return z14.object({
1743
1795
  destination: z14.string(),
1744
1796
  dataLimitInGB: z14.number(),
1745
- startDate: z14.string(),
1746
- endDate: z14.string(),
1747
1797
  quantity: z14.number().gte(1).lte(5),
1748
1798
  email: z14.string().optional(),
1749
1799
  referenceId: z14.string().optional(),
1750
- networkBrand: z14.string().optional()
1800
+ networkBrand: z14.string().optional(),
1801
+ emailBrand: z14.string().optional()
1751
1802
  }).transform((data) => ({
1752
1803
  destination: data["destination"],
1753
1804
  dataLimitInGb: data["dataLimitInGB"],
1754
- startDate: data["startDate"],
1755
- endDate: data["endDate"],
1756
1805
  quantity: data["quantity"],
1757
1806
  email: data["email"],
1758
1807
  referenceId: data["referenceId"],
1759
- networkBrand: data["networkBrand"]
1808
+ networkBrand: data["networkBrand"],
1809
+ emailBrand: data["emailBrand"]
1760
1810
  }));
1761
1811
  });
1762
1812
  var createPurchaseV2RequestRequest = z14.lazy(() => {
1763
1813
  return z14.object({
1764
1814
  destination: z14.string(),
1765
1815
  dataLimitInGb: z14.number(),
1766
- startDate: z14.string(),
1767
- endDate: z14.string(),
1768
1816
  quantity: z14.number().gte(1).lte(5),
1769
1817
  email: z14.string().optional(),
1770
1818
  referenceId: z14.string().optional(),
1771
- networkBrand: z14.string().optional()
1819
+ networkBrand: z14.string().optional(),
1820
+ emailBrand: z14.string().optional()
1772
1821
  }).transform((data) => ({
1773
1822
  destination: data["destination"],
1774
1823
  dataLimitInGB: data["dataLimitInGb"],
1775
- startDate: data["startDate"],
1776
- endDate: data["endDate"],
1777
1824
  quantity: data["quantity"],
1778
1825
  email: data["email"],
1779
1826
  referenceId: data["referenceId"],
1780
- networkBrand: data["networkBrand"]
1827
+ networkBrand: data["networkBrand"],
1828
+ emailBrand: data["emailBrand"]
1781
1829
  }));
1782
1830
  });
1783
1831
 
@@ -1883,12 +1931,17 @@ var _4Response = z18.lazy(() => {
1883
1931
  message: data["message"]
1884
1932
  }));
1885
1933
  });
1886
- var _4 = class extends Error {
1934
+ var _4 = class extends ThrowableError {
1887
1935
  constructor(message, response) {
1888
1936
  super(message);
1937
+ this.message = message;
1938
+ this.response = response;
1889
1939
  const parsedResponse = _4Response.parse(response);
1890
1940
  this.message = parsedResponse.message || "";
1891
1941
  }
1942
+ throw() {
1943
+ throw new _4(this.message, this.response);
1944
+ }
1892
1945
  };
1893
1946
 
1894
1947
  // src/services/purchases/models/_5.ts
@@ -1900,12 +1953,17 @@ var _5Response = z19.lazy(() => {
1900
1953
  message: data["message"]
1901
1954
  }));
1902
1955
  });
1903
- var _5 = class extends Error {
1956
+ var _5 = class extends ThrowableError {
1904
1957
  constructor(message, response) {
1905
1958
  super(message);
1959
+ this.message = message;
1960
+ this.response = response;
1906
1961
  const parsedResponse = _5Response.parse(response);
1907
1962
  this.message = parsedResponse.message || "";
1908
1963
  }
1964
+ throw() {
1965
+ throw new _5(this.message, this.response);
1966
+ }
1909
1967
  };
1910
1968
 
1911
1969
  // src/services/purchases/models/list-purchases-ok-response.ts
@@ -1982,35 +2040,40 @@ var purchasesEsimRequest = z21.lazy(() => {
1982
2040
  var purchases = z22.lazy(() => {
1983
2041
  return z22.object({
1984
2042
  id: z22.string().optional(),
1985
- startDate: z22.string().optional(),
1986
- endDate: z22.string().optional(),
2043
+ startDate: z22.string().optional().nullable(),
2044
+ endDate: z22.string().optional().nullable(),
2045
+ duration: z22.number().optional().nullable(),
1987
2046
  createdDate: z22.string().optional(),
1988
- startTime: z22.number().optional(),
1989
- endTime: z22.number().optional(),
2047
+ startTime: z22.number().optional().nullable(),
2048
+ endTime: z22.number().optional().nullable(),
1990
2049
  createdAt: z22.number().optional(),
1991
2050
  package: package_.optional(),
1992
2051
  esim: purchasesEsim.optional(),
1993
2052
  source: z22.string().optional(),
2053
+ purchaseType: z22.string().optional(),
1994
2054
  referenceId: z22.string().optional()
1995
2055
  });
1996
2056
  });
1997
2057
  var purchasesResponse = z22.lazy(() => {
1998
2058
  return z22.object({
1999
2059
  id: z22.string().optional(),
2000
- startDate: z22.string().optional(),
2001
- endDate: z22.string().optional(),
2060
+ startDate: z22.string().optional().nullable(),
2061
+ endDate: z22.string().optional().nullable(),
2062
+ duration: z22.number().optional().nullable(),
2002
2063
  createdDate: z22.string().optional(),
2003
- startTime: z22.number().optional(),
2004
- endTime: z22.number().optional(),
2064
+ startTime: z22.number().optional().nullable(),
2065
+ endTime: z22.number().optional().nullable(),
2005
2066
  createdAt: z22.number().optional(),
2006
2067
  package: packageResponse.optional(),
2007
2068
  esim: purchasesEsimResponse.optional(),
2008
2069
  source: z22.string().optional(),
2070
+ purchaseType: z22.string().optional(),
2009
2071
  referenceId: z22.string().optional()
2010
2072
  }).transform((data) => ({
2011
2073
  id: data["id"],
2012
2074
  startDate: data["startDate"],
2013
2075
  endDate: data["endDate"],
2076
+ duration: data["duration"],
2014
2077
  createdDate: data["createdDate"],
2015
2078
  startTime: data["startTime"],
2016
2079
  endTime: data["endTime"],
@@ -2018,26 +2081,30 @@ var purchasesResponse = z22.lazy(() => {
2018
2081
  package: data["package"],
2019
2082
  esim: data["esim"],
2020
2083
  source: data["source"],
2084
+ purchaseType: data["purchaseType"],
2021
2085
  referenceId: data["referenceId"]
2022
2086
  }));
2023
2087
  });
2024
2088
  var purchasesRequest = z22.lazy(() => {
2025
2089
  return z22.object({
2026
2090
  id: z22.string().optional(),
2027
- startDate: z22.string().optional(),
2028
- endDate: z22.string().optional(),
2091
+ startDate: z22.string().optional().nullable(),
2092
+ endDate: z22.string().optional().nullable(),
2093
+ duration: z22.number().optional().nullable(),
2029
2094
  createdDate: z22.string().optional(),
2030
- startTime: z22.number().optional(),
2031
- endTime: z22.number().optional(),
2095
+ startTime: z22.number().optional().nullable(),
2096
+ endTime: z22.number().optional().nullable(),
2032
2097
  createdAt: z22.number().optional(),
2033
2098
  package: packageRequest.optional(),
2034
2099
  esim: purchasesEsimRequest.optional(),
2035
2100
  source: z22.string().optional(),
2101
+ purchaseType: z22.string().optional(),
2036
2102
  referenceId: z22.string().optional()
2037
2103
  }).transform((data) => ({
2038
2104
  id: data["id"],
2039
2105
  startDate: data["startDate"],
2040
2106
  endDate: data["endDate"],
2107
+ duration: data["duration"],
2041
2108
  createdDate: data["createdDate"],
2042
2109
  startTime: data["startTime"],
2043
2110
  endTime: data["endTime"],
@@ -2045,6 +2112,7 @@ var purchasesRequest = z22.lazy(() => {
2045
2112
  package: data["package"],
2046
2113
  esim: data["esim"],
2047
2114
  source: data["source"],
2115
+ purchaseType: data["purchaseType"],
2048
2116
  referenceId: data["referenceId"]
2049
2117
  }));
2050
2118
  });
@@ -2084,12 +2152,17 @@ var _6Response = z24.lazy(() => {
2084
2152
  message: data["message"]
2085
2153
  }));
2086
2154
  });
2087
- var _6 = class extends Error {
2155
+ var _6 = class extends ThrowableError {
2088
2156
  constructor(message, response) {
2089
2157
  super(message);
2158
+ this.message = message;
2159
+ this.response = response;
2090
2160
  const parsedResponse = _6Response.parse(response);
2091
2161
  this.message = parsedResponse.message || "";
2092
2162
  }
2163
+ throw() {
2164
+ throw new _6(this.message, this.response);
2165
+ }
2093
2166
  };
2094
2167
 
2095
2168
  // src/services/purchases/models/_7.ts
@@ -2101,12 +2174,17 @@ var _7Response = z25.lazy(() => {
2101
2174
  message: data["message"]
2102
2175
  }));
2103
2176
  });
2104
- var _7 = class extends Error {
2177
+ var _7 = class extends ThrowableError {
2105
2178
  constructor(message, response) {
2106
2179
  super(message);
2180
+ this.message = message;
2181
+ this.response = response;
2107
2182
  const parsedResponse = _7Response.parse(response);
2108
2183
  this.message = parsedResponse.message || "";
2109
2184
  }
2185
+ throw() {
2186
+ throw new _7(this.message, this.response);
2187
+ }
2110
2188
  };
2111
2189
 
2112
2190
  // src/services/purchases/models/create-purchase-request.ts
@@ -2120,6 +2198,7 @@ var createPurchaseRequest = z26.lazy(() => {
2120
2198
  email: z26.string().optional(),
2121
2199
  referenceId: z26.string().optional(),
2122
2200
  networkBrand: z26.string().optional(),
2201
+ emailBrand: z26.string().optional(),
2123
2202
  startTime: z26.number().optional(),
2124
2203
  endTime: z26.number().optional()
2125
2204
  });
@@ -2133,6 +2212,7 @@ var createPurchaseRequestResponse = z26.lazy(() => {
2133
2212
  email: z26.string().optional(),
2134
2213
  referenceId: z26.string().optional(),
2135
2214
  networkBrand: z26.string().optional(),
2215
+ emailBrand: z26.string().optional(),
2136
2216
  startTime: z26.number().optional(),
2137
2217
  endTime: z26.number().optional()
2138
2218
  }).transform((data) => ({
@@ -2143,6 +2223,7 @@ var createPurchaseRequestResponse = z26.lazy(() => {
2143
2223
  email: data["email"],
2144
2224
  referenceId: data["referenceId"],
2145
2225
  networkBrand: data["networkBrand"],
2226
+ emailBrand: data["emailBrand"],
2146
2227
  startTime: data["startTime"],
2147
2228
  endTime: data["endTime"]
2148
2229
  }));
@@ -2156,6 +2237,7 @@ var createPurchaseRequestRequest = z26.lazy(() => {
2156
2237
  email: z26.string().optional(),
2157
2238
  referenceId: z26.string().optional(),
2158
2239
  networkBrand: z26.string().optional(),
2240
+ emailBrand: z26.string().optional(),
2159
2241
  startTime: z26.number().optional(),
2160
2242
  endTime: z26.number().optional()
2161
2243
  }).transform((data) => ({
@@ -2166,6 +2248,7 @@ var createPurchaseRequestRequest = z26.lazy(() => {
2166
2248
  email: data["email"],
2167
2249
  referenceId: data["referenceId"],
2168
2250
  networkBrand: data["networkBrand"],
2251
+ emailBrand: data["emailBrand"],
2169
2252
  startTime: data["startTime"],
2170
2253
  endTime: data["endTime"]
2171
2254
  }));
@@ -2180,22 +2263,22 @@ var createPurchaseOkResponsePurchase = z27.lazy(() => {
2180
2263
  return z27.object({
2181
2264
  id: z27.string().optional(),
2182
2265
  packageId: z27.string().optional(),
2183
- startDate: z27.string().optional(),
2184
- endDate: z27.string().optional(),
2266
+ startDate: z27.string().optional().nullable(),
2267
+ endDate: z27.string().optional().nullable(),
2185
2268
  createdDate: z27.string().optional(),
2186
- startTime: z27.number().optional(),
2187
- endTime: z27.number().optional()
2269
+ startTime: z27.number().optional().nullable(),
2270
+ endTime: z27.number().optional().nullable()
2188
2271
  });
2189
2272
  });
2190
2273
  var createPurchaseOkResponsePurchaseResponse = z27.lazy(() => {
2191
2274
  return z27.object({
2192
2275
  id: z27.string().optional(),
2193
2276
  packageId: z27.string().optional(),
2194
- startDate: z27.string().optional(),
2195
- endDate: z27.string().optional(),
2277
+ startDate: z27.string().optional().nullable(),
2278
+ endDate: z27.string().optional().nullable(),
2196
2279
  createdDate: z27.string().optional(),
2197
- startTime: z27.number().optional(),
2198
- endTime: z27.number().optional()
2280
+ startTime: z27.number().optional().nullable(),
2281
+ endTime: z27.number().optional().nullable()
2199
2282
  }).transform((data) => ({
2200
2283
  id: data["id"],
2201
2284
  packageId: data["packageId"],
@@ -2210,11 +2293,11 @@ var createPurchaseOkResponsePurchaseRequest = z27.lazy(() => {
2210
2293
  return z27.object({
2211
2294
  id: z27.string().optional(),
2212
2295
  packageId: z27.string().optional(),
2213
- startDate: z27.string().optional(),
2214
- endDate: z27.string().optional(),
2296
+ startDate: z27.string().optional().nullable(),
2297
+ endDate: z27.string().optional().nullable(),
2215
2298
  createdDate: z27.string().optional(),
2216
- startTime: z27.number().optional(),
2217
- endTime: z27.number().optional()
2299
+ startTime: z27.number().optional().nullable(),
2300
+ endTime: z27.number().optional().nullable()
2218
2301
  }).transform((data) => ({
2219
2302
  id: data["id"],
2220
2303
  packageId: data["packageId"],
@@ -2293,12 +2376,17 @@ var _8Response = z30.lazy(() => {
2293
2376
  message: data["message"]
2294
2377
  }));
2295
2378
  });
2296
- var _8 = class extends Error {
2379
+ var _8 = class extends ThrowableError {
2297
2380
  constructor(message, response) {
2298
2381
  super(message);
2382
+ this.message = message;
2383
+ this.response = response;
2299
2384
  const parsedResponse = _8Response.parse(response);
2300
2385
  this.message = parsedResponse.message || "";
2301
2386
  }
2387
+ throw() {
2388
+ throw new _8(this.message, this.response);
2389
+ }
2302
2390
  };
2303
2391
 
2304
2392
  // src/services/purchases/models/_9.ts
@@ -2310,12 +2398,17 @@ var _9Response = z31.lazy(() => {
2310
2398
  message: data["message"]
2311
2399
  }));
2312
2400
  });
2313
- var _9 = class extends Error {
2401
+ var _9 = class extends ThrowableError {
2314
2402
  constructor(message, response) {
2315
2403
  super(message);
2404
+ this.message = message;
2405
+ this.response = response;
2316
2406
  const parsedResponse = _9Response.parse(response);
2317
2407
  this.message = parsedResponse.message || "";
2318
2408
  }
2409
+ throw() {
2410
+ throw new _9(this.message, this.response);
2411
+ }
2319
2412
  };
2320
2413
 
2321
2414
  // src/services/purchases/models/top-up-esim-request.ts
@@ -2324,10 +2417,9 @@ var topUpEsimRequest = z32.lazy(() => {
2324
2417
  return z32.object({
2325
2418
  iccid: z32.string().min(18).max(22),
2326
2419
  dataLimitInGb: z32.number(),
2327
- startDate: z32.string(),
2328
- endDate: z32.string(),
2329
2420
  email: z32.string().optional(),
2330
2421
  referenceId: z32.string().optional(),
2422
+ emailBrand: z32.string().optional(),
2331
2423
  startTime: z32.number().optional(),
2332
2424
  endTime: z32.number().optional()
2333
2425
  });
@@ -2336,19 +2428,17 @@ var topUpEsimRequestResponse = z32.lazy(() => {
2336
2428
  return z32.object({
2337
2429
  iccid: z32.string().min(18).max(22),
2338
2430
  dataLimitInGB: z32.number(),
2339
- startDate: z32.string(),
2340
- endDate: z32.string(),
2341
2431
  email: z32.string().optional(),
2342
2432
  referenceId: z32.string().optional(),
2433
+ emailBrand: z32.string().optional(),
2343
2434
  startTime: z32.number().optional(),
2344
2435
  endTime: z32.number().optional()
2345
2436
  }).transform((data) => ({
2346
2437
  iccid: data["iccid"],
2347
2438
  dataLimitInGb: data["dataLimitInGB"],
2348
- startDate: data["startDate"],
2349
- endDate: data["endDate"],
2350
2439
  email: data["email"],
2351
2440
  referenceId: data["referenceId"],
2441
+ emailBrand: data["emailBrand"],
2352
2442
  startTime: data["startTime"],
2353
2443
  endTime: data["endTime"]
2354
2444
  }));
@@ -2357,19 +2447,17 @@ var topUpEsimRequestRequest = z32.lazy(() => {
2357
2447
  return z32.object({
2358
2448
  iccid: z32.string().min(18).max(22),
2359
2449
  dataLimitInGb: z32.number(),
2360
- startDate: z32.string(),
2361
- endDate: z32.string(),
2362
2450
  email: z32.string().optional(),
2363
2451
  referenceId: z32.string().optional(),
2452
+ emailBrand: z32.string().optional(),
2364
2453
  startTime: z32.number().optional(),
2365
2454
  endTime: z32.number().optional()
2366
2455
  }).transform((data) => ({
2367
2456
  iccid: data["iccid"],
2368
2457
  dataLimitInGB: data["dataLimitInGb"],
2369
- startDate: data["startDate"],
2370
- endDate: data["endDate"],
2371
2458
  email: data["email"],
2372
2459
  referenceId: data["referenceId"],
2460
+ emailBrand: data["emailBrand"],
2373
2461
  startTime: data["startTime"],
2374
2462
  endTime: data["endTime"]
2375
2463
  }));
@@ -2384,27 +2472,30 @@ var topUpEsimOkResponsePurchase = z33.lazy(() => {
2384
2472
  return z33.object({
2385
2473
  id: z33.string().optional(),
2386
2474
  packageId: z33.string().optional(),
2387
- startDate: z33.string().optional(),
2388
- endDate: z33.string().optional(),
2475
+ startDate: z33.string().optional().nullable(),
2476
+ endDate: z33.string().optional().nullable(),
2477
+ duration: z33.number().optional().nullable(),
2389
2478
  createdDate: z33.string().optional(),
2390
- startTime: z33.number().optional(),
2391
- endTime: z33.number().optional()
2479
+ startTime: z33.number().optional().nullable(),
2480
+ endTime: z33.number().optional().nullable()
2392
2481
  });
2393
2482
  });
2394
2483
  var topUpEsimOkResponsePurchaseResponse = z33.lazy(() => {
2395
2484
  return z33.object({
2396
2485
  id: z33.string().optional(),
2397
2486
  packageId: z33.string().optional(),
2398
- startDate: z33.string().optional(),
2399
- endDate: z33.string().optional(),
2487
+ startDate: z33.string().optional().nullable(),
2488
+ endDate: z33.string().optional().nullable(),
2489
+ duration: z33.number().optional().nullable(),
2400
2490
  createdDate: z33.string().optional(),
2401
- startTime: z33.number().optional(),
2402
- endTime: z33.number().optional()
2491
+ startTime: z33.number().optional().nullable(),
2492
+ endTime: z33.number().optional().nullable()
2403
2493
  }).transform((data) => ({
2404
2494
  id: data["id"],
2405
2495
  packageId: data["packageId"],
2406
2496
  startDate: data["startDate"],
2407
2497
  endDate: data["endDate"],
2498
+ duration: data["duration"],
2408
2499
  createdDate: data["createdDate"],
2409
2500
  startTime: data["startTime"],
2410
2501
  endTime: data["endTime"]
@@ -2414,16 +2505,18 @@ var topUpEsimOkResponsePurchaseRequest = z33.lazy(() => {
2414
2505
  return z33.object({
2415
2506
  id: z33.string().optional(),
2416
2507
  packageId: z33.string().optional(),
2417
- startDate: z33.string().optional(),
2418
- endDate: z33.string().optional(),
2508
+ startDate: z33.string().optional().nullable(),
2509
+ endDate: z33.string().optional().nullable(),
2510
+ duration: z33.number().optional().nullable(),
2419
2511
  createdDate: z33.string().optional(),
2420
- startTime: z33.number().optional(),
2421
- endTime: z33.number().optional()
2512
+ startTime: z33.number().optional().nullable(),
2513
+ endTime: z33.number().optional().nullable()
2422
2514
  }).transform((data) => ({
2423
2515
  id: data["id"],
2424
2516
  packageId: data["packageId"],
2425
2517
  startDate: data["startDate"],
2426
2518
  endDate: data["endDate"],
2519
+ duration: data["duration"],
2427
2520
  createdDate: data["createdDate"],
2428
2521
  startTime: data["startTime"],
2429
2522
  endTime: data["endTime"]
@@ -2487,12 +2580,17 @@ var _10Response = z36.lazy(() => {
2487
2580
  message: data["message"]
2488
2581
  }));
2489
2582
  });
2490
- var _10 = class extends Error {
2583
+ var _10 = class extends ThrowableError {
2491
2584
  constructor(message, response) {
2492
2585
  super(message);
2586
+ this.message = message;
2587
+ this.response = response;
2493
2588
  const parsedResponse = _10Response.parse(response);
2494
2589
  this.message = parsedResponse.message || "";
2495
2590
  }
2591
+ throw() {
2592
+ throw new _10(this.message, this.response);
2593
+ }
2496
2594
  };
2497
2595
 
2498
2596
  // src/services/purchases/models/_11.ts
@@ -2504,12 +2602,17 @@ var _11Response = z37.lazy(() => {
2504
2602
  message: data["message"]
2505
2603
  }));
2506
2604
  });
2507
- var _11 = class extends Error {
2605
+ var _11 = class extends ThrowableError {
2508
2606
  constructor(message, response) {
2509
2607
  super(message);
2608
+ this.message = message;
2609
+ this.response = response;
2510
2610
  const parsedResponse = _11Response.parse(response);
2511
2611
  this.message = parsedResponse.message || "";
2512
2612
  }
2613
+ throw() {
2614
+ throw new _11(this.message, this.response);
2615
+ }
2513
2616
  };
2514
2617
 
2515
2618
  // src/services/purchases/models/edit-purchase-request.ts
@@ -2559,19 +2662,19 @@ import { z as z39 } from "zod";
2559
2662
  var editPurchaseOkResponse = z39.lazy(() => {
2560
2663
  return z39.object({
2561
2664
  purchaseId: z39.string().optional(),
2562
- newStartDate: z39.string().optional(),
2563
- newEndDate: z39.string().optional(),
2564
- newStartTime: z39.number().optional(),
2565
- newEndTime: z39.number().optional()
2665
+ newStartDate: z39.string().optional().nullable(),
2666
+ newEndDate: z39.string().optional().nullable(),
2667
+ newStartTime: z39.number().optional().nullable(),
2668
+ newEndTime: z39.number().optional().nullable()
2566
2669
  });
2567
2670
  });
2568
2671
  var editPurchaseOkResponseResponse = z39.lazy(() => {
2569
2672
  return z39.object({
2570
2673
  purchaseId: z39.string().optional(),
2571
- newStartDate: z39.string().optional(),
2572
- newEndDate: z39.string().optional(),
2573
- newStartTime: z39.number().optional(),
2574
- newEndTime: z39.number().optional()
2674
+ newStartDate: z39.string().optional().nullable(),
2675
+ newEndDate: z39.string().optional().nullable(),
2676
+ newStartTime: z39.number().optional().nullable(),
2677
+ newEndTime: z39.number().optional().nullable()
2575
2678
  }).transform((data) => ({
2576
2679
  purchaseId: data["purchaseId"],
2577
2680
  newStartDate: data["newStartDate"],
@@ -2583,10 +2686,10 @@ var editPurchaseOkResponseResponse = z39.lazy(() => {
2583
2686
  var editPurchaseOkResponseRequest = z39.lazy(() => {
2584
2687
  return z39.object({
2585
2688
  purchaseId: z39.string().optional(),
2586
- newStartDate: z39.string().optional(),
2587
- newEndDate: z39.string().optional(),
2588
- newStartTime: z39.number().optional(),
2589
- newEndTime: z39.number().optional()
2689
+ newStartDate: z39.string().optional().nullable(),
2690
+ newEndDate: z39.string().optional().nullable(),
2691
+ newStartTime: z39.number().optional().nullable(),
2692
+ newEndTime: z39.number().optional().nullable()
2590
2693
  }).transform((data) => ({
2591
2694
  purchaseId: data["purchaseId"],
2592
2695
  newStartDate: data["newStartDate"],
@@ -2605,12 +2708,17 @@ var _12Response = z40.lazy(() => {
2605
2708
  message: data["message"]
2606
2709
  }));
2607
2710
  });
2608
- var _12 = class extends Error {
2711
+ var _12 = class extends ThrowableError {
2609
2712
  constructor(message, response) {
2610
2713
  super(message);
2714
+ this.message = message;
2715
+ this.response = response;
2611
2716
  const parsedResponse = _12Response.parse(response);
2612
2717
  this.message = parsedResponse.message || "";
2613
2718
  }
2719
+ throw() {
2720
+ throw new _12(this.message, this.response);
2721
+ }
2614
2722
  };
2615
2723
 
2616
2724
  // src/services/purchases/models/_13.ts
@@ -2622,12 +2730,17 @@ var _13Response = z41.lazy(() => {
2622
2730
  message: data["message"]
2623
2731
  }));
2624
2732
  });
2625
- var _13 = class extends Error {
2733
+ var _13 = class extends ThrowableError {
2626
2734
  constructor(message, response) {
2627
2735
  super(message);
2736
+ this.message = message;
2737
+ this.response = response;
2628
2738
  const parsedResponse = _13Response.parse(response);
2629
2739
  this.message = parsedResponse.message || "";
2630
2740
  }
2741
+ throw() {
2742
+ throw new _13(this.message, this.response);
2743
+ }
2631
2744
  };
2632
2745
 
2633
2746
  // src/services/purchases/models/get-purchase-consumption-ok-response.ts
@@ -2666,12 +2779,17 @@ var _14Response = z43.lazy(() => {
2666
2779
  message: data["message"]
2667
2780
  }));
2668
2781
  });
2669
- var _14 = class extends Error {
2782
+ var _14 = class extends ThrowableError {
2670
2783
  constructor(message, response) {
2671
2784
  super(message);
2785
+ this.message = message;
2786
+ this.response = response;
2672
2787
  const parsedResponse = _14Response.parse(response);
2673
2788
  this.message = parsedResponse.message || "";
2674
2789
  }
2790
+ throw() {
2791
+ throw new _14(this.message, this.response);
2792
+ }
2675
2793
  };
2676
2794
 
2677
2795
  // src/services/purchases/models/_15.ts
@@ -2683,12 +2801,17 @@ var _15Response = z44.lazy(() => {
2683
2801
  message: data["message"]
2684
2802
  }));
2685
2803
  });
2686
- var _15 = class extends Error {
2804
+ var _15 = class extends ThrowableError {
2687
2805
  constructor(message, response) {
2688
2806
  super(message);
2807
+ this.message = message;
2808
+ this.response = response;
2689
2809
  const parsedResponse = _15Response.parse(response);
2690
2810
  this.message = parsedResponse.message || "";
2691
2811
  }
2812
+ throw() {
2813
+ throw new _15(this.message, this.response);
2814
+ }
2692
2815
  };
2693
2816
 
2694
2817
  // src/services/purchases/purchases-service.ts
@@ -2810,7 +2933,7 @@ var PurchasesService = class extends BaseService {
2810
2933
  return this.client.call(request);
2811
2934
  }
2812
2935
  /**
2813
- * 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.
2936
+ * 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. Duration based packages cannot be edited.
2814
2937
  * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
2815
2938
  * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
2816
2939
  */
@@ -2930,12 +3053,17 @@ var _16Response = z48.lazy(() => {
2930
3053
  message: data["message"]
2931
3054
  }));
2932
3055
  });
2933
- var _16 = class extends Error {
3056
+ var _16 = class extends ThrowableError {
2934
3057
  constructor(message, response) {
2935
3058
  super(message);
3059
+ this.message = message;
3060
+ this.response = response;
2936
3061
  const parsedResponse = _16Response.parse(response);
2937
3062
  this.message = parsedResponse.message || "";
2938
3063
  }
3064
+ throw() {
3065
+ throw new _16(this.message, this.response);
3066
+ }
2939
3067
  };
2940
3068
 
2941
3069
  // src/services/e-sim/models/_17.ts
@@ -2947,12 +3075,17 @@ var _17Response = z49.lazy(() => {
2947
3075
  message: data["message"]
2948
3076
  }));
2949
3077
  });
2950
- var _17 = class extends Error {
3078
+ var _17 = class extends ThrowableError {
2951
3079
  constructor(message, response) {
2952
3080
  super(message);
3081
+ this.message = message;
3082
+ this.response = response;
2953
3083
  const parsedResponse = _17Response.parse(response);
2954
3084
  this.message = parsedResponse.message || "";
2955
3085
  }
3086
+ throw() {
3087
+ throw new _17(this.message, this.response);
3088
+ }
2956
3089
  };
2957
3090
 
2958
3091
  // src/services/e-sim/models/get-esim-device-ok-response.ts
@@ -3025,12 +3158,17 @@ var _18Response = z52.lazy(() => {
3025
3158
  message: data["message"]
3026
3159
  }));
3027
3160
  });
3028
- var _18 = class extends Error {
3161
+ var _18 = class extends ThrowableError {
3029
3162
  constructor(message, response) {
3030
3163
  super(message);
3164
+ this.message = message;
3165
+ this.response = response;
3031
3166
  const parsedResponse = _18Response.parse(response);
3032
3167
  this.message = parsedResponse.message || "";
3033
3168
  }
3169
+ throw() {
3170
+ throw new _18(this.message, this.response);
3171
+ }
3034
3172
  };
3035
3173
 
3036
3174
  // src/services/e-sim/models/_19.ts
@@ -3042,12 +3180,17 @@ var _19Response = z53.lazy(() => {
3042
3180
  message: data["message"]
3043
3181
  }));
3044
3182
  });
3045
- var _19 = class extends Error {
3183
+ var _19 = class extends ThrowableError {
3046
3184
  constructor(message, response) {
3047
3185
  super(message);
3186
+ this.message = message;
3187
+ this.response = response;
3048
3188
  const parsedResponse = _19Response.parse(response);
3049
3189
  this.message = parsedResponse.message || "";
3050
3190
  }
3191
+ throw() {
3192
+ throw new _19(this.message, this.response);
3193
+ }
3051
3194
  };
3052
3195
 
3053
3196
  // src/services/e-sim/models/get-esim-history-ok-response.ts
@@ -3144,12 +3287,17 @@ var _20Response = z57.lazy(() => {
3144
3287
  message: data["message"]
3145
3288
  }));
3146
3289
  });
3147
- var _20 = class extends Error {
3290
+ var _20 = class extends ThrowableError {
3148
3291
  constructor(message, response) {
3149
3292
  super(message);
3293
+ this.message = message;
3294
+ this.response = response;
3150
3295
  const parsedResponse = _20Response.parse(response);
3151
3296
  this.message = parsedResponse.message || "";
3152
3297
  }
3298
+ throw() {
3299
+ throw new _20(this.message, this.response);
3300
+ }
3153
3301
  };
3154
3302
 
3155
3303
  // src/services/e-sim/models/_21.ts
@@ -3161,12 +3309,17 @@ var _21Response = z58.lazy(() => {
3161
3309
  message: data["message"]
3162
3310
  }));
3163
3311
  });
3164
- var _21 = class extends Error {
3312
+ var _21 = class extends ThrowableError {
3165
3313
  constructor(message, response) {
3166
3314
  super(message);
3315
+ this.message = message;
3316
+ this.response = response;
3167
3317
  const parsedResponse = _21Response.parse(response);
3168
3318
  this.message = parsedResponse.message || "";
3169
3319
  }
3320
+ throw() {
3321
+ throw new _21(this.message, this.response);
3322
+ }
3170
3323
  };
3171
3324
 
3172
3325
  // src/services/e-sim/models/get-esim-mac-ok-response.ts
@@ -3234,12 +3387,17 @@ var _22Response = z61.lazy(() => {
3234
3387
  message: data["message"]
3235
3388
  }));
3236
3389
  });
3237
- var _22 = class extends Error {
3390
+ var _22 = class extends ThrowableError {
3238
3391
  constructor(message, response) {
3239
3392
  super(message);
3393
+ this.message = message;
3394
+ this.response = response;
3240
3395
  const parsedResponse = _22Response.parse(response);
3241
3396
  this.message = parsedResponse.message || "";
3242
3397
  }
3398
+ throw() {
3399
+ throw new _22(this.message, this.response);
3400
+ }
3243
3401
  };
3244
3402
 
3245
3403
  // src/services/e-sim/models/_23.ts
@@ -3251,12 +3409,17 @@ var _23Response = z62.lazy(() => {
3251
3409
  message: data["message"]
3252
3410
  }));
3253
3411
  });
3254
- var _23 = class extends Error {
3412
+ var _23 = class extends ThrowableError {
3255
3413
  constructor(message, response) {
3256
3414
  super(message);
3415
+ this.message = message;
3416
+ this.response = response;
3257
3417
  const parsedResponse = _23Response.parse(response);
3258
3418
  this.message = parsedResponse.message || "";
3259
3419
  }
3420
+ throw() {
3421
+ throw new _23(this.message, this.response);
3422
+ }
3260
3423
  };
3261
3424
 
3262
3425
  // src/services/e-sim/e-sim-service.ts
@@ -3397,12 +3560,17 @@ var _24Response = z65.lazy(() => {
3397
3560
  message: data["message"]
3398
3561
  }));
3399
3562
  });
3400
- var _24 = class extends Error {
3563
+ var _24 = class extends ThrowableError {
3401
3564
  constructor(message, response) {
3402
3565
  super(message);
3566
+ this.message = message;
3567
+ this.response = response;
3403
3568
  const parsedResponse = _24Response.parse(response);
3404
3569
  this.message = parsedResponse.message || "";
3405
3570
  }
3571
+ throw() {
3572
+ throw new _24(this.message, this.response);
3573
+ }
3406
3574
  };
3407
3575
 
3408
3576
  // src/services/i-frame/models/_25.ts
@@ -3414,12 +3582,17 @@ var _25Response = z66.lazy(() => {
3414
3582
  message: data["message"]
3415
3583
  }));
3416
3584
  });
3417
- var _25 = class extends Error {
3585
+ var _25 = class extends ThrowableError {
3418
3586
  constructor(message, response) {
3419
3587
  super(message);
3588
+ this.message = message;
3589
+ this.response = response;
3420
3590
  const parsedResponse = _25Response.parse(response);
3421
3591
  this.message = parsedResponse.message || "";
3422
3592
  }
3593
+ throw() {
3594
+ throw new _25(this.message, this.response);
3595
+ }
3423
3596
  };
3424
3597
 
3425
3598
  // src/services/i-frame/i-frame-service.ts