n8n-nodes-typebot 1.3.22 → 1.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,10 @@
1
- import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
1
+ import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
2
  export declare class TypebotApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
+ icon: "file:typebot.svg";
5
6
  documentationUrl: string;
6
7
  properties: INodeProperties[];
7
8
  authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
8
10
  }
@@ -5,6 +5,7 @@ class TypebotApi {
5
5
  constructor() {
6
6
  this.name = 'typebotApi';
7
7
  this.displayName = 'Typebot API';
8
+ this.icon = 'file:typebot.svg';
8
9
  this.documentationUrl = 'https://docs.typebot.io/api-reference/authentication';
9
10
  this.properties = [
10
11
  {
@@ -43,6 +44,13 @@ class TypebotApi {
43
44
  },
44
45
  },
45
46
  };
47
+ this.test = {
48
+ request: {
49
+ baseURL: '={{$credentials.baseUrl}}',
50
+ url: '/v1/workspaces',
51
+ method: 'GET',
52
+ },
53
+ };
46
54
  }
47
55
  }
48
56
  exports.TypebotApi = TypebotApi;
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <!-- For LIGHT mode - white background with dark logo -->
4
+ <rect width="60" height="60" rx="12" fill="#FFFFFF"/>
5
+ <rect x="8" y="8" width="44" height="44" rx="8" fill="#1F2937"/>
6
+ <rect x="14" y="14" width="32" height="32" rx="6" fill="none" stroke="#FFFFFF" stroke-width="3"/>
7
+ <rect x="24" y="18" width="12" height="24" rx="2" fill="#FFFFFF" transform="rotate(-15 30 30)"/>
8
+ </svg>
@@ -15,8 +15,8 @@ class Typebot {
15
15
  defaults: {
16
16
  name: 'Typebot',
17
17
  },
18
- inputs: ['main'],
19
- outputs: ['main'],
18
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
19
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
20
20
  credentials: [
21
21
  {
22
22
  name: 'typebotApi',
@@ -36,20 +36,20 @@ class Typebot {
36
36
  value: 'chat',
37
37
  },
38
38
  {
39
- name: 'Typebot',
40
- value: 'typebot',
39
+ name: 'Folder',
40
+ value: 'folder',
41
41
  },
42
42
  {
43
43
  name: 'Result',
44
44
  value: 'result',
45
45
  },
46
46
  {
47
- name: 'Workspace',
48
- value: 'workspace',
47
+ name: 'Typebot',
48
+ value: 'typebot',
49
49
  },
50
50
  {
51
- name: 'Folder',
52
- value: 'folder',
51
+ name: 'Workspace',
52
+ value: 'workspace',
53
53
  },
54
54
  ],
55
55
  default: 'chat',
@@ -68,18 +68,30 @@ class Typebot {
68
68
  },
69
69
  },
70
70
  options: [
71
- {
72
- name: 'Start Chat',
73
- value: 'startChat',
74
- description: 'Start a new chat session',
75
- action: 'Start a chat session',
76
- },
77
71
  {
78
72
  name: 'Continue Chat',
79
73
  value: 'continueChat',
80
74
  description: 'Continue an existing chat session',
81
75
  action: 'Continue a chat session',
82
76
  },
77
+ {
78
+ name: 'Generate Upload URL',
79
+ value: 'generateUploadUrl',
80
+ description: 'Generate a presigned URL for file upload',
81
+ action: 'Generate upload URL',
82
+ },
83
+ {
84
+ name: 'Save Logs',
85
+ value: 'saveLogs',
86
+ description: 'Save client logs for a session',
87
+ action: 'Save logs',
88
+ },
89
+ {
90
+ name: 'Start Chat',
91
+ value: 'startChat',
92
+ description: 'Start a new chat session',
93
+ action: 'Start a chat session',
94
+ },
83
95
  {
84
96
  name: 'Start Preview Chat',
85
97
  value: 'startPreviewChat',
@@ -92,18 +104,6 @@ class Typebot {
92
104
  description: 'Update typebot configuration in an active session',
93
105
  action: 'Update typebot in session',
94
106
  },
95
- {
96
- name: 'Save Logs',
97
- value: 'saveLogs',
98
- description: 'Save client logs for a session',
99
- action: 'Save logs',
100
- },
101
- {
102
- name: 'Generate Upload URL',
103
- value: 'generateUploadUrl',
104
- description: 'Generate a presigned URL for file upload',
105
- action: 'Generate upload URL',
106
- },
107
107
  ],
108
108
  default: 'startChat',
109
109
  },
@@ -963,7 +963,7 @@ class Typebot {
963
963
  if (additionalFields.textBubbleContentFormat) {
964
964
  body.textBubbleContentFormat = additionalFields.textBubbleContentFormat;
965
965
  }
966
- responseData = await this.helpers.httpRequest({
966
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
967
967
  method: 'POST',
968
968
  url: `${chatBaseUrl}/v1/typebots/${publicId}/startChat`,
969
969
  body,
@@ -973,7 +973,7 @@ class Typebot {
973
973
  else if (operation === 'continueChat') {
974
974
  const sessionId = this.getNodeParameter('sessionId', i);
975
975
  const message = this.getNodeParameter('message', i);
976
- responseData = await this.helpers.httpRequest({
976
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
977
977
  method: 'POST',
978
978
  url: `${chatBaseUrl}/v1/sessions/${sessionId}/continueChat`,
979
979
  body: { message },
@@ -998,7 +998,7 @@ class Typebot {
998
998
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Prefilled Variables must be valid JSON');
999
999
  }
1000
1000
  }
1001
- responseData = await this.helpers.httpRequest({
1001
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
1002
1002
  method: 'POST',
1003
1003
  url: `${chatBaseUrl}/v1/typebots/${typebotId}/preview/startChat`,
1004
1004
  body,
@@ -1007,7 +1007,7 @@ class Typebot {
1007
1007
  }
1008
1008
  else if (operation === 'updateTypebotInSession') {
1009
1009
  const sessionId = this.getNodeParameter('sessionId', i);
1010
- responseData = await this.helpers.httpRequest({
1010
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
1011
1011
  method: 'POST',
1012
1012
  url: `${chatBaseUrl}/v1/sessions/${sessionId}/updateTypebot`,
1013
1013
  json: true,
@@ -1023,7 +1023,7 @@ class Typebot {
1023
1023
  catch (error) {
1024
1024
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Client Logs must be valid JSON');
1025
1025
  }
1026
- responseData = await this.helpers.httpRequest({
1026
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
1027
1027
  method: 'POST',
1028
1028
  url: `${chatBaseUrl}/v2/sessions/${sessionId}/clientLogs`,
1029
1029
  body: { clientLogs: logs },
@@ -1040,7 +1040,7 @@ class Typebot {
1040
1040
  if (fileType) {
1041
1041
  body.fileType = fileType;
1042
1042
  }
1043
- responseData = await this.helpers.httpRequest({
1043
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
1044
1044
  method: 'POST',
1045
1045
  url: `${chatBaseUrl}/v2/generate-upload-url`,
1046
1046
  qs: { sessionId },
@@ -1146,7 +1146,7 @@ class Typebot {
1146
1146
  }
1147
1147
  else if (operation === 'getPublished') {
1148
1148
  const publicId = this.getNodeParameter('publicId', i);
1149
- responseData = await this.helpers.httpRequest({
1149
+ responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'typebotApi', {
1150
1150
  method: 'GET',
1151
1151
  url: `${chatBaseUrl}/v1/publicTypebots/${publicId}`,
1152
1152
  json: true,
@@ -1353,7 +1353,7 @@ class Typebot {
1353
1353
  returnData.push(...executionData);
1354
1354
  continue;
1355
1355
  }
1356
- throw error;
1356
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
1357
1357
  }
1358
1358
  }
1359
1359
  return [returnData];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-typebot",
3
- "version": "1.3.22",
3
+ "version": "1.3.24",
4
4
  "description": "n8n community node for Typebot - A powerful chatbot builder integration",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",