@rjsebening/n8n-nodes-learningsuite 1.3.5 → 1.4.0
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.
- package/README.md +3 -3
- package/dist/nodes/LearningSuite/LearningSuite.node.js +2 -2
- package/dist/nodes/LearningSuite/LearningSuiteTrigger.node.js +2 -2
- package/dist/nodes/LearningSuite/descriptions/ai.properties.js +15 -135
- package/dist/nodes/LearningSuite/descriptions/group.properties.js +12 -3
- package/dist/nodes/LearningSuite/execute/ai.handlers.d.ts +1 -1
- package/dist/nodes/LearningSuite/execute/ai.handlers.js +51 -31
- package/dist/nodes/LearningSuite/execute/group.handlers.d.ts +1 -0
- package/dist/nodes/LearningSuite/execute/group.handlers.js +9 -0
- package/dist/nodes/LearningSuitePollingTrigger/LearningSuitePollingTrigger.node.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ This community node uses the public LearningSuite API and is not affiliated with
|
|
|
44
44
|
|
|
45
45
|
- Add bundles to group, add courses to group, add members to groups, add members to groups (summary)
|
|
46
46
|
- Create group, delete group, find group by name, find or create group
|
|
47
|
-
- Get group courses, get many, remove courses from group, remove members from groups
|
|
47
|
+
- Get group by ID, get group courses, get many, remove courses from group, remove members from groups
|
|
48
48
|
|
|
49
49
|
### 📦 **Bundle** (2 operations)
|
|
50
50
|
|
|
@@ -88,9 +88,9 @@ This community node uses the public LearningSuite API and is not affiliated with
|
|
|
88
88
|
|
|
89
89
|
- Send push notification
|
|
90
90
|
|
|
91
|
-
### 🤖 **AI** (
|
|
91
|
+
### 🤖 **AI** (4 operations)
|
|
92
92
|
|
|
93
|
-
-
|
|
93
|
+
- Agent chat, concierge chat, get agent actions, get AI agents
|
|
94
94
|
|
|
95
95
|
### 🛡️ **Role** (1 operation)
|
|
96
96
|
|
|
@@ -113,11 +113,11 @@ class LearningSuite {
|
|
|
113
113
|
group: ['transform'],
|
|
114
114
|
version: 1,
|
|
115
115
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
116
|
-
description: 'Interact with LearningSuite API (powered by
|
|
116
|
+
description: 'Interact with LearningSuite API (powered by joergsebening.de)',
|
|
117
117
|
defaults: {
|
|
118
118
|
name: 'LearningSuite',
|
|
119
119
|
// @ts-expect-error -- description required by linter
|
|
120
|
-
description: 'Interact with LearningSuite API (powered by
|
|
120
|
+
description: 'Interact with LearningSuite API (powered by joergsebening.de)',
|
|
121
121
|
},
|
|
122
122
|
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
123
123
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
@@ -288,12 +288,12 @@ class LearningSuiteTrigger {
|
|
|
288
288
|
},
|
|
289
289
|
group: ['trigger'],
|
|
290
290
|
version: 1,
|
|
291
|
-
description: 'Interact with LearningSuite API (powered by
|
|
291
|
+
description: 'Interact with LearningSuite API (powered by joergsebening.de)',
|
|
292
292
|
subtitle: '={{$parameter["event"]}}',
|
|
293
293
|
defaults: {
|
|
294
294
|
name: 'LearningSuite Trigger',
|
|
295
295
|
// @ts-expect-error -- description is required by n8n node linting for defaults
|
|
296
|
-
description: 'Interact with LearningSuite API (powered by
|
|
296
|
+
description: 'Interact with LearningSuite API (powered by joergsebening.de)',
|
|
297
297
|
},
|
|
298
298
|
inputs: [],
|
|
299
299
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
@@ -7,7 +7,7 @@ exports.aiProperties = [
|
|
|
7
7
|
name: 'operation',
|
|
8
8
|
type: 'options',
|
|
9
9
|
noDataExpression: true,
|
|
10
|
-
default: '
|
|
10
|
+
default: 'agentChat',
|
|
11
11
|
displayOptions: { show: { resource: ['ai'] } },
|
|
12
12
|
options: [
|
|
13
13
|
{
|
|
@@ -16,6 +16,12 @@ exports.aiProperties = [
|
|
|
16
16
|
description: 'Send a message to an AI agent and get the response',
|
|
17
17
|
action: 'Send message to AI agent',
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Concierge Chat',
|
|
21
|
+
value: 'conciergeChat',
|
|
22
|
+
description: 'Send a message to the global AI Concierge agent and get the response',
|
|
23
|
+
action: 'Send message to AI concierge',
|
|
24
|
+
},
|
|
19
25
|
{
|
|
20
26
|
name: 'Get Agent Actions',
|
|
21
27
|
value: 'getAgentActions',
|
|
@@ -28,12 +34,6 @@ exports.aiProperties = [
|
|
|
28
34
|
description: 'List all enabled AI agents',
|
|
29
35
|
action: 'List AI agents',
|
|
30
36
|
},
|
|
31
|
-
{
|
|
32
|
-
name: 'RAG Chat',
|
|
33
|
-
value: 'ragChat',
|
|
34
|
-
description: 'Ask a question using the AI RAG chat endpoint',
|
|
35
|
-
action: 'Ask AI question',
|
|
36
|
-
},
|
|
37
37
|
],
|
|
38
38
|
},
|
|
39
39
|
{
|
|
@@ -54,7 +54,7 @@ exports.aiProperties = [
|
|
|
54
54
|
required: true,
|
|
55
55
|
default: '',
|
|
56
56
|
description: 'The user ID of the member sending the message. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
57
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
57
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
displayName: 'Message',
|
|
@@ -62,7 +62,7 @@ exports.aiProperties = [
|
|
|
62
62
|
type: 'string',
|
|
63
63
|
default: '',
|
|
64
64
|
description: 'The message you want to send to the AI agent',
|
|
65
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
65
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
displayName: 'Chat ID',
|
|
@@ -70,7 +70,7 @@ exports.aiProperties = [
|
|
|
70
70
|
type: 'string',
|
|
71
71
|
default: '',
|
|
72
72
|
description: 'The chat/conversation you want to send the message to. Leave empty to start a new chat.',
|
|
73
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
73
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
displayName: 'Include Chat History',
|
|
@@ -78,7 +78,7 @@ exports.aiProperties = [
|
|
|
78
78
|
type: 'boolean',
|
|
79
79
|
default: false,
|
|
80
80
|
description: 'Whether to return the full chat history in the response. Otherwise, only the latest agent response is returned.',
|
|
81
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
81
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
displayName: 'End Chat',
|
|
@@ -86,7 +86,7 @@ exports.aiProperties = [
|
|
|
86
86
|
type: 'boolean',
|
|
87
87
|
default: false,
|
|
88
88
|
description: 'Whether to end the chat after this message. The agent will not generate a response. Useful when filling out a form is complete.',
|
|
89
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
89
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
displayName: 'Metadata',
|
|
@@ -94,134 +94,14 @@ exports.aiProperties = [
|
|
|
94
94
|
type: 'json',
|
|
95
95
|
default: '{}',
|
|
96
96
|
description: 'If a previous agent response included metadata, it should be included in the next request. Provide as JSON object.',
|
|
97
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
97
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
displayName: 'Profile Context',
|
|
101
101
|
name: 'profileContext',
|
|
102
102
|
type: 'json',
|
|
103
103
|
default: '{}',
|
|
104
|
-
description: 'Optional profile context to use when interacting with custom field (forms). Only used if the agent config supports it.
|
|
105
|
-
displayOptions: { show: { resource: ['ai'], operation: ['agentChat'] } },
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
displayName: 'Question',
|
|
109
|
-
name: 'question',
|
|
110
|
-
type: 'string',
|
|
111
|
-
required: true,
|
|
112
|
-
default: '',
|
|
113
|
-
description: 'The question to ask the AI',
|
|
114
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
displayName: 'User Name or ID',
|
|
118
|
-
name: 'userId',
|
|
119
|
-
type: 'options',
|
|
120
|
-
typeOptions: { loadOptionsMethod: 'member_getMembers' },
|
|
121
|
-
default: '',
|
|
122
|
-
description: 'The ID of the user making the request. Used to personalize and scope the AI response. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
123
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
displayName: 'Conversation ID',
|
|
127
|
-
name: 'conversationId',
|
|
128
|
-
type: 'string',
|
|
129
|
-
default: '',
|
|
130
|
-
description: 'If set, the conversation history with this ID will be taken into account',
|
|
131
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
displayName: 'Answer Length',
|
|
135
|
-
name: 'answerLength',
|
|
136
|
-
type: 'options',
|
|
137
|
-
default: 'standard',
|
|
138
|
-
description: 'The desired length of the AI’s answer',
|
|
139
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
140
|
-
options: [
|
|
141
|
-
{
|
|
142
|
-
name: 'Concise',
|
|
143
|
-
value: 'concise',
|
|
144
|
-
description: 'A short and to-the-point answer',
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: 'Standard',
|
|
148
|
-
value: 'standard',
|
|
149
|
-
description: 'A balanced answer with sufficient detail',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: 'Detailed',
|
|
153
|
-
value: 'detailed',
|
|
154
|
-
description: 'A comprehensive and detailed answer',
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
displayName: 'Tone',
|
|
160
|
-
name: 'tone',
|
|
161
|
-
type: 'options',
|
|
162
|
-
default: 'neutral',
|
|
163
|
-
description: 'The desired tone of the AI’s answer',
|
|
164
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
165
|
-
options: [
|
|
166
|
-
{
|
|
167
|
-
name: 'Friendly',
|
|
168
|
-
value: 'friendly',
|
|
169
|
-
description: 'A warm and approachable tone',
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: 'Neutral',
|
|
173
|
-
value: 'neutral',
|
|
174
|
-
description: 'A neutral and factual tone',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: 'Professional',
|
|
178
|
-
value: 'professional',
|
|
179
|
-
description: 'A formal and professional tone',
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
displayName: 'Format',
|
|
185
|
-
name: 'format',
|
|
186
|
-
type: 'options',
|
|
187
|
-
default: 'markdown',
|
|
188
|
-
description: 'The desired output format of the AI’s answer',
|
|
189
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
190
|
-
options: [
|
|
191
|
-
{
|
|
192
|
-
name: 'Markdown',
|
|
193
|
-
value: 'markdown',
|
|
194
|
-
description: 'Formatted output using Markdown',
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
name: 'Plain Text',
|
|
198
|
-
value: 'plaintext',
|
|
199
|
-
description: 'Unformatted plain text output',
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
displayName: 'Add Citations',
|
|
205
|
-
name: 'addCitations',
|
|
206
|
-
type: 'boolean',
|
|
207
|
-
default: false,
|
|
208
|
-
description: 'Whether the AI will add citations to its answer',
|
|
209
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
displayName: 'Unlock Content Drip',
|
|
213
|
-
name: 'unlockContentDrip',
|
|
214
|
-
type: 'boolean',
|
|
215
|
-
default: false,
|
|
216
|
-
description: 'Whether the AI will have access to content that is normally restricted by content drip settings',
|
|
217
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
displayName: 'System Prompt Addition',
|
|
221
|
-
name: 'systemPromptAddition',
|
|
222
|
-
type: 'string',
|
|
223
|
-
default: '',
|
|
224
|
-
description: 'Additional system prompt instructions to guide the AI’s behavior',
|
|
225
|
-
displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
|
|
104
|
+
description: 'Optional profile context to use when interacting with custom field (forms). Only used if the agent config supports it. Leave as {} to omit. Expected structure: { "selectedProfileIdByCard": { "cardId": "profileId or null" } } - keys are custom field card IDs, values are profile IDs or null for the default profile.',
|
|
105
|
+
displayOptions: { show: { resource: ['ai'], operation: ['agentChat', 'conciergeChat'] } },
|
|
226
106
|
},
|
|
227
107
|
];
|
|
@@ -48,6 +48,12 @@ exports.groupProperties = [
|
|
|
48
48
|
description: 'Find a group by name or create it if not found',
|
|
49
49
|
action: 'Find or create group',
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Get Group by ID',
|
|
53
|
+
value: 'getById',
|
|
54
|
+
description: 'Get a single group by ID',
|
|
55
|
+
action: 'Get group by ID',
|
|
56
|
+
},
|
|
51
57
|
{
|
|
52
58
|
name: 'Get Group Courses',
|
|
53
59
|
value: 'getCourses',
|
|
@@ -75,7 +81,10 @@ exports.groupProperties = [
|
|
|
75
81
|
type: 'options',
|
|
76
82
|
typeOptions: { loadOptionsMethod: 'group_getGroups' },
|
|
77
83
|
displayOptions: {
|
|
78
|
-
show: {
|
|
84
|
+
show: {
|
|
85
|
+
resource: ['group'],
|
|
86
|
+
operation: ['delete', 'getById', 'getCourses', 'addCourses', 'removeCourses', 'addBundles'],
|
|
87
|
+
},
|
|
79
88
|
},
|
|
80
89
|
default: '',
|
|
81
90
|
required: true,
|
|
@@ -132,14 +141,14 @@ exports.groupProperties = [
|
|
|
132
141
|
type: 'collection',
|
|
133
142
|
placeholder: 'Add Option',
|
|
134
143
|
default: {},
|
|
135
|
-
displayOptions: { show: { resource: ['group'], operation: ['getAll', 'findByName', 'findOrCreate'] } },
|
|
144
|
+
displayOptions: { show: { resource: ['group'], operation: ['getAll', 'getById', 'findByName', 'findOrCreate'] } },
|
|
136
145
|
options: [
|
|
137
146
|
{
|
|
138
147
|
displayName: 'Include Users',
|
|
139
148
|
name: 'includeUsers',
|
|
140
149
|
type: 'boolean',
|
|
141
150
|
default: false,
|
|
142
|
-
description: 'Whether
|
|
151
|
+
description: 'Whether to include users in the group results',
|
|
143
152
|
},
|
|
144
153
|
],
|
|
145
154
|
},
|
|
@@ -13,24 +13,49 @@ function parseJsonObjectParam(ctx, i, name) {
|
|
|
13
13
|
const raw = ctx.getNodeParameter(name, i, '');
|
|
14
14
|
if (raw === undefined || raw === null || raw === '')
|
|
15
15
|
return undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
let parsed = raw;
|
|
17
|
+
if (typeof raw !== 'object') {
|
|
18
|
+
try {
|
|
19
|
+
parsed = JSON.parse(raw);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Invalid JSON in "${name}": ${String(err)}`);
|
|
23
|
+
}
|
|
24
24
|
}
|
|
25
25
|
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
26
26
|
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `"${name}" must be a JSON object`);
|
|
27
27
|
}
|
|
28
|
+
// The "{}" placeholder means "not set" - sending it would fail the API's schema validation
|
|
29
|
+
if (Object.keys(parsed).length === 0)
|
|
30
|
+
return undefined;
|
|
28
31
|
return parsed;
|
|
29
32
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const PROFILE_CONTEXT_EXAMPLE = '{ "selectedProfileIdByCard": { "<cardId>": "<profileId or null>" } }';
|
|
34
|
+
/** Reads and validates the optional profile context, which the API only accepts fully formed. */
|
|
35
|
+
function buildProfileContext(ctx, i) {
|
|
36
|
+
const profileContext = parseJsonObjectParam(ctx, i, 'profileContext');
|
|
37
|
+
if (!profileContext)
|
|
38
|
+
return undefined;
|
|
39
|
+
const selection = profileContext.selectedProfileIdByCard;
|
|
40
|
+
if (!selection || typeof selection !== 'object' || Array.isArray(selection)) {
|
|
41
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), '"Profile Context" must contain a "selectedProfileIdByCard" object', {
|
|
42
|
+
itemIndex: i,
|
|
43
|
+
description: `Expected structure: ${PROFILE_CONTEXT_EXAMPLE}. Keys are custom field card IDs, values are profile IDs (or null for the default profile).`,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const invalid = Object.entries(selection)
|
|
47
|
+
.filter(([, v]) => v !== null && typeof v !== 'string')
|
|
48
|
+
.map(([k]) => k);
|
|
49
|
+
if (invalid.length) {
|
|
50
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `"Profile Context" contains invalid profile IDs for the following cards: ${invalid.join(', ')}`, {
|
|
51
|
+
itemIndex: i,
|
|
52
|
+
description: `Each value must be a profile ID string or null (= default profile). Expected structure: ${PROFILE_CONTEXT_EXAMPLE}.`,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return profileContext;
|
|
56
|
+
}
|
|
57
|
+
/** Builds the chat request body shared by the agent and concierge chat endpoints. */
|
|
58
|
+
function buildChatBody(ctx, i) {
|
|
34
59
|
const body = {
|
|
35
60
|
userId: ctx.getNodeParameter('userId', i),
|
|
36
61
|
chatId: ctx.getNodeParameter('chatId', i, undefined),
|
|
@@ -38,30 +63,25 @@ const agentChat = async (ctx, i) => {
|
|
|
38
63
|
includeChatHistory: ctx.getNodeParameter('includeChatHistory', i, false),
|
|
39
64
|
endChat: ctx.getNodeParameter('endChat', i, false),
|
|
40
65
|
metadata: parseJsonObjectParam(ctx, i, 'metadata'),
|
|
41
|
-
profileContext:
|
|
42
|
-
};
|
|
43
|
-
const cleanBody = Object.fromEntries(Object.entries(body).filter(([, v]) => v !== undefined && v !== ''));
|
|
44
|
-
return await shared_1.lsRequest.call(ctx, 'POST', `/ai-agents/${encodeURIComponent(agentId)}/chat`, { body: cleanBody });
|
|
45
|
-
};
|
|
46
|
-
const ragChat = async (ctx, i) => {
|
|
47
|
-
const body = {
|
|
48
|
-
question: ctx.getNodeParameter('question', i),
|
|
49
|
-
userId: ctx.getNodeParameter('userId', i, undefined),
|
|
50
|
-
conversationId: ctx.getNodeParameter('conversationId', i, undefined),
|
|
51
|
-
addCitations: ctx.getNodeParameter('addCitations', i, false),
|
|
52
|
-
systemPromptAddition: ctx.getNodeParameter('systemPromptAddition', i, undefined),
|
|
53
|
-
answerLength: ctx.getNodeParameter('answerLength', i, 'standard'),
|
|
54
|
-
tone: ctx.getNodeParameter('tone', i, 'neutral'),
|
|
55
|
-
format: ctx.getNodeParameter('format', i, 'markdown'),
|
|
56
|
-
unlockContentDrip: ctx.getNodeParameter('unlockContentDrip', i, false),
|
|
66
|
+
profileContext: buildProfileContext(ctx, i),
|
|
57
67
|
};
|
|
58
68
|
// Remove keys with undefined or empty string values so optional params are not sent as empty
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
return Object.fromEntries(Object.entries(body).filter(([, v]) => v !== undefined && v !== ''));
|
|
70
|
+
}
|
|
71
|
+
const agentChat = async (ctx, i) => {
|
|
72
|
+
const agentId = ctx.getNodeParameter('agentId', i);
|
|
73
|
+
if (!agentId)
|
|
74
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'AI Agent is required');
|
|
75
|
+
return await shared_1.lsRequest.call(ctx, 'POST', `/ai-agents/${encodeURIComponent(agentId)}/chat`, {
|
|
76
|
+
body: buildChatBody(ctx, i),
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const conciergeChat = async (ctx, i) => {
|
|
80
|
+
return await shared_1.lsRequest.call(ctx, 'POST', '/ai-agents/concierge/chat', { body: buildChatBody(ctx, i) });
|
|
61
81
|
};
|
|
62
82
|
exports.aiHandlers = {
|
|
63
83
|
agentChat,
|
|
84
|
+
conciergeChat,
|
|
64
85
|
getAgentActions,
|
|
65
86
|
getAiAgents,
|
|
66
|
-
ragChat,
|
|
67
87
|
};
|
|
@@ -54,6 +54,14 @@ const removeMembers = async (ctx, i) => {
|
|
|
54
54
|
const groupIds = (0, shared_1.toIdArray)(ctx.getNodeParameter('groupIds', i));
|
|
55
55
|
return await shared_1.lsRequest.call(ctx, 'DELETE', '/remove-members-from-groups', { body: { userIds, groupIds } });
|
|
56
56
|
};
|
|
57
|
+
const getById = async (ctx, i) => {
|
|
58
|
+
const groupId = ctx.getNodeParameter('groupId', i);
|
|
59
|
+
const additionalOptions = ctx.getNodeParameter('additionalOptions', i, {});
|
|
60
|
+
const qs = {};
|
|
61
|
+
if (additionalOptions.includeUsers)
|
|
62
|
+
qs.includeUsers = additionalOptions.includeUsers;
|
|
63
|
+
return await shared_1.lsRequest.call(ctx, 'GET', `/groups/${groupId}`, { qs });
|
|
64
|
+
};
|
|
57
65
|
const getCourses = async (ctx, i) => {
|
|
58
66
|
const groupId = ctx.getNodeParameter('groupId', i);
|
|
59
67
|
return await shared_1.lsRequest.call(ctx, 'GET', `/group/${groupId}/courses`);
|
|
@@ -89,6 +97,7 @@ exports.groupHandlers = {
|
|
|
89
97
|
delete: deleteGroup,
|
|
90
98
|
findByName,
|
|
91
99
|
findOrCreate,
|
|
100
|
+
getById,
|
|
92
101
|
addMembers,
|
|
93
102
|
removeMembers,
|
|
94
103
|
getCourses,
|
|
@@ -149,12 +149,12 @@ class LearningSuitePollingTrigger {
|
|
|
149
149
|
group: ['trigger', 'schedule'],
|
|
150
150
|
version: 1,
|
|
151
151
|
polling: true,
|
|
152
|
-
description: 'Polling Trigger node for LearningSuite API (powered by
|
|
152
|
+
description: 'Polling Trigger node for LearningSuite API (powered by joergsebening.de)',
|
|
153
153
|
subtitle: '={{$parameter["event"]}}',
|
|
154
154
|
defaults: {
|
|
155
155
|
name: 'LearningSuite Polling Trigger',
|
|
156
156
|
// @ts-expect-error -- description is required by n8n node linting for defaults
|
|
157
|
-
description: 'Polling Trigger node for LearningSuite API (powered by
|
|
157
|
+
description: 'Polling Trigger node for LearningSuite API (powered by joergsebening.de)',
|
|
158
158
|
},
|
|
159
159
|
inputs: [],
|
|
160
160
|
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|