♻️ (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 { sendEventToParent } from 'services/chat'
|
||||||
import { IntegrationContext } from 'services/integration'
|
import { IntegrationContext } from 'services/integration'
|
||||||
import { isEmbedded } from 'services/utils'
|
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",
|
"name": "models",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "./index.ts",
|
"main": "./src/index.ts",
|
||||||
"types": "./index.ts",
|
"types": "./src/index.ts",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -4,17 +4,17 @@ import {
|
|||||||
Item,
|
Item,
|
||||||
LogicBlockOptions,
|
LogicBlockOptions,
|
||||||
} from '.'
|
} from '.'
|
||||||
import { BubbleBlock, bubbleBlockSchema } from './bubble'
|
import { BubbleBlock, bubbleBlockSchema } from './bubbles'
|
||||||
import { InputBlock, inputBlockSchema } from './input'
|
import { InputBlock, inputBlockSchema } from './inputs'
|
||||||
import { IntegrationBlock, integrationBlockSchema } from './integration'
|
import { IntegrationBlock, integrationBlockSchema } from './integrations'
|
||||||
import { ConditionBlock, LogicBlock, logicBlockSchema } from './logic'
|
import { ConditionBlock, LogicBlock, logicBlockSchema } from './logic'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import {
|
import {
|
||||||
BubbleBlockType,
|
BubbleBlockType,
|
||||||
InputBlockType,
|
InputBlockType,
|
||||||
IntegrationBlockType,
|
|
||||||
LogicBlockType,
|
LogicBlockType,
|
||||||
blockBaseSchema,
|
blockBaseSchema,
|
||||||
|
IntegrationBlockType,
|
||||||
} from './shared'
|
} from './shared'
|
||||||
|
|
||||||
export type DraggableBlock =
|
export type DraggableBlock =
|
@ -1,4 +1,4 @@
|
|||||||
export * from './bubble'
|
export * from './bubbleBlock'
|
||||||
export * from './text'
|
export * from './text'
|
||||||
export * from './image'
|
export * from './image'
|
||||||
export * from './video'
|
export * from './video'
|
@ -1,7 +1,7 @@
|
|||||||
export * from './blocks'
|
export * from './blocks'
|
||||||
export * from './bubble'
|
export * from './bubbles'
|
||||||
export * from './input'
|
export * from './inputs'
|
||||||
export * from './logic'
|
export * from './logic'
|
||||||
export * from './integration'
|
export * from './integrations'
|
||||||
export * from './item'
|
export * from './item'
|
||||||
export * from './shared'
|
export * from './shared'
|
@ -1,4 +1,4 @@
|
|||||||
export * from './input'
|
export * from './inputBlock'
|
||||||
export * from './text'
|
export * from './text'
|
||||||
export * from './email'
|
export * from './email'
|
||||||
export * from './number'
|
export * from './number'
|
@ -1,8 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import {
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
blockBaseSchema,
|
|
||||||
IntegrationBlockType,
|
|
||||||
} from '../../typebot/blocks/shared'
|
|
||||||
|
|
||||||
export const chatwootOptionsSchema = z.object({
|
export const chatwootOptionsSchema = z.object({
|
||||||
baseUrl: z.string(),
|
baseUrl: z.string(),
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
|
|
||||||
export const googleAnalyticsOptionsSchema = z.object({
|
export const googleAnalyticsOptionsSchema = z.object({
|
||||||
trackingId: z.string().optional(),
|
trackingId: z.string().optional(),
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
|
|
||||||
export enum GoogleSheetsAction {
|
export enum GoogleSheetsAction {
|
||||||
GET = 'Get data from sheet',
|
GET = 'Get data from sheet',
|
@ -1,4 +1,4 @@
|
|||||||
export * from './integration'
|
export * from './integrationBlock'
|
||||||
export * from './webhook'
|
export * from './webhook'
|
||||||
export * from './googleAnalytics'
|
export * from './googleAnalytics'
|
||||||
export * from './pabblyConnect'
|
export * from './pabblyConnect'
|
||||||
@ -6,3 +6,4 @@ export * from './makeCom'
|
|||||||
export * from './zapier'
|
export * from './zapier'
|
||||||
export * from './sendEmail'
|
export * from './sendEmail'
|
||||||
export * from './googleSheets'
|
export * from './googleSheets'
|
||||||
|
export * from './chatwoot'
|
@ -1,8 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import {
|
import { chatwootBlockSchema, chatwootOptionsSchema } from './chatwoot'
|
||||||
chatwootBlockSchema,
|
|
||||||
chatwootOptionsSchema,
|
|
||||||
} from '../../../features/chatwoot'
|
|
||||||
import {
|
import {
|
||||||
googleAnalyticsOptionsSchema,
|
googleAnalyticsOptionsSchema,
|
||||||
googleAnalyticsBlockSchema,
|
googleAnalyticsBlockSchema,
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
import { webhookOptionsSchema } from './webhook'
|
import { webhookOptionsSchema } from './webhook'
|
||||||
|
|
||||||
export const makeComBlockSchema = blockBaseSchema.and(
|
export const makeComBlockSchema = blockBaseSchema.and(
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
import { webhookOptionsSchema } from './webhook'
|
import { webhookOptionsSchema } from './webhook'
|
||||||
|
|
||||||
export const pabblyConnectBlockSchema = blockBaseSchema.and(
|
export const pabblyConnectBlockSchema = blockBaseSchema.and(
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
|
|
||||||
export const sendEmailOptionsSchema = z.object({
|
export const sendEmailOptionsSchema = z.object({
|
||||||
credentialsId: z.string(),
|
credentialsId: z.string(),
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
|
|
||||||
const variableForTestSchema = z.object({
|
const variableForTestSchema = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { IntegrationBlockType, blockBaseSchema } from '../shared'
|
import { blockBaseSchema, IntegrationBlockType } from '../shared'
|
||||||
import { webhookOptionsSchema } from './webhook'
|
import { webhookOptionsSchema } from './webhook'
|
||||||
|
|
||||||
export const zapierBlockSchema = blockBaseSchema.and(
|
export const zapierBlockSchema = blockBaseSchema.and(
|
@ -1,6 +1,6 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { itemBaseSchema } from './shared'
|
import { itemBaseSchema } from './shared'
|
||||||
import { buttonItemSchema } from './input'
|
import { buttonItemSchema } from './inputs'
|
||||||
import { conditionItemSchema } from './logic'
|
import { conditionItemSchema } from './logic'
|
||||||
|
|
||||||
export type ItemIndices = {
|
export type ItemIndices = {
|
@ -1,4 +1,4 @@
|
|||||||
export * from './logic'
|
export * from './logicBlock'
|
||||||
export * from './code'
|
export * from './code'
|
||||||
export * from './condition'
|
export * from './condition'
|
||||||
export * from './redirect'
|
export * from './redirect'
|
@ -1,6 +1,7 @@
|
|||||||
import { Result as ResultFromPrisma } from 'db'
|
import { Result as ResultFromPrisma } from 'db'
|
||||||
import { Answer, VariableWithValue } from '.'
|
import { Answer } from './answer'
|
||||||
import { InputBlockType } from './typebot/blocks/shared'
|
import { InputBlockType } from './blocks'
|
||||||
|
import { VariableWithValue } from './typebot/variable'
|
||||||
|
|
||||||
export type Result = Omit<ResultFromPrisma, 'createdAt' | 'variables'> & {
|
export type Result = Omit<ResultFromPrisma, 'createdAt' | 'variables'> & {
|
||||||
createdAt: string
|
createdAt: string
|
@ -1,5 +1,4 @@
|
|||||||
export * from './typebot'
|
export * from './typebot'
|
||||||
export * from './blocks'
|
|
||||||
export * from './theme'
|
export * from './theme'
|
||||||
export * from './settings'
|
export * from './settings'
|
||||||
export * from './variable'
|
export * from './variable'
|
@ -1,6 +1,6 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { settingsSchema } from './settings'
|
import { settingsSchema } from './settings'
|
||||||
import { blockSchema } from './blocks'
|
import { blockSchema } from '../blocks'
|
||||||
import { themeSchema } from './theme'
|
import { themeSchema } from './theme'
|
||||||
import { variableSchema } from './variable'
|
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