@bpinternal/const 0.0.14 → 0.0.16

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.cjs CHANGED
@@ -189,13 +189,11 @@ var quotaTypes = [
189
189
  "invocation_calls",
190
190
  "storage_count",
191
191
  "bot_count",
192
- "knowledgebase_vector_count",
193
- "bot_ratelimit",
192
+ "knowledgebase_vector_storage",
193
+ "workspace_ratelimit",
194
194
  "table_row_count",
195
195
  "workspace_member_count",
196
196
  "integrations_owned_count",
197
- "cognitive_calls",
198
- "model_credit",
199
197
  "token_spend"
200
198
  ];
201
199
  var quotaConfigs = {
@@ -209,10 +207,11 @@ var quotaConfigs = {
209
207
  storage_count: {
210
208
  name: "Storage Count",
211
209
  description: "Maximum number of storage bytes that can be stored.",
212
- default: 104857600,
213
- // 100 MB
214
- kind: "bot",
215
- category: "count"
210
+ default: 524288e3,
211
+ // 500 MB
212
+ kind: "workspace",
213
+ category: "count",
214
+ trackUsagePerBot: true
216
215
  },
217
216
  bot_count: {
218
217
  name: "Bot Count",
@@ -228,39 +227,36 @@ var quotaConfigs = {
228
227
  kind: "workspace",
229
228
  category: "count"
230
229
  },
231
- knowledgebase_vector_count: {
232
- name: "Knowledgebase Vector Count",
233
- description: "Maximum number of knowledgebase vectors that can be created.",
234
- default: 5e3,
235
- kind: "bot",
236
- category: "count"
230
+ knowledgebase_vector_storage: {
231
+ name: "Knowledgebase Vector Storage",
232
+ description: "Maximum size knowledge base documents",
233
+ default: 104857600,
234
+ // 100 MB
235
+ kind: "workspace",
236
+ category: "count",
237
+ trackUsagePerBot: true
237
238
  },
238
239
  table_row_count: {
239
240
  name: "Table Row Count",
240
241
  description: "Maximum number of rows that can be stored in a table.",
241
242
  default: 5e3,
242
- kind: "bot",
243
- category: "count"
243
+ kind: "workspace",
244
+ category: "count",
245
+ trackUsagePerBot: true
244
246
  },
245
247
  invocation_calls: {
246
248
  name: "Invocation Calls",
247
249
  description: "Maximum number of times a bot can be invoked in a month.",
248
- default: 25e3,
249
- kind: "bot",
250
- category: "calls"
251
- },
252
- cognitive_calls: {
253
- name: "Cognitive Calls",
254
- description: "Maximum number of times a cognitive service can be called in a month.",
255
- default: 4e3,
256
- kind: "bot",
257
- category: "calls"
250
+ default: 2e3,
251
+ kind: "workspace",
252
+ category: "calls",
253
+ trackUsagePerBot: true
258
254
  },
259
- bot_ratelimit: {
260
- name: "Bot Ratelimit",
261
- description: "Maximum number of times a bot can be invoked in a minute.",
255
+ workspace_ratelimit: {
256
+ name: "Workspace Ratelimit",
257
+ description: "Maximum number of API calls per second for a workspace.",
262
258
  default: 100,
263
- kind: "bot",
259
+ kind: "workspace",
264
260
  category: "ratelimit"
265
261
  },
266
262
  integrations_owned_count: {
@@ -270,19 +266,13 @@ var quotaConfigs = {
270
266
  kind: "workspace",
271
267
  category: "count"
272
268
  },
273
- model_credit: {
274
- name: "Model Credit",
275
- description: "Maximum amount of ai model credit that can be used in a month.",
276
- default: 5e3,
277
- kind: "bot",
278
- category: "credit"
279
- },
280
269
  token_spend: {
281
270
  name: "Token Spend",
282
271
  description: "Maximum amount of token spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
283
272
  default: 5e9,
284
273
  kind: "workspace",
285
- category: "credit"
274
+ category: "credit",
275
+ trackUsagePerBot: true
286
276
  }
287
277
  };
288
278
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -159,13 +159,11 @@ var quotaTypes = [
159
159
  "invocation_calls",
160
160
  "storage_count",
161
161
  "bot_count",
162
- "knowledgebase_vector_count",
163
- "bot_ratelimit",
162
+ "knowledgebase_vector_storage",
163
+ "workspace_ratelimit",
164
164
  "table_row_count",
165
165
  "workspace_member_count",
166
166
  "integrations_owned_count",
167
- "cognitive_calls",
168
- "model_credit",
169
167
  "token_spend"
170
168
  ];
171
169
  var quotaConfigs = {
@@ -179,10 +177,11 @@ var quotaConfigs = {
179
177
  storage_count: {
180
178
  name: "Storage Count",
181
179
  description: "Maximum number of storage bytes that can be stored.",
182
- default: 104857600,
183
- // 100 MB
184
- kind: "bot",
185
- category: "count"
180
+ default: 524288e3,
181
+ // 500 MB
182
+ kind: "workspace",
183
+ category: "count",
184
+ trackUsagePerBot: true
186
185
  },
187
186
  bot_count: {
188
187
  name: "Bot Count",
@@ -198,39 +197,36 @@ var quotaConfigs = {
198
197
  kind: "workspace",
199
198
  category: "count"
200
199
  },
201
- knowledgebase_vector_count: {
202
- name: "Knowledgebase Vector Count",
203
- description: "Maximum number of knowledgebase vectors that can be created.",
204
- default: 5e3,
205
- kind: "bot",
206
- category: "count"
200
+ knowledgebase_vector_storage: {
201
+ name: "Knowledgebase Vector Storage",
202
+ description: "Maximum size knowledge base documents",
203
+ default: 104857600,
204
+ // 100 MB
205
+ kind: "workspace",
206
+ category: "count",
207
+ trackUsagePerBot: true
207
208
  },
208
209
  table_row_count: {
209
210
  name: "Table Row Count",
210
211
  description: "Maximum number of rows that can be stored in a table.",
211
212
  default: 5e3,
212
- kind: "bot",
213
- category: "count"
213
+ kind: "workspace",
214
+ category: "count",
215
+ trackUsagePerBot: true
214
216
  },
215
217
  invocation_calls: {
216
218
  name: "Invocation Calls",
217
219
  description: "Maximum number of times a bot can be invoked in a month.",
218
- default: 25e3,
219
- kind: "bot",
220
- category: "calls"
221
- },
222
- cognitive_calls: {
223
- name: "Cognitive Calls",
224
- description: "Maximum number of times a cognitive service can be called in a month.",
225
- default: 4e3,
226
- kind: "bot",
227
- category: "calls"
220
+ default: 2e3,
221
+ kind: "workspace",
222
+ category: "calls",
223
+ trackUsagePerBot: true
228
224
  },
229
- bot_ratelimit: {
230
- name: "Bot Ratelimit",
231
- description: "Maximum number of times a bot can be invoked in a minute.",
225
+ workspace_ratelimit: {
226
+ name: "Workspace Ratelimit",
227
+ description: "Maximum number of API calls per second for a workspace.",
232
228
  default: 100,
233
- kind: "bot",
229
+ kind: "workspace",
234
230
  category: "ratelimit"
235
231
  },
236
232
  integrations_owned_count: {
@@ -240,19 +236,13 @@ var quotaConfigs = {
240
236
  kind: "workspace",
241
237
  category: "count"
242
238
  },
243
- model_credit: {
244
- name: "Model Credit",
245
- description: "Maximum amount of ai model credit that can be used in a month.",
246
- default: 5e3,
247
- kind: "bot",
248
- category: "credit"
249
- },
250
239
  token_spend: {
251
240
  name: "Token Spend",
252
241
  description: "Maximum amount of token spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
253
242
  default: 5e9,
254
243
  kind: "workspace",
255
- category: "credit"
244
+ category: "credit",
245
+ trackUsagePerBot: true
256
246
  }
257
247
  };
258
248
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Constant utilities for Botpress",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.mjs",
package/src/quotas.ts CHANGED
@@ -19,6 +19,10 @@ export type Quota = {
19
19
  * The usage category determine how the usage is calculated.
20
20
  */
21
21
  category: QuotaCategory
22
+ /**
23
+ * If true, the usage is tracked per bot. This is only applicable if the kind is workspace.
24
+ */
25
+ trackUsagePerBot?: boolean
22
26
  }
23
27
 
24
28
  export type QuotaKind = 'workspace' | 'bot'
@@ -30,13 +34,11 @@ export const quotaTypes = [
30
34
  'invocation_calls',
31
35
  'storage_count',
32
36
  'bot_count',
33
- 'knowledgebase_vector_count',
34
- 'bot_ratelimit',
37
+ 'knowledgebase_vector_storage',
38
+ 'workspace_ratelimit',
35
39
  'table_row_count',
36
40
  'workspace_member_count',
37
41
  'integrations_owned_count',
38
- 'cognitive_calls',
39
- 'model_credit',
40
42
  'token_spend'
41
43
  ] as const satisfies Readonly<string[]>
42
44
 
@@ -51,9 +53,10 @@ export const quotaConfigs = {
51
53
  storage_count: {
52
54
  name: 'Storage Count',
53
55
  description: 'Maximum number of storage bytes that can be stored.',
54
- default: 104_857_600, // 100 MB
55
- kind: 'bot',
56
- category: 'count'
56
+ default: 524_288_000, // 500 MB
57
+ kind: 'workspace',
58
+ category: 'count',
59
+ trackUsagePerBot: true
57
60
  },
58
61
  bot_count: {
59
62
  name: 'Bot Count',
@@ -69,39 +72,35 @@ export const quotaConfigs = {
69
72
  kind: 'workspace',
70
73
  category: 'count'
71
74
  },
72
- knowledgebase_vector_count: {
73
- name: 'Knowledgebase Vector Count',
74
- description: 'Maximum number of knowledgebase vectors that can be created.',
75
- default: 5_000,
76
- kind: 'bot',
77
- category: 'count'
75
+ knowledgebase_vector_storage: {
76
+ name: 'Knowledgebase Vector Storage',
77
+ description: 'Maximum size knowledge base documents',
78
+ default: 104_857_600, // 100 MB
79
+ kind: 'workspace',
80
+ category: 'count',
81
+ trackUsagePerBot: true
78
82
  },
79
83
  table_row_count: {
80
84
  name: 'Table Row Count',
81
85
  description: 'Maximum number of rows that can be stored in a table.',
82
86
  default: 5_000,
83
- kind: 'bot',
84
- category: 'count'
87
+ kind: 'workspace',
88
+ category: 'count',
89
+ trackUsagePerBot: true
85
90
  },
86
91
  invocation_calls: {
87
92
  name: 'Invocation Calls',
88
93
  description: 'Maximum number of times a bot can be invoked in a month.',
89
- default: 25_000,
90
- kind: 'bot',
91
- category: 'calls'
92
- },
93
- cognitive_calls: {
94
- name: 'Cognitive Calls',
95
- description: 'Maximum number of times a cognitive service can be called in a month.',
96
- default: 4_000,
97
- kind: 'bot',
98
- category: 'calls'
94
+ default: 2_000,
95
+ kind: 'workspace',
96
+ category: 'calls',
97
+ trackUsagePerBot: true
99
98
  },
100
- bot_ratelimit: {
101
- name: 'Bot Ratelimit',
102
- description: 'Maximum number of times a bot can be invoked in a minute.',
99
+ workspace_ratelimit: {
100
+ name: 'Workspace Ratelimit',
101
+ description: 'Maximum number of API calls per second for a workspace.',
103
102
  default: 100,
104
- kind: 'bot',
103
+ kind: 'workspace',
105
104
  category: 'ratelimit'
106
105
  },
107
106
  integrations_owned_count: {
@@ -111,19 +110,13 @@ export const quotaConfigs = {
111
110
  kind: 'workspace',
112
111
  category: 'count'
113
112
  },
114
- model_credit: {
115
- name: 'Model Credit',
116
- description: 'Maximum amount of ai model credit that can be used in a month.',
117
- default: 5000,
118
- kind: 'bot',
119
- category: 'credit'
120
- },
121
113
  token_spend: {
122
114
  name: 'Token Spend',
123
115
  description:
124
116
  'Maximum amount of token spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.',
125
117
  default: 5_000_000_000,
126
118
  kind: 'workspace',
127
- category: 'credit'
119
+ category: 'credit',
120
+ trackUsagePerBot: true
128
121
  }
129
122
  } as const satisfies Record<QuotaType, Quota>