@bpinternal/const 0.0.3 → 0.0.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/prefixes.ts +38 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Constant utilities for Botpress",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.mjs",
package/src/prefixes.ts CHANGED
@@ -63,12 +63,48 @@ export const objectToPrefixMap: Reverser<typeof prefixToObjectMap> = {
63
63
  usage: 'usage',
64
64
  user: 'user',
65
65
  webhook: 'webhook',
66
- workspace: 'wkspace',
66
+ workspace: 'wkspace'
67
67
  } as const
68
68
 
69
- export type Prefixes = typeof objectToPrefixMap[keyof typeof objectToPrefixMap]
69
+ export type Prefixes = (typeof objectToPrefixMap)[keyof typeof objectToPrefixMap]
70
70
  export type Objects = keyof typeof objectToPrefixMap
71
71
 
72
+ type Ids = {
73
+ [Id in Objects as `${Capitalize<Id>}Id`]: `${(typeof objectToPrefixMap)[Id]}_${string}`
74
+ }
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
+
72
108
  type Reverser<T extends Record<PropertyKey, PropertyKey>> = {
73
109
  [P in keyof T as T[P]]: P
74
110
  }