@delopay/sdk 0.198.0 → 0.200.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
@@ -1010,6 +1010,27 @@ var Customers = class {
1010
1010
  constructor(request) {
1011
1011
  this.request = request;
1012
1012
  }
1013
+ /** Issue a shop-scoped buyer portal link for this customer. */
1014
+ async createPortalLink(customerId, params, options) {
1015
+ return this.request("POST", `/customers/${encodeURIComponent(customerId)}/portal-links`, {
1016
+ body: params,
1017
+ ...options
1018
+ });
1019
+ }
1020
+ /** List issued grants without disclosing their secret URLs. */
1021
+ async listPortalLinks(customerId, params, options) {
1022
+ return this.request("GET", `/customers/${encodeURIComponent(customerId)}/portal-links`, {
1023
+ query: params,
1024
+ ...options
1025
+ });
1026
+ }
1027
+ async revokePortalLink(customerId, linkId, options) {
1028
+ return this.request(
1029
+ "DELETE",
1030
+ `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,
1031
+ { ...options }
1032
+ );
1033
+ }
1013
1034
  /**
1014
1035
  * Create a new customer.
1015
1036
  *
@@ -5959,6 +5980,29 @@ var Subscriptions = class {
5959
5980
  constructor(request) {
5960
5981
  this.request = request;
5961
5982
  }
5983
+ /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */
5984
+ async getNativeConfig(options) {
5985
+ return this.request("GET", "/subscriptions/native/config", { ...options });
5986
+ }
5987
+ /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */
5988
+ async updateNativeConfig(params, options) {
5989
+ return this.request("PUT", "/subscriptions/native/config", { body: params, ...options });
5990
+ }
5991
+ /** Read merchant-wide renewal recovery settings. */
5992
+ async getNativeDunning(options) {
5993
+ return this.request("GET", "/subscriptions/native/dunning", { ...options });
5994
+ }
5995
+ async updateNativeDunning(params, options) {
5996
+ return this.request("PUT", "/subscriptions/native/dunning", { body: params, ...options });
5997
+ }
5998
+ /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */
5999
+ async getCapabilities(subscriptionId, options) {
6000
+ return this.request(
6001
+ "GET",
6002
+ `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,
6003
+ { ...options }
6004
+ );
6005
+ }
5962
6006
  /**
5963
6007
  * Create and immediately confirm a subscription. `POST /subscriptions`
5964
6008
  *
@@ -6235,6 +6279,96 @@ var Subscriptions = class {
6235
6279
  }
6236
6280
  };
6237
6281
 
6282
+ // src/resources/buyerPortal.ts
6283
+ var BuyerPortal = class {
6284
+ constructor(request) {
6285
+ this.request = request;
6286
+ }
6287
+ async getSession(options) {
6288
+ return this.request("GET", "/buyer-portal/session", { ...options });
6289
+ }
6290
+ async listInvoices(params, options) {
6291
+ return this.request("GET", "/buyer-portal/invoices", {
6292
+ query: params,
6293
+ ...options
6294
+ });
6295
+ }
6296
+ async retrieveInvoice(invoiceId, options) {
6297
+ return this.request("GET", `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {
6298
+ ...options
6299
+ });
6300
+ }
6301
+ /** Download the owned, published invoice as PDF bytes. */
6302
+ async downloadInvoicePdf(invoiceId, options) {
6303
+ return this.request("GET", `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {
6304
+ responseType: "blob",
6305
+ ...options
6306
+ });
6307
+ }
6308
+ async listPurchases(params, options) {
6309
+ return this.request("GET", "/buyer-portal/purchases", {
6310
+ query: params,
6311
+ ...options
6312
+ });
6313
+ }
6314
+ async listSubscriptions(params, options) {
6315
+ return this.request("GET", "/buyer-portal/subscriptions", {
6316
+ query: params,
6317
+ ...options
6318
+ });
6319
+ }
6320
+ /** Apply an action allowed by the subscription capabilities and portal grant. */
6321
+ async actOnSubscription(subscriptionId, params, options) {
6322
+ return this.request(
6323
+ "POST",
6324
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,
6325
+ { body: params, ...options }
6326
+ );
6327
+ }
6328
+ async listSubscriptionPlans(subscriptionId, params, options) {
6329
+ return this.request(
6330
+ "GET",
6331
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,
6332
+ { query: params, ...options }
6333
+ );
6334
+ }
6335
+ async changeSubscriptionPlan(subscriptionId, params, options) {
6336
+ return this.request(
6337
+ "POST",
6338
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,
6339
+ { body: params, ...options }
6340
+ );
6341
+ }
6342
+ async listNativePlans(profileId, params, options) {
6343
+ return this.request(
6344
+ "GET",
6345
+ `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,
6346
+ { query: params, ...options }
6347
+ );
6348
+ }
6349
+ /** Retry with the same subscription ID and accepted terms after a lost response. */
6350
+ async enrollNative(params, options) {
6351
+ return this.request("POST", "/buyer-portal/subscriptions/native/enroll", {
6352
+ body: params,
6353
+ ...options
6354
+ });
6355
+ }
6356
+ async getNativeEnrollment(subscriptionId, params, options) {
6357
+ return this.request(
6358
+ "GET",
6359
+ `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,
6360
+ { query: { profile_id: params.profile_id }, ...options }
6361
+ );
6362
+ }
6363
+ async abandonNativeEnrollment(subscriptionId, params, options) {
6364
+ return this.request(
6365
+ "POST",
6366
+ `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,
6367
+ { query: { profile_id: params.profile_id }, ...options }
6368
+ );
6369
+ }
6370
+ };
6371
+
6238
6372
  // src/resources/audit.ts
6239
6373
  var Audit = class {
6240
6374
  constructor(request) {
@@ -7212,6 +7346,7 @@ var Delopay = class {
7212
7346
  this.replayRetention = new ReplayRetention(request);
7213
7347
  this.risk = new Risk(request);
7214
7348
  this.subscriptions = new Subscriptions(request);
7349
+ this.buyerPortal = new BuyerPortal(request);
7215
7350
  this.files = new Files(request);
7216
7351
  this.export = new Export(request);
7217
7352
  this.forex = new Forex(request);