@bpinternal/const 0.2.1 → 0.3.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.
@@ -0,0 +1,280 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingAddons = exports.billingPlans = 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.billingPlans = {
10
+ community: {
11
+ id: 'community',
12
+ name: 'Plan - Pay as you go',
13
+ description: 'Free plan for developers',
14
+ prices: [
15
+ {
16
+ price: exports.FREE_PRICE,
17
+ currency: 'usd',
18
+ interval: 'month',
19
+ },
20
+ ],
21
+ features: {
22
+ human_in_the_loop: false,
23
+ ratelimit: 100,
24
+ incoming_messages_events: 2000,
25
+ integration_spend: 5_000_000_000, // $5 in nano-dollars
26
+ integration_subscription: false,
27
+ table_rows: 5000,
28
+ bot_count: 5,
29
+ always_alive_count: 0,
30
+ collaborator_count: 3,
31
+ file_storage: 500_000_000, // 500 MB
32
+ vector_db_storage: 100_000_000, // 100 MB
33
+ saved_versions: 3,
34
+ },
35
+ },
36
+ plus: {
37
+ id: 'plus',
38
+ name: 'Plan - Plus',
39
+ description: 'For growing businesses',
40
+ prices: [
41
+ {
42
+ price: 89,
43
+ currency: 'usd',
44
+ interval: 'month',
45
+ },
46
+ {
47
+ price: 948,
48
+ currency: 'usd',
49
+ interval: 'year',
50
+ },
51
+ ],
52
+ features: {
53
+ human_in_the_loop: true,
54
+ ratelimit: 5000,
55
+ incoming_messages_events: 500000,
56
+ integration_spend: 50_000_000_000, // $50 in nano-dollars
57
+ integration_subscription: true,
58
+ table_rows: 5000000,
59
+ bot_count: 50,
60
+ always_alive_count: 50,
61
+ collaborator_count: 15,
62
+ file_storage: 50_000_000_000, // 50 GB
63
+ vector_db_storage: 10_000_000_000, // 10 GB
64
+ saved_versions: 50,
65
+ },
66
+ },
67
+ team: {
68
+ id: 'team',
69
+ name: 'Plan - Team',
70
+ description: 'For small teams',
71
+ prices: [
72
+ {
73
+ price: 495,
74
+ currency: 'usd',
75
+ interval: 'month',
76
+ },
77
+ {
78
+ price: 5346,
79
+ currency: 'usd',
80
+ interval: 'year',
81
+ },
82
+ ],
83
+ features: {
84
+ human_in_the_loop: true,
85
+ ratelimit: 1000,
86
+ incoming_messages_events: 250000,
87
+ integration_spend: 10_000_000_000, // $10 in nano-dollars
88
+ integration_subscription: false,
89
+ table_rows: 1000000,
90
+ bot_count: 20,
91
+ always_alive_count: 20,
92
+ collaborator_count: 5,
93
+ file_storage: 10_000_000_000, // 10 GB
94
+ vector_db_storage: 2_000_000_000, // 2 GB
95
+ saved_versions: 10,
96
+ },
97
+ },
98
+ enterprise: {
99
+ id: 'enterprise',
100
+ name: 'Plan - Enterprise',
101
+ description: 'Enterprise license subscription',
102
+ prices: [
103
+ {
104
+ price: exports.FREE_PRICE, // Custom pricing
105
+ currency: 'usd',
106
+ interval: 'month',
107
+ },
108
+ ],
109
+ features: {
110
+ human_in_the_loop: true,
111
+ ratelimit: 10000,
112
+ incoming_messages_events: 10000000,
113
+ integration_spend: 1000_000_000_000, // $1000 in nano-dollars
114
+ integration_subscription: true,
115
+ table_rows: 100000000,
116
+ bot_count: 1000,
117
+ always_alive_count: 500,
118
+ collaborator_count: 100,
119
+ file_storage: 1000_000_000_000, // 1000 GB
120
+ vector_db_storage: 500_000_000_000, // 500 GB
121
+ saved_versions: 1000,
122
+ },
123
+ },
124
+ };
125
+ exports.billingAddons = {
126
+ bot_addon: {
127
+ id: 'bot_addon',
128
+ name: 'Add-on - Bot',
129
+ description: 'Add one more bot to your workspace',
130
+ prices: [
131
+ {
132
+ price: 10,
133
+ currency: 'usd',
134
+ interval: 'month',
135
+ },
136
+ ],
137
+ feature: 'bot_count',
138
+ increment: 1,
139
+ },
140
+ collaborator_addon: {
141
+ id: 'collaborator_addon',
142
+ name: 'Add-on - Collaborators',
143
+ description: 'Add one more collaborator to your workspace',
144
+ prices: [
145
+ {
146
+ price: 25,
147
+ currency: 'usd',
148
+ interval: 'month',
149
+ },
150
+ ],
151
+ feature: 'collaborator_count',
152
+ increment: 1,
153
+ },
154
+ always_alive_addon: {
155
+ id: 'always_alive_addon',
156
+ name: 'Add-on - Always Alive',
157
+ description: 'Keep one more bot always alive',
158
+ prices: [
159
+ {
160
+ price: 10,
161
+ currency: 'usd',
162
+ interval: 'month',
163
+ },
164
+ ],
165
+ feature: 'always_alive_count',
166
+ increment: 1,
167
+ },
168
+ messages_events_addon: {
169
+ id: 'messages_events_addon',
170
+ name: 'Add-on - Messages & Events',
171
+ description: 'Adds 5,000 messages and events',
172
+ prices: [
173
+ {
174
+ price: 20,
175
+ currency: 'usd',
176
+ interval: 'month',
177
+ },
178
+ ],
179
+ feature: 'incoming_messages_events',
180
+ increment: 5000,
181
+ },
182
+ table_rows_addon: {
183
+ id: 'table_rows_addon',
184
+ name: 'Add-on - Table Rows',
185
+ description: 'Adds 100,000 additional table rows',
186
+ prices: [
187
+ {
188
+ price: 25,
189
+ currency: 'usd',
190
+ interval: 'month',
191
+ },
192
+ ],
193
+ feature: 'table_rows',
194
+ increment: 100000,
195
+ },
196
+ file_storage_addon: {
197
+ id: 'file_storage_addon',
198
+ name: 'Add-on - File Storage',
199
+ description: 'Adds 10GB of File Storage',
200
+ prices: [
201
+ {
202
+ price: 10,
203
+ currency: 'usd',
204
+ interval: 'month',
205
+ },
206
+ ],
207
+ feature: 'file_storage',
208
+ increment: 10_000_000_000, // 10 GB
209
+ },
210
+ vector_db_storage_addon: {
211
+ id: 'vector_db_storage_addon',
212
+ name: 'Add-on - Vector DB Storage',
213
+ description: 'Add 1 GB of vector database storage',
214
+ prices: [
215
+ {
216
+ price: 20,
217
+ currency: 'usd',
218
+ interval: 'month',
219
+ },
220
+ ],
221
+ feature: 'vector_db_storage',
222
+ increment: 1_000_000_000, // 1 GB
223
+ },
224
+ web_search_addon: {
225
+ id: 'web_search_addon',
226
+ name: 'Web Search and Crawl',
227
+ description: 'Web search and crawl functionality',
228
+ prices: [
229
+ {
230
+ price: 0.01,
231
+ currency: 'usd',
232
+ interval: 'month',
233
+ },
234
+ ],
235
+ feature: 'integration_spend',
236
+ increment: 10_000_000_000, // $10 in nano-dollars
237
+ },
238
+ ai_credits_addon: {
239
+ id: 'ai_credits_addon',
240
+ name: 'AI Tokens',
241
+ description: 'Add $25 worth of AI credits',
242
+ prices: [
243
+ {
244
+ price: 0.01,
245
+ currency: 'usd',
246
+ interval: 'month',
247
+ },
248
+ ],
249
+ feature: 'integration_spend',
250
+ increment: 25_000_000_000, // $25 in nano-dollars
251
+ },
252
+ enterprise_ai_token: {
253
+ id: 'enterprise_ai_token',
254
+ name: 'Enterprise - AI Token',
255
+ description: 'Enterprise AI token credits',
256
+ prices: [
257
+ {
258
+ price: exports.FREE_PRICE, // Custom pricing
259
+ currency: 'usd',
260
+ interval: 'month',
261
+ },
262
+ ],
263
+ feature: 'integration_spend',
264
+ increment: 100_000_000_000, // $100 in nano-dollars
265
+ },
266
+ enterprise_additional_workspace: {
267
+ id: 'enterprise_additional_workspace',
268
+ name: 'Enterprise - Additional Workspace',
269
+ description: 'Enterprise additional workspace',
270
+ prices: [
271
+ {
272
+ price: exports.FREE_PRICE, // Custom pricing
273
+ currency: 'usd',
274
+ interval: 'month',
275
+ },
276
+ ],
277
+ feature: 'collaborator_count',
278
+ increment: 10,
279
+ },
280
+ };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Billing versions for v4 billing system
3
+ * Each version represents a complete billing configuration
4
+ */
5
+ import { billingPlans, billingAddons } from './billing-products';
6
+ export type BillingVersion = {
7
+ version: string;
8
+ name: string;
9
+ description: string;
10
+ plans: typeof billingPlans;
11
+ addons: typeof billingAddons;
12
+ isActive: boolean;
13
+ createdAt: string;
14
+ stripeMapping?: StripeMapping;
15
+ };
16
+ export type StripeMapping = {
17
+ plans: Record<string, {
18
+ productId: string;
19
+ priceId: string;
20
+ }>;
21
+ addons: Record<string, {
22
+ productId: string;
23
+ priceId: string;
24
+ }>;
25
+ };
26
+ export declare const billingVersionV4: BillingVersion;
27
+ export declare const billingVersions: Record<string, BillingVersion>;
28
+ export declare const getActiveBillingVersion: () => BillingVersion;
29
+ export declare const getBillingVersion: (version: string) => BillingVersion | undefined;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * Billing versions for v4 billing system
4
+ * Each version represents a complete billing configuration
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getBillingVersion = exports.getActiveBillingVersion = exports.billingVersions = exports.billingVersionV4 = void 0;
8
+ const billing_products_1 = require("./billing-products");
9
+ exports.billingVersionV4 = {
10
+ version: 'v4',
11
+ name: 'Billing Version 4',
12
+ description: 'New billing system with credit grants and entitlements',
13
+ plans: billing_products_1.billingPlans,
14
+ addons: billing_products_1.billingAddons,
15
+ isActive: false, // Will be set to true when migration is complete
16
+ createdAt: new Date().toISOString(),
17
+ // stripeMapping will be populated by Pulumi
18
+ };
19
+ exports.billingVersions = {
20
+ v4: exports.billingVersionV4,
21
+ };
22
+ const getActiveBillingVersion = () => {
23
+ const activeVersion = Object.values(exports.billingVersions).find((v) => v.isActive);
24
+ if (!activeVersion) {
25
+ throw new Error('No active billing version found');
26
+ }
27
+ return activeVersion;
28
+ };
29
+ exports.getActiveBillingVersion = getActiveBillingVersion;
30
+ const getBillingVersion = (version) => {
31
+ return exports.billingVersions[version];
32
+ };
33
+ exports.getBillingVersion = getBillingVersion;
@@ -0,0 +1,8 @@
1
+ export * from './limits';
2
+ export * from './prefixes';
3
+ export * from './quotas';
4
+ export * from './tags';
5
+ export * from './billing-features';
6
+ export * from './billing-products';
7
+ export * from './billing-versions';
8
+ export * from './usage-metadata';
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./limits"), exports);
18
+ __exportStar(require("./prefixes"), exports);
19
+ __exportStar(require("./quotas"), exports);
20
+ __exportStar(require("./tags"), exports);
21
+ // V4 Billing Constants
22
+ __exportStar(require("./billing-features"), exports);
23
+ __exportStar(require("./billing-products"), exports);
24
+ __exportStar(require("./billing-versions"), exports);
25
+ __exportStar(require("./usage-metadata"), exports);
@@ -0,0 +1,80 @@
1
+ export type LimitType = keyof typeof limitConfigs;
2
+ export type LimitUnit = 'count' | 'bytes';
3
+ export declare const limitConfigs: {
4
+ readonly bot_configuration_bytes: {
5
+ readonly value: 20480;
6
+ readonly unit: "bytes";
7
+ };
8
+ readonly bot_installed_integrations_count: {
9
+ readonly value: 30;
10
+ readonly unit: "count";
11
+ };
12
+ readonly bot_integration_configuration_bytes: {
13
+ readonly value: 20480;
14
+ readonly unit: "bytes";
15
+ };
16
+ readonly bot_recurring_event_count: {
17
+ readonly value: 50;
18
+ readonly unit: "count";
19
+ };
20
+ readonly bot_recurring_event_payload_bytes: {
21
+ readonly value: 131072;
22
+ readonly unit: "bytes";
23
+ };
24
+ readonly event_definition_count: {
25
+ readonly value: 20;
26
+ readonly unit: "count";
27
+ };
28
+ readonly integration_channel_count: {
29
+ readonly value: 10;
30
+ readonly unit: "count";
31
+ };
32
+ readonly integration_channel_message_type_count: {
33
+ readonly value: 20;
34
+ readonly unit: "count";
35
+ };
36
+ readonly integration_identifier_count: {
37
+ readonly value: 50;
38
+ readonly unit: "count";
39
+ };
40
+ readonly integration_version_count: {
41
+ readonly value: 50;
42
+ readonly unit: "count";
43
+ };
44
+ readonly issue_event_item_payload_bytes: {
45
+ readonly value: 131072;
46
+ readonly unit: "bytes";
47
+ };
48
+ readonly message_payload_bytes: {
49
+ readonly value: 131072;
50
+ readonly unit: "bytes";
51
+ };
52
+ readonly schema_bytes: {
53
+ readonly value: 102400;
54
+ readonly unit: "bytes";
55
+ };
56
+ readonly state_definition_count: {
57
+ readonly value: 10;
58
+ readonly unit: "count";
59
+ };
60
+ readonly state_item_payload_bytes: {
61
+ readonly value: 131072;
62
+ readonly unit: "bytes";
63
+ };
64
+ readonly tag_definition_count: {
65
+ readonly value: 50;
66
+ readonly unit: "count";
67
+ };
68
+ readonly bot_integration_secret_count: {
69
+ readonly value: 25;
70
+ readonly unit: "count";
71
+ };
72
+ readonly files_api_query_bytes: {
73
+ readonly value: 2048;
74
+ readonly unit: "bytes";
75
+ };
76
+ readonly code_payload_bytes: {
77
+ readonly value: 52428800;
78
+ readonly unit: "bytes";
79
+ };
80
+ };
package/dist/limits.js ADDED
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.limitConfigs = void 0;
4
+ exports.limitConfigs = {
5
+ bot_configuration_bytes: {
6
+ value: 20480, // 20 KB
7
+ unit: 'bytes',
8
+ },
9
+ bot_installed_integrations_count: {
10
+ value: 30,
11
+ unit: 'count',
12
+ },
13
+ bot_integration_configuration_bytes: {
14
+ value: 20480, // 20 KB
15
+ unit: 'bytes',
16
+ },
17
+ bot_recurring_event_count: {
18
+ value: 50,
19
+ unit: 'count',
20
+ },
21
+ bot_recurring_event_payload_bytes: {
22
+ value: 131072, // 128 KB
23
+ unit: 'bytes',
24
+ },
25
+ event_definition_count: {
26
+ value: 20,
27
+ unit: 'count',
28
+ },
29
+ integration_channel_count: {
30
+ value: 10,
31
+ unit: 'count',
32
+ },
33
+ integration_channel_message_type_count: {
34
+ value: 20,
35
+ unit: 'count',
36
+ },
37
+ integration_identifier_count: {
38
+ value: 50,
39
+ unit: 'count',
40
+ },
41
+ integration_version_count: {
42
+ value: 50,
43
+ unit: 'count',
44
+ },
45
+ issue_event_item_payload_bytes: {
46
+ value: 131072, // 128 KB
47
+ unit: 'bytes',
48
+ },
49
+ message_payload_bytes: {
50
+ value: 131072, // 128 KB
51
+ unit: 'bytes',
52
+ },
53
+ schema_bytes: {
54
+ value: 102400, // 100 KB
55
+ unit: 'bytes',
56
+ },
57
+ state_definition_count: {
58
+ value: 10,
59
+ unit: 'count',
60
+ },
61
+ state_item_payload_bytes: {
62
+ value: 131072, // 128 KB
63
+ unit: 'bytes',
64
+ },
65
+ tag_definition_count: {
66
+ value: 50,
67
+ unit: 'count',
68
+ },
69
+ bot_integration_secret_count: {
70
+ value: 25,
71
+ unit: 'count',
72
+ },
73
+ files_api_query_bytes: {
74
+ value: 2048, // 2 KB
75
+ unit: 'bytes',
76
+ },
77
+ code_payload_bytes: {
78
+ value: 52428800, // 50 MB
79
+ unit: 'bytes',
80
+ },
81
+ };
@@ -0,0 +1,99 @@
1
+ export declare const prefixToObjectMap: {
2
+ readonly accnt: "account";
3
+ readonly accntpf: "accountPreference";
4
+ readonly action: "action";
5
+ readonly activty: "activity";
6
+ readonly anlytic: "analytics";
7
+ readonly audit: "audit";
8
+ readonly bak: "botApiKey";
9
+ readonly bot: "bot";
10
+ readonly card: "card";
11
+ readonly cfg: "configuration";
12
+ readonly channel: "channel";
13
+ readonly conv: "conversation";
14
+ readonly devbot: "devBot";
15
+ readonly devint: "devIntegration";
16
+ readonly evt: "event";
17
+ readonly file: "file";
18
+ readonly flow: "flow";
19
+ readonly iak: "integrationApiKey";
20
+ readonly int: "integration";
21
+ readonly iface: "interface";
22
+ readonly ifver: "interfaceVersion";
23
+ readonly intver: "integrationVersion";
24
+ readonly iss: "issue";
25
+ readonly issevt: "issueEvent";
26
+ readonly kb: "knowledgeBase";
27
+ readonly limit: "limit";
28
+ readonly media: "media";
29
+ readonly msg: "message";
30
+ readonly node: "node";
31
+ readonly notif: "notification";
32
+ readonly pat: "personalAccessToken";
33
+ readonly plugin: "plugin";
34
+ readonly plugver: "pluginVersion";
35
+ readonly quota: "quota";
36
+ readonly recevt: "recurringEvent";
37
+ readonly report: "report";
38
+ readonly sandbox: "sandbox";
39
+ readonly schema: "schema";
40
+ readonly script: "script";
41
+ readonly state: "state";
42
+ readonly table: "table";
43
+ readonly tag: "tag";
44
+ readonly task: "task";
45
+ readonly usage: "usage";
46
+ readonly user: "user";
47
+ readonly webhook: "webhook";
48
+ readonly wkspace: "workspace";
49
+ readonly wrkflow: "workflow";
50
+ };
51
+ export declare const objectToPrefixMap: Reverser<typeof prefixToObjectMap>;
52
+ export type Prefixes = (typeof objectToPrefixMap)[keyof typeof objectToPrefixMap];
53
+ export type Objects = keyof typeof objectToPrefixMap;
54
+ type Ids = {
55
+ [Id in Objects as `${Capitalize<Id>}Id`]: `${(typeof objectToPrefixMap)[Id]}_${string}`;
56
+ };
57
+ export type AccountId = Ids['AccountId'];
58
+ export type AccountPreferenceId = Ids['AccountPreferenceId'];
59
+ export type ActionId = Ids['ActionId'];
60
+ export type AnalyticsId = Ids['AnalyticsId'];
61
+ export type AuditId = Ids['AuditId'];
62
+ export type BotApiKeyId = Ids['BotApiKeyId'];
63
+ export type BotId = Ids['BotId'];
64
+ export type CardId = Ids['CardId'];
65
+ export type ChannelId = Ids['ChannelId'];
66
+ export type ConfigurationId = Ids['ConfigurationId'];
67
+ export type ConversationId = Ids['ConversationId'];
68
+ export type EventId = Ids['EventId'];
69
+ export type FileId = Ids['FileId'];
70
+ export type FlowId = Ids['FlowId'];
71
+ export type IntegrationApiKeyId = Ids['IntegrationApiKeyId'];
72
+ export type IntegrationId = Ids['IntegrationId'];
73
+ export type Issue = Ids['IssueId'];
74
+ export type IssueEvent = Ids['IssueEventId'];
75
+ export type KnowledgeBaseId = Ids['KnowledgeBaseId'];
76
+ export type LimitId = Ids['LimitId'];
77
+ export type MediaId = Ids['MediaId'];
78
+ export type MessageId = Ids['MessageId'];
79
+ export type NodeId = Ids['NodeId'];
80
+ export type PersonalAccessTokenId = Ids['PersonalAccessTokenId'];
81
+ export type QuotaId = Ids['QuotaId'];
82
+ export type RecurringEventId = Ids['RecurringEventId'];
83
+ export type ReportId = Ids['ReportId'];
84
+ export type SandboxId = Ids['SandboxId'];
85
+ export type SchemaId = Ids['SchemaId'];
86
+ export type ScriptId = Ids['ScriptId'];
87
+ export type StateId = Ids['StateId'];
88
+ export type TableId = Ids['TableId'];
89
+ export type TagId = Ids['TagId'];
90
+ export type TaskId = Ids['TaskId'];
91
+ export type UsageId = Ids['UsageId'];
92
+ export type UserId = Ids['UserId'];
93
+ export type WebhookId = Ids['WebhookId'];
94
+ export type WorkflowId = Ids['WorkflowId'];
95
+ export type WorkspaceId = Ids['WorkspaceId'];
96
+ type Reverser<T extends Record<PropertyKey, PropertyKey>> = {
97
+ [P in keyof T as T[P]]: P;
98
+ };
99
+ export {};