@delopay/sdk 0.240.0 → 0.244.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
@@ -935,6 +935,43 @@ var Connectors = class {
935
935
  `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`
936
936
  );
937
937
  }
938
+ /**
939
+ * Read the transaction currencies a connector may process: its own list,
940
+ * what the provider is known to accept with its methods, and the effective
941
+ * currencies in each shop it serves (todos#333).
942
+ * `GET /account/{accountId}/connectors/{connectorId}/currencies`
943
+ */
944
+ async getCurrencies(accountId, connectorId) {
945
+ return this.request(
946
+ "GET",
947
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`
948
+ );
949
+ }
950
+ /**
951
+ * Set the transaction currencies a connector may process in every shop it
952
+ * serves. `allowed_currencies: null` allows every currency the provider
953
+ * supports. With `dry_run`, nothing is saved and `impact` reports the effect.
954
+ * `PUT /account/{accountId}/connectors/{connectorId}/currencies`
955
+ */
956
+ async setCurrencies(accountId, connectorId, params) {
957
+ return this.request(
958
+ "PUT",
959
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`,
960
+ { body: params }
961
+ );
962
+ }
963
+ /**
964
+ * Narrow a connector's currencies in one shop it serves, within the
965
+ * connector's own list. `allowed_currencies: null` returns the shop to it.
966
+ * `PUT /account/{accountId}/connectors/{connectorId}/shops/{profileId}/currencies`
967
+ */
968
+ async setShopCurrencies(accountId, connectorId, profileId, params) {
969
+ return this.request(
970
+ "PUT",
971
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}/currencies`,
972
+ { body: params }
973
+ );
974
+ }
938
975
  // --- Advanced operations (Task 4.8) ---
939
976
  /**
940
977
  * Run the configuration checks for a vault (VGS) connector account:
@@ -7144,6 +7181,68 @@ var Subscriptions = class {
7144
7181
  }
7145
7182
  };
7146
7183
 
7184
+ // src/resources/buyerAccount.ts
7185
+ var BuyerAccount = class {
7186
+ constructor(request) {
7187
+ this.request = request;
7188
+ }
7189
+ /** Whether buyers can sign in by email on this platform, and how. */
7190
+ async availability(options) {
7191
+ return this.request("GET", "/buyer-account/availability", { ...options });
7192
+ }
7193
+ /**
7194
+ * Mail a sign-in code, a link, or both to the address, as the platform
7195
+ * offers. The answer is the same whether or not the address has purchases.
7196
+ */
7197
+ async startSignIn(params, options) {
7198
+ return this.request("POST", "/buyer-account/sign-in", { body: params, ...options });
7199
+ }
7200
+ /** Complete a sign-in with the code from the message. */
7201
+ async verifyCode(params, options) {
7202
+ return this.request("POST", "/buyer-account/sign-in/code", { body: params, ...options });
7203
+ }
7204
+ /** Complete a sign-in with the token of the link in the message. */
7205
+ async verifyLink(params, options) {
7206
+ return this.request("POST", "/buyer-account/sign-in/link", { body: params, ...options });
7207
+ }
7208
+ /** The current session: the address signed in with, masked, and its expiry. */
7209
+ async getSession(options) {
7210
+ return this.request("GET", "/buyer-account/session", { ...options });
7211
+ }
7212
+ /** End the current session. */
7213
+ async signOut(options) {
7214
+ return this.request("DELETE", "/buyer-account/session", { ...options });
7215
+ }
7216
+ /**
7217
+ * The buyer's purchases across merchants, newest first, as receipts: shop,
7218
+ * date, amount, items and status. Page with `next_cursor`.
7219
+ */
7220
+ async listPurchases(params, options) {
7221
+ return this.request("GET", "/buyer-account/purchases", {
7222
+ query: params,
7223
+ ...options
7224
+ });
7225
+ }
7226
+ /**
7227
+ * Confirm the record of a shop's customer portal link for the signed-in
7228
+ * buyer. The link's customer must carry the address the buyer signed in
7229
+ * with.
7230
+ */
7231
+ async confirm(params, options) {
7232
+ return this.request("POST", "/buyer-account/confirmations", { body: params, ...options });
7233
+ }
7234
+ /**
7235
+ * Open the shop's customer portal for a confirmed record, named by the
7236
+ * `record` its purchases carry. Opening another one for the same record
7237
+ * ends the previous one.
7238
+ */
7239
+ async openPortal(record, options) {
7240
+ return this.request("POST", `/buyer-account/records/${encodeURIComponent(record)}/portal`, {
7241
+ ...options
7242
+ });
7243
+ }
7244
+ };
7245
+
7147
7246
  // src/resources/buyerPortal.ts
7148
7247
  var BuyerPortal = class {
7149
7248
  constructor(request) {
@@ -8271,6 +8370,7 @@ var Delopay = class {
8271
8370
  this.risk = new Risk(request);
8272
8371
  this.subscriptions = new Subscriptions(request);
8273
8372
  this.buyerPortal = new BuyerPortal(request);
8373
+ this.buyerAccount = new BuyerAccount(request);
8274
8374
  this.files = new Files(request);
8275
8375
  this.export = new Export(request);
8276
8376
  this.forex = new Forex(request);
@@ -13096,6 +13196,19 @@ var AdminPortal = class {
13096
13196
  `/admin-portal/transactions/${encodeURIComponent(paymentId)}/refunds`
13097
13197
  );
13098
13198
  }
13199
+ /**
13200
+ * The refund requests buyers raised from the customer portal about a single
13201
+ * transaction of ANY merchant, newest first, one page at a time
13202
+ * (`total_count` counts them all). Read-only.
13203
+ * `GET /admin-portal/transactions/{paymentId}/refund-requests`
13204
+ */
13205
+ async getTransactionRefundRequests(paymentId, params) {
13206
+ return this.request(
13207
+ "GET",
13208
+ `/admin-portal/transactions/${encodeURIComponent(paymentId)}/refund-requests`,
13209
+ { query: params === void 0 ? void 0 : { ...params } }
13210
+ );
13211
+ }
13099
13212
  /**
13100
13213
  * Refunds of ANY merchant mirrored from a connector webhook at a
13101
13214
  * non-terminal status that no sync can advance. Newest first.