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.js CHANGED
@@ -295,10 +295,10 @@ var HookHandler = class {
295
295
  const error = request.errors.find((error2) => {
296
296
  return error2.contentType === contentType && error2.status === statusCode;
297
297
  });
298
- if (error == null ? void 0 : error.error) {
298
+ if (error) {
299
299
  const decodedBody2 = new TextDecoder().decode(response.raw);
300
300
  const json = JSON.parse(decodedBody2);
301
- throw new error.error((json == null ? void 0 : json.message) || "", json);
301
+ new error.error((json == null ? void 0 : json.message) || "", json).throw();
302
302
  }
303
303
  const decodedBody = new TextDecoder().decode(response.raw);
304
304
  throw new HttpError(
@@ -809,6 +809,9 @@ var OAuthHandler = class {
809
809
  this.addAccessTokenHeader(request, request.config.accessToken);
810
810
  return this.next.handle(request);
811
811
  }
812
+ if (!request.config.clientId || !request.config.clientSecret) {
813
+ return this.next.handle(request);
814
+ }
812
815
  await this.manageToken(request);
813
816
  return this.next.handle(request);
814
817
  }
@@ -1142,8 +1145,8 @@ var RequestBuilder = class {
1142
1145
  requestSchema: import_zod3.default.any(),
1143
1146
  requestContentType: "json" /* Json */,
1144
1147
  retry: {
1145
- attempts: 3,
1146
- delayMs: 150
1148
+ attempts: 1,
1149
+ delayMs: 0
1147
1150
  },
1148
1151
  validation: {
1149
1152
  responseValidation: true
@@ -1447,6 +1450,9 @@ var OAuthTokenManager = class {
1447
1450
  if ((_a = this.token) == null ? void 0 : _a.hasAllScopes(scopes)) {
1448
1451
  return this.token;
1449
1452
  }
1453
+ if (!config.clientId || !config.clientSecret) {
1454
+ throw new Error("OAuthError: clientId and clientSecret are required for token management.");
1455
+ }
1450
1456
  const updatedScopes = /* @__PURE__ */ new Set([...scopes, ...((_b = this.token) == null ? void 0 : _b.scopes) || []]);
1451
1457
  const oAuth = new OAuthService(
1452
1458
  {
@@ -1538,6 +1544,20 @@ var listDestinationsOkResponseRequest = import_zod7.z.lazy(() => {
1538
1544
 
1539
1545
  // src/services/destinations/models/__.ts
1540
1546
  var import_zod8 = require("zod");
1547
+
1548
+ // src/http/errors/throwable-error.ts
1549
+ var ThrowableError = class extends Error {
1550
+ constructor(message, response) {
1551
+ super(message);
1552
+ this.message = message;
1553
+ this.response = response;
1554
+ }
1555
+ throw() {
1556
+ throw this;
1557
+ }
1558
+ };
1559
+
1560
+ // src/services/destinations/models/__.ts
1541
1561
  var _response = import_zod8.z.lazy(() => {
1542
1562
  return import_zod8.z.object({
1543
1563
  message: import_zod8.z.string().optional()
@@ -1545,12 +1565,17 @@ var _response = import_zod8.z.lazy(() => {
1545
1565
  message: data["message"]
1546
1566
  }));
1547
1567
  });
1548
- var __ = class extends Error {
1568
+ var __ = class extends ThrowableError {
1549
1569
  constructor(message, response) {
1550
1570
  super(message);
1571
+ this.message = message;
1572
+ this.response = response;
1551
1573
  const parsedResponse = _response.parse(response);
1552
1574
  this.message = parsedResponse.message || "";
1553
1575
  }
1576
+ throw() {
1577
+ throw new __(this.message, this.response);
1578
+ }
1554
1579
  };
1555
1580
 
1556
1581
  // src/services/destinations/models/_1.ts
@@ -1562,12 +1587,17 @@ var _1Response = import_zod9.z.lazy(() => {
1562
1587
  message: data["message"]
1563
1588
  }));
1564
1589
  });
1565
- var _1 = class extends Error {
1590
+ var _1 = class extends ThrowableError {
1566
1591
  constructor(message, response) {
1567
1592
  super(message);
1593
+ this.message = message;
1594
+ this.response = response;
1568
1595
  const parsedResponse = _1Response.parse(response);
1569
1596
  this.message = parsedResponse.message || "";
1570
1597
  }
1598
+ throw() {
1599
+ throw new _1(this.message, this.response);
1600
+ }
1571
1601
  };
1572
1602
 
1573
1603
  // src/services/destinations/destinations-service.ts
@@ -1683,12 +1713,17 @@ var _2Response = import_zod13.z.lazy(() => {
1683
1713
  message: data["message"]
1684
1714
  }));
1685
1715
  });
1686
- var _2 = class extends Error {
1716
+ var _2 = class extends ThrowableError {
1687
1717
  constructor(message, response) {
1688
1718
  super(message);
1719
+ this.message = message;
1720
+ this.response = response;
1689
1721
  const parsedResponse = _2Response.parse(response);
1690
1722
  this.message = parsedResponse.message || "";
1691
1723
  }
1724
+ throw() {
1725
+ throw new _2(this.message, this.response);
1726
+ }
1692
1727
  };
1693
1728
 
1694
1729
  // src/services/packages/models/_3.ts
@@ -1700,12 +1735,17 @@ var _3Response = import_zod14.z.lazy(() => {
1700
1735
  message: data["message"]
1701
1736
  }));
1702
1737
  });
1703
- var _3 = class extends Error {
1738
+ var _3 = class extends ThrowableError {
1704
1739
  constructor(message, response) {
1705
1740
  super(message);
1741
+ this.message = message;
1742
+ this.response = response;
1706
1743
  const parsedResponse = _3Response.parse(response);
1707
1744
  this.message = parsedResponse.message || "";
1708
1745
  }
1746
+ throw() {
1747
+ throw new _3(this.message, this.response);
1748
+ }
1709
1749
  };
1710
1750
 
1711
1751
  // src/services/packages/packages-service.ts
@@ -1715,6 +1755,13 @@ var PackagesService = class extends BaseService {
1715
1755
  * @param {string} [params.destination] - ISO representation of the package's destination.
1716
1756
  * @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.
1717
1757
  * @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.
1758
+ * @param {number} [params.dataLimitInGb] - Size of the package in GB.
1759
+
1760
+ For **limited packages**, the available options are: **0.5, 1, 2, 3, 5, 8, 20GB**.
1761
+
1762
+ For **unlimited packages** (available to Region-3), please use **-1** as an identifier.
1763
+
1764
+ * @param {boolean} [params.includeUnlimited] - A boolean flag to include the **unlimited packages** in the response. The flag is false by default.
1718
1765
  * @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.
1719
1766
  * @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
1720
1767
  * @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
@@ -1745,6 +1792,12 @@ var PackagesService = class extends BaseService {
1745
1792
  }).addQueryParam({
1746
1793
  key: "endDate",
1747
1794
  value: params == null ? void 0 : params.endDate
1795
+ }).addQueryParam({
1796
+ key: "dataLimitInGB",
1797
+ value: params == null ? void 0 : params.dataLimitInGb
1798
+ }).addQueryParam({
1799
+ key: "includeUnlimited",
1800
+ value: params == null ? void 0 : params.includeUnlimited
1748
1801
  }).addQueryParam({
1749
1802
  key: "afterCursor",
1750
1803
  value: params == null ? void 0 : params.afterCursor
@@ -1774,54 +1827,49 @@ var createPurchaseV2Request = import_zod16.z.lazy(() => {
1774
1827
  return import_zod16.z.object({
1775
1828
  destination: import_zod16.z.string(),
1776
1829
  dataLimitInGb: import_zod16.z.number(),
1777
- startDate: import_zod16.z.string(),
1778
- endDate: import_zod16.z.string(),
1779
1830
  quantity: import_zod16.z.number().gte(1).lte(5),
1780
1831
  email: import_zod16.z.string().optional(),
1781
1832
  referenceId: import_zod16.z.string().optional(),
1782
- networkBrand: import_zod16.z.string().optional()
1833
+ networkBrand: import_zod16.z.string().optional(),
1834
+ emailBrand: import_zod16.z.string().optional()
1783
1835
  });
1784
1836
  });
1785
1837
  var createPurchaseV2RequestResponse = import_zod16.z.lazy(() => {
1786
1838
  return import_zod16.z.object({
1787
1839
  destination: import_zod16.z.string(),
1788
1840
  dataLimitInGB: import_zod16.z.number(),
1789
- startDate: import_zod16.z.string(),
1790
- endDate: import_zod16.z.string(),
1791
1841
  quantity: import_zod16.z.number().gte(1).lte(5),
1792
1842
  email: import_zod16.z.string().optional(),
1793
1843
  referenceId: import_zod16.z.string().optional(),
1794
- networkBrand: import_zod16.z.string().optional()
1844
+ networkBrand: import_zod16.z.string().optional(),
1845
+ emailBrand: import_zod16.z.string().optional()
1795
1846
  }).transform((data) => ({
1796
1847
  destination: data["destination"],
1797
1848
  dataLimitInGb: data["dataLimitInGB"],
1798
- startDate: data["startDate"],
1799
- endDate: data["endDate"],
1800
1849
  quantity: data["quantity"],
1801
1850
  email: data["email"],
1802
1851
  referenceId: data["referenceId"],
1803
- networkBrand: data["networkBrand"]
1852
+ networkBrand: data["networkBrand"],
1853
+ emailBrand: data["emailBrand"]
1804
1854
  }));
1805
1855
  });
1806
1856
  var createPurchaseV2RequestRequest = import_zod16.z.lazy(() => {
1807
1857
  return import_zod16.z.object({
1808
1858
  destination: import_zod16.z.string(),
1809
1859
  dataLimitInGb: import_zod16.z.number(),
1810
- startDate: import_zod16.z.string(),
1811
- endDate: import_zod16.z.string(),
1812
1860
  quantity: import_zod16.z.number().gte(1).lte(5),
1813
1861
  email: import_zod16.z.string().optional(),
1814
1862
  referenceId: import_zod16.z.string().optional(),
1815
- networkBrand: import_zod16.z.string().optional()
1863
+ networkBrand: import_zod16.z.string().optional(),
1864
+ emailBrand: import_zod16.z.string().optional()
1816
1865
  }).transform((data) => ({
1817
1866
  destination: data["destination"],
1818
1867
  dataLimitInGB: data["dataLimitInGb"],
1819
- startDate: data["startDate"],
1820
- endDate: data["endDate"],
1821
1868
  quantity: data["quantity"],
1822
1869
  email: data["email"],
1823
1870
  referenceId: data["referenceId"],
1824
- networkBrand: data["networkBrand"]
1871
+ networkBrand: data["networkBrand"],
1872
+ emailBrand: data["emailBrand"]
1825
1873
  }));
1826
1874
  });
1827
1875
 
@@ -1927,12 +1975,17 @@ var _4Response = import_zod20.z.lazy(() => {
1927
1975
  message: data["message"]
1928
1976
  }));
1929
1977
  });
1930
- var _4 = class extends Error {
1978
+ var _4 = class extends ThrowableError {
1931
1979
  constructor(message, response) {
1932
1980
  super(message);
1981
+ this.message = message;
1982
+ this.response = response;
1933
1983
  const parsedResponse = _4Response.parse(response);
1934
1984
  this.message = parsedResponse.message || "";
1935
1985
  }
1986
+ throw() {
1987
+ throw new _4(this.message, this.response);
1988
+ }
1936
1989
  };
1937
1990
 
1938
1991
  // src/services/purchases/models/_5.ts
@@ -1944,12 +1997,17 @@ var _5Response = import_zod21.z.lazy(() => {
1944
1997
  message: data["message"]
1945
1998
  }));
1946
1999
  });
1947
- var _5 = class extends Error {
2000
+ var _5 = class extends ThrowableError {
1948
2001
  constructor(message, response) {
1949
2002
  super(message);
2003
+ this.message = message;
2004
+ this.response = response;
1950
2005
  const parsedResponse = _5Response.parse(response);
1951
2006
  this.message = parsedResponse.message || "";
1952
2007
  }
2008
+ throw() {
2009
+ throw new _5(this.message, this.response);
2010
+ }
1953
2011
  };
1954
2012
 
1955
2013
  // src/services/purchases/models/list-purchases-ok-response.ts
@@ -2026,35 +2084,40 @@ var purchasesEsimRequest = import_zod23.z.lazy(() => {
2026
2084
  var purchases = import_zod24.z.lazy(() => {
2027
2085
  return import_zod24.z.object({
2028
2086
  id: import_zod24.z.string().optional(),
2029
- startDate: import_zod24.z.string().optional(),
2030
- endDate: import_zod24.z.string().optional(),
2087
+ startDate: import_zod24.z.string().optional().nullable(),
2088
+ endDate: import_zod24.z.string().optional().nullable(),
2089
+ duration: import_zod24.z.number().optional().nullable(),
2031
2090
  createdDate: import_zod24.z.string().optional(),
2032
- startTime: import_zod24.z.number().optional(),
2033
- endTime: import_zod24.z.number().optional(),
2091
+ startTime: import_zod24.z.number().optional().nullable(),
2092
+ endTime: import_zod24.z.number().optional().nullable(),
2034
2093
  createdAt: import_zod24.z.number().optional(),
2035
2094
  package: package_.optional(),
2036
2095
  esim: purchasesEsim.optional(),
2037
2096
  source: import_zod24.z.string().optional(),
2097
+ purchaseType: import_zod24.z.string().optional(),
2038
2098
  referenceId: import_zod24.z.string().optional()
2039
2099
  });
2040
2100
  });
2041
2101
  var purchasesResponse = import_zod24.z.lazy(() => {
2042
2102
  return import_zod24.z.object({
2043
2103
  id: import_zod24.z.string().optional(),
2044
- startDate: import_zod24.z.string().optional(),
2045
- endDate: import_zod24.z.string().optional(),
2104
+ startDate: import_zod24.z.string().optional().nullable(),
2105
+ endDate: import_zod24.z.string().optional().nullable(),
2106
+ duration: import_zod24.z.number().optional().nullable(),
2046
2107
  createdDate: import_zod24.z.string().optional(),
2047
- startTime: import_zod24.z.number().optional(),
2048
- endTime: import_zod24.z.number().optional(),
2108
+ startTime: import_zod24.z.number().optional().nullable(),
2109
+ endTime: import_zod24.z.number().optional().nullable(),
2049
2110
  createdAt: import_zod24.z.number().optional(),
2050
2111
  package: packageResponse.optional(),
2051
2112
  esim: purchasesEsimResponse.optional(),
2052
2113
  source: import_zod24.z.string().optional(),
2114
+ purchaseType: import_zod24.z.string().optional(),
2053
2115
  referenceId: import_zod24.z.string().optional()
2054
2116
  }).transform((data) => ({
2055
2117
  id: data["id"],
2056
2118
  startDate: data["startDate"],
2057
2119
  endDate: data["endDate"],
2120
+ duration: data["duration"],
2058
2121
  createdDate: data["createdDate"],
2059
2122
  startTime: data["startTime"],
2060
2123
  endTime: data["endTime"],
@@ -2062,26 +2125,30 @@ var purchasesResponse = import_zod24.z.lazy(() => {
2062
2125
  package: data["package"],
2063
2126
  esim: data["esim"],
2064
2127
  source: data["source"],
2128
+ purchaseType: data["purchaseType"],
2065
2129
  referenceId: data["referenceId"]
2066
2130
  }));
2067
2131
  });
2068
2132
  var purchasesRequest = import_zod24.z.lazy(() => {
2069
2133
  return import_zod24.z.object({
2070
2134
  id: import_zod24.z.string().optional(),
2071
- startDate: import_zod24.z.string().optional(),
2072
- endDate: import_zod24.z.string().optional(),
2135
+ startDate: import_zod24.z.string().optional().nullable(),
2136
+ endDate: import_zod24.z.string().optional().nullable(),
2137
+ duration: import_zod24.z.number().optional().nullable(),
2073
2138
  createdDate: import_zod24.z.string().optional(),
2074
- startTime: import_zod24.z.number().optional(),
2075
- endTime: import_zod24.z.number().optional(),
2139
+ startTime: import_zod24.z.number().optional().nullable(),
2140
+ endTime: import_zod24.z.number().optional().nullable(),
2076
2141
  createdAt: import_zod24.z.number().optional(),
2077
2142
  package: packageRequest.optional(),
2078
2143
  esim: purchasesEsimRequest.optional(),
2079
2144
  source: import_zod24.z.string().optional(),
2145
+ purchaseType: import_zod24.z.string().optional(),
2080
2146
  referenceId: import_zod24.z.string().optional()
2081
2147
  }).transform((data) => ({
2082
2148
  id: data["id"],
2083
2149
  startDate: data["startDate"],
2084
2150
  endDate: data["endDate"],
2151
+ duration: data["duration"],
2085
2152
  createdDate: data["createdDate"],
2086
2153
  startTime: data["startTime"],
2087
2154
  endTime: data["endTime"],
@@ -2089,6 +2156,7 @@ var purchasesRequest = import_zod24.z.lazy(() => {
2089
2156
  package: data["package"],
2090
2157
  esim: data["esim"],
2091
2158
  source: data["source"],
2159
+ purchaseType: data["purchaseType"],
2092
2160
  referenceId: data["referenceId"]
2093
2161
  }));
2094
2162
  });
@@ -2128,12 +2196,17 @@ var _6Response = import_zod26.z.lazy(() => {
2128
2196
  message: data["message"]
2129
2197
  }));
2130
2198
  });
2131
- var _6 = class extends Error {
2199
+ var _6 = class extends ThrowableError {
2132
2200
  constructor(message, response) {
2133
2201
  super(message);
2202
+ this.message = message;
2203
+ this.response = response;
2134
2204
  const parsedResponse = _6Response.parse(response);
2135
2205
  this.message = parsedResponse.message || "";
2136
2206
  }
2207
+ throw() {
2208
+ throw new _6(this.message, this.response);
2209
+ }
2137
2210
  };
2138
2211
 
2139
2212
  // src/services/purchases/models/_7.ts
@@ -2145,12 +2218,17 @@ var _7Response = import_zod27.z.lazy(() => {
2145
2218
  message: data["message"]
2146
2219
  }));
2147
2220
  });
2148
- var _7 = class extends Error {
2221
+ var _7 = class extends ThrowableError {
2149
2222
  constructor(message, response) {
2150
2223
  super(message);
2224
+ this.message = message;
2225
+ this.response = response;
2151
2226
  const parsedResponse = _7Response.parse(response);
2152
2227
  this.message = parsedResponse.message || "";
2153
2228
  }
2229
+ throw() {
2230
+ throw new _7(this.message, this.response);
2231
+ }
2154
2232
  };
2155
2233
 
2156
2234
  // src/services/purchases/models/create-purchase-request.ts
@@ -2164,6 +2242,7 @@ var createPurchaseRequest = import_zod28.z.lazy(() => {
2164
2242
  email: import_zod28.z.string().optional(),
2165
2243
  referenceId: import_zod28.z.string().optional(),
2166
2244
  networkBrand: import_zod28.z.string().optional(),
2245
+ emailBrand: import_zod28.z.string().optional(),
2167
2246
  startTime: import_zod28.z.number().optional(),
2168
2247
  endTime: import_zod28.z.number().optional()
2169
2248
  });
@@ -2177,6 +2256,7 @@ var createPurchaseRequestResponse = import_zod28.z.lazy(() => {
2177
2256
  email: import_zod28.z.string().optional(),
2178
2257
  referenceId: import_zod28.z.string().optional(),
2179
2258
  networkBrand: import_zod28.z.string().optional(),
2259
+ emailBrand: import_zod28.z.string().optional(),
2180
2260
  startTime: import_zod28.z.number().optional(),
2181
2261
  endTime: import_zod28.z.number().optional()
2182
2262
  }).transform((data) => ({
@@ -2187,6 +2267,7 @@ var createPurchaseRequestResponse = import_zod28.z.lazy(() => {
2187
2267
  email: data["email"],
2188
2268
  referenceId: data["referenceId"],
2189
2269
  networkBrand: data["networkBrand"],
2270
+ emailBrand: data["emailBrand"],
2190
2271
  startTime: data["startTime"],
2191
2272
  endTime: data["endTime"]
2192
2273
  }));
@@ -2200,6 +2281,7 @@ var createPurchaseRequestRequest = import_zod28.z.lazy(() => {
2200
2281
  email: import_zod28.z.string().optional(),
2201
2282
  referenceId: import_zod28.z.string().optional(),
2202
2283
  networkBrand: import_zod28.z.string().optional(),
2284
+ emailBrand: import_zod28.z.string().optional(),
2203
2285
  startTime: import_zod28.z.number().optional(),
2204
2286
  endTime: import_zod28.z.number().optional()
2205
2287
  }).transform((data) => ({
@@ -2210,6 +2292,7 @@ var createPurchaseRequestRequest = import_zod28.z.lazy(() => {
2210
2292
  email: data["email"],
2211
2293
  referenceId: data["referenceId"],
2212
2294
  networkBrand: data["networkBrand"],
2295
+ emailBrand: data["emailBrand"],
2213
2296
  startTime: data["startTime"],
2214
2297
  endTime: data["endTime"]
2215
2298
  }));
@@ -2224,22 +2307,22 @@ var createPurchaseOkResponsePurchase = import_zod29.z.lazy(() => {
2224
2307
  return import_zod29.z.object({
2225
2308
  id: import_zod29.z.string().optional(),
2226
2309
  packageId: import_zod29.z.string().optional(),
2227
- startDate: import_zod29.z.string().optional(),
2228
- endDate: import_zod29.z.string().optional(),
2310
+ startDate: import_zod29.z.string().optional().nullable(),
2311
+ endDate: import_zod29.z.string().optional().nullable(),
2229
2312
  createdDate: import_zod29.z.string().optional(),
2230
- startTime: import_zod29.z.number().optional(),
2231
- endTime: import_zod29.z.number().optional()
2313
+ startTime: import_zod29.z.number().optional().nullable(),
2314
+ endTime: import_zod29.z.number().optional().nullable()
2232
2315
  });
2233
2316
  });
2234
2317
  var createPurchaseOkResponsePurchaseResponse = import_zod29.z.lazy(() => {
2235
2318
  return import_zod29.z.object({
2236
2319
  id: import_zod29.z.string().optional(),
2237
2320
  packageId: import_zod29.z.string().optional(),
2238
- startDate: import_zod29.z.string().optional(),
2239
- endDate: import_zod29.z.string().optional(),
2321
+ startDate: import_zod29.z.string().optional().nullable(),
2322
+ endDate: import_zod29.z.string().optional().nullable(),
2240
2323
  createdDate: import_zod29.z.string().optional(),
2241
- startTime: import_zod29.z.number().optional(),
2242
- endTime: import_zod29.z.number().optional()
2324
+ startTime: import_zod29.z.number().optional().nullable(),
2325
+ endTime: import_zod29.z.number().optional().nullable()
2243
2326
  }).transform((data) => ({
2244
2327
  id: data["id"],
2245
2328
  packageId: data["packageId"],
@@ -2254,11 +2337,11 @@ var createPurchaseOkResponsePurchaseRequest = import_zod29.z.lazy(() => {
2254
2337
  return import_zod29.z.object({
2255
2338
  id: import_zod29.z.string().optional(),
2256
2339
  packageId: import_zod29.z.string().optional(),
2257
- startDate: import_zod29.z.string().optional(),
2258
- endDate: import_zod29.z.string().optional(),
2340
+ startDate: import_zod29.z.string().optional().nullable(),
2341
+ endDate: import_zod29.z.string().optional().nullable(),
2259
2342
  createdDate: import_zod29.z.string().optional(),
2260
- startTime: import_zod29.z.number().optional(),
2261
- endTime: import_zod29.z.number().optional()
2343
+ startTime: import_zod29.z.number().optional().nullable(),
2344
+ endTime: import_zod29.z.number().optional().nullable()
2262
2345
  }).transform((data) => ({
2263
2346
  id: data["id"],
2264
2347
  packageId: data["packageId"],
@@ -2337,12 +2420,17 @@ var _8Response = import_zod32.z.lazy(() => {
2337
2420
  message: data["message"]
2338
2421
  }));
2339
2422
  });
2340
- var _8 = class extends Error {
2423
+ var _8 = class extends ThrowableError {
2341
2424
  constructor(message, response) {
2342
2425
  super(message);
2426
+ this.message = message;
2427
+ this.response = response;
2343
2428
  const parsedResponse = _8Response.parse(response);
2344
2429
  this.message = parsedResponse.message || "";
2345
2430
  }
2431
+ throw() {
2432
+ throw new _8(this.message, this.response);
2433
+ }
2346
2434
  };
2347
2435
 
2348
2436
  // src/services/purchases/models/_9.ts
@@ -2354,12 +2442,17 @@ var _9Response = import_zod33.z.lazy(() => {
2354
2442
  message: data["message"]
2355
2443
  }));
2356
2444
  });
2357
- var _9 = class extends Error {
2445
+ var _9 = class extends ThrowableError {
2358
2446
  constructor(message, response) {
2359
2447
  super(message);
2448
+ this.message = message;
2449
+ this.response = response;
2360
2450
  const parsedResponse = _9Response.parse(response);
2361
2451
  this.message = parsedResponse.message || "";
2362
2452
  }
2453
+ throw() {
2454
+ throw new _9(this.message, this.response);
2455
+ }
2363
2456
  };
2364
2457
 
2365
2458
  // src/services/purchases/models/top-up-esim-request.ts
@@ -2368,10 +2461,9 @@ var topUpEsimRequest = import_zod34.z.lazy(() => {
2368
2461
  return import_zod34.z.object({
2369
2462
  iccid: import_zod34.z.string().min(18).max(22),
2370
2463
  dataLimitInGb: import_zod34.z.number(),
2371
- startDate: import_zod34.z.string(),
2372
- endDate: import_zod34.z.string(),
2373
2464
  email: import_zod34.z.string().optional(),
2374
2465
  referenceId: import_zod34.z.string().optional(),
2466
+ emailBrand: import_zod34.z.string().optional(),
2375
2467
  startTime: import_zod34.z.number().optional(),
2376
2468
  endTime: import_zod34.z.number().optional()
2377
2469
  });
@@ -2380,19 +2472,17 @@ var topUpEsimRequestResponse = import_zod34.z.lazy(() => {
2380
2472
  return import_zod34.z.object({
2381
2473
  iccid: import_zod34.z.string().min(18).max(22),
2382
2474
  dataLimitInGB: import_zod34.z.number(),
2383
- startDate: import_zod34.z.string(),
2384
- endDate: import_zod34.z.string(),
2385
2475
  email: import_zod34.z.string().optional(),
2386
2476
  referenceId: import_zod34.z.string().optional(),
2477
+ emailBrand: import_zod34.z.string().optional(),
2387
2478
  startTime: import_zod34.z.number().optional(),
2388
2479
  endTime: import_zod34.z.number().optional()
2389
2480
  }).transform((data) => ({
2390
2481
  iccid: data["iccid"],
2391
2482
  dataLimitInGb: data["dataLimitInGB"],
2392
- startDate: data["startDate"],
2393
- endDate: data["endDate"],
2394
2483
  email: data["email"],
2395
2484
  referenceId: data["referenceId"],
2485
+ emailBrand: data["emailBrand"],
2396
2486
  startTime: data["startTime"],
2397
2487
  endTime: data["endTime"]
2398
2488
  }));
@@ -2401,19 +2491,17 @@ var topUpEsimRequestRequest = import_zod34.z.lazy(() => {
2401
2491
  return import_zod34.z.object({
2402
2492
  iccid: import_zod34.z.string().min(18).max(22),
2403
2493
  dataLimitInGb: import_zod34.z.number(),
2404
- startDate: import_zod34.z.string(),
2405
- endDate: import_zod34.z.string(),
2406
2494
  email: import_zod34.z.string().optional(),
2407
2495
  referenceId: import_zod34.z.string().optional(),
2496
+ emailBrand: import_zod34.z.string().optional(),
2408
2497
  startTime: import_zod34.z.number().optional(),
2409
2498
  endTime: import_zod34.z.number().optional()
2410
2499
  }).transform((data) => ({
2411
2500
  iccid: data["iccid"],
2412
2501
  dataLimitInGB: data["dataLimitInGb"],
2413
- startDate: data["startDate"],
2414
- endDate: data["endDate"],
2415
2502
  email: data["email"],
2416
2503
  referenceId: data["referenceId"],
2504
+ emailBrand: data["emailBrand"],
2417
2505
  startTime: data["startTime"],
2418
2506
  endTime: data["endTime"]
2419
2507
  }));
@@ -2428,27 +2516,30 @@ var topUpEsimOkResponsePurchase = import_zod35.z.lazy(() => {
2428
2516
  return import_zod35.z.object({
2429
2517
  id: import_zod35.z.string().optional(),
2430
2518
  packageId: import_zod35.z.string().optional(),
2431
- startDate: import_zod35.z.string().optional(),
2432
- endDate: import_zod35.z.string().optional(),
2519
+ startDate: import_zod35.z.string().optional().nullable(),
2520
+ endDate: import_zod35.z.string().optional().nullable(),
2521
+ duration: import_zod35.z.number().optional().nullable(),
2433
2522
  createdDate: import_zod35.z.string().optional(),
2434
- startTime: import_zod35.z.number().optional(),
2435
- endTime: import_zod35.z.number().optional()
2523
+ startTime: import_zod35.z.number().optional().nullable(),
2524
+ endTime: import_zod35.z.number().optional().nullable()
2436
2525
  });
2437
2526
  });
2438
2527
  var topUpEsimOkResponsePurchaseResponse = import_zod35.z.lazy(() => {
2439
2528
  return import_zod35.z.object({
2440
2529
  id: import_zod35.z.string().optional(),
2441
2530
  packageId: import_zod35.z.string().optional(),
2442
- startDate: import_zod35.z.string().optional(),
2443
- endDate: import_zod35.z.string().optional(),
2531
+ startDate: import_zod35.z.string().optional().nullable(),
2532
+ endDate: import_zod35.z.string().optional().nullable(),
2533
+ duration: import_zod35.z.number().optional().nullable(),
2444
2534
  createdDate: import_zod35.z.string().optional(),
2445
- startTime: import_zod35.z.number().optional(),
2446
- endTime: import_zod35.z.number().optional()
2535
+ startTime: import_zod35.z.number().optional().nullable(),
2536
+ endTime: import_zod35.z.number().optional().nullable()
2447
2537
  }).transform((data) => ({
2448
2538
  id: data["id"],
2449
2539
  packageId: data["packageId"],
2450
2540
  startDate: data["startDate"],
2451
2541
  endDate: data["endDate"],
2542
+ duration: data["duration"],
2452
2543
  createdDate: data["createdDate"],
2453
2544
  startTime: data["startTime"],
2454
2545
  endTime: data["endTime"]
@@ -2458,16 +2549,18 @@ var topUpEsimOkResponsePurchaseRequest = import_zod35.z.lazy(() => {
2458
2549
  return import_zod35.z.object({
2459
2550
  id: import_zod35.z.string().optional(),
2460
2551
  packageId: import_zod35.z.string().optional(),
2461
- startDate: import_zod35.z.string().optional(),
2462
- endDate: import_zod35.z.string().optional(),
2552
+ startDate: import_zod35.z.string().optional().nullable(),
2553
+ endDate: import_zod35.z.string().optional().nullable(),
2554
+ duration: import_zod35.z.number().optional().nullable(),
2463
2555
  createdDate: import_zod35.z.string().optional(),
2464
- startTime: import_zod35.z.number().optional(),
2465
- endTime: import_zod35.z.number().optional()
2556
+ startTime: import_zod35.z.number().optional().nullable(),
2557
+ endTime: import_zod35.z.number().optional().nullable()
2466
2558
  }).transform((data) => ({
2467
2559
  id: data["id"],
2468
2560
  packageId: data["packageId"],
2469
2561
  startDate: data["startDate"],
2470
2562
  endDate: data["endDate"],
2563
+ duration: data["duration"],
2471
2564
  createdDate: data["createdDate"],
2472
2565
  startTime: data["startTime"],
2473
2566
  endTime: data["endTime"]
@@ -2531,12 +2624,17 @@ var _10Response = import_zod38.z.lazy(() => {
2531
2624
  message: data["message"]
2532
2625
  }));
2533
2626
  });
2534
- var _10 = class extends Error {
2627
+ var _10 = class extends ThrowableError {
2535
2628
  constructor(message, response) {
2536
2629
  super(message);
2630
+ this.message = message;
2631
+ this.response = response;
2537
2632
  const parsedResponse = _10Response.parse(response);
2538
2633
  this.message = parsedResponse.message || "";
2539
2634
  }
2635
+ throw() {
2636
+ throw new _10(this.message, this.response);
2637
+ }
2540
2638
  };
2541
2639
 
2542
2640
  // src/services/purchases/models/_11.ts
@@ -2548,12 +2646,17 @@ var _11Response = import_zod39.z.lazy(() => {
2548
2646
  message: data["message"]
2549
2647
  }));
2550
2648
  });
2551
- var _11 = class extends Error {
2649
+ var _11 = class extends ThrowableError {
2552
2650
  constructor(message, response) {
2553
2651
  super(message);
2652
+ this.message = message;
2653
+ this.response = response;
2554
2654
  const parsedResponse = _11Response.parse(response);
2555
2655
  this.message = parsedResponse.message || "";
2556
2656
  }
2657
+ throw() {
2658
+ throw new _11(this.message, this.response);
2659
+ }
2557
2660
  };
2558
2661
 
2559
2662
  // src/services/purchases/models/edit-purchase-request.ts
@@ -2603,19 +2706,19 @@ var import_zod41 = require("zod");
2603
2706
  var editPurchaseOkResponse = import_zod41.z.lazy(() => {
2604
2707
  return import_zod41.z.object({
2605
2708
  purchaseId: import_zod41.z.string().optional(),
2606
- newStartDate: import_zod41.z.string().optional(),
2607
- newEndDate: import_zod41.z.string().optional(),
2608
- newStartTime: import_zod41.z.number().optional(),
2609
- newEndTime: import_zod41.z.number().optional()
2709
+ newStartDate: import_zod41.z.string().optional().nullable(),
2710
+ newEndDate: import_zod41.z.string().optional().nullable(),
2711
+ newStartTime: import_zod41.z.number().optional().nullable(),
2712
+ newEndTime: import_zod41.z.number().optional().nullable()
2610
2713
  });
2611
2714
  });
2612
2715
  var editPurchaseOkResponseResponse = import_zod41.z.lazy(() => {
2613
2716
  return import_zod41.z.object({
2614
2717
  purchaseId: import_zod41.z.string().optional(),
2615
- newStartDate: import_zod41.z.string().optional(),
2616
- newEndDate: import_zod41.z.string().optional(),
2617
- newStartTime: import_zod41.z.number().optional(),
2618
- newEndTime: import_zod41.z.number().optional()
2718
+ newStartDate: import_zod41.z.string().optional().nullable(),
2719
+ newEndDate: import_zod41.z.string().optional().nullable(),
2720
+ newStartTime: import_zod41.z.number().optional().nullable(),
2721
+ newEndTime: import_zod41.z.number().optional().nullable()
2619
2722
  }).transform((data) => ({
2620
2723
  purchaseId: data["purchaseId"],
2621
2724
  newStartDate: data["newStartDate"],
@@ -2627,10 +2730,10 @@ var editPurchaseOkResponseResponse = import_zod41.z.lazy(() => {
2627
2730
  var editPurchaseOkResponseRequest = import_zod41.z.lazy(() => {
2628
2731
  return import_zod41.z.object({
2629
2732
  purchaseId: import_zod41.z.string().optional(),
2630
- newStartDate: import_zod41.z.string().optional(),
2631
- newEndDate: import_zod41.z.string().optional(),
2632
- newStartTime: import_zod41.z.number().optional(),
2633
- newEndTime: import_zod41.z.number().optional()
2733
+ newStartDate: import_zod41.z.string().optional().nullable(),
2734
+ newEndDate: import_zod41.z.string().optional().nullable(),
2735
+ newStartTime: import_zod41.z.number().optional().nullable(),
2736
+ newEndTime: import_zod41.z.number().optional().nullable()
2634
2737
  }).transform((data) => ({
2635
2738
  purchaseId: data["purchaseId"],
2636
2739
  newStartDate: data["newStartDate"],
@@ -2649,12 +2752,17 @@ var _12Response = import_zod42.z.lazy(() => {
2649
2752
  message: data["message"]
2650
2753
  }));
2651
2754
  });
2652
- var _12 = class extends Error {
2755
+ var _12 = class extends ThrowableError {
2653
2756
  constructor(message, response) {
2654
2757
  super(message);
2758
+ this.message = message;
2759
+ this.response = response;
2655
2760
  const parsedResponse = _12Response.parse(response);
2656
2761
  this.message = parsedResponse.message || "";
2657
2762
  }
2763
+ throw() {
2764
+ throw new _12(this.message, this.response);
2765
+ }
2658
2766
  };
2659
2767
 
2660
2768
  // src/services/purchases/models/_13.ts
@@ -2666,12 +2774,17 @@ var _13Response = import_zod43.z.lazy(() => {
2666
2774
  message: data["message"]
2667
2775
  }));
2668
2776
  });
2669
- var _13 = class extends Error {
2777
+ var _13 = class extends ThrowableError {
2670
2778
  constructor(message, response) {
2671
2779
  super(message);
2780
+ this.message = message;
2781
+ this.response = response;
2672
2782
  const parsedResponse = _13Response.parse(response);
2673
2783
  this.message = parsedResponse.message || "";
2674
2784
  }
2785
+ throw() {
2786
+ throw new _13(this.message, this.response);
2787
+ }
2675
2788
  };
2676
2789
 
2677
2790
  // src/services/purchases/models/get-purchase-consumption-ok-response.ts
@@ -2710,12 +2823,17 @@ var _14Response = import_zod45.z.lazy(() => {
2710
2823
  message: data["message"]
2711
2824
  }));
2712
2825
  });
2713
- var _14 = class extends Error {
2826
+ var _14 = class extends ThrowableError {
2714
2827
  constructor(message, response) {
2715
2828
  super(message);
2829
+ this.message = message;
2830
+ this.response = response;
2716
2831
  const parsedResponse = _14Response.parse(response);
2717
2832
  this.message = parsedResponse.message || "";
2718
2833
  }
2834
+ throw() {
2835
+ throw new _14(this.message, this.response);
2836
+ }
2719
2837
  };
2720
2838
 
2721
2839
  // src/services/purchases/models/_15.ts
@@ -2727,12 +2845,17 @@ var _15Response = import_zod46.z.lazy(() => {
2727
2845
  message: data["message"]
2728
2846
  }));
2729
2847
  });
2730
- var _15 = class extends Error {
2848
+ var _15 = class extends ThrowableError {
2731
2849
  constructor(message, response) {
2732
2850
  super(message);
2851
+ this.message = message;
2852
+ this.response = response;
2733
2853
  const parsedResponse = _15Response.parse(response);
2734
2854
  this.message = parsedResponse.message || "";
2735
2855
  }
2856
+ throw() {
2857
+ throw new _15(this.message, this.response);
2858
+ }
2736
2859
  };
2737
2860
 
2738
2861
  // src/services/purchases/purchases-service.ts
@@ -2854,7 +2977,7 @@ var PurchasesService = class extends BaseService {
2854
2977
  return this.client.call(request);
2855
2978
  }
2856
2979
  /**
2857
- * 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.
2980
+ * 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.
2858
2981
  * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
2859
2982
  * @returns {Promise<HttpResponse<EditPurchaseOkResponse>>} Successful Response
2860
2983
  */
@@ -2974,12 +3097,17 @@ var _16Response = import_zod50.z.lazy(() => {
2974
3097
  message: data["message"]
2975
3098
  }));
2976
3099
  });
2977
- var _16 = class extends Error {
3100
+ var _16 = class extends ThrowableError {
2978
3101
  constructor(message, response) {
2979
3102
  super(message);
3103
+ this.message = message;
3104
+ this.response = response;
2980
3105
  const parsedResponse = _16Response.parse(response);
2981
3106
  this.message = parsedResponse.message || "";
2982
3107
  }
3108
+ throw() {
3109
+ throw new _16(this.message, this.response);
3110
+ }
2983
3111
  };
2984
3112
 
2985
3113
  // src/services/e-sim/models/_17.ts
@@ -2991,12 +3119,17 @@ var _17Response = import_zod51.z.lazy(() => {
2991
3119
  message: data["message"]
2992
3120
  }));
2993
3121
  });
2994
- var _17 = class extends Error {
3122
+ var _17 = class extends ThrowableError {
2995
3123
  constructor(message, response) {
2996
3124
  super(message);
3125
+ this.message = message;
3126
+ this.response = response;
2997
3127
  const parsedResponse = _17Response.parse(response);
2998
3128
  this.message = parsedResponse.message || "";
2999
3129
  }
3130
+ throw() {
3131
+ throw new _17(this.message, this.response);
3132
+ }
3000
3133
  };
3001
3134
 
3002
3135
  // src/services/e-sim/models/get-esim-device-ok-response.ts
@@ -3069,12 +3202,17 @@ var _18Response = import_zod54.z.lazy(() => {
3069
3202
  message: data["message"]
3070
3203
  }));
3071
3204
  });
3072
- var _18 = class extends Error {
3205
+ var _18 = class extends ThrowableError {
3073
3206
  constructor(message, response) {
3074
3207
  super(message);
3208
+ this.message = message;
3209
+ this.response = response;
3075
3210
  const parsedResponse = _18Response.parse(response);
3076
3211
  this.message = parsedResponse.message || "";
3077
3212
  }
3213
+ throw() {
3214
+ throw new _18(this.message, this.response);
3215
+ }
3078
3216
  };
3079
3217
 
3080
3218
  // src/services/e-sim/models/_19.ts
@@ -3086,12 +3224,17 @@ var _19Response = import_zod55.z.lazy(() => {
3086
3224
  message: data["message"]
3087
3225
  }));
3088
3226
  });
3089
- var _19 = class extends Error {
3227
+ var _19 = class extends ThrowableError {
3090
3228
  constructor(message, response) {
3091
3229
  super(message);
3230
+ this.message = message;
3231
+ this.response = response;
3092
3232
  const parsedResponse = _19Response.parse(response);
3093
3233
  this.message = parsedResponse.message || "";
3094
3234
  }
3235
+ throw() {
3236
+ throw new _19(this.message, this.response);
3237
+ }
3095
3238
  };
3096
3239
 
3097
3240
  // src/services/e-sim/models/get-esim-history-ok-response.ts
@@ -3188,12 +3331,17 @@ var _20Response = import_zod59.z.lazy(() => {
3188
3331
  message: data["message"]
3189
3332
  }));
3190
3333
  });
3191
- var _20 = class extends Error {
3334
+ var _20 = class extends ThrowableError {
3192
3335
  constructor(message, response) {
3193
3336
  super(message);
3337
+ this.message = message;
3338
+ this.response = response;
3194
3339
  const parsedResponse = _20Response.parse(response);
3195
3340
  this.message = parsedResponse.message || "";
3196
3341
  }
3342
+ throw() {
3343
+ throw new _20(this.message, this.response);
3344
+ }
3197
3345
  };
3198
3346
 
3199
3347
  // src/services/e-sim/models/_21.ts
@@ -3205,12 +3353,17 @@ var _21Response = import_zod60.z.lazy(() => {
3205
3353
  message: data["message"]
3206
3354
  }));
3207
3355
  });
3208
- var _21 = class extends Error {
3356
+ var _21 = class extends ThrowableError {
3209
3357
  constructor(message, response) {
3210
3358
  super(message);
3359
+ this.message = message;
3360
+ this.response = response;
3211
3361
  const parsedResponse = _21Response.parse(response);
3212
3362
  this.message = parsedResponse.message || "";
3213
3363
  }
3364
+ throw() {
3365
+ throw new _21(this.message, this.response);
3366
+ }
3214
3367
  };
3215
3368
 
3216
3369
  // src/services/e-sim/models/get-esim-mac-ok-response.ts
@@ -3278,12 +3431,17 @@ var _22Response = import_zod63.z.lazy(() => {
3278
3431
  message: data["message"]
3279
3432
  }));
3280
3433
  });
3281
- var _22 = class extends Error {
3434
+ var _22 = class extends ThrowableError {
3282
3435
  constructor(message, response) {
3283
3436
  super(message);
3437
+ this.message = message;
3438
+ this.response = response;
3284
3439
  const parsedResponse = _22Response.parse(response);
3285
3440
  this.message = parsedResponse.message || "";
3286
3441
  }
3442
+ throw() {
3443
+ throw new _22(this.message, this.response);
3444
+ }
3287
3445
  };
3288
3446
 
3289
3447
  // src/services/e-sim/models/_23.ts
@@ -3295,12 +3453,17 @@ var _23Response = import_zod64.z.lazy(() => {
3295
3453
  message: data["message"]
3296
3454
  }));
3297
3455
  });
3298
- var _23 = class extends Error {
3456
+ var _23 = class extends ThrowableError {
3299
3457
  constructor(message, response) {
3300
3458
  super(message);
3459
+ this.message = message;
3460
+ this.response = response;
3301
3461
  const parsedResponse = _23Response.parse(response);
3302
3462
  this.message = parsedResponse.message || "";
3303
3463
  }
3464
+ throw() {
3465
+ throw new _23(this.message, this.response);
3466
+ }
3304
3467
  };
3305
3468
 
3306
3469
  // src/services/e-sim/e-sim-service.ts
@@ -3441,12 +3604,17 @@ var _24Response = import_zod67.z.lazy(() => {
3441
3604
  message: data["message"]
3442
3605
  }));
3443
3606
  });
3444
- var _24 = class extends Error {
3607
+ var _24 = class extends ThrowableError {
3445
3608
  constructor(message, response) {
3446
3609
  super(message);
3610
+ this.message = message;
3611
+ this.response = response;
3447
3612
  const parsedResponse = _24Response.parse(response);
3448
3613
  this.message = parsedResponse.message || "";
3449
3614
  }
3615
+ throw() {
3616
+ throw new _24(this.message, this.response);
3617
+ }
3450
3618
  };
3451
3619
 
3452
3620
  // src/services/i-frame/models/_25.ts
@@ -3458,12 +3626,17 @@ var _25Response = import_zod68.z.lazy(() => {
3458
3626
  message: data["message"]
3459
3627
  }));
3460
3628
  });
3461
- var _25 = class extends Error {
3629
+ var _25 = class extends ThrowableError {
3462
3630
  constructor(message, response) {
3463
3631
  super(message);
3632
+ this.message = message;
3633
+ this.response = response;
3464
3634
  const parsedResponse = _25Response.parse(response);
3465
3635
  this.message = parsedResponse.message || "";
3466
3636
  }
3637
+ throw() {
3638
+ throw new _25(this.message, this.response);
3639
+ }
3467
3640
  };
3468
3641
 
3469
3642
  // src/services/i-frame/i-frame-service.ts