@bpinternal/const 0.0.10 → 0.0.12
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 +20 -2
- package/dist/index.mjs +20 -2
- package/package.json +2 -2
- package/src/prefixes.ts +6 -3
- package/src/quotas.ts +19 -3
package/dist/index.cjs
CHANGED
|
@@ -132,6 +132,7 @@ var prefixToObjectMap = {
|
|
|
132
132
|
recevt: "recurringEvent",
|
|
133
133
|
sandbox: "sandbox",
|
|
134
134
|
schema: "schema",
|
|
135
|
+
script: "script",
|
|
135
136
|
state: "state",
|
|
136
137
|
table: "table",
|
|
137
138
|
tag: "tag",
|
|
@@ -154,8 +155,8 @@ var objectToPrefixMap = {
|
|
|
154
155
|
file: "file",
|
|
155
156
|
flow: "flow",
|
|
156
157
|
integration: "int",
|
|
157
|
-
integrationVersion: "intver",
|
|
158
158
|
integrationApiKey: "iak",
|
|
159
|
+
integrationVersion: "intver",
|
|
159
160
|
issue: "iss",
|
|
160
161
|
issueEvent: "issevt",
|
|
161
162
|
knowledgeBase: "kb",
|
|
@@ -168,6 +169,7 @@ var objectToPrefixMap = {
|
|
|
168
169
|
recurringEvent: "recevt",
|
|
169
170
|
sandbox: "sandbox",
|
|
170
171
|
schema: "schema",
|
|
172
|
+
script: "script",
|
|
171
173
|
state: "state",
|
|
172
174
|
table: "table",
|
|
173
175
|
tag: "tag",
|
|
@@ -187,7 +189,9 @@ var quotaTypes = [
|
|
|
187
189
|
"bot_ratelimit",
|
|
188
190
|
"table_row_count",
|
|
189
191
|
"workspace_member_count",
|
|
190
|
-
"integrations_owned_count"
|
|
192
|
+
"integrations_owned_count",
|
|
193
|
+
"cognitive_calls",
|
|
194
|
+
"model_credit"
|
|
191
195
|
];
|
|
192
196
|
var quotaConfigs = {
|
|
193
197
|
invocation_timeout: {
|
|
@@ -240,6 +244,13 @@ var quotaConfigs = {
|
|
|
240
244
|
kind: "bot",
|
|
241
245
|
category: "calls"
|
|
242
246
|
},
|
|
247
|
+
cognitive_calls: {
|
|
248
|
+
name: "Cognitive Calls",
|
|
249
|
+
description: "Maximum number of times a cognitive service can be called in a month.",
|
|
250
|
+
default: 4e3,
|
|
251
|
+
kind: "bot",
|
|
252
|
+
category: "calls"
|
|
253
|
+
},
|
|
243
254
|
bot_ratelimit: {
|
|
244
255
|
name: "Bot Ratelimit",
|
|
245
256
|
description: "Maximum number of times a bot can be invoked in a minute.",
|
|
@@ -253,6 +264,13 @@ var quotaConfigs = {
|
|
|
253
264
|
default: 20,
|
|
254
265
|
kind: "workspace",
|
|
255
266
|
category: "count"
|
|
267
|
+
},
|
|
268
|
+
model_credit: {
|
|
269
|
+
name: "Model Credit",
|
|
270
|
+
description: "Maximum amount of ai model credit that can be used in a month.",
|
|
271
|
+
default: 5e3,
|
|
272
|
+
kind: "bot",
|
|
273
|
+
category: "credit"
|
|
256
274
|
}
|
|
257
275
|
};
|
|
258
276
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -102,6 +102,7 @@ var prefixToObjectMap = {
|
|
|
102
102
|
recevt: "recurringEvent",
|
|
103
103
|
sandbox: "sandbox",
|
|
104
104
|
schema: "schema",
|
|
105
|
+
script: "script",
|
|
105
106
|
state: "state",
|
|
106
107
|
table: "table",
|
|
107
108
|
tag: "tag",
|
|
@@ -124,8 +125,8 @@ var objectToPrefixMap = {
|
|
|
124
125
|
file: "file",
|
|
125
126
|
flow: "flow",
|
|
126
127
|
integration: "int",
|
|
127
|
-
integrationVersion: "intver",
|
|
128
128
|
integrationApiKey: "iak",
|
|
129
|
+
integrationVersion: "intver",
|
|
129
130
|
issue: "iss",
|
|
130
131
|
issueEvent: "issevt",
|
|
131
132
|
knowledgeBase: "kb",
|
|
@@ -138,6 +139,7 @@ var objectToPrefixMap = {
|
|
|
138
139
|
recurringEvent: "recevt",
|
|
139
140
|
sandbox: "sandbox",
|
|
140
141
|
schema: "schema",
|
|
142
|
+
script: "script",
|
|
141
143
|
state: "state",
|
|
142
144
|
table: "table",
|
|
143
145
|
tag: "tag",
|
|
@@ -157,7 +159,9 @@ var quotaTypes = [
|
|
|
157
159
|
"bot_ratelimit",
|
|
158
160
|
"table_row_count",
|
|
159
161
|
"workspace_member_count",
|
|
160
|
-
"integrations_owned_count"
|
|
162
|
+
"integrations_owned_count",
|
|
163
|
+
"cognitive_calls",
|
|
164
|
+
"model_credit"
|
|
161
165
|
];
|
|
162
166
|
var quotaConfigs = {
|
|
163
167
|
invocation_timeout: {
|
|
@@ -210,6 +214,13 @@ var quotaConfigs = {
|
|
|
210
214
|
kind: "bot",
|
|
211
215
|
category: "calls"
|
|
212
216
|
},
|
|
217
|
+
cognitive_calls: {
|
|
218
|
+
name: "Cognitive Calls",
|
|
219
|
+
description: "Maximum number of times a cognitive service can be called in a month.",
|
|
220
|
+
default: 4e3,
|
|
221
|
+
kind: "bot",
|
|
222
|
+
category: "calls"
|
|
223
|
+
},
|
|
213
224
|
bot_ratelimit: {
|
|
214
225
|
name: "Bot Ratelimit",
|
|
215
226
|
description: "Maximum number of times a bot can be invoked in a minute.",
|
|
@@ -223,6 +234,13 @@ var quotaConfigs = {
|
|
|
223
234
|
default: 20,
|
|
224
235
|
kind: "workspace",
|
|
225
236
|
category: "count"
|
|
237
|
+
},
|
|
238
|
+
model_credit: {
|
|
239
|
+
name: "Model Credit",
|
|
240
|
+
description: "Maximum amount of ai model credit that can be used in a month.",
|
|
241
|
+
default: 5e3,
|
|
242
|
+
kind: "bot",
|
|
243
|
+
category: "credit"
|
|
226
244
|
}
|
|
227
245
|
};
|
|
228
246
|
export {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpinternal/const",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Constant utilities for Botpress",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"browser": "./dist/index.mjs",
|
|
7
7
|
"types": "./src/index.ts",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"type
|
|
10
|
+
"type:check": "tsc --noEmit",
|
|
11
11
|
"build:nodejs": "esbuild src/index.ts --bundle --platform=node --target=node16 --outfile=dist/index.cjs",
|
|
12
12
|
"build:browser": "esbuild src/index.ts --bundle --platform=browser --target=es2017 --format=esm --outfile=dist/index.mjs",
|
|
13
13
|
"build": "npm run build:nodejs && npm run build:browser",
|
package/src/prefixes.ts
CHANGED
|
@@ -26,6 +26,7 @@ export const prefixToObjectMap = {
|
|
|
26
26
|
recevt: 'recurringEvent',
|
|
27
27
|
sandbox: 'sandbox',
|
|
28
28
|
schema: 'schema',
|
|
29
|
+
script: 'script',
|
|
29
30
|
state: 'state',
|
|
30
31
|
table: 'table',
|
|
31
32
|
tag: 'tag',
|
|
@@ -49,8 +50,8 @@ export const objectToPrefixMap: Reverser<typeof prefixToObjectMap> = {
|
|
|
49
50
|
file: 'file',
|
|
50
51
|
flow: 'flow',
|
|
51
52
|
integration: 'int',
|
|
52
|
-
integrationVersion: 'intver',
|
|
53
53
|
integrationApiKey: 'iak',
|
|
54
|
+
integrationVersion: 'intver',
|
|
54
55
|
issue: 'iss',
|
|
55
56
|
issueEvent: 'issevt',
|
|
56
57
|
knowledgeBase: 'kb',
|
|
@@ -63,6 +64,7 @@ export const objectToPrefixMap: Reverser<typeof prefixToObjectMap> = {
|
|
|
63
64
|
recurringEvent: 'recevt',
|
|
64
65
|
sandbox: 'sandbox',
|
|
65
66
|
schema: 'schema',
|
|
67
|
+
script: 'script',
|
|
66
68
|
state: 'state',
|
|
67
69
|
table: 'table',
|
|
68
70
|
tag: 'tag',
|
|
@@ -82,8 +84,8 @@ type Ids = {
|
|
|
82
84
|
export type ActionId = Ids['ActionId']
|
|
83
85
|
export type AnalyticsId = Ids['AnalyticsId']
|
|
84
86
|
export type AuditId = Ids['AuditId']
|
|
85
|
-
export type BotId = Ids['BotId']
|
|
86
87
|
export type BotApiKeyId = Ids['BotApiKeyId']
|
|
88
|
+
export type BotId = Ids['BotId']
|
|
87
89
|
export type CardId = Ids['CardId']
|
|
88
90
|
export type ChannelId = Ids['ChannelId']
|
|
89
91
|
export type ConfigurationId = Ids['ConfigurationId']
|
|
@@ -91,8 +93,8 @@ export type ConversationId = Ids['ConversationId']
|
|
|
91
93
|
export type EventId = Ids['EventId']
|
|
92
94
|
export type FileId = Ids['FileId']
|
|
93
95
|
export type FlowId = Ids['FlowId']
|
|
94
|
-
export type IntegrationId = Ids['IntegrationId']
|
|
95
96
|
export type IntegrationApiKeyId = Ids['IntegrationApiKeyId']
|
|
97
|
+
export type IntegrationId = Ids['IntegrationId']
|
|
96
98
|
export type Issue = Ids['IssueId']
|
|
97
99
|
export type IssueEvent = Ids['IssueEventId']
|
|
98
100
|
export type KnowledgeBaseId = Ids['KnowledgeBaseId']
|
|
@@ -105,6 +107,7 @@ export type QuotaId = Ids['QuotaId']
|
|
|
105
107
|
export type RecurringEventId = Ids['RecurringEventId']
|
|
106
108
|
export type SandboxId = Ids['SandboxId']
|
|
107
109
|
export type SchemaId = Ids['SchemaId']
|
|
110
|
+
export type ScriptId = Ids['ScriptId']
|
|
108
111
|
export type StateId = Ids['StateId']
|
|
109
112
|
export type TableId = Ids['TableId']
|
|
110
113
|
export type TagId = Ids['TagId']
|
package/src/quotas.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type Quota = {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type QuotaKind = 'workspace' | 'bot'
|
|
25
|
-
export type QuotaCategory = 'ratelimit' | 'count' | 'calls' | 'timeout'
|
|
25
|
+
export type QuotaCategory = 'ratelimit' | 'count' | 'calls' | 'timeout' | 'credit'
|
|
26
26
|
export type QuotaType = (typeof quotaTypes)[number]
|
|
27
27
|
|
|
28
28
|
export const quotaTypes = [
|
|
@@ -34,7 +34,9 @@ export const quotaTypes = [
|
|
|
34
34
|
'bot_ratelimit',
|
|
35
35
|
'table_row_count',
|
|
36
36
|
'workspace_member_count',
|
|
37
|
-
'integrations_owned_count'
|
|
37
|
+
'integrations_owned_count',
|
|
38
|
+
'cognitive_calls',
|
|
39
|
+
'model_credit',
|
|
38
40
|
] as const satisfies Readonly<string[]>
|
|
39
41
|
|
|
40
42
|
export const quotaConfigs = {
|
|
@@ -87,6 +89,13 @@ export const quotaConfigs = {
|
|
|
87
89
|
kind: 'bot',
|
|
88
90
|
category: 'calls'
|
|
89
91
|
},
|
|
92
|
+
cognitive_calls: {
|
|
93
|
+
name: 'Cognitive Calls',
|
|
94
|
+
description: 'Maximum number of times a cognitive service can be called in a month.',
|
|
95
|
+
default: 4_000,
|
|
96
|
+
kind: 'bot',
|
|
97
|
+
category: 'calls'
|
|
98
|
+
},
|
|
90
99
|
bot_ratelimit: {
|
|
91
100
|
name: 'Bot Ratelimit',
|
|
92
101
|
description: 'Maximum number of times a bot can be invoked in a minute.',
|
|
@@ -100,5 +109,12 @@ export const quotaConfigs = {
|
|
|
100
109
|
default: 20,
|
|
101
110
|
kind: 'workspace',
|
|
102
111
|
category: 'count'
|
|
103
|
-
}
|
|
112
|
+
},
|
|
113
|
+
model_credit: {
|
|
114
|
+
name: 'Model Credit',
|
|
115
|
+
description: 'Maximum amount of ai model credit that can be used in a month.',
|
|
116
|
+
default: 5000,
|
|
117
|
+
kind: 'bot',
|
|
118
|
+
category: 'credit'
|
|
119
|
+
},
|
|
104
120
|
} as const satisfies Record<QuotaType, Quota>
|