Skip to content

Commit

Permalink
chore(const): added workflow prefix to const package (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmass committed Sep 5, 2024
1 parent 454ce44 commit 2411332
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion const/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bpinternal/const",
"version": "0.0.39",
"version": "0.0.40",
"description": "Constant utilities for Botpress",
"main": "./dist/index.cjs",
"browser": "./dist/index.mjs",
Expand Down
9 changes: 6 additions & 3 deletions const/src/prefixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const prefixToObjectMap = {
usage: 'usage',
user: 'user',
webhook: 'webhook',
wkspace: 'workspace'
wkspace: 'workspace',
wrkflow: 'workflow',
} as const

export const objectToPrefixMap: Reverser<typeof prefixToObjectMap> = {
Expand Down Expand Up @@ -87,7 +88,8 @@ export const objectToPrefixMap: Reverser<typeof prefixToObjectMap> = {
usage: 'usage',
user: 'user',
webhook: 'webhook',
workspace: 'wkspace'
workflow: 'wrkflow',
workspace: 'wkspace',
} as const

export type Prefixes = (typeof objectToPrefixMap)[keyof typeof objectToPrefixMap]
Expand Down Expand Up @@ -130,11 +132,12 @@ export type ScriptId = Ids['ScriptId']
export type StateId = Ids['StateId']
export type TableId = Ids['TableId']
export type TagId = Ids['TagId']
export type TaskId = Ids['TaskId']
export type UsageId = Ids['UsageId']
export type UserId = Ids['UserId']
export type WebhookId = Ids['WebhookId']
export type WorkflowId = Ids['WorkflowId']
export type WorkspaceId = Ids['WorkspaceId']
export type TaskId = Ids['TaskId']

type Reverser<T extends Record<PropertyKey, PropertyKey>> = {
[P in keyof T as T[P]]: P
Expand Down

0 comments on commit 2411332

Please sign in to comment.