@delopay/sdk 0.366.0 → 0.370.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/internal.js CHANGED
@@ -147,6 +147,7 @@ import {
147
147
  Settlement,
148
148
  ShopLabels,
149
149
  Subscriptions,
150
+ Support,
150
151
  UNKNOWN_SECTION_ORDER,
151
152
  WCAG_AA_TEXT,
152
153
  WCAG_AA_UI,
@@ -298,7 +299,7 @@ import {
298
299
  visibleCustomFields,
299
300
  whopAccentSwatch,
300
301
  whopCardElement
301
- } from "./chunk-ESYKTYJA.js";
302
+ } from "./chunk-RD3HP3EY.js";
302
303
 
303
304
  // src/internal/resources/admin.ts
304
305
  var Admin = class {
@@ -367,6 +368,60 @@ var AdminBranding = class {
367
368
  }
368
369
  };
369
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
+
370
425
  // src/internal/resources/adminLive.ts
371
426
  var AdminLive = class {
372
427
  constructor(request, openStream) {
@@ -927,6 +982,15 @@ var AdminPortal = class {
927
982
  query
928
983
  });
929
984
  }
985
+ /**
986
+ * Every shop's device intelligence account, with its assessments per environment and
987
+ * its error rate over the last `window_days` days. The error rate counts finished
988
+ * assessments: one still running and a payment naming no buyer are not errors.
989
+ * `GET /admin-portal/device-intelligence`
990
+ */
991
+ async deviceIntelligenceUsage() {
992
+ return this.request("GET", "/admin-portal/device-intelligence");
993
+ }
930
994
  /**
931
995
  * Device analytics over the canonical client-context observation per
932
996
  * payment, rooted at all merchants and drillable via `merchant_id` /
@@ -1738,6 +1802,65 @@ function adminAccount(merchantId) {
1738
1802
  return `/admin-portal/accounts/${encodeURIComponent(merchantId)}`;
1739
1803
  }
1740
1804
 
1805
+ // src/internal/resources/adminSupport.ts
1806
+ var path2 = (id) => `/admin-portal/support/conversations/${encodeURIComponent(id)}`;
1807
+ var AdminSupport = class {
1808
+ constructor(request) {
1809
+ this.request = request;
1810
+ }
1811
+ /** The queue. `GET /admin-portal/support/conversations` */
1812
+ async list(query) {
1813
+ return this.request("GET", "/admin-portal/support/conversations", {
1814
+ query: query === void 0 ? void 0 : { ...query }
1815
+ });
1816
+ }
1817
+ /** One conversation. `GET /admin-portal/support/conversations/{id}` */
1818
+ async retrieve(id) {
1819
+ return this.request("GET", path2(id));
1820
+ }
1821
+ /** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */
1822
+ async update(id, body) {
1823
+ return this.request("PATCH", path2(id), { body });
1824
+ }
1825
+ /** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */
1826
+ async messages(id, query) {
1827
+ return this.request("GET", `${path2(id)}/messages`, {
1828
+ query: query === void 0 ? void 0 : { ...query }
1829
+ });
1830
+ }
1831
+ /** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */
1832
+ async reply(id, body) {
1833
+ return this.request("POST", `${path2(id)}/messages`, { body });
1834
+ }
1835
+ /**
1836
+ * Upload a file for a message from staff, scanned like a merchant's.
1837
+ * `POST /admin-portal/support/conversations/{id}/attachments`
1838
+ */
1839
+ async uploadAttachment(id, file, clientUploadId, fileName) {
1840
+ const form = new FormData();
1841
+ form.append("client_upload_id", clientUploadId);
1842
+ if (fileName === void 0) form.append("file", file);
1843
+ else form.append("file", file, fileName);
1844
+ return this.request("POST", `${path2(id)}/attachments`, { body: form });
1845
+ }
1846
+ /**
1847
+ * Fetch a file once its scan is clean. A blocked file stays shut for staff too.
1848
+ * `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`
1849
+ */
1850
+ async downloadAttachment(id, fileId) {
1851
+ return this.request("GET", `${path2(id)}/attachments/${encodeURIComponent(fileId)}`, {
1852
+ responseType: "blob"
1853
+ });
1854
+ }
1855
+ /**
1856
+ * Clear the staff unread mark and read the conversation as it is now.
1857
+ * `POST /admin-portal/support/conversations/{id}/read`
1858
+ */
1859
+ async markRead(id) {
1860
+ return this.request("POST", `${path2(id)}/read`);
1861
+ }
1862
+ };
1863
+
1741
1864
  // src/internal/resources/auditLogs.ts
1742
1865
  var AuditLogs = class {
1743
1866
  constructor(request) {
@@ -2517,6 +2640,8 @@ var DelopayInternal = class extends Delopay {
2517
2640
  const request = this.request.bind(this);
2518
2641
  this.admin = new Admin(request);
2519
2642
  this.adminPortal = new AdminPortal(request);
2643
+ this.adminSupport = new AdminSupport(request);
2644
+ this.adminIndustries = new AdminIndustries(request);
2520
2645
  const openStream = this.openEventStream.bind(this);
2521
2646
  this.adminLive = new AdminLive(request, openStream);
2522
2647
  this.adminBranding = new AdminBranding(request);
@@ -2553,8 +2678,10 @@ export {
2553
2678
  APPLE_PAY_BUTTON_TYPES,
2554
2679
  Admin,
2555
2680
  AdminBranding,
2681
+ AdminIndustries,
2556
2682
  AdminLive,
2557
2683
  AdminPortal,
2684
+ AdminSupport,
2558
2685
  Analytics,
2559
2686
  AnalyticsDashboard,
2560
2687
  Audit,
@@ -2702,6 +2829,7 @@ export {
2702
2829
  Settlement,
2703
2830
  ShopLabels,
2704
2831
  Subscriptions,
2832
+ Support,
2705
2833
  UNKNOWN_SECTION_ORDER,
2706
2834
  WCAG_AA_TEXT,
2707
2835
  WCAG_AA_UI,