@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/index.cjs CHANGED
@@ -137,6 +137,7 @@ __export(index_exports, {
137
137
  PAYPAL_CARD_LAYOUTS: () => PAYPAL_CARD_LAYOUTS,
138
138
  PAYPAL_LABEL_STYLES: () => PAYPAL_LABEL_STYLES,
139
139
  PRESENTATION_CONTRACT_VERSION: () => PRESENTATION_CONTRACT_VERSION,
140
+ PayoutDestinations: () => PayoutDestinations,
140
141
  PaypalDisputes: () => PaypalDisputes,
141
142
  Persons: () => Persons,
142
143
  PresentationCache: () => PresentationCache,
@@ -542,6 +543,23 @@ var ApiKeys = class {
542
543
  async list(merchantId) {
543
544
  return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/list`);
544
545
  }
546
+ /**
547
+ * The key templates the caller may use, with the values each prefills.
548
+ * Create the key with `create`; the template itself is not sent.
549
+ * `GET /api-keys/{merchantId}/templates`
550
+ *
551
+ * @param merchantId - The merchant account ID.
552
+ * @returns The templates, each limited to what the caller may grant.
553
+ *
554
+ * @example
555
+ * ```typescript
556
+ * const { templates } = await delopay.apiKeys.listTemplates('merch_123');
557
+ * const readOnly = templates.find((t) => t.id === 'ai_agent_read_only');
558
+ * ```
559
+ */
560
+ async listTemplates(merchantId) {
561
+ return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/templates`);
562
+ }
545
563
  // --- Profile-scoped (shop-level) API keys ---------------------------------
546
564
  //
547
565
  // JWT-authenticated routes under `/account/{merchantId}/profile/api-keys`.
@@ -7745,6 +7763,161 @@ function shopPath(profileId) {
7745
7763
  return `/industries/shops/${encodeURIComponent(profileId)}`;
7746
7764
  }
7747
7765
 
7766
+ // src/resources/payoutDestinations.ts
7767
+ var PayoutDestinations = class {
7768
+ constructor(request) {
7769
+ this.request = request;
7770
+ }
7771
+ /**
7772
+ * The caller's own destinations, masked, and the methods offered to them.
7773
+ *
7774
+ * `GET /payout-destinations/me`
7775
+ */
7776
+ async listMine() {
7777
+ return this.request("GET", "/payout-destinations/me");
7778
+ }
7779
+ /**
7780
+ * Save a destination. The method must be offered; at most 20 per member.
7781
+ *
7782
+ * `POST /payout-destinations/me`
7783
+ */
7784
+ async createMine(params) {
7785
+ return this.request("POST", "/payout-destinations/me", { body: params });
7786
+ }
7787
+ /**
7788
+ * Replace a destination's details at the version read.
7789
+ *
7790
+ * `PUT /payout-destinations/me/{destinationId}`
7791
+ */
7792
+ async updateMine(destinationId, params) {
7793
+ return this.request("PUT", `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {
7794
+ body: params
7795
+ });
7796
+ }
7797
+ /**
7798
+ * Make a destination the preferred one; the others lose it.
7799
+ *
7800
+ * `POST /payout-destinations/me/{destinationId}/preferred`
7801
+ */
7802
+ async preferMine(destinationId, version) {
7803
+ return this.request(
7804
+ "POST",
7805
+ `/payout-destinations/me/${encodeURIComponent(destinationId)}/preferred`,
7806
+ { body: { version } }
7807
+ );
7808
+ }
7809
+ /**
7810
+ * Delete a destination. Final: the history keeps who, when and which
7811
+ * fields, never a value.
7812
+ *
7813
+ * `DELETE /payout-destinations/me/{destinationId}?version=`
7814
+ */
7815
+ async deleteMine(destinationId, version) {
7816
+ await this.request("DELETE", `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {
7817
+ query: { version }
7818
+ });
7819
+ }
7820
+ /**
7821
+ * One's own destination in plain text. Recorded in the history first.
7822
+ *
7823
+ * `POST /payout-destinations/me/{destinationId}/reveal`
7824
+ */
7825
+ async revealMine(destinationId) {
7826
+ return this.request(
7827
+ "POST",
7828
+ `/payout-destinations/me/${encodeURIComponent(destinationId)}/reveal`
7829
+ );
7830
+ }
7831
+ /**
7832
+ * The methods offered to the caller.
7833
+ *
7834
+ * `GET /payout-destinations/methods`
7835
+ */
7836
+ async offeredMethods() {
7837
+ return this.request("GET", "/payout-destinations/methods");
7838
+ }
7839
+ /**
7840
+ * The merchant's list and, with `shop_id`, one shop's. A shop role reads
7841
+ * its own shop only.
7842
+ *
7843
+ * `GET /payout-destinations/methods/settings`
7844
+ */
7845
+ async retrieveMethodsSettings(params) {
7846
+ return this.request("GET", "/payout-destinations/methods/settings", {
7847
+ query: params
7848
+ });
7849
+ }
7850
+ /**
7851
+ * Set the methods offered at the merchant or at one shop.
7852
+ *
7853
+ * `PUT /payout-destinations/methods/settings`
7854
+ */
7855
+ async updateMethodsSettings(params) {
7856
+ return this.request("PUT", "/payout-destinations/methods/settings", { body: params });
7857
+ }
7858
+ /**
7859
+ * The team's destinations the caller manages, masked: every member for a
7860
+ * merchant-level role, the members reaching the caller's shop for a shop
7861
+ * role.
7862
+ *
7863
+ * `GET /payout-destinations`
7864
+ */
7865
+ async listTeam(params) {
7866
+ return this.request("GET", "/payout-destinations", { query: params });
7867
+ }
7868
+ /**
7869
+ * A managed member's destination in plain text. Recorded in the history
7870
+ * first.
7871
+ *
7872
+ * `POST /payout-destinations/{destinationId}/reveal`
7873
+ */
7874
+ async revealTeam(destinationId) {
7875
+ return this.request("POST", `/payout-destinations/${encodeURIComponent(destinationId)}/reveal`);
7876
+ }
7877
+ /**
7878
+ * Confirm a changed destination was seen, at the version read.
7879
+ *
7880
+ * `POST /payout-destinations/{destinationId}/acknowledge`
7881
+ */
7882
+ async acknowledgeTeam(destinationId, version) {
7883
+ return this.request(
7884
+ "POST",
7885
+ `/payout-destinations/${encodeURIComponent(destinationId)}/acknowledge`,
7886
+ { body: { version } }
7887
+ );
7888
+ }
7889
+ /**
7890
+ * Link a revenue-share holder to a team member, or unlink it (`null`). The
7891
+ * member must be an active member of the merchant whose role reads Payouts.
7892
+ *
7893
+ * `PUT /revenue-shares/holders/{holderId}/member`
7894
+ */
7895
+ async linkRevenueShareHolder(holderId, userId) {
7896
+ return this.request("PUT", `/revenue-shares/holders/${encodeURIComponent(holderId)}/member`, {
7897
+ body: { user_id: userId }
7898
+ });
7899
+ }
7900
+ /**
7901
+ * The merchant's revenue-share holders, each with the team member it is
7902
+ * linked to, if any.
7903
+ *
7904
+ * `GET /revenue-shares/holders?merchant_id={merchantId}`
7905
+ */
7906
+ async listRevenueShareHolders(merchantId) {
7907
+ return this.request("GET", "/revenue-shares/holders", {
7908
+ query: { merchant_id: merchantId }
7909
+ });
7910
+ }
7911
+ /**
7912
+ * The share terms of the holders linked to the caller. Read-only.
7913
+ *
7914
+ * `GET /revenue-shares/mine`
7915
+ */
7916
+ async listMyRevenueShares() {
7917
+ return this.request("GET", "/revenue-shares/mine");
7918
+ }
7919
+ };
7920
+
7748
7921
  // src/resources/checkoutTemplates.ts
7749
7922
  var CheckoutTemplates = class {
7750
7923
  constructor(request) {
@@ -11842,6 +12015,7 @@ var Delopay = class {
11842
12015
  this.persons = new Persons(request);
11843
12016
  this.shopLabels = new ShopLabels(request);
11844
12017
  this.industries = new Industries(request);
12018
+ this.payoutDestinations = new PayoutDestinations(request);
11845
12019
  this.checkoutTemplates = new CheckoutTemplates(request);
11846
12020
  this.buyerConversations = new BuyerConversations(request);
11847
12021
  this.buyerEvidence = new BuyerEvidenceReviews(request);
@@ -17945,6 +18119,7 @@ var encodeNativePanes = encodePanes;
17945
18119
  PAYPAL_CARD_LAYOUTS,
17946
18120
  PAYPAL_LABEL_STYLES,
17947
18121
  PRESENTATION_CONTRACT_VERSION,
18122
+ PayoutDestinations,
17948
18123
  PaypalDisputes,
17949
18124
  Persons,
17950
18125
  PresentationCache,