@bpinternal/const 0.0.4 → 0.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Constant utilities for Botpress",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.mjs",
package/src/prefixes.ts CHANGED
@@ -69,10 +69,42 @@ export const objectToPrefixMap: Reverser<typeof prefixToObjectMap> = {
69
69
  export type Prefixes = (typeof objectToPrefixMap)[keyof typeof objectToPrefixMap]
70
70
  export type Objects = keyof typeof objectToPrefixMap
71
71
 
72
- export type Ids = {
73
- [Id in Objects as `${Capitalize<Id>}Id`]: `${Id}_${string}`
72
+ type Ids = {
73
+ [Id in Objects as `${Capitalize<Id>}Id`]: `${(typeof objectToPrefixMap)[Id]}_${string}`
74
74
  }
75
75
 
76
+ export type ActionId = Ids['ActionId']
77
+ export type AnalyticsId = Ids['AnalyticsId']
78
+ export type AuditId = Ids['AuditId']
79
+ export type BotId = Ids['BotId']
80
+ export type BotApiKeyId = Ids['BotApiKeyId']
81
+ export type CardId = Ids['CardId']
82
+ export type ChannelId = Ids['ChannelId']
83
+ export type ConfigurationId = Ids['ConfigurationId']
84
+ export type ConversationId = Ids['ConversationId']
85
+ export type EventId = Ids['EventId']
86
+ export type FileId = Ids['FileId']
87
+ export type FlowId = Ids['FlowId']
88
+ export type IntegrationId = Ids['IntegrationId']
89
+ export type IntegrationApiKeyId = Ids['IntegrationApiKeyId']
90
+ export type KnowledgeBaseId = Ids['KnowledgeBaseId']
91
+ export type LimitId = Ids['LimitId']
92
+ export type MediaId = Ids['MediaId']
93
+ export type MessageId = Ids['MessageId']
94
+ export type NodeId = Ids['NodeId']
95
+ export type PersonalAccessTokenId = Ids['PersonalAccessTokenId']
96
+ export type QuotaId = Ids['QuotaId']
97
+ export type RecurringEventId = Ids['RecurringEventId']
98
+ export type SandboxId = Ids['SandboxId']
99
+ export type SchemaId = Ids['SchemaId']
100
+ export type StateId = Ids['StateId']
101
+ export type TableId = Ids['TableId']
102
+ export type TagId = Ids['TagId']
103
+ export type UsageId = Ids['UsageId']
104
+ export type UserId = Ids['UserId']
105
+ export type WebhookId = Ids['WebhookId']
106
+ export type WorkspaceId = Ids['WorkspaceId']
107
+
76
108
  type Reverser<T extends Record<PropertyKey, PropertyKey>> = {
77
109
  [P in keyof T as T[P]]: P
78
110
  }
package/src/quotas.ts CHANGED
@@ -1,4 +1,4 @@
1
- type Quota = {
1
+ export type Quota = {
2
2
  /**
3
3
  * Friendly name of the usage type.
4
4
  */
@@ -23,7 +23,7 @@ type Quota = {
23
23
 
24
24
  export type QuotaKind = 'workspace' | 'bot'
25
25
  export type QuotaCategory = 'ratelimit' | 'count' | 'calls' | 'timeout'
26
- export type QuotaType = typeof quotaTypes[number]
26
+ export type QuotaType = (typeof quotaTypes)[number]
27
27
 
28
28
  export const quotaTypes = [
29
29
  'invocation_timeout',
@@ -33,7 +33,7 @@ export const quotaTypes = [
33
33
  'knowledgebase_vector_count',
34
34
  'bot_ratelimit',
35
35
  'table_row_count',
36
- 'workspace_member_count',
36
+ 'workspace_member_count'
37
37
  ] as const
38
38
 
39
39
  export const quotaConfigs = {
@@ -42,55 +42,55 @@ export const quotaConfigs = {
42
42
  description: 'Maximum time in milliseconds a bot can run before timing out.',
43
43
  default: 60_000,
44
44
  kind: 'bot',
45
- category: 'timeout',
45
+ category: 'timeout'
46
46
  },
47
47
  storage_count: {
48
48
  name: 'Storage Count',
49
49
  description: 'Maximum number of storage bytes that can be stored.',
50
50
  default: 104_857_600, // 100 MB
51
51
  kind: 'bot',
52
- category: 'count',
52
+ category: 'count'
53
53
  },
54
54
  bot_count: {
55
55
  name: 'Bot Count',
56
56
  description: 'Maximum number of bots that can be created.',
57
57
  default: 5,
58
58
  kind: 'workspace',
59
- category: 'count',
59
+ category: 'count'
60
60
  },
61
61
  workspace_member_count: {
62
62
  name: 'Workspace Member Count',
63
63
  description: 'Maximum number of members that can be added to a workspace.',
64
64
  default: 3,
65
65
  kind: 'workspace',
66
- category: 'count',
66
+ category: 'count'
67
67
  },
68
68
  knowledgebase_vector_count: {
69
69
  name: 'Knowledgebase Vector Count',
70
70
  description: 'Maximum number of knowledgebase vectors that can be created.',
71
71
  default: 5_000,
72
72
  kind: 'bot',
73
- category: 'count',
73
+ category: 'count'
74
74
  },
75
75
  table_row_count: {
76
76
  name: 'Table Row Count',
77
77
  description: 'Maximum number of rows that can be stored in a table.',
78
78
  default: 5_000,
79
79
  kind: 'bot',
80
- category: 'count',
80
+ category: 'count'
81
81
  },
82
82
  invocation_calls: {
83
83
  name: 'Invocation Calls',
84
84
  description: 'Maximum number of times a bot can be invoked in a month.',
85
85
  default: 25_000,
86
86
  kind: 'bot',
87
- category: 'calls',
87
+ category: 'calls'
88
88
  },
89
89
  bot_ratelimit: {
90
90
  name: 'Bot Ratelimit',
91
91
  description: 'Maximum number of times a bot can be invoked in a minute.',
92
92
  default: 100,
93
93
  kind: 'bot',
94
- category: 'ratelimit',
95
- },
94
+ category: 'ratelimit'
95
+ }
96
96
  } as const satisfies Record<QuotaType, Quota>