@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,468 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import { APIPromise } from '../../../core/api-promise';
5
+ import { RequestOptions } from '../../../internal/request-options';
6
+ import { path } from '../../../internal/utils/path';
7
+
8
+ export class PromotionalEntitlements extends APIResource {
9
+ /**
10
+ * Grants promotional entitlements to a customer, providing feature access outside
11
+ * their subscription. Entitlements can be time-limited or permanent.
12
+ */
13
+ grant(
14
+ customerID: string,
15
+ body: PromotionalEntitlementGrantParams,
16
+ options?: RequestOptions,
17
+ ): APIPromise<PromotionalEntitlementGrantResponse> {
18
+ return this._client.post(path`/api/v1/customers/${customerID}/promotional`, { body, ...options });
19
+ }
20
+
21
+ /**
22
+ * Revokes a previously granted promotional entitlement from a customer for a
23
+ * specific feature.
24
+ */
25
+ revoke(
26
+ featureID: string,
27
+ params: PromotionalEntitlementRevokeParams,
28
+ options?: RequestOptions,
29
+ ): APIPromise<PromotionalEntitlementRevokeResponse> {
30
+ const { customerId } = params;
31
+ return this._client.delete(path`/api/v1/customers/${customerId}/promotional/${featureID}`, options);
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Response object
37
+ */
38
+ export interface PromotionalEntitlementGrantResponse {
39
+ data: Array<PromotionalEntitlementGrantResponse.Data>;
40
+ }
41
+
42
+ export namespace PromotionalEntitlementGrantResponse {
43
+ /**
44
+ * Granted feature entitlement
45
+ */
46
+ export interface Data {
47
+ /**
48
+ * Unique identifier for the entity
49
+ */
50
+ id: string;
51
+
52
+ /**
53
+ * Timestamp of when the record was created
54
+ */
55
+ createdAt: string;
56
+
57
+ /**
58
+ * The description of the entitlement
59
+ */
60
+ description: string | null;
61
+
62
+ /**
63
+ * The end date of the promotional entitlement
64
+ */
65
+ endDate: string | null;
66
+
67
+ /**
68
+ * The enum values of the entitlement
69
+ */
70
+ enumValues: Array<string> | null;
71
+
72
+ /**
73
+ * The unique identifier for the environment
74
+ */
75
+ environmentId: string;
76
+
77
+ /**
78
+ * Feature group IDs associated with this entitlement
79
+ */
80
+ featureGroupIds: Array<string> | null;
81
+
82
+ /**
83
+ * The unique identifier of the entitlement feature
84
+ */
85
+ featureId: string;
86
+
87
+ /**
88
+ * Whether the entitlement has a soft limit
89
+ */
90
+ hasSoftLimit: boolean | null;
91
+
92
+ /**
93
+ * Whether the entitlement has an unlimited usage
94
+ */
95
+ hasUnlimitedUsage: boolean | null;
96
+
97
+ /**
98
+ * Whether the entitlement is visible
99
+ */
100
+ isVisible: boolean;
101
+
102
+ /**
103
+ * The grant period of the promotional entitlement
104
+ */
105
+ period: '1 week' | '1 month' | '6 month' | '1 year' | 'lifetime' | 'custom';
106
+
107
+ /**
108
+ * The reset period of the entitlement
109
+ */
110
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
111
+
112
+ /**
113
+ * The reset period configuration of the entitlement
114
+ */
115
+ resetPeriodConfiguration:
116
+ | Data.YearlyResetPeriodConfig
117
+ | Data.MonthlyResetPeriodConfig
118
+ | Data.WeeklyResetPeriodConfig
119
+ | null;
120
+
121
+ /**
122
+ * The start date of the entitlement
123
+ */
124
+ startDate: string;
125
+
126
+ /**
127
+ * The status of the entitlement
128
+ */
129
+ status: 'Active' | 'Expired' | 'Paused';
130
+
131
+ /**
132
+ * Timestamp of when the record was last updated
133
+ */
134
+ updatedAt: string;
135
+
136
+ /**
137
+ * The usage limit of the entitlement
138
+ */
139
+ usageLimit: number | null;
140
+ }
141
+
142
+ export namespace Data {
143
+ /**
144
+ * Yearly reset configuration
145
+ */
146
+ export interface YearlyResetPeriodConfig {
147
+ /**
148
+ * Reset anchor (SubscriptionStart)
149
+ */
150
+ accordingTo: 'SubscriptionStart';
151
+ }
152
+
153
+ /**
154
+ * Monthly reset configuration
155
+ */
156
+ export interface MonthlyResetPeriodConfig {
157
+ /**
158
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
159
+ */
160
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
161
+ }
162
+
163
+ /**
164
+ * Weekly reset configuration
165
+ */
166
+ export interface WeeklyResetPeriodConfig {
167
+ /**
168
+ * Reset anchor (SubscriptionStart or specific day)
169
+ */
170
+ accordingTo:
171
+ | 'SubscriptionStart'
172
+ | 'EverySunday'
173
+ | 'EveryMonday'
174
+ | 'EveryTuesday'
175
+ | 'EveryWednesday'
176
+ | 'EveryThursday'
177
+ | 'EveryFriday'
178
+ | 'EverySaturday';
179
+ }
180
+ }
181
+ }
182
+
183
+ /**
184
+ * Response object
185
+ */
186
+ export interface PromotionalEntitlementRevokeResponse {
187
+ /**
188
+ * Granted feature entitlement
189
+ */
190
+ data: PromotionalEntitlementRevokeResponse.Data;
191
+ }
192
+
193
+ export namespace PromotionalEntitlementRevokeResponse {
194
+ /**
195
+ * Granted feature entitlement
196
+ */
197
+ export interface Data {
198
+ /**
199
+ * Unique identifier for the entity
200
+ */
201
+ id: string;
202
+
203
+ /**
204
+ * Timestamp of when the record was created
205
+ */
206
+ createdAt: string;
207
+
208
+ /**
209
+ * The description of the entitlement
210
+ */
211
+ description: string | null;
212
+
213
+ /**
214
+ * The end date of the promotional entitlement
215
+ */
216
+ endDate: string | null;
217
+
218
+ /**
219
+ * The enum values of the entitlement
220
+ */
221
+ enumValues: Array<string> | null;
222
+
223
+ /**
224
+ * The unique identifier for the environment
225
+ */
226
+ environmentId: string;
227
+
228
+ /**
229
+ * Feature group IDs associated with this entitlement
230
+ */
231
+ featureGroupIds: Array<string> | null;
232
+
233
+ /**
234
+ * The unique identifier of the entitlement feature
235
+ */
236
+ featureId: string;
237
+
238
+ /**
239
+ * Whether the entitlement has a soft limit
240
+ */
241
+ hasSoftLimit: boolean | null;
242
+
243
+ /**
244
+ * Whether the entitlement has an unlimited usage
245
+ */
246
+ hasUnlimitedUsage: boolean | null;
247
+
248
+ /**
249
+ * Whether the entitlement is visible
250
+ */
251
+ isVisible: boolean;
252
+
253
+ /**
254
+ * The grant period of the promotional entitlement
255
+ */
256
+ period: '1 week' | '1 month' | '6 month' | '1 year' | 'lifetime' | 'custom';
257
+
258
+ /**
259
+ * The reset period of the entitlement
260
+ */
261
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
262
+
263
+ /**
264
+ * The reset period configuration of the entitlement
265
+ */
266
+ resetPeriodConfiguration:
267
+ | Data.YearlyResetPeriodConfig
268
+ | Data.MonthlyResetPeriodConfig
269
+ | Data.WeeklyResetPeriodConfig
270
+ | null;
271
+
272
+ /**
273
+ * The start date of the entitlement
274
+ */
275
+ startDate: string;
276
+
277
+ /**
278
+ * The status of the entitlement
279
+ */
280
+ status: 'Active' | 'Expired' | 'Paused';
281
+
282
+ /**
283
+ * Timestamp of when the record was last updated
284
+ */
285
+ updatedAt: string;
286
+
287
+ /**
288
+ * The usage limit of the entitlement
289
+ */
290
+ usageLimit: number | null;
291
+ }
292
+
293
+ export namespace Data {
294
+ /**
295
+ * Yearly reset configuration
296
+ */
297
+ export interface YearlyResetPeriodConfig {
298
+ /**
299
+ * Reset anchor (SubscriptionStart)
300
+ */
301
+ accordingTo: 'SubscriptionStart';
302
+ }
303
+
304
+ /**
305
+ * Monthly reset configuration
306
+ */
307
+ export interface MonthlyResetPeriodConfig {
308
+ /**
309
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
310
+ */
311
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
312
+ }
313
+
314
+ /**
315
+ * Weekly reset configuration
316
+ */
317
+ export interface WeeklyResetPeriodConfig {
318
+ /**
319
+ * Reset anchor (SubscriptionStart or specific day)
320
+ */
321
+ accordingTo:
322
+ | 'SubscriptionStart'
323
+ | 'EverySunday'
324
+ | 'EveryMonday'
325
+ | 'EveryTuesday'
326
+ | 'EveryWednesday'
327
+ | 'EveryThursday'
328
+ | 'EveryFriday'
329
+ | 'EverySaturday';
330
+ }
331
+ }
332
+ }
333
+
334
+ export interface PromotionalEntitlementGrantParams {
335
+ /**
336
+ * Promotional entitlements to grant
337
+ */
338
+ promotionalEntitlements: Array<PromotionalEntitlementGrantParams.PromotionalEntitlement>;
339
+ }
340
+
341
+ export namespace PromotionalEntitlementGrantParams {
342
+ /**
343
+ * Single entitlement grant config
344
+ */
345
+ export interface PromotionalEntitlement {
346
+ /**
347
+ * The custom end date of the promotional entitlement
348
+ */
349
+ customEndDate: string | null;
350
+
351
+ /**
352
+ * The enum values of the entitlement
353
+ */
354
+ enumValues: Array<string> | null;
355
+
356
+ /**
357
+ * The unique identifier of the entitlement feature
358
+ */
359
+ featureId: string;
360
+
361
+ /**
362
+ * Whether the entitlement has a soft limit
363
+ */
364
+ hasSoftLimit: boolean | null;
365
+
366
+ /**
367
+ * Whether the entitlement has an unlimited usage
368
+ */
369
+ hasUnlimitedUsage: boolean | null;
370
+
371
+ /**
372
+ * Whether the entitlement is visible
373
+ */
374
+ isVisible: boolean | null;
375
+
376
+ /**
377
+ * The monthly reset period configuration of the entitlement, defined when reset
378
+ * period is monthly
379
+ */
380
+ monthlyResetPeriodConfiguration: PromotionalEntitlement.MonthlyResetPeriodConfiguration | null;
381
+
382
+ /**
383
+ * The grant period of the promotional entitlement
384
+ */
385
+ period: '1 week' | '1 month' | '6 month' | '1 year' | 'lifetime' | 'custom';
386
+
387
+ /**
388
+ * The reset period of the entitlement
389
+ */
390
+ resetPeriod: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | null;
391
+
392
+ /**
393
+ * The usage limit of the entitlement
394
+ */
395
+ usageLimit: number | null;
396
+
397
+ /**
398
+ * The weekly reset period configuration of the entitlement, defined when reset
399
+ * period is weekly
400
+ */
401
+ weeklyResetPeriodConfiguration: PromotionalEntitlement.WeeklyResetPeriodConfiguration | null;
402
+
403
+ /**
404
+ * The yearly reset period configuration of the entitlement, defined when reset
405
+ * period is yearly
406
+ */
407
+ yearlyResetPeriodConfiguration: PromotionalEntitlement.YearlyResetPeriodConfiguration | null;
408
+ }
409
+
410
+ export namespace PromotionalEntitlement {
411
+ /**
412
+ * The monthly reset period configuration of the entitlement, defined when reset
413
+ * period is monthly
414
+ */
415
+ export interface MonthlyResetPeriodConfiguration {
416
+ /**
417
+ * Reset anchor (SubscriptionStart or StartOfTheMonth)
418
+ */
419
+ accordingTo: 'SubscriptionStart' | 'StartOfTheMonth';
420
+ }
421
+
422
+ /**
423
+ * The weekly reset period configuration of the entitlement, defined when reset
424
+ * period is weekly
425
+ */
426
+ export interface WeeklyResetPeriodConfiguration {
427
+ /**
428
+ * Reset anchor (SubscriptionStart or specific day)
429
+ */
430
+ accordingTo:
431
+ | 'SubscriptionStart'
432
+ | 'EverySunday'
433
+ | 'EveryMonday'
434
+ | 'EveryTuesday'
435
+ | 'EveryWednesday'
436
+ | 'EveryThursday'
437
+ | 'EveryFriday'
438
+ | 'EverySaturday';
439
+ }
440
+
441
+ /**
442
+ * The yearly reset period configuration of the entitlement, defined when reset
443
+ * period is yearly
444
+ */
445
+ export interface YearlyResetPeriodConfiguration {
446
+ /**
447
+ * Reset anchor (SubscriptionStart)
448
+ */
449
+ accordingTo: 'SubscriptionStart';
450
+ }
451
+ }
452
+ }
453
+
454
+ export interface PromotionalEntitlementRevokeParams {
455
+ /**
456
+ * The unique identifier of the customer
457
+ */
458
+ customerId: string;
459
+ }
460
+
461
+ export declare namespace PromotionalEntitlements {
462
+ export {
463
+ type PromotionalEntitlementGrantResponse as PromotionalEntitlementGrantResponse,
464
+ type PromotionalEntitlementRevokeResponse as PromotionalEntitlementRevokeResponse,
465
+ type PromotionalEntitlementGrantParams as PromotionalEntitlementGrantParams,
466
+ type PromotionalEntitlementRevokeParams as PromotionalEntitlementRevokeParams,
467
+ };
468
+ }
@@ -0,0 +1,74 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+
7
+ export class Events extends APIResource {
8
+ /**
9
+ * Reports raw usage events for event-based metering. Events are ingested
10
+ * asynchronously and aggregated into usage totals.
11
+ */
12
+ report(body: EventReportParams, options?: RequestOptions): APIPromise<EventReportResponse> {
13
+ return this._client.post('/api/v1/events', { body, ...options });
14
+ }
15
+ }
16
+
17
+ /**
18
+ * Response object
19
+ */
20
+ export interface EventReportResponse {
21
+ /**
22
+ * Empty success response confirming that events were successfully ingested and
23
+ * queued for processing by Stigg's metering system.
24
+ */
25
+ data: unknown;
26
+ }
27
+
28
+ export interface EventReportParams {
29
+ /**
30
+ * A list of usage events to report
31
+ */
32
+ events: Array<EventReportParams.Event>;
33
+ }
34
+
35
+ export namespace EventReportParams {
36
+ /**
37
+ * Raw usage event
38
+ */
39
+ export interface Event {
40
+ /**
41
+ * Customer id
42
+ */
43
+ customerId: string;
44
+
45
+ /**
46
+ * The name of the usage event
47
+ */
48
+ eventName: string;
49
+
50
+ /**
51
+ * Idempotency key
52
+ */
53
+ idempotencyKey: string;
54
+
55
+ /**
56
+ * Dimensions associated with the usage event
57
+ */
58
+ dimensions?: { [key: string]: string | number | boolean };
59
+
60
+ /**
61
+ * Resource id
62
+ */
63
+ resourceId?: string | null;
64
+
65
+ /**
66
+ * Timestamp
67
+ */
68
+ timestamp?: string;
69
+ }
70
+ }
71
+
72
+ export declare namespace Events {
73
+ export { type EventReportResponse as EventReportResponse, type EventReportParams as EventReportParams };
74
+ }
@@ -2,8 +2,7 @@
2
2
 
3
3
  export {
4
4
  Coupons,
5
- type CouponCreateResponse,
6
- type CouponRetrieveResponse,
5
+ type Coupon,
7
6
  type CouponListResponse,
8
7
  type CouponCreateParams,
9
8
  type CouponListParams,
@@ -13,32 +12,46 @@ export {
13
12
  Customers,
14
13
  type CustomerResponse,
15
14
  type CustomerListResponse,
16
- type CustomerCreateParams,
15
+ type CustomerImportResponse,
16
+ type CustomerListResourcesResponse,
17
17
  type CustomerUpdateParams,
18
18
  type CustomerListParams,
19
+ type CustomerImportParams,
20
+ type CustomerListResourcesParams,
21
+ type CustomerProvisionParams,
19
22
  type CustomerListResponsesMyCursorIDPage,
23
+ type CustomerListResourcesResponsesMyCursorIDPage,
20
24
  } from './customers/index';
25
+ export { Events, type EventReportResponse, type EventReportParams } from './events';
26
+ export {
27
+ Products,
28
+ type ProductListProductsResponse,
29
+ type ProductListProductsParams,
30
+ type ProductListProductsResponsesMyCursorIDPage,
31
+ } from './products';
21
32
  export {
22
33
  Subscriptions,
23
- type SubscriptionCreateResponse,
24
- type SubscriptionRetrieveResponse,
34
+ type Subscription,
25
35
  type SubscriptionListResponse,
26
- type SubscriptionDelegateResponse,
27
- type SubscriptionMigrateResponse,
36
+ type SubscriptionImportResponse,
28
37
  type SubscriptionPreviewResponse,
29
- type SubscriptionTransferResponse,
30
- type SubscriptionCreateParams,
38
+ type SubscriptionProvisionResponse,
39
+ type SubscriptionUpdateParams,
31
40
  type SubscriptionListParams,
41
+ type SubscriptionCancelParams,
32
42
  type SubscriptionDelegateParams,
43
+ type SubscriptionImportParams,
33
44
  type SubscriptionMigrateParams,
34
45
  type SubscriptionPreviewParams,
46
+ type SubscriptionProvisionParams,
35
47
  type SubscriptionTransferParams,
36
48
  type SubscriptionListResponsesMyCursorIDPage,
37
49
  } from './subscriptions/index';
38
50
  export {
39
- V1,
40
- type V1CreateEventResponse,
41
- type V1CreateUsageResponse,
42
- type V1CreateEventParams,
43
- type V1CreateUsageParams,
44
- } from './v1';
51
+ Usage,
52
+ type UsageHistoryResponse,
53
+ type UsageReportResponse,
54
+ type UsageHistoryParams,
55
+ type UsageReportParams,
56
+ } from './usage';
57
+ export { V1 } from './v1';