n8n-nodes-tukimate 1.2.0 → 1.2.2
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.
|
@@ -12,6 +12,7 @@ const RESOURCES = {
|
|
|
12
12
|
CLIENT: 'client',
|
|
13
13
|
SOURCE: 'source',
|
|
14
14
|
CONVERSATION_TYPE: 'conversationType',
|
|
15
|
+
TAG: 'tag',
|
|
15
16
|
};
|
|
16
17
|
// Operation definitions
|
|
17
18
|
const OPERATIONS = {
|
|
@@ -185,6 +186,7 @@ class TukiMate {
|
|
|
185
186
|
{ name: 'Client', value: RESOURCES.CLIENT },
|
|
186
187
|
{ name: 'Source', value: RESOURCES.SOURCE },
|
|
187
188
|
{ name: 'Conversation Type', value: RESOURCES.CONVERSATION_TYPE },
|
|
189
|
+
{ name: 'Tag', value: RESOURCES.TAG },
|
|
188
190
|
],
|
|
189
191
|
default: RESOURCES.CONVERSATION,
|
|
190
192
|
},
|
|
@@ -914,6 +916,36 @@ class TukiMate {
|
|
|
914
916
|
],
|
|
915
917
|
default: OPERATIONS.LIST,
|
|
916
918
|
},
|
|
919
|
+
// ==================== TAG ====================
|
|
920
|
+
{
|
|
921
|
+
displayName: 'Operation',
|
|
922
|
+
name: 'operation',
|
|
923
|
+
type: 'options',
|
|
924
|
+
noDataExpression: true,
|
|
925
|
+
displayOptions: {
|
|
926
|
+
show: {
|
|
927
|
+
resource: [RESOURCES.TAG],
|
|
928
|
+
},
|
|
929
|
+
},
|
|
930
|
+
options: [
|
|
931
|
+
{ name: 'Get', value: OPERATIONS.GET, description: 'Get tags for a conversation' },
|
|
932
|
+
],
|
|
933
|
+
default: OPERATIONS.GET,
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
displayName: 'Conversation ID',
|
|
937
|
+
name: 'conversationId',
|
|
938
|
+
type: 'string',
|
|
939
|
+
required: true,
|
|
940
|
+
displayOptions: {
|
|
941
|
+
show: {
|
|
942
|
+
resource: [RESOURCES.TAG],
|
|
943
|
+
operation: [OPERATIONS.GET],
|
|
944
|
+
},
|
|
945
|
+
},
|
|
946
|
+
default: '',
|
|
947
|
+
description: 'The ID of the conversation to get tags from',
|
|
948
|
+
},
|
|
917
949
|
],
|
|
918
950
|
};
|
|
919
951
|
methods = {
|
|
@@ -1235,6 +1267,13 @@ class TukiMate {
|
|
|
1235
1267
|
responseData = await tukiMateRequest.call(this, 'GET', '/conversation-types');
|
|
1236
1268
|
}
|
|
1237
1269
|
}
|
|
1270
|
+
// ==================== TAG ====================
|
|
1271
|
+
else if (resource === RESOURCES.TAG) {
|
|
1272
|
+
if (operation === OPERATIONS.GET) {
|
|
1273
|
+
const conversationId = this.getNodeParameter('conversationId', i);
|
|
1274
|
+
responseData = await tukiMateRequest.call(this, 'GET', `/conversations/${conversationId}/tags`);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1238
1277
|
// Handle response data
|
|
1239
1278
|
if (Array.isArray(responseData)) {
|
|
1240
1279
|
returnData.push(...responseData.map((item) => ({ json: item })));
|