@delopay/sdk 0.398.0 → 0.403.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
@@ -116,6 +116,7 @@ import {
116
116
  PAYPAL_CARD_LAYOUTS,
117
117
  PAYPAL_LABEL_STYLES,
118
118
  PRESENTATION_CONTRACT_VERSION,
119
+ PayoutDestinations,
119
120
  PaypalDisputes,
120
121
  Persons,
121
122
  PresentationCache,
@@ -305,7 +306,7 @@ import {
305
306
  visibleCustomFields,
306
307
  whopAccentSwatch,
307
308
  whopCardElement
308
- } from "./chunk-BI74VQSZ.js";
309
+ } from "./chunk-JJE7PY3K.js";
309
310
 
310
311
  // src/internal/resources/admin.ts
311
312
  var Admin = class {
@@ -717,6 +718,97 @@ var AdminPortal = class {
717
718
  { query: params }
718
719
  );
719
720
  }
721
+ /**
722
+ * Every staff flag of a person, active and removed, newest first, with
723
+ * those of the persons merged into it. A merged person reads as the person
724
+ * it merged into. Staff only; a flag changes no payment.
725
+ *
726
+ * `GET /admin-portal/persons/{merchantId}/{personId}/flags`
727
+ */
728
+ async listPersonFlags(merchantId, personId) {
729
+ return this.request("GET", personFlags(merchantId, personId));
730
+ }
731
+ /**
732
+ * Flags a person for staff. The flag changes no payment and the merchant
733
+ * never sees it. A merged person's flag goes on the person it merged into.
734
+ * A person already flagged is refused with `IR_38` (400); a staff role that
735
+ * may not flag buyers gets a `403`.
736
+ *
737
+ * `POST /admin-portal/persons/{merchantId}/{personId}/flags`
738
+ */
739
+ async flagPerson(merchantId, personId, body) {
740
+ return this.request("POST", personFlags(merchantId, personId), { body });
741
+ }
742
+ /**
743
+ * Replaces an active flag's reason and note at the `version` read. A
744
+ * colleague's newer change, or a removal, since that read is refused with
745
+ * `IR_16` (400) rather than overwritten.
746
+ *
747
+ * `PUT /admin-portal/persons/{merchantId}/{personId}/flags/{flagId}`
748
+ */
749
+ async updatePersonFlag(merchantId, personId, flagId, body) {
750
+ return this.request(
751
+ "PUT",
752
+ `${personFlags(merchantId, personId)}/${encodeURIComponent(flagId)}`,
753
+ { body }
754
+ );
755
+ }
756
+ /**
757
+ * Removes a flag at the `version` read: the flag stops and stays in the
758
+ * history with who removed it and when, which is what this answers. A
759
+ * colleague's change since that read is refused with `IR_16` (400).
760
+ *
761
+ * `DELETE /admin-portal/persons/{merchantId}/{personId}/flags/{flagId}?version=`
762
+ */
763
+ async removePersonFlag(merchantId, personId, flagId, version) {
764
+ return this.request(
765
+ "DELETE",
766
+ `${personFlags(merchantId, personId)}/${encodeURIComponent(flagId)}`,
767
+ { query: { version } }
768
+ );
769
+ }
770
+ /**
771
+ * One page of a merchant's persons with an active flag, newest flag first.
772
+ * A flag on a merged person is listed under the person it merged into, and
773
+ * a person with two active flags is listed once, with the newer one.
774
+ *
775
+ * `GET /admin-portal/persons/{merchantId}/flagged`
776
+ */
777
+ async listFlaggedPersons(merchantId, params) {
778
+ if (params === void 0) {
779
+ return this.request("GET", `${adminPersons(merchantId)}/flagged`);
780
+ }
781
+ return this.request("GET", `${adminPersons(merchantId)}/flagged`, {
782
+ query: params
783
+ });
784
+ }
785
+ /**
786
+ * Whether each of 1 to 100 persons of a merchant is flagged, one answer
787
+ * per asked person in the order asked. A merged person answers for the
788
+ * person it merged into; an unknown person is not flagged. No id, or more
789
+ * than 100, is a `400`.
790
+ *
791
+ * `GET /admin-portal/persons/{merchantId}/flag-status?person_ids=`
792
+ */
793
+ async personFlagStatus(merchantId, personIds) {
794
+ return this.request("GET", `${adminPersons(merchantId)}/flag-status`, {
795
+ query: { person_ids: personIds.join(",") }
796
+ });
797
+ }
798
+ /**
799
+ * Persons flagged by staff at other merchants who share an email address
800
+ * or a device id with this person's 100 most recent payments, each once,
801
+ * newest flag first. A card, an IP address or device traits never match.
802
+ * A hint only: the persons stay separate and nothing is written.
803
+ *
804
+ * `GET /admin-portal/persons/{merchantId}/{personId}/flagged-elsewhere`
805
+ */
806
+ async listFlaggedElsewhere(merchantId, personId) {
807
+ return this.request(
808
+ "GET",
809
+ `${adminPersons(merchantId)}/${encodeURIComponent(personId)}/flagged-elsewhere`
810
+ );
811
+ }
720
812
  async exportTransactions(params, options) {
721
813
  return runExport(
722
814
  this.request,
@@ -737,7 +829,8 @@ var AdminPortal = class {
737
829
  }
738
830
  /**
739
831
  * Full detail for a single transaction of ANY merchant — the same
740
- * `PaymentResponse` the merchant `payments.retrieve` returns. Admin-scoped:
832
+ * `PaymentResponse` the merchant `payments.retrieve` returns, with what only
833
+ * staff see beside it (`person_flagged`, `flagged_elsewhere`). Admin-scoped:
741
834
  * the JWT (or admin API key) does not need to belong to the payment's
742
835
  * merchant; the backend resolves the owning merchant and reads it read-only
743
836
  * (no connector sync).
@@ -1102,13 +1195,32 @@ var AdminPortal = class {
1102
1195
  });
1103
1196
  }
1104
1197
  /**
1105
- * Every shop's device intelligence account, with its assessments per environment and
1106
- * its error rate over the last `window_days` days. The error rate counts finished
1107
- * assessments: one still running and a payment naming no buyer are not errors.
1198
+ * Every shop's device intelligence account, with its merchant's and its own
1199
+ * name and its assessments per environment over the last `days` days: counts
1200
+ * and error rate, failures by reason, finished assessments per day and
1201
+ * provider, the last recorded assessment, browser payments against assessed
1202
+ * ones, and the payments held for a missing assessment. The error rate counts
1203
+ * finished assessments: one still running and a payment naming no buyer are
1204
+ * not errors.
1108
1205
  * `GET /admin-portal/device-intelligence`
1109
1206
  */
1110
- async deviceIntelligenceUsage() {
1111
- return this.request("GET", "/admin-portal/device-intelligence");
1207
+ async deviceIntelligenceUsage(params = {}) {
1208
+ return this.request("GET", "/admin-portal/device-intelligence", {
1209
+ query: params
1210
+ });
1211
+ }
1212
+ /**
1213
+ * The payments behind one number of the device intelligence overview, one
1214
+ * page at a time: the assessments it counts, the payments held for a missing
1215
+ * assessment, or the browser payments without a device signal. With the same
1216
+ * `days` a list's `total` is the count it was opened from. A row carries
1217
+ * nothing about the buyer.
1218
+ * `GET /admin-portal/device-intelligence/payments`
1219
+ */
1220
+ async deviceIntelligencePayments(params = {}) {
1221
+ return this.request("GET", "/admin-portal/device-intelligence/payments", {
1222
+ query: params
1223
+ });
1112
1224
  }
1113
1225
  /**
1114
1226
  * PSP analytics across merchants: the merchant surface's
@@ -2029,6 +2141,9 @@ function transactionListQuery(params) {
2029
2141
  function adminPersons(merchantId) {
2030
2142
  return `/admin-portal/persons/${encodeURIComponent(merchantId)}`;
2031
2143
  }
2144
+ function personFlags(merchantId, personId) {
2145
+ return `${adminPersons(merchantId)}/${encodeURIComponent(personId)}/flags`;
2146
+ }
2032
2147
  function adminAccount(merchantId) {
2033
2148
  return `/admin-portal/accounts/${encodeURIComponent(merchantId)}`;
2034
2149
  }
@@ -3050,6 +3165,7 @@ export {
3050
3165
  PAYPAL_CARD_LAYOUTS,
3051
3166
  PAYPAL_LABEL_STYLES,
3052
3167
  PRESENTATION_CONTRACT_VERSION,
3168
+ PayoutDestinations,
3053
3169
  PaypalDisputes,
3054
3170
  Persons,
3055
3171
  PlatformBilling,