📦 Update cuid to cuid2
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
"@playwright/test": "1.30.0",
|
||||
"@types/nodemailer": "6.4.7",
|
||||
"aws-sdk": "2.1304.0",
|
||||
"cuid": "3.0.0",
|
||||
"@paralleldrive/cuid2": "2.0.1",
|
||||
"db": "workspace:*",
|
||||
"dotenv": "16.0.3",
|
||||
"models": "workspace:*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Plan, Prisma, PrismaClient, User, Workspace, WorkspaceRole } from 'db'
|
||||
import cuid from 'cuid'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { Typebot, Webhook } from 'models'
|
||||
import { readFileSync } from 'fs'
|
||||
import { proWorkspaceId, userId } from './databaseSetup'
|
||||
@ -25,7 +25,7 @@ export const injectFakeResults = async ({
|
||||
isChronological,
|
||||
fakeStorage,
|
||||
}: CreateFakeResultsProps) => {
|
||||
const resultIdPrefix = customResultIdPrefix ?? cuid()
|
||||
const resultIdPrefix = customResultIdPrefix ?? createId()
|
||||
await prisma.result.createMany({
|
||||
data: [
|
||||
...Array.from(Array(count)).map((_, idx) => {
|
||||
@ -115,7 +115,7 @@ export const deleteWebhooks = async (webhookIds: string[]) => {
|
||||
}
|
||||
|
||||
export const createWorkspaces = async (workspaces: Partial<Workspace>[]) => {
|
||||
const workspaceIds = workspaces.map((workspace) => workspace.id ?? cuid())
|
||||
const workspaceIds = workspaces.map((workspace) => workspace.id ?? createId())
|
||||
await prisma.workspace.createMany({
|
||||
data: workspaces.map((workspace, index) => ({
|
||||
id: workspaceIds[index],
|
||||
@ -166,7 +166,7 @@ export const createWebhook = async (
|
||||
|
||||
export const createTypebots = async (partialTypebots: Partial<Typebot>[]) => {
|
||||
const typebotsWithId = partialTypebots.map((typebot) => {
|
||||
const typebotId = typebot.id ?? cuid()
|
||||
const typebotId = typebot.id ?? createId()
|
||||
return {
|
||||
...typebot,
|
||||
id: typebotId,
|
||||
|
@ -1,4 +1,4 @@
|
||||
import cuid from 'cuid'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import {
|
||||
Block,
|
||||
defaultChoiceInputOptions,
|
||||
@ -15,7 +15,7 @@ import { proWorkspaceId } from './databaseSetup'
|
||||
export const parseTestTypebot = (
|
||||
partialTypebot: Partial<Typebot>
|
||||
): Typebot => ({
|
||||
id: cuid(),
|
||||
id: createId(),
|
||||
workspaceId: proWorkspaceId,
|
||||
folderId: null,
|
||||
name: 'My typebot',
|
||||
|
Reference in New Issue
Block a user