@bpinternal/const 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/billing-legacy/consts.d.ts +9 -0
  2. package/dist/billing-legacy/consts.js +53 -0
  3. package/dist/billing-legacy/index.d.ts +2 -0
  4. package/dist/billing-legacy/index.js +18 -0
  5. package/dist/billing-next/config/addons.d.ts +165 -0
  6. package/dist/{billing-addons.js → billing-next/config/addons.js} +64 -57
  7. package/dist/billing-next/config/index.d.ts +5 -0
  8. package/dist/billing-next/config/index.js +18 -0
  9. package/dist/{billing-meters.d.ts → billing-next/config/meters.d.ts} +22 -12
  10. package/dist/{billing-meters.js → billing-next/config/meters.js} +15 -9
  11. package/dist/{billing-plans.d.ts → billing-next/config/plans.d.ts} +59 -68
  12. package/dist/{billing-plans.js → billing-next/config/plans.js} +40 -68
  13. package/dist/{schema.d.ts → billing-next/config/schemas.d.ts} +392 -196
  14. package/dist/{schema.js → billing-next/config/schemas.js} +19 -12
  15. package/dist/billing-next/config/versions.d.ts +747 -0
  16. package/dist/billing-next/config/versions.js +27 -0
  17. package/dist/billing-next/consts.d.ts +5 -0
  18. package/dist/billing-next/consts.js +8 -0
  19. package/dist/billing-next/features.d.ts +95 -0
  20. package/dist/billing-next/features.js +92 -0
  21. package/dist/billing-next/index.d.ts +3 -0
  22. package/dist/billing-next/index.js +19 -0
  23. package/dist/billing-next/type-utils.d.ts +4 -0
  24. package/dist/{types.js → billing-next/type-utils.js} +1 -0
  25. package/dist/index.d.ts +2 -9
  26. package/dist/index.js +2 -10
  27. package/package.json +1 -1
  28. package/dist/billing-addons.d.ts +0 -136
  29. package/dist/billing-features.d.ts +0 -94
  30. package/dist/billing-features.js +0 -132
  31. package/dist/billing-versions.d.ts +0 -10
  32. package/dist/billing-versions.js +0 -37
  33. package/dist/types.d.ts +0 -82
  34. package/dist/usage-metadata.d.ts +0 -22
  35. package/dist/usage-metadata.js +0 -138
  36. /package/dist/{quotas.d.ts → billing-legacy/quotas.d.ts} +0 -0
  37. /package/dist/{quotas.js → billing-legacy/quotas.js} +0 -0
@@ -1,154 +1,145 @@
1
- /**
2
- * Special price value indicating a free product/plan.
3
- * This will be converted to $0 during deployment.
4
- */
5
- export declare const FREE_PRICE = -1;
6
- export declare const ALLOWED_TRIAL_LENGTHS_IN_DAYS = 7;
7
- export declare const ALLOWED_TRIAL_PLANS: readonly ["plus", "team"];
8
- export declare const BILLING_PLAN_IDS: readonly ["community", "plus", "team", "enterprise", "managed"];
9
- export declare const BILLING_ADDON_IDS: readonly ["bot_addon", "collaborator_addon", "always_alive_addon", "messages_events_addon", "table_rows_addon", "file_storage_addon", "vector_db_storage_addon", "web_search_addon", "ai_credits_addon", "enterprise_ai_token", "enterprise_additional_workspace"];
10
- export declare const billingPlansDefs: {
1
+ export type BillingPlanId = keyof typeof plans;
2
+ export declare const plans: {
11
3
  readonly community: {
12
4
  readonly id: "community";
13
5
  readonly name: "Plan - Pay as you go";
14
6
  readonly description: "Free plan for developers";
15
7
  readonly tierIndex: 0;
16
- readonly prices: [{
17
- readonly price: -1;
18
- readonly currency: "usd";
19
- readonly interval: "month";
20
- }];
8
+ readonly prices: {
9
+ readonly month: {
10
+ readonly amount: -1;
11
+ readonly currency: "usd";
12
+ readonly interval: "month";
13
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
14
+ };
15
+ };
21
16
  readonly features: {
22
- readonly human_in_the_loop: false;
23
- readonly ratelimit: 100;
24
17
  readonly incoming_messages_events: 500;
25
18
  readonly integration_spend: 0;
26
- readonly integration_subscription: false;
27
19
  readonly table_rows: 1000;
28
20
  readonly bot_count: 1;
29
- readonly always_alive_count: 0;
30
- readonly always_alive_concurrency: 1;
31
21
  readonly collaborator_count: 1;
32
22
  readonly file_storage: 100000000;
33
23
  readonly vector_db_storage: 100000000;
34
24
  readonly saved_versions: 3;
35
25
  readonly indexed_file_count: 1000;
36
26
  };
27
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
37
28
  };
38
29
  readonly plus: {
39
30
  readonly id: "plus";
40
31
  readonly name: "Plan - Plus";
41
32
  readonly description: "For growing businesses";
42
33
  readonly tierIndex: 1;
43
- readonly prices: [{
44
- readonly price: 89;
45
- readonly currency: "usd";
46
- readonly interval: "month";
47
- }, {
48
- readonly price: 948;
49
- readonly currency: "usd";
50
- readonly interval: "year";
51
- }];
34
+ readonly prices: {
35
+ readonly month: {
36
+ readonly amount: 89;
37
+ readonly currency: "usd";
38
+ readonly interval: "month";
39
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
40
+ };
41
+ readonly year: {
42
+ readonly amount: 948;
43
+ readonly currency: "usd";
44
+ readonly interval: "year";
45
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
46
+ };
47
+ };
52
48
  readonly features: {
53
- readonly human_in_the_loop: true;
54
- readonly ratelimit: 100;
55
49
  readonly incoming_messages_events: 5000;
56
50
  readonly integration_spend: 5000000000;
57
- readonly integration_subscription: true;
58
51
  readonly table_rows: 100000;
59
52
  readonly bot_count: 2;
60
- readonly always_alive_count: 1;
61
- readonly always_alive_concurrency: 1;
62
53
  readonly collaborator_count: 2;
63
54
  readonly file_storage: 10000000000;
64
55
  readonly vector_db_storage: 1000000000;
65
56
  readonly saved_versions: 50;
66
57
  readonly indexed_file_count: 2000;
67
58
  };
59
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
68
60
  };
69
61
  readonly team: {
70
62
  readonly id: "team";
71
63
  readonly name: "Plan - Team";
72
64
  readonly description: "For small teams";
73
65
  readonly tierIndex: 2;
74
- readonly prices: [{
75
- readonly price: 495;
76
- readonly currency: "usd";
77
- readonly interval: "month";
78
- }, {
79
- readonly price: 5346;
80
- readonly currency: "usd";
81
- readonly interval: "year";
82
- }];
66
+ readonly prices: {
67
+ readonly month: {
68
+ readonly amount: 495;
69
+ readonly currency: "usd";
70
+ readonly interval: "month";
71
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
72
+ };
73
+ readonly year: {
74
+ readonly amount: 5346;
75
+ readonly currency: "usd";
76
+ readonly interval: "year";
77
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
78
+ };
79
+ };
83
80
  readonly features: {
84
- readonly human_in_the_loop: true;
85
- readonly ratelimit: 1000;
86
81
  readonly incoming_messages_events: 50000;
87
82
  readonly integration_spend: 5000000000;
88
- readonly integration_subscription: true;
89
83
  readonly table_rows: 100000;
90
84
  readonly bot_count: 3;
91
- readonly always_alive_count: 3;
92
- readonly always_alive_concurrency: 3;
93
85
  readonly collaborator_count: 3;
94
86
  readonly file_storage: 10000000000;
95
87
  readonly vector_db_storage: 2000000000;
96
88
  readonly saved_versions: 100;
97
89
  readonly indexed_file_count: 10000;
98
90
  };
91
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
99
92
  };
100
93
  readonly enterprise: {
101
94
  readonly id: "enterprise";
102
95
  readonly name: "Plan - Enterprise";
103
96
  readonly description: "Enterprise license subscription";
104
97
  readonly tierIndex: 3;
105
- readonly prices: [{
106
- readonly price: -1;
107
- readonly currency: "usd";
108
- readonly interval: "month";
109
- }];
98
+ readonly prices: {
99
+ readonly month: {
100
+ readonly amount: -1;
101
+ readonly currency: "usd";
102
+ readonly interval: "month";
103
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
104
+ };
105
+ };
110
106
  readonly features: {
111
- human_in_the_loop: boolean;
112
- ratelimit: number;
113
107
  incoming_messages_events: number;
114
108
  integration_spend: number;
115
- integration_subscription: boolean;
116
109
  table_rows: number;
117
110
  bot_count: number;
118
- always_alive_count: number;
119
- always_alive_concurrency: number;
120
111
  collaborator_count: number;
121
112
  file_storage: number;
122
113
  vector_db_storage: number;
123
114
  saved_versions: number;
124
115
  indexed_file_count: number;
125
116
  };
117
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
126
118
  };
127
119
  readonly managed: {
128
120
  readonly id: "managed";
129
121
  readonly name: "Plan - Managed";
130
122
  readonly description: "Managed license subscription";
131
123
  readonly tierIndex: 4;
132
- readonly prices: [{
133
- readonly price: -1;
134
- readonly currency: "usd";
135
- readonly interval: "month";
136
- }];
124
+ readonly prices: {
125
+ readonly month: {
126
+ readonly amount: -1;
127
+ readonly currency: "usd";
128
+ readonly interval: "month";
129
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
130
+ };
131
+ };
137
132
  readonly features: {
138
- human_in_the_loop: boolean;
139
- ratelimit: number;
140
133
  incoming_messages_events: number;
141
134
  integration_spend: number;
142
- integration_subscription: boolean;
143
135
  table_rows: number;
144
136
  bot_count: number;
145
- always_alive_count: number;
146
- always_alive_concurrency: number;
147
137
  collaborator_count: number;
148
138
  file_storage: number;
149
139
  vector_db_storage: number;
150
140
  saved_versions: number;
151
141
  indexed_file_count: number;
152
142
  };
143
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
153
144
  };
154
145
  };
@@ -1,38 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.billingPlansDefs = exports.BILLING_ADDON_IDS = exports.BILLING_PLAN_IDS = exports.ALLOWED_TRIAL_PLANS = exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = exports.FREE_PRICE = void 0;
4
- /**
5
- * Special price value indicating a free product/plan.
6
- * This will be converted to $0 during deployment.
7
- */
8
- exports.FREE_PRICE = -1;
9
- exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = 7;
10
- exports.ALLOWED_TRIAL_PLANS = ['plus', 'team'];
11
- // keep this in order of lowest to highest tier
12
- exports.BILLING_PLAN_IDS = ['community', 'plus', 'team', 'enterprise', 'managed'];
13
- exports.BILLING_ADDON_IDS = [
14
- 'bot_addon',
15
- 'collaborator_addon',
16
- 'always_alive_addon',
17
- 'messages_events_addon',
18
- 'table_rows_addon',
19
- 'file_storage_addon',
20
- 'vector_db_storage_addon',
21
- 'web_search_addon',
22
- 'ai_credits_addon',
23
- 'enterprise_ai_token',
24
- 'enterprise_additional_workspace',
25
- ];
3
+ exports.plans = void 0;
4
+ const consts_1 = require("../consts");
5
+ const schemas_1 = require("./schemas");
26
6
  const ENTERPRISE_PLAN_FEATURES = {
27
- human_in_the_loop: true,
28
- ratelimit: 10000,
29
7
  incoming_messages_events: 1000000,
30
8
  integration_spend: 5_000_000_000, // $5 in nano-dollars
31
- integration_subscription: true,
32
9
  table_rows: 10000000,
33
10
  bot_count: 100,
34
- always_alive_count: 50,
35
- always_alive_concurrency: 3,
36
11
  collaborator_count: 100,
37
12
  file_storage: 1000_000_000_000, // 1000 GB
38
13
  vector_db_storage: 500_000_000_000, // 500 GB
@@ -40,130 +15,127 @@ const ENTERPRISE_PLAN_FEATURES = {
40
15
  indexed_file_count: 10_000,
41
16
  };
42
17
  /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
43
- exports.billingPlansDefs = {
18
+ exports.plans = {
44
19
  community: {
45
20
  id: 'community',
46
21
  name: 'Plan - Pay as you go',
47
22
  description: 'Free plan for developers',
48
23
  tierIndex: 0,
49
- prices: [
50
- {
51
- price: exports.FREE_PRICE,
24
+ prices: {
25
+ month: {
26
+ amount: consts_1.FREE_PRICE,
52
27
  currency: 'usd',
53
28
  interval: 'month',
29
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
54
30
  },
55
- ],
31
+ },
56
32
  features: {
57
- human_in_the_loop: false,
58
- ratelimit: 100,
59
33
  incoming_messages_events: 500,
60
34
  integration_spend: 0,
61
- integration_subscription: false,
62
35
  table_rows: 1000,
63
36
  bot_count: 1,
64
- always_alive_count: 0,
65
- always_alive_concurrency: 1,
66
37
  collaborator_count: 1,
67
38
  file_storage: 100_000_000, // 100 MB
68
39
  vector_db_storage: 100_000_000, // 100 MB
69
40
  saved_versions: 3,
70
41
  indexed_file_count: 1_000,
71
42
  },
43
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
72
44
  },
73
45
  plus: {
74
46
  id: 'plus',
75
47
  name: 'Plan - Plus',
76
48
  description: 'For growing businesses',
77
49
  tierIndex: 1,
78
- prices: [
79
- {
80
- price: 89,
50
+ prices: {
51
+ month: {
52
+ amount: 89,
81
53
  currency: 'usd',
82
54
  interval: 'month',
55
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
83
56
  },
84
- {
85
- price: 948,
57
+ year: {
58
+ amount: 948,
86
59
  currency: 'usd',
87
60
  interval: 'year',
61
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
88
62
  },
89
- ],
63
+ },
90
64
  features: {
91
- human_in_the_loop: true,
92
- ratelimit: 100,
93
65
  incoming_messages_events: 5000,
94
66
  integration_spend: 5_000_000_000, // $5 in nano-dollars
95
- integration_subscription: true,
96
67
  table_rows: 100000,
97
68
  bot_count: 2,
98
- always_alive_count: 1,
99
- always_alive_concurrency: 1,
100
69
  collaborator_count: 2,
101
70
  file_storage: 10_000_000_000, // 10 GB
102
71
  vector_db_storage: 1_000_000_000, // 1 GB
103
72
  saved_versions: 50,
104
73
  indexed_file_count: 2_000,
105
74
  },
75
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
106
76
  },
107
77
  team: {
108
78
  id: 'team',
109
79
  name: 'Plan - Team',
110
80
  description: 'For small teams',
111
81
  tierIndex: 2,
112
- prices: [
113
- {
114
- price: 495,
82
+ prices: {
83
+ month: {
84
+ amount: 495,
115
85
  currency: 'usd',
116
86
  interval: 'month',
87
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
117
88
  },
118
- {
119
- price: 5346,
89
+ year: {
90
+ amount: 5346,
120
91
  currency: 'usd',
121
92
  interval: 'year',
93
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
122
94
  },
123
- ],
95
+ },
124
96
  features: {
125
- human_in_the_loop: true,
126
- ratelimit: 1000,
127
97
  incoming_messages_events: 50000,
128
98
  integration_spend: 5_000_000_000, // $5 in nano-dollars
129
- integration_subscription: true,
130
99
  table_rows: 100000,
131
100
  bot_count: 3,
132
- always_alive_count: 3,
133
- always_alive_concurrency: 3,
134
101
  collaborator_count: 3,
135
102
  file_storage: 10_000_000_000, // 10 GB
136
103
  vector_db_storage: 2_000_000_000, // 2 GB
137
104
  saved_versions: 100,
138
105
  indexed_file_count: 10_000,
139
106
  },
107
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
140
108
  },
141
109
  enterprise: {
142
110
  id: 'enterprise',
143
111
  name: 'Plan - Enterprise',
144
112
  description: 'Enterprise license subscription',
145
113
  tierIndex: 3,
146
- prices: [
147
- {
148
- price: exports.FREE_PRICE, // Custom pricing
114
+ prices: {
115
+ month: {
116
+ amount: consts_1.FREE_PRICE, // Custom pricing
149
117
  currency: 'usd',
150
118
  interval: 'month',
119
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
151
120
  },
152
- ],
121
+ },
153
122
  features: ENTERPRISE_PLAN_FEATURES,
123
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
154
124
  },
155
125
  managed: {
156
126
  id: 'managed',
157
127
  name: 'Plan - Managed',
158
128
  description: 'Managed license subscription',
159
129
  tierIndex: 4,
160
- prices: [
161
- {
162
- price: exports.FREE_PRICE, // Custom pricing
130
+ prices: {
131
+ month: {
132
+ amount: consts_1.FREE_PRICE, // Custom pricing
163
133
  currency: 'usd',
164
134
  interval: 'month',
135
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
165
136
  },
166
- ],
137
+ },
167
138
  features: ENTERPRISE_PLAN_FEATURES,
139
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
168
140
  },
169
141
  };