@usehercules/sdk 1.7.0 → 1.8.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 +21 -0
- package/README.md +17 -16
- 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/commerce/commerce.d.mts +201 -0
- package/resources/beta/commerce/commerce.d.mts.map +1 -0
- package/resources/beta/commerce/commerce.d.ts +201 -0
- package/resources/beta/commerce/commerce.d.ts.map +1 -0
- package/resources/beta/{pay/pay.js → commerce/commerce.js} +10 -14
- package/resources/beta/commerce/commerce.js.map +1 -0
- package/resources/beta/{pay/pay.mjs → commerce/commerce.mjs} +8 -12
- package/resources/beta/commerce/commerce.mjs.map +1 -0
- package/resources/beta/commerce/coupons.d.mts +333 -0
- package/resources/beta/commerce/coupons.d.mts.map +1 -0
- package/resources/beta/commerce/coupons.d.ts +333 -0
- package/resources/beta/commerce/coupons.d.ts.map +1 -0
- package/resources/beta/{pay → commerce}/coupons.js +8 -5
- package/resources/beta/commerce/coupons.js.map +1 -0
- package/resources/beta/{pay → commerce}/coupons.mjs +8 -5
- package/resources/beta/commerce/coupons.mjs.map +1 -0
- package/resources/beta/commerce/customers.d.mts +407 -0
- package/resources/beta/commerce/customers.d.mts.map +1 -0
- package/resources/beta/commerce/customers.d.ts +407 -0
- package/resources/beta/commerce/customers.d.ts.map +1 -0
- package/resources/beta/{pay → commerce}/customers.js +9 -6
- package/resources/beta/commerce/customers.js.map +1 -0
- package/resources/beta/{pay → commerce}/customers.mjs +9 -6
- package/resources/beta/commerce/customers.mjs.map +1 -0
- package/resources/beta/commerce/index.d.mts +5 -0
- package/resources/beta/commerce/index.d.mts.map +1 -0
- package/resources/beta/commerce/index.d.ts +5 -0
- package/resources/beta/commerce/index.d.ts.map +1 -0
- package/resources/beta/{pay → commerce}/index.js +3 -5
- package/resources/beta/commerce/index.js.map +1 -0
- package/resources/beta/{pay → commerce}/index.mjs +1 -2
- package/resources/beta/commerce/index.mjs.map +1 -0
- package/resources/beta/commerce/products/index.d.mts +4 -0
- package/resources/beta/commerce/products/index.d.mts.map +1 -0
- package/resources/beta/commerce/products/index.d.ts +4 -0
- package/resources/beta/commerce/products/index.d.ts.map +1 -0
- package/resources/beta/{pay → commerce}/products/index.js +3 -3
- package/resources/beta/commerce/products/index.js.map +1 -0
- package/resources/beta/{pay → commerce}/products/index.mjs +1 -1
- package/resources/beta/commerce/products/index.mjs.map +1 -0
- package/resources/beta/commerce/products/products.d.mts +967 -0
- package/resources/beta/commerce/products/products.d.mts.map +1 -0
- package/resources/beta/commerce/products/products.d.ts +967 -0
- package/resources/beta/commerce/products/products.d.ts.map +1 -0
- package/resources/beta/{pay → commerce}/products/products.js +16 -12
- package/resources/beta/commerce/products/products.js.map +1 -0
- package/resources/beta/{pay → commerce}/products/products.mjs +16 -12
- package/resources/beta/commerce/products/products.mjs.map +1 -0
- package/resources/beta/commerce/products/resources.d.mts +160 -0
- package/resources/beta/commerce/products/resources.d.mts.map +1 -0
- package/resources/beta/commerce/products/resources.d.ts +160 -0
- package/resources/beta/commerce/products/resources.d.ts.map +1 -0
- package/resources/beta/commerce/products/resources.js +41 -0
- package/resources/beta/commerce/products/resources.js.map +1 -0
- package/resources/beta/commerce/products/resources.mjs +37 -0
- package/resources/beta/commerce/products/resources.mjs.map +1 -0
- package/resources/beta/commerce/products/variants.d.mts +798 -0
- package/resources/beta/commerce/products/variants.d.mts.map +1 -0
- package/resources/beta/commerce/products/variants.d.ts +798 -0
- package/resources/beta/commerce/products/variants.d.ts.map +1 -0
- package/resources/beta/{pay → commerce}/products/variants.js +5 -8
- package/resources/beta/commerce/products/variants.js.map +1 -0
- package/resources/beta/{pay → commerce}/products/variants.mjs +5 -8
- package/resources/beta/commerce/products/variants.mjs.map +1 -0
- package/resources/beta/commerce/products.d.mts.map +1 -0
- package/resources/beta/commerce/products.d.ts.map +1 -0
- package/resources/beta/commerce/products.js.map +1 -0
- package/resources/beta/commerce/products.mjs.map +1 -0
- package/resources/beta/commerce.d.mts +2 -0
- package/resources/beta/commerce.d.mts.map +1 -0
- package/resources/beta/commerce.d.ts +2 -0
- package/resources/beta/commerce.d.ts.map +1 -0
- package/resources/beta/{pay.js → commerce.js} +2 -2
- package/resources/beta/commerce.js.map +1 -0
- package/resources/beta/{pay.mjs → commerce.mjs} +2 -2
- package/resources/beta/commerce.mjs.map +1 -0
- 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/push-notifications/push-notifications.d.mts +8 -9
- package/resources/push-notifications/push-notifications.d.mts.map +1 -1
- package/resources/push-notifications/push-notifications.d.ts +8 -9
- package/resources/push-notifications/push-notifications.d.ts.map +1 -1
- package/resources/push-notifications/push-notifications.js +5 -6
- package/resources/push-notifications/push-notifications.js.map +1 -1
- package/resources/push-notifications/push-notifications.mjs +5 -6
- package/resources/push-notifications/push-notifications.mjs.map +1 -1
- package/src/resources/beta/beta.ts +18 -18
- package/src/resources/beta/{pay/pay.ts → commerce/commerce.ts} +82 -85
- package/src/resources/beta/commerce/coupons.ts +440 -0
- package/src/resources/beta/commerce/customers.ts +532 -0
- package/src/resources/beta/commerce/index.ts +47 -0
- package/src/resources/beta/commerce/products/index.ts +37 -0
- package/src/resources/beta/commerce/products/products.ts +1199 -0
- package/src/resources/beta/commerce/products/resources.ts +213 -0
- package/src/resources/beta/commerce/products/variants.ts +984 -0
- package/src/resources/beta/{pay.ts → commerce.ts} +1 -1
- package/src/resources/beta/index.ts +8 -8
- package/src/resources/push-notifications/push-notifications.ts +8 -9
- 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/pay/coupons.d.mts +0 -156
- package/resources/beta/pay/coupons.d.mts.map +0 -1
- package/resources/beta/pay/coupons.d.ts +0 -156
- package/resources/beta/pay/coupons.d.ts.map +0 -1
- package/resources/beta/pay/coupons.js.map +0 -1
- package/resources/beta/pay/coupons.mjs.map +0 -1
- package/resources/beta/pay/customers.d.mts +0 -160
- package/resources/beta/pay/customers.d.mts.map +0 -1
- package/resources/beta/pay/customers.d.ts +0 -160
- package/resources/beta/pay/customers.d.ts.map +0 -1
- package/resources/beta/pay/customers.js.map +0 -1
- package/resources/beta/pay/customers.mjs.map +0 -1
- package/resources/beta/pay/entitlements.d.mts +0 -76
- package/resources/beta/pay/entitlements.d.mts.map +0 -1
- package/resources/beta/pay/entitlements.d.ts +0 -76
- package/resources/beta/pay/entitlements.d.ts.map +0 -1
- package/resources/beta/pay/entitlements.js +0 -41
- package/resources/beta/pay/entitlements.js.map +0 -1
- package/resources/beta/pay/entitlements.mjs +0 -37
- package/resources/beta/pay/entitlements.mjs.map +0 -1
- package/resources/beta/pay/index.d.mts +0 -6
- package/resources/beta/pay/index.d.mts.map +0 -1
- package/resources/beta/pay/index.d.ts +0 -6
- package/resources/beta/pay/index.d.ts.map +0 -1
- package/resources/beta/pay/index.js.map +0 -1
- package/resources/beta/pay/index.mjs.map +0 -1
- package/resources/beta/pay/pay.d.mts +0 -206
- package/resources/beta/pay/pay.d.mts.map +0 -1
- package/resources/beta/pay/pay.d.ts +0 -206
- package/resources/beta/pay/pay.d.ts.map +0 -1
- package/resources/beta/pay/pay.js.map +0 -1
- package/resources/beta/pay/pay.mjs.map +0 -1
- package/resources/beta/pay/products/entitlements.d.mts +0 -53
- package/resources/beta/pay/products/entitlements.d.mts.map +0 -1
- package/resources/beta/pay/products/entitlements.d.ts +0 -53
- package/resources/beta/pay/products/entitlements.d.ts.map +0 -1
- package/resources/beta/pay/products/entitlements.js +0 -38
- package/resources/beta/pay/products/entitlements.js.map +0 -1
- package/resources/beta/pay/products/entitlements.mjs +0 -34
- package/resources/beta/pay/products/entitlements.mjs.map +0 -1
- package/resources/beta/pay/products/index.d.mts +0 -4
- package/resources/beta/pay/products/index.d.mts.map +0 -1
- package/resources/beta/pay/products/index.d.ts +0 -4
- package/resources/beta/pay/products/index.d.ts.map +0 -1
- package/resources/beta/pay/products/index.js.map +0 -1
- package/resources/beta/pay/products/index.mjs.map +0 -1
- package/resources/beta/pay/products/products.d.mts +0 -183
- package/resources/beta/pay/products/products.d.mts.map +0 -1
- package/resources/beta/pay/products/products.d.ts +0 -183
- package/resources/beta/pay/products/products.d.ts.map +0 -1
- package/resources/beta/pay/products/products.js.map +0 -1
- package/resources/beta/pay/products/products.mjs.map +0 -1
- package/resources/beta/pay/products/variants.d.mts +0 -206
- package/resources/beta/pay/products/variants.d.mts.map +0 -1
- package/resources/beta/pay/products/variants.d.ts +0 -206
- package/resources/beta/pay/products/variants.d.ts.map +0 -1
- package/resources/beta/pay/products/variants.js.map +0 -1
- package/resources/beta/pay/products/variants.mjs.map +0 -1
- package/resources/beta/pay/products.d.mts.map +0 -1
- package/resources/beta/pay/products.d.ts.map +0 -1
- package/resources/beta/pay/products.js.map +0 -1
- package/resources/beta/pay/products.mjs.map +0 -1
- package/resources/beta/pay.d.mts +0 -2
- package/resources/beta/pay.d.mts.map +0 -1
- package/resources/beta/pay.d.ts +0 -2
- package/resources/beta/pay.d.ts.map +0 -1
- package/resources/beta/pay.js.map +0 -1
- package/resources/beta/pay.mjs.map +0 -1
- package/src/resources/beta/pay/coupons.ts +0 -218
- package/src/resources/beta/pay/customers.ts +0 -229
- package/src/resources/beta/pay/entitlements.ts +0 -113
- package/src/resources/beta/pay/index.ts +0 -46
- package/src/resources/beta/pay/products/entitlements.ts +0 -93
- package/src/resources/beta/pay/products/index.ts +0 -28
- package/src/resources/beta/pay/products/products.ts +0 -280
- package/src/resources/beta/pay/products/variants.ts +0 -279
- /package/resources/beta/{pay → commerce}/products.d.mts +0 -0
- /package/resources/beta/{pay → commerce}/products.d.ts +0 -0
- /package/resources/beta/{pay → commerce}/products.js +0 -0
- /package/resources/beta/{pay → commerce}/products.mjs +0 -0
- /package/src/resources/beta/{pay → commerce}/products.ts +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
export { Beta } from './beta';
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
type
|
|
12
|
-
} from './
|
|
5
|
+
Commerce,
|
|
6
|
+
type CommerceCancelResponse,
|
|
7
|
+
type CommerceCheckResponse,
|
|
8
|
+
type CommerceCheckoutResponse,
|
|
9
|
+
type CommerceCancelParams,
|
|
10
|
+
type CommerceCheckParams,
|
|
11
|
+
type CommerceCheckoutParams,
|
|
12
|
+
} from './commerce/index';
|
|
@@ -28,9 +28,8 @@ export class PushNotifications extends APIResource {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* calling this immediately after authentication.
|
|
31
|
+
* Updates a subscription's visitorId to the provided userId. Call after sign-in to
|
|
32
|
+
* link the subscription to the authenticated user's account.
|
|
34
33
|
*/
|
|
35
34
|
identify(
|
|
36
35
|
body: PushNotificationIdentifyParams,
|
|
@@ -49,9 +48,9 @@ export class PushNotifications extends APIResource {
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
|
-
* Registers a push subscription
|
|
53
|
-
*
|
|
54
|
-
* Returns a secret for subscription ownership.
|
|
51
|
+
* Registers a push subscription with the provided visitorId. Use authenticated
|
|
52
|
+
* userId or generate a UUID for anonymous users. Upserts by endpoint to handle
|
|
53
|
+
* re-subscriptions. Returns a secret for subscription ownership.
|
|
55
54
|
*/
|
|
56
55
|
subscribe(
|
|
57
56
|
body: PushNotificationSubscribeParams,
|
|
@@ -194,10 +193,10 @@ export interface PushNotificationSubscribeParams {
|
|
|
194
193
|
subscription: PushNotificationSubscribeParams.Subscription;
|
|
195
194
|
|
|
196
195
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
196
|
+
* Visitor identifier. Use authenticated userId or generate a UUID for anonymous
|
|
197
|
+
* users.
|
|
199
198
|
*/
|
|
200
|
-
|
|
199
|
+
visitorId: string;
|
|
201
200
|
}
|
|
202
201
|
|
|
203
202
|
export namespace PushNotificationSubscribeParams {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.8.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.8.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.8.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
-
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
-
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
-
export declare class Coupons extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
8
|
-
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
9
|
-
* date. Customers can apply coupons during checkout.
|
|
10
|
-
*/
|
|
11
|
-
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
|
|
12
|
-
/**
|
|
13
|
-
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
14
|
-
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
15
|
-
*/
|
|
16
|
-
update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
|
|
17
|
-
/**
|
|
18
|
-
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
19
|
-
* customers can apply during checkout using a promo code.
|
|
20
|
-
*/
|
|
21
|
-
list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
|
|
22
|
-
/**
|
|
23
|
-
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
24
|
-
* discounts applied to active subscriptions are not affected.
|
|
25
|
-
*/
|
|
26
|
-
delete(couponID: string, options?: RequestOptions): APIPromise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
29
|
-
* and redemption statistics.
|
|
30
|
-
*/
|
|
31
|
-
get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
32
|
-
}
|
|
33
|
-
export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
34
|
-
/**
|
|
35
|
-
* A discount coupon that customers can apply during checkout using a promo code
|
|
36
|
-
*/
|
|
37
|
-
export interface Coupon {
|
|
38
|
-
/**
|
|
39
|
-
* Unique identifier for the topic subscription
|
|
40
|
-
*/
|
|
41
|
-
id: string;
|
|
42
|
-
/**
|
|
43
|
-
* Whether the coupon is currently active and can be redeemed
|
|
44
|
-
*/
|
|
45
|
-
active: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* The promo code customers enter to apply the discount
|
|
48
|
-
*/
|
|
49
|
-
code: string;
|
|
50
|
-
/**
|
|
51
|
-
* Timestamp when the coupon was created
|
|
52
|
-
*/
|
|
53
|
-
created: string;
|
|
54
|
-
/**
|
|
55
|
-
* How long the discount applies: once (first payment only), repeating (for
|
|
56
|
-
* duration_in_months), or forever
|
|
57
|
-
*/
|
|
58
|
-
duration: 'once' | 'repeating' | 'forever';
|
|
59
|
-
/**
|
|
60
|
-
* Number of times this coupon has been successfully redeemed
|
|
61
|
-
*/
|
|
62
|
-
times_redeemed: number;
|
|
63
|
-
/**
|
|
64
|
-
* Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
|
|
65
|
-
* exclusive with percent_off.
|
|
66
|
-
*/
|
|
67
|
-
amount_off?: number | null;
|
|
68
|
-
/**
|
|
69
|
-
* Three-letter ISO currency code for amount_off discounts
|
|
70
|
-
*/
|
|
71
|
-
currency?: string | null;
|
|
72
|
-
/**
|
|
73
|
-
* Number of months the discount applies when duration is 'repeating'
|
|
74
|
-
*/
|
|
75
|
-
duration_in_months?: number | null;
|
|
76
|
-
/**
|
|
77
|
-
* Maximum number of times this coupon can be redeemed across all customers
|
|
78
|
-
*/
|
|
79
|
-
max_redemptions?: number | null;
|
|
80
|
-
/**
|
|
81
|
-
* Display name for the coupon (shown to customers)
|
|
82
|
-
*/
|
|
83
|
-
name?: string | null;
|
|
84
|
-
/**
|
|
85
|
-
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
86
|
-
*/
|
|
87
|
-
percent_off?: number | null;
|
|
88
|
-
/**
|
|
89
|
-
* Expiration date after which the coupon can no longer be redeemed
|
|
90
|
-
*/
|
|
91
|
-
redeem_by?: string | null;
|
|
92
|
-
}
|
|
93
|
-
export interface CouponCreateParams {
|
|
94
|
-
/**
|
|
95
|
-
* The promo code customers will enter to apply the discount
|
|
96
|
-
*/
|
|
97
|
-
code: string;
|
|
98
|
-
/**
|
|
99
|
-
* Optional custom ID for the coupon. If not provided, one will be generated.
|
|
100
|
-
*/
|
|
101
|
-
id?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
|
|
104
|
-
* with percent_off.
|
|
105
|
-
*/
|
|
106
|
-
amount_off?: number;
|
|
107
|
-
/**
|
|
108
|
-
* Three-letter ISO currency code for amount_off discounts
|
|
109
|
-
*/
|
|
110
|
-
currency?: string;
|
|
111
|
-
/**
|
|
112
|
-
* How long the discount applies: once (first payment only), repeating (for
|
|
113
|
-
* duration_in_months), or forever
|
|
114
|
-
*/
|
|
115
|
-
duration?: 'once' | 'repeating' | 'forever';
|
|
116
|
-
/**
|
|
117
|
-
* Number of months the discount applies when duration is 'repeating'
|
|
118
|
-
*/
|
|
119
|
-
duration_in_months?: number;
|
|
120
|
-
/**
|
|
121
|
-
* Maximum number of times this coupon can be redeemed
|
|
122
|
-
*/
|
|
123
|
-
max_redemptions?: number;
|
|
124
|
-
/**
|
|
125
|
-
* Display name for the coupon (shown to customers)
|
|
126
|
-
*/
|
|
127
|
-
name?: string;
|
|
128
|
-
/**
|
|
129
|
-
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
130
|
-
*/
|
|
131
|
-
percent_off?: number;
|
|
132
|
-
/**
|
|
133
|
-
* Expiration date after which the coupon can no longer be redeemed
|
|
134
|
-
*/
|
|
135
|
-
redeem_by?: string;
|
|
136
|
-
}
|
|
137
|
-
export interface CouponUpdateParams {
|
|
138
|
-
/**
|
|
139
|
-
* Whether the coupon is active and can be redeemed
|
|
140
|
-
*/
|
|
141
|
-
active?: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Display name for the coupon
|
|
144
|
-
*/
|
|
145
|
-
name?: string;
|
|
146
|
-
}
|
|
147
|
-
export interface CouponListParams extends CursorIDPageParams {
|
|
148
|
-
/**
|
|
149
|
-
* Filter by active status
|
|
150
|
-
*/
|
|
151
|
-
active?: boolean;
|
|
152
|
-
}
|
|
153
|
-
export declare namespace Coupons {
|
|
154
|
-
export { type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=coupons.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coupons.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;;OAGG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC;IAI3C;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOpE;;;OAGG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAGpE;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MA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B;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,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,156 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.js";
|
|
2
|
-
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
|
|
4
|
-
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
-
export declare class Coupons extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Creates a discount coupon with a promo code. Coupons can offer percentage or
|
|
8
|
-
* fixed-amount discounts and can be limited by redemption count or expiration
|
|
9
|
-
* date. Customers can apply coupons during checkout.
|
|
10
|
-
*/
|
|
11
|
-
create(body: CouponCreateParams, options?: RequestOptions): APIPromise<Coupon>;
|
|
12
|
-
/**
|
|
13
|
-
* Updates an existing coupon. Use this to modify the display name or deactivate
|
|
14
|
-
* the coupon. Discount amounts and codes cannot be changed after creation.
|
|
15
|
-
*/
|
|
16
|
-
update(couponID: string, body?: CouponUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Coupon>;
|
|
17
|
-
/**
|
|
18
|
-
* Retrieves a paginated list of all coupons. Coupons provide discounts that
|
|
19
|
-
* customers can apply during checkout using a promo code.
|
|
20
|
-
*/
|
|
21
|
-
list(query?: CouponListParams | null | undefined, options?: RequestOptions): PagePromise<CouponsCursorIDPage, Coupon>;
|
|
22
|
-
/**
|
|
23
|
-
* Permanently deletes a coupon. The promo code can no longer be used. Existing
|
|
24
|
-
* discounts applied to active subscriptions are not affected.
|
|
25
|
-
*/
|
|
26
|
-
delete(couponID: string, options?: RequestOptions): APIPromise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves a coupon by ID. Returns the coupon object including discount details
|
|
29
|
-
* and redemption statistics.
|
|
30
|
-
*/
|
|
31
|
-
get(couponID: string, options?: RequestOptions): APIPromise<Coupon>;
|
|
32
|
-
}
|
|
33
|
-
export type CouponsCursorIDPage = CursorIDPage<Coupon>;
|
|
34
|
-
/**
|
|
35
|
-
* A discount coupon that customers can apply during checkout using a promo code
|
|
36
|
-
*/
|
|
37
|
-
export interface Coupon {
|
|
38
|
-
/**
|
|
39
|
-
* Unique identifier for the topic subscription
|
|
40
|
-
*/
|
|
41
|
-
id: string;
|
|
42
|
-
/**
|
|
43
|
-
* Whether the coupon is currently active and can be redeemed
|
|
44
|
-
*/
|
|
45
|
-
active: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* The promo code customers enter to apply the discount
|
|
48
|
-
*/
|
|
49
|
-
code: string;
|
|
50
|
-
/**
|
|
51
|
-
* Timestamp when the coupon was created
|
|
52
|
-
*/
|
|
53
|
-
created: string;
|
|
54
|
-
/**
|
|
55
|
-
* How long the discount applies: once (first payment only), repeating (for
|
|
56
|
-
* duration_in_months), or forever
|
|
57
|
-
*/
|
|
58
|
-
duration: 'once' | 'repeating' | 'forever';
|
|
59
|
-
/**
|
|
60
|
-
* Number of times this coupon has been successfully redeemed
|
|
61
|
-
*/
|
|
62
|
-
times_redeemed: number;
|
|
63
|
-
/**
|
|
64
|
-
* Fixed discount amount in the smallest currency unit (e.g., cents). Mutually
|
|
65
|
-
* exclusive with percent_off.
|
|
66
|
-
*/
|
|
67
|
-
amount_off?: number | null;
|
|
68
|
-
/**
|
|
69
|
-
* Three-letter ISO currency code for amount_off discounts
|
|
70
|
-
*/
|
|
71
|
-
currency?: string | null;
|
|
72
|
-
/**
|
|
73
|
-
* Number of months the discount applies when duration is 'repeating'
|
|
74
|
-
*/
|
|
75
|
-
duration_in_months?: number | null;
|
|
76
|
-
/**
|
|
77
|
-
* Maximum number of times this coupon can be redeemed across all customers
|
|
78
|
-
*/
|
|
79
|
-
max_redemptions?: number | null;
|
|
80
|
-
/**
|
|
81
|
-
* Display name for the coupon (shown to customers)
|
|
82
|
-
*/
|
|
83
|
-
name?: string | null;
|
|
84
|
-
/**
|
|
85
|
-
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
86
|
-
*/
|
|
87
|
-
percent_off?: number | null;
|
|
88
|
-
/**
|
|
89
|
-
* Expiration date after which the coupon can no longer be redeemed
|
|
90
|
-
*/
|
|
91
|
-
redeem_by?: string | null;
|
|
92
|
-
}
|
|
93
|
-
export interface CouponCreateParams {
|
|
94
|
-
/**
|
|
95
|
-
* The promo code customers will enter to apply the discount
|
|
96
|
-
*/
|
|
97
|
-
code: string;
|
|
98
|
-
/**
|
|
99
|
-
* Optional custom ID for the coupon. If not provided, one will be generated.
|
|
100
|
-
*/
|
|
101
|
-
id?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Fixed discount in the smallest currency unit (e.g., cents). Mutually exclusive
|
|
104
|
-
* with percent_off.
|
|
105
|
-
*/
|
|
106
|
-
amount_off?: number;
|
|
107
|
-
/**
|
|
108
|
-
* Three-letter ISO currency code for amount_off discounts
|
|
109
|
-
*/
|
|
110
|
-
currency?: string;
|
|
111
|
-
/**
|
|
112
|
-
* How long the discount applies: once (first payment only), repeating (for
|
|
113
|
-
* duration_in_months), or forever
|
|
114
|
-
*/
|
|
115
|
-
duration?: 'once' | 'repeating' | 'forever';
|
|
116
|
-
/**
|
|
117
|
-
* Number of months the discount applies when duration is 'repeating'
|
|
118
|
-
*/
|
|
119
|
-
duration_in_months?: number;
|
|
120
|
-
/**
|
|
121
|
-
* Maximum number of times this coupon can be redeemed
|
|
122
|
-
*/
|
|
123
|
-
max_redemptions?: number;
|
|
124
|
-
/**
|
|
125
|
-
* Display name for the coupon (shown to customers)
|
|
126
|
-
*/
|
|
127
|
-
name?: string;
|
|
128
|
-
/**
|
|
129
|
-
* Percentage discount (1-100). Mutually exclusive with amount_off.
|
|
130
|
-
*/
|
|
131
|
-
percent_off?: number;
|
|
132
|
-
/**
|
|
133
|
-
* Expiration date after which the coupon can no longer be redeemed
|
|
134
|
-
*/
|
|
135
|
-
redeem_by?: string;
|
|
136
|
-
}
|
|
137
|
-
export interface CouponUpdateParams {
|
|
138
|
-
/**
|
|
139
|
-
* Whether the coupon is active and can be redeemed
|
|
140
|
-
*/
|
|
141
|
-
active?: boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Display name for the coupon
|
|
144
|
-
*/
|
|
145
|
-
name?: string;
|
|
146
|
-
}
|
|
147
|
-
export interface CouponListParams extends CursorIDPageParams {
|
|
148
|
-
/**
|
|
149
|
-
* Filter by active status
|
|
150
|
-
*/
|
|
151
|
-
active?: boolean;
|
|
152
|
-
}
|
|
153
|
-
export declare namespace Coupons {
|
|
154
|
-
export { type Coupon as Coupon, type CouponsCursorIDPage as CouponsCursorIDPage, type CouponCreateParams as CouponCreateParams, type CouponUpdateParams as CouponUpdateParams, type CouponListParams as CouponListParams, };
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=coupons.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coupons.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/pay/coupons.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAA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;IACH,GAAG,CAAC,QAAgB,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,mBAAmB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
-
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
-
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
-
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
-
export declare class Customers extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Creates a new billable customer. A customer represents the entity in your app
|
|
8
|
-
* that will be charged—typically a user, organization, or project. Hercules
|
|
9
|
-
* recommends creating a customer immediately after creating the corresponding
|
|
10
|
-
* entity in your app.
|
|
11
|
-
*/
|
|
12
|
-
create(body?: CustomerCreateParams | null | undefined, options?: RequestOptions): APIPromise<Customer>;
|
|
13
|
-
/**
|
|
14
|
-
* Updates an existing customer. Use this to modify contact information or billing
|
|
15
|
-
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
16
|
-
*/
|
|
17
|
-
update(customerID: string, body?: CustomerUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Customer>;
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
20
|
-
* in your app—typically users, organizations, or projects.
|
|
21
|
-
*/
|
|
22
|
-
list(query?: CustomerListParams | null | undefined, options?: RequestOptions): PagePromise<CustomersCursorIDPage, Customer>;
|
|
23
|
-
/**
|
|
24
|
-
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
25
|
-
* action cannot be undone.
|
|
26
|
-
*/
|
|
27
|
-
delete(customerID: string, options?: RequestOptions): APIPromise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Generates a URL to a hosted billing portal where the customer can view invoices,
|
|
30
|
-
* update payment methods, and manage billing details. Redirect the customer to the
|
|
31
|
-
* returned URL.
|
|
32
|
-
*/
|
|
33
|
-
billingPortal(customerID: string, body?: CustomerBillingPortalParams | null | undefined, options?: RequestOptions): APIPromise<CustomerBillingPortalResponse>;
|
|
34
|
-
/**
|
|
35
|
-
* Retrieves a customer by ID. Returns the customer object including contact
|
|
36
|
-
* information and billing address.
|
|
37
|
-
*/
|
|
38
|
-
get(customerID: string, options?: RequestOptions): APIPromise<Customer>;
|
|
39
|
-
}
|
|
40
|
-
export type CustomersCursorIDPage = CursorIDPage<Customer>;
|
|
41
|
-
/**
|
|
42
|
-
* A billable customer. Represents the entity in your app that will be
|
|
43
|
-
* charged—typically a user, organization, or project.
|
|
44
|
-
*/
|
|
45
|
-
export interface Customer {
|
|
46
|
-
/**
|
|
47
|
-
* Unique identifier for the topic subscription
|
|
48
|
-
*/
|
|
49
|
-
id: string;
|
|
50
|
-
/**
|
|
51
|
-
* Timestamp when the customer was created
|
|
52
|
-
*/
|
|
53
|
-
created: string;
|
|
54
|
-
/**
|
|
55
|
-
* The customer's billing address
|
|
56
|
-
*/
|
|
57
|
-
address?: CustomerAddress | null;
|
|
58
|
-
/**
|
|
59
|
-
* The customer's email address for receipts and notifications
|
|
60
|
-
*/
|
|
61
|
-
email?: string | null;
|
|
62
|
-
/**
|
|
63
|
-
* The customer's full name
|
|
64
|
-
*/
|
|
65
|
-
name?: string | null;
|
|
66
|
-
/**
|
|
67
|
-
* The customer's phone number
|
|
68
|
-
*/
|
|
69
|
-
phone?: string | null;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* The customer's billing address
|
|
73
|
-
*/
|
|
74
|
-
export interface CustomerAddress {
|
|
75
|
-
/**
|
|
76
|
-
* City name
|
|
77
|
-
*/
|
|
78
|
-
city?: string | null;
|
|
79
|
-
/**
|
|
80
|
-
* Two-letter ISO country code
|
|
81
|
-
*/
|
|
82
|
-
country?: string | null;
|
|
83
|
-
/**
|
|
84
|
-
* Street address line 1
|
|
85
|
-
*/
|
|
86
|
-
line1?: string | null;
|
|
87
|
-
/**
|
|
88
|
-
* Street address line 2 (apartment, suite, etc.)
|
|
89
|
-
*/
|
|
90
|
-
line2?: string | null;
|
|
91
|
-
/**
|
|
92
|
-
* Postal or ZIP code
|
|
93
|
-
*/
|
|
94
|
-
postal_code?: string | null;
|
|
95
|
-
/**
|
|
96
|
-
* State, province, or region
|
|
97
|
-
*/
|
|
98
|
-
state?: string | null;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Response containing the billing portal URL
|
|
102
|
-
*/
|
|
103
|
-
export interface CustomerBillingPortalResponse {
|
|
104
|
-
/**
|
|
105
|
-
* URL to redirect the customer to for the billing portal
|
|
106
|
-
*/
|
|
107
|
-
url: string;
|
|
108
|
-
}
|
|
109
|
-
export interface CustomerCreateParams {
|
|
110
|
-
/**
|
|
111
|
-
* Optional custom ID for the customer. If not provided, one will be generated.
|
|
112
|
-
*/
|
|
113
|
-
id?: string;
|
|
114
|
-
/**
|
|
115
|
-
* The customer's billing address
|
|
116
|
-
*/
|
|
117
|
-
address?: CustomerAddress;
|
|
118
|
-
/**
|
|
119
|
-
* The customer's email address for receipts and notifications
|
|
120
|
-
*/
|
|
121
|
-
email?: string;
|
|
122
|
-
/**
|
|
123
|
-
* The customer's full name
|
|
124
|
-
*/
|
|
125
|
-
name?: string;
|
|
126
|
-
/**
|
|
127
|
-
* The customer's phone number
|
|
128
|
-
*/
|
|
129
|
-
phone?: string;
|
|
130
|
-
}
|
|
131
|
-
export interface CustomerUpdateParams {
|
|
132
|
-
/**
|
|
133
|
-
* The customer's billing address
|
|
134
|
-
*/
|
|
135
|
-
address?: CustomerAddress;
|
|
136
|
-
/**
|
|
137
|
-
* The customer's email address for receipts and notifications
|
|
138
|
-
*/
|
|
139
|
-
email?: string;
|
|
140
|
-
/**
|
|
141
|
-
* The customer's full name
|
|
142
|
-
*/
|
|
143
|
-
name?: string;
|
|
144
|
-
/**
|
|
145
|
-
* The customer's phone number
|
|
146
|
-
*/
|
|
147
|
-
phone?: string;
|
|
148
|
-
}
|
|
149
|
-
export interface CustomerListParams extends CursorIDPageParams {
|
|
150
|
-
}
|
|
151
|
-
export interface CustomerBillingPortalParams {
|
|
152
|
-
/**
|
|
153
|
-
* URL to redirect the customer to after they exit the billing portal
|
|
154
|
-
*/
|
|
155
|
-
return_url?: string;
|
|
156
|
-
}
|
|
157
|
-
export declare namespace Customers {
|
|
158
|
-
export { 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, };
|
|
159
|
-
}
|
|
160
|
-
//# sourceMappingURL=customers.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customers.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/pay/customers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OAEtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IAI1G;;;OAGG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,QAAQ,CAAC;IAIvB;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GAC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