@bpinternal/const 0.0.3 → 0.0.4

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 +6 -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.4",
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,16 @@ 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
+ export type Ids = {
73
+ [Id in Objects as `${Capitalize<Id>}Id`]: `${Id}_${string}`
74
+ }
75
+
72
76
  type Reverser<T extends Record<PropertyKey, PropertyKey>> = {
73
77
  [P in keyof T as T[P]]: P
74
78
  }