2
0

♻️ (models) Change to features-centric folder structure

This commit is contained in:
Baptiste Arnaud
2022-11-15 11:02:26 +01:00
committed by Baptiste Arnaud
parent a9d04798bc
commit a5c8a8a95c
55 changed files with 37 additions and 43 deletions

View File

@ -1,4 +1,4 @@
import { ChatwootBlock, ChatwootOptions } from 'models/features/chatwoot'
import { ChatwootBlock, ChatwootOptions } from 'models'
import { sendEventToParent } from 'services/chat'
import { IntegrationContext } from 'services/integration'
import { isEmbedded } from 'services/utils'

View File

@ -1 +0,0 @@
export * from './types'

View File

@ -1,8 +0,0 @@
export * from './typebot'
export * from './publicTypebot'
export * from './result'
export * from './answer'
export * from './utils'
export * from './credentials'
export * from './webhooks'
export * from './features/chatwoot'

View File

@ -1,8 +1,8 @@
{
"name": "models",
"version": "1.0.0",
"main": "./index.ts",
"types": "./index.ts",
"main": "./src/index.ts",
"types": "./src/index.ts",
"license": "AGPL-3.0-or-later",
"private": true,
"dependencies": {

View File

@ -4,17 +4,17 @@ import {
Item,
LogicBlockOptions,
} from '.'
import { BubbleBlock, bubbleBlockSchema } from './bubble'
import { InputBlock, inputBlockSchema } from './input'
import { IntegrationBlock, integrationBlockSchema } from './integration'
import { BubbleBlock, bubbleBlockSchema } from './bubbles'
import { InputBlock, inputBlockSchema } from './inputs'
import { IntegrationBlock, integrationBlockSchema } from './integrations'
import { ConditionBlock, LogicBlock, logicBlockSchema } from './logic'
import { z } from 'zod'
import {
BubbleBlockType,
InputBlockType,
IntegrationBlockType,
LogicBlockType,
blockBaseSchema,
IntegrationBlockType,
} from './shared'
export type DraggableBlock =

View File

@ -1,4 +1,4 @@
export * from './bubble'
export * from './bubbleBlock'
export * from './text'
export * from './image'
export * from './video'

View File

@ -1,7 +1,7 @@
export * from './blocks'
export * from './bubble'
export * from './input'
export * from './bubbles'
export * from './inputs'
export * from './logic'
export * from './integration'
export * from './integrations'
export * from './item'
export * from './shared'

View File

@ -1,4 +1,4 @@
export * from './input'
export * from './inputBlock'
export * from './text'
export * from './email'
export * from './number'

View File

@ -1,8 +1,5 @@
import { z } from 'zod'
import {
blockBaseSchema,
IntegrationBlockType,
} from '../../typebot/blocks/shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
export const chatwootOptionsSchema = z.object({
baseUrl: z.string(),

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
export const googleAnalyticsOptionsSchema = z.object({
trackingId: z.string().optional(),

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
export enum GoogleSheetsAction {
GET = 'Get data from sheet',

View File

@ -1,4 +1,4 @@
export * from './integration'
export * from './integrationBlock'
export * from './webhook'
export * from './googleAnalytics'
export * from './pabblyConnect'
@ -6,3 +6,4 @@ export * from './makeCom'
export * from './zapier'
export * from './sendEmail'
export * from './googleSheets'
export * from './chatwoot'

View File

@ -1,8 +1,5 @@
import { z } from 'zod'
import {
chatwootBlockSchema,
chatwootOptionsSchema,
} from '../../../features/chatwoot'
import { chatwootBlockSchema, chatwootOptionsSchema } from './chatwoot'
import {
googleAnalyticsOptionsSchema,
googleAnalyticsBlockSchema,

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
import { webhookOptionsSchema } from './webhook'
export const makeComBlockSchema = blockBaseSchema.and(

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
import { webhookOptionsSchema } from './webhook'
export const pabblyConnectBlockSchema = blockBaseSchema.and(

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
export const sendEmailOptionsSchema = z.object({
credentialsId: z.string(),

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
const variableForTestSchema = z.object({
id: z.string(),

View File

@ -1,5 +1,5 @@
import { z } from 'zod'
import { IntegrationBlockType, blockBaseSchema } from '../shared'
import { blockBaseSchema, IntegrationBlockType } from '../shared'
import { webhookOptionsSchema } from './webhook'
export const zapierBlockSchema = blockBaseSchema.and(

View File

@ -1,6 +1,6 @@
import { z } from 'zod'
import { itemBaseSchema } from './shared'
import { buttonItemSchema } from './input'
import { buttonItemSchema } from './inputs'
import { conditionItemSchema } from './logic'
export type ItemIndices = {

View File

@ -1,4 +1,4 @@
export * from './logic'
export * from './logicBlock'
export * from './code'
export * from './condition'
export * from './redirect'

View File

@ -1,6 +1,7 @@
import { Result as ResultFromPrisma } from 'db'
import { Answer, VariableWithValue } from '.'
import { InputBlockType } from './typebot/blocks/shared'
import { Answer } from './answer'
import { InputBlockType } from './blocks'
import { VariableWithValue } from './typebot/variable'
export type Result = Omit<ResultFromPrisma, 'createdAt' | 'variables'> & {
createdAt: string

View File

@ -1,5 +1,4 @@
export * from './typebot'
export * from './blocks'
export * from './theme'
export * from './settings'
export * from './variable'

View File

@ -1,6 +1,6 @@
import { z } from 'zod'
import { settingsSchema } from './settings'
import { blockSchema } from './blocks'
import { blockSchema } from '../blocks'
import { themeSchema } from './theme'
import { variableSchema } from './variable'

View File

@ -0,0 +1,8 @@
export * from './features/blocks'
export * from './features/typebot'
export * from './features/publicTypebot'
export * from './features/result'
export * from './features/answer'
export * from './features/utils'
export * from './features/credentials'
export * from './features/webhooks'