@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.
Files changed (201) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +17 -16
  3. package/package.json +1 -1
  4. package/resources/beta/beta.d.mts +4 -4
  5. package/resources/beta/beta.d.mts.map +1 -1
  6. package/resources/beta/beta.d.ts +4 -4
  7. package/resources/beta/beta.d.ts.map +1 -1
  8. package/resources/beta/beta.js +4 -4
  9. package/resources/beta/beta.js.map +1 -1
  10. package/resources/beta/beta.mjs +4 -4
  11. package/resources/beta/beta.mjs.map +1 -1
  12. package/resources/beta/commerce/commerce.d.mts +201 -0
  13. package/resources/beta/commerce/commerce.d.mts.map +1 -0
  14. package/resources/beta/commerce/commerce.d.ts +201 -0
  15. package/resources/beta/commerce/commerce.d.ts.map +1 -0
  16. package/resources/beta/{pay/pay.js → commerce/commerce.js} +10 -14
  17. package/resources/beta/commerce/commerce.js.map +1 -0
  18. package/resources/beta/{pay/pay.mjs → commerce/commerce.mjs} +8 -12
  19. package/resources/beta/commerce/commerce.mjs.map +1 -0
  20. package/resources/beta/commerce/coupons.d.mts +333 -0
  21. package/resources/beta/commerce/coupons.d.mts.map +1 -0
  22. package/resources/beta/commerce/coupons.d.ts +333 -0
  23. package/resources/beta/commerce/coupons.d.ts.map +1 -0
  24. package/resources/beta/{pay → commerce}/coupons.js +8 -5
  25. package/resources/beta/commerce/coupons.js.map +1 -0
  26. package/resources/beta/{pay → commerce}/coupons.mjs +8 -5
  27. package/resources/beta/commerce/coupons.mjs.map +1 -0
  28. package/resources/beta/commerce/customers.d.mts +407 -0
  29. package/resources/beta/commerce/customers.d.mts.map +1 -0
  30. package/resources/beta/commerce/customers.d.ts +407 -0
  31. package/resources/beta/commerce/customers.d.ts.map +1 -0
  32. package/resources/beta/{pay → commerce}/customers.js +9 -6
  33. package/resources/beta/commerce/customers.js.map +1 -0
  34. package/resources/beta/{pay → commerce}/customers.mjs +9 -6
  35. package/resources/beta/commerce/customers.mjs.map +1 -0
  36. package/resources/beta/commerce/index.d.mts +5 -0
  37. package/resources/beta/commerce/index.d.mts.map +1 -0
  38. package/resources/beta/commerce/index.d.ts +5 -0
  39. package/resources/beta/commerce/index.d.ts.map +1 -0
  40. package/resources/beta/{pay → commerce}/index.js +3 -5
  41. package/resources/beta/commerce/index.js.map +1 -0
  42. package/resources/beta/{pay → commerce}/index.mjs +1 -2
  43. package/resources/beta/commerce/index.mjs.map +1 -0
  44. package/resources/beta/commerce/products/index.d.mts +4 -0
  45. package/resources/beta/commerce/products/index.d.mts.map +1 -0
  46. package/resources/beta/commerce/products/index.d.ts +4 -0
  47. package/resources/beta/commerce/products/index.d.ts.map +1 -0
  48. package/resources/beta/{pay → commerce}/products/index.js +3 -3
  49. package/resources/beta/commerce/products/index.js.map +1 -0
  50. package/resources/beta/{pay → commerce}/products/index.mjs +1 -1
  51. package/resources/beta/commerce/products/index.mjs.map +1 -0
  52. package/resources/beta/commerce/products/products.d.mts +967 -0
  53. package/resources/beta/commerce/products/products.d.mts.map +1 -0
  54. package/resources/beta/commerce/products/products.d.ts +967 -0
  55. package/resources/beta/commerce/products/products.d.ts.map +1 -0
  56. package/resources/beta/{pay → commerce}/products/products.js +16 -12
  57. package/resources/beta/commerce/products/products.js.map +1 -0
  58. package/resources/beta/{pay → commerce}/products/products.mjs +16 -12
  59. package/resources/beta/commerce/products/products.mjs.map +1 -0
  60. package/resources/beta/commerce/products/resources.d.mts +160 -0
  61. package/resources/beta/commerce/products/resources.d.mts.map +1 -0
  62. package/resources/beta/commerce/products/resources.d.ts +160 -0
  63. package/resources/beta/commerce/products/resources.d.ts.map +1 -0
  64. package/resources/beta/commerce/products/resources.js +41 -0
  65. package/resources/beta/commerce/products/resources.js.map +1 -0
  66. package/resources/beta/commerce/products/resources.mjs +37 -0
  67. package/resources/beta/commerce/products/resources.mjs.map +1 -0
  68. package/resources/beta/commerce/products/variants.d.mts +798 -0
  69. package/resources/beta/commerce/products/variants.d.mts.map +1 -0
  70. package/resources/beta/commerce/products/variants.d.ts +798 -0
  71. package/resources/beta/commerce/products/variants.d.ts.map +1 -0
  72. package/resources/beta/{pay → commerce}/products/variants.js +5 -8
  73. package/resources/beta/commerce/products/variants.js.map +1 -0
  74. package/resources/beta/{pay → commerce}/products/variants.mjs +5 -8
  75. package/resources/beta/commerce/products/variants.mjs.map +1 -0
  76. package/resources/beta/commerce/products.d.mts.map +1 -0
  77. package/resources/beta/commerce/products.d.ts.map +1 -0
  78. package/resources/beta/commerce/products.js.map +1 -0
  79. package/resources/beta/commerce/products.mjs.map +1 -0
  80. package/resources/beta/commerce.d.mts +2 -0
  81. package/resources/beta/commerce.d.mts.map +1 -0
  82. package/resources/beta/commerce.d.ts +2 -0
  83. package/resources/beta/commerce.d.ts.map +1 -0
  84. package/resources/beta/{pay.js → commerce.js} +2 -2
  85. package/resources/beta/commerce.js.map +1 -0
  86. package/resources/beta/{pay.mjs → commerce.mjs} +2 -2
  87. package/resources/beta/commerce.mjs.map +1 -0
  88. package/resources/beta/index.d.mts +1 -1
  89. package/resources/beta/index.d.mts.map +1 -1
  90. package/resources/beta/index.d.ts +1 -1
  91. package/resources/beta/index.d.ts.map +1 -1
  92. package/resources/beta/index.js +3 -3
  93. package/resources/beta/index.js.map +1 -1
  94. package/resources/beta/index.mjs +1 -1
  95. package/resources/beta/index.mjs.map +1 -1
  96. package/resources/push-notifications/push-notifications.d.mts +8 -9
  97. package/resources/push-notifications/push-notifications.d.mts.map +1 -1
  98. package/resources/push-notifications/push-notifications.d.ts +8 -9
  99. package/resources/push-notifications/push-notifications.d.ts.map +1 -1
  100. package/resources/push-notifications/push-notifications.js +5 -6
  101. package/resources/push-notifications/push-notifications.js.map +1 -1
  102. package/resources/push-notifications/push-notifications.mjs +5 -6
  103. package/resources/push-notifications/push-notifications.mjs.map +1 -1
  104. package/src/resources/beta/beta.ts +18 -18
  105. package/src/resources/beta/{pay/pay.ts → commerce/commerce.ts} +82 -85
  106. package/src/resources/beta/commerce/coupons.ts +440 -0
  107. package/src/resources/beta/commerce/customers.ts +532 -0
  108. package/src/resources/beta/commerce/index.ts +47 -0
  109. package/src/resources/beta/commerce/products/index.ts +37 -0
  110. package/src/resources/beta/commerce/products/products.ts +1199 -0
  111. package/src/resources/beta/commerce/products/resources.ts +213 -0
  112. package/src/resources/beta/commerce/products/variants.ts +984 -0
  113. package/src/resources/beta/{pay.ts → commerce.ts} +1 -1
  114. package/src/resources/beta/index.ts +8 -8
  115. package/src/resources/push-notifications/push-notifications.ts +8 -9
  116. package/src/version.ts +1 -1
  117. package/version.d.mts +1 -1
  118. package/version.d.ts +1 -1
  119. package/version.js +1 -1
  120. package/version.mjs +1 -1
  121. package/resources/beta/pay/coupons.d.mts +0 -156
  122. package/resources/beta/pay/coupons.d.mts.map +0 -1
  123. package/resources/beta/pay/coupons.d.ts +0 -156
  124. package/resources/beta/pay/coupons.d.ts.map +0 -1
  125. package/resources/beta/pay/coupons.js.map +0 -1
  126. package/resources/beta/pay/coupons.mjs.map +0 -1
  127. package/resources/beta/pay/customers.d.mts +0 -160
  128. package/resources/beta/pay/customers.d.mts.map +0 -1
  129. package/resources/beta/pay/customers.d.ts +0 -160
  130. package/resources/beta/pay/customers.d.ts.map +0 -1
  131. package/resources/beta/pay/customers.js.map +0 -1
  132. package/resources/beta/pay/customers.mjs.map +0 -1
  133. package/resources/beta/pay/entitlements.d.mts +0 -76
  134. package/resources/beta/pay/entitlements.d.mts.map +0 -1
  135. package/resources/beta/pay/entitlements.d.ts +0 -76
  136. package/resources/beta/pay/entitlements.d.ts.map +0 -1
  137. package/resources/beta/pay/entitlements.js +0 -41
  138. package/resources/beta/pay/entitlements.js.map +0 -1
  139. package/resources/beta/pay/entitlements.mjs +0 -37
  140. package/resources/beta/pay/entitlements.mjs.map +0 -1
  141. package/resources/beta/pay/index.d.mts +0 -6
  142. package/resources/beta/pay/index.d.mts.map +0 -1
  143. package/resources/beta/pay/index.d.ts +0 -6
  144. package/resources/beta/pay/index.d.ts.map +0 -1
  145. package/resources/beta/pay/index.js.map +0 -1
  146. package/resources/beta/pay/index.mjs.map +0 -1
  147. package/resources/beta/pay/pay.d.mts +0 -206
  148. package/resources/beta/pay/pay.d.mts.map +0 -1
  149. package/resources/beta/pay/pay.d.ts +0 -206
  150. package/resources/beta/pay/pay.d.ts.map +0 -1
  151. package/resources/beta/pay/pay.js.map +0 -1
  152. package/resources/beta/pay/pay.mjs.map +0 -1
  153. package/resources/beta/pay/products/entitlements.d.mts +0 -53
  154. package/resources/beta/pay/products/entitlements.d.mts.map +0 -1
  155. package/resources/beta/pay/products/entitlements.d.ts +0 -53
  156. package/resources/beta/pay/products/entitlements.d.ts.map +0 -1
  157. package/resources/beta/pay/products/entitlements.js +0 -38
  158. package/resources/beta/pay/products/entitlements.js.map +0 -1
  159. package/resources/beta/pay/products/entitlements.mjs +0 -34
  160. package/resources/beta/pay/products/entitlements.mjs.map +0 -1
  161. package/resources/beta/pay/products/index.d.mts +0 -4
  162. package/resources/beta/pay/products/index.d.mts.map +0 -1
  163. package/resources/beta/pay/products/index.d.ts +0 -4
  164. package/resources/beta/pay/products/index.d.ts.map +0 -1
  165. package/resources/beta/pay/products/index.js.map +0 -1
  166. package/resources/beta/pay/products/index.mjs.map +0 -1
  167. package/resources/beta/pay/products/products.d.mts +0 -183
  168. package/resources/beta/pay/products/products.d.mts.map +0 -1
  169. package/resources/beta/pay/products/products.d.ts +0 -183
  170. package/resources/beta/pay/products/products.d.ts.map +0 -1
  171. package/resources/beta/pay/products/products.js.map +0 -1
  172. package/resources/beta/pay/products/products.mjs.map +0 -1
  173. package/resources/beta/pay/products/variants.d.mts +0 -206
  174. package/resources/beta/pay/products/variants.d.mts.map +0 -1
  175. package/resources/beta/pay/products/variants.d.ts +0 -206
  176. package/resources/beta/pay/products/variants.d.ts.map +0 -1
  177. package/resources/beta/pay/products/variants.js.map +0 -1
  178. package/resources/beta/pay/products/variants.mjs.map +0 -1
  179. package/resources/beta/pay/products.d.mts.map +0 -1
  180. package/resources/beta/pay/products.d.ts.map +0 -1
  181. package/resources/beta/pay/products.js.map +0 -1
  182. package/resources/beta/pay/products.mjs.map +0 -1
  183. package/resources/beta/pay.d.mts +0 -2
  184. package/resources/beta/pay.d.mts.map +0 -1
  185. package/resources/beta/pay.d.ts +0 -2
  186. package/resources/beta/pay.d.ts.map +0 -1
  187. package/resources/beta/pay.js.map +0 -1
  188. package/resources/beta/pay.mjs.map +0 -1
  189. package/src/resources/beta/pay/coupons.ts +0 -218
  190. package/src/resources/beta/pay/customers.ts +0 -229
  191. package/src/resources/beta/pay/entitlements.ts +0 -113
  192. package/src/resources/beta/pay/index.ts +0 -46
  193. package/src/resources/beta/pay/products/entitlements.ts +0 -93
  194. package/src/resources/beta/pay/products/index.ts +0 -28
  195. package/src/resources/beta/pay/products/products.ts +0 -280
  196. package/src/resources/beta/pay/products/variants.ts +0 -279
  197. /package/resources/beta/{pay → commerce}/products.d.mts +0 -0
  198. /package/resources/beta/{pay → commerce}/products.d.ts +0 -0
  199. /package/resources/beta/{pay → commerce}/products.js +0 -0
  200. /package/resources/beta/{pay → commerce}/products.mjs +0 -0
  201. /package/src/resources/beta/{pay → commerce}/products.ts +0 -0
@@ -1,4 +0,0 @@
1
- export { Entitlements, type ProductEntitlement, type EntitlementListParams, type EntitlementAttachParams, type EntitlementRemoveParams, type ProductEntitlementsCursorIDPage, } from "./entitlements.js";
2
- export { Products, type Product, type ProductCreateParams, type ProductUpdateParams, type ProductListParams, type ProductsCursorIDPage, } from "./products.js";
3
- export { Variants, type Variant, type VariantCreateParams, type VariantUpdateParams, type VariantListParams, type VariantArchiveParams, type VariantGetParams, type VariantsCursorIDPage, } from "./variants.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/beta/pay/products/index.ts"],"names":[],"mappings":"OAEO,EACL,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,GACrC;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/beta/pay/products/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAOwB;AANtB,4GAAA,YAAY,OAAA;AAOd,0CAOoB;AANlB,oGAAA,QAAQ,OAAA;AAOV,0CASoB;AARlB,oGAAA,QAAQ,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/resources/beta/pay/products/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,YAAY,GAMb;OACM,EACL,QAAQ,GAMT;OACM,EACL,QAAQ,GAQT"}
@@ -1,183 +0,0 @@
1
- import { APIResource } from "../../../../core/resource.mjs";
2
- import * as EntitlementsAPI from "./entitlements.mjs";
3
- import { EntitlementAttachParams, EntitlementListParams, EntitlementRemoveParams, Entitlements, ProductEntitlement, ProductEntitlementsCursorIDPage } from "./entitlements.mjs";
4
- import * as VariantsAPI from "./variants.mjs";
5
- import { Variant, VariantArchiveParams, VariantCreateParams, VariantGetParams, VariantListParams, VariantUpdateParams, Variants, VariantsCursorIDPage } from "./variants.mjs";
6
- import { APIPromise } from "../../../../core/api-promise.mjs";
7
- import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../../core/pagination.mjs";
8
- import { RequestOptions } from "../../../../internal/request-options.mjs";
9
- export declare class Products extends APIResource {
10
- entitlements: EntitlementsAPI.Entitlements;
11
- variants: VariantsAPI.Variants;
12
- /**
13
- * Creates a new subscription product with a recurring price. Common examples
14
- * include Free, Pro, Business, or Teams tiers. After creating a product, attach
15
- * entitlements to define which features customers on this product can access.
16
- */
17
- create(body: ProductCreateParams, options?: RequestOptions): APIPromise<Product>;
18
- /**
19
- * Updates an existing product. Use this to modify the product name, description,
20
- * or active status. Pricing cannot be changed after creation—create a new product
21
- * instead.
22
- */
23
- update(productID: string, body?: ProductUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Product>;
24
- /**
25
- * Retrieves a paginated list of subscription products. Products define the pricing
26
- * and billing intervals for subscriptions. Each product can have entitlements
27
- * attached that grant features to subscribed customers.
28
- */
29
- list(query?: ProductListParams | null | undefined, options?: RequestOptions): PagePromise<ProductsCursorIDPage, Product>;
30
- /**
31
- * Archives a product, preventing new subscriptions. Existing subscriptions remain
32
- * active. Use this instead of deletion to preserve subscription history.
33
- */
34
- archive(productID: string, options?: RequestOptions): APIPromise<Product>;
35
- /**
36
- * Retrieves a product by ID. Returns the product object including pricing details
37
- * and status.
38
- */
39
- get(productID: string, options?: RequestOptions): APIPromise<Product>;
40
- }
41
- export type ProductsCursorIDPage = CursorIDPage<Product>;
42
- /**
43
- * A product that customers can purchase. Products can be one-time purchases or
44
- * recurring subscriptions. Attach entitlements to a product to grant features to
45
- * customers.
46
- */
47
- export interface Product {
48
- /**
49
- * Unique identifier for the topic subscription
50
- */
51
- id: string;
52
- /**
53
- * Whether the product is available for new purchases
54
- */
55
- active: boolean;
56
- /**
57
- * Timestamp when the product was created
58
- */
59
- created: string;
60
- /**
61
- * Display name for the product (e.g., Pro, Business, Teams)
62
- */
63
- name: string;
64
- /**
65
- * Price configuration for a product. Can be one-time or recurring (subscription).
66
- */
67
- default_price?: Product.DefaultPrice | null;
68
- /**
69
- * Detailed description of what the product includes
70
- */
71
- description?: string | null;
72
- }
73
- export declare namespace Product {
74
- /**
75
- * Price configuration for a product. Can be one-time or recurring (subscription).
76
- */
77
- interface DefaultPrice {
78
- /**
79
- * Unique identifier for the topic subscription
80
- */
81
- id: string;
82
- /**
83
- * How to handle the billing cycle when switching plans. 'now' resets to current
84
- * time, 'unchanged' keeps the original anchor. Null for one-time prices.
85
- */
86
- billing_cycle_anchor: 'now' | 'unchanged' | null;
87
- /**
88
- * Three-letter ISO currency code (e.g., usd, eur)
89
- */
90
- currency: string;
91
- /**
92
- * Billing frequency for recurring prices: day, week, month, or year. Null for
93
- * one-time prices.
94
- */
95
- interval: 'day' | 'week' | 'month' | 'year' | null;
96
- /**
97
- * Number of intervals between billings for recurring prices. Null for one-time
98
- * prices.
99
- */
100
- interval_count: number | null;
101
- /**
102
- * How to handle prorations when switching plans. 'default' creates prorations,
103
- * 'none' disables them. Null for one-time prices.
104
- */
105
- proration_behavior: 'default' | 'none' | null;
106
- /**
107
- * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
108
- * billing period start. Null for one-time prices or to use Stripe's default.
109
- */
110
- proration_date: 'now' | 'start_of_period' | null;
111
- /**
112
- * Price type: one_time for single purchases, recurring for subscriptions
113
- */
114
- type: 'one_time' | 'recurring';
115
- /**
116
- * Price amount in the smallest currency unit (e.g., cents)
117
- */
118
- unit_amount: number | null;
119
- }
120
- }
121
- export interface ProductCreateParams {
122
- /**
123
- * Display name for the product (e.g., Pro, Business, Teams)
124
- */
125
- name: string;
126
- /**
127
- * Price amount in the smallest currency unit (e.g., cents). Use 0 for free
128
- * products.
129
- */
130
- unit_amount: number;
131
- /**
132
- * Optional custom ID for the product. If not provided, one will be generated.
133
- */
134
- id?: string;
135
- /**
136
- * Three-letter ISO currency code
137
- */
138
- currency?: string;
139
- /**
140
- * Detailed description of what the product includes
141
- */
142
- description?: string;
143
- /**
144
- * Billing frequency for recurring prices: day, week, month, or year. Required for
145
- * recurring type, ignored for one_time.
146
- */
147
- interval?: 'day' | 'week' | 'month' | 'year';
148
- /**
149
- * Number of intervals between billings for recurring prices. Required for
150
- * recurring type, ignored for one_time.
151
- */
152
- interval_count?: number;
153
- /**
154
- * Price type: one_time for single purchases, recurring for subscriptions
155
- */
156
- type?: 'one_time' | 'recurring';
157
- }
158
- export interface ProductUpdateParams {
159
- /**
160
- * Whether the product is available for new subscriptions
161
- */
162
- active?: boolean;
163
- /**
164
- * Detailed description of what the product includes
165
- */
166
- description?: string;
167
- /**
168
- * Display name for the product
169
- */
170
- name?: string;
171
- }
172
- export interface ProductListParams extends CursorIDPageParams {
173
- /**
174
- * Filter by active status
175
- */
176
- active?: 'true' | 'false';
177
- }
178
- export declare namespace Products {
179
- export { type Product as Product, type ProductsCursorIDPage as ProductsCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
180
- export { Entitlements as Entitlements, type ProductEntitlement as ProductEntitlement, type ProductEntitlementsCursorIDPage as ProductEntitlementsCursorIDPage, type EntitlementListParams as EntitlementListParams, type EntitlementAttachParams as EntitlementAttachParams, type EntitlementRemoveParams as EntitlementRemoveParams, };
181
- export { Variants as Variants, type Variant as Variant, type VariantsCursorIDPage as VariantsCursorIDPage, type VariantCreateParams as VariantCreateParams, type VariantUpdateParams as VariantUpdateParams, type VariantListParams as VariantListParams, type VariantArchiveParams as VariantArchiveParams, type VariantGetParams as VariantGetParams, };
182
- }
183
- //# sourceMappingURL=products.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"products.d.mts","sourceRoot":"","sources":["../../../../src/resources/beta/pay/products/products.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,eAAe;OACpB,EACL,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,kBAAkB,EAClB,+BAA+B,EAChC;OACM,KAAK,WAAW;OAChB,EACL,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,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,OAAO,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAKD,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,YAAY,IAAI,YAAY,EAC5B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -1,183 +0,0 @@
1
- import { APIResource } from "../../../../core/resource.js";
2
- import * as EntitlementsAPI from "./entitlements.js";
3
- import { EntitlementAttachParams, EntitlementListParams, EntitlementRemoveParams, Entitlements, ProductEntitlement, ProductEntitlementsCursorIDPage } from "./entitlements.js";
4
- import * as VariantsAPI from "./variants.js";
5
- import { Variant, VariantArchiveParams, VariantCreateParams, VariantGetParams, VariantListParams, VariantUpdateParams, Variants, VariantsCursorIDPage } from "./variants.js";
6
- import { APIPromise } from "../../../../core/api-promise.js";
7
- import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../../core/pagination.js";
8
- import { RequestOptions } from "../../../../internal/request-options.js";
9
- export declare class Products extends APIResource {
10
- entitlements: EntitlementsAPI.Entitlements;
11
- variants: VariantsAPI.Variants;
12
- /**
13
- * Creates a new subscription product with a recurring price. Common examples
14
- * include Free, Pro, Business, or Teams tiers. After creating a product, attach
15
- * entitlements to define which features customers on this product can access.
16
- */
17
- create(body: ProductCreateParams, options?: RequestOptions): APIPromise<Product>;
18
- /**
19
- * Updates an existing product. Use this to modify the product name, description,
20
- * or active status. Pricing cannot be changed after creation—create a new product
21
- * instead.
22
- */
23
- update(productID: string, body?: ProductUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Product>;
24
- /**
25
- * Retrieves a paginated list of subscription products. Products define the pricing
26
- * and billing intervals for subscriptions. Each product can have entitlements
27
- * attached that grant features to subscribed customers.
28
- */
29
- list(query?: ProductListParams | null | undefined, options?: RequestOptions): PagePromise<ProductsCursorIDPage, Product>;
30
- /**
31
- * Archives a product, preventing new subscriptions. Existing subscriptions remain
32
- * active. Use this instead of deletion to preserve subscription history.
33
- */
34
- archive(productID: string, options?: RequestOptions): APIPromise<Product>;
35
- /**
36
- * Retrieves a product by ID. Returns the product object including pricing details
37
- * and status.
38
- */
39
- get(productID: string, options?: RequestOptions): APIPromise<Product>;
40
- }
41
- export type ProductsCursorIDPage = CursorIDPage<Product>;
42
- /**
43
- * A product that customers can purchase. Products can be one-time purchases or
44
- * recurring subscriptions. Attach entitlements to a product to grant features to
45
- * customers.
46
- */
47
- export interface Product {
48
- /**
49
- * Unique identifier for the topic subscription
50
- */
51
- id: string;
52
- /**
53
- * Whether the product is available for new purchases
54
- */
55
- active: boolean;
56
- /**
57
- * Timestamp when the product was created
58
- */
59
- created: string;
60
- /**
61
- * Display name for the product (e.g., Pro, Business, Teams)
62
- */
63
- name: string;
64
- /**
65
- * Price configuration for a product. Can be one-time or recurring (subscription).
66
- */
67
- default_price?: Product.DefaultPrice | null;
68
- /**
69
- * Detailed description of what the product includes
70
- */
71
- description?: string | null;
72
- }
73
- export declare namespace Product {
74
- /**
75
- * Price configuration for a product. Can be one-time or recurring (subscription).
76
- */
77
- interface DefaultPrice {
78
- /**
79
- * Unique identifier for the topic subscription
80
- */
81
- id: string;
82
- /**
83
- * How to handle the billing cycle when switching plans. 'now' resets to current
84
- * time, 'unchanged' keeps the original anchor. Null for one-time prices.
85
- */
86
- billing_cycle_anchor: 'now' | 'unchanged' | null;
87
- /**
88
- * Three-letter ISO currency code (e.g., usd, eur)
89
- */
90
- currency: string;
91
- /**
92
- * Billing frequency for recurring prices: day, week, month, or year. Null for
93
- * one-time prices.
94
- */
95
- interval: 'day' | 'week' | 'month' | 'year' | null;
96
- /**
97
- * Number of intervals between billings for recurring prices. Null for one-time
98
- * prices.
99
- */
100
- interval_count: number | null;
101
- /**
102
- * How to handle prorations when switching plans. 'default' creates prorations,
103
- * 'none' disables them. Null for one-time prices.
104
- */
105
- proration_behavior: 'default' | 'none' | null;
106
- /**
107
- * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
108
- * billing period start. Null for one-time prices or to use Stripe's default.
109
- */
110
- proration_date: 'now' | 'start_of_period' | null;
111
- /**
112
- * Price type: one_time for single purchases, recurring for subscriptions
113
- */
114
- type: 'one_time' | 'recurring';
115
- /**
116
- * Price amount in the smallest currency unit (e.g., cents)
117
- */
118
- unit_amount: number | null;
119
- }
120
- }
121
- export interface ProductCreateParams {
122
- /**
123
- * Display name for the product (e.g., Pro, Business, Teams)
124
- */
125
- name: string;
126
- /**
127
- * Price amount in the smallest currency unit (e.g., cents). Use 0 for free
128
- * products.
129
- */
130
- unit_amount: number;
131
- /**
132
- * Optional custom ID for the product. If not provided, one will be generated.
133
- */
134
- id?: string;
135
- /**
136
- * Three-letter ISO currency code
137
- */
138
- currency?: string;
139
- /**
140
- * Detailed description of what the product includes
141
- */
142
- description?: string;
143
- /**
144
- * Billing frequency for recurring prices: day, week, month, or year. Required for
145
- * recurring type, ignored for one_time.
146
- */
147
- interval?: 'day' | 'week' | 'month' | 'year';
148
- /**
149
- * Number of intervals between billings for recurring prices. Required for
150
- * recurring type, ignored for one_time.
151
- */
152
- interval_count?: number;
153
- /**
154
- * Price type: one_time for single purchases, recurring for subscriptions
155
- */
156
- type?: 'one_time' | 'recurring';
157
- }
158
- export interface ProductUpdateParams {
159
- /**
160
- * Whether the product is available for new subscriptions
161
- */
162
- active?: boolean;
163
- /**
164
- * Detailed description of what the product includes
165
- */
166
- description?: string;
167
- /**
168
- * Display name for the product
169
- */
170
- name?: string;
171
- }
172
- export interface ProductListParams extends CursorIDPageParams {
173
- /**
174
- * Filter by active status
175
- */
176
- active?: 'true' | 'false';
177
- }
178
- export declare namespace Products {
179
- export { type Product as Product, type ProductsCursorIDPage as ProductsCursorIDPage, type ProductCreateParams as ProductCreateParams, type ProductUpdateParams as ProductUpdateParams, type ProductListParams as ProductListParams, };
180
- export { Entitlements as Entitlements, type ProductEntitlement as ProductEntitlement, type ProductEntitlementsCursorIDPage as ProductEntitlementsCursorIDPage, type EntitlementListParams as EntitlementListParams, type EntitlementAttachParams as EntitlementAttachParams, type EntitlementRemoveParams as EntitlementRemoveParams, };
181
- export { Variants as Variants, type Variant as Variant, type VariantsCursorIDPage as VariantsCursorIDPage, type VariantCreateParams as VariantCreateParams, type VariantUpdateParams as VariantUpdateParams, type VariantListParams as VariantListParams, type VariantArchiveParams as VariantArchiveParams, type VariantGetParams as VariantGetParams, };
182
- }
183
- //# sourceMappingURL=products.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../../src/resources/beta/pay/products/products.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,eAAe;OACpB,EACL,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,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AAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnG,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,SAAiB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAoB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,SAAiB,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AAuKD,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;AACrC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -1,206 +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 Variants extends APIResource {
6
- /**
7
- * Creates a new variant with pricing for a product. Use variants to offer multiple
8
- * pricing tiers or configurations (e.g., Basic at $10/month, Pro at $25/month). A
9
- * Stripe Price is automatically created.
10
- */
11
- create(productID: string, body: VariantCreateParams, options?: RequestOptions): APIPromise<Variant>;
12
- /**
13
- * Updates an existing variant. Use this to modify the name, description, or active
14
- * status. Pricing cannot be changed after creation—create a new variant instead.
15
- */
16
- update(variantID: string, params: VariantUpdateParams, options?: RequestOptions): APIPromise<Variant>;
17
- /**
18
- * Retrieves all variants for a product. Variants represent different pricing tiers
19
- * or configurations (e.g., Basic, Pro, Enterprise) within a single product.
20
- */
21
- list(productID: string, query?: VariantListParams | null | undefined, options?: RequestOptions): PagePromise<VariantsCursorIDPage, Variant>;
22
- /**
23
- * Archives a variant, preventing new subscriptions. The associated Stripe Price is
24
- * also archived. Existing subscriptions remain active.
25
- */
26
- archive(variantID: string, params: VariantArchiveParams, options?: RequestOptions): APIPromise<Variant>;
27
- /**
28
- * Retrieves a variant by ID. Returns the variant object including pricing details
29
- * and status.
30
- */
31
- get(variantID: string, params: VariantGetParams, options?: RequestOptions): APIPromise<Variant>;
32
- }
33
- export type VariantsCursorIDPage = CursorIDPage<Variant>;
34
- /**
35
- * A product variant representing a specific tier or configuration. Each variant
36
- * has its own pricing. Variants allow a single product to have multiple pricing
37
- * options (e.g., Basic, Pro, Enterprise tiers).
38
- */
39
- export interface Variant {
40
- /**
41
- * Unique identifier for the topic subscription
42
- */
43
- id: string;
44
- /**
45
- * Whether the variant is available for new purchases
46
- */
47
- active: boolean;
48
- /**
49
- * Timestamp when the variant was created
50
- */
51
- created: string;
52
- /**
53
- * Display name for the variant (e.g., Basic, Standard, Premium)
54
- */
55
- name: string;
56
- /**
57
- * Price configuration for a product. Can be one-time or recurring (subscription).
58
- */
59
- default_price?: Variant.DefaultPrice | null;
60
- /**
61
- * Detailed description of what this variant includes
62
- */
63
- description?: string | null;
64
- }
65
- export declare namespace Variant {
66
- /**
67
- * Price configuration for a product. Can be one-time or recurring (subscription).
68
- */
69
- interface DefaultPrice {
70
- /**
71
- * Unique identifier for the topic subscription
72
- */
73
- id: string;
74
- /**
75
- * How to handle the billing cycle when switching plans. 'now' resets to current
76
- * time, 'unchanged' keeps the original anchor. Null for one-time prices.
77
- */
78
- billing_cycle_anchor: 'now' | 'unchanged' | null;
79
- /**
80
- * Three-letter ISO currency code (e.g., usd, eur)
81
- */
82
- currency: string;
83
- /**
84
- * Billing frequency for recurring prices: day, week, month, or year. Null for
85
- * one-time prices.
86
- */
87
- interval: 'day' | 'week' | 'month' | 'year' | null;
88
- /**
89
- * Number of intervals between billings for recurring prices. Null for one-time
90
- * prices.
91
- */
92
- interval_count: number | null;
93
- /**
94
- * How to handle prorations when switching plans. 'default' creates prorations,
95
- * 'none' disables them. Null for one-time prices.
96
- */
97
- proration_behavior: 'default' | 'none' | null;
98
- /**
99
- * When to calculate proration. 'now' uses current time, 'start_of_period' uses the
100
- * billing period start. Null for one-time prices or to use Stripe's default.
101
- */
102
- proration_date: 'now' | 'start_of_period' | null;
103
- /**
104
- * Price type: one_time for single purchases, recurring for subscriptions
105
- */
106
- type: 'one_time' | 'recurring';
107
- /**
108
- * Price amount in the smallest currency unit (e.g., cents)
109
- */
110
- unit_amount: number | null;
111
- }
112
- }
113
- export interface VariantCreateParams {
114
- /**
115
- * Display name for the variant (e.g., Basic, Standard, Premium)
116
- */
117
- name: string;
118
- /**
119
- * Price amount in the smallest currency unit (e.g., cents). Use 0 for free
120
- * variants.
121
- */
122
- unit_amount: number;
123
- /**
124
- * Optional custom ID for the variant. If not provided, one will be generated.
125
- */
126
- id?: string;
127
- /**
128
- * Default billing cycle anchor behavior when switching to this price. 'now' resets
129
- * to current time, 'unchanged' keeps original anchor. Only applies to recurring
130
- * prices.
131
- */
132
- billing_cycle_anchor?: 'now' | 'unchanged';
133
- /**
134
- * Three-letter ISO currency code
135
- */
136
- currency?: string;
137
- /**
138
- * Detailed description of what this variant includes
139
- */
140
- description?: string;
141
- /**
142
- * Billing frequency for recurring prices: day, week, month, or year. Required for
143
- * recurring type, ignored for one_time.
144
- */
145
- interval?: 'day' | 'week' | 'month' | 'year';
146
- /**
147
- * Number of intervals between billings for recurring prices. Required for
148
- * recurring type, ignored for one_time.
149
- */
150
- interval_count?: number;
151
- /**
152
- * Default proration behavior when switching to this price. 'default' creates
153
- * prorations, 'none' disables them. Only applies to recurring prices.
154
- */
155
- proration_behavior?: 'default' | 'none';
156
- /**
157
- * Default proration date calculation when switching to this price. 'now' uses
158
- * current time, 'start_of_period' uses billing period start. Only applies to
159
- * recurring prices.
160
- */
161
- proration_date?: 'now' | 'start_of_period';
162
- /**
163
- * Price type: one_time for single purchases, recurring for subscriptions
164
- */
165
- type?: 'one_time' | 'recurring';
166
- }
167
- export interface VariantUpdateParams {
168
- /**
169
- * Path param: The unique identifier of the product
170
- */
171
- product_id: string;
172
- /**
173
- * Body param: Whether the variant is available for new purchases
174
- */
175
- active?: boolean;
176
- /**
177
- * Body param: Detailed description of what this variant includes
178
- */
179
- description?: string;
180
- /**
181
- * Body param: Display name for the variant
182
- */
183
- name?: string;
184
- }
185
- export interface VariantListParams extends CursorIDPageParams {
186
- /**
187
- * Filter by active status
188
- */
189
- active?: 'true' | 'false';
190
- }
191
- export interface VariantArchiveParams {
192
- /**
193
- * The unique identifier of the product
194
- */
195
- product_id: string;
196
- }
197
- export interface VariantGetParams {
198
- /**
199
- * The unique identifier of the product
200
- */
201
- product_id: string;
202
- }
203
- export declare namespace Variants {
204
- export { type Variant as Variant, type VariantsCursorIDPage as VariantsCursorIDPage, type VariantCreateParams as VariantCreateParams, type VariantUpdateParams as VariantUpdateParams, type VariantListParams as VariantListParams, type VariantArchiveParams as VariantArchiveParams, type VariantGetParams as VariantGetParams, };
205
- }
206
- //# sourceMappingURL=variants.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variants.d.mts","sourceRoot":"","sources":["../../../../src/resources/beta/pay/products/variants.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInG;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAQrG;;;OAGG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAA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