♻️ Re-organize workspace folders
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Plan, WorkspaceRole } from 'db'
|
||||
import { Plan, WorkspaceRole } from '@typebot.io/prisma'
|
||||
import Stripe from 'stripe'
|
||||
import { z } from 'zod'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Plan, WorkspaceRole } from 'db'
|
||||
import { Plan, WorkspaceRole } from '@typebot.io/prisma'
|
||||
import Stripe from 'stripe'
|
||||
import { z } from 'zod'
|
||||
import { parseSubscriptionItems } from '../utils/parseSubscriptionItems'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { WorkspaceRole } from 'db'
|
||||
import { WorkspaceRole } from '@typebot.io/prisma'
|
||||
import Stripe from 'stripe'
|
||||
import { z } from 'zod'
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { WorkspaceRole } from 'db'
|
||||
import { WorkspaceRole } from '@typebot.io/prisma'
|
||||
import Stripe from 'stripe'
|
||||
import { z } from 'zod'
|
||||
import { subscriptionSchema } from 'models/features/billing/subscription'
|
||||
import { subscriptionSchema } from '@typebot.io/schemas/features/billing/subscription'
|
||||
|
||||
export const getSubscription = authenticatedProcedure
|
||||
.meta({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { WorkspaceRole } from 'db'
|
||||
import { WorkspaceRole } from '@typebot.io/prisma'
|
||||
import Stripe from 'stripe'
|
||||
import { isDefined } from 'utils'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import { z } from 'zod'
|
||||
import { invoiceSchema } from 'models/features/billing/invoice'
|
||||
import { invoiceSchema } from '@typebot.io/schemas/features/billing/invoice'
|
||||
|
||||
export const listInvoices = authenticatedProcedure
|
||||
.meta({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { sendTelemetryEvents } from 'utils/telemetry/sendTelemetryEvent'
|
||||
import { sendTelemetryEvents } from '@typebot.io/lib/telemetry/sendTelemetryEvent'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Plan, WorkspaceRole } from 'db'
|
||||
import { workspaceSchema } from 'models'
|
||||
import { Plan, WorkspaceRole } from '@typebot.io/prisma'
|
||||
import { workspaceSchema } from '@typebot.io/schemas'
|
||||
import Stripe from 'stripe'
|
||||
import { isDefined } from 'utils'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import { z } from 'zod'
|
||||
|
||||
export const updateSubscription = authenticatedProcedure
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
|
||||
export const parseSubscriptionItems = (
|
||||
plan: Plan,
|
||||
|
||||
@@ -4,13 +4,13 @@ import {
|
||||
} from '@/test/utils/databaseActions'
|
||||
import test, { expect } from '@playwright/test'
|
||||
import { createId } from '@paralleldrive/cuid2'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import {
|
||||
createTypebots,
|
||||
createWorkspaces,
|
||||
deleteWorkspaces,
|
||||
injectFakeResults,
|
||||
} from 'utils/playwright/databaseActions'
|
||||
} from '@typebot.io/lib/playwright/databaseActions'
|
||||
|
||||
const usageWorkspaceId = createId()
|
||||
const usageTypebotId = createId()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { HStack, Stack, Text } from '@chakra-ui/react'
|
||||
import { useWorkspace } from '@/features/workspace'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import React from 'react'
|
||||
import { CurrentSubscriptionContent } from './CurrentSubscriptionContent'
|
||||
import { InvoicesList } from './InvoicesList'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Text, HStack, Link, Spinner, Stack, Heading } from '@chakra-ui/react'
|
||||
import { useToast } from '@/hooks/useToast'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import React from 'react'
|
||||
import { PlanTag } from '../PlanTag'
|
||||
import { BillingPortalButton } from './BillingPortalButton'
|
||||
import { trpc } from '@/lib/trpc'
|
||||
import { Workspace } from 'models'
|
||||
import { Workspace } from '@typebot.io/schemas'
|
||||
|
||||
type CurrentSubscriptionContentProps = {
|
||||
workspace: Pick<Workspace, 'id' | 'plan' | 'stripeId'>
|
||||
|
||||
@@ -9,10 +9,10 @@ import {
|
||||
Tooltip,
|
||||
} from '@chakra-ui/react'
|
||||
import { AlertIcon } from '@/components/icons'
|
||||
import { Plan, Workspace } from 'db'
|
||||
import { Plan, Workspace } from '@typebot.io/prisma'
|
||||
import React from 'react'
|
||||
import { parseNumberWithCommas } from 'utils'
|
||||
import { getChatsLimit, getStorageLimit } from 'utils/pricing'
|
||||
import { parseNumberWithCommas } from '@typebot.io/lib'
|
||||
import { getChatsLimit, getStorageLimit } from '@typebot.io/lib/pricing'
|
||||
import { storageToReadable } from './helpers'
|
||||
import { trpc } from '@/lib/trpc'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { sendRequest } from 'utils'
|
||||
import { sendRequest } from '@typebot.io/lib'
|
||||
|
||||
export const cancelSubscriptionQuery = (stripeId: string) =>
|
||||
sendRequest({
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Stack, HStack, Text } from '@chakra-ui/react'
|
||||
import { useUser } from '@/features/account'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import { ProPlanContent } from './ProPlanContent'
|
||||
import { StarterPlanContent } from './StarterPlanContent'
|
||||
import { TextLink } from '@/components/TextLink'
|
||||
import { useToast } from '@/hooks/useToast'
|
||||
import { trpc } from '@/lib/trpc'
|
||||
import { guessIfUserIsEuropean } from 'utils/pricing'
|
||||
import { Workspace } from 'models'
|
||||
import { guessIfUserIsEuropean } from '@typebot.io/lib/pricing'
|
||||
import { Workspace } from '@typebot.io/schemas'
|
||||
import { PreCheckoutModal, PreCheckoutModalProps } from '../PreCheckoutModal'
|
||||
import { useState } from 'react'
|
||||
import { ParentModalProvider } from '@/features/graph/providers/ParentModalProvider'
|
||||
|
||||
@@ -16,9 +16,9 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { ChevronLeftIcon } from '@/components/icons'
|
||||
import { useWorkspace } from '@/features/workspace'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { parseNumberWithCommas } from 'utils'
|
||||
import { parseNumberWithCommas } from '@typebot.io/lib'
|
||||
import {
|
||||
chatsLimit,
|
||||
computePrice,
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
getChatsLimit,
|
||||
getStorageLimit,
|
||||
storageLimit,
|
||||
} from 'utils/pricing'
|
||||
} from '@typebot.io/lib/pricing'
|
||||
import { FeaturesList } from './components/FeaturesList'
|
||||
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { ChevronLeftIcon } from '@/components/icons'
|
||||
import { useWorkspace } from '@/features/workspace'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { parseNumberWithCommas } from 'utils'
|
||||
import { parseNumberWithCommas } from '@typebot.io/lib'
|
||||
import {
|
||||
chatsLimit,
|
||||
computePrice,
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
getChatsLimit,
|
||||
getStorageLimit,
|
||||
storageLimit,
|
||||
} from 'utils/pricing'
|
||||
} from '@typebot.io/lib/pricing'
|
||||
import { FeaturesList } from './components/FeaturesList'
|
||||
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Tag, TagProps } from '@chakra-ui/react'
|
||||
import { LockedIcon } from '@/components/icons'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
import { planColorSchemes } from './PlanTag'
|
||||
|
||||
export const LockTag = ({ plan, ...props }: { plan?: Plan } & TagProps) => (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Tag, TagProps, ThemeTypings } from '@chakra-ui/react'
|
||||
import { Plan } from 'db'
|
||||
import { Plan } from '@typebot.io/prisma'
|
||||
|
||||
export const planColorSchemes: Record<Plan, ThemeTypings['colorSchemes']> = {
|
||||
[Plan.LIFETIME]: 'purple',
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { useRouter } from 'next/router'
|
||||
import React, { FormEvent, useState } from 'react'
|
||||
import { isDefined } from 'utils'
|
||||
import { isDefined } from '@typebot.io/lib'
|
||||
import { taxIdTypes } from '../taxIdTypes'
|
||||
|
||||
export type PreCheckoutModalProps = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Button, ButtonProps, useDisclosure } from '@chakra-ui/react'
|
||||
import { useWorkspace } from '@/features/workspace'
|
||||
import React from 'react'
|
||||
import { isNotDefined } from 'utils'
|
||||
import { isNotDefined } from '@typebot.io/lib'
|
||||
import { ChangePlanModal } from './ChangePlanModal'
|
||||
import { LimitReached } from './ChangePlanModal'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Plan, Workspace } from 'db'
|
||||
import { isDefined, isNotDefined } from 'utils'
|
||||
import { Plan, Workspace } from '@typebot.io/prisma'
|
||||
import { isDefined, isNotDefined } from '@typebot.io/lib'
|
||||
|
||||
export const planToReadable = (plan?: Plan) => {
|
||||
if (!plan) return
|
||||
|
||||
Reference in New Issue
Block a user