@delopay/sdk 0.365.0 → 0.368.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-DBE6IDBL.js";
302
+ } from "./chunk-RD3HP3EY.js";
302
303
 
303
304
  // src/internal/resources/admin.ts
304
305
  var Admin = class {
@@ -742,6 +743,27 @@ var AdminPortal = class {
742
743
  query: { ...preventionCaseQuery(filters), ...merchant_id ? { merchant_id } : {} }
743
744
  });
744
745
  }
746
+ /** Chargeback prevention refund rules across merchants, or of one merchant. */
747
+ async listChargebackPreventionRefundRules(params) {
748
+ return this.request("GET", "/admin-portal/chargeback-prevention/refund-rules", {
749
+ query: params
750
+ });
751
+ }
752
+ /**
753
+ * Turn a merchant's refund rule off. Its settings are kept, and what it
754
+ * already did is still settled and reported.
755
+ */
756
+ async stopChargebackPreventionRefundRule(body) {
757
+ return this.request("POST", "/admin-portal/chargeback-prevention/refund-rules/disable", {
758
+ body
759
+ });
760
+ }
761
+ /** What refund rules did, across merchants or for one merchant. */
762
+ async listChargebackPreventionRefundActions(params) {
763
+ return this.request("GET", "/admin-portal/chargeback-prevention/refund-actions", {
764
+ query: params
765
+ });
766
+ }
745
767
  /** One chargeback prevention case of any merchant, with its history. */
746
768
  async getChargebackPreventionCase(caseId) {
747
769
  return this.request(
@@ -906,6 +928,15 @@ var AdminPortal = class {
906
928
  query
907
929
  });
908
930
  }
931
+ /**
932
+ * Every shop's device intelligence account, with its assessments per environment and
933
+ * its error rate over the last `window_days` days. The error rate counts finished
934
+ * assessments: one still running and a payment naming no buyer are not errors.
935
+ * `GET /admin-portal/device-intelligence`
936
+ */
937
+ async deviceIntelligenceUsage() {
938
+ return this.request("GET", "/admin-portal/device-intelligence");
939
+ }
909
940
  /**
910
941
  * Device analytics over the canonical client-context observation per
911
942
  * payment, rooted at all merchants and drillable via `merchant_id` /
@@ -1717,6 +1748,65 @@ function adminAccount(merchantId) {
1717
1748
  return `/admin-portal/accounts/${encodeURIComponent(merchantId)}`;
1718
1749
  }
1719
1750
 
1751
+ // src/internal/resources/adminSupport.ts
1752
+ var path = (id) => `/admin-portal/support/conversations/${encodeURIComponent(id)}`;
1753
+ var AdminSupport = class {
1754
+ constructor(request) {
1755
+ this.request = request;
1756
+ }
1757
+ /** The queue. `GET /admin-portal/support/conversations` */
1758
+ async list(query) {
1759
+ return this.request("GET", "/admin-portal/support/conversations", {
1760
+ query: query === void 0 ? void 0 : { ...query }
1761
+ });
1762
+ }
1763
+ /** One conversation. `GET /admin-portal/support/conversations/{id}` */
1764
+ async retrieve(id) {
1765
+ return this.request("GET", path(id));
1766
+ }
1767
+ /** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */
1768
+ async update(id, body) {
1769
+ return this.request("PATCH", path(id), { body });
1770
+ }
1771
+ /** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */
1772
+ async messages(id, query) {
1773
+ return this.request("GET", `${path(id)}/messages`, {
1774
+ query: query === void 0 ? void 0 : { ...query }
1775
+ });
1776
+ }
1777
+ /** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */
1778
+ async reply(id, body) {
1779
+ return this.request("POST", `${path(id)}/messages`, { body });
1780
+ }
1781
+ /**
1782
+ * Upload a file for a message from staff, scanned like a merchant's.
1783
+ * `POST /admin-portal/support/conversations/{id}/attachments`
1784
+ */
1785
+ async uploadAttachment(id, file, clientUploadId, fileName) {
1786
+ const form = new FormData();
1787
+ form.append("client_upload_id", clientUploadId);
1788
+ if (fileName === void 0) form.append("file", file);
1789
+ else form.append("file", file, fileName);
1790
+ return this.request("POST", `${path(id)}/attachments`, { body: form });
1791
+ }
1792
+ /**
1793
+ * Fetch a file once its scan is clean. A blocked file stays shut for staff too.
1794
+ * `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`
1795
+ */
1796
+ async downloadAttachment(id, fileId) {
1797
+ return this.request("GET", `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {
1798
+ responseType: "blob"
1799
+ });
1800
+ }
1801
+ /**
1802
+ * Clear the staff unread mark and read the conversation as it is now.
1803
+ * `POST /admin-portal/support/conversations/{id}/read`
1804
+ */
1805
+ async markRead(id) {
1806
+ return this.request("POST", `${path(id)}/read`);
1807
+ }
1808
+ };
1809
+
1720
1810
  // src/internal/resources/auditLogs.ts
1721
1811
  var AuditLogs = class {
1722
1812
  constructor(request) {
@@ -2496,6 +2586,7 @@ var DelopayInternal = class extends Delopay {
2496
2586
  const request = this.request.bind(this);
2497
2587
  this.admin = new Admin(request);
2498
2588
  this.adminPortal = new AdminPortal(request);
2589
+ this.adminSupport = new AdminSupport(request);
2499
2590
  const openStream = this.openEventStream.bind(this);
2500
2591
  this.adminLive = new AdminLive(request, openStream);
2501
2592
  this.adminBranding = new AdminBranding(request);
@@ -2534,6 +2625,7 @@ export {
2534
2625
  AdminBranding,
2535
2626
  AdminLive,
2536
2627
  AdminPortal,
2628
+ AdminSupport,
2537
2629
  Analytics,
2538
2630
  AnalyticsDashboard,
2539
2631
  Audit,
@@ -2681,6 +2773,7 @@ export {
2681
2773
  Settlement,
2682
2774
  ShopLabels,
2683
2775
  Subscriptions,
2776
+ Support,
2684
2777
  UNKNOWN_SECTION_ORDER,
2685
2778
  WCAG_AA_TEXT,
2686
2779
  WCAG_AA_UI,