@delopay/sdk 0.198.0 → 0.201.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
  *
@@ -5031,9 +5052,10 @@ var ExternalRecords = class {
5031
5052
  * same thing is how a caller ends up waiting for something that will never
5032
5053
  * be built.
5033
5054
  *
5034
- * The answer describes the binary rather than anything a merchant owns, so
5035
- * it is the same for every caller of one deployment and is safe to cache for
5036
- * the life of a dashboard session.
5055
+ * The answer includes the current merchant's rollout and storage eligibility.
5056
+ * Read it for the authenticated merchant when deciding whether to offer an
5057
+ * action; do not reuse another merchant's response or a previous session's
5058
+ * answer after eligibility may have changed.
5037
5059
  */
5038
5060
  async capabilities() {
5039
5061
  return this.request("GET", "/external-records/capabilities");
@@ -5717,6 +5739,29 @@ var Subscriptions = class {
5717
5739
  constructor(request) {
5718
5740
  this.request = request;
5719
5741
  }
5742
+ /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */
5743
+ async getNativeConfig(options) {
5744
+ return this.request("GET", "/subscriptions/native/config", { ...options });
5745
+ }
5746
+ /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */
5747
+ async updateNativeConfig(params, options) {
5748
+ return this.request("PUT", "/subscriptions/native/config", { body: params, ...options });
5749
+ }
5750
+ /** Read merchant-wide renewal recovery settings. */
5751
+ async getNativeDunning(options) {
5752
+ return this.request("GET", "/subscriptions/native/dunning", { ...options });
5753
+ }
5754
+ async updateNativeDunning(params, options) {
5755
+ return this.request("PUT", "/subscriptions/native/dunning", { body: params, ...options });
5756
+ }
5757
+ /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */
5758
+ async getCapabilities(subscriptionId, options) {
5759
+ return this.request(
5760
+ "GET",
5761
+ `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,
5762
+ { ...options }
5763
+ );
5764
+ }
5720
5765
  /**
5721
5766
  * Create and immediately confirm a subscription. `POST /subscriptions`
5722
5767
  *
@@ -5993,6 +6038,96 @@ var Subscriptions = class {
5993
6038
  }
5994
6039
  };
5995
6040
 
6041
+ // src/resources/buyerPortal.ts
6042
+ var BuyerPortal = class {
6043
+ constructor(request) {
6044
+ this.request = request;
6045
+ }
6046
+ async getSession(options) {
6047
+ return this.request("GET", "/buyer-portal/session", { ...options });
6048
+ }
6049
+ async listInvoices(params, options) {
6050
+ return this.request("GET", "/buyer-portal/invoices", {
6051
+ query: params,
6052
+ ...options
6053
+ });
6054
+ }
6055
+ async retrieveInvoice(invoiceId, options) {
6056
+ return this.request("GET", `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {
6057
+ ...options
6058
+ });
6059
+ }
6060
+ /** Download the owned, published invoice as PDF bytes. */
6061
+ async downloadInvoicePdf(invoiceId, options) {
6062
+ return this.request("GET", `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {
6063
+ responseType: "blob",
6064
+ ...options
6065
+ });
6066
+ }
6067
+ async listPurchases(params, options) {
6068
+ return this.request("GET", "/buyer-portal/purchases", {
6069
+ query: params,
6070
+ ...options
6071
+ });
6072
+ }
6073
+ async listSubscriptions(params, options) {
6074
+ return this.request("GET", "/buyer-portal/subscriptions", {
6075
+ query: params,
6076
+ ...options
6077
+ });
6078
+ }
6079
+ /** Apply an action allowed by the subscription capabilities and portal grant. */
6080
+ async actOnSubscription(subscriptionId, params, options) {
6081
+ return this.request(
6082
+ "POST",
6083
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,
6084
+ { body: params, ...options }
6085
+ );
6086
+ }
6087
+ async listSubscriptionPlans(subscriptionId, params, options) {
6088
+ return this.request(
6089
+ "GET",
6090
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,
6091
+ { query: params, ...options }
6092
+ );
6093
+ }
6094
+ async changeSubscriptionPlan(subscriptionId, params, options) {
6095
+ return this.request(
6096
+ "POST",
6097
+ `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,
6098
+ { body: params, ...options }
6099
+ );
6100
+ }
6101
+ async listNativePlans(profileId, params, options) {
6102
+ return this.request(
6103
+ "GET",
6104
+ `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,
6105
+ { query: params, ...options }
6106
+ );
6107
+ }
6108
+ /** Retry with the same subscription ID and accepted terms after a lost response. */
6109
+ async enrollNative(params, options) {
6110
+ return this.request("POST", "/buyer-portal/subscriptions/native/enroll", {
6111
+ body: params,
6112
+ ...options
6113
+ });
6114
+ }
6115
+ async getNativeEnrollment(subscriptionId, params, options) {
6116
+ return this.request(
6117
+ "GET",
6118
+ `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,
6119
+ { query: { profile_id: params.profile_id }, ...options }
6120
+ );
6121
+ }
6122
+ async abandonNativeEnrollment(subscriptionId, params, options) {
6123
+ return this.request(
6124
+ "POST",
6125
+ `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,
6126
+ { query: { profile_id: params.profile_id }, ...options }
6127
+ );
6128
+ }
6129
+ };
6130
+
5996
6131
  // src/resources/audit.ts
5997
6132
  var Audit = class {
5998
6133
  constructor(request) {
@@ -6970,6 +7105,7 @@ var Delopay = class {
6970
7105
  this.replayRetention = new ReplayRetention(request);
6971
7106
  this.risk = new Risk(request);
6972
7107
  this.subscriptions = new Subscriptions(request);
7108
+ this.buyerPortal = new BuyerPortal(request);
6973
7109
  this.files = new Files(request);
6974
7110
  this.export = new Export(request);
6975
7111
  this.forex = new Forex(request);
@@ -11177,4 +11313,4 @@ export {
11177
11313
  decodeNativePanes,
11178
11314
  encodeNativePanes
11179
11315
  };
11180
- //# sourceMappingURL=chunk-AUVCCOH6.js.map
11316
+ //# sourceMappingURL=chunk-3U2LBZ32.js.map