@pelygo/janus 0.6.3 → 1.0.1
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.d.ts +5093 -679
- package/dist/index.js +517 -160
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,29 +1,53 @@
|
|
|
1
|
-
import { createAuthApi as
|
|
2
|
-
function
|
|
1
|
+
import { createAuthApi as Y } from "@pelygo/auth/core";
|
|
2
|
+
function i(t) {
|
|
3
|
+
if (!t || typeof t != "object") return t;
|
|
4
|
+
const e = t;
|
|
5
|
+
return e.client_id === void 0 && e.clientId !== void 0 && (e.client_id = e.clientId), e.items === void 0 && e.return_items !== void 0 && (e.items = e.return_items), e.comments === void 0 && e.return_comments !== void 0 && (e.comments = e.return_comments), e.statuses === void 0 && e.return_return_statuses !== void 0 && (e.statuses = e.return_return_statuses), t;
|
|
6
|
+
}
|
|
7
|
+
function $(t) {
|
|
8
|
+
return Array.isArray(t) ? t.map(i) : t;
|
|
9
|
+
}
|
|
10
|
+
function y(t) {
|
|
11
|
+
if (!t || typeof t != "object") return t;
|
|
12
|
+
const e = t;
|
|
13
|
+
return e.active === void 0 && e.status !== void 0 && (e.active = e.status), t;
|
|
14
|
+
}
|
|
15
|
+
function m(t) {
|
|
16
|
+
return Array.isArray(t) ? t.map(y) : t;
|
|
17
|
+
}
|
|
18
|
+
function d(t) {
|
|
19
|
+
if (!t || typeof t != "object") return t;
|
|
20
|
+
const e = t;
|
|
21
|
+
return e.active === void 0 && e.status !== void 0 && (e.active = e.status), e.courier_service_id === void 0 && e.courier_service?.id !== void 0 && (e.courier_service_id = e.courier_service.id), e.client_id === void 0 && e.client?.id !== void 0 && (e.client_id = e.client.id), t;
|
|
22
|
+
}
|
|
23
|
+
function ee(t) {
|
|
24
|
+
return Array.isArray(t) ? t.map(d) : t;
|
|
25
|
+
}
|
|
26
|
+
function te(t) {
|
|
3
27
|
return {
|
|
4
28
|
async getAll() {
|
|
5
|
-
return t.get("/clients");
|
|
29
|
+
return t.get("/clients").then(m);
|
|
6
30
|
},
|
|
7
31
|
async getWithActiveIntegrations() {
|
|
8
|
-
return t.get("/clients/activeIntegrations");
|
|
32
|
+
return t.get("/clients/activeIntegrations").then(m);
|
|
9
33
|
},
|
|
10
34
|
async previewNotification(e, r) {
|
|
11
35
|
return t.get(`/clients/preview-notification?type=${encodeURIComponent(e)}&client_id=${r}`);
|
|
12
36
|
},
|
|
13
37
|
async getById(e) {
|
|
14
|
-
return t.get(`/clients/${e}`);
|
|
38
|
+
return t.get(`/clients/${e}`).then(y);
|
|
15
39
|
},
|
|
16
40
|
async getByIdMinimal(e) {
|
|
17
|
-
return t.get(`/clients/${e}?type=m`);
|
|
41
|
+
return t.get(`/clients/${e}?type=m`).then(y);
|
|
18
42
|
},
|
|
19
43
|
async create(e) {
|
|
20
|
-
return t.post("/clients", e);
|
|
44
|
+
return t.post("/clients", e).then(y);
|
|
21
45
|
},
|
|
22
46
|
async replace(e, r) {
|
|
23
|
-
return t.put(`/clients/${e}`, r);
|
|
47
|
+
return t.put(`/clients/${e}`, r).then(y);
|
|
24
48
|
},
|
|
25
49
|
async update(e, r) {
|
|
26
|
-
return t.patch(`/clients/${e}`, r);
|
|
50
|
+
return t.patch(`/clients/${e}`, r).then(y);
|
|
27
51
|
},
|
|
28
52
|
async getReturnReasons(e) {
|
|
29
53
|
return t.get(`/clients/${e}/returnreasons`);
|
|
@@ -42,18 +66,18 @@ function P(t) {
|
|
|
42
66
|
return t.delete(`/clients/${e}/returnreasons/${r}`);
|
|
43
67
|
},
|
|
44
68
|
async getCourierServices(e) {
|
|
45
|
-
return t.get(`/clients/${e}/courierservices`);
|
|
69
|
+
return t.get(`/clients/${e}/courierservices`).then(ee);
|
|
46
70
|
},
|
|
47
71
|
async getCourierServiceById(e, r) {
|
|
48
|
-
return t.get(`/clients/${e}/courierservices/${r}`);
|
|
72
|
+
return t.get(`/clients/${e}/courierservices/${r}`).then(d);
|
|
49
73
|
},
|
|
50
74
|
async addCourierService(e, r) {
|
|
51
|
-
return t.post(`/clients/${e}/courierservices`, r);
|
|
75
|
+
return t.post(`/clients/${e}/courierservices`, r).then(d);
|
|
52
76
|
},
|
|
53
77
|
async updateCourierService(e, r) {
|
|
54
78
|
if (!r.id)
|
|
55
79
|
throw new Error("Service ID is required for update");
|
|
56
|
-
return t.patch(`/clients/${e}/courierservices/${r.id}`, r);
|
|
80
|
+
return t.patch(`/clients/${e}/courierservices/${r.id}`, r).then(d);
|
|
57
81
|
},
|
|
58
82
|
async deleteCourierService(e, r) {
|
|
59
83
|
return t.delete(`/clients/${e}/courierservices/${r}`);
|
|
@@ -64,6 +88,9 @@ function P(t) {
|
|
|
64
88
|
async getOrderByRef(e, r) {
|
|
65
89
|
return t.get(`/clients/${e}/orderbyref/${encodeURIComponent(r)}`);
|
|
66
90
|
},
|
|
91
|
+
async getReturns(e) {
|
|
92
|
+
return t.get(`/returns?clientId=${e}`);
|
|
93
|
+
},
|
|
67
94
|
async getFiles(e) {
|
|
68
95
|
return t.get(`/clients/${e}/files`);
|
|
69
96
|
},
|
|
@@ -78,7 +105,7 @@ function P(t) {
|
|
|
78
105
|
}
|
|
79
106
|
};
|
|
80
107
|
}
|
|
81
|
-
function
|
|
108
|
+
function re(t) {
|
|
82
109
|
if (!t)
|
|
83
110
|
return "";
|
|
84
111
|
const e = new URLSearchParams();
|
|
@@ -86,59 +113,59 @@ function b(t) {
|
|
|
86
113
|
n != null && n !== "" && e.append(r, String(n));
|
|
87
114
|
return e.toString();
|
|
88
115
|
}
|
|
89
|
-
function
|
|
116
|
+
function o(t, e) {
|
|
90
117
|
if (!e || Object.keys(e).length === 0)
|
|
91
118
|
return t;
|
|
92
|
-
const r =
|
|
119
|
+
const r = re(e);
|
|
93
120
|
if (!r)
|
|
94
121
|
return t;
|
|
95
122
|
const n = t.includes("?") ? "&" : "?";
|
|
96
123
|
return `${t}${n}${r}`;
|
|
97
124
|
}
|
|
98
|
-
function
|
|
125
|
+
function ne(t) {
|
|
99
126
|
return t.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
|
|
100
127
|
}
|
|
101
|
-
function
|
|
128
|
+
function se(t) {
|
|
102
129
|
const e = {};
|
|
103
130
|
for (const [r, n] of Object.entries(t))
|
|
104
|
-
e[
|
|
131
|
+
e[ne(r)] = n;
|
|
105
132
|
return e;
|
|
106
133
|
}
|
|
107
|
-
function
|
|
134
|
+
function p(t, e) {
|
|
108
135
|
if (!e) return t;
|
|
109
136
|
const r = { pageNumber: 1, ...e };
|
|
110
|
-
return
|
|
137
|
+
return o(t, se(r));
|
|
111
138
|
}
|
|
112
|
-
function
|
|
139
|
+
function c(t, e) {
|
|
113
140
|
if (e.clientId == null)
|
|
114
141
|
throw new Error("clientId is required for this endpoint");
|
|
115
|
-
return
|
|
142
|
+
return p(t, e);
|
|
116
143
|
}
|
|
117
|
-
function
|
|
144
|
+
function ce(t) {
|
|
118
145
|
return {
|
|
119
146
|
// ── Core returns ─────────────────────────────────────────────
|
|
120
147
|
async query(e) {
|
|
121
|
-
const r = e && { page: 1, ...e }, n =
|
|
122
|
-
return t.get(n);
|
|
148
|
+
const r = e && { page: 1, ...e }, n = o("/returns/", r);
|
|
149
|
+
return t.get(n).then($);
|
|
123
150
|
},
|
|
124
151
|
async queryPost(e) {
|
|
125
|
-
return t.post("/returns/query", e);
|
|
152
|
+
return t.post("/returns/query", e).then($);
|
|
126
153
|
},
|
|
127
154
|
async getById(e, r) {
|
|
128
|
-
const n =
|
|
129
|
-
return t.get(n);
|
|
155
|
+
const n = o(`/returns/${e}`, r);
|
|
156
|
+
return t.get(n).then(i);
|
|
130
157
|
},
|
|
131
158
|
async create(e) {
|
|
132
|
-
return t.post("/helpers/returns", e);
|
|
159
|
+
return t.post("/helpers/returns", e).then(i);
|
|
133
160
|
},
|
|
134
161
|
async createDirect(e) {
|
|
135
|
-
return t.post("/returns", e);
|
|
162
|
+
return t.post("/returns", e).then(i);
|
|
136
163
|
},
|
|
137
164
|
async replace(e, r) {
|
|
138
|
-
return t.put(`/returns/${e}`, r);
|
|
165
|
+
return t.put(`/returns/${e}`, r).then(i);
|
|
139
166
|
},
|
|
140
167
|
async update(e, r) {
|
|
141
|
-
return t.patch(`/returns/${e}`, r);
|
|
168
|
+
return t.patch(`/returns/${e}`, r).then(i);
|
|
142
169
|
},
|
|
143
170
|
async delete(e) {
|
|
144
171
|
return t.delete(`/returns/${e}`);
|
|
@@ -266,51 +293,59 @@ function N(t) {
|
|
|
266
293
|
}
|
|
267
294
|
};
|
|
268
295
|
}
|
|
269
|
-
function
|
|
296
|
+
function ue(t) {
|
|
270
297
|
return {
|
|
271
298
|
async returnsSummary(e) {
|
|
272
|
-
const r = e && { page: 1, ...e }, n =
|
|
299
|
+
const r = e && { page: 1, ...e }, n = o("/reports/returns/summary/", r);
|
|
273
300
|
return t.get(n);
|
|
274
301
|
},
|
|
275
302
|
async returnsSummaryCsv(e) {
|
|
276
|
-
const r = { ...e, csv: !0, pageSize: 1e5, page: 1 }, n =
|
|
303
|
+
const r = { ...e, csv: !0, pageSize: 1e5, page: 1 }, n = o("/reports/returns/summary/", r);
|
|
277
304
|
return t.get(n);
|
|
278
305
|
},
|
|
279
306
|
async returnsReasons(e) {
|
|
280
|
-
const r = e && { page: 1, ...e }, n =
|
|
307
|
+
const r = e && { page: 1, ...e }, n = o("/reports/returns/reasons/", r);
|
|
281
308
|
return t.get(n);
|
|
282
309
|
},
|
|
283
310
|
async returnsReasonsCsv(e) {
|
|
284
|
-
const r = { ...e, csv: !0, pageSize: 1e5, page: 1 }, n =
|
|
311
|
+
const r = { ...e, csv: !0, pageSize: 1e5, page: 1 }, n = o("/reports/returns/reasons/", r);
|
|
285
312
|
return t.get(n);
|
|
286
313
|
},
|
|
287
314
|
async returnsOverview(e) {
|
|
288
|
-
const r = e && { page: 1, ...e }, n =
|
|
315
|
+
const r = e && { page: 1, ...e }, n = o("/reports/returns/overview/", r);
|
|
289
316
|
return t.get(n);
|
|
290
317
|
},
|
|
291
318
|
async returnsOverviewCsv(e) {
|
|
292
|
-
const r = { ...e, csv: !0, pageSize: 1e5, page: 1 }, n =
|
|
319
|
+
const r = { ...e, csv: !0, pageSize: 1e5, page: 1 }, n = o("/reports/returns/overview/", r);
|
|
293
320
|
return t.get(n);
|
|
294
321
|
},
|
|
295
322
|
async returnsStats(e) {
|
|
296
323
|
return t.get(`/reports/returns/stats?clientId=${e}`);
|
|
324
|
+
},
|
|
325
|
+
async productSnapshotRolling(e) {
|
|
326
|
+
const r = c("/reports/products/snapshot-rolling", e);
|
|
327
|
+
return t.get(r);
|
|
328
|
+
},
|
|
329
|
+
async productSnapshotWeekly(e) {
|
|
330
|
+
const r = c("/reports/products/snapshot-weekly", e);
|
|
331
|
+
return t.get(r);
|
|
297
332
|
}
|
|
298
333
|
};
|
|
299
334
|
}
|
|
300
|
-
function
|
|
335
|
+
function oe(t) {
|
|
301
336
|
const { baseUrl: e } = t;
|
|
302
337
|
async function r(n, s) {
|
|
303
|
-
const
|
|
338
|
+
const u = await fetch(n, {
|
|
304
339
|
headers: {
|
|
305
340
|
"Content-Type": "application/json"
|
|
306
341
|
},
|
|
307
342
|
...s
|
|
308
343
|
});
|
|
309
|
-
if (!
|
|
310
|
-
const a = await
|
|
311
|
-
throw new Error(`HTTP ${
|
|
344
|
+
if (!u.ok) {
|
|
345
|
+
const a = await u.text().catch(() => "Unknown error");
|
|
346
|
+
throw new Error(`HTTP ${u.status}: ${a}`);
|
|
312
347
|
}
|
|
313
|
-
return
|
|
348
|
+
return u.json();
|
|
314
349
|
}
|
|
315
350
|
return {
|
|
316
351
|
async getClientSettingsByName(n) {
|
|
@@ -323,19 +358,19 @@ function q(t) {
|
|
|
323
358
|
`${e}/helpers/settings/${encodeURIComponent(n)}`
|
|
324
359
|
);
|
|
325
360
|
},
|
|
326
|
-
async customerLogin(n, s,
|
|
361
|
+
async customerLogin(n, s, u) {
|
|
327
362
|
return r(`${e}/helpers/customerlogin`, {
|
|
328
363
|
method: "POST",
|
|
329
364
|
body: JSON.stringify({
|
|
330
365
|
client_id: n,
|
|
331
366
|
order_ref: s,
|
|
332
|
-
postcode:
|
|
367
|
+
postcode: u
|
|
333
368
|
})
|
|
334
369
|
});
|
|
335
370
|
}
|
|
336
371
|
};
|
|
337
372
|
}
|
|
338
|
-
function
|
|
373
|
+
function ae(t) {
|
|
339
374
|
return {
|
|
340
375
|
async getAll() {
|
|
341
376
|
return t.get("/couriers");
|
|
@@ -363,10 +398,10 @@ function J(t) {
|
|
|
363
398
|
}
|
|
364
399
|
};
|
|
365
400
|
}
|
|
366
|
-
function
|
|
401
|
+
function ge(t) {
|
|
367
402
|
return {
|
|
368
403
|
async getAll(e) {
|
|
369
|
-
const r =
|
|
404
|
+
const r = c("/legacy/orders", e);
|
|
370
405
|
return t.get(r);
|
|
371
406
|
},
|
|
372
407
|
async getById(e) {
|
|
@@ -377,29 +412,29 @@ function j(t) {
|
|
|
377
412
|
}
|
|
378
413
|
};
|
|
379
414
|
}
|
|
380
|
-
function
|
|
415
|
+
function ie(t) {
|
|
381
416
|
return {
|
|
382
417
|
async getAll(e) {
|
|
383
|
-
const r = e && { pageNumber: 1, ...e }, n =
|
|
418
|
+
const r = e && { pageNumber: 1, ...e }, n = o("/orders", r);
|
|
384
419
|
return t.get(n);
|
|
385
420
|
},
|
|
386
421
|
async getStats(e) {
|
|
387
|
-
const r =
|
|
422
|
+
const r = o("/orders/stats", e);
|
|
388
423
|
return t.get(r);
|
|
389
424
|
},
|
|
390
425
|
async getReturns(e) {
|
|
391
|
-
const r = e && { pageNumber: 1, ...e }, n =
|
|
426
|
+
const r = e && { pageNumber: 1, ...e }, n = o("/orders/returns", r);
|
|
392
427
|
return t.get(n);
|
|
393
428
|
},
|
|
394
429
|
async getByRef(e, r) {
|
|
395
|
-
const n =
|
|
430
|
+
const n = o(`/orders/${encodeURIComponent(e)}`, r != null ? { clientId: r } : void 0);
|
|
396
431
|
return t.get(n);
|
|
397
432
|
},
|
|
398
433
|
async getReturnFilterOptions(e) {
|
|
399
434
|
return t.get(`/orders/returns/filter-types?clientId=${e}`);
|
|
400
435
|
},
|
|
401
436
|
async getFilterTypes(e) {
|
|
402
|
-
const r =
|
|
437
|
+
const r = o("/orders/filter-types", e != null ? { clientId: e } : void 0);
|
|
403
438
|
return t.get(r);
|
|
404
439
|
},
|
|
405
440
|
async create(e) {
|
|
@@ -410,7 +445,7 @@ function z(t) {
|
|
|
410
445
|
}
|
|
411
446
|
};
|
|
412
447
|
}
|
|
413
|
-
function
|
|
448
|
+
function ye(t) {
|
|
414
449
|
return {
|
|
415
450
|
async getAll() {
|
|
416
451
|
return t.get("/integrations");
|
|
@@ -435,10 +470,10 @@ function W(t) {
|
|
|
435
470
|
}
|
|
436
471
|
};
|
|
437
472
|
}
|
|
438
|
-
function
|
|
473
|
+
function le(t) {
|
|
439
474
|
return {
|
|
440
475
|
async getAll(e) {
|
|
441
|
-
const r =
|
|
476
|
+
const r = p("/users", e);
|
|
442
477
|
return t.get(r);
|
|
443
478
|
},
|
|
444
479
|
async getById(e) {
|
|
@@ -464,7 +499,7 @@ function H(t) {
|
|
|
464
499
|
}
|
|
465
500
|
};
|
|
466
501
|
}
|
|
467
|
-
function
|
|
502
|
+
function de(t) {
|
|
468
503
|
return {
|
|
469
504
|
async createActivity(e) {
|
|
470
505
|
return t.post("/logs/activity", e);
|
|
@@ -474,49 +509,56 @@ function M(t) {
|
|
|
474
509
|
},
|
|
475
510
|
async updateOrderIssue(e) {
|
|
476
511
|
return t.patch("/logs/orderissue", e);
|
|
512
|
+
},
|
|
513
|
+
async getInventory(e) {
|
|
514
|
+
const r = c("/logs/inventory", e);
|
|
515
|
+
return t.get(r);
|
|
516
|
+
},
|
|
517
|
+
async getInventoryById(e) {
|
|
518
|
+
return t.get(`/logs/inventory/${e}`);
|
|
477
519
|
}
|
|
478
520
|
};
|
|
479
521
|
}
|
|
480
|
-
function
|
|
522
|
+
function $e(t) {
|
|
481
523
|
return {
|
|
482
524
|
async getByUuid(e) {
|
|
483
525
|
return t.get(`/tasks/histories/${encodeURIComponent(e)}`);
|
|
484
526
|
},
|
|
485
527
|
async getAll(e) {
|
|
486
|
-
const r =
|
|
528
|
+
const r = o("/tasks/histories", e);
|
|
487
529
|
return t.get(r);
|
|
488
530
|
}
|
|
489
531
|
};
|
|
490
532
|
}
|
|
491
|
-
function
|
|
533
|
+
function me(t) {
|
|
492
534
|
const { baseUrl: e } = t;
|
|
493
|
-
async function r(s,
|
|
535
|
+
async function r(s, u) {
|
|
494
536
|
const a = await fetch(s, {
|
|
495
537
|
headers: { "Content-Type": "application/json" },
|
|
496
|
-
...
|
|
538
|
+
...u
|
|
497
539
|
});
|
|
498
540
|
if (!a.ok) {
|
|
499
|
-
const
|
|
500
|
-
throw new Error(`HTTP ${a.status}: ${
|
|
541
|
+
const l = await a.text().catch(() => "Unknown error");
|
|
542
|
+
throw new Error(`HTTP ${a.status}: ${l}`);
|
|
501
543
|
}
|
|
502
544
|
return a.json();
|
|
503
545
|
}
|
|
504
546
|
async function n(s) {
|
|
505
|
-
const
|
|
506
|
-
if (!
|
|
507
|
-
const a = await
|
|
508
|
-
throw new Error(`HTTP ${
|
|
547
|
+
const u = await fetch(s);
|
|
548
|
+
if (!u.ok) {
|
|
549
|
+
const a = await u.text().catch(() => "Unknown error");
|
|
550
|
+
throw new Error(`HTTP ${u.status}: ${a}`);
|
|
509
551
|
}
|
|
510
|
-
return
|
|
552
|
+
return u.text();
|
|
511
553
|
}
|
|
512
554
|
return {
|
|
513
|
-
async tracking(s,
|
|
514
|
-
const
|
|
555
|
+
async tracking(s, u, a) {
|
|
556
|
+
const l = new URLSearchParams({
|
|
515
557
|
order_ref: s,
|
|
516
|
-
postcode:
|
|
558
|
+
postcode: u,
|
|
517
559
|
client_id: String(a)
|
|
518
560
|
});
|
|
519
|
-
return r(`${e}/customer/tracking?${
|
|
561
|
+
return r(`${e}/customer/tracking?${l}`);
|
|
520
562
|
},
|
|
521
563
|
async track(s) {
|
|
522
564
|
return r(`${e}/customer/track?ref=${encodeURIComponent(s)}`);
|
|
@@ -532,7 +574,7 @@ function G(t) {
|
|
|
532
574
|
}
|
|
533
575
|
};
|
|
534
576
|
}
|
|
535
|
-
function
|
|
577
|
+
function pe(t) {
|
|
536
578
|
return {
|
|
537
579
|
async getCouriers() {
|
|
538
580
|
return t.get("/legacy-couriers");
|
|
@@ -552,10 +594,10 @@ function K(t) {
|
|
|
552
594
|
}
|
|
553
595
|
};
|
|
554
596
|
}
|
|
555
|
-
function
|
|
597
|
+
function he(t) {
|
|
556
598
|
return {
|
|
557
599
|
async getAll(e) {
|
|
558
|
-
const r =
|
|
600
|
+
const r = c("/products", e);
|
|
559
601
|
return t.get(r);
|
|
560
602
|
},
|
|
561
603
|
async getById(e) {
|
|
@@ -569,13 +611,30 @@ function Q(t) {
|
|
|
569
611
|
},
|
|
570
612
|
async delete(e) {
|
|
571
613
|
return t.delete(`/products/${e}`);
|
|
614
|
+
},
|
|
615
|
+
// ── Composites ───────────────────────────────
|
|
616
|
+
async getComposites(e) {
|
|
617
|
+
return t.get(`/products/${e}/composites`).then((r) => r.data);
|
|
618
|
+
},
|
|
619
|
+
async createComposite(e, r) {
|
|
620
|
+
return t.post(`/products/${e}/composites`, r);
|
|
621
|
+
},
|
|
622
|
+
async deleteComposite(e, r) {
|
|
623
|
+
return t.delete(`/products/${e}/composites/${r}`);
|
|
624
|
+
},
|
|
625
|
+
// ── Expiries ─────────────────────────────────
|
|
626
|
+
async getExpiries(e) {
|
|
627
|
+
return t.get(`/products/${e}/expiries`).then((r) => r.data);
|
|
628
|
+
},
|
|
629
|
+
async createExpiry(e, r) {
|
|
630
|
+
return t.post(`/products/${e}/expiries`, r);
|
|
572
631
|
}
|
|
573
632
|
};
|
|
574
633
|
}
|
|
575
|
-
function
|
|
634
|
+
function fe(t) {
|
|
576
635
|
return {
|
|
577
636
|
async getAll(e) {
|
|
578
|
-
const r =
|
|
637
|
+
const r = c("/product-categories", e);
|
|
579
638
|
return t.get(r);
|
|
580
639
|
},
|
|
581
640
|
async getById(e) {
|
|
@@ -592,10 +651,10 @@ function Z(t) {
|
|
|
592
651
|
}
|
|
593
652
|
};
|
|
594
653
|
}
|
|
595
|
-
function
|
|
654
|
+
function ve(t) {
|
|
596
655
|
return {
|
|
597
656
|
async getAll(e) {
|
|
598
|
-
const r =
|
|
657
|
+
const r = c("/stocks", e);
|
|
599
658
|
return t.get(r);
|
|
600
659
|
},
|
|
601
660
|
async getById(e) {
|
|
@@ -612,10 +671,10 @@ function X(t) {
|
|
|
612
671
|
}
|
|
613
672
|
};
|
|
614
673
|
}
|
|
615
|
-
function
|
|
674
|
+
function Re(t) {
|
|
616
675
|
return {
|
|
617
676
|
async getAll(e) {
|
|
618
|
-
const r =
|
|
677
|
+
const r = c("/transactions", e);
|
|
619
678
|
return t.get(r);
|
|
620
679
|
},
|
|
621
680
|
async getById(e) {
|
|
@@ -632,10 +691,10 @@ function Y(t) {
|
|
|
632
691
|
}
|
|
633
692
|
};
|
|
634
693
|
}
|
|
635
|
-
function
|
|
694
|
+
function ke(t) {
|
|
636
695
|
return {
|
|
637
696
|
async getAll(e) {
|
|
638
|
-
const r =
|
|
697
|
+
const r = c("/allocations", e);
|
|
639
698
|
return t.get(r);
|
|
640
699
|
},
|
|
641
700
|
async getById(e) {
|
|
@@ -649,10 +708,10 @@ function ee(t) {
|
|
|
649
708
|
}
|
|
650
709
|
};
|
|
651
710
|
}
|
|
652
|
-
function
|
|
711
|
+
function Ie(t) {
|
|
653
712
|
return {
|
|
654
713
|
async getAll(e) {
|
|
655
|
-
const r =
|
|
714
|
+
const r = c("/locations", e);
|
|
656
715
|
return t.get(r);
|
|
657
716
|
},
|
|
658
717
|
async getById(e) {
|
|
@@ -669,10 +728,10 @@ function te(t) {
|
|
|
669
728
|
}
|
|
670
729
|
};
|
|
671
730
|
}
|
|
672
|
-
function
|
|
731
|
+
function Se(t) {
|
|
673
732
|
return {
|
|
674
733
|
async getAll(e) {
|
|
675
|
-
const r =
|
|
734
|
+
const r = c("/audits", e);
|
|
676
735
|
return t.get(r);
|
|
677
736
|
},
|
|
678
737
|
async getById(e) {
|
|
@@ -680,11 +739,11 @@ function re(t) {
|
|
|
680
739
|
}
|
|
681
740
|
};
|
|
682
741
|
}
|
|
683
|
-
function
|
|
742
|
+
function Ae(t) {
|
|
684
743
|
return {
|
|
685
744
|
// ── ASN CRUD ─────────────────────────────────
|
|
686
745
|
async getAll(e) {
|
|
687
|
-
const r =
|
|
746
|
+
const r = c("/asns", e);
|
|
688
747
|
return t.get(r);
|
|
689
748
|
},
|
|
690
749
|
async getById(e) {
|
|
@@ -701,18 +760,18 @@ function ne(t) {
|
|
|
701
760
|
},
|
|
702
761
|
// ── ASN Lines ────────────────────────────────
|
|
703
762
|
async getLines(e, r) {
|
|
704
|
-
const n =
|
|
763
|
+
const n = c(`/asns/${e}/lines`, r);
|
|
705
764
|
return t.get(n);
|
|
706
765
|
},
|
|
707
766
|
async getLineById(e, r) {
|
|
708
767
|
return t.get(`/asns/${e}/lines/${r}`);
|
|
709
768
|
},
|
|
710
769
|
async createLine(e, r) {
|
|
711
|
-
const { client_id: n, asn_id: s, ...
|
|
770
|
+
const { client_id: n, asn_id: s, ...u } = r;
|
|
712
771
|
return t.post(`/asns/${e}/lines`, {
|
|
713
772
|
client_id: n,
|
|
714
773
|
asn_id: e,
|
|
715
|
-
asn_lines: [
|
|
774
|
+
asn_lines: [u]
|
|
716
775
|
});
|
|
717
776
|
},
|
|
718
777
|
async updateLine(e, r, n) {
|
|
@@ -726,7 +785,7 @@ function ne(t) {
|
|
|
726
785
|
},
|
|
727
786
|
// ── ASN Receipts ─────────────────────────────
|
|
728
787
|
async getReceipts(e, r, n) {
|
|
729
|
-
const s =
|
|
788
|
+
const s = c(`/asns/${e}/lines/${r}/receipts`, n);
|
|
730
789
|
return t.get(s);
|
|
731
790
|
},
|
|
732
791
|
async getReceiptById(e, r, n) {
|
|
@@ -747,10 +806,10 @@ function ne(t) {
|
|
|
747
806
|
}
|
|
748
807
|
};
|
|
749
808
|
}
|
|
750
|
-
function
|
|
809
|
+
function we(t) {
|
|
751
810
|
return {
|
|
752
811
|
async getAll(e) {
|
|
753
|
-
const r =
|
|
812
|
+
const r = c("/dispatches", e);
|
|
754
813
|
return t.get(r);
|
|
755
814
|
},
|
|
756
815
|
async getById(e) {
|
|
@@ -764,10 +823,22 @@ function se(t) {
|
|
|
764
823
|
},
|
|
765
824
|
async delete(e) {
|
|
766
825
|
return t.delete(`/dispatches/${e}`);
|
|
826
|
+
},
|
|
827
|
+
async getStatuses() {
|
|
828
|
+
return t.get("/dispatches/statuses").then((e) => e.data);
|
|
829
|
+
},
|
|
830
|
+
async getFees(e) {
|
|
831
|
+
return t.get(`/dispatches/${e}/fees`).then((r) => r.data);
|
|
832
|
+
},
|
|
833
|
+
async getPackaging(e) {
|
|
834
|
+
return t.get(`/dispatches/${e}/packaging`).then((r) => r.data);
|
|
835
|
+
},
|
|
836
|
+
async getVariables(e) {
|
|
837
|
+
return t.get(`/dispatches/${e}/variables`).then((r) => r.data);
|
|
767
838
|
}
|
|
768
839
|
};
|
|
769
840
|
}
|
|
770
|
-
function
|
|
841
|
+
function Ce(t) {
|
|
771
842
|
return {
|
|
772
843
|
async getByDispatchId(e) {
|
|
773
844
|
return t.get(`/consignments/${e}`);
|
|
@@ -780,14 +851,29 @@ function ce(t) {
|
|
|
780
851
|
},
|
|
781
852
|
async delete(e) {
|
|
782
853
|
return t.delete(`/consignments/${e}`);
|
|
854
|
+
},
|
|
855
|
+
async getPackages(e) {
|
|
856
|
+
return t.get(`/consignments/${e}/packages`).then((r) => r.data);
|
|
857
|
+
},
|
|
858
|
+
async getPackageById(e, r) {
|
|
859
|
+
return t.get(`/consignments/${e}/packages/${r}`);
|
|
860
|
+
},
|
|
861
|
+
async createPackage(e, r) {
|
|
862
|
+
return t.post(`/consignments/${e}/packages`, r);
|
|
863
|
+
},
|
|
864
|
+
async updatePackage(e, r, n) {
|
|
865
|
+
return t.put(`/consignments/${e}/packages/${r}`, n);
|
|
866
|
+
},
|
|
867
|
+
async deletePackage(e, r) {
|
|
868
|
+
return t.delete(`/consignments/${e}/packages/${r}`);
|
|
783
869
|
}
|
|
784
870
|
};
|
|
785
871
|
}
|
|
786
|
-
function
|
|
872
|
+
function Be(t) {
|
|
787
873
|
return {
|
|
788
874
|
// ── Invoice CRUD ────────────────────────────────────────────
|
|
789
875
|
async getAll(e) {
|
|
790
|
-
const r =
|
|
876
|
+
const r = c("/invoices", e);
|
|
791
877
|
return t.get(r);
|
|
792
878
|
},
|
|
793
879
|
async getById(e) {
|
|
@@ -804,18 +890,18 @@ function ue(t) {
|
|
|
804
890
|
},
|
|
805
891
|
// ── Invoice Lines ───────────────────────────────────────────
|
|
806
892
|
async getLines(e, r) {
|
|
807
|
-
const n =
|
|
893
|
+
const n = c(`/invoices/${e}/lines`, r);
|
|
808
894
|
return t.get(n);
|
|
809
895
|
},
|
|
810
896
|
async getLineById(e, r) {
|
|
811
897
|
return t.get(`/invoices/${e}/lines/${r}`);
|
|
812
898
|
},
|
|
813
899
|
async createLine(e, r) {
|
|
814
|
-
const { client_id: n, invoice_id: s, ...
|
|
900
|
+
const { client_id: n, invoice_id: s, ...u } = r;
|
|
815
901
|
return t.post(`/invoices/${e}/lines`, {
|
|
816
902
|
client_id: n,
|
|
817
903
|
invoice_id: e,
|
|
818
|
-
invoice_lines: [{ ...
|
|
904
|
+
invoice_lines: [{ ...u, invoice_id: e }]
|
|
819
905
|
});
|
|
820
906
|
},
|
|
821
907
|
async updateLine(e, r, n) {
|
|
@@ -829,16 +915,272 @@ function ue(t) {
|
|
|
829
915
|
}
|
|
830
916
|
};
|
|
831
917
|
}
|
|
832
|
-
|
|
918
|
+
function _e(t) {
|
|
919
|
+
return {
|
|
920
|
+
async getAll(e) {
|
|
921
|
+
const r = c("/legacy/deliveries", e);
|
|
922
|
+
return t.get(r);
|
|
923
|
+
},
|
|
924
|
+
async getById(e) {
|
|
925
|
+
return t.get(`/legacy/deliveries/${e}`);
|
|
926
|
+
},
|
|
927
|
+
async create(e) {
|
|
928
|
+
return t.post("/legacy/deliveries", e);
|
|
929
|
+
},
|
|
930
|
+
async update(e, r) {
|
|
931
|
+
return t.put(`/legacy/deliveries/${e}`, r);
|
|
932
|
+
},
|
|
933
|
+
async delete(e) {
|
|
934
|
+
return t.delete(`/legacy/deliveries/${e}`);
|
|
935
|
+
},
|
|
936
|
+
async getItems(e) {
|
|
937
|
+
return t.get(`/legacy/deliveries/${e}/items`);
|
|
938
|
+
},
|
|
939
|
+
async getItemById(e, r) {
|
|
940
|
+
return t.get(`/legacy/deliveries/${e}/items/${r}`);
|
|
941
|
+
},
|
|
942
|
+
async createItem(e, r) {
|
|
943
|
+
return t.post(`/legacy/deliveries/${e}/items`, r);
|
|
944
|
+
},
|
|
945
|
+
async updateItem(e, r, n) {
|
|
946
|
+
return t.put(`/legacy/deliveries/${e}/items/${r}`, n);
|
|
947
|
+
},
|
|
948
|
+
async deleteItem(e, r) {
|
|
949
|
+
return t.delete(`/legacy/deliveries/${e}/items/${r}`);
|
|
950
|
+
},
|
|
951
|
+
async getShipments(e) {
|
|
952
|
+
return t.get(`/legacy/deliveries/${e}/shipments`);
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
function Ee(t) {
|
|
957
|
+
return {
|
|
958
|
+
async getAll(e) {
|
|
959
|
+
const r = c("/legacy/suppliers", e);
|
|
960
|
+
return t.get(r);
|
|
961
|
+
},
|
|
962
|
+
async getById(e) {
|
|
963
|
+
return t.get(`/legacy/suppliers/${e}`);
|
|
964
|
+
},
|
|
965
|
+
async create(e) {
|
|
966
|
+
return t.post("/legacy/suppliers", e);
|
|
967
|
+
},
|
|
968
|
+
async update(e, r) {
|
|
969
|
+
return t.put(`/legacy/suppliers/${e}`, r);
|
|
970
|
+
},
|
|
971
|
+
async delete(e) {
|
|
972
|
+
return t.delete(`/legacy/suppliers/${e}`);
|
|
973
|
+
},
|
|
974
|
+
async getLinks(e) {
|
|
975
|
+
return t.get(`/legacy/suppliers/${e}/links`);
|
|
976
|
+
}
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
function Te(t) {
|
|
980
|
+
return {
|
|
981
|
+
async getTypes(e) {
|
|
982
|
+
const r = o("/legacy/storage/types", e != null ? { client_id: e } : void 0);
|
|
983
|
+
return t.get(r).then((n) => n.data);
|
|
984
|
+
},
|
|
985
|
+
async getWeekEnds(e) {
|
|
986
|
+
const r = c("/legacy/storage/week-ends", e);
|
|
987
|
+
return t.get(r);
|
|
988
|
+
},
|
|
989
|
+
async getWeekEndById(e) {
|
|
990
|
+
return t.get(`/legacy/storage/week-ends/${e}`);
|
|
991
|
+
},
|
|
992
|
+
async getWeekEndItems(e) {
|
|
993
|
+
return t.get(`/legacy/storage/week-ends/${e}/items`).then((r) => r.data);
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
function Ue(t) {
|
|
998
|
+
return {
|
|
999
|
+
async getAll(e) {
|
|
1000
|
+
const r = c("/legacy/service-fees", e);
|
|
1001
|
+
return t.get(r);
|
|
1002
|
+
},
|
|
1003
|
+
async getById(e) {
|
|
1004
|
+
return t.get(`/legacy/service-fees/${e}`);
|
|
1005
|
+
},
|
|
1006
|
+
async getLookups(e) {
|
|
1007
|
+
return t.get(`/legacy/service-fees/${e}/lookups`);
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
function Le(t) {
|
|
1012
|
+
return {
|
|
1013
|
+
async getAll(e) {
|
|
1014
|
+
const r = c("/legacy/stock-takes", e);
|
|
1015
|
+
return t.get(r);
|
|
1016
|
+
},
|
|
1017
|
+
async getById(e) {
|
|
1018
|
+
return t.get(`/legacy/stock-takes/${e}`);
|
|
1019
|
+
},
|
|
1020
|
+
async create(e) {
|
|
1021
|
+
return t.post("/legacy/stock-takes", e);
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
function Pe(t) {
|
|
1026
|
+
return {
|
|
1027
|
+
async getServiceClasses() {
|
|
1028
|
+
return t.get("/legacy/service-classes");
|
|
1029
|
+
},
|
|
1030
|
+
async getPackageSizes() {
|
|
1031
|
+
return t.get("/legacy/package-sizes");
|
|
1032
|
+
},
|
|
1033
|
+
async getInvex(e) {
|
|
1034
|
+
const r = c("/legacy/invex", e);
|
|
1035
|
+
return t.get(r);
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
function be(t) {
|
|
1040
|
+
return {
|
|
1041
|
+
async getAll() {
|
|
1042
|
+
return t.get("/legacy/countries");
|
|
1043
|
+
},
|
|
1044
|
+
async getByCode(e) {
|
|
1045
|
+
return t.get(`/legacy/countries/${encodeURIComponent(e)}`);
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
function Oe(t) {
|
|
1050
|
+
return {
|
|
1051
|
+
async getAll(e) {
|
|
1052
|
+
const r = c("/legacy/email-reports", e);
|
|
1053
|
+
return t.get(r);
|
|
1054
|
+
},
|
|
1055
|
+
async getById(e) {
|
|
1056
|
+
return t.get(`/legacy/email-reports/${e}`);
|
|
1057
|
+
}
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
function De(t) {
|
|
1061
|
+
return {
|
|
1062
|
+
async getAll(e) {
|
|
1063
|
+
const r = c("/legacy/packaging", e);
|
|
1064
|
+
return t.get(r);
|
|
1065
|
+
},
|
|
1066
|
+
async getById(e) {
|
|
1067
|
+
return t.get(`/legacy/packaging/${e}`);
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
function xe(t) {
|
|
1072
|
+
return {
|
|
1073
|
+
async getAll() {
|
|
1074
|
+
return t.get("/legacy/shipment-types");
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
function Fe(t) {
|
|
1079
|
+
return {
|
|
1080
|
+
async getAll() {
|
|
1081
|
+
return t.get("/legacy/sources");
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
function Ne(t) {
|
|
1086
|
+
return {
|
|
1087
|
+
async getAll(e) {
|
|
1088
|
+
const r = c("/legacy/product-sets", e);
|
|
1089
|
+
return t.get(r);
|
|
1090
|
+
},
|
|
1091
|
+
async getById(e) {
|
|
1092
|
+
return t.get(`/legacy/product-sets/${e}`);
|
|
1093
|
+
},
|
|
1094
|
+
async create(e) {
|
|
1095
|
+
return t.post("/legacy/product-sets", e);
|
|
1096
|
+
},
|
|
1097
|
+
async update(e, r) {
|
|
1098
|
+
return t.put(`/legacy/product-sets/${e}`, r);
|
|
1099
|
+
},
|
|
1100
|
+
async delete(e) {
|
|
1101
|
+
return t.delete(`/legacy/product-sets/${e}`);
|
|
1102
|
+
},
|
|
1103
|
+
async getLinks(e) {
|
|
1104
|
+
return t.get(`/legacy/product-sets/${e}/links`).then((r) => r.data);
|
|
1105
|
+
},
|
|
1106
|
+
async createLink(e, r) {
|
|
1107
|
+
return t.post(`/legacy/product-sets/${e}/links`, r);
|
|
1108
|
+
},
|
|
1109
|
+
async deleteLink(e, r) {
|
|
1110
|
+
return t.delete(`/legacy/product-sets/${e}/links/${r}`);
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
function qe(t) {
|
|
1115
|
+
return {
|
|
1116
|
+
async getAll(e) {
|
|
1117
|
+
const r = c("/legacy/product-reworks", e);
|
|
1118
|
+
return t.get(r);
|
|
1119
|
+
},
|
|
1120
|
+
async getById(e) {
|
|
1121
|
+
return t.get(`/legacy/product-reworks/${e}`);
|
|
1122
|
+
},
|
|
1123
|
+
async create(e) {
|
|
1124
|
+
return t.post("/legacy/product-reworks", e);
|
|
1125
|
+
},
|
|
1126
|
+
async update(e, r) {
|
|
1127
|
+
return t.put(`/legacy/product-reworks/${e}`, r);
|
|
1128
|
+
},
|
|
1129
|
+
async delete(e) {
|
|
1130
|
+
return t.delete(`/legacy/product-reworks/${e}`);
|
|
1131
|
+
}
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
function je(t) {
|
|
1135
|
+
return {
|
|
1136
|
+
async getDispatch(e) {
|
|
1137
|
+
const r = c("/legacy/tariffs/dispatch", e);
|
|
1138
|
+
return t.get(r);
|
|
1139
|
+
},
|
|
1140
|
+
async getDispatchById(e) {
|
|
1141
|
+
return t.get(`/legacy/tariffs/dispatch/${e}`);
|
|
1142
|
+
},
|
|
1143
|
+
async getDispatchProducts(e) {
|
|
1144
|
+
return t.get(`/legacy/tariffs/dispatch/${e}/products`).then((r) => r.data);
|
|
1145
|
+
},
|
|
1146
|
+
async getDelivery(e) {
|
|
1147
|
+
const r = c("/legacy/tariffs/delivery", e);
|
|
1148
|
+
return t.get(r);
|
|
1149
|
+
},
|
|
1150
|
+
async getShipping(e) {
|
|
1151
|
+
const r = c("/legacy/tariffs/shipping", e);
|
|
1152
|
+
return t.get(r);
|
|
1153
|
+
},
|
|
1154
|
+
async getPackaging(e) {
|
|
1155
|
+
const r = c("/legacy/tariffs/packaging", e);
|
|
1156
|
+
return t.get(r);
|
|
1157
|
+
},
|
|
1158
|
+
async getStorage(e) {
|
|
1159
|
+
const r = c("/legacy/tariffs/storage", e);
|
|
1160
|
+
return t.get(r);
|
|
1161
|
+
}
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
function ze(t) {
|
|
1165
|
+
return {
|
|
1166
|
+
async getAll() {
|
|
1167
|
+
return t.get("/email-templates").then((e) => e.data);
|
|
1168
|
+
},
|
|
1169
|
+
async getById(e) {
|
|
1170
|
+
return t.get(`/email-templates/${e}`);
|
|
1171
|
+
}
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
const Je = "https://api.janus.pelygo.com", We = [
|
|
833
1175
|
"/auth/",
|
|
834
1176
|
"/returns/query",
|
|
835
1177
|
"/legacy/products/query",
|
|
836
|
-
"/legacy/"
|
|
1178
|
+
"/legacy/orders/query"
|
|
837
1179
|
];
|
|
838
|
-
function
|
|
839
|
-
return
|
|
1180
|
+
function He(t) {
|
|
1181
|
+
return We.some((e) => t.includes(e));
|
|
840
1182
|
}
|
|
841
|
-
function
|
|
1183
|
+
function Ve(t) {
|
|
842
1184
|
const e = (r, n) => {
|
|
843
1185
|
throw new Error(
|
|
844
1186
|
`@pelygo/janus: Write operation blocked (${r.toUpperCase()}${n ? " " + n : ""}). The client is in read-only mode. To enable writes, set allowWrites: true in createJanusApi options:
|
|
@@ -848,93 +1190,108 @@ function ye(t) {
|
|
|
848
1190
|
};
|
|
849
1191
|
return {
|
|
850
1192
|
...t,
|
|
851
|
-
post: (r, n, s) =>
|
|
1193
|
+
post: (r, n, s) => He(r) ? t.post(r, n, s) : e("POST", r),
|
|
852
1194
|
put: (r, n, s) => e("PUT", r),
|
|
853
1195
|
patch: (r, n, s) => e("PATCH", r),
|
|
854
1196
|
delete: (r, n) => e("DELETE", r)
|
|
855
1197
|
};
|
|
856
1198
|
}
|
|
857
|
-
function
|
|
858
|
-
const e = t.baseUrl ||
|
|
1199
|
+
function Ke(t = {}) {
|
|
1200
|
+
const e = t.baseUrl || Je, r = {
|
|
859
1201
|
baseUrl: e,
|
|
860
1202
|
authUrl: t.authUrl,
|
|
861
1203
|
onUnauthorized: t.onUnauthorized,
|
|
862
1204
|
onLoginSuccess: t.onLoginSuccess,
|
|
863
1205
|
onLoginError: t.onLoginError
|
|
864
|
-
}, n =
|
|
1206
|
+
}, n = Y(r), s = t.allowWrites ? n : Ve(n), u = te(s), a = ce(s), l = ue(s), h = oe({ baseUrl: e }), f = ae(s), v = ge(s), R = ie(s), k = ye(s), I = le(s), S = de(s), A = $e(s), w = me({ baseUrl: e }), C = pe(s), B = he(s), _ = fe(s), E = ve(s), T = Re(s), U = ke(s), L = Ie(s), P = Se(s), b = Ae(s), O = we(s), D = Ce(s), x = Be(s), F = _e(s), N = Ee(s), q = Te(s), j = Ue(s), z = Le(s), J = Pe(s), W = be(s), H = Oe(s), V = De(s), M = xe(s), G = Fe(s), K = Ne(s), Q = qe(s), Z = je(s), X = ze(s);
|
|
865
1207
|
return {
|
|
866
|
-
clients:
|
|
1208
|
+
clients: u,
|
|
867
1209
|
returns: a,
|
|
868
|
-
reports:
|
|
869
|
-
helpers:
|
|
870
|
-
couriers:
|
|
871
|
-
orders:
|
|
872
|
-
ordersMt:
|
|
873
|
-
integrations:
|
|
874
|
-
users:
|
|
875
|
-
logs:
|
|
876
|
-
tasks:
|
|
877
|
-
customer:
|
|
878
|
-
legacy:
|
|
879
|
-
products:
|
|
880
|
-
productCategories:
|
|
881
|
-
stocks:
|
|
882
|
-
stockTransactions:
|
|
1210
|
+
reports: l,
|
|
1211
|
+
helpers: h,
|
|
1212
|
+
couriers: f,
|
|
1213
|
+
orders: v,
|
|
1214
|
+
ordersMt: R,
|
|
1215
|
+
integrations: k,
|
|
1216
|
+
users: I,
|
|
1217
|
+
logs: S,
|
|
1218
|
+
tasks: A,
|
|
1219
|
+
customer: w,
|
|
1220
|
+
legacy: C,
|
|
1221
|
+
products: B,
|
|
1222
|
+
productCategories: _,
|
|
1223
|
+
stocks: E,
|
|
1224
|
+
stockTransactions: T,
|
|
883
1225
|
stockAllocations: U,
|
|
884
|
-
locations:
|
|
885
|
-
audits:
|
|
886
|
-
asns:
|
|
887
|
-
dispatches:
|
|
888
|
-
consignments:
|
|
889
|
-
invoices:
|
|
1226
|
+
locations: L,
|
|
1227
|
+
audits: P,
|
|
1228
|
+
asns: b,
|
|
1229
|
+
dispatches: O,
|
|
1230
|
+
consignments: D,
|
|
1231
|
+
invoices: x,
|
|
1232
|
+
deliveries: F,
|
|
1233
|
+
suppliers: N,
|
|
1234
|
+
storage: q,
|
|
1235
|
+
serviceFees: j,
|
|
1236
|
+
stockTakes: z,
|
|
1237
|
+
billingLookups: J,
|
|
1238
|
+
countries: W,
|
|
1239
|
+
emailReports: H,
|
|
1240
|
+
packaging: V,
|
|
1241
|
+
shipmentTypes: M,
|
|
1242
|
+
sources: G,
|
|
1243
|
+
productSets: K,
|
|
1244
|
+
productReworks: Q,
|
|
1245
|
+
tariffs: Z,
|
|
1246
|
+
emailTemplates: X,
|
|
890
1247
|
auth: n
|
|
891
1248
|
};
|
|
892
1249
|
}
|
|
893
|
-
class
|
|
1250
|
+
class g extends Error {
|
|
894
1251
|
constructor(e, r, n) {
|
|
895
1252
|
super(e), this.name = "JanusApiError", this.status = r, this.response = n;
|
|
896
1253
|
const s = Error;
|
|
897
|
-
s.captureStackTrace && s.captureStackTrace(this,
|
|
1254
|
+
s.captureStackTrace && s.captureStackTrace(this, g);
|
|
898
1255
|
}
|
|
899
1256
|
}
|
|
900
|
-
class
|
|
1257
|
+
class Me extends g {
|
|
901
1258
|
constructor(e = "Unauthorized", r) {
|
|
902
1259
|
super(e, 401, r), this.name = "UnauthorizedError";
|
|
903
1260
|
}
|
|
904
1261
|
}
|
|
905
|
-
class
|
|
1262
|
+
class Qe extends g {
|
|
906
1263
|
constructor(e = "Forbidden", r) {
|
|
907
1264
|
super(e, 403, r), this.name = "ForbiddenError";
|
|
908
1265
|
}
|
|
909
1266
|
}
|
|
910
|
-
class
|
|
1267
|
+
class Ze extends g {
|
|
911
1268
|
constructor(e = "Not Found", r) {
|
|
912
1269
|
super(e, 404, r), this.name = "NotFoundError";
|
|
913
1270
|
}
|
|
914
1271
|
}
|
|
915
|
-
class
|
|
1272
|
+
class Xe extends g {
|
|
916
1273
|
constructor(e = "Validation Error", r, n) {
|
|
917
1274
|
super(e, 400, n), this.name = "ValidationError", this.errors = r;
|
|
918
1275
|
}
|
|
919
1276
|
}
|
|
920
|
-
function
|
|
921
|
-
return t instanceof
|
|
1277
|
+
function Ye(t) {
|
|
1278
|
+
return t instanceof g;
|
|
922
1279
|
}
|
|
923
|
-
function
|
|
924
|
-
return t instanceof
|
|
1280
|
+
function et(t) {
|
|
1281
|
+
return t instanceof Me;
|
|
925
1282
|
}
|
|
926
1283
|
export {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1284
|
+
Je as DEFAULT_JANUS_URL,
|
|
1285
|
+
Qe as ForbiddenError,
|
|
1286
|
+
g as JanusApiError,
|
|
1287
|
+
Ze as NotFoundError,
|
|
1288
|
+
Me as UnauthorizedError,
|
|
1289
|
+
Xe as ValidationError,
|
|
1290
|
+
c as buildClientScopedPaginatedUrl,
|
|
1291
|
+
p as buildPaginatedUrl,
|
|
1292
|
+
re as buildQueryString,
|
|
1293
|
+
o as buildUrl,
|
|
1294
|
+
Ke as createJanusApi,
|
|
1295
|
+
Ye as isJanusApiError,
|
|
1296
|
+
et as isUnauthorizedError
|
|
940
1297
|
};
|