@pelygo/janus 0.1.2 → 0.2.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.
- package/dist/index.d.ts +1848 -9
- package/dist/index.js +593 -253
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,286 +1,303 @@
|
|
|
1
|
-
import { createAuthApi as
|
|
2
|
-
function
|
|
1
|
+
import { createAuthApi as L } from "@pelygo/auth/core";
|
|
2
|
+
function T(t) {
|
|
3
3
|
return {
|
|
4
4
|
async getAll() {
|
|
5
|
-
return
|
|
5
|
+
return t.get("/clients");
|
|
6
6
|
},
|
|
7
7
|
async getWithActiveIntegrations() {
|
|
8
|
-
return
|
|
8
|
+
return t.get("/clients/activeIntegrations");
|
|
9
9
|
},
|
|
10
|
-
async previewNotification(e,
|
|
11
|
-
return
|
|
10
|
+
async previewNotification(e, r) {
|
|
11
|
+
return t.get(`/clients/preview-notification?type=${encodeURIComponent(e)}&client_id=${r}`);
|
|
12
12
|
},
|
|
13
13
|
async getById(e) {
|
|
14
|
-
return
|
|
14
|
+
return t.get(`/clients/${e}`);
|
|
15
15
|
},
|
|
16
16
|
async getByIdMinimal(e) {
|
|
17
|
-
return
|
|
17
|
+
return t.get(`/clients/${e}?type=m`);
|
|
18
18
|
},
|
|
19
19
|
async create(e) {
|
|
20
|
-
return
|
|
20
|
+
return t.post("/clients", e);
|
|
21
21
|
},
|
|
22
|
-
async replace(e,
|
|
23
|
-
return
|
|
22
|
+
async replace(e, r) {
|
|
23
|
+
return t.put(`/clients/${e}`, r);
|
|
24
24
|
},
|
|
25
|
-
async update(e,
|
|
26
|
-
return
|
|
25
|
+
async update(e, r) {
|
|
26
|
+
return t.patch(`/clients/${e}`, r);
|
|
27
27
|
},
|
|
28
28
|
async getReturnReasons(e) {
|
|
29
|
-
return
|
|
29
|
+
return t.get(`/clients/${e}/returnreasons`);
|
|
30
30
|
},
|
|
31
|
-
async addReturnReason(e,
|
|
31
|
+
async addReturnReason(e, r) {
|
|
32
32
|
const n = {
|
|
33
33
|
client: { id: e },
|
|
34
|
-
return_reason: { id:
|
|
34
|
+
return_reason: { id: r }
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return t.post(`/clients/${e}/returnreasons`, n);
|
|
37
37
|
},
|
|
38
|
-
async updateReturnReasons(e,
|
|
39
|
-
return
|
|
38
|
+
async updateReturnReasons(e, r) {
|
|
39
|
+
return t.put(`/clients/${e}/returnreasons`, r);
|
|
40
40
|
},
|
|
41
|
-
async removeReturnReason(e,
|
|
42
|
-
return
|
|
41
|
+
async removeReturnReason(e, r) {
|
|
42
|
+
return t.delete(`/clients/${e}/returnreasons/${r}`);
|
|
43
43
|
},
|
|
44
44
|
async getCourierServices(e) {
|
|
45
|
-
return
|
|
45
|
+
return t.get(`/clients/${e}/courierservices`);
|
|
46
46
|
},
|
|
47
|
-
async getCourierServiceById(e,
|
|
48
|
-
return
|
|
47
|
+
async getCourierServiceById(e, r) {
|
|
48
|
+
return t.get(`/clients/${e}/courierservices/${r}`);
|
|
49
49
|
},
|
|
50
|
-
async addCourierService(e,
|
|
51
|
-
return
|
|
50
|
+
async addCourierService(e, r) {
|
|
51
|
+
return t.post(`/clients/${e}/courierservices`, r);
|
|
52
52
|
},
|
|
53
|
-
async updateCourierService(e,
|
|
54
|
-
if (!
|
|
53
|
+
async updateCourierService(e, r) {
|
|
54
|
+
if (!r.id)
|
|
55
55
|
throw new Error("Service ID is required for update");
|
|
56
|
-
return
|
|
56
|
+
return t.patch(`/clients/${e}/courierservices/${r.id}`, r);
|
|
57
57
|
},
|
|
58
|
-
async deleteCourierService(e,
|
|
59
|
-
return
|
|
58
|
+
async deleteCourierService(e, r) {
|
|
59
|
+
return t.delete(`/clients/${e}/courierservices/${r}`);
|
|
60
60
|
},
|
|
61
|
-
async createIntegration(e,
|
|
62
|
-
return
|
|
61
|
+
async createIntegration(e, r) {
|
|
62
|
+
return t.post(`/clients/${e}/integration`, r);
|
|
63
63
|
},
|
|
64
|
-
async getOrderByRef(e,
|
|
65
|
-
return
|
|
64
|
+
async getOrderByRef(e, r) {
|
|
65
|
+
return t.get(`/clients/${e}/orderbyref/${encodeURIComponent(r)}`);
|
|
66
66
|
},
|
|
67
67
|
async getFiles(e) {
|
|
68
|
-
return
|
|
68
|
+
return t.get(`/clients/${e}/files`);
|
|
69
69
|
},
|
|
70
|
-
async uploadFile(e,
|
|
71
|
-
return
|
|
70
|
+
async uploadFile(e, r, n) {
|
|
71
|
+
return t.post(`/clients/${e}/files/${r}`, n);
|
|
72
72
|
},
|
|
73
|
-
async deleteFile(e,
|
|
74
|
-
return
|
|
73
|
+
async deleteFile(e, r) {
|
|
74
|
+
return t.delete(`/clients/${e}/files/${encodeURIComponent(r)}`);
|
|
75
75
|
},
|
|
76
76
|
async getSettings(e) {
|
|
77
|
-
return
|
|
77
|
+
return t.get(`/clients/${e}/settings`);
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
if (!
|
|
81
|
+
function O(t) {
|
|
82
|
+
if (!t)
|
|
83
83
|
return "";
|
|
84
84
|
const e = new URLSearchParams();
|
|
85
|
-
for (const [
|
|
86
|
-
n != null && n !== "" && e.append(
|
|
85
|
+
for (const [r, n] of Object.entries(t))
|
|
86
|
+
n != null && n !== "" && e.append(r, String(n));
|
|
87
87
|
return e.toString();
|
|
88
88
|
}
|
|
89
|
-
function u(
|
|
89
|
+
function u(t, e) {
|
|
90
90
|
if (!e || Object.keys(e).length === 0)
|
|
91
|
-
return
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
94
|
-
return
|
|
95
|
-
const n =
|
|
96
|
-
return `${
|
|
91
|
+
return t;
|
|
92
|
+
const r = O(e);
|
|
93
|
+
if (!r)
|
|
94
|
+
return t;
|
|
95
|
+
const n = t.includes("?") ? "&" : "?";
|
|
96
|
+
return `${t}${n}${r}`;
|
|
97
|
+
}
|
|
98
|
+
function P(t) {
|
|
99
|
+
return t.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
|
|
97
100
|
}
|
|
98
|
-
function
|
|
101
|
+
function F(t) {
|
|
102
|
+
const e = {};
|
|
103
|
+
for (const [r, n] of Object.entries(t))
|
|
104
|
+
e[P(r)] = n;
|
|
105
|
+
return e;
|
|
106
|
+
}
|
|
107
|
+
function l(t, e) {
|
|
108
|
+
return e ? u(t, F(e)) : t;
|
|
109
|
+
}
|
|
110
|
+
function o(t, e) {
|
|
111
|
+
if (e.clientId == null)
|
|
112
|
+
throw new Error("clientId is required for this endpoint");
|
|
113
|
+
return l(t, e);
|
|
114
|
+
}
|
|
115
|
+
function b(t) {
|
|
99
116
|
return {
|
|
100
117
|
// ── Core returns ─────────────────────────────────────────────
|
|
101
118
|
async query(e) {
|
|
102
|
-
const
|
|
103
|
-
return
|
|
119
|
+
const r = u("/returns/", e);
|
|
120
|
+
return t.get(r);
|
|
104
121
|
},
|
|
105
122
|
async queryPost(e) {
|
|
106
|
-
return
|
|
123
|
+
return t.post("/returns/query", e);
|
|
107
124
|
},
|
|
108
|
-
async getById(e,
|
|
109
|
-
const n = u(`/returns/${e}`,
|
|
110
|
-
return
|
|
125
|
+
async getById(e, r) {
|
|
126
|
+
const n = u(`/returns/${e}`, r);
|
|
127
|
+
return t.get(n);
|
|
111
128
|
},
|
|
112
129
|
async create(e) {
|
|
113
|
-
return
|
|
130
|
+
return t.post("/helpers/returns", e);
|
|
114
131
|
},
|
|
115
132
|
async createDirect(e) {
|
|
116
|
-
return
|
|
133
|
+
return t.post("/returns", e);
|
|
117
134
|
},
|
|
118
|
-
async replace(e,
|
|
119
|
-
return
|
|
135
|
+
async replace(e, r) {
|
|
136
|
+
return t.put(`/returns/${e}`, r);
|
|
120
137
|
},
|
|
121
|
-
async update(e,
|
|
122
|
-
return
|
|
138
|
+
async update(e, r) {
|
|
139
|
+
return t.patch(`/returns/${e}`, r);
|
|
123
140
|
},
|
|
124
141
|
async delete(e) {
|
|
125
|
-
return
|
|
142
|
+
return t.delete(`/returns/${e}`);
|
|
126
143
|
},
|
|
127
|
-
async setApproval(e,
|
|
128
|
-
const n = { approve:
|
|
129
|
-
return
|
|
144
|
+
async setApproval(e, r) {
|
|
145
|
+
const n = { approve: r };
|
|
146
|
+
return t.post(`/returns/${e}/approval`, n);
|
|
130
147
|
},
|
|
131
148
|
async getEmail(e) {
|
|
132
|
-
return
|
|
149
|
+
return t.get(`/returns/email?ref=${encodeURIComponent(e)}`);
|
|
133
150
|
},
|
|
134
151
|
// ── Return items ─────────────────────────────────────────────
|
|
135
152
|
async getItems(e) {
|
|
136
|
-
return
|
|
153
|
+
return t.get(`/returns/${e}/returnitems`);
|
|
137
154
|
},
|
|
138
|
-
async getItemById(e,
|
|
139
|
-
return
|
|
155
|
+
async getItemById(e, r) {
|
|
156
|
+
return t.get(`/returns/${e}/returnitems/${r}`);
|
|
140
157
|
},
|
|
141
|
-
async addItem(e,
|
|
142
|
-
return
|
|
158
|
+
async addItem(e, r) {
|
|
159
|
+
return t.post(`/returns/${e}/returnitems`, r);
|
|
143
160
|
},
|
|
144
|
-
async updateItem(e,
|
|
145
|
-
return
|
|
161
|
+
async updateItem(e, r, n) {
|
|
162
|
+
return t.patch(`/returns/${e}/returnitems/${r}`, n);
|
|
146
163
|
},
|
|
147
|
-
async updateItems(e,
|
|
148
|
-
return
|
|
164
|
+
async updateItems(e, r) {
|
|
165
|
+
return t.patch(`/returns/${e}/returnitems`, r);
|
|
149
166
|
},
|
|
150
167
|
// ── Return statuses (per-return) ─────────────────────────────
|
|
151
168
|
async getStatuses(e) {
|
|
152
|
-
return
|
|
169
|
+
return t.get(`/returns/${e}/statuses`);
|
|
153
170
|
},
|
|
154
|
-
async addStatus(e,
|
|
171
|
+
async addStatus(e, r) {
|
|
155
172
|
const n = {
|
|
156
173
|
return: { id: e },
|
|
157
|
-
return_status: { id:
|
|
174
|
+
return_status: { id: r },
|
|
158
175
|
created_by: { id: 1 }
|
|
159
176
|
};
|
|
160
|
-
return
|
|
177
|
+
return t.post(`/returns/${e}/statuses`, n);
|
|
161
178
|
},
|
|
162
|
-
async removeStatus(e,
|
|
163
|
-
return
|
|
179
|
+
async removeStatus(e, r) {
|
|
180
|
+
return t.delete(`/returns/${e}/statuses/${r}`);
|
|
164
181
|
},
|
|
165
182
|
// ── Return comments (per-return) ─────────────────────────────
|
|
166
183
|
async getComments(e) {
|
|
167
|
-
return
|
|
184
|
+
return t.get(`/returns/${e}/comments`);
|
|
168
185
|
},
|
|
169
|
-
async getCommentById(e,
|
|
170
|
-
return
|
|
186
|
+
async getCommentById(e, r) {
|
|
187
|
+
return t.get(`/returns/${e}/comments/${r}`);
|
|
171
188
|
},
|
|
172
|
-
async addComment(e,
|
|
173
|
-
const n = { comment:
|
|
174
|
-
return
|
|
189
|
+
async addComment(e, r) {
|
|
190
|
+
const n = { comment: r };
|
|
191
|
+
return t.post(`/returns/${e}/comments`, n);
|
|
175
192
|
},
|
|
176
|
-
async removeComment(e,
|
|
177
|
-
return
|
|
193
|
+
async removeComment(e, r) {
|
|
194
|
+
return t.delete(`/returns/${e}/comments/${r}`);
|
|
178
195
|
},
|
|
179
196
|
// ── Reference data: reasons ──────────────────────────────────
|
|
180
197
|
async getReasons() {
|
|
181
|
-
return
|
|
198
|
+
return t.get("/returns/reasons");
|
|
182
199
|
},
|
|
183
200
|
async getReasonById(e) {
|
|
184
|
-
return
|
|
201
|
+
return t.get(`/returns/reasons/${e}`);
|
|
185
202
|
},
|
|
186
203
|
async createReason(e) {
|
|
187
|
-
return
|
|
204
|
+
return t.post("/returns/reasons", e);
|
|
188
205
|
},
|
|
189
|
-
async updateReason(e,
|
|
190
|
-
return
|
|
206
|
+
async updateReason(e, r) {
|
|
207
|
+
return t.put(`/returns/reasons/${e}`, r);
|
|
191
208
|
},
|
|
192
209
|
// ── Reference data: statuses ─────────────────────────────────
|
|
193
210
|
async getAllStatuses() {
|
|
194
|
-
return
|
|
211
|
+
return t.get("/returns/statuses");
|
|
195
212
|
},
|
|
196
213
|
async getStatusById(e) {
|
|
197
|
-
return
|
|
214
|
+
return t.get(`/returns/statuses/${e}`);
|
|
198
215
|
},
|
|
199
216
|
async createStatus(e) {
|
|
200
|
-
return
|
|
217
|
+
return t.post("/returns/statuses", e);
|
|
201
218
|
},
|
|
202
|
-
async updateStatus(e,
|
|
203
|
-
return
|
|
219
|
+
async updateStatus(e, r) {
|
|
220
|
+
return t.put(`/returns/statuses/${e}`, r);
|
|
204
221
|
},
|
|
205
222
|
async deleteStatus(e) {
|
|
206
|
-
return
|
|
223
|
+
return t.delete(`/returns/statuses/${e}`);
|
|
207
224
|
},
|
|
208
225
|
// ── Reference data: categories ───────────────────────────────
|
|
209
226
|
async getCategories() {
|
|
210
|
-
return
|
|
227
|
+
return t.get("/returns/categories");
|
|
211
228
|
},
|
|
212
229
|
async getCategoryById(e) {
|
|
213
|
-
return
|
|
230
|
+
return t.get(`/returns/categories/${e}`);
|
|
214
231
|
},
|
|
215
232
|
async createCategory(e) {
|
|
216
|
-
return
|
|
233
|
+
return t.post("/returns/categories", e);
|
|
217
234
|
},
|
|
218
|
-
async updateCategory(e,
|
|
219
|
-
return
|
|
235
|
+
async updateCategory(e, r) {
|
|
236
|
+
return t.put(`/returns/categories/${e}`, r);
|
|
220
237
|
},
|
|
221
238
|
// ── Reference data: sources ──────────────────────────────────
|
|
222
239
|
async getSources() {
|
|
223
|
-
return
|
|
240
|
+
return t.get("/returns/sources");
|
|
224
241
|
},
|
|
225
242
|
async getSourceById(e) {
|
|
226
|
-
return
|
|
243
|
+
return t.get(`/returns/sources/${e}`);
|
|
227
244
|
},
|
|
228
245
|
async createSource(e) {
|
|
229
|
-
return
|
|
246
|
+
return t.post("/returns/sources", e);
|
|
230
247
|
},
|
|
231
|
-
async updateSource(e,
|
|
232
|
-
return
|
|
248
|
+
async updateSource(e, r) {
|
|
249
|
+
return t.put(`/returns/sources/${e}`, r);
|
|
233
250
|
},
|
|
234
251
|
async deleteSource(e) {
|
|
235
|
-
return
|
|
252
|
+
return t.delete(`/returns/sources/${e}`);
|
|
236
253
|
},
|
|
237
254
|
// ── Reference data: comments (global) ────────────────────────
|
|
238
255
|
async getAllComments() {
|
|
239
|
-
return
|
|
256
|
+
return t.get("/returns/comments");
|
|
240
257
|
},
|
|
241
258
|
async getGlobalCommentById(e) {
|
|
242
|
-
return
|
|
259
|
+
return t.get(`/returns/comments/${e}`);
|
|
243
260
|
},
|
|
244
261
|
// ── Filter options ───────────────────────────────────────────
|
|
245
262
|
async getFilterOptions(e) {
|
|
246
|
-
return
|
|
263
|
+
return t.get(`/orders/returns/filter-types?clientId=${e}`);
|
|
247
264
|
}
|
|
248
265
|
};
|
|
249
266
|
}
|
|
250
|
-
function
|
|
267
|
+
function x(t) {
|
|
251
268
|
return {
|
|
252
269
|
async returnsSummary(e) {
|
|
253
|
-
const
|
|
254
|
-
return
|
|
270
|
+
const r = u("/reports/returns/summary/", e);
|
|
271
|
+
return t.get(r);
|
|
255
272
|
},
|
|
256
273
|
async returnsSummaryCsv(e) {
|
|
257
|
-
const
|
|
258
|
-
return
|
|
274
|
+
const r = { ...e, csv: !0, pageSize: 1e5 }, n = u("/reports/returns/summary/", r);
|
|
275
|
+
return t.get(n);
|
|
259
276
|
},
|
|
260
277
|
async returnsReasons(e) {
|
|
261
|
-
const
|
|
262
|
-
return
|
|
278
|
+
const r = u("/reports/returns/reasons/", e);
|
|
279
|
+
return t.get(r);
|
|
263
280
|
},
|
|
264
281
|
async returnsReasonsCsv(e) {
|
|
265
|
-
const
|
|
266
|
-
return
|
|
282
|
+
const r = { ...e, csv: !0, pageSize: 1e5 }, n = u("/reports/returns/reasons/", r);
|
|
283
|
+
return t.get(n);
|
|
267
284
|
},
|
|
268
285
|
async returnsOverview(e) {
|
|
269
|
-
const
|
|
270
|
-
return
|
|
286
|
+
const r = u("/reports/returns/overview/", e);
|
|
287
|
+
return t.get(r);
|
|
271
288
|
},
|
|
272
289
|
async returnsOverviewCsv(e) {
|
|
273
|
-
const
|
|
274
|
-
return
|
|
290
|
+
const r = { ...e, csv: !0, pageSize: 1e5 }, n = u("/reports/returns/overview/", r);
|
|
291
|
+
return t.get(n);
|
|
275
292
|
},
|
|
276
293
|
async returnsStats(e) {
|
|
277
|
-
return
|
|
294
|
+
return t.get(`/reports/returns/stats?clientId=${e}`);
|
|
278
295
|
}
|
|
279
296
|
};
|
|
280
297
|
}
|
|
281
|
-
function
|
|
282
|
-
const { baseUrl: e } =
|
|
283
|
-
async function
|
|
298
|
+
function N(t) {
|
|
299
|
+
const { baseUrl: e } = t;
|
|
300
|
+
async function r(n, s) {
|
|
284
301
|
const c = await fetch(n, {
|
|
285
302
|
headers: {
|
|
286
303
|
"Content-Type": "application/json"
|
|
@@ -288,24 +305,24 @@ function I(r) {
|
|
|
288
305
|
...s
|
|
289
306
|
});
|
|
290
307
|
if (!c.ok) {
|
|
291
|
-
const
|
|
292
|
-
throw new Error(`HTTP ${c.status}: ${
|
|
308
|
+
const a = await c.text().catch(() => "Unknown error");
|
|
309
|
+
throw new Error(`HTTP ${c.status}: ${a}`);
|
|
293
310
|
}
|
|
294
311
|
return c.json();
|
|
295
312
|
}
|
|
296
313
|
return {
|
|
297
314
|
async getClientSettingsByName(n) {
|
|
298
|
-
return
|
|
315
|
+
return r(
|
|
299
316
|
`${e}/helpers/clientsettings/${encodeURIComponent(n)}`
|
|
300
317
|
);
|
|
301
318
|
},
|
|
302
319
|
async getNotificationSettings(n) {
|
|
303
|
-
return
|
|
320
|
+
return r(
|
|
304
321
|
`${e}/helpers/settings/${encodeURIComponent(n)}`
|
|
305
322
|
);
|
|
306
323
|
},
|
|
307
324
|
async customerLogin(n, s, c) {
|
|
308
|
-
return
|
|
325
|
+
return r(`${e}/helpers/customerlogin`, {
|
|
309
326
|
method: "POST",
|
|
310
327
|
body: JSON.stringify({
|
|
311
328
|
client_id: n,
|
|
@@ -316,151 +333,180 @@ function I(r) {
|
|
|
316
333
|
}
|
|
317
334
|
};
|
|
318
335
|
}
|
|
319
|
-
function
|
|
336
|
+
function z(t) {
|
|
320
337
|
return {
|
|
321
338
|
async getAll() {
|
|
322
|
-
return
|
|
339
|
+
return t.get("/couriers");
|
|
323
340
|
},
|
|
324
341
|
async getById(e) {
|
|
325
|
-
return
|
|
342
|
+
return t.get(`/couriers/${e}`);
|
|
326
343
|
},
|
|
327
344
|
async create(e) {
|
|
328
|
-
return
|
|
345
|
+
return t.post("/couriers", e);
|
|
329
346
|
},
|
|
330
|
-
async update(e,
|
|
331
|
-
return
|
|
347
|
+
async update(e, r) {
|
|
348
|
+
return t.put(`/couriers/${e}`, r);
|
|
332
349
|
},
|
|
333
350
|
async getServices(e) {
|
|
334
|
-
return
|
|
351
|
+
return t.get(`/couriers/${e}/services`);
|
|
335
352
|
},
|
|
336
|
-
async getServiceById(e,
|
|
337
|
-
return
|
|
353
|
+
async getServiceById(e, r) {
|
|
354
|
+
return t.get(`/couriers/${e}/services/${r}`);
|
|
338
355
|
},
|
|
339
|
-
async createService(e,
|
|
340
|
-
return
|
|
356
|
+
async createService(e, r) {
|
|
357
|
+
return t.post(`/couriers/${e}/services`, r);
|
|
341
358
|
},
|
|
342
|
-
async updateService(e,
|
|
343
|
-
return
|
|
359
|
+
async updateService(e, r, n) {
|
|
360
|
+
return t.put(`/couriers/${e}/services/${r}`, n);
|
|
344
361
|
}
|
|
345
362
|
};
|
|
346
363
|
}
|
|
347
|
-
function
|
|
364
|
+
function j(t) {
|
|
348
365
|
return {
|
|
349
366
|
async getAll(e) {
|
|
350
|
-
const
|
|
351
|
-
return
|
|
367
|
+
const r = u("/orders", e);
|
|
368
|
+
return t.get(r);
|
|
352
369
|
},
|
|
353
370
|
async getStats(e) {
|
|
354
|
-
const
|
|
355
|
-
return
|
|
371
|
+
const r = u("/orders/stats", e);
|
|
372
|
+
return t.get(r);
|
|
356
373
|
},
|
|
357
374
|
async getReturns(e) {
|
|
358
|
-
const
|
|
359
|
-
return
|
|
375
|
+
const r = u("/orders/returns", e);
|
|
376
|
+
return t.get(r);
|
|
360
377
|
},
|
|
361
|
-
async getByRef(e,
|
|
362
|
-
const n = u(`/orders/${encodeURIComponent(e)}`,
|
|
363
|
-
return
|
|
378
|
+
async getByRef(e, r) {
|
|
379
|
+
const n = u(`/orders/${encodeURIComponent(e)}`, r != null ? { clientId: r } : void 0);
|
|
380
|
+
return t.get(n);
|
|
364
381
|
},
|
|
365
382
|
async getReturnFilterOptions(e) {
|
|
366
|
-
return
|
|
383
|
+
return t.get(`/orders/returns/filter-types?clientId=${e}`);
|
|
384
|
+
},
|
|
385
|
+
async getFilterTypes(e) {
|
|
386
|
+
const r = u("/orders/filter-types", e != null ? { clientId: e } : void 0);
|
|
387
|
+
return t.get(r);
|
|
388
|
+
},
|
|
389
|
+
async create(e) {
|
|
390
|
+
return t.post("/orders", e);
|
|
391
|
+
},
|
|
392
|
+
async updateOrder(e, r) {
|
|
393
|
+
return t.put(`/orders/${e}`, r);
|
|
367
394
|
}
|
|
368
395
|
};
|
|
369
396
|
}
|
|
370
|
-
function
|
|
397
|
+
function q(t) {
|
|
371
398
|
return {
|
|
372
399
|
async getAll() {
|
|
373
|
-
return
|
|
400
|
+
return t.get("/integrations");
|
|
374
401
|
},
|
|
375
402
|
async getByClientId(e) {
|
|
376
|
-
return
|
|
403
|
+
return t.get(`/integrations/${e}`);
|
|
377
404
|
},
|
|
378
|
-
async getByCustomerAndName(e,
|
|
379
|
-
return
|
|
405
|
+
async getByCustomerAndName(e, r) {
|
|
406
|
+
return t.get(`/integrations/${e}/${encodeURIComponent(r)}`);
|
|
380
407
|
},
|
|
381
408
|
async getActive() {
|
|
382
|
-
return
|
|
409
|
+
return t.get("/integrations/active");
|
|
383
410
|
},
|
|
384
411
|
async getNamesOnly() {
|
|
385
|
-
return
|
|
412
|
+
return t.get("/integrations/namesOnly");
|
|
386
413
|
},
|
|
387
414
|
async create(e) {
|
|
388
|
-
return
|
|
415
|
+
return t.post("/integrations", e);
|
|
389
416
|
},
|
|
390
|
-
async update(e,
|
|
391
|
-
return
|
|
417
|
+
async update(e, r) {
|
|
418
|
+
return t.put(`/integrations/${e}`, r);
|
|
392
419
|
}
|
|
393
420
|
};
|
|
394
421
|
}
|
|
395
|
-
function
|
|
422
|
+
function J(t) {
|
|
396
423
|
return {
|
|
424
|
+
async getAll(e) {
|
|
425
|
+
const r = l("/users", e);
|
|
426
|
+
return t.get(r);
|
|
427
|
+
},
|
|
428
|
+
async getById(e) {
|
|
429
|
+
return t.get(`/users/${e}`);
|
|
430
|
+
},
|
|
397
431
|
async create(e) {
|
|
398
|
-
return
|
|
432
|
+
return t.post("/users", e);
|
|
399
433
|
},
|
|
400
434
|
async update(e) {
|
|
401
|
-
return
|
|
435
|
+
return t.patch("/users", e);
|
|
436
|
+
},
|
|
437
|
+
async replace(e, r) {
|
|
438
|
+
return t.put(`/users/${e}`, r);
|
|
439
|
+
},
|
|
440
|
+
async delete(e) {
|
|
441
|
+
return t.delete(`/users/${e}`);
|
|
442
|
+
},
|
|
443
|
+
async changePassword(e) {
|
|
444
|
+
return t.post("/users/change-password", e);
|
|
445
|
+
},
|
|
446
|
+
async resetPassword(e) {
|
|
447
|
+
return t.get(`/users/reset-password?link=${encodeURIComponent(e)}`);
|
|
402
448
|
}
|
|
403
449
|
};
|
|
404
450
|
}
|
|
405
|
-
function
|
|
451
|
+
function D(t) {
|
|
406
452
|
return {
|
|
407
453
|
async createActivity(e) {
|
|
408
|
-
return
|
|
454
|
+
return t.post("/logs/activity", e);
|
|
409
455
|
},
|
|
410
456
|
async createOrderIssue(e) {
|
|
411
|
-
return
|
|
457
|
+
return t.post("/logs/orderissue", e);
|
|
412
458
|
},
|
|
413
459
|
async updateOrderIssue(e) {
|
|
414
|
-
return
|
|
460
|
+
return t.patch("/logs/orderissue", e);
|
|
415
461
|
}
|
|
416
462
|
};
|
|
417
463
|
}
|
|
418
|
-
function
|
|
464
|
+
function H(t) {
|
|
419
465
|
return {
|
|
420
466
|
async getByUuid(e) {
|
|
421
|
-
return
|
|
467
|
+
return t.get(`/tasks/histories/${encodeURIComponent(e)}`);
|
|
422
468
|
},
|
|
423
469
|
async getAll(e) {
|
|
424
|
-
const
|
|
425
|
-
return
|
|
470
|
+
const r = u("/tasks/histories", e);
|
|
471
|
+
return t.get(r);
|
|
426
472
|
}
|
|
427
473
|
};
|
|
428
474
|
}
|
|
429
|
-
function
|
|
430
|
-
const { baseUrl: e } =
|
|
431
|
-
async function
|
|
432
|
-
const
|
|
475
|
+
function V(t) {
|
|
476
|
+
const { baseUrl: e } = t;
|
|
477
|
+
async function r(s, c) {
|
|
478
|
+
const a = await fetch(s, {
|
|
433
479
|
headers: { "Content-Type": "application/json" },
|
|
434
480
|
...c
|
|
435
481
|
});
|
|
436
|
-
if (!
|
|
437
|
-
const
|
|
438
|
-
throw new Error(`HTTP ${
|
|
482
|
+
if (!a.ok) {
|
|
483
|
+
const y = await a.text().catch(() => "Unknown error");
|
|
484
|
+
throw new Error(`HTTP ${a.status}: ${y}`);
|
|
439
485
|
}
|
|
440
|
-
return
|
|
486
|
+
return a.json();
|
|
441
487
|
}
|
|
442
488
|
async function n(s) {
|
|
443
489
|
const c = await fetch(s);
|
|
444
490
|
if (!c.ok) {
|
|
445
|
-
const
|
|
446
|
-
throw new Error(`HTTP ${c.status}: ${
|
|
491
|
+
const a = await c.text().catch(() => "Unknown error");
|
|
492
|
+
throw new Error(`HTTP ${c.status}: ${a}`);
|
|
447
493
|
}
|
|
448
494
|
return c.text();
|
|
449
495
|
}
|
|
450
496
|
return {
|
|
451
|
-
async tracking(s, c,
|
|
452
|
-
const
|
|
497
|
+
async tracking(s, c, a) {
|
|
498
|
+
const y = new URLSearchParams({
|
|
453
499
|
order_ref: s,
|
|
454
500
|
postcode: c,
|
|
455
|
-
client_id: String(
|
|
501
|
+
client_id: String(a)
|
|
456
502
|
});
|
|
457
|
-
return
|
|
503
|
+
return r(`${e}/customer/tracking?${y}`);
|
|
458
504
|
},
|
|
459
505
|
async track(s) {
|
|
460
|
-
return
|
|
506
|
+
return r(`${e}/customer/track?ref=${encodeURIComponent(s)}`);
|
|
461
507
|
},
|
|
462
508
|
async login(s) {
|
|
463
|
-
return
|
|
509
|
+
return r(`${e}/customer/login`, {
|
|
464
510
|
method: "POST",
|
|
465
511
|
body: JSON.stringify(s)
|
|
466
512
|
});
|
|
@@ -470,90 +516,384 @@ function T(r) {
|
|
|
470
516
|
}
|
|
471
517
|
};
|
|
472
518
|
}
|
|
473
|
-
function
|
|
519
|
+
function W(t) {
|
|
474
520
|
return {
|
|
475
521
|
async getCouriers() {
|
|
476
|
-
return
|
|
522
|
+
return t.get("/legacy-couriers");
|
|
477
523
|
},
|
|
478
524
|
async getPostServices() {
|
|
479
|
-
return
|
|
525
|
+
return t.get("/legacy-postservices");
|
|
480
526
|
},
|
|
481
527
|
async getPostServicesByCarrier(e) {
|
|
482
|
-
return
|
|
528
|
+
return t.get(`/legacy-postservices/${encodeURIComponent(e)}`);
|
|
483
529
|
},
|
|
530
|
+
/** @deprecated Use janus.products.getAll() instead. */
|
|
484
531
|
async queryProducts(e) {
|
|
485
|
-
return
|
|
532
|
+
return t.post("/legacy/products/query", e);
|
|
533
|
+
},
|
|
534
|
+
async getPrintList() {
|
|
535
|
+
return t.get("/legacy-printlist");
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function G(t) {
|
|
540
|
+
return {
|
|
541
|
+
async getAll(e) {
|
|
542
|
+
const r = o("/products", e);
|
|
543
|
+
return t.get(r);
|
|
544
|
+
},
|
|
545
|
+
async getById(e) {
|
|
546
|
+
return t.get(`/products/${e}`);
|
|
547
|
+
},
|
|
548
|
+
async create(e) {
|
|
549
|
+
return t.post("/products", e);
|
|
550
|
+
},
|
|
551
|
+
async update(e, r) {
|
|
552
|
+
return t.put(`/products/${e}`, r);
|
|
553
|
+
},
|
|
554
|
+
async delete(e) {
|
|
555
|
+
return t.delete(`/products/${e}`);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
function K(t) {
|
|
560
|
+
return {
|
|
561
|
+
async getAll(e) {
|
|
562
|
+
const r = o("/product-categories", e);
|
|
563
|
+
return t.get(r);
|
|
564
|
+
},
|
|
565
|
+
async getById(e) {
|
|
566
|
+
return t.get(`/product-categories/${e}`);
|
|
567
|
+
},
|
|
568
|
+
async create(e) {
|
|
569
|
+
return t.post("/product-categories", e);
|
|
570
|
+
},
|
|
571
|
+
async update(e, r) {
|
|
572
|
+
return t.put(`/product-categories/${e}`, r);
|
|
573
|
+
},
|
|
574
|
+
async delete(e) {
|
|
575
|
+
return t.delete(`/product-categories/${e}`);
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function M(t) {
|
|
580
|
+
return {
|
|
581
|
+
async getAll(e) {
|
|
582
|
+
const r = o("/stocks", e);
|
|
583
|
+
return t.get(r);
|
|
584
|
+
},
|
|
585
|
+
async getById(e) {
|
|
586
|
+
return t.get(`/stocks/${e}`);
|
|
587
|
+
},
|
|
588
|
+
async create(e) {
|
|
589
|
+
return t.post("/stocks", e);
|
|
590
|
+
},
|
|
591
|
+
async update(e, r) {
|
|
592
|
+
return t.put(`/stocks/${e}`, r);
|
|
593
|
+
},
|
|
594
|
+
async delete(e) {
|
|
595
|
+
return t.delete(`/stocks/${e}`);
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
function Q(t) {
|
|
600
|
+
return {
|
|
601
|
+
async getAll(e) {
|
|
602
|
+
const r = o("/transactions", e);
|
|
603
|
+
return t.get(r);
|
|
604
|
+
},
|
|
605
|
+
async getById(e) {
|
|
606
|
+
return t.get(`/transactions/${e}`);
|
|
607
|
+
},
|
|
608
|
+
async create(e) {
|
|
609
|
+
return t.post("/transactions", e);
|
|
610
|
+
},
|
|
611
|
+
async update(e, r) {
|
|
612
|
+
return t.put(`/transactions/${e}`, r);
|
|
613
|
+
},
|
|
614
|
+
async delete(e) {
|
|
615
|
+
return t.delete(`/transactions/${e}`);
|
|
616
|
+
}
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function Z(t) {
|
|
620
|
+
return {
|
|
621
|
+
async getAll(e) {
|
|
622
|
+
const r = o("/allocations", e);
|
|
623
|
+
return t.get(r);
|
|
624
|
+
},
|
|
625
|
+
async getById(e) {
|
|
626
|
+
return t.get(`/allocations/${e}`);
|
|
627
|
+
},
|
|
628
|
+
async create(e) {
|
|
629
|
+
return t.post("/allocations", e);
|
|
630
|
+
},
|
|
631
|
+
async update(e, r) {
|
|
632
|
+
return t.put(`/allocations/${e}`, r);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
function X(t) {
|
|
637
|
+
return {
|
|
638
|
+
async getAll(e) {
|
|
639
|
+
const r = o("/locations", e);
|
|
640
|
+
return t.get(r);
|
|
641
|
+
},
|
|
642
|
+
async getById(e) {
|
|
643
|
+
return t.get(`/locations/${e}`);
|
|
644
|
+
},
|
|
645
|
+
async create(e) {
|
|
646
|
+
return t.post("/locations", e);
|
|
647
|
+
},
|
|
648
|
+
async update(e, r) {
|
|
649
|
+
return t.put(`/locations/${e}`, r);
|
|
650
|
+
},
|
|
651
|
+
async delete(e) {
|
|
652
|
+
return t.delete(`/locations/${e}`);
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function Y(t) {
|
|
657
|
+
return {
|
|
658
|
+
async getAll(e) {
|
|
659
|
+
const r = o("/audits", e);
|
|
660
|
+
return t.get(r);
|
|
661
|
+
},
|
|
662
|
+
async getById(e) {
|
|
663
|
+
return t.get(`/audits/${e}`);
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function ee(t) {
|
|
668
|
+
return {
|
|
669
|
+
// ── ASN CRUD ─────────────────────────────────
|
|
670
|
+
async getAll(e) {
|
|
671
|
+
const r = o("/asns", e);
|
|
672
|
+
return t.get(r);
|
|
673
|
+
},
|
|
674
|
+
async getById(e) {
|
|
675
|
+
return t.get(`/asns/${e}`);
|
|
676
|
+
},
|
|
677
|
+
async create(e) {
|
|
678
|
+
return t.post("/asns", e);
|
|
679
|
+
},
|
|
680
|
+
async update(e, r) {
|
|
681
|
+
return t.put(`/asns/${e}`, r);
|
|
682
|
+
},
|
|
683
|
+
async delete(e) {
|
|
684
|
+
return t.delete(`/asns/${e}`);
|
|
685
|
+
},
|
|
686
|
+
// ── ASN Lines ────────────────────────────────
|
|
687
|
+
async getLines(e, r) {
|
|
688
|
+
const n = o(`/asns/${e}/lines`, r);
|
|
689
|
+
return t.get(n);
|
|
690
|
+
},
|
|
691
|
+
async getLineById(e, r) {
|
|
692
|
+
return t.get(`/asns/${e}/lines/${r}`);
|
|
693
|
+
},
|
|
694
|
+
async createLine(e, r) {
|
|
695
|
+
const { client_id: n, asn_id: s, ...c } = r;
|
|
696
|
+
return t.post(`/asns/${e}/lines`, {
|
|
697
|
+
client_id: n,
|
|
698
|
+
asn_id: e,
|
|
699
|
+
asn_lines: [c]
|
|
700
|
+
});
|
|
701
|
+
},
|
|
702
|
+
async updateLine(e, r, n) {
|
|
703
|
+
return t.put(`/asns/${e}/lines/${r}`, {
|
|
704
|
+
...n,
|
|
705
|
+
asn_id: e
|
|
706
|
+
});
|
|
707
|
+
},
|
|
708
|
+
async deleteLine(e, r) {
|
|
709
|
+
return t.delete(`/asns/${e}/lines/${r}`);
|
|
710
|
+
},
|
|
711
|
+
// ── ASN Receipts ─────────────────────────────
|
|
712
|
+
async getReceipts(e, r, n) {
|
|
713
|
+
const s = o(`/asns/${e}/lines/${r}/receipts`, n);
|
|
714
|
+
return t.get(s);
|
|
715
|
+
},
|
|
716
|
+
async getReceiptById(e, r, n) {
|
|
717
|
+
return t.get(`/asns/${e}/lines/${r}/receipts/${n}`);
|
|
718
|
+
},
|
|
719
|
+
async createReceipt(e, r, n) {
|
|
720
|
+
return t.post(`/asns/${e}/lines/${r}/receipts`, n);
|
|
721
|
+
},
|
|
722
|
+
async updateReceipt(e, r, n, s) {
|
|
723
|
+
return t.put(`/asns/${e}/lines/${r}/receipts/${n}`, {
|
|
724
|
+
...s,
|
|
725
|
+
asn_id: e,
|
|
726
|
+
asn_line_id: r
|
|
727
|
+
});
|
|
728
|
+
},
|
|
729
|
+
async deleteReceipt(e, r, n) {
|
|
730
|
+
return t.delete(`/asns/${e}/lines/${r}/receipts/${n}`);
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
function te(t) {
|
|
735
|
+
return {
|
|
736
|
+
async getAll(e) {
|
|
737
|
+
const r = o("/dispatches", e);
|
|
738
|
+
return t.get(r);
|
|
739
|
+
},
|
|
740
|
+
async getById(e) {
|
|
741
|
+
return t.get(`/dispatches/${e}`);
|
|
742
|
+
},
|
|
743
|
+
async create(e) {
|
|
744
|
+
return t.post("/dispatches", e);
|
|
745
|
+
},
|
|
746
|
+
async update(e, r) {
|
|
747
|
+
return t.put(`/dispatches/${e}`, r);
|
|
748
|
+
},
|
|
749
|
+
async delete(e) {
|
|
750
|
+
return t.delete(`/dispatches/${e}`);
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
function re(t) {
|
|
755
|
+
return {
|
|
756
|
+
async getByDispatchId(e) {
|
|
757
|
+
return t.get(`/consignments/${e}`);
|
|
758
|
+
},
|
|
759
|
+
async create(e) {
|
|
760
|
+
return t.post("/consignments", e);
|
|
761
|
+
},
|
|
762
|
+
async update(e, r) {
|
|
763
|
+
return t.put(`/consignments/${e}`, r);
|
|
764
|
+
},
|
|
765
|
+
async delete(e) {
|
|
766
|
+
return t.delete(`/consignments/${e}`);
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
function ne(t) {
|
|
771
|
+
return {
|
|
772
|
+
// ── Invoice CRUD ────────────────────────────────────────────
|
|
773
|
+
async getAll(e) {
|
|
774
|
+
const r = o("/invoices", e);
|
|
775
|
+
return t.get(r);
|
|
776
|
+
},
|
|
777
|
+
async getById(e) {
|
|
778
|
+
return t.get(`/invoices/${e}`);
|
|
779
|
+
},
|
|
780
|
+
async create(e) {
|
|
781
|
+
return t.post("/invoices", e);
|
|
782
|
+
},
|
|
783
|
+
async update(e, r) {
|
|
784
|
+
return t.put(`/invoices/${e}`, r);
|
|
785
|
+
},
|
|
786
|
+
async delete(e) {
|
|
787
|
+
return t.delete(`/invoices/${e}`);
|
|
788
|
+
},
|
|
789
|
+
// ── Invoice Lines ───────────────────────────────────────────
|
|
790
|
+
async getLines(e, r) {
|
|
791
|
+
const n = o(`/invoices/${e}/lines`, r);
|
|
792
|
+
return t.get(n);
|
|
793
|
+
},
|
|
794
|
+
async getLineById(e, r) {
|
|
795
|
+
return t.get(`/invoices/${e}/lines/${r}`);
|
|
796
|
+
},
|
|
797
|
+
async createLine(e, r) {
|
|
798
|
+
const { client_id: n, invoice_id: s, ...c } = r;
|
|
799
|
+
return t.post(`/invoices/${e}/lines`, {
|
|
800
|
+
client_id: n,
|
|
801
|
+
invoice_id: e,
|
|
802
|
+
invoice_lines: [{ ...c, invoice_id: e }]
|
|
803
|
+
});
|
|
804
|
+
},
|
|
805
|
+
async updateLine(e, r, n) {
|
|
806
|
+
return t.put(`/invoices/${e}/lines/${r}`, {
|
|
807
|
+
...n,
|
|
808
|
+
invoice_id: e
|
|
809
|
+
});
|
|
810
|
+
},
|
|
811
|
+
async deleteLine(e, r) {
|
|
812
|
+
return t.delete(`/invoices/${e}/lines/${r}`);
|
|
486
813
|
}
|
|
487
814
|
};
|
|
488
815
|
}
|
|
489
|
-
const
|
|
490
|
-
function
|
|
491
|
-
const e =
|
|
816
|
+
const se = "https://api.janus.pelygo.com";
|
|
817
|
+
function oe(t = {}) {
|
|
818
|
+
const e = t.baseUrl || se, r = {
|
|
492
819
|
baseUrl: e,
|
|
493
|
-
authUrl:
|
|
494
|
-
onUnauthorized:
|
|
495
|
-
onLoginSuccess:
|
|
496
|
-
onLoginError:
|
|
497
|
-
}, n =
|
|
820
|
+
authUrl: t.authUrl,
|
|
821
|
+
onUnauthorized: t.onUnauthorized,
|
|
822
|
+
onLoginSuccess: t.onLoginSuccess,
|
|
823
|
+
onLoginError: t.onLoginError
|
|
824
|
+
}, n = L(r), s = T(n), c = b(n), a = x(n), y = N({ baseUrl: e }), g = z(n), d = j(n), $ = q(n), m = J(n), f = D(n), v = H(n), h = V({ baseUrl: e }), R = W(n), p = G(n), S = K(n), I = M(n), C = Q(n), A = Z(n), B = X(n), U = Y(n), w = ee(n), k = te(n), _ = re(n), E = ne(n);
|
|
498
825
|
return {
|
|
499
826
|
clients: s,
|
|
500
827
|
returns: c,
|
|
501
|
-
reports:
|
|
502
|
-
helpers:
|
|
503
|
-
couriers:
|
|
504
|
-
orders:
|
|
505
|
-
integrations:
|
|
506
|
-
users:
|
|
507
|
-
logs:
|
|
508
|
-
tasks:
|
|
828
|
+
reports: a,
|
|
829
|
+
helpers: y,
|
|
830
|
+
couriers: g,
|
|
831
|
+
orders: d,
|
|
832
|
+
integrations: $,
|
|
833
|
+
users: m,
|
|
834
|
+
logs: f,
|
|
835
|
+
tasks: v,
|
|
509
836
|
customer: h,
|
|
510
|
-
legacy:
|
|
837
|
+
legacy: R,
|
|
838
|
+
products: p,
|
|
839
|
+
productCategories: S,
|
|
840
|
+
stocks: I,
|
|
841
|
+
stockTransactions: C,
|
|
842
|
+
stockAllocations: A,
|
|
843
|
+
locations: B,
|
|
844
|
+
audits: U,
|
|
845
|
+
asns: w,
|
|
846
|
+
dispatches: k,
|
|
847
|
+
consignments: _,
|
|
848
|
+
invoices: E,
|
|
511
849
|
auth: n
|
|
512
850
|
};
|
|
513
851
|
}
|
|
514
|
-
class
|
|
515
|
-
constructor(e,
|
|
516
|
-
super(e), this.name = "JanusApiError", this.status =
|
|
852
|
+
class i extends Error {
|
|
853
|
+
constructor(e, r, n) {
|
|
854
|
+
super(e), this.name = "JanusApiError", this.status = r, this.response = n;
|
|
517
855
|
const s = Error;
|
|
518
|
-
s.captureStackTrace && s.captureStackTrace(this,
|
|
856
|
+
s.captureStackTrace && s.captureStackTrace(this, i);
|
|
519
857
|
}
|
|
520
858
|
}
|
|
521
|
-
class
|
|
522
|
-
constructor(e = "Unauthorized",
|
|
523
|
-
super(e, 401,
|
|
859
|
+
class ce extends i {
|
|
860
|
+
constructor(e = "Unauthorized", r) {
|
|
861
|
+
super(e, 401, r), this.name = "UnauthorizedError";
|
|
524
862
|
}
|
|
525
863
|
}
|
|
526
|
-
class
|
|
527
|
-
constructor(e = "Forbidden",
|
|
528
|
-
super(e, 403,
|
|
864
|
+
class ae extends i {
|
|
865
|
+
constructor(e = "Forbidden", r) {
|
|
866
|
+
super(e, 403, r), this.name = "ForbiddenError";
|
|
529
867
|
}
|
|
530
868
|
}
|
|
531
|
-
class
|
|
532
|
-
constructor(e = "Not Found",
|
|
533
|
-
super(e, 404,
|
|
869
|
+
class ie extends i {
|
|
870
|
+
constructor(e = "Not Found", r) {
|
|
871
|
+
super(e, 404, r), this.name = "NotFoundError";
|
|
534
872
|
}
|
|
535
873
|
}
|
|
536
|
-
class
|
|
537
|
-
constructor(e = "Validation Error",
|
|
538
|
-
super(e, 400, n), this.name = "ValidationError", this.errors =
|
|
874
|
+
class ye extends i {
|
|
875
|
+
constructor(e = "Validation Error", r, n) {
|
|
876
|
+
super(e, 400, n), this.name = "ValidationError", this.errors = r;
|
|
539
877
|
}
|
|
540
878
|
}
|
|
541
|
-
function
|
|
542
|
-
return
|
|
879
|
+
function le(t) {
|
|
880
|
+
return t instanceof i;
|
|
543
881
|
}
|
|
544
|
-
function
|
|
545
|
-
return
|
|
882
|
+
function ge(t) {
|
|
883
|
+
return t instanceof ce;
|
|
546
884
|
}
|
|
547
885
|
export {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
886
|
+
se as DEFAULT_JANUS_URL,
|
|
887
|
+
ae as ForbiddenError,
|
|
888
|
+
i as JanusApiError,
|
|
889
|
+
ie as NotFoundError,
|
|
890
|
+
ce as UnauthorizedError,
|
|
891
|
+
ye as ValidationError,
|
|
892
|
+
o as buildClientScopedPaginatedUrl,
|
|
893
|
+
l as buildPaginatedUrl,
|
|
894
|
+
O as buildQueryString,
|
|
555
895
|
u as buildUrl,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
896
|
+
oe as createJanusApi,
|
|
897
|
+
le as isJanusApiError,
|
|
898
|
+
ge as isUnauthorizedError
|
|
559
899
|
};
|