2
0

⬆️ Upgrade dependencies

This commit is contained in:
Baptiste Arnaud
2022-11-21 19:08:14 +01:00
parent b29f7325ad
commit 34cfd1db30
35 changed files with 674 additions and 739 deletions

View File

@ -33,7 +33,7 @@ test('should work as expected', async ({ page }) => {
'src',
RegExp(`/public/typebots/${typebotId}/blocks`, 'gm')
)
await page.getByRole('button', { name: 'Preview' }).click()
await page.getByRole('button', { name: 'Preview', exact: true }).click()
await expect(typebotViewer(page).locator('audio')).toHaveAttribute(
'src',
RegExp(`/public/typebots/${typebotId}/blocks`, 'gm')

View File

@ -29,11 +29,7 @@ test.describe.parallel('Image bubble block', () => {
await page.setInputFiles('input[type="file"]', getTestAsset('avatar.jpg'))
await expect(page.locator('img')).toHaveAttribute(
'src',
`${process.env.S3_SSL === 'false' ? 'http://' : 'https://'}${
process.env.S3_ENDPOINT
}${process.env.S3_PORT ? `:${process.env.S3_PORT}` : ''}/${
process.env.S3_BUCKET
}/public/typebots/${typebotId}/blocks/block2`
new RegExp(`/public/typebots/${typebotId}/blocks/block2`, 'gm')
)
})

View File

@ -34,7 +34,7 @@ test.describe('Chatwoot block', () => {
await page.getByLabel('Email').fill('john@email.com')
await page.getByLabel('Avatar URL').fill('https://domain.com/avatar.png')
await page.getByLabel('Phone number').fill('+33654347543')
await page.getByRole('button', { name: 'Preview' }).click()
await page.getByRole('button', { name: 'Preview', exact: true }).click()
await expect(
page.getByText("Chatwoot won't open in preview mode").nth(0)
).toBeVisible()

View File

@ -139,9 +139,9 @@ const useUndo = <T extends { updatedAt: string } | undefined>(
const set = useCallback(
(newPresent: T | ((current: T) => T), options = { updateDate: true }) => {
const updatedTypebot =
newPresent && 'id' in newPresent
? newPresent
: (newPresent as (current: T) => T)(presentRef.current)
newPresent && typeof newPresent === 'function'
? newPresent(presentRef.current)
: newPresent
presentRef.current = updatedTypebot
dispatch({
type: ActionType.Set,

View File

@ -27,7 +27,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const session = await stripe.billingPortal.sessions.create({
customer: workspace.stripeId,

View File

@ -22,7 +22,7 @@ const createCheckoutSession = async (userId: string) => {
if (!process.env.STRIPE_SECRET_KEY)
throw Error('STRIPE_SECRET_KEY var is missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const claimableCustomPlan = await prisma.claimableCustomPlan.findFirst({

View File

@ -27,7 +27,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const invoices = await stripe.invoices.list({
customer: workspace.stripeId,

View File

@ -46,7 +46,7 @@ const getSubscriptionDetails =
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const subscriptions = await stripe.subscriptions.list({
customer: workspace.stripeId,
@ -70,7 +70,7 @@ const createCheckoutSession = (req: NextApiRequest) => {
if (!process.env.STRIPE_SECRET_KEY)
throw Error('STRIPE_SECRET_KEY var is missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const {
email,
@ -118,7 +118,7 @@ const updateSubscription = async (req: NextApiRequest) => {
if (!process.env.STRIPE_SECRET_KEY)
throw Error('STRIPE_SECRET_KEY var is missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const { data } = await stripe.subscriptions.list({
customer: stripeId,
@ -203,7 +203,7 @@ const cancelSubscription =
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const existingSubscription = await stripe.subscriptions.list({
customer: workspace.stripeId,

View File

@ -10,7 +10,7 @@ import { Plan } from 'db'
if (!process.env.STRIPE_SECRET_KEY || !process.env.STRIPE_WEBHOOK_SECRET)
throw new Error('STRIPE_SECRET_KEY or STRIPE_WEBHOOK_SECRET missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const cors = Cors({

View File

@ -11,7 +11,7 @@ import { proWorkspaceId } from 'utils/playwright/databaseSetup'
const prisma = new PrismaClient()
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY ?? '', {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
export const addSubscriptionToWorkspace = async (