@bpinternal/const 0.3.9 → 0.4.1

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/dist/index.d.ts CHANGED
@@ -6,6 +6,9 @@ export * from './tags';
6
6
  export * from './workflow-names';
7
7
  export * from './cancellation-reasons';
8
8
  export * from './billing-features';
9
- export * from './billing-products';
9
+ export * from './billing-plans';
10
10
  export * from './billing-versions';
11
+ export * from './billing-addons';
11
12
  export * from './usage-metadata';
13
+ export * from './schema';
14
+ export * from './types';
package/dist/index.js CHANGED
@@ -23,6 +23,9 @@ __exportStar(require("./workflow-names"), exports);
23
23
  __exportStar(require("./cancellation-reasons"), exports);
24
24
  // V4 Billing Constants
25
25
  __exportStar(require("./billing-features"), exports);
26
- __exportStar(require("./billing-products"), exports);
26
+ __exportStar(require("./billing-plans"), exports);
27
27
  __exportStar(require("./billing-versions"), exports);
28
+ __exportStar(require("./billing-addons"), exports);
28
29
  __exportStar(require("./usage-metadata"), exports);
30
+ __exportStar(require("./schema"), exports);
31
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,523 @@
1
+ import { z } from 'zod';
2
+ export declare const intervalSchema: z.ZodEnum<["month", "year"]>;
3
+ export declare const priceSchema: z.ZodObject<{
4
+ providerPriceId: z.ZodString;
5
+ amount: z.ZodNumber;
6
+ currency: z.ZodEnum<["usd"]>;
7
+ interval: z.ZodEnum<["month", "year"]>;
8
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ providerPriceId: string;
11
+ amount: number;
12
+ currency: "usd";
13
+ interval: "month" | "year";
14
+ metadata?: Record<string, string> | undefined;
15
+ }, {
16
+ providerPriceId: string;
17
+ amount: number;
18
+ currency: "usd";
19
+ interval: "month" | "year";
20
+ metadata?: Record<string, string> | undefined;
21
+ }>;
22
+ export declare const featureSchema: z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>;
23
+ export declare const planSchema: z.ZodObject<{
24
+ id: z.ZodString;
25
+ name: z.ZodString;
26
+ description: z.ZodString;
27
+ providerProductId: z.ZodString;
28
+ prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
29
+ providerPriceId: z.ZodString;
30
+ amount: z.ZodNumber;
31
+ currency: z.ZodEnum<["usd"]>;
32
+ interval: z.ZodEnum<["month", "year"]>;
33
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ providerPriceId: string;
36
+ amount: number;
37
+ currency: "usd";
38
+ interval: "month" | "year";
39
+ metadata?: Record<string, string> | undefined;
40
+ }, {
41
+ providerPriceId: string;
42
+ amount: number;
43
+ currency: "usd";
44
+ interval: "month" | "year";
45
+ metadata?: Record<string, string> | undefined;
46
+ }>>;
47
+ features: z.ZodRecord<z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>, z.ZodAny>;
48
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ id: string;
51
+ name: string;
52
+ description: string;
53
+ providerProductId: string;
54
+ prices: Partial<Record<"month" | "year", {
55
+ providerPriceId: string;
56
+ amount: number;
57
+ currency: "usd";
58
+ interval: "month" | "year";
59
+ metadata?: Record<string, string> | undefined;
60
+ }>>;
61
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
62
+ metadata?: Record<string, string> | undefined;
63
+ }, {
64
+ id: string;
65
+ name: string;
66
+ description: string;
67
+ providerProductId: string;
68
+ prices: Partial<Record<"month" | "year", {
69
+ providerPriceId: string;
70
+ amount: number;
71
+ currency: "usd";
72
+ interval: "month" | "year";
73
+ metadata?: Record<string, string> | undefined;
74
+ }>>;
75
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
76
+ metadata?: Record<string, string> | undefined;
77
+ }>;
78
+ export declare const addOnSchema: z.ZodObject<{
79
+ id: z.ZodString;
80
+ name: z.ZodString;
81
+ description: z.ZodString;
82
+ providerProductId: z.ZodString;
83
+ prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
84
+ providerPriceId: z.ZodString;
85
+ amount: z.ZodNumber;
86
+ currency: z.ZodEnum<["usd"]>;
87
+ interval: z.ZodEnum<["month", "year"]>;
88
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ providerPriceId: string;
91
+ amount: number;
92
+ currency: "usd";
93
+ interval: "month" | "year";
94
+ metadata?: Record<string, string> | undefined;
95
+ }, {
96
+ providerPriceId: string;
97
+ amount: number;
98
+ currency: "usd";
99
+ interval: "month" | "year";
100
+ metadata?: Record<string, string> | undefined;
101
+ }>>;
102
+ feature: z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>;
103
+ increment: z.ZodNumber;
104
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ id: string;
107
+ name: string;
108
+ description: string;
109
+ providerProductId: string;
110
+ prices: Partial<Record<"month" | "year", {
111
+ providerPriceId: string;
112
+ amount: number;
113
+ currency: "usd";
114
+ interval: "month" | "year";
115
+ metadata?: Record<string, string> | undefined;
116
+ }>>;
117
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
118
+ increment: number;
119
+ metadata?: Record<string, string> | undefined;
120
+ }, {
121
+ id: string;
122
+ name: string;
123
+ description: string;
124
+ providerProductId: string;
125
+ prices: Partial<Record<"month" | "year", {
126
+ providerPriceId: string;
127
+ amount: number;
128
+ currency: "usd";
129
+ interval: "month" | "year";
130
+ metadata?: Record<string, string> | undefined;
131
+ }>>;
132
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
133
+ increment: number;
134
+ metadata?: Record<string, string> | undefined;
135
+ }>;
136
+ export declare const billingVersionConfigSchema: z.ZodObject<{
137
+ version: z.ZodEnum<["v4"]>;
138
+ name: z.ZodString;
139
+ description: z.ZodString;
140
+ plans: z.ZodRecord<z.ZodString, z.ZodObject<{
141
+ id: z.ZodString;
142
+ name: z.ZodString;
143
+ description: z.ZodString;
144
+ providerProductId: z.ZodString;
145
+ prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
146
+ providerPriceId: z.ZodString;
147
+ amount: z.ZodNumber;
148
+ currency: z.ZodEnum<["usd"]>;
149
+ interval: z.ZodEnum<["month", "year"]>;
150
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ providerPriceId: string;
153
+ amount: number;
154
+ currency: "usd";
155
+ interval: "month" | "year";
156
+ metadata?: Record<string, string> | undefined;
157
+ }, {
158
+ providerPriceId: string;
159
+ amount: number;
160
+ currency: "usd";
161
+ interval: "month" | "year";
162
+ metadata?: Record<string, string> | undefined;
163
+ }>>;
164
+ features: z.ZodRecord<z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>, z.ZodAny>;
165
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ id: string;
168
+ name: string;
169
+ description: string;
170
+ providerProductId: string;
171
+ prices: Partial<Record<"month" | "year", {
172
+ providerPriceId: string;
173
+ amount: number;
174
+ currency: "usd";
175
+ interval: "month" | "year";
176
+ metadata?: Record<string, string> | undefined;
177
+ }>>;
178
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
179
+ metadata?: Record<string, string> | undefined;
180
+ }, {
181
+ id: string;
182
+ name: string;
183
+ description: string;
184
+ providerProductId: string;
185
+ prices: Partial<Record<"month" | "year", {
186
+ providerPriceId: string;
187
+ amount: number;
188
+ currency: "usd";
189
+ interval: "month" | "year";
190
+ metadata?: Record<string, string> | undefined;
191
+ }>>;
192
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
193
+ metadata?: Record<string, string> | undefined;
194
+ }>>;
195
+ addons: z.ZodRecord<z.ZodString, z.ZodObject<{
196
+ id: z.ZodString;
197
+ name: z.ZodString;
198
+ description: z.ZodString;
199
+ providerProductId: z.ZodString;
200
+ prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
201
+ providerPriceId: z.ZodString;
202
+ amount: z.ZodNumber;
203
+ currency: z.ZodEnum<["usd"]>;
204
+ interval: z.ZodEnum<["month", "year"]>;
205
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
206
+ }, "strip", z.ZodTypeAny, {
207
+ providerPriceId: string;
208
+ amount: number;
209
+ currency: "usd";
210
+ interval: "month" | "year";
211
+ metadata?: Record<string, string> | undefined;
212
+ }, {
213
+ providerPriceId: string;
214
+ amount: number;
215
+ currency: "usd";
216
+ interval: "month" | "year";
217
+ metadata?: Record<string, string> | undefined;
218
+ }>>;
219
+ feature: z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>;
220
+ increment: z.ZodNumber;
221
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
222
+ }, "strip", z.ZodTypeAny, {
223
+ id: string;
224
+ name: string;
225
+ description: string;
226
+ providerProductId: string;
227
+ prices: Partial<Record<"month" | "year", {
228
+ providerPriceId: string;
229
+ amount: number;
230
+ currency: "usd";
231
+ interval: "month" | "year";
232
+ metadata?: Record<string, string> | undefined;
233
+ }>>;
234
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
235
+ increment: number;
236
+ metadata?: Record<string, string> | undefined;
237
+ }, {
238
+ id: string;
239
+ name: string;
240
+ description: string;
241
+ providerProductId: string;
242
+ prices: Partial<Record<"month" | "year", {
243
+ providerPriceId: string;
244
+ amount: number;
245
+ currency: "usd";
246
+ interval: "month" | "year";
247
+ metadata?: Record<string, string> | undefined;
248
+ }>>;
249
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
250
+ increment: number;
251
+ metadata?: Record<string, string> | undefined;
252
+ }>>;
253
+ isActive: z.ZodBoolean;
254
+ createdAt: z.ZodString;
255
+ }, "strip", z.ZodTypeAny, {
256
+ name: string;
257
+ description: string;
258
+ version: "v4";
259
+ plans: Record<string, {
260
+ id: string;
261
+ name: string;
262
+ description: string;
263
+ providerProductId: string;
264
+ prices: Partial<Record<"month" | "year", {
265
+ providerPriceId: string;
266
+ amount: number;
267
+ currency: "usd";
268
+ interval: "month" | "year";
269
+ metadata?: Record<string, string> | undefined;
270
+ }>>;
271
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
272
+ metadata?: Record<string, string> | undefined;
273
+ }>;
274
+ addons: Record<string, {
275
+ id: string;
276
+ name: string;
277
+ description: string;
278
+ providerProductId: string;
279
+ prices: Partial<Record<"month" | "year", {
280
+ providerPriceId: string;
281
+ amount: number;
282
+ currency: "usd";
283
+ interval: "month" | "year";
284
+ metadata?: Record<string, string> | undefined;
285
+ }>>;
286
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
287
+ increment: number;
288
+ metadata?: Record<string, string> | undefined;
289
+ }>;
290
+ isActive: boolean;
291
+ createdAt: string;
292
+ }, {
293
+ name: string;
294
+ description: string;
295
+ version: "v4";
296
+ plans: Record<string, {
297
+ id: string;
298
+ name: string;
299
+ description: string;
300
+ providerProductId: string;
301
+ prices: Partial<Record<"month" | "year", {
302
+ providerPriceId: string;
303
+ amount: number;
304
+ currency: "usd";
305
+ interval: "month" | "year";
306
+ metadata?: Record<string, string> | undefined;
307
+ }>>;
308
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
309
+ metadata?: Record<string, string> | undefined;
310
+ }>;
311
+ addons: Record<string, {
312
+ id: string;
313
+ name: string;
314
+ description: string;
315
+ providerProductId: string;
316
+ prices: Partial<Record<"month" | "year", {
317
+ providerPriceId: string;
318
+ amount: number;
319
+ currency: "usd";
320
+ interval: "month" | "year";
321
+ metadata?: Record<string, string> | undefined;
322
+ }>>;
323
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
324
+ increment: number;
325
+ metadata?: Record<string, string> | undefined;
326
+ }>;
327
+ isActive: boolean;
328
+ createdAt: string;
329
+ }>;
330
+ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodObject<{
331
+ version: z.ZodEnum<["v4"]>;
332
+ name: z.ZodString;
333
+ description: z.ZodString;
334
+ plans: z.ZodRecord<z.ZodString, z.ZodObject<{
335
+ id: z.ZodString;
336
+ name: z.ZodString;
337
+ description: z.ZodString;
338
+ providerProductId: z.ZodString;
339
+ prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
340
+ providerPriceId: z.ZodString;
341
+ amount: z.ZodNumber;
342
+ currency: z.ZodEnum<["usd"]>;
343
+ interval: z.ZodEnum<["month", "year"]>;
344
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
345
+ }, "strip", z.ZodTypeAny, {
346
+ providerPriceId: string;
347
+ amount: number;
348
+ currency: "usd";
349
+ interval: "month" | "year";
350
+ metadata?: Record<string, string> | undefined;
351
+ }, {
352
+ providerPriceId: string;
353
+ amount: number;
354
+ currency: "usd";
355
+ interval: "month" | "year";
356
+ metadata?: Record<string, string> | undefined;
357
+ }>>;
358
+ features: z.ZodRecord<z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>, z.ZodAny>;
359
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
360
+ }, "strip", z.ZodTypeAny, {
361
+ id: string;
362
+ name: string;
363
+ description: string;
364
+ providerProductId: string;
365
+ prices: Partial<Record<"month" | "year", {
366
+ providerPriceId: string;
367
+ amount: number;
368
+ currency: "usd";
369
+ interval: "month" | "year";
370
+ metadata?: Record<string, string> | undefined;
371
+ }>>;
372
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
373
+ metadata?: Record<string, string> | undefined;
374
+ }, {
375
+ id: string;
376
+ name: string;
377
+ description: string;
378
+ providerProductId: string;
379
+ prices: Partial<Record<"month" | "year", {
380
+ providerPriceId: string;
381
+ amount: number;
382
+ currency: "usd";
383
+ interval: "month" | "year";
384
+ metadata?: Record<string, string> | undefined;
385
+ }>>;
386
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
387
+ metadata?: Record<string, string> | undefined;
388
+ }>>;
389
+ addons: z.ZodRecord<z.ZodString, z.ZodObject<{
390
+ id: z.ZodString;
391
+ name: z.ZodString;
392
+ description: z.ZodString;
393
+ providerProductId: z.ZodString;
394
+ prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
395
+ providerPriceId: z.ZodString;
396
+ amount: z.ZodNumber;
397
+ currency: z.ZodEnum<["usd"]>;
398
+ interval: z.ZodEnum<["month", "year"]>;
399
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ providerPriceId: string;
402
+ amount: number;
403
+ currency: "usd";
404
+ interval: "month" | "year";
405
+ metadata?: Record<string, string> | undefined;
406
+ }, {
407
+ providerPriceId: string;
408
+ amount: number;
409
+ currency: "usd";
410
+ interval: "month" | "year";
411
+ metadata?: Record<string, string> | undefined;
412
+ }>>;
413
+ feature: z.ZodEnum<["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"]>;
414
+ increment: z.ZodNumber;
415
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
416
+ }, "strip", z.ZodTypeAny, {
417
+ id: string;
418
+ name: string;
419
+ description: string;
420
+ providerProductId: string;
421
+ prices: Partial<Record<"month" | "year", {
422
+ providerPriceId: string;
423
+ amount: number;
424
+ currency: "usd";
425
+ interval: "month" | "year";
426
+ metadata?: Record<string, string> | undefined;
427
+ }>>;
428
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
429
+ increment: number;
430
+ metadata?: Record<string, string> | undefined;
431
+ }, {
432
+ id: string;
433
+ name: string;
434
+ description: string;
435
+ providerProductId: string;
436
+ prices: Partial<Record<"month" | "year", {
437
+ providerPriceId: string;
438
+ amount: number;
439
+ currency: "usd";
440
+ interval: "month" | "year";
441
+ metadata?: Record<string, string> | undefined;
442
+ }>>;
443
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
444
+ increment: number;
445
+ metadata?: Record<string, string> | undefined;
446
+ }>>;
447
+ isActive: z.ZodBoolean;
448
+ createdAt: z.ZodString;
449
+ }, "strip", z.ZodTypeAny, {
450
+ name: string;
451
+ description: string;
452
+ version: "v4";
453
+ plans: Record<string, {
454
+ id: string;
455
+ name: string;
456
+ description: string;
457
+ providerProductId: string;
458
+ prices: Partial<Record<"month" | "year", {
459
+ providerPriceId: string;
460
+ amount: number;
461
+ currency: "usd";
462
+ interval: "month" | "year";
463
+ metadata?: Record<string, string> | undefined;
464
+ }>>;
465
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
466
+ metadata?: Record<string, string> | undefined;
467
+ }>;
468
+ addons: Record<string, {
469
+ id: string;
470
+ name: string;
471
+ description: string;
472
+ providerProductId: string;
473
+ prices: Partial<Record<"month" | "year", {
474
+ providerPriceId: string;
475
+ amount: number;
476
+ currency: "usd";
477
+ interval: "month" | "year";
478
+ metadata?: Record<string, string> | undefined;
479
+ }>>;
480
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
481
+ increment: number;
482
+ metadata?: Record<string, string> | undefined;
483
+ }>;
484
+ isActive: boolean;
485
+ createdAt: string;
486
+ }, {
487
+ name: string;
488
+ description: string;
489
+ version: "v4";
490
+ plans: Record<string, {
491
+ id: string;
492
+ name: string;
493
+ description: string;
494
+ providerProductId: string;
495
+ prices: Partial<Record<"month" | "year", {
496
+ providerPriceId: string;
497
+ amount: number;
498
+ currency: "usd";
499
+ interval: "month" | "year";
500
+ metadata?: Record<string, string> | undefined;
501
+ }>>;
502
+ features: Partial<Record<"human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions", any>>;
503
+ metadata?: Record<string, string> | undefined;
504
+ }>;
505
+ addons: Record<string, {
506
+ id: string;
507
+ name: string;
508
+ description: string;
509
+ providerProductId: string;
510
+ prices: Partial<Record<"month" | "year", {
511
+ providerPriceId: string;
512
+ amount: number;
513
+ currency: "usd";
514
+ interval: "month" | "year";
515
+ metadata?: Record<string, string> | undefined;
516
+ }>>;
517
+ feature: "human_in_the_loop" | "ratelimit" | "incoming_messages_events" | "integration_spend" | "integration_subscription" | "table_rows" | "bot_count" | "always_alive_count" | "always_alive_concurrency" | "collaborator_count" | "file_storage" | "vector_db_storage" | "saved_versions";
518
+ increment: number;
519
+ metadata?: Record<string, string> | undefined;
520
+ }>;
521
+ isActive: boolean;
522
+ createdAt: string;
523
+ }>>;
package/dist/schema.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingConfigSchema = exports.billingVersionConfigSchema = exports.addOnSchema = exports.planSchema = exports.featureSchema = exports.priceSchema = exports.intervalSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const billing_versions_1 = require("./billing-versions");
6
+ const billing_features_1 = require("./billing-features");
7
+ exports.intervalSchema = zod_1.z.enum(['month', 'year']);
8
+ exports.priceSchema = zod_1.z.object({
9
+ providerPriceId: zod_1.z.string(),
10
+ amount: zod_1.z.number(),
11
+ currency: zod_1.z.enum(['usd']),
12
+ interval: exports.intervalSchema,
13
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
14
+ });
15
+ exports.featureSchema = zod_1.z.enum(billing_features_1.BILLING_FEATURE_IDS);
16
+ exports.planSchema = zod_1.z.object({
17
+ id: zod_1.z.string(),
18
+ name: zod_1.z.string(),
19
+ description: zod_1.z.string(),
20
+ providerProductId: zod_1.z.string(),
21
+ prices: zod_1.z.record(exports.intervalSchema, exports.priceSchema),
22
+ features: zod_1.z.record(exports.featureSchema, zod_1.z.any()),
23
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
24
+ });
25
+ exports.addOnSchema = zod_1.z.object({
26
+ id: zod_1.z.string(),
27
+ name: zod_1.z.string(),
28
+ description: zod_1.z.string(),
29
+ providerProductId: zod_1.z.string(),
30
+ prices: zod_1.z.record(exports.intervalSchema, exports.priceSchema),
31
+ feature: exports.featureSchema,
32
+ increment: zod_1.z.number(),
33
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
34
+ });
35
+ exports.billingVersionConfigSchema = zod_1.z.object({
36
+ version: zod_1.z.enum(billing_versions_1.BILLING_VERSIONS),
37
+ name: zod_1.z.string(),
38
+ description: zod_1.z.string(),
39
+ plans: zod_1.z.record(zod_1.z.string(), exports.planSchema),
40
+ addons: zod_1.z.record(zod_1.z.string(), exports.addOnSchema),
41
+ isActive: zod_1.z.boolean(),
42
+ createdAt: zod_1.z.string(),
43
+ });
44
+ exports.billingConfigSchema = zod_1.z.record(zod_1.z.enum(billing_versions_1.BILLING_VERSIONS), exports.billingVersionConfigSchema);
@@ -0,0 +1,55 @@
1
+ import { BILLING_FEATURE_IDS } from './billing-features';
2
+ import { BILLING_PLAN_IDS, BILLING_ADDON_IDS } from './billing-plans';
3
+ import { BILLING_VERSIONS } from './billing-versions';
4
+ import { billingVersionConfigSchema, billingConfigSchema, intervalSchema, priceSchema, planSchema, addOnSchema } from './schema';
5
+ import { z } from 'zod';
6
+ export type Interval = z.infer<typeof intervalSchema>;
7
+ export type BillingFeatureId = (typeof BILLING_FEATURE_IDS)[number];
8
+ export type BillingAddonId = (typeof BILLING_ADDON_IDS)[number];
9
+ export type BillingPlanId = (typeof BILLING_PLAN_IDS)[number];
10
+ export type BillingFeatureDefinition = {
11
+ name: string;
12
+ description: string;
13
+ type: 'boolean' | 'static' | 'usage' | 'subscription';
14
+ resetPeriod?: 'monthly' | 'yearly' | 'never';
15
+ dimensions?: Record<string, string>;
16
+ metadata?: Record<string, string>;
17
+ };
18
+ export type BillingPriceDefinition = {
19
+ price: number;
20
+ currency: 'usd';
21
+ interval: Interval;
22
+ };
23
+ export type BillingPlanDefinition = {
24
+ id: BillingPlanId;
25
+ name: string;
26
+ description: string;
27
+ prices: Array<BillingPriceDefinition>;
28
+ features: Partial<Record<BillingFeatureId, number | boolean>>;
29
+ metadata?: Record<string, string>;
30
+ };
31
+ export type BillingAddonDefinition = {
32
+ id: BillingAddonId;
33
+ name: string;
34
+ description: string;
35
+ prices: Array<BillingPriceDefinition>;
36
+ feature: BillingFeatureId;
37
+ increment: number;
38
+ metadata?: Record<string, string>;
39
+ };
40
+ export type BillingVersionId = (typeof BILLING_VERSIONS)[number];
41
+ export type BillingVersionDefinition = {
42
+ version: BillingVersionId;
43
+ name: string;
44
+ description: string;
45
+ plans: Partial<Record<BillingPlanId, BillingPlanDefinition>>;
46
+ addons: Partial<Record<BillingAddonId, BillingAddonDefinition>>;
47
+ isActive: boolean;
48
+ createdAt: string;
49
+ };
50
+ export type BillingDefinition = Record<BillingVersionId, BillingVersionDefinition>;
51
+ export type BillingVersionConfig = z.infer<typeof billingVersionConfigSchema>;
52
+ export type BillingConfig = z.infer<typeof billingConfigSchema>;
53
+ export type BillingPrice = z.infer<typeof priceSchema>;
54
+ export type BillingPlan = z.infer<typeof planSchema>;
55
+ export type BillingAddon = z.infer<typeof addOnSchema>;
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });