@bpinternal/const 0.0.17 → 0.0.19

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
@@ -194,7 +194,9 @@ var quotaTypes = [
194
194
  "table_row_count",
195
195
  "workspace_member_count",
196
196
  "integrations_owned_count",
197
- "token_spend"
197
+ "ai_spend",
198
+ "openai_spend",
199
+ "bing_search_spend"
198
200
  ];
199
201
  var quotaConfigs = {
200
202
  invocation_timeout: {
@@ -271,13 +273,31 @@ var quotaConfigs = {
271
273
  category: "count",
272
274
  trackUsagePerBot: false
273
275
  },
274
- token_spend: {
275
- name: "Token Spend",
276
- description: "Maximum amount of token spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
276
+ ai_spend: {
277
+ name: "AI Spend",
278
+ description: "Maximum amount of AI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
277
279
  default: 5e9,
278
280
  kind: "workspace",
279
281
  category: "credit",
280
282
  trackUsagePerBot: true
283
+ },
284
+ openai_spend: {
285
+ name: "OpenAI Spend",
286
+ description: "Maximum amount of OpenAI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
287
+ default: 5e9,
288
+ kind: "workspace",
289
+ category: "credit",
290
+ trackUsagePerBot: true,
291
+ parent: "ai_spend"
292
+ },
293
+ bing_search_spend: {
294
+ name: "Bing Search Spend",
295
+ description: "Maximum amount of Bing Search spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
296
+ default: 5e9,
297
+ kind: "workspace",
298
+ category: "credit",
299
+ trackUsagePerBot: true,
300
+ parent: "ai_spend"
281
301
  }
282
302
  };
283
303
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -164,7 +164,9 @@ var quotaTypes = [
164
164
  "table_row_count",
165
165
  "workspace_member_count",
166
166
  "integrations_owned_count",
167
- "token_spend"
167
+ "ai_spend",
168
+ "openai_spend",
169
+ "bing_search_spend"
168
170
  ];
169
171
  var quotaConfigs = {
170
172
  invocation_timeout: {
@@ -241,13 +243,31 @@ var quotaConfigs = {
241
243
  category: "count",
242
244
  trackUsagePerBot: false
243
245
  },
244
- token_spend: {
245
- name: "Token Spend",
246
- description: "Maximum amount of token spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
246
+ ai_spend: {
247
+ name: "AI Spend",
248
+ description: "Maximum amount of AI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
247
249
  default: 5e9,
248
250
  kind: "workspace",
249
251
  category: "credit",
250
252
  trackUsagePerBot: true
253
+ },
254
+ openai_spend: {
255
+ name: "OpenAI Spend",
256
+ description: "Maximum amount of OpenAI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
257
+ default: 5e9,
258
+ kind: "workspace",
259
+ category: "credit",
260
+ trackUsagePerBot: true,
261
+ parent: "ai_spend"
262
+ },
263
+ bing_search_spend: {
264
+ name: "Bing Search Spend",
265
+ description: "Maximum amount of Bing Search spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.",
266
+ default: 5e9,
267
+ kind: "workspace",
268
+ category: "credit",
269
+ trackUsagePerBot: true,
270
+ parent: "ai_spend"
251
271
  }
252
272
  };
253
273
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "Constant utilities for Botpress",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.mjs",
package/src/quotas.ts CHANGED
@@ -23,6 +23,10 @@ export type Quota = {
23
23
  * If true, the usage is tracked per bot. This is only applicable if the kind is workspace.
24
24
  */
25
25
  trackUsagePerBot: boolean
26
+ /**
27
+ * Parent quota type. This is used to determine the object linked to the usage type.
28
+ */
29
+ parent?: QuotaType
26
30
  }
27
31
 
28
32
  export type QuotaKind = 'workspace' | 'bot'
@@ -39,7 +43,9 @@ export const quotaTypes = [
39
43
  'table_row_count',
40
44
  'workspace_member_count',
41
45
  'integrations_owned_count',
42
- 'token_spend'
46
+ 'ai_spend',
47
+ 'openai_spend',
48
+ 'bing_search_spend',
43
49
  ] as const satisfies Readonly<string[]>
44
50
 
45
51
  export const quotaConfigs = {
@@ -115,13 +121,33 @@ export const quotaConfigs = {
115
121
  category: 'count',
116
122
  trackUsagePerBot: false
117
123
  },
118
- token_spend: {
119
- name: 'Token Spend',
124
+ ai_spend: {
125
+ name: 'AI Spend',
120
126
  description:
121
- 'Maximum amount of token spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.',
127
+ 'Maximum amount of AI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.',
122
128
  default: 5_000_000_000,
123
129
  kind: 'workspace',
124
130
  category: 'credit',
125
131
  trackUsagePerBot: true
126
- }
132
+ },
133
+ openai_spend: {
134
+ name: 'OpenAI Spend',
135
+ description:
136
+ 'Maximum amount of OpenAI spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.',
137
+ default: 5_000_000_000,
138
+ kind: 'workspace',
139
+ category: 'credit',
140
+ trackUsagePerBot: true,
141
+ parent: 'ai_spend'
142
+ },
143
+ bing_search_spend: {
144
+ name: 'Bing Search Spend',
145
+ description:
146
+ 'Maximum amount of Bing Search spend, expressed in nano-dollars (1 nano-dollar = $0.000000001) that can be used in a month.',
147
+ default: 5_000_000_000,
148
+ kind: 'workspace',
149
+ category: 'credit',
150
+ trackUsagePerBot: true,
151
+ parent: 'ai_spend'
152
+ },
127
153
  } as const satisfies Record<QuotaType, Quota>