@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
|
@@ -0,0 +1,407 @@
|
|
|
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 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<CustomerCreateResponse>;
|
|
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<CustomerUpdateResponse>;
|
|
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<CustomerListResponsesCursorIDPage, CustomerListResponse>;
|
|
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<CustomerGetResponse>;
|
|
39
|
+
}
|
|
40
|
+
export type CustomerListResponsesCursorIDPage = CursorIDPage<CustomerListResponse>;
|
|
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 CustomerCreateResponse {
|
|
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?: CustomerCreateResponse.Address | 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
|
+
export declare namespace CustomerCreateResponse {
|
|
72
|
+
/**
|
|
73
|
+
* The customer's billing address
|
|
74
|
+
*/
|
|
75
|
+
interface Address {
|
|
76
|
+
/**
|
|
77
|
+
* City name
|
|
78
|
+
*/
|
|
79
|
+
city?: string | null;
|
|
80
|
+
/**
|
|
81
|
+
* Two-letter ISO country code
|
|
82
|
+
*/
|
|
83
|
+
country?: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Street address line 1
|
|
86
|
+
*/
|
|
87
|
+
line1?: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
90
|
+
*/
|
|
91
|
+
line2?: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* Postal or ZIP code
|
|
94
|
+
*/
|
|
95
|
+
postal_code?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* State, province, or region
|
|
98
|
+
*/
|
|
99
|
+
state?: string | null;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A billable customer. Represents the entity in your app that will be
|
|
104
|
+
* charged—typically a user, organization, or project.
|
|
105
|
+
*/
|
|
106
|
+
export interface CustomerUpdateResponse {
|
|
107
|
+
/**
|
|
108
|
+
* Unique identifier for the topic subscription
|
|
109
|
+
*/
|
|
110
|
+
id: string;
|
|
111
|
+
/**
|
|
112
|
+
* Timestamp when the customer was created
|
|
113
|
+
*/
|
|
114
|
+
created: string;
|
|
115
|
+
/**
|
|
116
|
+
* The customer's billing address
|
|
117
|
+
*/
|
|
118
|
+
address?: CustomerUpdateResponse.Address | null;
|
|
119
|
+
/**
|
|
120
|
+
* The customer's email address for receipts and notifications
|
|
121
|
+
*/
|
|
122
|
+
email?: string | null;
|
|
123
|
+
/**
|
|
124
|
+
* The customer's full name
|
|
125
|
+
*/
|
|
126
|
+
name?: string | null;
|
|
127
|
+
/**
|
|
128
|
+
* The customer's phone number
|
|
129
|
+
*/
|
|
130
|
+
phone?: string | null;
|
|
131
|
+
}
|
|
132
|
+
export declare namespace CustomerUpdateResponse {
|
|
133
|
+
/**
|
|
134
|
+
* The customer's billing address
|
|
135
|
+
*/
|
|
136
|
+
interface Address {
|
|
137
|
+
/**
|
|
138
|
+
* City name
|
|
139
|
+
*/
|
|
140
|
+
city?: string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Two-letter ISO country code
|
|
143
|
+
*/
|
|
144
|
+
country?: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Street address line 1
|
|
147
|
+
*/
|
|
148
|
+
line1?: string | null;
|
|
149
|
+
/**
|
|
150
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
151
|
+
*/
|
|
152
|
+
line2?: string | null;
|
|
153
|
+
/**
|
|
154
|
+
* Postal or ZIP code
|
|
155
|
+
*/
|
|
156
|
+
postal_code?: string | null;
|
|
157
|
+
/**
|
|
158
|
+
* State, province, or region
|
|
159
|
+
*/
|
|
160
|
+
state?: string | null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* A billable customer. Represents the entity in your app that will be
|
|
165
|
+
* charged—typically a user, organization, or project.
|
|
166
|
+
*/
|
|
167
|
+
export interface CustomerListResponse {
|
|
168
|
+
/**
|
|
169
|
+
* Unique identifier for the topic subscription
|
|
170
|
+
*/
|
|
171
|
+
id: string;
|
|
172
|
+
/**
|
|
173
|
+
* Timestamp when the customer was created
|
|
174
|
+
*/
|
|
175
|
+
created: string;
|
|
176
|
+
/**
|
|
177
|
+
* The customer's billing address
|
|
178
|
+
*/
|
|
179
|
+
address?: CustomerListResponse.Address | null;
|
|
180
|
+
/**
|
|
181
|
+
* The customer's email address for receipts and notifications
|
|
182
|
+
*/
|
|
183
|
+
email?: string | null;
|
|
184
|
+
/**
|
|
185
|
+
* The customer's full name
|
|
186
|
+
*/
|
|
187
|
+
name?: string | null;
|
|
188
|
+
/**
|
|
189
|
+
* The customer's phone number
|
|
190
|
+
*/
|
|
191
|
+
phone?: string | null;
|
|
192
|
+
}
|
|
193
|
+
export declare namespace CustomerListResponse {
|
|
194
|
+
/**
|
|
195
|
+
* The customer's billing address
|
|
196
|
+
*/
|
|
197
|
+
interface Address {
|
|
198
|
+
/**
|
|
199
|
+
* City name
|
|
200
|
+
*/
|
|
201
|
+
city?: string | null;
|
|
202
|
+
/**
|
|
203
|
+
* Two-letter ISO country code
|
|
204
|
+
*/
|
|
205
|
+
country?: string | null;
|
|
206
|
+
/**
|
|
207
|
+
* Street address line 1
|
|
208
|
+
*/
|
|
209
|
+
line1?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
212
|
+
*/
|
|
213
|
+
line2?: string | null;
|
|
214
|
+
/**
|
|
215
|
+
* Postal or ZIP code
|
|
216
|
+
*/
|
|
217
|
+
postal_code?: string | null;
|
|
218
|
+
/**
|
|
219
|
+
* State, province, or region
|
|
220
|
+
*/
|
|
221
|
+
state?: string | null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Response containing the billing portal URL
|
|
226
|
+
*/
|
|
227
|
+
export interface CustomerBillingPortalResponse {
|
|
228
|
+
/**
|
|
229
|
+
* URL to redirect the customer to for the billing portal
|
|
230
|
+
*/
|
|
231
|
+
url: string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A billable customer. Represents the entity in your app that will be
|
|
235
|
+
* charged—typically a user, organization, or project.
|
|
236
|
+
*/
|
|
237
|
+
export interface CustomerGetResponse {
|
|
238
|
+
/**
|
|
239
|
+
* Unique identifier for the topic subscription
|
|
240
|
+
*/
|
|
241
|
+
id: string;
|
|
242
|
+
/**
|
|
243
|
+
* Timestamp when the customer was created
|
|
244
|
+
*/
|
|
245
|
+
created: string;
|
|
246
|
+
/**
|
|
247
|
+
* The customer's billing address
|
|
248
|
+
*/
|
|
249
|
+
address?: CustomerGetResponse.Address | null;
|
|
250
|
+
/**
|
|
251
|
+
* The customer's email address for receipts and notifications
|
|
252
|
+
*/
|
|
253
|
+
email?: string | null;
|
|
254
|
+
/**
|
|
255
|
+
* The customer's full name
|
|
256
|
+
*/
|
|
257
|
+
name?: string | null;
|
|
258
|
+
/**
|
|
259
|
+
* The customer's phone number
|
|
260
|
+
*/
|
|
261
|
+
phone?: string | null;
|
|
262
|
+
}
|
|
263
|
+
export declare namespace CustomerGetResponse {
|
|
264
|
+
/**
|
|
265
|
+
* The customer's billing address
|
|
266
|
+
*/
|
|
267
|
+
interface Address {
|
|
268
|
+
/**
|
|
269
|
+
* City name
|
|
270
|
+
*/
|
|
271
|
+
city?: string | null;
|
|
272
|
+
/**
|
|
273
|
+
* Two-letter ISO country code
|
|
274
|
+
*/
|
|
275
|
+
country?: string | null;
|
|
276
|
+
/**
|
|
277
|
+
* Street address line 1
|
|
278
|
+
*/
|
|
279
|
+
line1?: string | null;
|
|
280
|
+
/**
|
|
281
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
282
|
+
*/
|
|
283
|
+
line2?: string | null;
|
|
284
|
+
/**
|
|
285
|
+
* Postal or ZIP code
|
|
286
|
+
*/
|
|
287
|
+
postal_code?: string | null;
|
|
288
|
+
/**
|
|
289
|
+
* State, province, or region
|
|
290
|
+
*/
|
|
291
|
+
state?: string | null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
export interface CustomerCreateParams {
|
|
295
|
+
/**
|
|
296
|
+
* Optional custom ID for the customer. If not provided, one will be generated.
|
|
297
|
+
*/
|
|
298
|
+
id?: string;
|
|
299
|
+
/**
|
|
300
|
+
* The customer's billing address
|
|
301
|
+
*/
|
|
302
|
+
address?: CustomerCreateParams.Address;
|
|
303
|
+
/**
|
|
304
|
+
* The customer's email address for receipts and notifications
|
|
305
|
+
*/
|
|
306
|
+
email?: string;
|
|
307
|
+
/**
|
|
308
|
+
* The customer's full name
|
|
309
|
+
*/
|
|
310
|
+
name?: string;
|
|
311
|
+
/**
|
|
312
|
+
* The customer's phone number
|
|
313
|
+
*/
|
|
314
|
+
phone?: string;
|
|
315
|
+
}
|
|
316
|
+
export declare namespace CustomerCreateParams {
|
|
317
|
+
/**
|
|
318
|
+
* The customer's billing address
|
|
319
|
+
*/
|
|
320
|
+
interface Address {
|
|
321
|
+
/**
|
|
322
|
+
* City name
|
|
323
|
+
*/
|
|
324
|
+
city?: string | null;
|
|
325
|
+
/**
|
|
326
|
+
* Two-letter ISO country code
|
|
327
|
+
*/
|
|
328
|
+
country?: string | null;
|
|
329
|
+
/**
|
|
330
|
+
* Street address line 1
|
|
331
|
+
*/
|
|
332
|
+
line1?: string | null;
|
|
333
|
+
/**
|
|
334
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
335
|
+
*/
|
|
336
|
+
line2?: string | null;
|
|
337
|
+
/**
|
|
338
|
+
* Postal or ZIP code
|
|
339
|
+
*/
|
|
340
|
+
postal_code?: string | null;
|
|
341
|
+
/**
|
|
342
|
+
* State, province, or region
|
|
343
|
+
*/
|
|
344
|
+
state?: string | null;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
export interface CustomerUpdateParams {
|
|
348
|
+
/**
|
|
349
|
+
* The customer's billing address
|
|
350
|
+
*/
|
|
351
|
+
address?: CustomerUpdateParams.Address;
|
|
352
|
+
/**
|
|
353
|
+
* The customer's email address for receipts and notifications
|
|
354
|
+
*/
|
|
355
|
+
email?: string;
|
|
356
|
+
/**
|
|
357
|
+
* The customer's full name
|
|
358
|
+
*/
|
|
359
|
+
name?: string;
|
|
360
|
+
/**
|
|
361
|
+
* The customer's phone number
|
|
362
|
+
*/
|
|
363
|
+
phone?: string;
|
|
364
|
+
}
|
|
365
|
+
export declare namespace CustomerUpdateParams {
|
|
366
|
+
/**
|
|
367
|
+
* The customer's billing address
|
|
368
|
+
*/
|
|
369
|
+
interface Address {
|
|
370
|
+
/**
|
|
371
|
+
* City name
|
|
372
|
+
*/
|
|
373
|
+
city?: string | null;
|
|
374
|
+
/**
|
|
375
|
+
* Two-letter ISO country code
|
|
376
|
+
*/
|
|
377
|
+
country?: string | null;
|
|
378
|
+
/**
|
|
379
|
+
* Street address line 1
|
|
380
|
+
*/
|
|
381
|
+
line1?: string | null;
|
|
382
|
+
/**
|
|
383
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
384
|
+
*/
|
|
385
|
+
line2?: string | null;
|
|
386
|
+
/**
|
|
387
|
+
* Postal or ZIP code
|
|
388
|
+
*/
|
|
389
|
+
postal_code?: string | null;
|
|
390
|
+
/**
|
|
391
|
+
* State, province, or region
|
|
392
|
+
*/
|
|
393
|
+
state?: string | null;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
export interface CustomerListParams extends CursorIDPageParams {
|
|
397
|
+
}
|
|
398
|
+
export interface CustomerBillingPortalParams {
|
|
399
|
+
/**
|
|
400
|
+
* URL to redirect the customer to after they exit the billing portal
|
|
401
|
+
*/
|
|
402
|
+
return_url?: string;
|
|
403
|
+
}
|
|
404
|
+
export declare namespace Customers {
|
|
405
|
+
export { type CustomerCreateResponse as CustomerCreateResponse, type CustomerUpdateResponse as CustomerUpdateResponse, type CustomerListResponse as CustomerListResponse, type CustomerBillingPortalResponse as CustomerBillingPortalResponse, type CustomerGetResponse as CustomerGetResponse, type CustomerListResponsesCursorIDPage as CustomerListResponsesCursorIDPage, type CustomerCreateParams as CustomerCreateParams, type CustomerUpdateParams as CustomerUpdateParams, type CustomerListParams as CustomerListParams, type CustomerBillingPortalParams as CustomerBillingPortalParams, };
|
|
406
|
+
}
|
|
407
|
+
//# sourceMappingURL=customers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/commerce/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,CACJ,IAAI,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACv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resource_1.APIResource {
|
|
|
14
14
|
* entity in your app.
|
|
15
15
|
*/
|
|
16
16
|
create(body = {}, options) {
|
|
17
|
-
return this._client.post('/v1/
|
|
17
|
+
return this._client.post('/v1/commerce/customers', { body, ...options });
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Updates an existing customer. Use this to modify contact information or billing
|
|
21
21
|
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
22
22
|
*/
|
|
23
23
|
update(customerID, body = {}, options) {
|
|
24
|
-
return this._client.patch((0, path_1.path) `/v1/
|
|
24
|
+
return this._client.patch((0, path_1.path) `/v1/commerce/customers/${customerID}`, { body, ...options });
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
28
28
|
* in your app—typically users, organizations, or projects.
|
|
29
29
|
*/
|
|
30
30
|
list(query = {}, options) {
|
|
31
|
-
return this._client.getAPIList('/v1/
|
|
31
|
+
return this._client.getAPIList('/v1/commerce/customers', (pagination_1.CursorIDPage), {
|
|
32
|
+
query,
|
|
33
|
+
...options,
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
34
37
|
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
35
38
|
* action cannot be undone.
|
|
36
39
|
*/
|
|
37
40
|
delete(customerID, options) {
|
|
38
|
-
return this._client.delete((0, path_1.path) `/v1/
|
|
41
|
+
return this._client.delete((0, path_1.path) `/v1/commerce/customers/${customerID}`, {
|
|
39
42
|
...options,
|
|
40
43
|
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
41
44
|
});
|
|
@@ -46,14 +49,14 @@ class Customers extends resource_1.APIResource {
|
|
|
46
49
|
* returned URL.
|
|
47
50
|
*/
|
|
48
51
|
billingPortal(customerID, body = {}, options) {
|
|
49
|
-
return this._client.post((0, path_1.path) `/v1/
|
|
52
|
+
return this._client.post((0, path_1.path) `/v1/commerce/customers/${customerID}/billing_portal`, { body, ...options });
|
|
50
53
|
}
|
|
51
54
|
/**
|
|
52
55
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
53
56
|
* information and billing address.
|
|
54
57
|
*/
|
|
55
58
|
get(customerID, options) {
|
|
56
|
-
return this._client.get((0, path_1.path) `/v1/
|
|
59
|
+
return this._client.get((0, path_1.path) `/v1/commerce/customers/${customerID}`, options);
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
exports.Customers = Customers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.js","sourceRoot":"","sources":["../../../src/resources/beta/commerce/customers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAErD,4DAA8F;AAC9F,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;;;;OAKG;IACH,MAAM,CACJ,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,UAAkB,EAClB,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAA,yBAAkC,CAAA,EAAE;YAC3F,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAkB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,EAAE,EAAE;YACrE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,aAAa,CACX,UAAkB,EAClB,OAAuD,EAAE,EACzD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,UAAkB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;CACF;AAvED,8BAuEC"}
|
|
@@ -11,28 +11,31 @@ export class Customers extends APIResource {
|
|
|
11
11
|
* entity in your app.
|
|
12
12
|
*/
|
|
13
13
|
create(body = {}, options) {
|
|
14
|
-
return this._client.post('/v1/
|
|
14
|
+
return this._client.post('/v1/commerce/customers', { body, ...options });
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Updates an existing customer. Use this to modify contact information or billing
|
|
18
18
|
* address. Only provided fields are updated; omitted fields remain unchanged.
|
|
19
19
|
*/
|
|
20
20
|
update(customerID, body = {}, options) {
|
|
21
|
-
return this._client.patch(path `/v1/
|
|
21
|
+
return this._client.patch(path `/v1/commerce/customers/${customerID}`, { body, ...options });
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Retrieves a paginated list of all customers. Customers are the billable entities
|
|
25
25
|
* in your app—typically users, organizations, or projects.
|
|
26
26
|
*/
|
|
27
27
|
list(query = {}, options) {
|
|
28
|
-
return this._client.getAPIList('/v1/
|
|
28
|
+
return this._client.getAPIList('/v1/commerce/customers', (CursorIDPage), {
|
|
29
|
+
query,
|
|
30
|
+
...options,
|
|
31
|
+
});
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
34
|
* Permanently deletes a customer. This also cancels any active subscriptions. This
|
|
32
35
|
* action cannot be undone.
|
|
33
36
|
*/
|
|
34
37
|
delete(customerID, options) {
|
|
35
|
-
return this._client.delete(path `/v1/
|
|
38
|
+
return this._client.delete(path `/v1/commerce/customers/${customerID}`, {
|
|
36
39
|
...options,
|
|
37
40
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
38
41
|
});
|
|
@@ -43,14 +46,14 @@ export class Customers extends APIResource {
|
|
|
43
46
|
* returned URL.
|
|
44
47
|
*/
|
|
45
48
|
billingPortal(customerID, body = {}, options) {
|
|
46
|
-
return this._client.post(path `/v1/
|
|
49
|
+
return this._client.post(path `/v1/commerce/customers/${customerID}/billing_portal`, { body, ...options });
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
49
52
|
* Retrieves a customer by ID. Returns the customer object including contact
|
|
50
53
|
* information and billing address.
|
|
51
54
|
*/
|
|
52
55
|
get(customerID, options) {
|
|
53
|
-
return this._client.get(path `/v1/
|
|
56
|
+
return this._client.get(path `/v1/commerce/customers/${customerID}`, options);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
//# sourceMappingURL=customers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customers.mjs","sourceRoot":"","sources":["../../../src/resources/beta/commerce/customers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAwC;OACtD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC;;;;;OAKG;IACH,MAAM,CACJ,OAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wB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Response, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce.mjs";
|
|
2
|
+
export { Coupons, type CouponCreateResponse, type CouponUpdateResponse, type CouponListResponse, type CouponGetResponse, type CouponCreateParams, type CouponUpdateParams, type CouponListParams, type CouponListResponsesCursorIDPage, } from "./coupons.mjs";
|
|
3
|
+
export { Customers, type CustomerCreateResponse, type CustomerUpdateResponse, type CustomerListResponse, type CustomerBillingPortalResponse, type CustomerGetResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomerListResponsesCursorIDPage, } from "./customers.mjs";
|
|
4
|
+
export { Products, type ProductCreateResponse, type ProductUpdateResponse, type ProductListResponse, type ProductArchiveResponse, type ProductGetResponse, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductListResponsesCursorIDPage, } from "./products/index.mjs";
|
|
5
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/commerce/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EACL,OAAO,EACP,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,GACrC;OACM,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,GACvC;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gCAAgC,GACtC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Commerce, type CommerceCancelResponse, type CommerceCheckResponse, type CommerceCheckoutResponse, type CommerceCancelParams, type CommerceCheckParams, type CommerceCheckoutParams, } from "./commerce.js";
|
|
2
|
+
export { Coupons, type CouponCreateResponse, type CouponUpdateResponse, type CouponListResponse, type CouponGetResponse, type CouponCreateParams, type CouponUpdateParams, type CouponListParams, type CouponListResponsesCursorIDPage, } from "./coupons.js";
|
|
3
|
+
export { Customers, type CustomerCreateResponse, type CustomerUpdateResponse, type CustomerListResponse, type CustomerBillingPortalResponse, type CustomerGetResponse, type CustomerCreateParams, type CustomerUpdateParams, type CustomerListParams, type CustomerBillingPortalParams, type CustomerListResponsesCursorIDPage, } from "./customers.js";
|
|
4
|
+
export { Products, type ProductCreateResponse, type ProductUpdateResponse, type ProductListResponse, type ProductArchiveResponse, type ProductGetResponse, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductListResponsesCursorIDPage, } from "./products/index.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/commerce/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B;OACM,EACL,OAAO,EACP,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,GACrC;OACM,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,GACvC;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gCAAgC,GACtC"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Products = exports.
|
|
4
|
+
exports.Products = exports.Customers = exports.Coupons = exports.Commerce = void 0;
|
|
5
|
+
var commerce_1 = require("./commerce.js");
|
|
6
|
+
Object.defineProperty(exports, "Commerce", { enumerable: true, get: function () { return commerce_1.Commerce; } });
|
|
5
7
|
var coupons_1 = require("./coupons.js");
|
|
6
8
|
Object.defineProperty(exports, "Coupons", { enumerable: true, get: function () { return coupons_1.Coupons; } });
|
|
7
9
|
var customers_1 = require("./customers.js");
|
|
8
10
|
Object.defineProperty(exports, "Customers", { enumerable: true, get: function () { return customers_1.Customers; } });
|
|
9
|
-
var entitlements_1 = require("./entitlements.js");
|
|
10
|
-
Object.defineProperty(exports, "Entitlements", { enumerable: true, get: function () { return entitlements_1.Entitlements; } });
|
|
11
|
-
var pay_1 = require("./pay.js");
|
|
12
|
-
Object.defineProperty(exports, "Pay", { enumerable: true, get: function () { return pay_1.Pay; } });
|
|
13
11
|
var index_1 = require("./products/index.js");
|
|
14
12
|
Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return index_1.Products; } });
|
|
15
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/commerce/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,wCAUmB;AATjB,kGAAA,OAAO,OAAA;AAUT,4CAYqB;AAXnB,sGAAA,SAAS,OAAA;AAYX,6CAW0B;AAVxB,iGAAA,QAAQ,OAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
export { Commerce, } from "./commerce.mjs";
|
|
2
3
|
export { Coupons, } from "./coupons.mjs";
|
|
3
4
|
export { Customers, } from "./customers.mjs";
|
|
4
|
-
export { Entitlements, } from "./entitlements.mjs";
|
|
5
|
-
export { Pay, } from "./pay.mjs";
|
|
6
5
|
export { Products, } from "./products/index.mjs";
|
|
7
6
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/commerce/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAOT;OACM,EACL,OAAO,GASR;OACM,EACL,SAAS,GAWV;OACM,EACL,QAAQ,GAUT"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Products, type ProductCreateResponse, type ProductUpdateResponse, type ProductListResponse, type ProductArchiveResponse, type ProductGetResponse, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductListResponsesCursorIDPage, } from "./products.mjs";
|
|
2
|
+
export { Resources, type ResourceListResponse, type ResourceAttachResponse, type ResourceListParams, type ResourceAttachParams, type ResourceRemoveParams, type ResourceListResponsesCursorIDPage, } from "./resources.mjs";
|
|
3
|
+
export { Variants, type VariantCreateResponse, type VariantUpdateResponse, type VariantListResponse, type VariantArchiveResponse, type VariantGetResponse, type VariantCreateParams, type VariantUpdateParams, type VariantListParams, type VariantArchiveParams, type VariantGetParams, type VariantListResponsesCursorIDPage, } from "./variants.mjs";
|
|
4
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/resources/beta/commerce/products/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gCAAgC,GACtC;OACM,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,GACvC;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,GACtC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Products, type ProductCreateResponse, type ProductUpdateResponse, type ProductListResponse, type ProductArchiveResponse, type ProductGetResponse, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductListResponsesCursorIDPage, } from "./products.js";
|
|
2
|
+
export { Resources, type ResourceListResponse, type ResourceAttachResponse, type ResourceListParams, type ResourceAttachParams, type ResourceRemoveParams, type ResourceListResponsesCursorIDPage, } from "./resources.js";
|
|
3
|
+
export { Variants, type VariantCreateResponse, type VariantUpdateResponse, type VariantListResponse, type VariantArchiveResponse, type VariantGetResponse, type VariantCreateParams, type VariantUpdateParams, type VariantListParams, type VariantArchiveParams, type VariantGetParams, type VariantListResponsesCursorIDPage, } from "./variants.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/beta/commerce/products/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,gCAAgC,GACtC;OACM,EACL,SAAS,EACT,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iCAAiC,GACvC;OACM,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,GACtC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Variants = exports.
|
|
5
|
-
var entitlements_1 = require("./entitlements.js");
|
|
6
|
-
Object.defineProperty(exports, "Entitlements", { enumerable: true, get: function () { return entitlements_1.Entitlements; } });
|
|
4
|
+
exports.Variants = exports.Resources = exports.Products = void 0;
|
|
7
5
|
var products_1 = require("./products.js");
|
|
8
6
|
Object.defineProperty(exports, "Products", { enumerable: true, get: function () { return products_1.Products; } });
|
|
7
|
+
var resources_1 = require("./resources.js");
|
|
8
|
+
Object.defineProperty(exports, "Resources", { enumerable: true, get: function () { return resources_1.Resources; } });
|
|
9
9
|
var variants_1 = require("./variants.js");
|
|
10
10
|
Object.defineProperty(exports, "Variants", { enumerable: true, get: function () { return variants_1.Variants; } });
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/beta/commerce/products/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAWoB;AAVlB,oGAAA,QAAQ,OAAA;AAWV,4CAQqB;AAPnB,sGAAA,SAAS,OAAA;AAQX,0CAaoB;AAZlB,oGAAA,QAAQ,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export { Entitlements, } from "./entitlements.mjs";
|
|
3
2
|
export { Products, } from "./products.mjs";
|
|
3
|
+
export { Resources, } from "./resources.mjs";
|
|
4
4
|
export { Variants, } from "./variants.mjs";
|
|
5
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/resources/beta/commerce/products/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAUT;OACM,EACL,SAAS,GAOV;OACM,EACL,QAAQ,GAYT"}
|