⬆️ Upgrade dependencies
This commit is contained in:
@ -14,27 +14,27 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/anatomy": "^2.1.1",
|
||||
"@chakra-ui/react": "2.6.1",
|
||||
"@chakra-ui/theme-tools": "^2.0.16",
|
||||
"@chakra-ui/react": "2.7.1",
|
||||
"@chakra-ui/theme-tools": "^2.0.18",
|
||||
"@dnd-kit/core": "6.0.8",
|
||||
"@dnd-kit/sortable": "7.0.2",
|
||||
"@dnd-kit/utilities": "3.2.1",
|
||||
"@emotion/react": "11.11.0",
|
||||
"@emotion/react": "11.11.1",
|
||||
"@emotion/styled": "11.11.0",
|
||||
"@faire/mjml-react": "3.3.0",
|
||||
"@giphy/js-fetch-api": "4.9.1",
|
||||
"@giphy/js-types": "4.4.0",
|
||||
"@giphy/react-components": "6.9.3",
|
||||
"@googleapis/drive": "5.1.0",
|
||||
"@paralleldrive/cuid2": "2.2.0",
|
||||
"@sentry/nextjs": "7.53.1",
|
||||
"@stripe/stripe-js": "1.53.0",
|
||||
"@tanstack/react-query": "^4.29.7",
|
||||
"@tanstack/react-table": "8.9.1",
|
||||
"@trpc/client": "10.27.3",
|
||||
"@trpc/next": "10.27.3",
|
||||
"@trpc/react-query": "10.27.3",
|
||||
"@trpc/server": "10.27.3",
|
||||
"@giphy/react-components": "7.1.0",
|
||||
"@googleapis/drive": "8.0.0",
|
||||
"@paralleldrive/cuid2": "2.2.1",
|
||||
"@sentry/nextjs": "7.58.1",
|
||||
"@stripe/stripe-js": "1.54.1",
|
||||
"@tanstack/react-query": "^4.29.19",
|
||||
"@tanstack/react-table": "8.9.3",
|
||||
"@trpc/client": "10.34.0",
|
||||
"@trpc/next": "10.34.0",
|
||||
"@trpc/react-query": "10.34.0",
|
||||
"@trpc/server": "10.34.0",
|
||||
"@typebot.io/emails": "workspace:*",
|
||||
"@typebot.io/js": "workspace:*",
|
||||
"@typebot.io/react": "workspace:*",
|
||||
@ -45,14 +45,14 @@
|
||||
"@udecode/plate-serializer-html": "21.1.5",
|
||||
"@udecode/plate-ui-link": "21.2.0",
|
||||
"@udecode/plate-ui-toolbar": "21.1.5",
|
||||
"@uiw/codemirror-extensions-langs": "^4.20.2",
|
||||
"@uiw/codemirror-theme-github": "^4.20.2",
|
||||
"@uiw/codemirror-theme-tokyo-night": "^4.20.2",
|
||||
"@uiw/react-codemirror": "^4.20.2",
|
||||
"@uiw/codemirror-extensions-langs": "^4.21.7",
|
||||
"@uiw/codemirror-theme-github": "^4.21.7",
|
||||
"@uiw/codemirror-theme-tokyo-night": "^4.21.7",
|
||||
"@uiw/react-codemirror": "^4.21.7",
|
||||
"@upstash/ratelimit": "^0.4.3",
|
||||
"@upstash/redis": "^1.21.0",
|
||||
"@upstash/redis": "^1.22.0",
|
||||
"@use-gesture/react": "^10.2.27",
|
||||
"aws-sdk": "2.1384.0",
|
||||
"aws-sdk": "2.1415.0",
|
||||
"browser-image-compression": "2.0.2",
|
||||
"canvas-confetti": "1.6.0",
|
||||
"codemirror": "6.0.1",
|
||||
@ -61,20 +61,20 @@
|
||||
"emojilib": "3.0.10",
|
||||
"focus-visible": "5.2.0",
|
||||
"framer-motion": "10.3.0",
|
||||
"google-auth-library": "8.8.0",
|
||||
"google-spreadsheet": "3.3.0",
|
||||
"google-auth-library": "8.9.0",
|
||||
"google-spreadsheet": "4.0.2",
|
||||
"got": "12.6.0",
|
||||
"immer": "10.0.2",
|
||||
"js-video-url-parser": "0.5.1",
|
||||
"jsonwebtoken": "9.0.0",
|
||||
"jsonwebtoken": "9.0.1",
|
||||
"micro": "10.0.1",
|
||||
"micro-cors": "0.1.1",
|
||||
"minio": "7.1.1",
|
||||
"next": "13.4.3",
|
||||
"next": "13.4.9",
|
||||
"next-auth": "4.22.1",
|
||||
"next-international": "^0.4.1",
|
||||
"next-international": "0.5.3",
|
||||
"nextjs-cors": "^2.1.2",
|
||||
"nodemailer": "6.9.2",
|
||||
"nodemailer": "6.9.3",
|
||||
"nprogress": "0.2.0",
|
||||
"papaparse": "5.4.1",
|
||||
"posthog-node": "3.1.1",
|
||||
@ -86,40 +86,38 @@
|
||||
"slate-history": "0.93.0",
|
||||
"slate-hyperscript": "0.77.0",
|
||||
"slate-react": "0.94.2",
|
||||
"stripe": "12.6.0",
|
||||
"styled-components": "5.3.10",
|
||||
"stripe": "12.13.0",
|
||||
"svg-round-corners": "0.4.1",
|
||||
"swr": "2.1.5",
|
||||
"swr": "2.2.0",
|
||||
"tinycolor2": "1.6.0",
|
||||
"trpc-openapi": "1.2.0",
|
||||
"unsplash-js": "^7.0.18",
|
||||
"use-debounce": "9.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chakra-ui/styled-system": "2.9.0",
|
||||
"@playwright/test": "1.34.3",
|
||||
"@chakra-ui/styled-system": "2.9.1",
|
||||
"@playwright/test": "1.36.0",
|
||||
"@typebot.io/lib": "workspace:*",
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"@types/canvas-confetti": "1.6.0",
|
||||
"@types/google-spreadsheet": "3.3.2",
|
||||
"@types/jsonwebtoken": "9.0.2",
|
||||
"@types/micro-cors": "0.1.3",
|
||||
"@types/minio": "7.1.0",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/minio": "7.1.1",
|
||||
"@types/node": "20.4.2",
|
||||
"@types/nodemailer": "6.4.8",
|
||||
"@types/nprogress": "0.2.0",
|
||||
"@types/papaparse": "5.3.7",
|
||||
"@types/prettier": "2.7.2",
|
||||
"@types/prettier": "2.7.3",
|
||||
"@types/qs": "6.9.7",
|
||||
"@types/react": "18.2.7",
|
||||
"@types/react": "18.2.15",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"dotenv": "16.0.3",
|
||||
"eslint": "8.41.0",
|
||||
"dotenv": "16.3.1",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"superjson": "^1.12.3",
|
||||
"typescript": "5.0.4",
|
||||
"superjson": "^1.12.4",
|
||||
"typescript": "5.1.6",
|
||||
"zod": "3.21.4"
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ test.describe.parallel('Video bubble block', () => {
|
||||
|
||||
await page.goto(`/typebots/${typebotId}/edit`)
|
||||
await page.click('text=Preview')
|
||||
await expect(page.locator('video > source').nth(1)).toHaveAttribute(
|
||||
await expect(page.locator('video').nth(1)).toHaveAttribute(
|
||||
'src',
|
||||
videoSrc
|
||||
)
|
||||
|
@ -26,7 +26,7 @@ test.describe('Builder', () => {
|
||||
)
|
||||
await page.click('text=Test the request')
|
||||
await expect(page.locator('div[role="textbox"] >> nth=-1')).toContainText(
|
||||
`"Group #1": "answer value", "Group #2": "20", "Group #2 (1)": "Yes"`
|
||||
`"Group #1": "answer value", "Group #2": "20", "Group #2 (1)": "Yes"`, {timeout: 10000}
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -23,8 +23,6 @@ export const CreateBotButton = ({
|
||||
|
||||
return (
|
||||
<Button
|
||||
mr={{ sm: 6 }}
|
||||
mb={6}
|
||||
style={{ width: '225px', height: '270px' }}
|
||||
onClick={handleClick}
|
||||
paddingX={6}
|
||||
|
@ -156,8 +156,6 @@ export const FolderButton = ({
|
||||
export const ButtonSkeleton = () => (
|
||||
<Button
|
||||
as={VStack}
|
||||
mr={{ sm: 6 }}
|
||||
mb={6}
|
||||
style={{ width: '225px', height: '270px' }}
|
||||
paddingX={6}
|
||||
whiteSpace={'normal'}
|
||||
|
@ -117,8 +117,6 @@ export const TypebotButton = ({
|
||||
variant="outline"
|
||||
w="225px"
|
||||
h="270px"
|
||||
mr={{ sm: 6 }}
|
||||
mb={6}
|
||||
rounded="lg"
|
||||
whiteSpace="normal"
|
||||
opacity={draggedTypebot?.id === typebot.id ? 0.2 : 1}
|
||||
|
@ -3,7 +3,6 @@ import test, { expect } from '@playwright/test'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { defaultTextInputOptions } from '@typebot.io/schemas'
|
||||
import { importTypebotInDatabase } from '@typebot.io/lib/playwright/databaseActions'
|
||||
import { freeWorkspaceId } from '@typebot.io/lib/playwright/databaseSetup'
|
||||
|
||||
test.describe.parallel('Settings page', () => {
|
||||
test.describe('General', () => {
|
||||
@ -13,12 +12,7 @@ test.describe.parallel('Settings page', () => {
|
||||
id: typebotId,
|
||||
})
|
||||
await page.goto(`/typebots/${typebotId}/settings`)
|
||||
await expect(
|
||||
page.locator('a:has-text("Made with Typebot")')
|
||||
).toHaveAttribute('href', 'https://www.typebot.io/?utm_source=litebadge')
|
||||
await page.click('text="Typebot.io branding"')
|
||||
await expect(page.locator('a:has-text("Made with Typebot")')).toBeHidden()
|
||||
|
||||
|
||||
await page.click('text="Remember user"')
|
||||
|
||||
await expect(page.getByPlaceholder('Type your answer...')).toHaveValue(
|
||||
@ -103,25 +97,4 @@ test.describe.parallel('Settings page', () => {
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Free workspace', () => {
|
||||
test("can't remove branding", async ({ page }) => {
|
||||
const typebotId = createId()
|
||||
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
||||
id: typebotId,
|
||||
workspaceId: freeWorkspaceId,
|
||||
})
|
||||
await page.goto(`/typebots/${typebotId}/settings`)
|
||||
await expect(page.locator('text="What\'s your name?"')).toBeVisible()
|
||||
await expect(
|
||||
page.locator('[data-testid="starter-lock-tag"]')
|
||||
).toBeVisible()
|
||||
await page.click('text=Typebot.io branding')
|
||||
await expect(
|
||||
page.locator(
|
||||
'text="You need to upgrade your plan in order to remove branding"'
|
||||
)
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -2,6 +2,7 @@ import { getTestAsset } from '@/test/utils/playwright'
|
||||
import test, { expect } from '@playwright/test'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { importTypebotInDatabase } from '@typebot.io/lib/playwright/databaseActions'
|
||||
import { freeWorkspaceId } from '@typebot.io/lib/playwright/databaseSetup'
|
||||
|
||||
const hostAvatarUrl =
|
||||
'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1760&q=80'
|
||||
@ -20,8 +21,15 @@ test.describe.parallel('Theme page', () => {
|
||||
await page.goto(`/typebots/${typebotId}/theme`)
|
||||
await expect(page.getByRole('button', { name: 'Go' })).toBeVisible()
|
||||
|
||||
// Branding
|
||||
await page.getByRole('button', { name: 'Global' }).click()
|
||||
await expect(
|
||||
page.locator('a:has-text("Made with Typebot")')
|
||||
).toHaveAttribute('href', 'https://www.typebot.io/?utm_source=litebadge')
|
||||
await page.click('text="Show Typebot brand"')
|
||||
await expect(page.locator('a:has-text("Made with Typebot")')).toBeHidden()
|
||||
|
||||
// Font
|
||||
await page.getByRole('button', { name: 'Font & Background' }).click()
|
||||
await page.getByRole('textbox').fill('Roboto Slab')
|
||||
await expect(page.locator('.typebot-container')).toHaveCSS(
|
||||
'font-family',
|
||||
@ -252,3 +260,25 @@ test.describe.parallel('Theme page', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
test.describe('Free workspace', () => {
|
||||
test("can't remove branding", async ({ page }) => {
|
||||
const typebotId = createId()
|
||||
await importTypebotInDatabase(getTestAsset('typebots/settings.json'), {
|
||||
id: typebotId,
|
||||
workspaceId: freeWorkspaceId,
|
||||
})
|
||||
await page.goto(`/typebots/${typebotId}/theme`)
|
||||
await expect(page.locator('text="What\'s your name?"')).toBeVisible()
|
||||
await page.getByRole('button', { name: 'Global' }).click()
|
||||
await expect(
|
||||
page.locator('[data-testid="starter-lock-tag"]')
|
||||
).toBeVisible()
|
||||
await page.click('text=Show Typebot brand')
|
||||
await expect(
|
||||
page.locator(
|
||||
'text="You need to upgrade your plan in order to remove branding"'
|
||||
)
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
|
@ -19,13 +19,12 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const credentialsId = req.query.credentialsId as string | undefined
|
||||
if (!credentialsId) return badRequest(res)
|
||||
const spreadsheetId = req.query.id as string
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId)
|
||||
const auth = await getAuthenticatedGoogleClient(user.id, credentialsId)
|
||||
if (!auth)
|
||||
return res
|
||||
.status(404)
|
||||
.send({ message: "Couldn't find credentials in database" })
|
||||
doc.useOAuth2Client(auth.client)
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId, auth.client)
|
||||
await doc.loadInfo()
|
||||
return res.send({
|
||||
sheets: (
|
||||
|
@ -11,8 +11,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@chakra-ui/icon": "3.0.15",
|
||||
"@chakra-ui/react": "2.6.1",
|
||||
"@emotion/react": "11.11.0",
|
||||
"@chakra-ui/react": "2.7.1",
|
||||
"@emotion/react": "11.11.1",
|
||||
"@emotion/styled": "11.11.0",
|
||||
"@vercel/analytics": "1.0.1",
|
||||
"@typebot.io/react": "workspace:*",
|
||||
@ -20,28 +20,28 @@
|
||||
"aos": "2.3.4",
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"focus-visible": "5.2.0",
|
||||
"framer-motion": "10.3.0",
|
||||
"framer-motion": "10.12.20",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"next": "13.4.3",
|
||||
"next": "13.4.9",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"@typebot.io/lib": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.21.8",
|
||||
"@chakra-ui/styled-system": "2.9.0",
|
||||
"@next/bundle-analyzer": "13.4.3",
|
||||
"@babel/core": "7.22.9",
|
||||
"@chakra-ui/styled-system": "2.9.1",
|
||||
"@next/bundle-analyzer": "13.4.9",
|
||||
"@types/aos": "3.0.4",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/react": "18.2.7",
|
||||
"@types/node": "20.4.2",
|
||||
"@types/react": "18.2.15",
|
||||
"autoprefixer": "10.4.14",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "8.41.0",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"next-transpile-modules": "10.0.0",
|
||||
"postcss": "8.4.23",
|
||||
"prettier": "2.8.8",
|
||||
"postcss": "8.4.26",
|
||||
"prettier": "3.0.0",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"typescript": "5.0.4"
|
||||
"typescript": "5.1.6"
|
||||
}
|
||||
}
|
||||
|
@ -13,56 +13,55 @@
|
||||
"test:report": "pnpm playwright show-report"
|
||||
},
|
||||
"dependencies": {
|
||||
"@planetscale/database": "^1.7.0",
|
||||
"@sentry/nextjs": "7.53.1",
|
||||
"@trpc/server": "10.27.3",
|
||||
"@planetscale/database": "^1.8.0",
|
||||
"@sentry/nextjs": "7.58.1",
|
||||
"@trpc/server": "10.34.0",
|
||||
"@typebot.io/js": "workspace:*",
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"@typebot.io/react": "workspace:*",
|
||||
"ai": "^2.1.18",
|
||||
"aws-sdk": "2.1384.0",
|
||||
"ai": "^2.1.20",
|
||||
"aws-sdk": "2.1415.0",
|
||||
"bot-engine": "workspace:*",
|
||||
"cors": "2.8.5",
|
||||
"eventsource-parser": "^1.0.0",
|
||||
"google-spreadsheet": "3.3.0",
|
||||
"google-spreadsheet": "4.0.2",
|
||||
"got": "12.6.0",
|
||||
"libphonenumber-js": "1.10.30",
|
||||
"next": "13.4.3",
|
||||
"libphonenumber-js": "1.10.37",
|
||||
"next": "13.4.9",
|
||||
"nextjs-cors": "2.1.2",
|
||||
"node-html-parser": "^6.1.5",
|
||||
"nodemailer": "6.9.2",
|
||||
"nodemailer": "6.9.3",
|
||||
"openai": "3.3.0",
|
||||
"openai-edge": "^1.2.0",
|
||||
"qs": "6.11.2",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"stripe": "12.6.0",
|
||||
"stripe": "12.13.0",
|
||||
"trpc-openapi": "1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@faire/mjml-react": "3.3.0",
|
||||
"@paralleldrive/cuid2": "2.2.0",
|
||||
"@playwright/test": "1.34.3",
|
||||
"@paralleldrive/cuid2": "2.2.1",
|
||||
"@playwright/test": "1.36.0",
|
||||
"@typebot.io/emails": "workspace:*",
|
||||
"@typebot.io/lib": "workspace:*",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"@types/cors": "2.8.13",
|
||||
"@types/google-spreadsheet": "3.3.2",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/node": "20.4.2",
|
||||
"@types/nodemailer": "6.4.8",
|
||||
"@types/papaparse": "5.3.7",
|
||||
"@types/qs": "6.9.7",
|
||||
"@types/react": "18.2.7",
|
||||
"@types/react": "18.2.15",
|
||||
"@types/sanitize-html": "2.9.0",
|
||||
"dotenv": "16.0.3",
|
||||
"eslint": "8.41.0",
|
||||
"dotenv": "16.3.1",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"google-auth-library": "8.8.0",
|
||||
"google-auth-library": "8.9.0",
|
||||
"node-fetch": "3.3.1",
|
||||
"papaparse": "5.4.1",
|
||||
"superjson": "1.12.3",
|
||||
"typescript": "5.0.4",
|
||||
"superjson": "1.12.4",
|
||||
"typescript": "5.1.6",
|
||||
"zod": "3.21.4"
|
||||
}
|
||||
}
|
||||
|
@ -37,13 +37,13 @@ export const getRow = async (
|
||||
|
||||
try {
|
||||
await doc.loadInfo()
|
||||
const sheet = doc.sheetsById[sheetId]
|
||||
const sheet = doc.sheetsById[Number(sheetId)]
|
||||
const rows = await sheet.getRows()
|
||||
const filteredRows = getTotalRows(
|
||||
options.totalRowsToExtract,
|
||||
rows.filter((row) =>
|
||||
referenceCell
|
||||
? row[referenceCell.column as string] === referenceCell.value
|
||||
? row.get(referenceCell.column as string) === referenceCell.value
|
||||
: matchFilter(row, filter)
|
||||
)
|
||||
)
|
||||
@ -64,7 +64,7 @@ export const getRow = async (
|
||||
.filter(isNotEmpty)
|
||||
const selectedRows = filteredRows.map((row) =>
|
||||
extractingColumns.reduce<{ [key: string]: string }>(
|
||||
(obj, column) => ({ ...obj, [column]: row[column] }),
|
||||
(obj, column) => ({ ...obj, [column]: row.get(column) }),
|
||||
{}
|
||||
)
|
||||
)
|
||||
|
@ -9,18 +9,16 @@ export const getAuthenticatedGoogleDoc = async ({
|
||||
credentialsId?: string
|
||||
spreadsheetId?: string
|
||||
}) => {
|
||||
if (!credentialsId)
|
||||
if (!credentialsId || !spreadsheetId)
|
||||
throw new TRPCError({
|
||||
code: 'BAD_REQUEST',
|
||||
message: 'Missing credentialsId or sheetId',
|
||||
message: 'Missing credentialsId or spreadsheetId',
|
||||
})
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId)
|
||||
const auth = await getAuthenticatedGoogleClient(credentialsId)
|
||||
if (!auth)
|
||||
throw new TRPCError({
|
||||
code: 'NOT_FOUND',
|
||||
message: "Couldn't find credentials in database",
|
||||
})
|
||||
doc.useOAuth2Client(auth)
|
||||
return doc
|
||||
return new GoogleSpreadsheet(spreadsheetId, auth)
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ export const matchFilter = (
|
||||
(comparison) =>
|
||||
comparison.column &&
|
||||
matchComparison(
|
||||
row[comparison.column],
|
||||
row.get(comparison.column),
|
||||
comparison.comparisonOperator,
|
||||
comparison.value
|
||||
)
|
||||
@ -25,7 +25,7 @@ export const matchFilter = (
|
||||
(comparison) =>
|
||||
comparison.column &&
|
||||
matchComparison(
|
||||
row[comparison.column],
|
||||
row.get(comparison.column),
|
||||
comparison.comparisonOperator,
|
||||
comparison.value
|
||||
)
|
||||
|
@ -29,7 +29,7 @@ export const insertRow = async (
|
||||
|
||||
try {
|
||||
await doc.loadInfo()
|
||||
const sheet = doc.sheetsById[options.sheetId]
|
||||
const sheet = doc.sheetsById[Number(options.sheetId)]
|
||||
await sheet.addRow(parsedValues)
|
||||
log = {
|
||||
status: 'success',
|
||||
|
@ -34,11 +34,11 @@ export const updateRow = async (
|
||||
const parsedValues = parseCellValues(variables)(options.cellsToUpsert)
|
||||
|
||||
await doc.loadInfo()
|
||||
const sheet = doc.sheetsById[sheetId]
|
||||
const sheet = doc.sheetsById[Number(sheetId)]
|
||||
const rows = await sheet.getRows()
|
||||
const filteredRows = rows.filter((row) =>
|
||||
referenceCell
|
||||
? row[referenceCell.column as string] === referenceCell.value
|
||||
? row.get(referenceCell.column as string) === referenceCell.value
|
||||
: matchFilter(row, filter as NonNullable<typeof filter>)
|
||||
)
|
||||
if (filteredRows.length === 0) {
|
||||
@ -58,9 +58,9 @@ export const updateRow = async (
|
||||
|
||||
try {
|
||||
for (const filteredRow of filteredRows) {
|
||||
const rowIndex = filteredRow.rowIndex - 2 // -1 for 0-indexing, -1 for header row
|
||||
const rowIndex = filteredRow.rowNumber - 2 // -1 for 1-indexing, -1 for header row
|
||||
for (const key in parsedValues) {
|
||||
rows[rowIndex][key] = parsedValues[key]
|
||||
rows[rowIndex].set(key, parsedValues[key])
|
||||
}
|
||||
await rows[rowIndex].save()
|
||||
}
|
||||
|
@ -61,20 +61,19 @@ const getRows = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
return
|
||||
}
|
||||
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId)
|
||||
const client = await getAuthenticatedGoogleClient(credentialsId)
|
||||
if (!client) {
|
||||
notFound(res, "Couldn't find credentials in database")
|
||||
return
|
||||
}
|
||||
doc.useOAuth2Client(client)
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId, client)
|
||||
await doc.loadInfo()
|
||||
const sheet = doc.sheetsById[sheetId]
|
||||
const sheet = doc.sheetsById[Number(sheetId)]
|
||||
try {
|
||||
const rows = await sheet.getRows()
|
||||
const filteredRows = rows.filter((row) =>
|
||||
referenceCell
|
||||
? row[referenceCell.column as string] === referenceCell.value
|
||||
? row.get(referenceCell.column as string) === referenceCell.value
|
||||
: matchFilter(row, filter as NonNullable<typeof filter>)
|
||||
)
|
||||
if (filteredRows.length === 0) {
|
||||
@ -88,7 +87,7 @@ const getRows = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const response = {
|
||||
rows: filteredRows.map((row) =>
|
||||
extractingColumns.reduce<{ [key: string]: string }>(
|
||||
(obj, column) => ({ ...obj, [column]: row[column] }),
|
||||
(obj, column) => ({ ...obj, [column]: row.get(column) }),
|
||||
{}
|
||||
)
|
||||
),
|
||||
@ -119,14 +118,13 @@ const insertRow = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
values: { [key: string]: string }
|
||||
}
|
||||
if (!hasValue(credentialsId)) return badRequest(res)
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId)
|
||||
const auth = await getAuthenticatedGoogleClient(credentialsId)
|
||||
if (!auth)
|
||||
return res.status(404).send("Couldn't find credentials in database")
|
||||
doc.useOAuth2Client(auth)
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId, auth)
|
||||
try {
|
||||
await doc.loadInfo()
|
||||
const sheet = doc.sheetsById[sheetId]
|
||||
const sheet = doc.sheetsById[Number(sheetId)]
|
||||
await sheet.addRow(values)
|
||||
await saveSuccessLog({ resultId, message: 'Succesfully inserted row' })
|
||||
return res.send({ message: 'Success' })
|
||||
@ -149,22 +147,21 @@ const updateRow = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
values: { [key: string]: string }
|
||||
}
|
||||
if (!hasValue(credentialsId) || !referenceCell) return badRequest(res)
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId)
|
||||
const auth = await getAuthenticatedGoogleClient(credentialsId)
|
||||
if (!auth)
|
||||
return res.status(404).send("Couldn't find credentials in database")
|
||||
doc.useOAuth2Client(auth)
|
||||
const doc = new GoogleSpreadsheet(spreadsheetId, auth)
|
||||
try {
|
||||
await doc.loadInfo()
|
||||
const sheet = doc.sheetsById[sheetId]
|
||||
const sheet = doc.sheetsById[Number(sheetId)]
|
||||
const rows = await sheet.getRows()
|
||||
const updatingRowIndex = rows.findIndex(
|
||||
(row) => row[referenceCell.column as string] === referenceCell.value
|
||||
(row) => row.get(referenceCell.column as string) === referenceCell.value
|
||||
)
|
||||
if (updatingRowIndex === -1)
|
||||
return res.status(404).send({ message: "Couldn't find row to update" })
|
||||
for (const key in values) {
|
||||
rows[updatingRowIndex][key] = values[key]
|
||||
rows[updatingRowIndex].set(key, values[key])
|
||||
}
|
||||
await rows[updatingRowIndex].save()
|
||||
await saveSuccessLog({ resultId, message: 'Succesfully updated row' })
|
||||
@ -188,7 +185,7 @@ const matchFilter = (
|
||||
(comparison) =>
|
||||
comparison.column &&
|
||||
matchComparison(
|
||||
row[comparison.column],
|
||||
row.get(comparison.column),
|
||||
comparison.comparisonOperator,
|
||||
comparison.value
|
||||
)
|
||||
@ -197,7 +194,7 @@ const matchFilter = (
|
||||
(comparison) =>
|
||||
comparison.column &&
|
||||
matchComparison(
|
||||
row[comparison.column],
|
||||
row.get(comparison.column),
|
||||
comparison.comparisonOperator,
|
||||
comparison.value
|
||||
)
|
||||
|
@ -22,12 +22,12 @@
|
||||
"cross-env": "7.0.3",
|
||||
"cz-emoji": "1.3.2-canary.2",
|
||||
"husky": "^8.0.3",
|
||||
"turbo": "1.9.9"
|
||||
"turbo": "1.10.7"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "node_modules/cz-emoji"
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@8.1.0"
|
||||
"packageManager": "pnpm@8.6.7"
|
||||
}
|
||||
|
@ -16,16 +16,16 @@
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@faire/mjml-react": "3.3.0",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/node": "20.4.2",
|
||||
"@types/nodemailer": "6.4.8",
|
||||
"@types/react": "18.2.7",
|
||||
"concurrently": "8.0.1",
|
||||
"@types/react": "18.2.15",
|
||||
"concurrently": "8.2.0",
|
||||
"http-server": "14.1.1",
|
||||
"nodemailer": "6.9.2",
|
||||
"nodemailer": "6.9.3",
|
||||
"react": "18.2.0",
|
||||
"tsx": "3.12.7",
|
||||
"@typebot.io/lib": "workspace:*",
|
||||
"eslint": "8.41.0",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"@typebot.io/tsconfig": "workspace:*"
|
||||
},
|
||||
|
@ -12,32 +12,32 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@stripe/stripe-js": "1.53.0",
|
||||
"@stripe/stripe-js": "1.54.1",
|
||||
"@udecode/plate-common": "^21.1.5",
|
||||
"eventsource-parser": "^1.0.0",
|
||||
"solid-element": "1.7.0",
|
||||
"solid-js": "1.7.5"
|
||||
"solid-element": "1.7.1",
|
||||
"solid-js": "1.7.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-typescript": "7.21.5",
|
||||
"@babel/preset-typescript": "7.22.5",
|
||||
"@rollup/plugin-babel": "6.0.3",
|
||||
"@rollup/plugin-node-resolve": "15.0.2",
|
||||
"@rollup/plugin-node-resolve": "15.1.0",
|
||||
"@rollup/plugin-terser": "0.4.3",
|
||||
"@rollup/plugin-typescript": "11.1.1",
|
||||
"@rollup/plugin-typescript": "11.1.2",
|
||||
"@typebot.io/lib": "workspace:*",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"autoprefixer": "10.4.14",
|
||||
"babel-preset-solid": "1.7.4",
|
||||
"eslint": "8.41.0",
|
||||
"babel-preset-solid": "1.7.7",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"eslint-plugin-solid": "0.12.1",
|
||||
"postcss": "8.4.23",
|
||||
"postcss": "8.4.26",
|
||||
"react": "18.2.0",
|
||||
"rollup": "3.20.2",
|
||||
"rollup": "3.26.2",
|
||||
"rollup-plugin-postcss": "4.0.2",
|
||||
"rollup-plugin-typescript-paths": "1.4.0",
|
||||
"tailwindcss": "3.3.2",
|
||||
"typescript": "5.0.4"
|
||||
"tailwindcss": "3.3.3",
|
||||
"typescript": "5.1.6"
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ export const Bot = (props: BotProps & { class?: string }) => {
|
||||
})
|
||||
|
||||
createEffect(() => {
|
||||
if (typeof props.typebot === 'string') return
|
||||
if (isNotDefined(props.typebot) || typeof props.typebot === 'string') return
|
||||
setCustomCss(props.typebot.theme.customCss ?? '')
|
||||
})
|
||||
|
||||
|
@ -3,7 +3,7 @@ import type { PopupProps } from './features/popup'
|
||||
import type { BotProps } from './components/Bot'
|
||||
|
||||
export const defaultBotProps: BotProps = {
|
||||
typebot: '',
|
||||
typebot: undefined,
|
||||
onNewInputBlock: undefined,
|
||||
onAnswer: undefined,
|
||||
onEnd: undefined,
|
||||
|
@ -19,26 +19,26 @@
|
||||
"@ladle/react": "2.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/preset-react": "7.18.6",
|
||||
"@babel/preset-typescript": "7.21.5",
|
||||
"@babel/preset-react": "7.22.5",
|
||||
"@babel/preset-typescript": "7.22.5",
|
||||
"@rollup/plugin-babel": "6.0.3",
|
||||
"@rollup/plugin-node-resolve": "15.0.2",
|
||||
"@rollup/plugin-node-resolve": "15.1.0",
|
||||
"@rollup/plugin-terser": "0.4.3",
|
||||
"@rollup/plugin-typescript": "11.1.1",
|
||||
"@rollup/plugin-typescript": "11.1.2",
|
||||
"@typebot.io/js": "workspace:*",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/react": "18.2.7",
|
||||
"@types/node": "20.4.2",
|
||||
"@types/react": "18.2.15",
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"eslint": "8.41.0",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-custom": "workspace:*",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"react": "18.2.0",
|
||||
"rollup": "3.20.2",
|
||||
"rollup": "3.26.2",
|
||||
"rollup-plugin-typescript-paths": "1.4.0",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"tslib": "2.5.2",
|
||||
"tslib": "2.6.0",
|
||||
"tsx": "3.12.7",
|
||||
"typescript": "5.0.4",
|
||||
"typescript": "5.1.6",
|
||||
"@typebot.io/lib": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -5,10 +5,6 @@
|
||||
"repository": "https://github.com/baptisteArno/typebot.io",
|
||||
"author": "baptisteArno",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-php": "0.19.5",
|
||||
"prettier": "2.8.8"
|
||||
},
|
||||
"scripts": {
|
||||
"deploy": "pnpm copy && pnpm commit",
|
||||
"copy": "svn copy ./trunk ./tags/3.1.11",
|
||||
|
@ -3,13 +3,13 @@
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"eslint": "8.41.0",
|
||||
"eslint-config-next": "13.4.3",
|
||||
"eslint": "8.44.0",
|
||||
"eslint-config-next": "13.4.9",
|
||||
"eslint-config-prettier": "8.8.0",
|
||||
"eslint-plugin-react": "7.32.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
||||
"@typescript-eslint/parser": "^5.59.7"
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -6,17 +6,17 @@
|
||||
"main": "./index.ts",
|
||||
"types": "./index.ts",
|
||||
"devDependencies": {
|
||||
"@paralleldrive/cuid2": "2.2.0",
|
||||
"@playwright/test": "1.34.3",
|
||||
"@paralleldrive/cuid2": "2.2.1",
|
||||
"@playwright/test": "1.36.0",
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"@types/nodemailer": "6.4.8",
|
||||
"aws-sdk": "2.1384.0",
|
||||
"dotenv": "16.0.3",
|
||||
"next": "13.4.3",
|
||||
"nodemailer": "6.9.2",
|
||||
"typescript": "5.0.4"
|
||||
"aws-sdk": "2.1415.0",
|
||||
"dotenv": "16.3.1",
|
||||
"next": "13.4.9",
|
||||
"nodemailer": "6.9.3",
|
||||
"typescript": "5.1.6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"aws-sdk": "2.1152.0",
|
||||
|
@ -14,14 +14,14 @@
|
||||
"db:migrate": "pnpm migrate:deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "4.14.1"
|
||||
"@prisma/client": "5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.2.3",
|
||||
"dotenv": "16.0.3",
|
||||
"prisma": "4.14.1",
|
||||
"@types/node": "20.4.2",
|
||||
"dotenv": "16.3.1",
|
||||
"prisma": "5.0.0",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"tsx": "3.12.7",
|
||||
"typescript": "5.0.4"
|
||||
"typescript": "5.1.6"
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,6 @@
|
||||
"devDependencies": {
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"@typebot.io/tsconfig": "workspace:*",
|
||||
"typescript": "5.0.4"
|
||||
"typescript": "5.1.6"
|
||||
}
|
||||
}
|
||||
|
@ -22,14 +22,14 @@
|
||||
"@typebot.io/lib": "workspace:*",
|
||||
"@typebot.io/prisma": "workspace:*",
|
||||
"@typebot.io/schemas": "workspace:*",
|
||||
"@types/node": "20.2.3",
|
||||
"@types/node": "20.4.2",
|
||||
"@types/prompts": "2.4.4",
|
||||
"deep-object-diff": "1.1.9",
|
||||
"got": "12.6.0",
|
||||
"prompts": "2.4.2",
|
||||
"stripe": "12.6.0",
|
||||
"stripe": "12.13.0",
|
||||
"tsx": "3.12.7",
|
||||
"typescript": "5.0.4",
|
||||
"typescript": "5.1.6",
|
||||
"zod": "3.21.4"
|
||||
}
|
||||
}
|
||||
|
5384
pnpm-lock.yaml
generated
5384
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user