@bpinternal/const 0.12.0 → 0.13.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 +181 -0
  6. package/dist/{billing-addons.js → billing-next/config/addons.js} +70 -47
  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 -43
  12. package/dist/{billing-plans.js → billing-next/config/plans.js} +40 -48
  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 +829 -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 +125 -0
  20. package/dist/billing-next/features.js +127 -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,23 +1,18 @@
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
17
  readonly human_in_the_loop: false;
23
18
  readonly ratelimit: 100;
@@ -34,21 +29,27 @@ export declare const billingPlansDefs: {
34
29
  readonly saved_versions: 3;
35
30
  readonly indexed_file_count: 1000;
36
31
  };
32
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
37
33
  };
38
34
  readonly plus: {
39
35
  readonly id: "plus";
40
36
  readonly name: "Plan - Plus";
41
37
  readonly description: "For growing businesses";
42
38
  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
- }];
39
+ readonly prices: {
40
+ readonly month: {
41
+ readonly amount: 89;
42
+ readonly currency: "usd";
43
+ readonly interval: "month";
44
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
45
+ };
46
+ readonly year: {
47
+ readonly amount: 948;
48
+ readonly currency: "usd";
49
+ readonly interval: "year";
50
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
51
+ };
52
+ };
52
53
  readonly features: {
53
54
  readonly human_in_the_loop: true;
54
55
  readonly ratelimit: 100;
@@ -65,21 +66,27 @@ export declare const billingPlansDefs: {
65
66
  readonly saved_versions: 50;
66
67
  readonly indexed_file_count: 2000;
67
68
  };
69
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
68
70
  };
69
71
  readonly team: {
70
72
  readonly id: "team";
71
73
  readonly name: "Plan - Team";
72
74
  readonly description: "For small teams";
73
75
  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
- }];
76
+ readonly prices: {
77
+ readonly month: {
78
+ readonly amount: 495;
79
+ readonly currency: "usd";
80
+ readonly interval: "month";
81
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
82
+ };
83
+ readonly year: {
84
+ readonly amount: 5346;
85
+ readonly currency: "usd";
86
+ readonly interval: "year";
87
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
88
+ };
89
+ };
83
90
  readonly features: {
84
91
  readonly human_in_the_loop: true;
85
92
  readonly ratelimit: 1000;
@@ -96,17 +103,21 @@ export declare const billingPlansDefs: {
96
103
  readonly saved_versions: 100;
97
104
  readonly indexed_file_count: 10000;
98
105
  };
106
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
99
107
  };
100
108
  readonly enterprise: {
101
109
  readonly id: "enterprise";
102
110
  readonly name: "Plan - Enterprise";
103
111
  readonly description: "Enterprise license subscription";
104
112
  readonly tierIndex: 3;
105
- readonly prices: [{
106
- readonly price: -1;
107
- readonly currency: "usd";
108
- readonly interval: "month";
109
- }];
113
+ readonly prices: {
114
+ readonly month: {
115
+ readonly amount: -1;
116
+ readonly currency: "usd";
117
+ readonly interval: "month";
118
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
119
+ };
120
+ };
110
121
  readonly features: {
111
122
  human_in_the_loop: boolean;
112
123
  ratelimit: number;
@@ -123,17 +134,21 @@ export declare const billingPlansDefs: {
123
134
  saved_versions: number;
124
135
  indexed_file_count: number;
125
136
  };
137
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
126
138
  };
127
139
  readonly managed: {
128
140
  readonly id: "managed";
129
141
  readonly name: "Plan - Managed";
130
142
  readonly description: "Managed license subscription";
131
143
  readonly tierIndex: 4;
132
- readonly prices: [{
133
- readonly price: -1;
134
- readonly currency: "usd";
135
- readonly interval: "month";
136
- }];
144
+ readonly prices: {
145
+ readonly month: {
146
+ readonly amount: -1;
147
+ readonly currency: "usd";
148
+ readonly interval: "month";
149
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
150
+ };
151
+ };
137
152
  readonly features: {
138
153
  human_in_the_loop: boolean;
139
154
  ratelimit: number;
@@ -150,5 +165,6 @@ export declare const billingPlansDefs: {
150
165
  saved_versions: number;
151
166
  indexed_file_count: number;
152
167
  };
168
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
153
169
  };
154
170
  };
@@ -1,28 +1,8 @@
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
7
  human_in_the_loop: true,
28
8
  ratelimit: 10000,
@@ -40,19 +20,20 @@ const ENTERPRISE_PLAN_FEATURES = {
40
20
  indexed_file_count: 10_000,
41
21
  };
42
22
  /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
43
- exports.billingPlansDefs = {
23
+ exports.plans = {
44
24
  community: {
45
25
  id: 'community',
46
26
  name: 'Plan - Pay as you go',
47
27
  description: 'Free plan for developers',
48
28
  tierIndex: 0,
49
- prices: [
50
- {
51
- price: exports.FREE_PRICE,
29
+ prices: {
30
+ month: {
31
+ amount: consts_1.FREE_PRICE,
52
32
  currency: 'usd',
53
33
  interval: 'month',
34
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
54
35
  },
55
- ],
36
+ },
56
37
  features: {
57
38
  human_in_the_loop: false,
58
39
  ratelimit: 100,
@@ -69,24 +50,27 @@ exports.billingPlansDefs = {
69
50
  saved_versions: 3,
70
51
  indexed_file_count: 1_000,
71
52
  },
53
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
72
54
  },
73
55
  plus: {
74
56
  id: 'plus',
75
57
  name: 'Plan - Plus',
76
58
  description: 'For growing businesses',
77
59
  tierIndex: 1,
78
- prices: [
79
- {
80
- price: 89,
60
+ prices: {
61
+ month: {
62
+ amount: 89,
81
63
  currency: 'usd',
82
64
  interval: 'month',
65
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
83
66
  },
84
- {
85
- price: 948,
67
+ year: {
68
+ amount: 948,
86
69
  currency: 'usd',
87
70
  interval: 'year',
71
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
88
72
  },
89
- ],
73
+ },
90
74
  features: {
91
75
  human_in_the_loop: true,
92
76
  ratelimit: 100,
@@ -103,24 +87,27 @@ exports.billingPlansDefs = {
103
87
  saved_versions: 50,
104
88
  indexed_file_count: 2_000,
105
89
  },
90
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
106
91
  },
107
92
  team: {
108
93
  id: 'team',
109
94
  name: 'Plan - Team',
110
95
  description: 'For small teams',
111
96
  tierIndex: 2,
112
- prices: [
113
- {
114
- price: 495,
97
+ prices: {
98
+ month: {
99
+ amount: 495,
115
100
  currency: 'usd',
116
101
  interval: 'month',
102
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
117
103
  },
118
- {
119
- price: 5346,
104
+ year: {
105
+ amount: 5346,
120
106
  currency: 'usd',
121
107
  interval: 'year',
108
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
122
109
  },
123
- ],
110
+ },
124
111
  features: {
125
112
  human_in_the_loop: true,
126
113
  ratelimit: 1000,
@@ -137,33 +124,38 @@ exports.billingPlansDefs = {
137
124
  saved_versions: 100,
138
125
  indexed_file_count: 10_000,
139
126
  },
127
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
140
128
  },
141
129
  enterprise: {
142
130
  id: 'enterprise',
143
131
  name: 'Plan - Enterprise',
144
132
  description: 'Enterprise license subscription',
145
133
  tierIndex: 3,
146
- prices: [
147
- {
148
- price: exports.FREE_PRICE, // Custom pricing
134
+ prices: {
135
+ month: {
136
+ amount: consts_1.FREE_PRICE, // Custom pricing
149
137
  currency: 'usd',
150
138
  interval: 'month',
139
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
151
140
  },
152
- ],
141
+ },
153
142
  features: ENTERPRISE_PLAN_FEATURES,
143
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
154
144
  },
155
145
  managed: {
156
146
  id: 'managed',
157
147
  name: 'Plan - Managed',
158
148
  description: 'Managed license subscription',
159
149
  tierIndex: 4,
160
- prices: [
161
- {
162
- price: exports.FREE_PRICE, // Custom pricing
150
+ prices: {
151
+ month: {
152
+ amount: consts_1.FREE_PRICE, // Custom pricing
163
153
  currency: 'usd',
164
154
  interval: 'month',
155
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
165
156
  },
166
- ],
157
+ },
167
158
  features: ENTERPRISE_PLAN_FEATURES,
159
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
168
160
  },
169
161
  };