@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.
package/dist/index.mjs DELETED
@@ -1,513 +0,0 @@
1
- // src/limits.ts
2
- var limitConfigs = {
3
- bot_configuration_bytes: {
4
- value: 20480,
5
- // 20 KB
6
- unit: "bytes"
7
- },
8
- bot_installed_integrations_count: {
9
- value: 30,
10
- unit: "count"
11
- },
12
- bot_integration_configuration_bytes: {
13
- value: 20480,
14
- // 20 KB
15
- unit: "bytes"
16
- },
17
- bot_recurring_event_count: {
18
- value: 40,
19
- unit: "count"
20
- },
21
- bot_recurring_event_payload_bytes: {
22
- value: 131072,
23
- // 128 KB
24
- unit: "bytes"
25
- },
26
- event_definition_count: {
27
- value: 20,
28
- unit: "count"
29
- },
30
- integration_channel_count: {
31
- value: 10,
32
- unit: "count"
33
- },
34
- integration_channel_message_type_count: {
35
- value: 20,
36
- unit: "count"
37
- },
38
- integration_identifier_count: {
39
- value: 50,
40
- unit: "count"
41
- },
42
- integration_version_count: {
43
- value: 50,
44
- unit: "count"
45
- },
46
- issue_event_item_payload_bytes: {
47
- value: 131072,
48
- // 128 KB
49
- unit: "bytes"
50
- },
51
- message_payload_bytes: {
52
- value: 131072,
53
- // 128 KB
54
- unit: "bytes"
55
- },
56
- schema_bytes: {
57
- value: 102400,
58
- // 100 KB
59
- unit: "bytes"
60
- },
61
- state_definition_count: {
62
- value: 10,
63
- unit: "count"
64
- },
65
- state_item_payload_bytes: {
66
- value: 131072,
67
- // 128 KB
68
- unit: "bytes"
69
- },
70
- tag_definition_count: {
71
- value: 50,
72
- unit: "count"
73
- },
74
- bot_integration_secret_count: {
75
- value: 25,
76
- unit: "count"
77
- },
78
- files_api_query_bytes: {
79
- value: 2048,
80
- // 2 KB
81
- unit: "bytes"
82
- },
83
- code_payload_bytes: {
84
- value: 52428800,
85
- // 50 MB
86
- unit: "bytes"
87
- }
88
- };
89
-
90
- // src/prefixes.ts
91
- var prefixToObjectMap = {
92
- accnt: "account",
93
- accntpf: "accountPreference",
94
- action: "action",
95
- activty: "activity",
96
- anlytic: "analytics",
97
- audit: "audit",
98
- bak: "botApiKey",
99
- bot: "bot",
100
- card: "card",
101
- cfg: "configuration",
102
- channel: "channel",
103
- conv: "conversation",
104
- devbot: "devBot",
105
- devint: "devIntegration",
106
- evt: "event",
107
- file: "file",
108
- flow: "flow",
109
- iak: "integrationApiKey",
110
- int: "integration",
111
- iface: "interface",
112
- ifver: "interfaceVersion",
113
- intver: "integrationVersion",
114
- iss: "issue",
115
- issevt: "issueEvent",
116
- kb: "knowledgeBase",
117
- limit: "limit",
118
- media: "media",
119
- msg: "message",
120
- node: "node",
121
- notif: "notification",
122
- pat: "personalAccessToken",
123
- plugin: "plugin",
124
- plugver: "pluginVersion",
125
- quota: "quota",
126
- recevt: "recurringEvent",
127
- report: "report",
128
- sandbox: "sandbox",
129
- schema: "schema",
130
- script: "script",
131
- state: "state",
132
- table: "table",
133
- tag: "tag",
134
- task: "task",
135
- usage: "usage",
136
- user: "user",
137
- webhook: "webhook",
138
- wkspace: "workspace",
139
- wrkflow: "workflow"
140
- };
141
- var objectToPrefixMap = {
142
- account: "accnt",
143
- accountPreference: "accntpf",
144
- action: "action",
145
- activity: "activty",
146
- analytics: "anlytic",
147
- audit: "audit",
148
- bot: "bot",
149
- botApiKey: "bak",
150
- card: "card",
151
- channel: "channel",
152
- configuration: "cfg",
153
- conversation: "conv",
154
- devBot: "devbot",
155
- devIntegration: "devint",
156
- event: "evt",
157
- file: "file",
158
- flow: "flow",
159
- integration: "int",
160
- integrationApiKey: "iak",
161
- integrationVersion: "intver",
162
- interface: "iface",
163
- interfaceVersion: "ifver",
164
- issue: "iss",
165
- issueEvent: "issevt",
166
- knowledgeBase: "kb",
167
- limit: "limit",
168
- media: "media",
169
- message: "msg",
170
- node: "node",
171
- notification: "notif",
172
- personalAccessToken: "pat",
173
- plugin: "plugin",
174
- pluginVersion: "plugver",
175
- quota: "quota",
176
- recurringEvent: "recevt",
177
- report: "report",
178
- sandbox: "sandbox",
179
- schema: "schema",
180
- script: "script",
181
- state: "state",
182
- table: "table",
183
- tag: "tag",
184
- task: "task",
185
- usage: "usage",
186
- user: "user",
187
- webhook: "webhook",
188
- workflow: "wrkflow",
189
- workspace: "wkspace"
190
- };
191
-
192
- // src/quotas.ts
193
- var quotaTypes = [
194
- "invocation_timeout",
195
- "invocation_calls",
196
- "storage_count",
197
- "bot_count",
198
- "knowledgebase_vector_storage",
199
- "workspace_ratelimit",
200
- "table_row_count",
201
- "workspace_member_count",
202
- "integrations_owned_count",
203
- "ai_spend",
204
- "openai_spend",
205
- "bing_search_spend",
206
- "always_alive"
207
- ];
208
- var quotaConfigs = {
209
- invocation_timeout: {
210
- name: "Invocation Timeout",
211
- description: "Maximum time in milliseconds a bot can run before timing out.",
212
- default: 6e4,
213
- kind: "workspace",
214
- category: "timeout",
215
- trackUsagePerBot: false
216
- },
217
- storage_count: {
218
- name: "Storage Count",
219
- description: "Maximum number of storage bytes that can be stored.",
220
- default: 5e8,
221
- // 500 MB
222
- kind: "workspace",
223
- category: "count",
224
- trackUsagePerBot: true
225
- },
226
- bot_count: {
227
- name: "Bot Count",
228
- description: "Maximum number of bots that can be created.",
229
- default: 5,
230
- kind: "workspace",
231
- category: "count",
232
- trackUsagePerBot: false
233
- },
234
- workspace_member_count: {
235
- name: "Workspace Member Count",
236
- description: "Maximum number of members that can be added to a workspace.",
237
- default: 3,
238
- kind: "workspace",
239
- category: "count",
240
- trackUsagePerBot: false
241
- },
242
- knowledgebase_vector_storage: {
243
- name: "Knowledgebase Vector Storage",
244
- description: "Maximum size of knowledge base documents",
245
- default: 1e8,
246
- // 100 MB
247
- kind: "workspace",
248
- category: "count",
249
- trackUsagePerBot: true
250
- },
251
- table_row_count: {
252
- name: "Table Row Count",
253
- description: "Maximum number of rows that can be stored in a table.",
254
- default: 5e3,
255
- kind: "workspace",
256
- category: "count",
257
- trackUsagePerBot: true
258
- },
259
- invocation_calls: {
260
- name: "Messages",
261
- description: "Maximum number of messages sent to a bot in a month.",
262
- default: 2e3,
263
- kind: "workspace",
264
- category: "calls",
265
- trackUsagePerBot: true
266
- },
267
- workspace_ratelimit: {
268
- name: "Workspace Ratelimit",
269
- description: "Maximum number of API calls per second for a workspace.",
270
- default: 100,
271
- kind: "workspace",
272
- category: "ratelimit",
273
- trackUsagePerBot: false
274
- },
275
- integrations_owned_count: {
276
- name: "Owned Integrations Count",
277
- description: "Maximum number of integrations that can be created.",
278
- default: 20,
279
- kind: "workspace",
280
- category: "count",
281
- trackUsagePerBot: false
282
- },
283
- ai_spend: {
284
- name: "AI Spend",
285
- description: "Maximum amount of AI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
286
- default: 5e9,
287
- kind: "workspace",
288
- category: "credit",
289
- trackUsagePerBot: true
290
- },
291
- openai_spend: {
292
- name: "OpenAI Spend",
293
- description: "Maximum amount of OpenAI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
294
- default: 5e9,
295
- kind: "workspace",
296
- category: "credit",
297
- trackUsagePerBot: true,
298
- parent: "ai_spend"
299
- },
300
- bing_search_spend: {
301
- name: "Bing Search Spend",
302
- description: "Maximum amount of Bing Search spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
303
- default: 5e9,
304
- kind: "workspace",
305
- category: "credit",
306
- trackUsagePerBot: true,
307
- parent: "ai_spend"
308
- },
309
- always_alive: {
310
- name: "Always Alive",
311
- description: "Maximum number of bots that can be in always alive mode.",
312
- default: 0,
313
- kind: "workspace",
314
- category: "count",
315
- trackUsagePerBot: false
316
- }
317
- };
318
- var quotaConfigsV3 = {
319
- invocation_timeout: {
320
- name: "Invocation Timeout",
321
- description: "Maximum time in milliseconds a bot can run before timing out.",
322
- default: 6e4,
323
- kind: "workspace",
324
- category: "timeout",
325
- trackUsagePerBot: false
326
- },
327
- storage_count: {
328
- name: "Storage Count",
329
- description: "Maximum number of storage bytes that can be stored.",
330
- default: 1e8,
331
- // 100 MB
332
- kind: "workspace",
333
- category: "count",
334
- trackUsagePerBot: true
335
- },
336
- bot_count: {
337
- name: "Bot Count",
338
- description: "Maximum number of bots that can be created.",
339
- default: 1,
340
- kind: "workspace",
341
- category: "count",
342
- trackUsagePerBot: false
343
- },
344
- workspace_member_count: {
345
- name: "Workspace Member Count",
346
- description: "Maximum number of members that can be added to a workspace.",
347
- default: 1,
348
- kind: "workspace",
349
- category: "count",
350
- trackUsagePerBot: false
351
- },
352
- knowledgebase_vector_storage: {
353
- name: "Knowledgebase Vector Storage",
354
- description: "Maximum size of knowledge base documents",
355
- default: 1e8,
356
- // 100 MB
357
- kind: "workspace",
358
- category: "count",
359
- trackUsagePerBot: true
360
- },
361
- table_row_count: {
362
- name: "Table Row Count",
363
- description: "Maximum number of rows that can be stored in a table.",
364
- default: 1e3,
365
- kind: "workspace",
366
- category: "count",
367
- trackUsagePerBot: true
368
- },
369
- invocation_calls: {
370
- name: "Messages",
371
- description: "Maximum number of messages sent to a bot in a month.",
372
- default: 500,
373
- kind: "workspace",
374
- category: "calls",
375
- trackUsagePerBot: true
376
- },
377
- workspace_ratelimit: {
378
- name: "Workspace Ratelimit",
379
- description: "Maximum number of API calls per second for a workspace.",
380
- default: 100,
381
- kind: "workspace",
382
- category: "ratelimit",
383
- trackUsagePerBot: false
384
- },
385
- integrations_owned_count: {
386
- name: "Owned Integrations Count",
387
- description: "Maximum number of integrations that can be created.",
388
- default: 20,
389
- kind: "workspace",
390
- category: "count",
391
- trackUsagePerBot: false
392
- },
393
- ai_spend: {
394
- name: "AI Spend",
395
- description: "Maximum amount of AI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
396
- default: 5e9,
397
- kind: "workspace",
398
- category: "credit",
399
- trackUsagePerBot: true
400
- },
401
- openai_spend: {
402
- name: "OpenAI Spend",
403
- description: "Maximum amount of OpenAI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
404
- default: 5e9,
405
- kind: "workspace",
406
- category: "credit",
407
- trackUsagePerBot: true,
408
- parent: "ai_spend"
409
- },
410
- bing_search_spend: {
411
- name: "Bing Search Spend",
412
- description: "Maximum amount of Bing Search spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
413
- default: 5e9,
414
- kind: "workspace",
415
- category: "credit",
416
- trackUsagePerBot: true,
417
- parent: "ai_spend"
418
- },
419
- always_alive: {
420
- name: "Always Alive",
421
- description: "Maximum number of bots that can be in always alive mode.",
422
- default: 0,
423
- kind: "workspace",
424
- category: "count",
425
- trackUsagePerBot: false
426
- }
427
- };
428
-
429
- // src/tags.ts
430
- var Tags = {
431
- bot: {},
432
- conversation: {
433
- upstream: {
434
- description: "Used for HITL as a convention. The upstream conversation ID, ie. the conversation ID of the original conversation"
435
- },
436
- downstream: {
437
- description: "Used for HITL as a convention. The downstream conversation ID, ie. the conversation ID of conversation in HITL channel"
438
- }
439
- },
440
- message: {
441
- origin: {
442
- description: 'The origin location of the message in the bot, eg. "workflow://[id]/node/[id]"'
443
- },
444
- iteration: {
445
- description: "The LLMz iteration ID of the message, for tracking and debugging purposes"
446
- }
447
- },
448
- event: {},
449
- workflow: {},
450
- user: {},
451
- file: {
452
- system: {
453
- type: "boolean",
454
- description: "System files are managed by Botpress and should not be modified"
455
- },
456
- purpose: {
457
- description: 'The purpose of the file, eg. "swap"'
458
- },
459
- source: {
460
- description: 'The source of the file, eg. "knowledge-base"'
461
- },
462
- kbId: {
463
- description: "The ID of the knowledge base"
464
- },
465
- favicon: {
466
- description: 'The favicon URL to display for the file, eg. "https://example.com/favicon.ico"'
467
- },
468
- pageUrl: {
469
- description: 'The original page URL of the file, eg. "https://example.com/page"'
470
- },
471
- integrationName: {
472
- description: "The name of the integration that created the file"
473
- },
474
- webchatInjectConfigVersion: {
475
- description: "The version of the webchat inject configuration (used by the dashboard)"
476
- }
477
- },
478
- table: {
479
- system: {
480
- type: "boolean",
481
- description: "System tables are managed by Botpress and should not be modified"
482
- },
483
- "x-studio-title": {
484
- description: "Overrides the table title in the Studio"
485
- },
486
- "x-studio-readonly": {
487
- type: "boolean",
488
- description: "Prevents the table from being modified by the user in the Studio"
489
- },
490
- "x-studio-icon": {
491
- description: 'Overrides the table icon in the Studio. The value can be a lucide icon URL, eg. "lucide://atom"'
492
- },
493
- "x-studio-color": {
494
- description: "Overrides the table color in the Studio."
495
- },
496
- "x-studio-folder": {
497
- description: "Groups the table in a folder in the Studio"
498
- },
499
- "x-studio-deletable": {
500
- type: "boolean",
501
- description: "Prevents the table from being deleted by the user in the Studio"
502
- }
503
- }
504
- };
505
- export {
506
- Tags,
507
- limitConfigs,
508
- objectToPrefixMap,
509
- prefixToObjectMap,
510
- quotaConfigs,
511
- quotaConfigsV3,
512
- quotaTypes
513
- };
@@ -1,10 +0,0 @@
1
- {
2
- "folders": [
3
- {
4
- "path": "."
5
- }
6
- ],
7
- "settings": {
8
- "typescript.tsdk": "node_modules/typescript/lib"
9
- }
10
- }
package/readme.md DELETED
@@ -1,9 +0,0 @@
1
- # Const
2
-
3
- Botpress specific constants
4
-
5
- ## Disclaimer ⚠️
6
-
7
- This package is published under the `@bpinternal` organization. All packages of this organization are meant to be used by the [Botpress](https://github.com/botpress/botpress) team internally and are not meant for our community. Since the packages are catered to our own use-cases, they might have less stable APIs, receive breaking changes without much warning, have minimal documentation and lack community-focused support. However, these packages were still left intentionally public for an important reason : We Love Open-Source. Therefore, if you wish to install or fork this package feel absolutly free to do it. We strongly recommend that you tag your versions properly.
8
-
9
- The Botpress Engineering team.
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './limits'
2
- export * from './prefixes'
3
- export * from './quotas'
4
- export * from './tags'
package/src/limits.ts DELETED
@@ -1,92 +0,0 @@
1
- type Limit = {
2
- /**
3
- * The maximum value for the limit.
4
- */
5
- value: number
6
- /**
7
- * The unit of the limit.
8
- */
9
- unit: LimitUnit
10
- }
11
-
12
- export type LimitType = keyof typeof limitConfigs
13
- export type LimitUnit = 'count' | 'bytes'
14
-
15
- export const limitConfigs = {
16
- bot_configuration_bytes: {
17
- value: 20480, // 20 KB
18
- unit: 'bytes'
19
- },
20
- bot_installed_integrations_count: {
21
- value: 30,
22
- unit: 'count'
23
- },
24
- bot_integration_configuration_bytes: {
25
- value: 20480, // 20 KB
26
- unit: 'bytes'
27
- },
28
- bot_recurring_event_count: {
29
- value: 40,
30
- unit: 'count'
31
- },
32
- bot_recurring_event_payload_bytes: {
33
- value: 131072, // 128 KB
34
- unit: 'bytes'
35
- },
36
- event_definition_count: {
37
- value: 20,
38
- unit: 'count'
39
- },
40
- integration_channel_count: {
41
- value: 10,
42
- unit: 'count'
43
- },
44
- integration_channel_message_type_count: {
45
- value: 20,
46
- unit: 'count'
47
- },
48
- integration_identifier_count: {
49
- value: 50,
50
- unit: 'count'
51
- },
52
- integration_version_count: {
53
- value: 50,
54
- unit: 'count'
55
- },
56
- issue_event_item_payload_bytes: {
57
- value: 131072, // 128 KB
58
- unit: 'bytes'
59
- },
60
- message_payload_bytes: {
61
- value: 131072, // 128 KB
62
- unit: 'bytes'
63
- },
64
- schema_bytes: {
65
- value: 102400, // 100 KB
66
- unit: 'bytes'
67
- },
68
- state_definition_count: {
69
- value: 10,
70
- unit: 'count'
71
- },
72
- state_item_payload_bytes: {
73
- value: 131072, // 128 KB
74
- unit: 'bytes'
75
- },
76
- tag_definition_count: {
77
- value: 50,
78
- unit: 'count'
79
- },
80
- bot_integration_secret_count: {
81
- value: 25,
82
- unit: 'count'
83
- },
84
- files_api_query_bytes: {
85
- value: 2048, // 2 KB
86
- unit: 'bytes'
87
- },
88
- code_payload_bytes: {
89
- value: 52428800, // 50 MB
90
- unit: 'bytes'
91
- }
92
- } as const satisfies Record<string, Limit>