♻️ (builder) Remove barrel export and flatten folder arch
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { getLinkedTypebots } from '@/features/blocks/logic/typebotLink/api'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { canReadTypebots } from '@/utils/api/dbRules'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { canReadTypebots } from '@/helpers/databaseRules'
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Typebot, Webhook } from '@typebot.io/schemas'
|
||||
import { z } from 'zod'
|
||||
import { parseResultExample } from '../utils'
|
||||
import { getLinkedTypebots } from '@/features/blocks/logic/typebotLink/helpers/getLinkedTypebots'
|
||||
import { parseResultExample } from '../helpers/parseResultExample'
|
||||
|
||||
export const getResultExampleProcedure = authenticatedProcedure
|
||||
export const getResultExample = authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'GET',
|
||||
@@ -1 +0,0 @@
|
||||
export * from './router'
|
||||
@@ -1,12 +1,12 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { canReadTypebots } from '@/utils/api/dbRules'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { canReadTypebots } from '@/helpers/databaseRules'
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Group, Typebot, Webhook, WebhookBlock } from '@typebot.io/schemas'
|
||||
import { byId, isWebhookBlock, parseGroupTitle } from '@typebot.io/lib'
|
||||
import { z } from 'zod'
|
||||
|
||||
export const listWebhookBlocksProcedure = authenticatedProcedure
|
||||
export const listWebhookBlocks = authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'GET',
|
||||
@@ -1,4 +0,0 @@
|
||||
export * from './getResultExampleProcedure'
|
||||
export * from './listWebhookBlocksProcedure'
|
||||
export * from './subscribeWebhookProcedure'
|
||||
export * from './unsubscribeWebhookProcedure'
|
||||
@@ -1,14 +1,12 @@
|
||||
import { router } from '@/utils/server/trpc'
|
||||
import {
|
||||
listWebhookBlocksProcedure,
|
||||
subscribeWebhookProcedure,
|
||||
unsubscribeWebhookProcedure,
|
||||
getResultExampleProcedure,
|
||||
} from './procedures'
|
||||
import { router } from '@/helpers/server/trpc'
|
||||
import { getResultExample } from './getResultExample'
|
||||
import { listWebhookBlocks } from './listWebhookBlocks'
|
||||
import { subscribeWebhook } from './subscribeWebhook'
|
||||
import { unsubscribeWebhook } from './unsubscribeWebhook'
|
||||
|
||||
export const webhookRouter = router({
|
||||
listWebhookBlocks: listWebhookBlocksProcedure,
|
||||
getResultExample: getResultExampleProcedure,
|
||||
subscribeWebhook: subscribeWebhookProcedure,
|
||||
unsubscribeWebhook: unsubscribeWebhookProcedure,
|
||||
listWebhookBlocks,
|
||||
getResultExample,
|
||||
subscribeWebhook,
|
||||
unsubscribeWebhook,
|
||||
})
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { canWriteTypebots } from '@/utils/api/dbRules'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { canWriteTypebots } from '@/helpers/databaseRules'
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Typebot, Webhook, WebhookBlock } from '@typebot.io/schemas'
|
||||
import { byId, isWebhookBlock } from '@typebot.io/lib'
|
||||
import { z } from 'zod'
|
||||
|
||||
export const subscribeWebhookProcedure = authenticatedProcedure
|
||||
export const subscribeWebhook = authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'POST',
|
||||
@@ -1,12 +1,12 @@
|
||||
import prisma from '@/lib/prisma'
|
||||
import { canWriteTypebots } from '@/utils/api/dbRules'
|
||||
import { authenticatedProcedure } from '@/utils/server/trpc'
|
||||
import { canWriteTypebots } from '@/helpers/databaseRules'
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { Typebot, Webhook, WebhookBlock } from '@typebot.io/schemas'
|
||||
import { byId, isWebhookBlock } from '@typebot.io/lib'
|
||||
import { z } from 'zod'
|
||||
|
||||
export const unsubscribeWebhookProcedure = authenticatedProcedure
|
||||
export const unsubscribeWebhook = authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'POST',
|
||||
@@ -1 +0,0 @@
|
||||
export * from './parseResultExample'
|
||||
@@ -2,7 +2,7 @@ import { DropdownList } from '@/components/DropdownList'
|
||||
import { CodeEditor } from '@/components/inputs/CodeEditor'
|
||||
import { SwitchWithLabel } from '@/components/inputs/SwitchWithLabel'
|
||||
import { TableList, TableListItemProps } from '@/components/TableList'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { useToast } from '@/hooks/useToast'
|
||||
import {
|
||||
Stack,
|
||||
@@ -25,14 +25,11 @@ import {
|
||||
} from '@typebot.io/schemas'
|
||||
import { useState, useMemo } from 'react'
|
||||
import { executeWebhook } from '../queries/executeWebhookQuery'
|
||||
import { convertVariablesForTestToVariables } from '../utils/convertVariablesForTestToVariables'
|
||||
import { getDeepKeys } from '../utils/getDeepKeys'
|
||||
import {
|
||||
QueryParamsInputs,
|
||||
HeadersInputs,
|
||||
} from './WebhookSettings/KeyValueInputs'
|
||||
import { DataVariableInputs } from './WebhookSettings/ResponseMappingInputs'
|
||||
import { VariableForTestInputs } from './WebhookSettings/VariableForTestInputs'
|
||||
import { convertVariablesForTestToVariables } from '../helpers/convertVariablesForTestToVariables'
|
||||
import { getDeepKeys } from '../helpers/getDeepKeys'
|
||||
import { QueryParamsInputs, HeadersInputs } from './KeyValueInputs'
|
||||
import { DataVariableInputs } from './ResponseMappingInputs'
|
||||
import { VariableForTestInputs } from './VariableForTestInputs'
|
||||
|
||||
type Props = {
|
||||
blockId: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Stack, Text } from '@chakra-ui/react'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { WebhookBlock } from '@typebot.io/schemas'
|
||||
import { byId } from '@typebot.io/lib'
|
||||
import { SetVariableLabel } from '@/components/SetVariableLabel'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React, { useState } from 'react'
|
||||
import { Spinner, Stack } from '@chakra-ui/react'
|
||||
import { useTypebot } from '@/features/editor'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
import { WebhookOptions, Webhook, WebhookBlock } from '@typebot.io/schemas'
|
||||
import { byId } from '@typebot.io/lib'
|
||||
import { TextInput } from '@/components/inputs'
|
||||
import { WebhookAdvancedConfigForm } from '../WebhookAdvancedConfigForm'
|
||||
import { WebhookAdvancedConfigForm } from './WebhookAdvancedConfigForm'
|
||||
|
||||
type Props = {
|
||||
block: WebhookBlock
|
||||
@@ -1 +0,0 @@
|
||||
export { WebhookSettings } from './WebhookSettings'
|
||||
@@ -1,4 +0,0 @@
|
||||
export { duplicateWebhookQuery } from './queries/duplicateWebhookQuery'
|
||||
export { WebhookSettings } from './components/WebhookSettings'
|
||||
export { WebhookContent } from './components/WebhookContent'
|
||||
export { WebhookIcon } from './components/WebhookIcon'
|
||||
Reference in New Issue
Block a user