@myparcel-dev/sdk 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE.txt +21 -0
  2. package/README.md +15 -0
  3. package/lib/createMyParcelSdk.d.ts +18 -0
  4. package/lib/createMyParcelSdk.spec.d.ts +1 -0
  5. package/lib/createPrivateSdk.d.ts +8 -0
  6. package/lib/createPrivateSdk.spec.d.ts +1 -0
  7. package/lib/createPublicSdk.d.ts +8 -0
  8. package/lib/endpoints/endpoints.spec.d.ts +1 -0
  9. package/lib/endpoints/index.d.ts +2 -0
  10. package/lib/endpoints/private/account-messages/AccountMessages.types.d.ts +6 -0
  11. package/lib/endpoints/private/account-messages/DeleteAccountMessage.d.ts +20 -0
  12. package/lib/endpoints/private/account-messages/GetAccountMessages.d.ts +20 -0
  13. package/lib/endpoints/private/account-messages/index.d.ts +3 -0
  14. package/lib/endpoints/private/accounts/Account.types.d.ts +59 -0
  15. package/lib/endpoints/private/accounts/GetAccount.d.ts +20 -0
  16. package/lib/endpoints/private/accounts/GetAccounts.d.ts +14 -0
  17. package/lib/endpoints/private/accounts/PutAccount.d.ts +19 -0
  18. package/lib/endpoints/private/accounts/index.d.ts +4 -0
  19. package/lib/endpoints/private/api-key/ApiKey.types.d.ts +12 -0
  20. package/lib/endpoints/private/api-key/GetApiKeys.d.ts +17 -0
  21. package/lib/endpoints/private/api-key/PostApiKeys.d.ts +20 -0
  22. package/lib/endpoints/private/api-key/index.d.ts +3 -0
  23. package/lib/endpoints/private/carrier-options/CarrierOption.types.d.ts +47 -0
  24. package/lib/endpoints/private/carrier-options/DeleteCarrierOptions.d.ts +18 -0
  25. package/lib/endpoints/private/carrier-options/GetCarrierOptions.d.ts +18 -0
  26. package/lib/endpoints/private/carrier-options/PostCarrierOptions.d.ts +20 -0
  27. package/lib/endpoints/private/carrier-options/PutCarrierOptions.d.ts +22 -0
  28. package/lib/endpoints/private/carrier-options/index.d.ts +5 -0
  29. package/lib/endpoints/private/index.d.ts +13 -0
  30. package/lib/endpoints/private/locations/GetLocations.d.ts +15 -0
  31. package/lib/endpoints/private/locations/Location.types.d.ts +9 -0
  32. package/lib/endpoints/private/locations/index.d.ts +2 -0
  33. package/lib/endpoints/private/shipments/GetShipment.d.ts +20 -0
  34. package/lib/endpoints/private/shipments/GetShipments.d.ts +23 -0
  35. package/lib/endpoints/private/shipments/PostShipments.d.ts +24 -0
  36. package/lib/endpoints/private/shipments/Shipment.types.d.ts +175 -0
  37. package/lib/endpoints/private/shipments/index.d.ts +4 -0
  38. package/lib/endpoints/private/shops/GetShop.d.ts +20 -0
  39. package/lib/endpoints/private/shops/PostShop.d.ts +23 -0
  40. package/lib/endpoints/private/shops/PostShopDuplicate.d.ts +24 -0
  41. package/lib/endpoints/private/shops/PutShop.d.ts +17 -0
  42. package/lib/endpoints/private/shops/Shop.types.d.ts +81 -0
  43. package/lib/endpoints/private/shops/index.d.ts +5 -0
  44. package/lib/endpoints/private/subscription-capabilities/GetSubscriptionCapabilities.d.ts +18 -0
  45. package/lib/endpoints/private/subscription-capabilities/SubscriptionCapability.types.d.ts +24 -0
  46. package/lib/endpoints/private/subscription-capabilities/index.d.ts +2 -0
  47. package/lib/endpoints/private/subscriptions/DeleteSubscription.d.ts +17 -0
  48. package/lib/endpoints/private/subscriptions/GetSubscriptions.d.ts +18 -0
  49. package/lib/endpoints/private/subscriptions/PatchSubscriptions.d.ts +20 -0
  50. package/lib/endpoints/private/subscriptions/PostSubscriptions.d.ts +20 -0
  51. package/lib/endpoints/private/subscriptions/Subscriptions.types.d.ts +30 -0
  52. package/lib/endpoints/private/subscriptions/index.d.ts +5 -0
  53. package/lib/endpoints/private/system-country-codes/GetSystemCountryCodes.d.ts +15 -0
  54. package/lib/endpoints/private/system-country-codes/SystemCountryCodes.types.d.ts +11 -0
  55. package/lib/endpoints/private/system-country-codes/index.d.ts +2 -0
  56. package/lib/endpoints/private/system-messages/GetSystemMessages.d.ts +17 -0
  57. package/lib/endpoints/private/system-messages/SystemMessage.types.d.ts +18 -0
  58. package/lib/endpoints/private/system-messages/index.d.ts +2 -0
  59. package/lib/endpoints/private/track-traces/GetTrackAndTraceByShipment.d.ts +17 -0
  60. package/lib/endpoints/private/track-traces/TrackTraces.types.d.ts +51 -0
  61. package/lib/endpoints/private/track-traces/index.d.ts +2 -0
  62. package/lib/endpoints/private/webhook-subscriptions/DeleteWebhookSubscriptions.d.ts +17 -0
  63. package/lib/endpoints/private/webhook-subscriptions/GetWebhookSubscriptions.d.ts +15 -0
  64. package/lib/endpoints/private/webhook-subscriptions/PostWebhookSubscriptions.d.ts +20 -0
  65. package/lib/endpoints/private/webhook-subscriptions/Webhook.types.d.ts +13 -0
  66. package/lib/endpoints/private/webhook-subscriptions/index.d.ts +4 -0
  67. package/lib/endpoints/public/carriers/Carrier.types.d.ts +11 -0
  68. package/lib/endpoints/public/carriers/GetCarrier.d.ts +20 -0
  69. package/lib/endpoints/public/carriers/GetCarriers.d.ts +16 -0
  70. package/lib/endpoints/public/carriers/index.d.ts +3 -0
  71. package/lib/endpoints/public/delivery-options/DeliveryOption.types.d.ts +22 -0
  72. package/lib/endpoints/public/delivery-options/GetDeliveryOptions.d.ts +50 -0
  73. package/lib/endpoints/public/delivery-options/index.d.ts +2 -0
  74. package/lib/endpoints/public/index.d.ts +3 -0
  75. package/lib/endpoints/public/pickup-locations/GetPickupLocations.d.ts +18 -0
  76. package/lib/endpoints/public/pickup-locations/PickupLocation.types.d.ts +32 -0
  77. package/lib/endpoints/public/pickup-locations/index.d.ts +2 -0
  78. package/lib/index.cjs +1 -0
  79. package/lib/index.d.ts +6 -0
  80. package/lib/index.js +660 -0
  81. package/lib/index.spec.d.ts +1 -0
  82. package/lib/model/client/AbstractClient.d.ts +89 -0
  83. package/lib/model/client/AbstractClient.spec.d.ts +1 -0
  84. package/lib/model/client/AbstractClient.types.d.ts +55 -0
  85. package/lib/model/client/FetchClient.d.ts +7 -0
  86. package/lib/model/client/helper/addParameters.d.ts +4 -0
  87. package/lib/model/client/helper/addParameters.spec.d.ts +1 -0
  88. package/lib/model/client/helper/index.d.ts +2 -0
  89. package/lib/model/client/helper/isJson.d.ts +1 -0
  90. package/lib/model/client/helper/isJson.spec.d.ts +1 -0
  91. package/lib/model/client/index.d.ts +4 -0
  92. package/lib/model/client/middleware/Interceptors.d.ts +8 -0
  93. package/lib/model/client/middleware/Interceptors.unit.spec.d.ts +1 -0
  94. package/lib/model/client/middleware/middleware.types.d.ts +1 -0
  95. package/lib/model/endpoint/AbstractEndpoint.d.ts +57 -0
  96. package/lib/model/endpoint/AbstractEndpoint.types.d.ts +21 -0
  97. package/lib/model/endpoint/AbstractPrivateEndpoint.d.ts +14 -0
  98. package/lib/model/endpoint/AbstractPublicEndpoint.d.ts +6 -0
  99. package/lib/model/endpoint/index.d.ts +4 -0
  100. package/lib/model/exception/ApiException.d.ts +6 -0
  101. package/lib/model/exception/UserException.d.ts +4 -0
  102. package/lib/model/exception/index.d.ts +2 -0
  103. package/lib/model/index.d.ts +3 -0
  104. package/lib/types/common.types.d.ts +31 -0
  105. package/lib/types/data.types.d.ts +23 -0
  106. package/lib/types/global.types.d.ts +4 -0
  107. package/lib/types/index.d.ts +4 -0
  108. package/lib/types/request.types.d.ts +18 -0
  109. package/package.json +79 -0
package/lib/index.js ADDED
@@ -0,0 +1,660 @@
1
+ var T = Object.defineProperty;
2
+ var O = (s, t, r) => t in s ? T(s, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[t] = r;
3
+ var e = (s, t, r) => O(s, typeof t != "symbol" ? t + "" : t, r);
4
+ function u(s, t) {
5
+ return (s == null ? void 0 : s[t]) !== void 0;
6
+ }
7
+ class P {
8
+ constructor() {
9
+ e(this, "fns");
10
+ this.fns = [];
11
+ }
12
+ delete(t) {
13
+ const r = this.fns.indexOf(t);
14
+ r !== -1 && (this.fns = [...this.fns.slice(0, r), ...this.fns.slice(r + 1)]);
15
+ }
16
+ use(t) {
17
+ this.fns = [...this.fns, t];
18
+ }
19
+ }
20
+ class h extends Error {
21
+ constructor(r) {
22
+ super(r);
23
+ e(this, "name", "user");
24
+ Object.setPrototypeOf(this, h.prototype), this.name = "UserException";
25
+ }
26
+ }
27
+ class y extends Error {
28
+ constructor(r) {
29
+ super(r.message);
30
+ e(this, "data");
31
+ Object.setPrototypeOf(this, y.prototype), this.name = "ApiException", this.data = r;
32
+ }
33
+ }
34
+ const _ = (s, t) => {
35
+ if (t) {
36
+ const r = Object.entries(t).map(([a, i]) => `${a}=${i}`);
37
+ r.length && (s += `?${r.join("&")}`);
38
+ }
39
+ return s;
40
+ }, C = "https://api.myparcel.nl", A = ["POST", "PUT"];
41
+ class k {
42
+ constructor(t) {
43
+ /**
44
+ * Interceptors for request and response.
45
+ *
46
+ * @protected
47
+ */
48
+ e(this, "interceptors");
49
+ /**
50
+ * Base URL to make requests to.
51
+ *
52
+ * @protected
53
+ */
54
+ e(this, "baseUrl");
55
+ /**
56
+ * Headers to use with requests.
57
+ *
58
+ * @protected
59
+ */
60
+ e(this, "headers");
61
+ /**
62
+ * @protected
63
+ */
64
+ e(this, "parameters");
65
+ /**
66
+ * Additional client specific options.
67
+ *
68
+ * @protected
69
+ */
70
+ e(this, "options");
71
+ /**
72
+ * Array of headers that are required. Client will throw an error if any are missing.
73
+ *
74
+ * @private
75
+ */
76
+ e(this, "_requiredHeaders", []);
77
+ this.baseUrl = ((t == null ? void 0 : t.baseUrl) ?? C).replace(/\/+$/, ""), this.headers = (t == null ? void 0 : t.headers) ?? {}, this.parameters = (t == null ? void 0 : t.parameters) ?? {}, this.options = (t == null ? void 0 : t.options) ?? {}, this.interceptors = {
78
+ request: new P(),
79
+ response: new P()
80
+ };
81
+ }
82
+ get requiredHeaders() {
83
+ return this._requiredHeaders;
84
+ }
85
+ set requiredHeaders(t) {
86
+ this._requiredHeaders = t;
87
+ }
88
+ /**
89
+ * Prepare and execute the final request and handle the response.
90
+ */
91
+ async doRequest(t, r) {
92
+ const a = this.normalizeOptions(t, { ...r, ...this.options });
93
+ this.validateHeaders(t, a);
94
+ let i = await this.request(t, a);
95
+ for (const n of this.interceptors.response.fns)
96
+ i = await n(i);
97
+ if (u(i, "errors"))
98
+ throw new y(i);
99
+ return this.getResponseBody(t, i);
100
+ }
101
+ getResponseBody(t, r) {
102
+ if (!u(r, "data"))
103
+ return r;
104
+ const a = t.getResponseProperty();
105
+ if (!a)
106
+ return r.data;
107
+ const { page: i, size: n, results: p } = r.data;
108
+ return i === void 0 && n === void 0 && p === void 0 ? r.data[a] : {
109
+ [a]: r.data[a],
110
+ ...i !== void 0 && { page: i },
111
+ ...n !== void 0 && { size: n },
112
+ ...p !== void 0 && { results: p }
113
+ };
114
+ }
115
+ /**
116
+ * Gets default and custom headers.
117
+ *
118
+ * @protected
119
+ */
120
+ getHeaders() {
121
+ return {
122
+ Accept: "application/json",
123
+ ...this.headers
124
+ };
125
+ }
126
+ /**
127
+ * Uses the base url, endpoint and options to create the final request url.
128
+ *
129
+ * @protected
130
+ */
131
+ createUrl(t, r) {
132
+ let a = t.getPath();
133
+ if (a.length && !a.startsWith("/") && (a = `/${a}`), r != null && r.path && (a = this.substitutePath(a, r.path)), a.includes("/:"))
134
+ throw new h(`One or more path variables are missing in ${a}`);
135
+ return r != null && r.parameters && (a = _(a, r.parameters)), this.baseUrl + a;
136
+ }
137
+ /**
138
+ * Replace path variables in an url path. Deletes optional parameters if
139
+ * they're not passed.
140
+ *
141
+ * @protected
142
+ */
143
+ substitutePath(t, r) {
144
+ if (r && Object.entries(r).forEach(([a, i]) => {
145
+ t = t.replace(`:${a}`, String(i));
146
+ }), t.includes(":")) {
147
+ const a = t.match(/:\w+?\?/g);
148
+ a == null || a.forEach((i) => {
149
+ t = t.replace(`/${i}`, "");
150
+ });
151
+ }
152
+ return t;
153
+ }
154
+ /**
155
+ * Validates headers passed in options.
156
+ *
157
+ * @protected
158
+ */
159
+ validateHeaders(t, r) {
160
+ const a = Object.entries(r.headers).reduce(
161
+ (n, [p, d]) => ({
162
+ ...n,
163
+ [p.toLowerCase()]: d
164
+ }),
165
+ {}
166
+ ), i = this.requiredHeaders.filter((n) => !(n.toLowerCase() in a));
167
+ if (i.length)
168
+ throw new h(`Required headers are missing: ${i.join(", ")}`);
169
+ }
170
+ /**
171
+ * Executes transformations on options before request.
172
+ *
173
+ * @protected
174
+ */
175
+ normalizeOptions(t, r) {
176
+ const a = {
177
+ ...r,
178
+ parameters: {
179
+ ...this.parameters,
180
+ ...r.parameters,
181
+ ...t.getParameters()
182
+ },
183
+ headers: {
184
+ ...A.includes(t.method) ? { "Content-Type": "application/json" } : {},
185
+ ...this.getHeaders(),
186
+ ...r.headers,
187
+ ...t.getHeaders()
188
+ }
189
+ };
190
+ if (u(r, "body")) {
191
+ const i = t.getProperty();
192
+ if (r.body instanceof FormData)
193
+ return a.body = r.body, delete a.headers["Content-Type"], a;
194
+ i === void 0 ? a.body = {
195
+ data: r.body
196
+ } : a.body = {
197
+ data: { [i]: r.body }
198
+ };
199
+ }
200
+ return a;
201
+ }
202
+ }
203
+ const w = (s) => {
204
+ try {
205
+ return JSON.parse(s), !0;
206
+ } catch {
207
+ return !1;
208
+ }
209
+ };
210
+ class H extends k {
211
+ constructor(r) {
212
+ super(r);
213
+ e(this, "request", async (r, a) => {
214
+ var b, g, S;
215
+ for (const c of this.interceptors.request.fns)
216
+ a = await c(a);
217
+ const i = r.getTimeout() ?? a.timeout, n = new AbortController(), p = {
218
+ method: r.method,
219
+ headers: a.headers,
220
+ signal: n.signal
221
+ };
222
+ let d;
223
+ i && (d = setTimeout(() => {
224
+ n.abort();
225
+ }, i)), u(a, "body") && (a.body instanceof FormData ? p.body = a.body : p.body = JSON.stringify(a.body));
226
+ try {
227
+ const c = await fetch(this.createUrl(r, a), p);
228
+ if (c.body) {
229
+ if ((b = c.headers.get("Content-Disposition")) != null && b.includes("attachment") || (g = c.headers.get("Content-Type")) != null && g.includes("application/pdf"))
230
+ return c.blob();
231
+ const l = await c.text();
232
+ return (S = c.headers.get("Content-Type")) != null && S.includes("application/json") && w(l) ? JSON.parse(l) : l;
233
+ }
234
+ } finally {
235
+ d && clearTimeout(d);
236
+ }
237
+ });
238
+ }
239
+ }
240
+ class x {
241
+ constructor(t) {
242
+ /**
243
+ * HTTP method.
244
+ */
245
+ e(this, "method", "GET");
246
+ /**
247
+ * The property in the request body and response body. If the response body
248
+ * property differs, set responseProperty alongside property.
249
+ * If the property is undefined, the endpoint will be called without a namespace.
250
+ */
251
+ e(this, "property");
252
+ /**
253
+ * Property used in the response. Falls back to `this.property` if it's not
254
+ * set.
255
+ */
256
+ e(this, "responseProperty");
257
+ /**
258
+ * Timeout in milliseconds.
259
+ * This is used to override the default timeout of the client.
260
+ */
261
+ e(this, "timeout");
262
+ /**
263
+ * Headers to include when calling this endpoint.
264
+ */
265
+ e(this, "headers");
266
+ /**
267
+ * Parameters to include in the endpoint url.
268
+ */
269
+ e(this, "parameters");
270
+ this.headers = (t == null ? void 0 : t.headers) ?? {}, this.parameters = (t == null ? void 0 : t.parameters) ?? {};
271
+ }
272
+ getHeaders() {
273
+ return this.headers;
274
+ }
275
+ getParameters() {
276
+ return this.parameters;
277
+ }
278
+ getPath() {
279
+ return this.path;
280
+ }
281
+ getProperty() {
282
+ return this.property;
283
+ }
284
+ getResponseProperty() {
285
+ return this.responseProperty ?? this.property;
286
+ }
287
+ getTimeout() {
288
+ return this.timeout;
289
+ }
290
+ }
291
+ class o extends x {
292
+ }
293
+ class m extends x {
294
+ }
295
+ function f(s, t) {
296
+ if (!t.length)
297
+ throw new h("At least one endpoint must be passed.");
298
+ return {
299
+ ...t.reduce(
300
+ (r, a) => ({
301
+ ...r,
302
+ [a.name]: async (i) => s.doRequest(a, i ?? {})
303
+ }),
304
+ {}
305
+ ),
306
+ client: s
307
+ };
308
+ }
309
+ const G = (s, t) => (s.requiredHeaders = ["Authorization"], f(s, t)), v = (s, t) => f(s, t);
310
+ class D extends o {
311
+ constructor() {
312
+ super(...arguments);
313
+ e(this, "method", "DELETE");
314
+ e(this, "name", "deleteAccountMessage");
315
+ e(this, "path", "account_messages/:id");
316
+ e(this, "property", "messages");
317
+ }
318
+ }
319
+ class q extends o {
320
+ constructor() {
321
+ super(...arguments);
322
+ e(this, "name", "getAccountMessages");
323
+ e(this, "path", "account_messages");
324
+ e(this, "property", "messages");
325
+ }
326
+ }
327
+ class j extends o {
328
+ constructor() {
329
+ super(...arguments);
330
+ e(this, "name", "getAccount");
331
+ e(this, "path", "accounts/:id");
332
+ e(this, "property", "accounts");
333
+ }
334
+ }
335
+ class U extends o {
336
+ constructor() {
337
+ super(...arguments);
338
+ e(this, "name", "getAccounts");
339
+ e(this, "path", "accounts");
340
+ e(this, "property", "accounts");
341
+ }
342
+ }
343
+ class L extends o {
344
+ constructor() {
345
+ super(...arguments);
346
+ e(this, "method", "PUT");
347
+ e(this, "name", "putAccount");
348
+ e(this, "path", "accounts");
349
+ e(this, "property", "accounts");
350
+ }
351
+ }
352
+ class $ extends o {
353
+ constructor() {
354
+ super(...arguments);
355
+ e(this, "name", "getApiKeys");
356
+ e(this, "path", "keys");
357
+ e(this, "property", "api_keys");
358
+ }
359
+ }
360
+ class M extends o {
361
+ constructor() {
362
+ super(...arguments);
363
+ e(this, "method", "POST");
364
+ e(this, "name", "postApiKeys");
365
+ e(this, "path", "keys");
366
+ e(this, "property", "api_keys");
367
+ }
368
+ }
369
+ class R extends o {
370
+ constructor() {
371
+ super(...arguments);
372
+ e(this, "method", "DELETE");
373
+ e(this, "name", "deleteCarrierOption");
374
+ e(this, "path", "accounts/:account_id/carrier_options/:contract_id");
375
+ e(this, "property", "carrier_options");
376
+ }
377
+ }
378
+ class W extends o {
379
+ constructor() {
380
+ super(...arguments);
381
+ e(this, "name", "getCarrierOptions");
382
+ e(this, "path", "carrier_management/accounts/:account_id/carrier_options");
383
+ e(this, "property", "carrier_options");
384
+ }
385
+ }
386
+ class N extends o {
387
+ constructor() {
388
+ super(...arguments);
389
+ e(this, "method", "POST");
390
+ e(this, "name", "postCarrierOptions");
391
+ e(this, "path", "accounts/:account_id/carrier_options");
392
+ e(this, "property", "carrier_options");
393
+ e(this, "responseProperty", "ids");
394
+ }
395
+ }
396
+ class z extends o {
397
+ constructor() {
398
+ super(...arguments);
399
+ e(this, "name", "putCarrierOptions");
400
+ e(this, "path", "carrier_management/accounts/:account_id/carrier_options");
401
+ e(this, "property", "carrier_options");
402
+ e(this, "method", "PUT");
403
+ }
404
+ }
405
+ class J extends o {
406
+ constructor() {
407
+ super(...arguments);
408
+ e(this, "name", "getLocations");
409
+ e(this, "path", "locations");
410
+ e(this, "property", "locations");
411
+ }
412
+ }
413
+ class K extends o {
414
+ constructor() {
415
+ super(...arguments);
416
+ e(this, "name", "getShipment");
417
+ e(this, "path", "shipments/:id");
418
+ e(this, "property", "shipments");
419
+ }
420
+ }
421
+ class B extends o {
422
+ constructor() {
423
+ super(...arguments);
424
+ e(this, "name", "getShipments");
425
+ e(this, "path", "shipments");
426
+ e(this, "property", "shipments");
427
+ }
428
+ }
429
+ class F extends o {
430
+ constructor() {
431
+ super(...arguments);
432
+ e(this, "method", "POST");
433
+ e(this, "name", "postShipments");
434
+ e(this, "path", "shipments");
435
+ e(this, "property", "shipments");
436
+ e(this, "responseProperty", "ids");
437
+ }
438
+ getHeaders() {
439
+ return {
440
+ ...super.getHeaders(),
441
+ "Content-Type": "application/vnd.shipment+json;charset=utf-8;version=1.1"
442
+ };
443
+ }
444
+ }
445
+ class I extends o {
446
+ constructor() {
447
+ super(...arguments);
448
+ e(this, "name", "getShop");
449
+ e(this, "path", "shops/:id");
450
+ e(this, "property", "shops");
451
+ }
452
+ }
453
+ class Q extends o {
454
+ constructor() {
455
+ super(...arguments);
456
+ e(this, "method", "POST");
457
+ e(this, "name", "postShop");
458
+ e(this, "path", "shops/duplicate");
459
+ e(this, "property", "shops");
460
+ e(this, "responseProperty", "ids");
461
+ }
462
+ }
463
+ class X extends o {
464
+ constructor() {
465
+ super(...arguments);
466
+ e(this, "method", "POST");
467
+ e(this, "name", "postShopDuplicate");
468
+ e(this, "path", "shops/duplicate");
469
+ e(this, "property", "ids");
470
+ }
471
+ }
472
+ class Y extends o {
473
+ constructor() {
474
+ super(...arguments);
475
+ e(this, "method", "PUT");
476
+ e(this, "name", "putShop");
477
+ e(this, "path", "shops");
478
+ e(this, "property", "shops");
479
+ }
480
+ }
481
+ class Z extends o {
482
+ constructor() {
483
+ super(...arguments);
484
+ e(this, "name", "getSubscriptionsCapabilities");
485
+ e(this, "path", "subscriptions/capabilities");
486
+ e(this, "property", "capabilities");
487
+ }
488
+ }
489
+ class V extends o {
490
+ constructor() {
491
+ super(...arguments);
492
+ e(this, "method", "DELETE");
493
+ e(this, "name", "deleteSubscription");
494
+ e(this, "path", "subscriptions/:id");
495
+ e(this, "property", "subscriptions");
496
+ }
497
+ }
498
+ class ee extends o {
499
+ constructor() {
500
+ super(...arguments);
501
+ e(this, "name", "getSubscriptions");
502
+ e(this, "path", "subscriptions");
503
+ e(this, "property", "subscriptions");
504
+ }
505
+ }
506
+ class te extends o {
507
+ constructor() {
508
+ super(...arguments);
509
+ e(this, "method", "PATCH");
510
+ e(this, "name", "patchSubscriptions");
511
+ e(this, "path", "subscriptions");
512
+ e(this, "property", "subscriptions");
513
+ e(this, "responseProperty", "ids");
514
+ }
515
+ }
516
+ class se extends o {
517
+ constructor() {
518
+ super(...arguments);
519
+ e(this, "method", "POST");
520
+ e(this, "name", "postSubscriptions");
521
+ e(this, "path", "subscriptions");
522
+ e(this, "property", "subscriptions");
523
+ e(this, "responseProperty", "ids");
524
+ }
525
+ }
526
+ class re extends o {
527
+ constructor() {
528
+ super(...arguments);
529
+ e(this, "name", "getSystemCountryCodes");
530
+ e(this, "path", "system_country_codes");
531
+ e(this, "property", "countries");
532
+ }
533
+ }
534
+ class ae extends o {
535
+ constructor() {
536
+ super(...arguments);
537
+ e(this, "name", "getSystemMessages");
538
+ e(this, "path", "system_messages");
539
+ e(this, "property", "messages");
540
+ }
541
+ }
542
+ class oe extends o {
543
+ constructor() {
544
+ super(...arguments);
545
+ e(this, "name", "getTrackAndTrace");
546
+ e(this, "path", "tracktraces/:shipment_id");
547
+ e(this, "property", "tracktraces");
548
+ }
549
+ }
550
+ class ie extends o {
551
+ constructor() {
552
+ super(...arguments);
553
+ e(this, "method", "DELETE");
554
+ e(this, "name", "deleteWebhookSubscriptions");
555
+ e(this, "path", "webhook_subscriptions/:ids");
556
+ e(this, "property", "webhook_subscriptions");
557
+ }
558
+ }
559
+ class ne extends o {
560
+ constructor() {
561
+ super(...arguments);
562
+ e(this, "name", "getWebhookSubscriptions");
563
+ e(this, "path", "webhook_subscriptions");
564
+ e(this, "property", "webhook_subscriptions");
565
+ }
566
+ }
567
+ class pe extends o {
568
+ constructor() {
569
+ super(...arguments);
570
+ e(this, "method", "POST");
571
+ e(this, "name", "postWebhookSubscriptions");
572
+ e(this, "path", "webhook_subscriptions");
573
+ e(this, "property", "webhook_subscriptions");
574
+ e(this, "responseProperty", "ids");
575
+ }
576
+ }
577
+ class ce extends m {
578
+ constructor() {
579
+ super(...arguments);
580
+ e(this, "name", "getCarrier");
581
+ e(this, "path", "carriers/:carrier");
582
+ e(this, "property", "carriers");
583
+ }
584
+ }
585
+ class de extends m {
586
+ constructor() {
587
+ super(...arguments);
588
+ e(this, "name", "getCarriers");
589
+ e(this, "path", "carriers");
590
+ e(this, "property", "carriers");
591
+ }
592
+ }
593
+ class he extends m {
594
+ constructor() {
595
+ super(...arguments);
596
+ e(this, "name", "getDeliveryOptions");
597
+ e(this, "path", "delivery_options");
598
+ e(this, "property", "deliveries");
599
+ }
600
+ getHeaders() {
601
+ return { ...super.getHeaders(), Accept: "application/json;version=2.0" };
602
+ }
603
+ }
604
+ class ue extends m {
605
+ constructor() {
606
+ super(...arguments);
607
+ e(this, "name", "getPickupLocations");
608
+ e(this, "path", "pickup_locations");
609
+ e(this, "property", "pickup_locations");
610
+ }
611
+ }
612
+ export {
613
+ k as AbstractClient,
614
+ x as AbstractEndpoint,
615
+ o as AbstractPrivateEndpoint,
616
+ m as AbstractPublicEndpoint,
617
+ y as ApiException,
618
+ C as BASE_URL,
619
+ D as DeleteAccountMessage,
620
+ R as DeleteCarrierOptions,
621
+ V as DeleteSubscription,
622
+ ie as DeleteWebhookSubscriptions,
623
+ H as FetchClient,
624
+ j as GetAccount,
625
+ q as GetAccountMessages,
626
+ U as GetAccounts,
627
+ $ as GetApiKeys,
628
+ ce as GetCarrier,
629
+ W as GetCarrierOptions,
630
+ de as GetCarriers,
631
+ he as GetDeliveryOptions,
632
+ J as GetLocations,
633
+ ue as GetPickupLocations,
634
+ K as GetShipment,
635
+ B as GetShipments,
636
+ I as GetShop,
637
+ ee as GetSubscriptions,
638
+ Z as GetSubscriptionsCapabilities,
639
+ re as GetSystemCountryCodes,
640
+ ae as GetSystemMessages,
641
+ oe as GetTrackAndTrace,
642
+ ne as GetWebhookSubscriptions,
643
+ te as PatchSubscriptions,
644
+ M as PostApiKeys,
645
+ N as PostCarrierOptions,
646
+ F as PostShipments,
647
+ Q as PostShop,
648
+ X as PostShopDuplicate,
649
+ se as PostSubscriptions,
650
+ pe as PostWebhookSubscriptions,
651
+ L as PutAccount,
652
+ z as PutCarrierOptions,
653
+ Y as PutShop,
654
+ h as UserException,
655
+ _ as addParameters,
656
+ f as createMyParcelSdk,
657
+ G as createPrivateSdk,
658
+ v as createPublicSdk,
659
+ w as isJson
660
+ };
@@ -0,0 +1 @@
1
+ export {};