@bpinternal/const 0.17.0 → 0.19.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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.billingConfigSchema = exports.billingVersionConfigSchema = exports.meterSchema = exports.addOnSchema = exports.planSchema = exports.meteredPriceSchema = exports.priceSchema = exports.meterTypeSchema = exports.aggregationSchema = exports.unitAmountSchema = exports.intervalSchema = exports.featureSchema = exports.UNKNOWN_STRIPE_ID = void 0;
3
+ exports.billingConfigSchema = exports.billingVersionConfigSchema = exports.meterSchema = exports.addOnSchema = exports.addonPlanPricesSchema = exports.planSchema = exports.meteredPriceSchema = exports.priceSchema = exports.meterTypeSchema = exports.aggregationSchema = exports.unitAmountSchema = exports.intervalSchema = exports.featureSchema = exports.UNKNOWN_STRIPE_ID = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const features_1 = require("../features");
6
6
  /**
@@ -37,32 +37,21 @@ exports.planSchema = zod_1.z.object({
37
37
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
38
38
  providerProductId: zod_1.z.string(), // pulumi
39
39
  });
40
- exports.addOnSchema = zod_1.z
41
- .object({
40
+ exports.addonPlanPricesSchema = zod_1.z.object({
41
+ month: exports.priceSchema,
42
+ year: exports.priceSchema.optional(),
43
+ });
44
+ exports.addOnSchema = zod_1.z.object({
42
45
  id: zod_1.z.string(),
43
46
  name: zod_1.z.string(),
44
47
  description: zod_1.z.string(),
45
- prices: zod_1.z.record(exports.intervalSchema, exports.priceSchema),
46
- feature: exports.featureSchema,
47
- increment: zod_1.z.number().positive(),
48
- increments: zod_1.z.record(exports.featureSchema, zod_1.z.number().positive()).optional(),
48
+ prices: zod_1.z.record(zod_1.z.string(), exports.addonPlanPricesSchema),
49
+ increments: zod_1.z.record(exports.featureSchema, zod_1.z.number().positive()),
49
50
  prorationDisabled: zod_1.z.boolean().optional(),
50
51
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
51
52
  autoRechargeable: zod_1.z.boolean().optional(),
52
53
  hidden: zod_1.z.boolean().optional(),
53
54
  providerProductId: zod_1.z.string(), // pulumi
54
- })
55
- .superRefine((data, ctx) => {
56
- if (!data.increments) {
57
- return;
58
- }
59
- if (data.increments[data.feature] !== data.increment) {
60
- ctx.addIssue({
61
- code: zod_1.z.ZodIssueCode.custom,
62
- message: 'addon increments must include the legacy feature with the same increment',
63
- path: ['increments', data.feature],
64
- });
65
- }
66
55
  });
67
56
  exports.meterSchema = zod_1.z.object({
68
57
  id: zod_1.z.string(),
@@ -154,186 +154,59 @@ export declare const billingConfig: {
154
154
  };
155
155
  };
156
156
  readonly addons: {
157
- readonly bot_addon: {
158
- readonly id: "bot_addon";
159
- readonly name: "Add-on - Bot";
160
- readonly description: "Add one more bot to your workspace";
161
- readonly prices: {
162
- readonly month: {
163
- readonly amount: 10;
164
- readonly currency: "usd";
165
- readonly interval: "month";
166
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
167
- };
168
- };
169
- readonly feature: "bot_count";
170
- readonly increment: 1;
171
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
172
- };
173
- readonly collaborator_addon: {
174
- readonly id: "collaborator_addon";
175
- readonly name: "Add-on - Collaborators";
176
- readonly description: "Add one more collaborator to your workspace";
177
- readonly prices: {
178
- readonly month: {
179
- readonly amount: 25;
180
- readonly currency: "usd";
181
- readonly interval: "month";
182
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
183
- };
184
- };
185
- readonly feature: "collaborator_count";
186
- readonly increment: 1;
187
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
188
- };
189
- readonly messages_events_addon: {
190
- readonly id: "messages_events_addon";
191
- readonly name: "Add-on - Messages & Events";
192
- readonly description: "Adds 5,000 messages and events";
193
- readonly prorationDisabled: true;
194
- readonly prices: {
195
- readonly month: {
196
- readonly amount: 20;
197
- readonly currency: "usd";
198
- readonly interval: "month";
199
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
200
- };
201
- };
202
- readonly feature: "incoming_messages_events";
203
- readonly increment: 5000;
204
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
205
- };
206
- readonly table_rows_addon: {
207
- readonly id: "table_rows_addon";
208
- readonly name: "Add-on - Table Rows";
209
- readonly description: "Adds 100,000 additional table rows";
210
- readonly prices: {
211
- readonly month: {
212
- readonly amount: 25;
213
- readonly currency: "usd";
214
- readonly interval: "month";
215
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
216
- };
217
- };
218
- readonly feature: "table_rows";
219
- readonly increment: 100000;
220
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
221
- };
222
- readonly file_storage_addon: {
223
- readonly id: "file_storage_addon";
224
- readonly name: "Add-on - File Storage";
225
- readonly description: "Adds 10GB of File Storage";
226
- readonly prices: {
227
- readonly month: {
228
- readonly amount: 10;
229
- readonly currency: "usd";
230
- readonly interval: "month";
231
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
232
- };
233
- };
234
- readonly feature: "file_storage";
235
- readonly increment: 10000000000;
236
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
237
- };
238
- readonly vector_db_storage_addon: {
239
- readonly id: "vector_db_storage_addon";
240
- readonly name: "Add-on - Vector DB Storage";
241
- readonly description: "Add 1 GB of vector database storage";
242
- readonly prices: {
243
- readonly month: {
244
- readonly amount: 20;
245
- readonly currency: "usd";
246
- readonly interval: "month";
247
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
248
- };
249
- };
250
- readonly feature: "vector_db_storage";
251
- readonly increment: 1000000000;
252
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
253
- };
254
- readonly web_search_addon: {
255
- readonly id: "web_search_addon";
256
- readonly name: "Web Search and Crawl";
257
- readonly description: "Web search and crawl functionality";
258
- readonly prices: {
259
- readonly month: {
260
- readonly amount: 10;
261
- readonly currency: "usd";
262
- readonly interval: "month";
263
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
264
- };
265
- };
266
- readonly feature: "integration_spend";
267
- readonly increment: 10000000000;
268
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
269
- };
270
- readonly ai_credits_addon: {
271
- readonly id: "ai_credits_addon";
272
- readonly name: "AI Tokens";
273
- readonly description: "Add $25 worth of AI credits";
274
- readonly prices: {
275
- readonly month: {
276
- readonly amount: 25;
277
- readonly currency: "usd";
278
- readonly interval: "month";
279
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
280
- };
281
- };
282
- readonly feature: "integration_spend";
283
- readonly increment: 25000000000;
284
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
285
- };
286
- readonly enterprise_ai_token: {
287
- readonly id: "enterprise_ai_token";
288
- readonly name: "Enterprise - AI Token";
289
- readonly description: "Enterprise AI token credits";
290
- readonly prices: {
291
- readonly month: {
292
- readonly amount: -1;
293
- readonly currency: "usd";
294
- readonly interval: "month";
295
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
296
- };
297
- };
298
- readonly feature: "integration_spend";
299
- readonly increment: 100000000000;
300
- readonly hidden: true;
301
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
302
- };
303
- readonly enterprise_additional_workspace: {
304
- readonly id: "enterprise_additional_workspace";
305
- readonly name: "Enterprise - Additional Workspace";
306
- readonly description: "Enterprise additional workspace";
307
- readonly prices: {
308
- readonly month: {
309
- readonly amount: -1;
310
- readonly currency: "usd";
311
- readonly interval: "month";
312
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
313
- };
314
- };
315
- readonly feature: "collaborator_count";
316
- readonly increment: 10;
317
- readonly hidden: true;
318
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
319
- };
320
157
  readonly conversation_sessions_addon: {
321
158
  readonly id: "conversation_sessions_addon";
322
159
  readonly name: "Add-on - Conversation Sessions";
323
160
  readonly description: "Adds 500 conversations sessions per month";
324
- readonly prices: {
325
- readonly month: {
326
- readonly amount: 20;
327
- readonly currency: "usd";
328
- readonly interval: "month";
329
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
330
- };
161
+ readonly prices: Record<string, {
162
+ month: {
163
+ amount: number;
164
+ currency: "usd";
165
+ interval: "month" | "year";
166
+ providerPriceId: string;
167
+ metadata?: Record<string, string> | undefined;
168
+ };
169
+ year?: {
170
+ amount: number;
171
+ currency: "usd";
172
+ interval: "month" | "year";
173
+ providerPriceId: string;
174
+ metadata?: Record<string, string> | undefined;
175
+ } | undefined;
176
+ }>;
177
+ readonly increments: {
178
+ readonly conversation_sessions: 500;
331
179
  };
332
- readonly feature: "conversation_sessions";
333
- readonly increment: 500;
334
180
  readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
335
181
  readonly autoRechargeable: true;
336
182
  };
183
+ readonly storage_addon: {
184
+ readonly id: "storage_addon";
185
+ readonly name: "Add-on - Storage";
186
+ readonly description: "Adds table rows, vector db space and files";
187
+ readonly prices: Record<string, {
188
+ month: {
189
+ amount: number;
190
+ currency: "usd";
191
+ interval: "month" | "year";
192
+ providerPriceId: string;
193
+ metadata?: Record<string, string> | undefined;
194
+ };
195
+ year?: {
196
+ amount: number;
197
+ currency: "usd";
198
+ interval: "month" | "year";
199
+ providerPriceId: string;
200
+ metadata?: Record<string, string> | undefined;
201
+ } | undefined;
202
+ }>;
203
+ readonly increments: {
204
+ readonly table_rows: 100000;
205
+ readonly vector_db_storage: number;
206
+ readonly file_storage: number;
207
+ };
208
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
209
+ };
337
210
  };
338
211
  readonly meters: {
339
212
  readonly ai_spend_credit_grant: {
@@ -552,186 +425,59 @@ export declare const billingDefinitions: {
552
425
  };
553
426
  };
554
427
  readonly addons: {
555
- readonly bot_addon: {
556
- readonly id: "bot_addon";
557
- readonly name: "Add-on - Bot";
558
- readonly description: "Add one more bot to your workspace";
559
- readonly prices: {
560
- readonly month: {
561
- readonly amount: 10;
562
- readonly currency: "usd";
563
- readonly interval: "month";
564
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
565
- };
566
- };
567
- readonly feature: "bot_count";
568
- readonly increment: 1;
569
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
570
- };
571
- readonly collaborator_addon: {
572
- readonly id: "collaborator_addon";
573
- readonly name: "Add-on - Collaborators";
574
- readonly description: "Add one more collaborator to your workspace";
575
- readonly prices: {
576
- readonly month: {
577
- readonly amount: 25;
578
- readonly currency: "usd";
579
- readonly interval: "month";
580
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
581
- };
582
- };
583
- readonly feature: "collaborator_count";
584
- readonly increment: 1;
585
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
586
- };
587
- readonly messages_events_addon: {
588
- readonly id: "messages_events_addon";
589
- readonly name: "Add-on - Messages & Events";
590
- readonly description: "Adds 5,000 messages and events";
591
- readonly prorationDisabled: true;
592
- readonly prices: {
593
- readonly month: {
594
- readonly amount: 20;
595
- readonly currency: "usd";
596
- readonly interval: "month";
597
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
598
- };
599
- };
600
- readonly feature: "incoming_messages_events";
601
- readonly increment: 5000;
602
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
603
- };
604
- readonly table_rows_addon: {
605
- readonly id: "table_rows_addon";
606
- readonly name: "Add-on - Table Rows";
607
- readonly description: "Adds 100,000 additional table rows";
608
- readonly prices: {
609
- readonly month: {
610
- readonly amount: 25;
611
- readonly currency: "usd";
612
- readonly interval: "month";
613
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
614
- };
615
- };
616
- readonly feature: "table_rows";
617
- readonly increment: 100000;
618
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
619
- };
620
- readonly file_storage_addon: {
621
- readonly id: "file_storage_addon";
622
- readonly name: "Add-on - File Storage";
623
- readonly description: "Adds 10GB of File Storage";
624
- readonly prices: {
625
- readonly month: {
626
- readonly amount: 10;
627
- readonly currency: "usd";
628
- readonly interval: "month";
629
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
630
- };
631
- };
632
- readonly feature: "file_storage";
633
- readonly increment: 10000000000;
634
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
635
- };
636
- readonly vector_db_storage_addon: {
637
- readonly id: "vector_db_storage_addon";
638
- readonly name: "Add-on - Vector DB Storage";
639
- readonly description: "Add 1 GB of vector database storage";
640
- readonly prices: {
641
- readonly month: {
642
- readonly amount: 20;
643
- readonly currency: "usd";
644
- readonly interval: "month";
645
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
646
- };
647
- };
648
- readonly feature: "vector_db_storage";
649
- readonly increment: 1000000000;
650
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
651
- };
652
- readonly web_search_addon: {
653
- readonly id: "web_search_addon";
654
- readonly name: "Web Search and Crawl";
655
- readonly description: "Web search and crawl functionality";
656
- readonly prices: {
657
- readonly month: {
658
- readonly amount: 10;
659
- readonly currency: "usd";
660
- readonly interval: "month";
661
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
662
- };
663
- };
664
- readonly feature: "integration_spend";
665
- readonly increment: 10000000000;
666
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
667
- };
668
- readonly ai_credits_addon: {
669
- readonly id: "ai_credits_addon";
670
- readonly name: "AI Tokens";
671
- readonly description: "Add $25 worth of AI credits";
672
- readonly prices: {
673
- readonly month: {
674
- readonly amount: 25;
675
- readonly currency: "usd";
676
- readonly interval: "month";
677
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
678
- };
679
- };
680
- readonly feature: "integration_spend";
681
- readonly increment: 25000000000;
682
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
683
- };
684
- readonly enterprise_ai_token: {
685
- readonly id: "enterprise_ai_token";
686
- readonly name: "Enterprise - AI Token";
687
- readonly description: "Enterprise AI token credits";
688
- readonly prices: {
689
- readonly month: {
690
- readonly amount: -1;
691
- readonly currency: "usd";
692
- readonly interval: "month";
693
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
694
- };
695
- };
696
- readonly feature: "integration_spend";
697
- readonly increment: 100000000000;
698
- readonly hidden: true;
699
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
700
- };
701
- readonly enterprise_additional_workspace: {
702
- readonly id: "enterprise_additional_workspace";
703
- readonly name: "Enterprise - Additional Workspace";
704
- readonly description: "Enterprise additional workspace";
705
- readonly prices: {
706
- readonly month: {
707
- readonly amount: -1;
708
- readonly currency: "usd";
709
- readonly interval: "month";
710
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
711
- };
712
- };
713
- readonly feature: "collaborator_count";
714
- readonly increment: 10;
715
- readonly hidden: true;
716
- readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
717
- };
718
428
  readonly conversation_sessions_addon: {
719
429
  readonly id: "conversation_sessions_addon";
720
430
  readonly name: "Add-on - Conversation Sessions";
721
431
  readonly description: "Adds 500 conversations sessions per month";
722
- readonly prices: {
723
- readonly month: {
724
- readonly amount: 20;
725
- readonly currency: "usd";
726
- readonly interval: "month";
727
- readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
728
- };
432
+ readonly prices: Record<string, {
433
+ month: {
434
+ amount: number;
435
+ currency: "usd";
436
+ interval: "month" | "year";
437
+ providerPriceId: string;
438
+ metadata?: Record<string, string> | undefined;
439
+ };
440
+ year?: {
441
+ amount: number;
442
+ currency: "usd";
443
+ interval: "month" | "year";
444
+ providerPriceId: string;
445
+ metadata?: Record<string, string> | undefined;
446
+ } | undefined;
447
+ }>;
448
+ readonly increments: {
449
+ readonly conversation_sessions: 500;
729
450
  };
730
- readonly feature: "conversation_sessions";
731
- readonly increment: 500;
732
451
  readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
733
452
  readonly autoRechargeable: true;
734
453
  };
454
+ readonly storage_addon: {
455
+ readonly id: "storage_addon";
456
+ readonly name: "Add-on - Storage";
457
+ readonly description: "Adds table rows, vector db space and files";
458
+ readonly prices: Record<string, {
459
+ month: {
460
+ amount: number;
461
+ currency: "usd";
462
+ interval: "month" | "year";
463
+ providerPriceId: string;
464
+ metadata?: Record<string, string> | undefined;
465
+ };
466
+ year?: {
467
+ amount: number;
468
+ currency: "usd";
469
+ interval: "month" | "year";
470
+ providerPriceId: string;
471
+ metadata?: Record<string, string> | undefined;
472
+ } | undefined;
473
+ }>;
474
+ readonly increments: {
475
+ readonly table_rows: 100000;
476
+ readonly vector_db_storage: number;
477
+ readonly file_storage: number;
478
+ };
479
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
480
+ };
735
481
  };
736
482
  readonly meters: {
737
483
  readonly ai_spend_credit_grant: {
@@ -3,3 +3,4 @@
3
3
  * This will be converted to $0 during deployment.
4
4
  */
5
5
  export declare const FREE_PRICE = -1;
6
+ export declare const GB = 1000000000;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FREE_PRICE = void 0;
3
+ exports.GB = exports.FREE_PRICE = void 0;
4
4
  /**
5
5
  * Special price value indicating a free product/plan.
6
6
  * This will be converted to $0 during deployment.
7
7
  */
8
8
  exports.FREE_PRICE = -1;
9
+ exports.GB = 1_000_000_000;
package/dist/limits.d.ts CHANGED
@@ -9,6 +9,10 @@ export declare const limitConfigs: {
9
9
  readonly value: 30;
10
10
  readonly unit: "count";
11
11
  };
12
+ readonly bot_installed_plugins_count: {
13
+ readonly value: 30;
14
+ readonly unit: "count";
15
+ };
12
16
  readonly bot_integration_configuration_bytes: {
13
17
  readonly value: 20480;
14
18
  readonly unit: "bytes";
package/dist/limits.js CHANGED
@@ -10,6 +10,10 @@ exports.limitConfigs = {
10
10
  value: 30,
11
11
  unit: 'count',
12
12
  },
13
+ bot_installed_plugins_count: {
14
+ value: 30,
15
+ unit: 'count',
16
+ },
13
17
  bot_integration_configuration_bytes: {
14
18
  value: 20480, // 20 KB
15
19
  unit: 'bytes',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Shared constants for Skynet billing refactor (vendored copy of upstream packages/const)",
5
5
  "license": "UNLICENSED",
6
6
  "files": [