@stigg/typescript 0.1.0-alpha.3 → 0.1.0-alpha.7

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 (204) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +9 -0
  3. package/client.d.mts +6 -8
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -8
  6. package/client.d.ts.map +1 -1
  7. package/client.js +16 -21
  8. package/client.js.map +1 -1
  9. package/client.mjs +17 -22
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/internal/qs/formats.d.mts +7 -0
  18. package/internal/qs/formats.d.mts.map +1 -0
  19. package/internal/qs/formats.d.ts +7 -0
  20. package/internal/qs/formats.d.ts.map +1 -0
  21. package/internal/qs/formats.js +13 -0
  22. package/internal/qs/formats.js.map +1 -0
  23. package/internal/qs/formats.mjs +9 -0
  24. package/internal/qs/formats.mjs.map +1 -0
  25. package/internal/qs/index.d.mts +10 -0
  26. package/internal/qs/index.d.mts.map +1 -0
  27. package/internal/qs/index.d.ts +10 -0
  28. package/internal/qs/index.d.ts.map +1 -0
  29. package/internal/qs/index.js +14 -0
  30. package/internal/qs/index.js.map +1 -0
  31. package/internal/qs/index.mjs +10 -0
  32. package/internal/qs/index.mjs.map +1 -0
  33. package/internal/qs/stringify.d.mts +3 -0
  34. package/internal/qs/stringify.d.mts.map +1 -0
  35. package/internal/qs/stringify.d.ts +3 -0
  36. package/internal/qs/stringify.d.ts.map +1 -0
  37. package/internal/qs/stringify.js +277 -0
  38. package/internal/qs/stringify.js.map +1 -0
  39. package/internal/qs/stringify.mjs +274 -0
  40. package/internal/qs/stringify.mjs.map +1 -0
  41. package/internal/qs/types.d.mts +57 -0
  42. package/internal/qs/types.d.mts.map +1 -0
  43. package/internal/qs/types.d.ts +57 -0
  44. package/internal/qs/types.d.ts.map +1 -0
  45. package/internal/qs/types.js +3 -0
  46. package/internal/qs/types.js.map +1 -0
  47. package/internal/qs/types.mjs +2 -0
  48. package/internal/qs/types.mjs.map +1 -0
  49. package/internal/qs/utils.d.mts +15 -0
  50. package/internal/qs/utils.d.mts.map +1 -0
  51. package/internal/qs/utils.d.ts +15 -0
  52. package/internal/qs/utils.d.ts.map +1 -0
  53. package/internal/qs/utils.js +230 -0
  54. package/internal/qs/utils.js.map +1 -0
  55. package/internal/qs/utils.mjs +217 -0
  56. package/internal/qs/utils.mjs.map +1 -0
  57. package/package.json +1 -1
  58. package/resources/index.d.mts +1 -1
  59. package/resources/index.d.mts.map +1 -1
  60. package/resources/index.d.ts +1 -1
  61. package/resources/index.d.ts.map +1 -1
  62. package/resources/index.js.map +1 -1
  63. package/resources/index.mjs +1 -1
  64. package/resources/index.mjs.map +1 -1
  65. package/resources/v1/coupons.d.mts +55 -96
  66. package/resources/v1/coupons.d.mts.map +1 -1
  67. package/resources/v1/coupons.d.ts +55 -96
  68. package/resources/v1/coupons.d.ts.map +1 -1
  69. package/resources/v1/coupons.js +4 -3
  70. package/resources/v1/coupons.js.map +1 -1
  71. package/resources/v1/coupons.mjs +4 -3
  72. package/resources/v1/coupons.mjs.map +1 -1
  73. package/resources/v1/customers/customers.d.mts +170 -46
  74. package/resources/v1/customers/customers.d.mts.map +1 -1
  75. package/resources/v1/customers/customers.d.ts +170 -46
  76. package/resources/v1/customers/customers.d.ts.map +1 -1
  77. package/resources/v1/customers/customers.js +32 -15
  78. package/resources/v1/customers/customers.js.map +1 -1
  79. package/resources/v1/customers/customers.mjs +32 -15
  80. package/resources/v1/customers/customers.mjs.map +1 -1
  81. package/resources/v1/customers/index.d.mts +2 -2
  82. package/resources/v1/customers/index.d.mts.map +1 -1
  83. package/resources/v1/customers/index.d.ts +2 -2
  84. package/resources/v1/customers/index.d.ts.map +1 -1
  85. package/resources/v1/customers/index.js +3 -3
  86. package/resources/v1/customers/index.js.map +1 -1
  87. package/resources/v1/customers/index.mjs +1 -1
  88. package/resources/v1/customers/index.mjs.map +1 -1
  89. package/resources/v1/customers/payment-method.d.mts +4 -2
  90. package/resources/v1/customers/payment-method.d.mts.map +1 -1
  91. package/resources/v1/customers/payment-method.d.ts +4 -2
  92. package/resources/v1/customers/payment-method.d.ts.map +1 -1
  93. package/resources/v1/customers/payment-method.js +4 -2
  94. package/resources/v1/customers/payment-method.js.map +1 -1
  95. package/resources/v1/customers/payment-method.mjs +4 -2
  96. package/resources/v1/customers/payment-method.mjs.map +1 -1
  97. package/resources/v1/customers/promotional-entitlements.d.mts +352 -0
  98. package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -0
  99. package/resources/v1/customers/promotional-entitlements.d.ts +352 -0
  100. package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -0
  101. package/resources/v1/customers/promotional-entitlements.js +25 -0
  102. package/resources/v1/customers/promotional-entitlements.js.map +1 -0
  103. package/resources/v1/customers/promotional-entitlements.mjs +21 -0
  104. package/resources/v1/customers/promotional-entitlements.mjs.map +1 -0
  105. package/resources/v1/events.d.mts +63 -0
  106. package/resources/v1/events.d.mts.map +1 -0
  107. package/resources/v1/events.d.ts +63 -0
  108. package/resources/v1/events.d.ts.map +1 -0
  109. package/resources/v1/events.js +16 -0
  110. package/resources/v1/events.js.map +1 -0
  111. package/resources/v1/events.mjs +12 -0
  112. package/resources/v1/events.mjs.map +1 -0
  113. package/resources/v1/index.d.mts +7 -4
  114. package/resources/v1/index.d.mts.map +1 -1
  115. package/resources/v1/index.d.ts +7 -4
  116. package/resources/v1/index.d.ts.map +1 -1
  117. package/resources/v1/index.js +7 -1
  118. package/resources/v1/index.js.map +1 -1
  119. package/resources/v1/index.mjs +4 -1
  120. package/resources/v1/index.mjs.map +1 -1
  121. package/resources/v1/products.d.mts +126 -0
  122. package/resources/v1/products.d.mts.map +1 -0
  123. package/resources/v1/products.d.ts +126 -0
  124. package/resources/v1/products.d.ts.map +1 -0
  125. package/resources/v1/products.js +19 -0
  126. package/resources/v1/products.js.map +1 -0
  127. package/resources/v1/products.mjs +15 -0
  128. package/resources/v1/products.mjs.map +1 -0
  129. package/resources/v1/subscriptions/future-update.d.mts +9 -22
  130. package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
  131. package/resources/v1/subscriptions/future-update.d.ts +9 -22
  132. package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
  133. package/resources/v1/subscriptions/future-update.js +3 -2
  134. package/resources/v1/subscriptions/future-update.js.map +1 -1
  135. package/resources/v1/subscriptions/future-update.mjs +3 -2
  136. package/resources/v1/subscriptions/future-update.mjs.map +1 -1
  137. package/resources/v1/subscriptions/index.d.mts +2 -2
  138. package/resources/v1/subscriptions/index.d.mts.map +1 -1
  139. package/resources/v1/subscriptions/index.d.ts +2 -2
  140. package/resources/v1/subscriptions/index.d.ts.map +1 -1
  141. package/resources/v1/subscriptions/index.js.map +1 -1
  142. package/resources/v1/subscriptions/index.mjs +1 -1
  143. package/resources/v1/subscriptions/index.mjs.map +1 -1
  144. package/resources/v1/subscriptions/subscriptions.d.mts +987 -949
  145. package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
  146. package/resources/v1/subscriptions/subscriptions.d.ts +987 -949
  147. package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
  148. package/resources/v1/subscriptions/subscriptions.js +39 -11
  149. package/resources/v1/subscriptions/subscriptions.js.map +1 -1
  150. package/resources/v1/subscriptions/subscriptions.mjs +40 -12
  151. package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
  152. package/resources/v1/usage.d.mts +230 -0
  153. package/resources/v1/usage.d.mts.map +1 -0
  154. package/resources/v1/usage.d.ts +230 -0
  155. package/resources/v1/usage.d.ts.map +1 -0
  156. package/resources/v1/usage.js +24 -0
  157. package/resources/v1/usage.js.map +1 -0
  158. package/resources/v1/usage.mjs +20 -0
  159. package/resources/v1/usage.mjs.map +1 -0
  160. package/resources/v1/v1.d.mts +18 -172
  161. package/resources/v1/v1.d.mts.map +1 -1
  162. package/resources/v1/v1.d.ts +18 -172
  163. package/resources/v1/v1.d.ts.map +1 -1
  164. package/resources/v1/v1.js +12 -12
  165. package/resources/v1/v1.js.map +1 -1
  166. package/resources/v1/v1.mjs +12 -12
  167. package/resources/v1/v1.mjs.map +1 -1
  168. package/src/client.ts +25 -40
  169. package/src/internal/parse.ts +6 -0
  170. package/src/internal/qs/LICENSE.md +13 -0
  171. package/src/internal/qs/README.md +3 -0
  172. package/src/internal/qs/formats.ts +10 -0
  173. package/src/internal/qs/index.ts +13 -0
  174. package/src/internal/qs/stringify.ts +385 -0
  175. package/src/internal/qs/types.ts +71 -0
  176. package/src/internal/qs/utils.ts +265 -0
  177. package/src/resources/index.ts +1 -7
  178. package/src/resources/v1/coupons.ts +63 -231
  179. package/src/resources/v1/customers/customers.ts +234 -60
  180. package/src/resources/v1/customers/index.ts +13 -2
  181. package/src/resources/v1/customers/payment-method.ts +4 -2
  182. package/src/resources/v1/customers/promotional-entitlements.ts +468 -0
  183. package/src/resources/v1/events.ts +74 -0
  184. package/src/resources/v1/index.ts +28 -15
  185. package/src/resources/v1/products.ts +162 -0
  186. package/src/resources/v1/subscriptions/future-update.ts +9 -30
  187. package/src/resources/v1/subscriptions/index.ts +8 -11
  188. package/src/resources/v1/subscriptions/subscriptions.ts +2699 -2280
  189. package/src/resources/v1/usage.ts +284 -0
  190. package/src/resources/v1/v1.ts +72 -220
  191. package/src/version.ts +1 -1
  192. package/version.d.mts +1 -1
  193. package/version.d.ts +1 -1
  194. package/version.js +1 -1
  195. package/version.mjs +1 -1
  196. package/resources/v1/customers/usage.d.mts +0 -4
  197. package/resources/v1/customers/usage.d.mts.map +0 -1
  198. package/resources/v1/customers/usage.d.ts +0 -4
  199. package/resources/v1/customers/usage.d.ts.map +0 -1
  200. package/resources/v1/customers/usage.js +0 -9
  201. package/resources/v1/customers/usage.js.map +0 -1
  202. package/resources/v1/customers/usage.mjs +0 -5
  203. package/resources/v1/customers/usage.mjs.map +0 -1
  204. package/src/resources/v1/customers/usage.ts +0 -5
@@ -0,0 +1,162 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../core/pagination';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+
7
+ export class Products extends APIResource {
8
+ /**
9
+ * Retrieves a paginated list of products in the environment.
10
+ */
11
+ listProducts(
12
+ query: ProductListProductsParams | null | undefined = {},
13
+ options?: RequestOptions,
14
+ ): PagePromise<ProductListProductsResponsesMyCursorIDPage, ProductListProductsResponse> {
15
+ return this._client.getAPIList('/api/v1/products', MyCursorIDPage<ProductListProductsResponse>, {
16
+ query,
17
+ ...options,
18
+ });
19
+ }
20
+ }
21
+
22
+ export type ProductListProductsResponsesMyCursorIDPage = MyCursorIDPage<ProductListProductsResponse>;
23
+
24
+ /**
25
+ * Product configuration object
26
+ */
27
+ export interface ProductListProductsResponse {
28
+ /**
29
+ * The unique identifier for the entity
30
+ */
31
+ id: string;
32
+
33
+ /**
34
+ * Timestamp of when the record was created
35
+ */
36
+ createdAt: string;
37
+
38
+ /**
39
+ * Description of the product
40
+ */
41
+ description: string | null;
42
+
43
+ /**
44
+ * Display name of the product
45
+ */
46
+ displayName: string;
47
+
48
+ /**
49
+ * Metadata associated with the entity
50
+ */
51
+ metadata: { [key: string]: string };
52
+
53
+ /**
54
+ * Indicates if multiple subscriptions to this product are allowed
55
+ */
56
+ multipleSubscriptions: boolean;
57
+
58
+ /**
59
+ * The status of the product
60
+ */
61
+ status: 'PUBLISHED' | 'ARCHIVED';
62
+
63
+ /**
64
+ * Timestamp of when the record was last updated
65
+ */
66
+ updatedAt: string;
67
+
68
+ /**
69
+ * Product behavior settings for subscription lifecycle management.
70
+ */
71
+ productSettings?: ProductListProductsResponse.ProductSettings;
72
+ }
73
+
74
+ export namespace ProductListProductsResponse {
75
+ /**
76
+ * Product behavior settings for subscription lifecycle management.
77
+ */
78
+ export interface ProductSettings {
79
+ /**
80
+ * Time when the subscription will be cancelled
81
+ */
82
+ subscriptionCancellationTime: 'END_OF_BILLING_PERIOD' | 'IMMEDIATE' | 'SPECIFIC_DATE';
83
+
84
+ /**
85
+ * Setup for the end of the subscription
86
+ */
87
+ subscriptionEndSetup: 'DOWNGRADE_TO_FREE' | 'CANCEL_SUBSCRIPTION';
88
+
89
+ /**
90
+ * Setup for the start of the subscription
91
+ */
92
+ subscriptionStartSetup: 'PLAN_SELECTION' | 'TRIAL_PERIOD' | 'FREE_PLAN';
93
+
94
+ /**
95
+ * ID of the plan to downgrade to at the end of the billing period
96
+ */
97
+ downgradePlanId?: string | null;
98
+
99
+ /**
100
+ * Indicates if the subscription should be prorated at the end of the billing
101
+ * period
102
+ */
103
+ prorateAtEndOfBillingPeriod?: boolean | null;
104
+
105
+ /**
106
+ * ID of the plan to start the subscription with
107
+ */
108
+ subscriptionStartPlanId?: string | null;
109
+ }
110
+ }
111
+
112
+ export interface ProductListProductsParams extends MyCursorIDPageParams {
113
+ /**
114
+ * Filter by entity ID
115
+ */
116
+ id?: string;
117
+
118
+ /**
119
+ * Filter by creation date using range operators: gt, gte, lt, lte
120
+ */
121
+ createdAt?: ProductListProductsParams.CreatedAt;
122
+
123
+ /**
124
+ * Filter by product status. Supports comma-separated values for multiple statuses
125
+ */
126
+ status?: string;
127
+ }
128
+
129
+ export namespace ProductListProductsParams {
130
+ /**
131
+ * Filter by creation date using range operators: gt, gte, lt, lte
132
+ */
133
+ export interface CreatedAt {
134
+ /**
135
+ * Greater than the specified createdAt value
136
+ */
137
+ gt?: string;
138
+
139
+ /**
140
+ * Greater than or equal to the specified createdAt value
141
+ */
142
+ gte?: string;
143
+
144
+ /**
145
+ * Less than the specified createdAt value
146
+ */
147
+ lt?: string;
148
+
149
+ /**
150
+ * Less than or equal to the specified createdAt value
151
+ */
152
+ lte?: string;
153
+ }
154
+ }
155
+
156
+ export declare namespace Products {
157
+ export {
158
+ type ProductListProductsResponse as ProductListProductsResponse,
159
+ type ProductListProductsResponsesMyCursorIDPage as ProductListProductsResponsesMyCursorIDPage,
160
+ type ProductListProductsParams as ProductListProductsParams,
161
+ };
162
+ }
@@ -7,19 +7,17 @@ import { path } from '../../../internal/utils/path';
7
7
 
8
8
  export class FutureUpdate extends APIResource {
9
9
  /**
10
- * Cancel pending payment update
10
+ * Cancels a subscription update that is pending payment completion.
11
11
  */
12
- cancelPendingPayment(
13
- id: string,
14
- options?: RequestOptions,
15
- ): APIPromise<FutureUpdateCancelPendingPaymentResponse> {
12
+ cancelPendingPayment(id: string, options?: RequestOptions): APIPromise<CancelSubscription> {
16
13
  return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/pending-payment`, options);
17
14
  }
18
15
 
19
16
  /**
20
- * Cancel scheduled update
17
+ * Cancels a scheduled subscription update, such as a future downgrade or plan
18
+ * change.
21
19
  */
22
- cancelSchedule(id: string, options?: RequestOptions): APIPromise<FutureUpdateCancelScheduleResponse> {
20
+ cancelSchedule(id: string, options?: RequestOptions): APIPromise<CancelSubscription> {
23
21
  return this._client.delete(path`/api/v1/subscriptions/${id}/future-update/schedule`, options);
24
22
  }
25
23
  }
@@ -27,27 +25,11 @@ export class FutureUpdate extends APIResource {
27
25
  /**
28
26
  * Response object
29
27
  */
30
- export interface FutureUpdateCancelPendingPaymentResponse {
31
- data: FutureUpdateCancelPendingPaymentResponse.Data;
28
+ export interface CancelSubscription {
29
+ data: CancelSubscription.Data;
32
30
  }
33
31
 
34
- export namespace FutureUpdateCancelPendingPaymentResponse {
35
- export interface Data {
36
- /**
37
- * Subscription ID
38
- */
39
- id: string;
40
- }
41
- }
42
-
43
- /**
44
- * Response object
45
- */
46
- export interface FutureUpdateCancelScheduleResponse {
47
- data: FutureUpdateCancelScheduleResponse.Data;
48
- }
49
-
50
- export namespace FutureUpdateCancelScheduleResponse {
32
+ export namespace CancelSubscription {
51
33
  export interface Data {
52
34
  /**
53
35
  * Subscription ID
@@ -57,8 +39,5 @@ export namespace FutureUpdateCancelScheduleResponse {
57
39
  }
58
40
 
59
41
  export declare namespace FutureUpdate {
60
- export {
61
- type FutureUpdateCancelPendingPaymentResponse as FutureUpdateCancelPendingPaymentResponse,
62
- type FutureUpdateCancelScheduleResponse as FutureUpdateCancelScheduleResponse,
63
- };
42
+ export { type CancelSubscription as CancelSubscription };
64
43
  }
@@ -1,24 +1,21 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export {
4
- FutureUpdate,
5
- type FutureUpdateCancelPendingPaymentResponse,
6
- type FutureUpdateCancelScheduleResponse,
7
- } from './future-update';
3
+ export { FutureUpdate, type CancelSubscription } from './future-update';
8
4
  export {
9
5
  Subscriptions,
10
- type SubscriptionCreateResponse,
11
- type SubscriptionRetrieveResponse,
6
+ type Subscription,
12
7
  type SubscriptionListResponse,
13
- type SubscriptionDelegateResponse,
14
- type SubscriptionMigrateResponse,
8
+ type SubscriptionImportResponse,
15
9
  type SubscriptionPreviewResponse,
16
- type SubscriptionTransferResponse,
17
- type SubscriptionCreateParams,
10
+ type SubscriptionProvisionResponse,
11
+ type SubscriptionUpdateParams,
18
12
  type SubscriptionListParams,
13
+ type SubscriptionCancelParams,
19
14
  type SubscriptionDelegateParams,
15
+ type SubscriptionImportParams,
20
16
  type SubscriptionMigrateParams,
21
17
  type SubscriptionPreviewParams,
18
+ type SubscriptionProvisionParams,
22
19
  type SubscriptionTransferParams,
23
20
  type SubscriptionListResponsesMyCursorIDPage,
24
21
  } from './subscriptions';