@delopay/sdk 0.312.0 → 0.319.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
@@ -265,7 +265,7 @@ import {
265
265
  visibleCustomFields,
266
266
  whopAccentSwatch,
267
267
  whopCardElement
268
- } from "./chunk-FRYFAWLF.js";
268
+ } from "./chunk-4QNMF3GL.js";
269
269
 
270
270
  // src/internal/resources/admin.ts
271
271
  var Admin = class {
@@ -808,12 +808,13 @@ var AdminPortal = class {
808
808
  return this.request("POST", "/admin-portal/analytics/exclusions/copy", { body });
809
809
  }
810
810
  /**
811
- * Shop comparison for one merchant: one series per shop over one window,
812
- * with whole-window and previous-window totals. `merchant_id` is required
813
- * (400 without it). Same contract as the merchant surface's
814
- * `analytics.shops`. `GET /admin-portal/analytics/shops`
811
+ * Shop comparison: one series per shop over one window, with whole-window
812
+ * and previous-window totals. With `merchant_id`, that merchant's shops;
813
+ * without it, the top `limit` (default 50) shops of every merchant by
814
+ * successful volume, the rest summed into `others`. Same contract as the
815
+ * merchant surface's `analytics.shops`. `GET /admin-portal/analytics/shops`
815
816
  */
816
- async analyticsShops(params) {
817
+ async analyticsShops(params = {}) {
817
818
  const query = params;
818
819
  return this.request("GET", "/admin-portal/analytics/shops", {
819
820
  query
@@ -1462,6 +1463,121 @@ var AdminPortal = class {
1462
1463
  async getRiskBackfill(jobId) {
1463
1464
  return this.request("GET", `/admin-portal/risk-engine/backfill/${encodeURIComponent(jobId)}`);
1464
1465
  }
1466
+ /**
1467
+ * Where a merchant stands in the risk policy (`merchant_risk.policy`): the
1468
+ * policy in force, the stage, the conditions of the last evaluation with
1469
+ * their evidence, pending and past actions, exemptions and stage changes.
1470
+ *
1471
+ * `GET /admin-portal/accounts/{merchant_id}/risk/stage`
1472
+ */
1473
+ async getMerchantRiskStage(merchantId) {
1474
+ return this.request("GET", `${adminAccount(merchantId)}/risk/stage`);
1475
+ }
1476
+ /**
1477
+ * Evaluate a merchant against its risk policy now, as the scoring pass
1478
+ * does, and answer where it stands afterwards. Needs `AccountManage`.
1479
+ *
1480
+ * `POST /admin-portal/accounts/{merchant_id}/risk/stage/evaluate`
1481
+ */
1482
+ async evaluateMerchantRiskStage(merchantId) {
1483
+ return this.request("POST", `${adminAccount(merchantId)}/risk/stage/evaluate`, { body: {} });
1484
+ }
1485
+ /**
1486
+ * Apply a pending action that waits for an operator. An action already
1487
+ * decided, suppressed or expired is refused with `DE_19` (HTTP 409).
1488
+ *
1489
+ * `POST /admin-portal/accounts/{merchant_id}/risk/actions/{action_id}/confirm`
1490
+ */
1491
+ async confirmMerchantRiskAction(merchantId, actionId, params = {}) {
1492
+ return this.request(
1493
+ "POST",
1494
+ `${adminAccount(merchantId)}/risk/actions/${encodeURIComponent(actionId)}/confirm`,
1495
+ { body: params }
1496
+ );
1497
+ }
1498
+ /**
1499
+ * Dismiss a pending action with a reason; it never applies. An action
1500
+ * already decided is refused with `DE_19` (HTTP 409).
1501
+ *
1502
+ * `POST /admin-portal/accounts/{merchant_id}/risk/actions/{action_id}/dismiss`
1503
+ */
1504
+ async dismissMerchantRiskAction(merchantId, actionId, params) {
1505
+ return this.request(
1506
+ "POST",
1507
+ `${adminAccount(merchantId)}/risk/actions/${encodeURIComponent(actionId)}/dismiss`,
1508
+ { body: params }
1509
+ );
1510
+ }
1511
+ /**
1512
+ * Exempt a merchant from one action for one risk dimension, until
1513
+ * `expires_at` or for good. An exempted action is recorded as `suppressed`
1514
+ * with the exemption's id; the stage itself is still entered.
1515
+ *
1516
+ * `POST /admin-portal/accounts/{merchant_id}/risk/exemptions`
1517
+ */
1518
+ async createMerchantRiskExemption(merchantId, params) {
1519
+ return this.request("POST", `${adminAccount(merchantId)}/risk/exemptions`, { body: params });
1520
+ }
1521
+ /**
1522
+ * End an exemption now, with a reason. It no longer suppresses anything
1523
+ * from the next evaluation on.
1524
+ *
1525
+ * `POST /admin-portal/accounts/{merchant_id}/risk/exemptions/{exemption_id}/revoke`
1526
+ */
1527
+ async revokeMerchantRiskExemption(merchantId, exemptionId, params) {
1528
+ return this.request(
1529
+ "POST",
1530
+ `${adminAccount(merchantId)}/risk/exemptions/${encodeURIComponent(exemptionId)}/revoke`,
1531
+ { body: params }
1532
+ );
1533
+ }
1534
+ /**
1535
+ * Lift an applied `restrict_payments`, `hold_payouts` or `suspend` action
1536
+ * with a reason: what it blocked is allowed again, and nothing else
1537
+ * changes. The merchant stays in its stage and the action stays lifted for
1538
+ * the rest of that stage entry. An action that is not applied, not one of
1539
+ * those kinds, or already lifted is refused with `DE_19` (HTTP 409).
1540
+ *
1541
+ * `POST /admin-portal/accounts/{merchant_id}/risk/actions/{action_id}/lift`
1542
+ */
1543
+ async liftMerchantRiskAction(merchantId, actionId, params) {
1544
+ return this.request(
1545
+ "POST",
1546
+ `${adminAccount(merchantId)}/risk/actions/${encodeURIComponent(actionId)}/lift`,
1547
+ { body: params }
1548
+ );
1549
+ }
1550
+ /**
1551
+ * The payments and payouts a merchant's applied risk actions refused,
1552
+ * newest first; 50 unless `limit` (at most 200) says otherwise.
1553
+ *
1554
+ * `GET /admin-portal/accounts/{merchant_id}/risk/blocked-attempts`
1555
+ */
1556
+ async listMerchantRiskBlockedAttempts(merchantId, params) {
1557
+ return this.request("GET", `${adminAccount(merchantId)}/risk/blocked-attempts`, {
1558
+ query: params === void 0 ? void 0 : { ...params }
1559
+ });
1560
+ }
1561
+ /**
1562
+ * Every merchant risk action kind and whether this platform can use it,
1563
+ * with its default mode, its scopes and what it blocks.
1564
+ *
1565
+ * `GET /admin-portal/risk/actions/catalog`
1566
+ */
1567
+ async getMerchantRiskActionCatalog() {
1568
+ return this.request("GET", "/admin-portal/risk/actions/catalog");
1569
+ }
1570
+ /**
1571
+ * Which merchants a risk policy, saved or not, would put in each stage now,
1572
+ * from their stored signals, and what each action would block there.
1573
+ * Writes nothing. A policy a settings write would refuse is refused the
1574
+ * same way (HTTP 422).
1575
+ *
1576
+ * `POST /admin-portal/risk/policy/preview`
1577
+ */
1578
+ async previewMerchantRiskPolicy(params) {
1579
+ return this.request("POST", "/admin-portal/risk/policy/preview", { body: params });
1580
+ }
1465
1581
  };
1466
1582
  function transactionListQuery(params) {
1467
1583
  if (!params) return void 0;