@delopay/sdk 0.193.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/{chunk-72DLUJCI.js → chunk-OJIATYCP.js} +194 -7
- package/dist/chunk-OJIATYCP.js.map +1 -0
- package/dist/index.cjs +193 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +603 -28
- package/dist/index.d.ts +603 -28
- package/dist/index.js +1 -1
- package/dist/internal.cjs +236 -6
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +99 -3
- package/dist/internal.d.ts +99 -3
- package/dist/internal.js +43 -1
- package/dist/internal.js.map +1 -1
- package/package.json +18 -17
- package/dist/chunk-72DLUJCI.js.map +0 -1
|
@@ -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
|
*
|
|
@@ -3658,6 +3679,31 @@ var Users = class {
|
|
|
3658
3679
|
async signIn(params) {
|
|
3659
3680
|
return this.request("POST", "/user/signin", { body: params });
|
|
3660
3681
|
}
|
|
3682
|
+
/** Providers currently configured for dashboard sign-in. */
|
|
3683
|
+
async listOAuthProviders() {
|
|
3684
|
+
return this.request("GET", "/user/oauth/providers");
|
|
3685
|
+
}
|
|
3686
|
+
/** Current account's links; disabled providers remain visible. */
|
|
3687
|
+
async listLinkedOAuthProviders() {
|
|
3688
|
+
return this.request("GET", "/user/oauth/linked");
|
|
3689
|
+
}
|
|
3690
|
+
async startOAuthSignIn(params) {
|
|
3691
|
+
return this.request("POST", "/user/oauth/start", { body: params });
|
|
3692
|
+
}
|
|
3693
|
+
async startOAuthLink(params) {
|
|
3694
|
+
return this.request("POST", "/user/oauth/link/start", { body: params });
|
|
3695
|
+
}
|
|
3696
|
+
async completeOAuthSignIn(params) {
|
|
3697
|
+
return this.request("POST", "/user/oauth/complete", { body: params });
|
|
3698
|
+
}
|
|
3699
|
+
async completeOAuthLink(params) {
|
|
3700
|
+
return this.request("POST", "/user/oauth/link/complete", { body: params });
|
|
3701
|
+
}
|
|
3702
|
+
async disconnectOAuthProvider(provider, params) {
|
|
3703
|
+
return this.request("DELETE", `/user/oauth/linked/${encodeURIComponent(provider)}`, {
|
|
3704
|
+
body: params
|
|
3705
|
+
});
|
|
3706
|
+
}
|
|
3661
3707
|
async signOut() {
|
|
3662
3708
|
return this.request("POST", "/user/signout");
|
|
3663
3709
|
}
|
|
@@ -5692,6 +5738,29 @@ var Subscriptions = class {
|
|
|
5692
5738
|
constructor(request) {
|
|
5693
5739
|
this.request = request;
|
|
5694
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
|
+
}
|
|
5695
5764
|
/**
|
|
5696
5765
|
* Create and immediately confirm a subscription. `POST /subscriptions`
|
|
5697
5766
|
*
|
|
@@ -5736,7 +5805,13 @@ var Subscriptions = class {
|
|
|
5736
5805
|
...options
|
|
5737
5806
|
});
|
|
5738
5807
|
}
|
|
5739
|
-
/**
|
|
5808
|
+
/**
|
|
5809
|
+
* Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`
|
|
5810
|
+
*
|
|
5811
|
+
* From the dashboard this counts against the caller's `subscription_change`
|
|
5812
|
+
* operation limit; an over-limit call fails with `DE_01` and nothing reaches
|
|
5813
|
+
* the processor. Calls made with an API key are not limited.
|
|
5814
|
+
*/
|
|
5740
5815
|
async update(subscriptionId, params, options) {
|
|
5741
5816
|
return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
|
|
5742
5817
|
body: params,
|
|
@@ -5792,6 +5867,10 @@ var Subscriptions = class {
|
|
|
5792
5867
|
/**
|
|
5793
5868
|
* Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`
|
|
5794
5869
|
*
|
|
5870
|
+
* From the dashboard this counts against the caller's `subscription_change`
|
|
5871
|
+
* operation limit; an over-limit call fails with `DE_01` and nothing reaches
|
|
5872
|
+
* the processor. Calls made with an API key are not limited.
|
|
5873
|
+
*
|
|
5795
5874
|
* The body defaults to `{}` so the request still carries
|
|
5796
5875
|
* `Content-Type: application/json` even when no params are passed — the
|
|
5797
5876
|
* backend rejects the POST otherwise ("Unsupported content type").
|
|
@@ -5802,7 +5881,13 @@ var Subscriptions = class {
|
|
|
5802
5881
|
...options
|
|
5803
5882
|
});
|
|
5804
5883
|
}
|
|
5805
|
-
/**
|
|
5884
|
+
/**
|
|
5885
|
+
* Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`
|
|
5886
|
+
*
|
|
5887
|
+
* From the dashboard this counts against the caller's `subscription_change`
|
|
5888
|
+
* operation limit; an over-limit call fails with `DE_01` and nothing reaches
|
|
5889
|
+
* the processor. Calls made with an API key are not limited.
|
|
5890
|
+
*/
|
|
5806
5891
|
async resume(subscriptionId, params, options) {
|
|
5807
5892
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
|
|
5808
5893
|
body: params ?? {},
|
|
@@ -5814,6 +5899,10 @@ var Subscriptions = class {
|
|
|
5814
5899
|
*
|
|
5815
5900
|
* A subscription in a state it cannot be cancelled from is refused with
|
|
5816
5901
|
* `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).
|
|
5902
|
+
*
|
|
5903
|
+
* From the dashboard this counts against the caller's `subscription_change`
|
|
5904
|
+
* operation limit; an over-limit call fails with `DE_01` and nothing reaches
|
|
5905
|
+
* the processor. Calls made with an API key are not limited.
|
|
5817
5906
|
*/
|
|
5818
5907
|
async cancel(subscriptionId, params, options) {
|
|
5819
5908
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
|
|
@@ -5948,6 +6037,96 @@ var Subscriptions = class {
|
|
|
5948
6037
|
}
|
|
5949
6038
|
};
|
|
5950
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
|
+
|
|
5951
6130
|
// src/resources/audit.ts
|
|
5952
6131
|
var Audit = class {
|
|
5953
6132
|
constructor(request) {
|
|
@@ -6318,10 +6497,13 @@ var Settlement = class {
|
|
|
6318
6497
|
* Add a manual adjustment to a statement. Positive `amount_usd` charges
|
|
6319
6498
|
* the shop (reducing their payout); negative credits them.
|
|
6320
6499
|
*
|
|
6321
|
-
* Subject to the caller's `settlement_adjustment` operation limit
|
|
6322
|
-
*
|
|
6323
|
-
*
|
|
6324
|
-
*
|
|
6500
|
+
* Subject to the caller's `settlement_adjustment` operation limit: an
|
|
6501
|
+
* over-limit call fails with `DE_01` and no adjustment is added. Both
|
|
6502
|
+
* windows count every add, and a credit counts at its magnitude. A
|
|
6503
|
+
* settlement rule can only block — approval is refund-only, for the reason
|
|
6504
|
+
* given on `updateStatementPayout()`. When another add by the same user
|
|
6505
|
+
* changes the window while this one is being admitted, the call fails with
|
|
6506
|
+
* HTTP 412 and nothing is written; retrying the same request is safe.
|
|
6325
6507
|
*
|
|
6326
6508
|
* `POST /settlement/statements/{statementId}/adjustments`
|
|
6327
6509
|
*/
|
|
@@ -6335,6 +6517,10 @@ var Settlement = class {
|
|
|
6335
6517
|
/**
|
|
6336
6518
|
* Remove a manual adjustment from a statement.
|
|
6337
6519
|
*
|
|
6520
|
+
* The adjustment still counts against the caller's `settlement_adjustment`
|
|
6521
|
+
* limit window it was added in: removing it does not give back its count or
|
|
6522
|
+
* amount.
|
|
6523
|
+
*
|
|
6338
6524
|
* `DELETE /settlement/statements/{statementId}/adjustments/{adjustmentId}`
|
|
6339
6525
|
*/
|
|
6340
6526
|
async deleteStatementAdjustment(statementId, adjustmentId, options) {
|
|
@@ -6918,6 +7104,7 @@ var Delopay = class {
|
|
|
6918
7104
|
this.replayRetention = new ReplayRetention(request);
|
|
6919
7105
|
this.risk = new Risk(request);
|
|
6920
7106
|
this.subscriptions = new Subscriptions(request);
|
|
7107
|
+
this.buyerPortal = new BuyerPortal(request);
|
|
6921
7108
|
this.files = new Files(request);
|
|
6922
7109
|
this.export = new Export(request);
|
|
6923
7110
|
this.forex = new Forex(request);
|
|
@@ -11125,4 +11312,4 @@ export {
|
|
|
11125
11312
|
decodeNativePanes,
|
|
11126
11313
|
encodeNativePanes
|
|
11127
11314
|
};
|
|
11128
|
-
//# sourceMappingURL=chunk-
|
|
11315
|
+
//# sourceMappingURL=chunk-OJIATYCP.js.map
|