diff --git a/apps/builder/src/pages/api/[...trpc].ts b/apps/builder/src/pages/api/[...trpc].ts index 980bac8300..ae3c0e69af 100644 --- a/apps/builder/src/pages/api/[...trpc].ts +++ b/apps/builder/src/pages/api/[...trpc].ts @@ -21,4 +21,13 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { }, })(req, res) } + +export const config = { + api: { + bodyParser: { + sizeLimit: '4mb', + }, + }, +} + export default handler diff --git a/apps/docs/openapi/builder/_spec_.json b/apps/docs/openapi/builder/_spec_.json index 2dca92fac5..0c07c8a410 100644 --- a/apps/docs/openapi/builder/_spec_.json +++ b/apps/docs/openapi/builder/_spec_.json @@ -56158,6 +56158,500 @@ } } } + }, + "/v1/t/process": { + "post": { + "operationId": "processTelemetryEvent", + "description": "Only used for the cloud version of Typebot. It's the way it processes telemetry events and inject it to thrid-party services.", + "tags": [ + "Telemetry" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "events": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Workspace created" + ] + }, + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "plan": { + "type": "string", + "enum": [ + "FREE", + "STARTER", + "PRO", + "LIFETIME", + "OFFERED", + "CUSTOM", + "UNLIMITED" + ] + } + }, + "required": [ + "plan" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "User created" + ] + }, + "data": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "email" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "typebotId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Typebot created" + ] + }, + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "template": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "typebotId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "typebotId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Typebot published" + ] + }, + "data": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "isFirstPublish": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "typebotId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Subscription updated" + ] + }, + "data": { + "type": "object", + "properties": { + "plan": { + "type": "string", + "enum": [ + "FREE", + "STARTER", + "PRO", + "LIFETIME", + "OFFERED", + "CUSTOM", + "UNLIMITED" + ] + } + }, + "required": [ + "plan" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "typebotId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "New results collected" + ] + }, + "data": { + "type": "object", + "properties": { + "total": { + "type": "number" + }, + "isFirstOfKind": { + "type": "boolean", + "enum": [ + true + ] + } + }, + "required": [ + "total" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "typebotId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Workspace limit reached" + ] + }, + "data": { + "type": "object", + "properties": { + "chatsLimit": { + "type": "number" + }, + "totalChatsUsed": { + "type": "number" + } + }, + "required": [ + "chatsLimit", + "totalChatsUsed" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Workspace automatically quarantined" + ] + }, + "data": { + "type": "object", + "properties": { + "chatsLimit": { + "type": "number" + }, + "totalChatsUsed": { + "type": "number" + } + }, + "required": [ + "chatsLimit", + "totalChatsUsed" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Subscription automatically updated" + ] + }, + "data": { + "type": "object", + "properties": { + "plan": { + "type": "string", + "enum": [ + "FREE", + "STARTER", + "PRO", + "LIFETIME", + "OFFERED", + "CUSTOM", + "UNLIMITED" + ] + } + }, + "required": [ + "plan" + ], + "additionalProperties": false + } + }, + "required": [ + "userId", + "workspaceId", + "name", + "data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Workspace past due" + ] + } + }, + "required": [ + "userId", + "workspaceId", + "name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string" + }, + "workspaceId": { + "type": "string" + }, + "name": { + "type": "string", + "enum": [ + "Workspace past due status removed" + ] + } + }, + "required": [ + "userId", + "workspaceId", + "name" + ], + "additionalProperties": false + } + ] + } + } + }, + "required": [ + "events" + ], + "additionalProperties": false + } + } + } + }, + "parameters": [], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "enum": [ + "Events injected" + ] + } + }, + "required": [ + "message" + ], + "additionalProperties": false + } + } + } + }, + "default": { + "$ref": "#/components/responses/error" + } + } + } } }, "components": {