@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.
@@ -768,6 +768,27 @@ var Customers = class {
768
768
  constructor(request) {
769
769
  this.request = request;
770
770
  }
771
+ /** Issue a shop-scoped buyer portal link for this customer. */
772
+ async createPortalLink(customerId, params, options) {
773
+ return this.request("POST", `/customers/${encodeURIComponent(customerId)}/portal-links`, {
774
+ body: params,
775
+ ...options
776
+ });
777
+ }
778
+ /** List issued grants without disclosing their secret URLs. */
779
+ async listPortalLinks(customerId, params, options) {
780
+ return this.request("GET", `/customers/${encodeURIComponent(customerId)}/portal-links`, {
781
+ query: params,
782
+ ...options
783
+ });
784
+ }
785
+ async revokePortalLink(customerId, linkId, options) {
786
+ return this.request(
787
+ "DELETE",
788
+ `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,
789
+ { ...options }
790
+ );
791
+ }
771
792
  /**
772
793
  * Create a new customer.
773
794
  *
@@ -5717,6 +5738,29 @@ var Subscriptions = class {
5717
5738
  constructor(request) {
5718
5739
  this.request = request;
5719
5740
  }
5741
+ /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */
5742
+ async getNativeConfig(options) {
5743
+ return this.request("GET", "/subscriptions/native/config", { ...options });
5744
+ }
5745
+ /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */
5746
+ async updateNativeConfig(params, options) {
5747
+ return this.request("PUT", "/subscriptions/native/config", { body: params, ...options });
5748
+ }
5749
+ /** Read merchant-wide renewal recovery settings. */
5750
+ async getNativeDunning(options) {
5751
+ return this.request("GET", "/subscriptions/native/dunning", { ...options });
5752
+ }
5753
+ async updateNativeDunning(params, options) {
5754
+ return this.request("PUT", "/subscriptions/native/dunning", { body: params, ...options });
5755
+ }
5756
+ /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */
5757
+ async getCapabilities(subscriptionId, options) {
5758
+ return this.request(
5759
+ "GET",
5760
+ `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,
5761
+ { ...options }
5762
+ );
5763
+ }
5720
5764
  /**
5721
5765
  * Create and immediately confirm a subscription. `POST /subscriptions`
5722
5766
  *
@@ -5993,6 +6037,96 @@ var Subscriptions = class {
5993
6037
  }
5994
6038
  };
5995
6039
 
6040
+ // src/resources/buyerPortal.ts
6041
+ var BuyerPortal = class {
6042
+ constructor(request) {
6043
+ this.request = request;
6044
+ }
6045
+ async getSession(options) {
6046
+ return this.request("GET", "/buyer-portal/session", { ...options });
6047
+ }
6048
+ async listInvoices(params, options) {
6049
+ return this.request("GET", "/buyer-portal/invoices", {
6050
+ query: params,
6051
+ ...options
6052
+ });
6053
+ }
6054
+ async retrieveInvoice(invoiceId, options) {
6055
+ return this.request("GET", `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {
6056
+ ...options
6057
+ });
6058
+ }
6059
+ /** Download the owned, published invoice as PDF bytes. */
6060
+ async downloadInvoicePdf(invoiceId, options) {
6061
+ return this.request("GET", `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {
6062
+ responseType: "blob",
6063
+ ...options
6064
+ });
6065
+ }
6066
+ async listPurchases(params, options) {
6067
+ return this.request("GET", "/buyer-portal/purchases", {
6068
+ query: params,
6069
+ ...options
6070
+ });
6071
+ }
6072
+ async listSubscriptions(params, options) {
6073
+ return this.request("GET", "/buyer-portal/subscriptions", {
6074
+ query: params,
6075
+ ...options
6076
+ });
6077
+ }
6078
+ /** Apply an action allowed by the subscription capabilities and portal grant. */
6079
+ async actOnSubscription(subscriptionId, params, options) {
6080
+ return this.request(
6081
+ "POST",
6082
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,
6083
+ { body: params, ...options }
6084
+ );
6085
+ }
6086
+ async listSubscriptionPlans(subscriptionId, params, options) {
6087
+ return this.request(
6088
+ "GET",
6089
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,
6090
+ { query: params, ...options }
6091
+ );
6092
+ }
6093
+ async changeSubscriptionPlan(subscriptionId, params, options) {
6094
+ return this.request(
6095
+ "POST",
6096
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,
6097
+ { body: params, ...options }
6098
+ );
6099
+ }
6100
+ async listNativePlans(profileId, params, options) {
6101
+ return this.request(
6102
+ "GET",
6103
+ `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,
6104
+ { query: params, ...options }
6105
+ );
6106
+ }
6107
+ /** Retry with the same subscription ID and accepted terms after a lost response. */
6108
+ async enrollNative(params, options) {
6109
+ return this.request("POST", "/buyer-portal/subscriptions/native/enroll", {
6110
+ body: params,
6111
+ ...options
6112
+ });
6113
+ }
6114
+ async getNativeEnrollment(subscriptionId, params, options) {
6115
+ return this.request(
6116
+ "GET",
6117
+ `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,
6118
+ { query: { profile_id: params.profile_id }, ...options }
6119
+ );
6120
+ }
6121
+ async abandonNativeEnrollment(subscriptionId, params, options) {
6122
+ return this.request(
6123
+ "POST",
6124
+ `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,
6125
+ { query: { profile_id: params.profile_id }, ...options }
6126
+ );
6127
+ }
6128
+ };
6129
+
5996
6130
  // src/resources/audit.ts
5997
6131
  var Audit = class {
5998
6132
  constructor(request) {
@@ -6970,6 +7104,7 @@ var Delopay = class {
6970
7104
  this.replayRetention = new ReplayRetention(request);
6971
7105
  this.risk = new Risk(request);
6972
7106
  this.subscriptions = new Subscriptions(request);
7107
+ this.buyerPortal = new BuyerPortal(request);
6973
7108
  this.files = new Files(request);
6974
7109
  this.export = new Export(request);
6975
7110
  this.forex = new Forex(request);
@@ -11177,4 +11312,4 @@ export {
11177
11312
  decodeNativePanes,
11178
11313
  encodeNativePanes
11179
11314
  };
11180
- //# sourceMappingURL=chunk-AUVCCOH6.js.map
11315
+ //# sourceMappingURL=chunk-OJIATYCP.js.map