♻️ (models) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
a9d04798bc
commit
a5c8a8a95c
@ -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'
|
||||
|
@ -1 +0,0 @@
|
||||
export * from './types'
|
@ -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'
|
@ -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": {
|
||||
|
@ -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 =
|
@ -1,4 +1,4 @@
|
||||
export * from './bubble'
|
||||
export * from './bubbleBlock'
|
||||
export * from './text'
|
||||
export * from './image'
|
||||
export * from './video'
|
@ -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'
|
@ -1,4 +1,4 @@
|
||||
export * from './input'
|
||||
export * from './inputBlock'
|
||||
export * from './text'
|
||||
export * from './email'
|
||||
export * from './number'
|
@ -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(),
|
@ -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(),
|
@ -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',
|
@ -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'
|
@ -1,8 +1,5 @@
|
||||
import { z } from 'zod'
|
||||
import {
|
||||
chatwootBlockSchema,
|
||||
chatwootOptionsSchema,
|
||||
} from '../../../features/chatwoot'
|
||||
import { chatwootBlockSchema, chatwootOptionsSchema } from './chatwoot'
|
||||
import {
|
||||
googleAnalyticsOptionsSchema,
|
||||
googleAnalyticsBlockSchema,
|
@ -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(
|
@ -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(
|
@ -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(),
|
@ -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(),
|
@ -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(
|
@ -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 = {
|
@ -1,4 +1,4 @@
|
||||
export * from './logic'
|
||||
export * from './logicBlock'
|
||||
export * from './code'
|
||||
export * from './condition'
|
||||
export * from './redirect'
|
@ -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
|
@ -1,5 +1,4 @@
|
||||
export * from './typebot'
|
||||
export * from './blocks'
|
||||
export * from './theme'
|
||||
export * from './settings'
|
||||
export * from './variable'
|
@ -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'
|
||||
|
8
packages/models/src/index.ts
Normal file
8
packages/models/src/index.ts
Normal 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'
|
Reference in New Issue
Block a user