@delopay/sdk 0.368.0 → 0.371.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-DW1C5mFq.d.cts → index-CPJbLuop.d.cts} +133 -4
- package/dist/{index-DW1C5mFq.d.ts → index-CPJbLuop.d.ts} +133 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/internal.cjs +105 -48
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +200 -3
- package/dist/internal.d.ts +200 -3
- package/dist/internal.js +64 -8
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
package/dist/internal.js
CHANGED
|
@@ -368,6 +368,60 @@ var AdminBranding = class {
|
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
|
|
371
|
+
// src/internal/resources/adminIndustries.ts
|
|
372
|
+
var path = (id) => `/admin-portal/industries/${encodeURIComponent(id)}`;
|
|
373
|
+
var AdminIndustries = class {
|
|
374
|
+
constructor(request) {
|
|
375
|
+
this.request = request;
|
|
376
|
+
}
|
|
377
|
+
/** The whole catalog, archived entries included. `GET /admin-portal/industries` */
|
|
378
|
+
async list() {
|
|
379
|
+
return this.request("GET", "/admin-portal/industries");
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Create an industry, or a sub-industry under `parent_id`. Without
|
|
383
|
+
* `availability` it can be selected nowhere until availability is set.
|
|
384
|
+
* `POST /admin-portal/industries`
|
|
385
|
+
*/
|
|
386
|
+
async create(body) {
|
|
387
|
+
return this.request("POST", "/admin-portal/industries", { body });
|
|
388
|
+
}
|
|
389
|
+
/** Rename an entry; its id stays. `PATCH /admin-portal/industries/{industry_id}` */
|
|
390
|
+
async rename(industryId, body) {
|
|
391
|
+
return this.request("PATCH", path(industryId), { body });
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Stop offering an entry, and for an industry its sub-industries, for new
|
|
395
|
+
* selections. Existing selections keep it. `POST /admin-portal/industries/{industry_id}/archive`
|
|
396
|
+
*/
|
|
397
|
+
async archive(industryId) {
|
|
398
|
+
return this.request("POST", `${path(industryId)}/archive`);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Offer an archived entry again. Refused while an active sibling holds its
|
|
402
|
+
* name, or for a sub-industry while its industry is archived.
|
|
403
|
+
* `POST /admin-portal/industries/{industry_id}/restore`
|
|
404
|
+
*/
|
|
405
|
+
async restore(industryId) {
|
|
406
|
+
return this.request("POST", `${path(industryId)}/restore`);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Replace where an entry can be selected.
|
|
410
|
+
* `PUT /admin-portal/industries/{industry_id}/availability`
|
|
411
|
+
*/
|
|
412
|
+
async setAvailability(industryId, body) {
|
|
413
|
+
return this.request("PUT", `${path(industryId)}/availability`, { body });
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Every entry as seen from one merchant, or one of its projects or shops:
|
|
417
|
+
* whether it can be selected there, why, and which scope grants it.
|
|
418
|
+
* `GET /admin-portal/industries/preview`
|
|
419
|
+
*/
|
|
420
|
+
async preview(query) {
|
|
421
|
+
return this.request("GET", "/admin-portal/industries/preview", { query: { ...query } });
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
|
|
371
425
|
// src/internal/resources/adminLive.ts
|
|
372
426
|
var AdminLive = class {
|
|
373
427
|
constructor(request, openStream) {
|
|
@@ -1749,7 +1803,7 @@ function adminAccount(merchantId) {
|
|
|
1749
1803
|
}
|
|
1750
1804
|
|
|
1751
1805
|
// src/internal/resources/adminSupport.ts
|
|
1752
|
-
var
|
|
1806
|
+
var path2 = (id) => `/admin-portal/support/conversations/${encodeURIComponent(id)}`;
|
|
1753
1807
|
var AdminSupport = class {
|
|
1754
1808
|
constructor(request) {
|
|
1755
1809
|
this.request = request;
|
|
@@ -1762,21 +1816,21 @@ var AdminSupport = class {
|
|
|
1762
1816
|
}
|
|
1763
1817
|
/** One conversation. `GET /admin-portal/support/conversations/{id}` */
|
|
1764
1818
|
async retrieve(id) {
|
|
1765
|
-
return this.request("GET",
|
|
1819
|
+
return this.request("GET", path2(id));
|
|
1766
1820
|
}
|
|
1767
1821
|
/** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */
|
|
1768
1822
|
async update(id, body) {
|
|
1769
|
-
return this.request("PATCH",
|
|
1823
|
+
return this.request("PATCH", path2(id), { body });
|
|
1770
1824
|
}
|
|
1771
1825
|
/** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */
|
|
1772
1826
|
async messages(id, query) {
|
|
1773
|
-
return this.request("GET", `${
|
|
1827
|
+
return this.request("GET", `${path2(id)}/messages`, {
|
|
1774
1828
|
query: query === void 0 ? void 0 : { ...query }
|
|
1775
1829
|
});
|
|
1776
1830
|
}
|
|
1777
1831
|
/** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */
|
|
1778
1832
|
async reply(id, body) {
|
|
1779
|
-
return this.request("POST", `${
|
|
1833
|
+
return this.request("POST", `${path2(id)}/messages`, { body });
|
|
1780
1834
|
}
|
|
1781
1835
|
/**
|
|
1782
1836
|
* Upload a file for a message from staff, scanned like a merchant's.
|
|
@@ -1787,14 +1841,14 @@ var AdminSupport = class {
|
|
|
1787
1841
|
form.append("client_upload_id", clientUploadId);
|
|
1788
1842
|
if (fileName === void 0) form.append("file", file);
|
|
1789
1843
|
else form.append("file", file, fileName);
|
|
1790
|
-
return this.request("POST", `${
|
|
1844
|
+
return this.request("POST", `${path2(id)}/attachments`, { body: form });
|
|
1791
1845
|
}
|
|
1792
1846
|
/**
|
|
1793
1847
|
* Fetch a file once its scan is clean. A blocked file stays shut for staff too.
|
|
1794
1848
|
* `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`
|
|
1795
1849
|
*/
|
|
1796
1850
|
async downloadAttachment(id, fileId) {
|
|
1797
|
-
return this.request("GET", `${
|
|
1851
|
+
return this.request("GET", `${path2(id)}/attachments/${encodeURIComponent(fileId)}`, {
|
|
1798
1852
|
responseType: "blob"
|
|
1799
1853
|
});
|
|
1800
1854
|
}
|
|
@@ -1803,7 +1857,7 @@ var AdminSupport = class {
|
|
|
1803
1857
|
* `POST /admin-portal/support/conversations/{id}/read`
|
|
1804
1858
|
*/
|
|
1805
1859
|
async markRead(id) {
|
|
1806
|
-
return this.request("POST", `${
|
|
1860
|
+
return this.request("POST", `${path2(id)}/read`);
|
|
1807
1861
|
}
|
|
1808
1862
|
};
|
|
1809
1863
|
|
|
@@ -2587,6 +2641,7 @@ var DelopayInternal = class extends Delopay {
|
|
|
2587
2641
|
this.admin = new Admin(request);
|
|
2588
2642
|
this.adminPortal = new AdminPortal(request);
|
|
2589
2643
|
this.adminSupport = new AdminSupport(request);
|
|
2644
|
+
this.adminIndustries = new AdminIndustries(request);
|
|
2590
2645
|
const openStream = this.openEventStream.bind(this);
|
|
2591
2646
|
this.adminLive = new AdminLive(request, openStream);
|
|
2592
2647
|
this.adminBranding = new AdminBranding(request);
|
|
@@ -2623,6 +2678,7 @@ export {
|
|
|
2623
2678
|
APPLE_PAY_BUTTON_TYPES,
|
|
2624
2679
|
Admin,
|
|
2625
2680
|
AdminBranding,
|
|
2681
|
+
AdminIndustries,
|
|
2626
2682
|
AdminLive,
|
|
2627
2683
|
AdminPortal,
|
|
2628
2684
|
AdminSupport,
|