@usehercules/sdk 1.2.0 → 1.4.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/CHANGELOG.md +129 -0
- package/LICENSE +1 -1
- package/README.md +14 -20
- package/client.d.mts +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -3
- package/client.d.ts.map +1 -1
- package/client.js +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +4 -4
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +4 -4
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -4
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -4
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +3 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/pay/coupons.d.mts +156 -0
- package/resources/beta/pay/coupons.d.mts.map +1 -0
- package/resources/beta/pay/coupons.d.ts +156 -0
- package/resources/beta/pay/coupons.d.ts.map +1 -0
- package/resources/beta/pay/coupons.js +51 -0
- package/resources/beta/pay/coupons.js.map +1 -0
- package/resources/beta/pay/coupons.mjs +47 -0
- package/resources/beta/pay/coupons.mjs.map +1 -0
- package/resources/beta/pay/customers.d.mts +160 -0
- package/resources/beta/pay/customers.d.mts.map +1 -0
- package/resources/beta/pay/customers.d.ts +160 -0
- package/resources/beta/pay/customers.d.ts.map +1 -0
- package/resources/beta/pay/customers.js +60 -0
- package/resources/beta/pay/customers.js.map +1 -0
- package/resources/beta/pay/customers.mjs +56 -0
- package/resources/beta/pay/customers.mjs.map +1 -0
- package/resources/beta/{subscriptions → pay}/entitlements.d.mts +25 -19
- package/resources/beta/pay/entitlements.d.mts.map +1 -0
- package/resources/beta/{subscriptions → pay}/entitlements.d.ts +25 -19
- package/resources/beta/pay/entitlements.d.ts.map +1 -0
- package/resources/beta/pay/entitlements.js +41 -0
- package/resources/beta/pay/entitlements.js.map +1 -0
- package/resources/beta/pay/entitlements.mjs +37 -0
- package/resources/beta/pay/entitlements.mjs.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.d.mts +2 -2
- package/resources/beta/pay/index.d.mts.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.d.ts +2 -2
- package/resources/beta/pay/index.d.ts.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.js +5 -5
- package/resources/beta/pay/index.js.map +1 -0
- package/resources/beta/{subscriptions → pay}/index.mjs +2 -2
- package/resources/beta/pay/index.mjs.map +1 -0
- package/resources/beta/pay/pay.d.mts +206 -0
- package/resources/beta/pay/pay.d.mts.map +1 -0
- package/resources/beta/pay/pay.d.ts +206 -0
- package/resources/beta/pay/pay.d.ts.map +1 -0
- package/resources/beta/pay/pay.js +54 -0
- package/resources/beta/pay/pay.js.map +1 -0
- package/resources/beta/pay/pay.mjs +49 -0
- package/resources/beta/pay/pay.mjs.map +1 -0
- package/resources/beta/pay/products/entitlements.d.mts +53 -0
- package/resources/beta/pay/products/entitlements.d.mts.map +1 -0
- package/resources/beta/pay/products/entitlements.d.ts +53 -0
- package/resources/beta/pay/products/entitlements.d.ts.map +1 -0
- package/resources/beta/pay/products/entitlements.js +38 -0
- package/resources/beta/pay/products/entitlements.js.map +1 -0
- package/resources/beta/pay/products/entitlements.mjs +34 -0
- package/resources/beta/pay/products/entitlements.mjs.map +1 -0
- package/resources/beta/pay/products/index.d.mts +4 -0
- package/resources/beta/pay/products/index.d.mts.map +1 -0
- package/resources/beta/pay/products/index.d.ts +4 -0
- package/resources/beta/pay/products/index.d.ts.map +1 -0
- package/resources/beta/pay/products/index.js +11 -0
- package/resources/beta/pay/products/index.js.map +1 -0
- package/resources/beta/{subscriptions/plans → pay/products}/index.mjs +2 -1
- package/resources/beta/pay/products/index.mjs.map +1 -0
- package/resources/beta/pay/products/products.d.mts +183 -0
- package/resources/beta/pay/products/products.d.mts.map +1 -0
- package/resources/beta/pay/products/products.d.ts +183 -0
- package/resources/beta/pay/products/products.d.ts.map +1 -0
- package/resources/beta/pay/products/products.js +61 -0
- package/resources/beta/pay/products/products.js.map +1 -0
- package/resources/beta/pay/products/products.mjs +56 -0
- package/resources/beta/pay/products/products.mjs.map +1 -0
- package/resources/beta/pay/products/variants.d.mts +206 -0
- package/resources/beta/pay/products/variants.d.mts.map +1 -0
- package/resources/beta/pay/products/variants.d.ts +206 -0
- package/resources/beta/pay/products/variants.d.ts.map +1 -0
- package/resources/beta/pay/products/variants.js +56 -0
- package/resources/beta/pay/products/variants.js.map +1 -0
- package/resources/beta/pay/products/variants.mjs +52 -0
- package/resources/beta/pay/products/variants.mjs.map +1 -0
- package/resources/beta/pay/products.d.mts +2 -0
- package/resources/beta/pay/products.d.mts.map +1 -0
- package/resources/beta/pay/products.d.ts +2 -0
- package/resources/beta/pay/products.d.ts.map +1 -0
- package/resources/beta/{subscriptions/plans.js → pay/products.js} +2 -2
- package/resources/beta/pay/products.js.map +1 -0
- package/resources/beta/{subscriptions.mjs → pay/products.mjs} +2 -2
- package/resources/beta/pay/products.mjs.map +1 -0
- package/resources/beta/pay.d.mts +2 -0
- package/resources/beta/pay.d.mts.map +1 -0
- package/resources/beta/pay.d.ts +2 -0
- package/resources/beta/pay.d.ts.map +1 -0
- package/resources/beta/{subscriptions.js → pay.js} +2 -2
- package/resources/beta/pay.js.map +1 -0
- package/resources/beta/{subscriptions/plans.mjs → pay.mjs} +2 -2
- package/resources/beta/pay.mjs.map +1 -0
- package/src/client.ts +6 -4
- package/src/resources/beta/beta.ts +18 -18
- package/src/resources/beta/index.ts +8 -8
- package/src/resources/beta/pay/coupons.ts +218 -0
- package/src/resources/beta/pay/customers.ts +229 -0
- package/src/resources/beta/{subscriptions → pay}/entitlements.ts +29 -29
- package/src/resources/beta/{subscriptions → pay}/index.ts +15 -15
- package/src/resources/beta/pay/pay.ts +326 -0
- package/src/resources/beta/{subscriptions/plans → pay/products}/entitlements.ts +26 -21
- package/src/resources/beta/pay/products/index.ts +28 -0
- package/src/resources/beta/pay/products/products.ts +280 -0
- package/src/resources/beta/pay/products/variants.ts +279 -0
- package/src/resources/beta/{subscriptions.ts → pay/products.ts} +1 -1
- package/src/resources/beta/{subscriptions/plans.ts → pay.ts} +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/beta/subscriptions/coupons.d.mts +0 -124
- package/resources/beta/subscriptions/coupons.d.mts.map +0 -1
- package/resources/beta/subscriptions/coupons.d.ts +0 -124
- package/resources/beta/subscriptions/coupons.d.ts.map +0 -1
- package/resources/beta/subscriptions/coupons.js +0 -45
- package/resources/beta/subscriptions/coupons.js.map +0 -1
- package/resources/beta/subscriptions/coupons.mjs +0 -41
- package/resources/beta/subscriptions/coupons.mjs.map +0 -1
- package/resources/beta/subscriptions/customers.d.mts +0 -93
- package/resources/beta/subscriptions/customers.d.mts.map +0 -1
- package/resources/beta/subscriptions/customers.d.ts +0 -93
- package/resources/beta/subscriptions/customers.d.ts.map +0 -1
- package/resources/beta/subscriptions/customers.js +0 -57
- package/resources/beta/subscriptions/customers.js.map +0 -1
- package/resources/beta/subscriptions/customers.mjs +0 -53
- package/resources/beta/subscriptions/customers.mjs.map +0 -1
- package/resources/beta/subscriptions/entitlements.d.mts.map +0 -1
- package/resources/beta/subscriptions/entitlements.d.ts.map +0 -1
- package/resources/beta/subscriptions/entitlements.js +0 -38
- package/resources/beta/subscriptions/entitlements.js.map +0 -1
- package/resources/beta/subscriptions/entitlements.mjs +0 -34
- package/resources/beta/subscriptions/entitlements.mjs.map +0 -1
- package/resources/beta/subscriptions/index.d.mts.map +0 -1
- package/resources/beta/subscriptions/index.d.ts.map +0 -1
- package/resources/beta/subscriptions/index.js.map +0 -1
- package/resources/beta/subscriptions/index.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.d.mts +0 -48
- package/resources/beta/subscriptions/plans/entitlements.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.d.ts +0 -48
- package/resources/beta/subscriptions/plans/entitlements.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.js +0 -34
- package/resources/beta/subscriptions/plans/entitlements.js.map +0 -1
- package/resources/beta/subscriptions/plans/entitlements.mjs +0 -30
- package/resources/beta/subscriptions/plans/entitlements.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/index.d.mts +0 -3
- package/resources/beta/subscriptions/plans/index.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/index.d.ts +0 -3
- package/resources/beta/subscriptions/plans/index.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/index.js +0 -9
- package/resources/beta/subscriptions/plans/index.js.map +0 -1
- package/resources/beta/subscriptions/plans/index.mjs.map +0 -1
- package/resources/beta/subscriptions/plans/plans.d.mts +0 -87
- package/resources/beta/subscriptions/plans/plans.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans/plans.d.ts +0 -87
- package/resources/beta/subscriptions/plans/plans.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans/plans.js +0 -49
- package/resources/beta/subscriptions/plans/plans.js.map +0 -1
- package/resources/beta/subscriptions/plans/plans.mjs +0 -44
- package/resources/beta/subscriptions/plans/plans.mjs.map +0 -1
- package/resources/beta/subscriptions/plans.d.mts +0 -2
- package/resources/beta/subscriptions/plans.d.mts.map +0 -1
- package/resources/beta/subscriptions/plans.d.ts +0 -2
- package/resources/beta/subscriptions/plans.d.ts.map +0 -1
- package/resources/beta/subscriptions/plans.js.map +0 -1
- package/resources/beta/subscriptions/plans.mjs.map +0 -1
- package/resources/beta/subscriptions/subscriptions.d.mts +0 -130
- package/resources/beta/subscriptions/subscriptions.d.mts.map +0 -1
- package/resources/beta/subscriptions/subscriptions.d.ts +0 -130
- package/resources/beta/subscriptions/subscriptions.d.ts.map +0 -1
- package/resources/beta/subscriptions/subscriptions.js +0 -47
- package/resources/beta/subscriptions/subscriptions.js.map +0 -1
- package/resources/beta/subscriptions/subscriptions.mjs +0 -42
- package/resources/beta/subscriptions/subscriptions.mjs.map +0 -1
- package/resources/beta/subscriptions.d.mts +0 -2
- package/resources/beta/subscriptions.d.mts.map +0 -1
- package/resources/beta/subscriptions.d.ts +0 -2
- package/resources/beta/subscriptions.d.ts.map +0 -1
- package/resources/beta/subscriptions.js.map +0 -1
- package/resources/beta/subscriptions.mjs.map +0 -1
- package/src/resources/beta/subscriptions/coupons.ts +0 -185
- package/src/resources/beta/subscriptions/customers.ts +0 -168
- package/src/resources/beta/subscriptions/plans/index.ts +0 -18
- package/src/resources/beta/subscriptions/plans/plans.ts +0 -159
- package/src/resources/beta/subscriptions/subscriptions.ts +0 -241
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plans.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,2DAA8B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plans.mjs","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/plans.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
-
import * as CouponsAPI from "./coupons.mjs";
|
|
3
|
-
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams, Coupons, CouponsCursorIDPage } from "./coupons.mjs";
|
|
4
|
-
import * as CustomersAPI from "./customers.mjs";
|
|
5
|
-
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers.mjs";
|
|
6
|
-
import * as EntitlementsAPI from "./entitlements.mjs";
|
|
7
|
-
import { Entitlement, EntitlementCreateParams, EntitlementListParams, EntitlementUpdateParams, Entitlements, EntitlementsCursorIDPage } from "./entitlements.mjs";
|
|
8
|
-
import * as PlansAPI from "./plans/plans.mjs";
|
|
9
|
-
import { Plan, PlanCreateParams, PlanListParams, PlanUpdateParams, Plans, PlansCursorIDPage } from "./plans/plans.mjs";
|
|
10
|
-
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
11
|
-
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
12
|
-
export declare class Subscriptions extends APIResource {
|
|
13
|
-
customers: CustomersAPI.Customers;
|
|
14
|
-
plans: PlansAPI.Plans;
|
|
15
|
-
entitlements: EntitlementsAPI.Entitlements;
|
|
16
|
-
coupons: CouponsAPI.Coupons;
|
|
17
|
-
/**
|
|
18
|
-
* Cancel Subscription
|
|
19
|
-
*/
|
|
20
|
-
cancel(body: SubscriptionCancelParams, options?: RequestOptions): APIPromise<SubscriptionCancelResponse>;
|
|
21
|
-
/**
|
|
22
|
-
* Check Entitlement
|
|
23
|
-
*/
|
|
24
|
-
check(body: SubscriptionCheckParams, options?: RequestOptions): APIPromise<SubscriptionCheckResponse>;
|
|
25
|
-
/**
|
|
26
|
-
* Create Checkout Session
|
|
27
|
-
*/
|
|
28
|
-
checkout(body: SubscriptionCheckoutParams, options?: RequestOptions): APIPromise<SubscriptionCheckoutResponse>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Cancel subscription response
|
|
32
|
-
*/
|
|
33
|
-
export interface SubscriptionCancelResponse {
|
|
34
|
-
/**
|
|
35
|
-
* The subscription ID
|
|
36
|
-
*/
|
|
37
|
-
id: string;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the subscription will cancel at period end
|
|
40
|
-
*/
|
|
41
|
-
cancel_at_period_end: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The subscription status
|
|
44
|
-
*/
|
|
45
|
-
status: string;
|
|
46
|
-
/**
|
|
47
|
-
* When the subscription was canceled
|
|
48
|
-
*/
|
|
49
|
-
canceled_at?: string | null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Check entitlement response
|
|
53
|
-
*/
|
|
54
|
-
export interface SubscriptionCheckResponse {
|
|
55
|
-
/**
|
|
56
|
-
* Whether the customer has the entitlement
|
|
57
|
-
*/
|
|
58
|
-
has_entitlement: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* The entitlement lookup key that was checked
|
|
61
|
-
*/
|
|
62
|
-
lookup_key: string;
|
|
63
|
-
/**
|
|
64
|
-
* The active entitlement ID if present
|
|
65
|
-
*/
|
|
66
|
-
entitlement_id?: string | null;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Checkout session response
|
|
70
|
-
*/
|
|
71
|
-
export interface SubscriptionCheckoutResponse {
|
|
72
|
-
/**
|
|
73
|
-
* The checkout session ID
|
|
74
|
-
*/
|
|
75
|
-
id: string;
|
|
76
|
-
/**
|
|
77
|
-
* The checkout URL to redirect the customer to
|
|
78
|
-
*/
|
|
79
|
-
url: string;
|
|
80
|
-
}
|
|
81
|
-
export interface SubscriptionCancelParams {
|
|
82
|
-
/**
|
|
83
|
-
* The customer ID
|
|
84
|
-
*/
|
|
85
|
-
customer_id: string;
|
|
86
|
-
/**
|
|
87
|
-
* The subscription ID to cancel
|
|
88
|
-
*/
|
|
89
|
-
subscription_id: string;
|
|
90
|
-
/**
|
|
91
|
-
* Whether to cancel at period end or immediately
|
|
92
|
-
*/
|
|
93
|
-
cancel_at_period_end?: boolean;
|
|
94
|
-
}
|
|
95
|
-
export interface SubscriptionCheckParams {
|
|
96
|
-
/**
|
|
97
|
-
* The customer ID
|
|
98
|
-
*/
|
|
99
|
-
customer_id: string;
|
|
100
|
-
/**
|
|
101
|
-
* The entitlement feature lookup key to check
|
|
102
|
-
*/
|
|
103
|
-
entitlement_lookup_key: string;
|
|
104
|
-
}
|
|
105
|
-
export interface SubscriptionCheckoutParams {
|
|
106
|
-
/**
|
|
107
|
-
* The customer ID
|
|
108
|
-
*/
|
|
109
|
-
customer_id: string;
|
|
110
|
-
/**
|
|
111
|
-
* The plan ID to subscribe to
|
|
112
|
-
*/
|
|
113
|
-
plan_id: string;
|
|
114
|
-
/**
|
|
115
|
-
* URL to redirect on cancel
|
|
116
|
-
*/
|
|
117
|
-
cancel_url?: string;
|
|
118
|
-
/**
|
|
119
|
-
* URL to redirect on success
|
|
120
|
-
*/
|
|
121
|
-
success_url?: string;
|
|
122
|
-
}
|
|
123
|
-
export declare namespace Subscriptions {
|
|
124
|
-
export { type SubscriptionCancelResponse as SubscriptionCancelResponse, type SubscriptionCheckResponse as SubscriptionCheckResponse, type SubscriptionCheckoutResponse as SubscriptionCheckoutResponse, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionCheckParams as SubscriptionCheckParams, type SubscriptionCheckoutParams as SubscriptionCheckoutParams, };
|
|
125
|
-
export { Customers as Customers, type Customer as Customer, type CustomerAddress as CustomerAddress, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomersCursorIDPage as CustomersCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
126
|
-
export { Plans as Plans, type Plan as Plan, type PlansCursorIDPage as PlansCursorIDPage, type PlanCreateParams as PlanCreateParams, type PlanUpdateParams as PlanUpdateParams, type PlanListParams as PlanListParams, };
|
|
127
|
-
export { Entitlements as Entitlements, type Entitlement as Entitlement, type EntitlementsCursorIDPage as EntitlementsCursorIDPage, type EntitlementCreateParams as EntitlementCreateParams, type EntitlementUpdateParams as EntitlementUpdateParams, type EntitlementListParams as EntitlementListParams, };
|
|
128
|
-
export { Coupons as Coupons, type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=subscriptions.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,QAAQ,EACR,eAAe,EACf,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,qBAAqB,EACtB;OACM,KAAK,eAAe;OACpB,EACL,WAAW,EACX,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,wBAAwB,EACzB;OACM,KAAK,QAAQ;OACb,EACL,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,iBAAiB,EAClB;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAC7E,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IACzD,YAAY,EAAE,eAAe,CAAC,YAAY,CAAkD;IAC5F,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IAEnE;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE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AK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.js";
|
|
2
|
-
import * as CouponsAPI from "./coupons.js";
|
|
3
|
-
import { Coupon, CouponCreateParams, CouponListParams, CouponUpdateParams, Coupons, CouponsCursorIDPage } from "./coupons.js";
|
|
4
|
-
import * as CustomersAPI from "./customers.js";
|
|
5
|
-
import { Customer, CustomerAddress, CustomerBillingPortalParams, CustomerBillingPortalResponse, CustomerCreateParams, CustomerListParams, CustomerUpdateParams, Customers, CustomersCursorIDPage } from "./customers.js";
|
|
6
|
-
import * as EntitlementsAPI from "./entitlements.js";
|
|
7
|
-
import { Entitlement, EntitlementCreateParams, EntitlementListParams, EntitlementUpdateParams, Entitlements, EntitlementsCursorIDPage } from "./entitlements.js";
|
|
8
|
-
import * as PlansAPI from "./plans/plans.js";
|
|
9
|
-
import { Plan, PlanCreateParams, PlanListParams, PlanUpdateParams, Plans, PlansCursorIDPage } from "./plans/plans.js";
|
|
10
|
-
import { APIPromise } from "../../../core/api-promise.js";
|
|
11
|
-
import { RequestOptions } from "../../../internal/request-options.js";
|
|
12
|
-
export declare class Subscriptions extends APIResource {
|
|
13
|
-
customers: CustomersAPI.Customers;
|
|
14
|
-
plans: PlansAPI.Plans;
|
|
15
|
-
entitlements: EntitlementsAPI.Entitlements;
|
|
16
|
-
coupons: CouponsAPI.Coupons;
|
|
17
|
-
/**
|
|
18
|
-
* Cancel Subscription
|
|
19
|
-
*/
|
|
20
|
-
cancel(body: SubscriptionCancelParams, options?: RequestOptions): APIPromise<SubscriptionCancelResponse>;
|
|
21
|
-
/**
|
|
22
|
-
* Check Entitlement
|
|
23
|
-
*/
|
|
24
|
-
check(body: SubscriptionCheckParams, options?: RequestOptions): APIPromise<SubscriptionCheckResponse>;
|
|
25
|
-
/**
|
|
26
|
-
* Create Checkout Session
|
|
27
|
-
*/
|
|
28
|
-
checkout(body: SubscriptionCheckoutParams, options?: RequestOptions): APIPromise<SubscriptionCheckoutResponse>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Cancel subscription response
|
|
32
|
-
*/
|
|
33
|
-
export interface SubscriptionCancelResponse {
|
|
34
|
-
/**
|
|
35
|
-
* The subscription ID
|
|
36
|
-
*/
|
|
37
|
-
id: string;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the subscription will cancel at period end
|
|
40
|
-
*/
|
|
41
|
-
cancel_at_period_end: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The subscription status
|
|
44
|
-
*/
|
|
45
|
-
status: string;
|
|
46
|
-
/**
|
|
47
|
-
* When the subscription was canceled
|
|
48
|
-
*/
|
|
49
|
-
canceled_at?: string | null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Check entitlement response
|
|
53
|
-
*/
|
|
54
|
-
export interface SubscriptionCheckResponse {
|
|
55
|
-
/**
|
|
56
|
-
* Whether the customer has the entitlement
|
|
57
|
-
*/
|
|
58
|
-
has_entitlement: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* The entitlement lookup key that was checked
|
|
61
|
-
*/
|
|
62
|
-
lookup_key: string;
|
|
63
|
-
/**
|
|
64
|
-
* The active entitlement ID if present
|
|
65
|
-
*/
|
|
66
|
-
entitlement_id?: string | null;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Checkout session response
|
|
70
|
-
*/
|
|
71
|
-
export interface SubscriptionCheckoutResponse {
|
|
72
|
-
/**
|
|
73
|
-
* The checkout session ID
|
|
74
|
-
*/
|
|
75
|
-
id: string;
|
|
76
|
-
/**
|
|
77
|
-
* The checkout URL to redirect the customer to
|
|
78
|
-
*/
|
|
79
|
-
url: string;
|
|
80
|
-
}
|
|
81
|
-
export interface SubscriptionCancelParams {
|
|
82
|
-
/**
|
|
83
|
-
* The customer ID
|
|
84
|
-
*/
|
|
85
|
-
customer_id: string;
|
|
86
|
-
/**
|
|
87
|
-
* The subscription ID to cancel
|
|
88
|
-
*/
|
|
89
|
-
subscription_id: string;
|
|
90
|
-
/**
|
|
91
|
-
* Whether to cancel at period end or immediately
|
|
92
|
-
*/
|
|
93
|
-
cancel_at_period_end?: boolean;
|
|
94
|
-
}
|
|
95
|
-
export interface SubscriptionCheckParams {
|
|
96
|
-
/**
|
|
97
|
-
* The customer ID
|
|
98
|
-
*/
|
|
99
|
-
customer_id: string;
|
|
100
|
-
/**
|
|
101
|
-
* The entitlement feature lookup key to check
|
|
102
|
-
*/
|
|
103
|
-
entitlement_lookup_key: string;
|
|
104
|
-
}
|
|
105
|
-
export interface SubscriptionCheckoutParams {
|
|
106
|
-
/**
|
|
107
|
-
* The customer ID
|
|
108
|
-
*/
|
|
109
|
-
customer_id: string;
|
|
110
|
-
/**
|
|
111
|
-
* The plan ID to subscribe to
|
|
112
|
-
*/
|
|
113
|
-
plan_id: string;
|
|
114
|
-
/**
|
|
115
|
-
* URL to redirect on cancel
|
|
116
|
-
*/
|
|
117
|
-
cancel_url?: string;
|
|
118
|
-
/**
|
|
119
|
-
* URL to redirect on success
|
|
120
|
-
*/
|
|
121
|
-
success_url?: string;
|
|
122
|
-
}
|
|
123
|
-
export declare namespace Subscriptions {
|
|
124
|
-
export { type SubscriptionCancelResponse as SubscriptionCancelResponse, type SubscriptionCheckResponse as SubscriptionCheckResponse, type SubscriptionCheckoutResponse as SubscriptionCheckoutResponse, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionCheckParams as SubscriptionCheckParams, type SubscriptionCheckoutParams as SubscriptionCheckoutParams, };
|
|
125
|
-
export { Customers as Customers, type Customer as Customer, type CustomerAddress as CustomerAddress, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomersCursorIDPage as CustomersCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
126
|
-
export { Plans as Plans, type Plan as Plan, type PlansCursorIDPage as PlansCursorIDPage, type PlanCreateParams as PlanCreateParams, type PlanUpdateParams as PlanUpdateParams, type PlanListParams as PlanListParams, };
|
|
127
|
-
export { Entitlements as Entitlements, type Entitlement as Entitlement, type EntitlementsCursorIDPage as EntitlementsCursorIDPage, type EntitlementCreateParams as EntitlementCreateParams, type EntitlementUpdateParams as EntitlementUpdateParams, type EntitlementListParams as EntitlementListParams, };
|
|
128
|
-
export { Coupons as Coupons, type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EACL,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,mBAAmB,EACpB;OACM,KAAK,YAAY;OACjB,EACL,QAAQ,EACR,eAAe,EACf,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,qBAAqB,EACtB;OACM,KAAK,eAAe;OACpB,EACL,WAAW,EACX,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,wBAAwB,EACzB;OACM,KAAK,QAAQ;OACb,EACL,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,iBAAiB,EAClB;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa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W,IAAI,WAAW,EAC/B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Subscriptions = void 0;
|
|
5
|
-
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
-
const resource_1 = require("../../../core/resource.js");
|
|
7
|
-
const CouponsAPI = tslib_1.__importStar(require("./coupons.js"));
|
|
8
|
-
const coupons_1 = require("./coupons.js");
|
|
9
|
-
const CustomersAPI = tslib_1.__importStar(require("./customers.js"));
|
|
10
|
-
const customers_1 = require("./customers.js");
|
|
11
|
-
const EntitlementsAPI = tslib_1.__importStar(require("./entitlements.js"));
|
|
12
|
-
const entitlements_1 = require("./entitlements.js");
|
|
13
|
-
const PlansAPI = tslib_1.__importStar(require("./plans/plans.js"));
|
|
14
|
-
const plans_1 = require("./plans/plans.js");
|
|
15
|
-
class Subscriptions extends resource_1.APIResource {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.customers = new CustomersAPI.Customers(this._client);
|
|
19
|
-
this.plans = new PlansAPI.Plans(this._client);
|
|
20
|
-
this.entitlements = new EntitlementsAPI.Entitlements(this._client);
|
|
21
|
-
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Cancel Subscription
|
|
25
|
-
*/
|
|
26
|
-
cancel(body, options) {
|
|
27
|
-
return this._client.post('/v1/subscriptions/cancel', { body, ...options });
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Check Entitlement
|
|
31
|
-
*/
|
|
32
|
-
check(body, options) {
|
|
33
|
-
return this._client.post('/v1/subscriptions/check', { body, ...options });
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create Checkout Session
|
|
37
|
-
*/
|
|
38
|
-
checkout(body, options) {
|
|
39
|
-
return this._client.post('/v1/subscriptions/checkout', { body, ...options });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.Subscriptions = Subscriptions;
|
|
43
|
-
Subscriptions.Customers = customers_1.Customers;
|
|
44
|
-
Subscriptions.Plans = plans_1.Plans;
|
|
45
|
-
Subscriptions.Entitlements = entitlements_1.Entitlements;
|
|
46
|
-
Subscriptions.Coupons = coupons_1.Coupons;
|
|
47
|
-
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,iEAAwC;AACxC,0CAOmB;AACnB,qEAA4C;AAC5C,8CAUqB;AACrB,2EAAkD;AAClD,oDAOwB;AACxB,mEAA0C;AAC1C,4CAOuB;AAIvB,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAyBrE,CAAC;IAvBC;;OAEG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAA6B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AA7BD,sCA6BC;AAiHD,aAAa,CAAC,SAAS,GAAG,qBAAS,CAAC;AACpC,aAAa,CAAC,KAAK,GAAG,aAAK,CAAC;AAC5B,aAAa,CAAC,YAAY,GAAG,2BAAY,CAAC;AAC1C,aAAa,CAAC,OAAO,GAAG,iBAAO,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
-
import * as CouponsAPI from "./coupons.mjs";
|
|
4
|
-
import { Coupons, } from "./coupons.mjs";
|
|
5
|
-
import * as CustomersAPI from "./customers.mjs";
|
|
6
|
-
import { Customers, } from "./customers.mjs";
|
|
7
|
-
import * as EntitlementsAPI from "./entitlements.mjs";
|
|
8
|
-
import { Entitlements, } from "./entitlements.mjs";
|
|
9
|
-
import * as PlansAPI from "./plans/plans.mjs";
|
|
10
|
-
import { Plans, } from "./plans/plans.mjs";
|
|
11
|
-
export class Subscriptions extends APIResource {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.customers = new CustomersAPI.Customers(this._client);
|
|
15
|
-
this.plans = new PlansAPI.Plans(this._client);
|
|
16
|
-
this.entitlements = new EntitlementsAPI.Entitlements(this._client);
|
|
17
|
-
this.coupons = new CouponsAPI.Coupons(this._client);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Cancel Subscription
|
|
21
|
-
*/
|
|
22
|
-
cancel(body, options) {
|
|
23
|
-
return this._client.post('/v1/subscriptions/cancel', { body, ...options });
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Check Entitlement
|
|
27
|
-
*/
|
|
28
|
-
check(body, options) {
|
|
29
|
-
return this._client.post('/v1/subscriptions/check', { body, ...options });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Create Checkout Session
|
|
33
|
-
*/
|
|
34
|
-
checkout(body, options) {
|
|
35
|
-
return this._client.post('/v1/subscriptions/checkout', { body, ...options });
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
Subscriptions.Customers = Customers;
|
|
39
|
-
Subscriptions.Plans = Plans;
|
|
40
|
-
Subscriptions.Entitlements = Entitlements;
|
|
41
|
-
Subscriptions.Coupons = Coupons;
|
|
42
|
-
//# sourceMappingURL=subscriptions.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/beta/subscriptions/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,EAKL,OAAO,GAER;OACM,KAAK,YAAY;OACjB,EAQL,SAAS,GAEV;OACM,KAAK,eAAe;OACpB,EAKL,YAAY,GAEb;OACM,KAAK,QAAQ;OACb,EAKL,KAAK,GAEN;AAID,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7E,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAyBrE,CAAC;IAvBC;;OAEG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAA6B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ,CACN,IAAgC,EAChC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAiHD,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;AACpC,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;AAC1C,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mEAAsC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../src/resources/beta/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../../core/pagination';
|
|
6
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
7
|
-
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
-
import { path } from '../../../internal/utils/path';
|
|
9
|
-
|
|
10
|
-
export class Coupons extends APIResource {
|
|
11
|
-
/**
|
|
12
|
-
* Create Coupon
|
|
13
|
-
*/
|
|
14
|
-
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon> {
|
|
15
|
-
return this._client.post('/v1/subscriptions/coupons', { body, ...options });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Update Coupon
|
|
20
|
-
*/
|
|
21
|
-
update(
|
|
22
|
-
couponID: string,
|
|
23
|
-
body: CouponUpdateParams | null | undefined = {},
|
|
24
|
-
options?: RequestOptions,
|
|
25
|
-
): APIPromise<Coupon> {
|
|
26
|
-
return this._client.patch(path`/v1/subscriptions/coupons/${couponID}`, { body, ...options });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* List Coupons
|
|
31
|
-
*/
|
|
32
|
-
list(
|
|
33
|
-
query: CouponListParams | null | undefined = {},
|
|
34
|
-
options?: RequestOptions,
|
|
35
|
-
): PagePromise<CouponsCursorIDPage, Coupon> {
|
|
36
|
-
return this._client.getAPIList('/v1/subscriptions/coupons', CursorIDPage<Coupon>, { query, ...options });
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Delete Coupon
|
|
41
|
-
*/
|
|
42
|
-
delete(couponID: string, options?: RequestOptions): APIPromise<void> {
|
|
43
|
-
return this._client.delete(path`/v1/subscriptions/coupons/${couponID}`, {
|
|
44
|
-
...options,
|
|
45
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Get Coupon
|
|
51
|
-
*/
|
|
52
|
-
get(couponID: string, options?: RequestOptions): APIPromise<Coupon> {
|
|
53
|
-
return this._client.get(path`/v1/subscriptions/coupons/${couponID}`, options);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* A coupon/promo code for discounts
|
|
61
|
-
*/
|
|
62
|
-
export interface Coupon {
|
|
63
|
-
/**
|
|
64
|
-
* An id for a data item
|
|
65
|
-
*/
|
|
66
|
-
id: string;
|
|
67
|
-
|
|
68
|
-
active: boolean;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* The promo code
|
|
72
|
-
*/
|
|
73
|
-
code: string;
|
|
74
|
-
|
|
75
|
-
created: string;
|
|
76
|
-
|
|
77
|
-
duration: 'once' | 'repeating' | 'forever';
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Number of times this coupon has been redeemed
|
|
81
|
-
*/
|
|
82
|
-
times_redeemed: number;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Fixed amount discount in cents
|
|
86
|
-
*/
|
|
87
|
-
amount_off?: number | null;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Currency for amount_off
|
|
91
|
-
*/
|
|
92
|
-
currency?: string | null;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Number of months for repeating duration
|
|
96
|
-
*/
|
|
97
|
-
duration_in_months?: number | null;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Maximum number of times this coupon can be redeemed
|
|
101
|
-
*/
|
|
102
|
-
max_redemptions?: number | null;
|
|
103
|
-
|
|
104
|
-
name?: string | null;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Percentage discount (1-100)
|
|
108
|
-
*/
|
|
109
|
-
percent_off?: number | null;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Date after which the coupon can no longer be redeemed
|
|
113
|
-
*/
|
|
114
|
-
redeem_by?: string | null;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface CouponCreateParams {
|
|
118
|
-
/**
|
|
119
|
-
* The promo code customers will enter
|
|
120
|
-
*/
|
|
121
|
-
code: string;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Fixed amount discount in cents
|
|
125
|
-
*/
|
|
126
|
-
amount_off?: number;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Currency for amount_off
|
|
130
|
-
*/
|
|
131
|
-
currency?: string;
|
|
132
|
-
|
|
133
|
-
duration?: 'once' | 'repeating' | 'forever';
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Number of months for repeating duration
|
|
137
|
-
*/
|
|
138
|
-
duration_in_months?: number;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Maximum number of redemptions
|
|
142
|
-
*/
|
|
143
|
-
max_redemptions?: number;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Display name for the coupon
|
|
147
|
-
*/
|
|
148
|
-
name?: string;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Percentage discount (1-100)
|
|
152
|
-
*/
|
|
153
|
-
percent_off?: number;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Expiration date for the coupon
|
|
157
|
-
*/
|
|
158
|
-
redeem_by?: string;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface CouponUpdateParams {
|
|
162
|
-
/**
|
|
163
|
-
* Whether the coupon is active
|
|
164
|
-
*/
|
|
165
|
-
active?: boolean;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Display name for the coupon
|
|
169
|
-
*/
|
|
170
|
-
name?: string;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface CouponListParams extends CursorIDPageParams {
|
|
174
|
-
active?: boolean;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export declare namespace Coupons {
|
|
178
|
-
export {
|
|
179
|
-
type Coupon as Coupon,
|
|
180
|
-
type CouponsCursorIDPage as CouponsCursorIDPage,
|
|
181
|
-
type CouponCreateParams as CouponCreateParams,
|
|
182
|
-
type CouponUpdateParams as CouponUpdateParams,
|
|
183
|
-
type CouponListParams as CouponListParams,
|
|
184
|
-
};
|
|
185
|
-
}
|