@delopay/sdk 0.32.0 → 0.33.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-ML3Z6JBP.js → chunk-33ZLHH3I.js} +33 -23
- package/dist/chunk-33ZLHH3I.js.map +1 -0
- package/dist/index.cjs +32 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -11
- package/dist/index.d.ts +23 -11
- package/dist/index.js +1 -1
- package/dist/internal.cjs +32 -22
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ML3Z6JBP.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1900,6 +1900,8 @@ interface SubscriptionInvoice {
|
|
|
1900
1900
|
status: InvoiceStatus;
|
|
1901
1901
|
/** ID of this invoice on the billing processor (Stripe Billing / PayPal). */
|
|
1902
1902
|
billing_processor_invoice_id?: string | null;
|
|
1903
|
+
/** Connector (billing processor) this invoice was raised through, e.g. `paypal`. */
|
|
1904
|
+
provider_name?: Connector | null;
|
|
1903
1905
|
}
|
|
1904
1906
|
/** A purchasable price option for a subscription item (plan or addon). */
|
|
1905
1907
|
interface SubscriptionItemPrice {
|
|
@@ -2133,6 +2135,10 @@ interface SubscriptionEstimateResponse {
|
|
|
2133
2135
|
coupon_code?: string | null;
|
|
2134
2136
|
customer_id?: string | null;
|
|
2135
2137
|
line_items: SubscriptionLineItem[];
|
|
2138
|
+
/** Billing interval unit, when the connector exposes it. */
|
|
2139
|
+
interval?: SubscriptionPeriodUnit | null;
|
|
2140
|
+
/** Number of interval units per cycle, when known. */
|
|
2141
|
+
interval_count?: number | null;
|
|
2136
2142
|
}
|
|
2137
2143
|
interface RegionCreateRequest {
|
|
2138
2144
|
region_name: string;
|
|
@@ -3705,6 +3711,12 @@ declare class Regions {
|
|
|
3705
3711
|
list(): Promise<RegionResponse[]>;
|
|
3706
3712
|
}
|
|
3707
3713
|
|
|
3714
|
+
/**
|
|
3715
|
+
* Subscription endpoints are profile-scoped: the backend requires an
|
|
3716
|
+
* `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`
|
|
3717
|
+
* otherwise). Pass it through the per-call `options.headers`, e.g.
|
|
3718
|
+
* `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.
|
|
3719
|
+
*/
|
|
3708
3720
|
declare class Subscriptions {
|
|
3709
3721
|
private readonly request;
|
|
3710
3722
|
constructor(request: RequestFn);
|
|
@@ -3714,32 +3726,32 @@ declare class Subscriptions {
|
|
|
3714
3726
|
* For billing processors that require buyer approval (e.g. PayPal), the
|
|
3715
3727
|
* response carries a `redirect_url` the customer must be sent to.
|
|
3716
3728
|
*/
|
|
3717
|
-
createAndConfirm(params: CreateAndConfirmSubscriptionRequest): Promise<ConfirmSubscriptionResponse>;
|
|
3729
|
+
createAndConfirm(params: CreateAndConfirmSubscriptionRequest, options?: RequestExtras): Promise<ConfirmSubscriptionResponse>;
|
|
3718
3730
|
/** Create a subscription without confirming it. `POST /subscriptions/create` */
|
|
3719
|
-
create(params: CreateSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
3731
|
+
create(params: CreateSubscriptionRequest, options?: RequestExtras): Promise<SubscriptionResponse>;
|
|
3720
3732
|
/** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
|
|
3721
|
-
retrieve(subscriptionId: string): Promise<SubscriptionResponse>;
|
|
3733
|
+
retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse>;
|
|
3722
3734
|
/**
|
|
3723
3735
|
* Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
|
|
3724
3736
|
*
|
|
3725
3737
|
* Like {@link createAndConfirm}, the response may carry a `redirect_url` for
|
|
3726
3738
|
* processors that require buyer approval.
|
|
3727
3739
|
*/
|
|
3728
|
-
confirm(subscriptionId: string, params: ConfirmSubscriptionRequest): Promise<ConfirmSubscriptionResponse>;
|
|
3740
|
+
confirm(subscriptionId: string, params: ConfirmSubscriptionRequest, options?: RequestExtras): Promise<ConfirmSubscriptionResponse>;
|
|
3729
3741
|
/** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
|
|
3730
|
-
update(subscriptionId: string, params: UpdateSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
3742
|
+
update(subscriptionId: string, params: UpdateSubscriptionRequest, options?: RequestExtras): Promise<SubscriptionResponse>;
|
|
3731
3743
|
/** List subscriptions for the profile. `GET /subscriptions/list` */
|
|
3732
|
-
list(params?: SubscriptionListParams): Promise<SubscriptionResponse[]>;
|
|
3744
|
+
list(params?: SubscriptionListParams, options?: RequestExtras): Promise<SubscriptionResponse[]>;
|
|
3733
3745
|
/** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
|
|
3734
|
-
getEstimate(params: SubscriptionEstimateParams): Promise<SubscriptionEstimateResponse>;
|
|
3746
|
+
getEstimate(params: SubscriptionEstimateParams, options?: RequestExtras): Promise<SubscriptionEstimateResponse>;
|
|
3735
3747
|
/** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
|
|
3736
|
-
getItems(params: GetSubscriptionItemsParams): Promise<GetSubscriptionItemsResponse[]>;
|
|
3748
|
+
getItems(params: GetSubscriptionItemsParams, options?: RequestExtras): Promise<GetSubscriptionItemsResponse[]>;
|
|
3737
3749
|
/** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
|
|
3738
|
-
pause(subscriptionId: string, params?: PauseSubscriptionRequest): Promise<PauseSubscriptionResponse>;
|
|
3750
|
+
pause(subscriptionId: string, params?: PauseSubscriptionRequest, options?: RequestExtras): Promise<PauseSubscriptionResponse>;
|
|
3739
3751
|
/** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
|
|
3740
|
-
resume(subscriptionId: string, params?: ResumeSubscriptionRequest): Promise<ResumeSubscriptionResponse>;
|
|
3752
|
+
resume(subscriptionId: string, params?: ResumeSubscriptionRequest, options?: RequestExtras): Promise<ResumeSubscriptionResponse>;
|
|
3741
3753
|
/** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
|
|
3742
|
-
cancel(subscriptionId: string, params?: CancelSubscriptionRequest): Promise<CancelSubscriptionResponse>;
|
|
3754
|
+
cancel(subscriptionId: string, params?: CancelSubscriptionRequest, options?: RequestExtras): Promise<CancelSubscriptionResponse>;
|
|
3743
3755
|
}
|
|
3744
3756
|
|
|
3745
3757
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1900,6 +1900,8 @@ interface SubscriptionInvoice {
|
|
|
1900
1900
|
status: InvoiceStatus;
|
|
1901
1901
|
/** ID of this invoice on the billing processor (Stripe Billing / PayPal). */
|
|
1902
1902
|
billing_processor_invoice_id?: string | null;
|
|
1903
|
+
/** Connector (billing processor) this invoice was raised through, e.g. `paypal`. */
|
|
1904
|
+
provider_name?: Connector | null;
|
|
1903
1905
|
}
|
|
1904
1906
|
/** A purchasable price option for a subscription item (plan or addon). */
|
|
1905
1907
|
interface SubscriptionItemPrice {
|
|
@@ -2133,6 +2135,10 @@ interface SubscriptionEstimateResponse {
|
|
|
2133
2135
|
coupon_code?: string | null;
|
|
2134
2136
|
customer_id?: string | null;
|
|
2135
2137
|
line_items: SubscriptionLineItem[];
|
|
2138
|
+
/** Billing interval unit, when the connector exposes it. */
|
|
2139
|
+
interval?: SubscriptionPeriodUnit | null;
|
|
2140
|
+
/** Number of interval units per cycle, when known. */
|
|
2141
|
+
interval_count?: number | null;
|
|
2136
2142
|
}
|
|
2137
2143
|
interface RegionCreateRequest {
|
|
2138
2144
|
region_name: string;
|
|
@@ -3705,6 +3711,12 @@ declare class Regions {
|
|
|
3705
3711
|
list(): Promise<RegionResponse[]>;
|
|
3706
3712
|
}
|
|
3707
3713
|
|
|
3714
|
+
/**
|
|
3715
|
+
* Subscription endpoints are profile-scoped: the backend requires an
|
|
3716
|
+
* `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`
|
|
3717
|
+
* otherwise). Pass it through the per-call `options.headers`, e.g.
|
|
3718
|
+
* `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.
|
|
3719
|
+
*/
|
|
3708
3720
|
declare class Subscriptions {
|
|
3709
3721
|
private readonly request;
|
|
3710
3722
|
constructor(request: RequestFn);
|
|
@@ -3714,32 +3726,32 @@ declare class Subscriptions {
|
|
|
3714
3726
|
* For billing processors that require buyer approval (e.g. PayPal), the
|
|
3715
3727
|
* response carries a `redirect_url` the customer must be sent to.
|
|
3716
3728
|
*/
|
|
3717
|
-
createAndConfirm(params: CreateAndConfirmSubscriptionRequest): Promise<ConfirmSubscriptionResponse>;
|
|
3729
|
+
createAndConfirm(params: CreateAndConfirmSubscriptionRequest, options?: RequestExtras): Promise<ConfirmSubscriptionResponse>;
|
|
3718
3730
|
/** Create a subscription without confirming it. `POST /subscriptions/create` */
|
|
3719
|
-
create(params: CreateSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
3731
|
+
create(params: CreateSubscriptionRequest, options?: RequestExtras): Promise<SubscriptionResponse>;
|
|
3720
3732
|
/** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
|
|
3721
|
-
retrieve(subscriptionId: string): Promise<SubscriptionResponse>;
|
|
3733
|
+
retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse>;
|
|
3722
3734
|
/**
|
|
3723
3735
|
* Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
|
|
3724
3736
|
*
|
|
3725
3737
|
* Like {@link createAndConfirm}, the response may carry a `redirect_url` for
|
|
3726
3738
|
* processors that require buyer approval.
|
|
3727
3739
|
*/
|
|
3728
|
-
confirm(subscriptionId: string, params: ConfirmSubscriptionRequest): Promise<ConfirmSubscriptionResponse>;
|
|
3740
|
+
confirm(subscriptionId: string, params: ConfirmSubscriptionRequest, options?: RequestExtras): Promise<ConfirmSubscriptionResponse>;
|
|
3729
3741
|
/** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
|
|
3730
|
-
update(subscriptionId: string, params: UpdateSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
3742
|
+
update(subscriptionId: string, params: UpdateSubscriptionRequest, options?: RequestExtras): Promise<SubscriptionResponse>;
|
|
3731
3743
|
/** List subscriptions for the profile. `GET /subscriptions/list` */
|
|
3732
|
-
list(params?: SubscriptionListParams): Promise<SubscriptionResponse[]>;
|
|
3744
|
+
list(params?: SubscriptionListParams, options?: RequestExtras): Promise<SubscriptionResponse[]>;
|
|
3733
3745
|
/** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
|
|
3734
|
-
getEstimate(params: SubscriptionEstimateParams): Promise<SubscriptionEstimateResponse>;
|
|
3746
|
+
getEstimate(params: SubscriptionEstimateParams, options?: RequestExtras): Promise<SubscriptionEstimateResponse>;
|
|
3735
3747
|
/** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
|
|
3736
|
-
getItems(params: GetSubscriptionItemsParams): Promise<GetSubscriptionItemsResponse[]>;
|
|
3748
|
+
getItems(params: GetSubscriptionItemsParams, options?: RequestExtras): Promise<GetSubscriptionItemsResponse[]>;
|
|
3737
3749
|
/** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
|
|
3738
|
-
pause(subscriptionId: string, params?: PauseSubscriptionRequest): Promise<PauseSubscriptionResponse>;
|
|
3750
|
+
pause(subscriptionId: string, params?: PauseSubscriptionRequest, options?: RequestExtras): Promise<PauseSubscriptionResponse>;
|
|
3739
3751
|
/** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
|
|
3740
|
-
resume(subscriptionId: string, params?: ResumeSubscriptionRequest): Promise<ResumeSubscriptionResponse>;
|
|
3752
|
+
resume(subscriptionId: string, params?: ResumeSubscriptionRequest, options?: RequestExtras): Promise<ResumeSubscriptionResponse>;
|
|
3741
3753
|
/** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
|
|
3742
|
-
cancel(subscriptionId: string, params?: CancelSubscriptionRequest): Promise<CancelSubscriptionResponse>;
|
|
3754
|
+
cancel(subscriptionId: string, params?: CancelSubscriptionRequest, options?: RequestExtras): Promise<CancelSubscriptionResponse>;
|
|
3743
3755
|
}
|
|
3744
3756
|
|
|
3745
3757
|
/**
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -2611,16 +2611,18 @@ var Subscriptions = class {
|
|
|
2611
2611
|
* For billing processors that require buyer approval (e.g. PayPal), the
|
|
2612
2612
|
* response carries a `redirect_url` the customer must be sent to.
|
|
2613
2613
|
*/
|
|
2614
|
-
async createAndConfirm(params) {
|
|
2615
|
-
return this.request("POST", "/subscriptions", { body: params });
|
|
2614
|
+
async createAndConfirm(params, options) {
|
|
2615
|
+
return this.request("POST", "/subscriptions", { body: params, ...options });
|
|
2616
2616
|
}
|
|
2617
2617
|
/** Create a subscription without confirming it. `POST /subscriptions/create` */
|
|
2618
|
-
async create(params) {
|
|
2619
|
-
return this.request("POST", "/subscriptions/create", { body: params });
|
|
2618
|
+
async create(params, options) {
|
|
2619
|
+
return this.request("POST", "/subscriptions/create", { body: params, ...options });
|
|
2620
2620
|
}
|
|
2621
2621
|
/** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */
|
|
2622
|
-
async retrieve(subscriptionId) {
|
|
2623
|
-
return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}
|
|
2622
|
+
async retrieve(subscriptionId, options) {
|
|
2623
|
+
return this.request("GET", `/subscriptions/${encodeURIComponent(subscriptionId)}`, {
|
|
2624
|
+
...options
|
|
2625
|
+
});
|
|
2624
2626
|
}
|
|
2625
2627
|
/**
|
|
2626
2628
|
* Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`
|
|
@@ -2628,51 +2630,59 @@ var Subscriptions = class {
|
|
|
2628
2630
|
* Like {@link createAndConfirm}, the response may carry a `redirect_url` for
|
|
2629
2631
|
* processors that require buyer approval.
|
|
2630
2632
|
*/
|
|
2631
|
-
async confirm(subscriptionId, params) {
|
|
2633
|
+
async confirm(subscriptionId, params, options) {
|
|
2632
2634
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {
|
|
2633
|
-
body: params
|
|
2635
|
+
body: params,
|
|
2636
|
+
...options
|
|
2634
2637
|
});
|
|
2635
2638
|
}
|
|
2636
2639
|
/** Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update` */
|
|
2637
|
-
async update(subscriptionId, params) {
|
|
2640
|
+
async update(subscriptionId, params, options) {
|
|
2638
2641
|
return this.request("PUT", `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {
|
|
2639
|
-
body: params
|
|
2642
|
+
body: params,
|
|
2643
|
+
...options
|
|
2640
2644
|
});
|
|
2641
2645
|
}
|
|
2642
2646
|
/** List subscriptions for the profile. `GET /subscriptions/list` */
|
|
2643
|
-
async list(params) {
|
|
2647
|
+
async list(params, options) {
|
|
2644
2648
|
return this.request("GET", "/subscriptions/list", {
|
|
2645
|
-
query: params
|
|
2649
|
+
query: params,
|
|
2650
|
+
...options
|
|
2646
2651
|
});
|
|
2647
2652
|
}
|
|
2648
2653
|
/** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */
|
|
2649
|
-
async getEstimate(params) {
|
|
2654
|
+
async getEstimate(params, options) {
|
|
2650
2655
|
return this.request("GET", "/subscriptions/estimate", {
|
|
2651
|
-
query: params
|
|
2656
|
+
query: params,
|
|
2657
|
+
...options
|
|
2652
2658
|
});
|
|
2653
2659
|
}
|
|
2654
2660
|
/** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */
|
|
2655
|
-
async getItems(params) {
|
|
2661
|
+
async getItems(params, options) {
|
|
2656
2662
|
return this.request("GET", "/subscriptions/items", {
|
|
2657
|
-
query: params
|
|
2663
|
+
query: params,
|
|
2664
|
+
...options
|
|
2658
2665
|
});
|
|
2659
2666
|
}
|
|
2660
2667
|
/** Pause a subscription. `POST /subscriptions/{subscriptionId}/pause` */
|
|
2661
|
-
async pause(subscriptionId, params) {
|
|
2668
|
+
async pause(subscriptionId, params, options) {
|
|
2662
2669
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {
|
|
2663
|
-
body: params
|
|
2670
|
+
body: params,
|
|
2671
|
+
...options
|
|
2664
2672
|
});
|
|
2665
2673
|
}
|
|
2666
2674
|
/** Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume` */
|
|
2667
|
-
async resume(subscriptionId, params) {
|
|
2675
|
+
async resume(subscriptionId, params, options) {
|
|
2668
2676
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {
|
|
2669
|
-
body: params
|
|
2677
|
+
body: params,
|
|
2678
|
+
...options
|
|
2670
2679
|
});
|
|
2671
2680
|
}
|
|
2672
2681
|
/** Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel` */
|
|
2673
|
-
async cancel(subscriptionId, params) {
|
|
2682
|
+
async cancel(subscriptionId, params, options) {
|
|
2674
2683
|
return this.request("POST", `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {
|
|
2675
|
-
body: params
|
|
2684
|
+
body: params,
|
|
2685
|
+
...options
|
|
2676
2686
|
});
|
|
2677
2687
|
}
|
|
2678
2688
|
};
|