@delopay/sdk 0.241.0 → 0.245.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
@@ -919,6 +919,43 @@ var Connectors = class {
919
919
  `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`
920
920
  );
921
921
  }
922
+ /**
923
+ * Read the transaction currencies a connector may process: its own list,
924
+ * what the provider is known to accept with its methods, and the effective
925
+ * currencies in each shop it serves (todos#333).
926
+ * `GET /account/{accountId}/connectors/{connectorId}/currencies`
927
+ */
928
+ async getCurrencies(accountId, connectorId) {
929
+ return this.request(
930
+ "GET",
931
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`
932
+ );
933
+ }
934
+ /**
935
+ * Set the transaction currencies a connector may process in every shop it
936
+ * serves. `allowed_currencies: null` allows every currency the provider
937
+ * supports. With `dry_run`, nothing is saved and `impact` reports the effect.
938
+ * `PUT /account/{accountId}/connectors/{connectorId}/currencies`
939
+ */
940
+ async setCurrencies(accountId, connectorId, params) {
941
+ return this.request(
942
+ "PUT",
943
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`,
944
+ { body: params }
945
+ );
946
+ }
947
+ /**
948
+ * Narrow a connector's currencies in one shop it serves, within the
949
+ * connector's own list. `allowed_currencies: null` returns the shop to it.
950
+ * `PUT /account/{accountId}/connectors/{connectorId}/shops/{profileId}/currencies`
951
+ */
952
+ async setShopCurrencies(accountId, connectorId, profileId, params) {
953
+ return this.request(
954
+ "PUT",
955
+ `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}/currencies`,
956
+ { body: params }
957
+ );
958
+ }
922
959
  // --- Advanced operations (Task 4.8) ---
923
960
  /**
924
961
  * Run the configuration checks for a vault (VGS) connector account:
@@ -7128,6 +7165,68 @@ var Subscriptions = class {
7128
7165
  }
7129
7166
  };
7130
7167
 
7168
+ // src/resources/buyerAccount.ts
7169
+ var BuyerAccount = class {
7170
+ constructor(request) {
7171
+ this.request = request;
7172
+ }
7173
+ /** Whether buyers can sign in by email on this platform, and how. */
7174
+ async availability(options) {
7175
+ return this.request("GET", "/buyer-account/availability", { ...options });
7176
+ }
7177
+ /**
7178
+ * Mail a sign-in code, a link, or both to the address, as the platform
7179
+ * offers. The answer is the same whether or not the address has purchases.
7180
+ */
7181
+ async startSignIn(params, options) {
7182
+ return this.request("POST", "/buyer-account/sign-in", { body: params, ...options });
7183
+ }
7184
+ /** Complete a sign-in with the code from the message. */
7185
+ async verifyCode(params, options) {
7186
+ return this.request("POST", "/buyer-account/sign-in/code", { body: params, ...options });
7187
+ }
7188
+ /** Complete a sign-in with the token of the link in the message. */
7189
+ async verifyLink(params, options) {
7190
+ return this.request("POST", "/buyer-account/sign-in/link", { body: params, ...options });
7191
+ }
7192
+ /** The current session: the address signed in with, masked, and its expiry. */
7193
+ async getSession(options) {
7194
+ return this.request("GET", "/buyer-account/session", { ...options });
7195
+ }
7196
+ /** End the current session. */
7197
+ async signOut(options) {
7198
+ return this.request("DELETE", "/buyer-account/session", { ...options });
7199
+ }
7200
+ /**
7201
+ * The buyer's purchases across merchants, newest first, as receipts: shop,
7202
+ * date, amount, items and status. Page with `next_cursor`.
7203
+ */
7204
+ async listPurchases(params, options) {
7205
+ return this.request("GET", "/buyer-account/purchases", {
7206
+ query: params,
7207
+ ...options
7208
+ });
7209
+ }
7210
+ /**
7211
+ * Confirm the record of a shop's customer portal link for the signed-in
7212
+ * buyer. The link's customer must carry the address the buyer signed in
7213
+ * with.
7214
+ */
7215
+ async confirm(params, options) {
7216
+ return this.request("POST", "/buyer-account/confirmations", { body: params, ...options });
7217
+ }
7218
+ /**
7219
+ * Open the shop's customer portal for a confirmed record, named by the
7220
+ * `record` its purchases carry. Opening another one for the same record
7221
+ * ends the previous one.
7222
+ */
7223
+ async openPortal(record, options) {
7224
+ return this.request("POST", `/buyer-account/records/${encodeURIComponent(record)}/portal`, {
7225
+ ...options
7226
+ });
7227
+ }
7228
+ };
7229
+
7131
7230
  // src/resources/buyerPortal.ts
7132
7231
  var BuyerPortal = class {
7133
7232
  constructor(request) {
@@ -8255,6 +8354,7 @@ var Delopay = class {
8255
8354
  this.risk = new Risk(request);
8256
8355
  this.subscriptions = new Subscriptions(request);
8257
8356
  this.buyerPortal = new BuyerPortal(request);
8357
+ this.buyerAccount = new BuyerAccount(request);
8258
8358
  this.files = new Files(request);
8259
8359
  this.export = new Export(request);
8260
8360
  this.forex = new Forex(request);