@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.cjs CHANGED
@@ -154,6 +154,7 @@ __export(internal_exports, {
154
154
  PAYPAL_CARD_LAYOUTS: () => PAYPAL_CARD_LAYOUTS,
155
155
  PAYPAL_LABEL_STYLES: () => PAYPAL_LABEL_STYLES,
156
156
  PRESENTATION_CONTRACT_VERSION: () => PRESENTATION_CONTRACT_VERSION,
157
+ PayoutDestinations: () => PayoutDestinations,
157
158
  PaypalDisputes: () => PaypalDisputes,
158
159
  Persons: () => Persons,
159
160
  PlatformBilling: () => PlatformBilling,
@@ -563,6 +564,23 @@ var ApiKeys = class {
563
564
  async list(merchantId) {
564
565
  return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/list`);
565
566
  }
567
+ /**
568
+ * The key templates the caller may use, with the values each prefills.
569
+ * Create the key with `create`; the template itself is not sent.
570
+ * `GET /api-keys/{merchantId}/templates`
571
+ *
572
+ * @param merchantId - The merchant account ID.
573
+ * @returns The templates, each limited to what the caller may grant.
574
+ *
575
+ * @example
576
+ * ```typescript
577
+ * const { templates } = await delopay.apiKeys.listTemplates('merch_123');
578
+ * const readOnly = templates.find((t) => t.id === 'ai_agent_read_only');
579
+ * ```
580
+ */
581
+ async listTemplates(merchantId) {
582
+ return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/templates`);
583
+ }
566
584
  // --- Profile-scoped (shop-level) API keys ---------------------------------
567
585
  //
568
586
  // JWT-authenticated routes under `/account/{merchantId}/profile/api-keys`.
@@ -7766,6 +7784,161 @@ function shopPath(profileId) {
7766
7784
  return `/industries/shops/${encodeURIComponent(profileId)}`;
7767
7785
  }
7768
7786
 
7787
+ // src/resources/payoutDestinations.ts
7788
+ var PayoutDestinations = class {
7789
+ constructor(request) {
7790
+ this.request = request;
7791
+ }
7792
+ /**
7793
+ * The caller's own destinations, masked, and the methods offered to them.
7794
+ *
7795
+ * `GET /payout-destinations/me`
7796
+ */
7797
+ async listMine() {
7798
+ return this.request("GET", "/payout-destinations/me");
7799
+ }
7800
+ /**
7801
+ * Save a destination. The method must be offered; at most 20 per member.
7802
+ *
7803
+ * `POST /payout-destinations/me`
7804
+ */
7805
+ async createMine(params) {
7806
+ return this.request("POST", "/payout-destinations/me", { body: params });
7807
+ }
7808
+ /**
7809
+ * Replace a destination's details at the version read.
7810
+ *
7811
+ * `PUT /payout-destinations/me/{destinationId}`
7812
+ */
7813
+ async updateMine(destinationId, params) {
7814
+ return this.request("PUT", `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {
7815
+ body: params
7816
+ });
7817
+ }
7818
+ /**
7819
+ * Make a destination the preferred one; the others lose it.
7820
+ *
7821
+ * `POST /payout-destinations/me/{destinationId}/preferred`
7822
+ */
7823
+ async preferMine(destinationId, version) {
7824
+ return this.request(
7825
+ "POST",
7826
+ `/payout-destinations/me/${encodeURIComponent(destinationId)}/preferred`,
7827
+ { body: { version } }
7828
+ );
7829
+ }
7830
+ /**
7831
+ * Delete a destination. Final: the history keeps who, when and which
7832
+ * fields, never a value.
7833
+ *
7834
+ * `DELETE /payout-destinations/me/{destinationId}?version=`
7835
+ */
7836
+ async deleteMine(destinationId, version) {
7837
+ await this.request("DELETE", `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {
7838
+ query: { version }
7839
+ });
7840
+ }
7841
+ /**
7842
+ * One's own destination in plain text. Recorded in the history first.
7843
+ *
7844
+ * `POST /payout-destinations/me/{destinationId}/reveal`
7845
+ */
7846
+ async revealMine(destinationId) {
7847
+ return this.request(
7848
+ "POST",
7849
+ `/payout-destinations/me/${encodeURIComponent(destinationId)}/reveal`
7850
+ );
7851
+ }
7852
+ /**
7853
+ * The methods offered to the caller.
7854
+ *
7855
+ * `GET /payout-destinations/methods`
7856
+ */
7857
+ async offeredMethods() {
7858
+ return this.request("GET", "/payout-destinations/methods");
7859
+ }
7860
+ /**
7861
+ * The merchant's list and, with `shop_id`, one shop's. A shop role reads
7862
+ * its own shop only.
7863
+ *
7864
+ * `GET /payout-destinations/methods/settings`
7865
+ */
7866
+ async retrieveMethodsSettings(params) {
7867
+ return this.request("GET", "/payout-destinations/methods/settings", {
7868
+ query: params
7869
+ });
7870
+ }
7871
+ /**
7872
+ * Set the methods offered at the merchant or at one shop.
7873
+ *
7874
+ * `PUT /payout-destinations/methods/settings`
7875
+ */
7876
+ async updateMethodsSettings(params) {
7877
+ return this.request("PUT", "/payout-destinations/methods/settings", { body: params });
7878
+ }
7879
+ /**
7880
+ * The team's destinations the caller manages, masked: every member for a
7881
+ * merchant-level role, the members reaching the caller's shop for a shop
7882
+ * role.
7883
+ *
7884
+ * `GET /payout-destinations`
7885
+ */
7886
+ async listTeam(params) {
7887
+ return this.request("GET", "/payout-destinations", { query: params });
7888
+ }
7889
+ /**
7890
+ * A managed member's destination in plain text. Recorded in the history
7891
+ * first.
7892
+ *
7893
+ * `POST /payout-destinations/{destinationId}/reveal`
7894
+ */
7895
+ async revealTeam(destinationId) {
7896
+ return this.request("POST", `/payout-destinations/${encodeURIComponent(destinationId)}/reveal`);
7897
+ }
7898
+ /**
7899
+ * Confirm a changed destination was seen, at the version read.
7900
+ *
7901
+ * `POST /payout-destinations/{destinationId}/acknowledge`
7902
+ */
7903
+ async acknowledgeTeam(destinationId, version) {
7904
+ return this.request(
7905
+ "POST",
7906
+ `/payout-destinations/${encodeURIComponent(destinationId)}/acknowledge`,
7907
+ { body: { version } }
7908
+ );
7909
+ }
7910
+ /**
7911
+ * Link a revenue-share holder to a team member, or unlink it (`null`). The
7912
+ * member must be an active member of the merchant whose role reads Payouts.
7913
+ *
7914
+ * `PUT /revenue-shares/holders/{holderId}/member`
7915
+ */
7916
+ async linkRevenueShareHolder(holderId, userId) {
7917
+ return this.request("PUT", `/revenue-shares/holders/${encodeURIComponent(holderId)}/member`, {
7918
+ body: { user_id: userId }
7919
+ });
7920
+ }
7921
+ /**
7922
+ * The merchant's revenue-share holders, each with the team member it is
7923
+ * linked to, if any.
7924
+ *
7925
+ * `GET /revenue-shares/holders?merchant_id={merchantId}`
7926
+ */
7927
+ async listRevenueShareHolders(merchantId) {
7928
+ return this.request("GET", "/revenue-shares/holders", {
7929
+ query: { merchant_id: merchantId }
7930
+ });
7931
+ }
7932
+ /**
7933
+ * The share terms of the holders linked to the caller. Read-only.
7934
+ *
7935
+ * `GET /revenue-shares/mine`
7936
+ */
7937
+ async listMyRevenueShares() {
7938
+ return this.request("GET", "/revenue-shares/mine");
7939
+ }
7940
+ };
7941
+
7769
7942
  // src/resources/checkoutTemplates.ts
7770
7943
  var CheckoutTemplates = class {
7771
7944
  constructor(request) {
@@ -11863,6 +12036,7 @@ var Delopay = class {
11863
12036
  this.persons = new Persons(request);
11864
12037
  this.shopLabels = new ShopLabels(request);
11865
12038
  this.industries = new Industries(request);
12039
+ this.payoutDestinations = new PayoutDestinations(request);
11866
12040
  this.checkoutTemplates = new CheckoutTemplates(request);
11867
12041
  this.buyerConversations = new BuyerConversations(request);
11868
12042
  this.buyerEvidence = new BuyerEvidenceReviews(request);
@@ -18258,6 +18432,97 @@ var AdminPortal = class {
18258
18432
  { query: params }
18259
18433
  );
18260
18434
  }
18435
+ /**
18436
+ * Every staff flag of a person, active and removed, newest first, with
18437
+ * those of the persons merged into it. A merged person reads as the person
18438
+ * it merged into. Staff only; a flag changes no payment.
18439
+ *
18440
+ * `GET /admin-portal/persons/{merchantId}/{personId}/flags`
18441
+ */
18442
+ async listPersonFlags(merchantId, personId) {
18443
+ return this.request("GET", personFlags(merchantId, personId));
18444
+ }
18445
+ /**
18446
+ * Flags a person for staff. The flag changes no payment and the merchant
18447
+ * never sees it. A merged person's flag goes on the person it merged into.
18448
+ * A person already flagged is refused with `IR_38` (400); a staff role that
18449
+ * may not flag buyers gets a `403`.
18450
+ *
18451
+ * `POST /admin-portal/persons/{merchantId}/{personId}/flags`
18452
+ */
18453
+ async flagPerson(merchantId, personId, body) {
18454
+ return this.request("POST", personFlags(merchantId, personId), { body });
18455
+ }
18456
+ /**
18457
+ * Replaces an active flag's reason and note at the `version` read. A
18458
+ * colleague's newer change, or a removal, since that read is refused with
18459
+ * `IR_16` (400) rather than overwritten.
18460
+ *
18461
+ * `PUT /admin-portal/persons/{merchantId}/{personId}/flags/{flagId}`
18462
+ */
18463
+ async updatePersonFlag(merchantId, personId, flagId, body) {
18464
+ return this.request(
18465
+ "PUT",
18466
+ `${personFlags(merchantId, personId)}/${encodeURIComponent(flagId)}`,
18467
+ { body }
18468
+ );
18469
+ }
18470
+ /**
18471
+ * Removes a flag at the `version` read: the flag stops and stays in the
18472
+ * history with who removed it and when, which is what this answers. A
18473
+ * colleague's change since that read is refused with `IR_16` (400).
18474
+ *
18475
+ * `DELETE /admin-portal/persons/{merchantId}/{personId}/flags/{flagId}?version=`
18476
+ */
18477
+ async removePersonFlag(merchantId, personId, flagId, version) {
18478
+ return this.request(
18479
+ "DELETE",
18480
+ `${personFlags(merchantId, personId)}/${encodeURIComponent(flagId)}`,
18481
+ { query: { version } }
18482
+ );
18483
+ }
18484
+ /**
18485
+ * One page of a merchant's persons with an active flag, newest flag first.
18486
+ * A flag on a merged person is listed under the person it merged into, and
18487
+ * a person with two active flags is listed once, with the newer one.
18488
+ *
18489
+ * `GET /admin-portal/persons/{merchantId}/flagged`
18490
+ */
18491
+ async listFlaggedPersons(merchantId, params) {
18492
+ if (params === void 0) {
18493
+ return this.request("GET", `${adminPersons(merchantId)}/flagged`);
18494
+ }
18495
+ return this.request("GET", `${adminPersons(merchantId)}/flagged`, {
18496
+ query: params
18497
+ });
18498
+ }
18499
+ /**
18500
+ * Whether each of 1 to 100 persons of a merchant is flagged, one answer
18501
+ * per asked person in the order asked. A merged person answers for the
18502
+ * person it merged into; an unknown person is not flagged. No id, or more
18503
+ * than 100, is a `400`.
18504
+ *
18505
+ * `GET /admin-portal/persons/{merchantId}/flag-status?person_ids=`
18506
+ */
18507
+ async personFlagStatus(merchantId, personIds) {
18508
+ return this.request("GET", `${adminPersons(merchantId)}/flag-status`, {
18509
+ query: { person_ids: personIds.join(",") }
18510
+ });
18511
+ }
18512
+ /**
18513
+ * Persons flagged by staff at other merchants who share an email address
18514
+ * or a device id with this person's 100 most recent payments, each once,
18515
+ * newest flag first. A card, an IP address or device traits never match.
18516
+ * A hint only: the persons stay separate and nothing is written.
18517
+ *
18518
+ * `GET /admin-portal/persons/{merchantId}/{personId}/flagged-elsewhere`
18519
+ */
18520
+ async listFlaggedElsewhere(merchantId, personId) {
18521
+ return this.request(
18522
+ "GET",
18523
+ `${adminPersons(merchantId)}/${encodeURIComponent(personId)}/flagged-elsewhere`
18524
+ );
18525
+ }
18261
18526
  async exportTransactions(params, options) {
18262
18527
  return runExport(
18263
18528
  this.request,
@@ -18278,7 +18543,8 @@ var AdminPortal = class {
18278
18543
  }
18279
18544
  /**
18280
18545
  * Full detail for a single transaction of ANY merchant — the same
18281
- * `PaymentResponse` the merchant `payments.retrieve` returns. Admin-scoped:
18546
+ * `PaymentResponse` the merchant `payments.retrieve` returns, with what only
18547
+ * staff see beside it (`person_flagged`, `flagged_elsewhere`). Admin-scoped:
18282
18548
  * the JWT (or admin API key) does not need to belong to the payment's
18283
18549
  * merchant; the backend resolves the owning merchant and reads it read-only
18284
18550
  * (no connector sync).
@@ -18643,13 +18909,32 @@ var AdminPortal = class {
18643
18909
  });
18644
18910
  }
18645
18911
  /**
18646
- * Every shop's device intelligence account, with its assessments per environment and
18647
- * its error rate over the last `window_days` days. The error rate counts finished
18648
- * assessments: one still running and a payment naming no buyer are not errors.
18912
+ * Every shop's device intelligence account, with its merchant's and its own
18913
+ * name and its assessments per environment over the last `days` days: counts
18914
+ * and error rate, failures by reason, finished assessments per day and
18915
+ * provider, the last recorded assessment, browser payments against assessed
18916
+ * ones, and the payments held for a missing assessment. The error rate counts
18917
+ * finished assessments: one still running and a payment naming no buyer are
18918
+ * not errors.
18649
18919
  * `GET /admin-portal/device-intelligence`
18650
18920
  */
18651
- async deviceIntelligenceUsage() {
18652
- return this.request("GET", "/admin-portal/device-intelligence");
18921
+ async deviceIntelligenceUsage(params = {}) {
18922
+ return this.request("GET", "/admin-portal/device-intelligence", {
18923
+ query: params
18924
+ });
18925
+ }
18926
+ /**
18927
+ * The payments behind one number of the device intelligence overview, one
18928
+ * page at a time: the assessments it counts, the payments held for a missing
18929
+ * assessment, or the browser payments without a device signal. With the same
18930
+ * `days` a list's `total` is the count it was opened from. A row carries
18931
+ * nothing about the buyer.
18932
+ * `GET /admin-portal/device-intelligence/payments`
18933
+ */
18934
+ async deviceIntelligencePayments(params = {}) {
18935
+ return this.request("GET", "/admin-portal/device-intelligence/payments", {
18936
+ query: params
18937
+ });
18653
18938
  }
18654
18939
  /**
18655
18940
  * PSP analytics across merchants: the merchant surface's
@@ -19570,6 +19855,9 @@ function transactionListQuery(params) {
19570
19855
  function adminPersons(merchantId) {
19571
19856
  return `/admin-portal/persons/${encodeURIComponent(merchantId)}`;
19572
19857
  }
19858
+ function personFlags(merchantId, personId) {
19859
+ return `${adminPersons(merchantId)}/${encodeURIComponent(personId)}/flags`;
19860
+ }
19573
19861
  function adminAccount(merchantId) {
19574
19862
  return `/admin-portal/accounts/${encodeURIComponent(merchantId)}`;
19575
19863
  }
@@ -20592,6 +20880,7 @@ var DelopayInternal = class extends Delopay {
20592
20880
  PAYPAL_CARD_LAYOUTS,
20593
20881
  PAYPAL_LABEL_STYLES,
20594
20882
  PRESENTATION_CONTRACT_VERSION,
20883
+ PayoutDestinations,
20595
20884
  PaypalDisputes,
20596
20885
  Persons,
20597
20886
  PlatformBilling,