🚧 Use TS project references
This commit is contained in:
@@ -2,12 +2,11 @@ import {
|
||||
Plan,
|
||||
Prisma,
|
||||
PrismaClient,
|
||||
User,
|
||||
Workspace,
|
||||
WorkspaceRole,
|
||||
} from '@typebot.io/prisma'
|
||||
import { createId } from '@typebot.io/lib/createId'
|
||||
import { Typebot, TypebotV6, HttpRequest } from '@typebot.io/schemas'
|
||||
import { Typebot, TypebotV6 } from '@typebot.io/schemas'
|
||||
import { readFileSync } from 'fs'
|
||||
import { proWorkspaceId, userId } from './databaseSetup'
|
||||
import {
|
||||
@@ -138,19 +137,6 @@ export const createWorkspaces = async (workspaces: Partial<Workspace>[]) => {
|
||||
return workspaceIds
|
||||
}
|
||||
|
||||
export const updateUser = (data: Partial<User>) =>
|
||||
prisma.user.update({
|
||||
data: {
|
||||
...data,
|
||||
onboardingCategories: data.onboardingCategories ?? [],
|
||||
displayedInAppNotifications:
|
||||
data.displayedInAppNotifications ?? Prisma.DbNull,
|
||||
},
|
||||
where: {
|
||||
id: userId,
|
||||
},
|
||||
})
|
||||
|
||||
export const createTypebots = async (partialTypebots: Partial<TypebotV6>[]) => {
|
||||
const typebotsWithId = partialTypebots.map((typebot) => {
|
||||
const typebotId = typebot.id ?? createId()
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
"@typebot.io/env": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.4.2",
|
||||
"@typebot.io/tsconfig": "workspace:*"
|
||||
"@types/node": "20.4.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
{
|
||||
"extends": "@typebot.io/tsconfig/base.json",
|
||||
"extends": "../tsconfig/base.json",
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": ["node_modules"],
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2021", "DOM"]
|
||||
}
|
||||
"outDir": "dist"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../env"
|
||||
},
|
||||
{
|
||||
"path": "../lib"
|
||||
},
|
||||
{
|
||||
"path": "../prisma"
|
||||
},
|
||||
{
|
||||
"path": "../schemas"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user