@rjsebening/n8n-nodes-learningsuite 1.3.3 → 1.3.5
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/dist/nodes/LearningSuite/LearningSuiteTrigger.node.js +8 -0
- package/dist/nodes/LearningSuite/descriptions/community.properties.js +79 -8
- package/dist/nodes/LearningSuite/descriptions/course.properties.js +139 -0
- package/dist/nodes/LearningSuite/descriptions/trigger.instant.properties.js +23 -0
- package/dist/nodes/LearningSuite/descriptions/user.properties.js +21 -0
- package/dist/nodes/LearningSuite/descriptions/webhook.properties.js +33 -0
- package/dist/nodes/LearningSuite/descriptions/webhook.sampleData.properties.js +20 -0
- package/dist/nodes/LearningSuite/execute/community.handlers.d.ts +1 -0
- package/dist/nodes/LearningSuite/execute/community.handlers.js +58 -0
- package/dist/nodes/LearningSuite/execute/course.handlers.d.ts +2 -0
- package/dist/nodes/LearningSuite/execute/course.handlers.js +31 -0
- package/dist/nodes/LearningSuite/execute/user.handlers.d.ts +1 -0
- package/dist/nodes/LearningSuite/execute/user.handlers.js +6 -1
- package/dist/nodes/LearningSuite/execute/webhook.handlers.js +12 -0
- package/package.json +1 -1
|
@@ -54,6 +54,7 @@ const loTeamMember = __importStar(require("./methods/loadOptions/teamMember.load
|
|
|
54
54
|
const loCustomFields = __importStar(require("./methods/loadOptions/customFields.loadOptions"));
|
|
55
55
|
const INSTANT_EVENTS = new Set([
|
|
56
56
|
'agentAction.executed',
|
|
57
|
+
'aiAgent.limitForInaccessibleCourseContentExceeded',
|
|
57
58
|
'accessRequest.created',
|
|
58
59
|
'communityPost.created',
|
|
59
60
|
'communityPost.commented',
|
|
@@ -114,6 +115,13 @@ function buildDesiredFilter(event) {
|
|
|
114
115
|
}
|
|
115
116
|
break;
|
|
116
117
|
}
|
|
118
|
+
case 'aiAgent.limitForInaccessibleCourseContentExceeded': {
|
|
119
|
+
const col = getCol('additionalAiAgentLimit');
|
|
120
|
+
if (col === null || col === void 0 ? void 0 : col.agentId) {
|
|
121
|
+
filter.agentId = String(col.agentId);
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
117
125
|
// ---------------- Community
|
|
118
126
|
case 'communityPost.commented': {
|
|
119
127
|
const col = getCol('additionalCommunityPostCommented');
|
|
@@ -16,6 +16,12 @@ exports.communityProperties = [
|
|
|
16
16
|
description: 'Assign one or more badges to a member',
|
|
17
17
|
action: 'Assign badges to member',
|
|
18
18
|
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Create Community Post',
|
|
21
|
+
value: 'createCommunityPost',
|
|
22
|
+
description: 'Create a community post or answer in a discussion',
|
|
23
|
+
action: 'Create community post',
|
|
24
|
+
},
|
|
19
25
|
{
|
|
20
26
|
name: 'Create Community Post Comment',
|
|
21
27
|
value: 'commentOnPost',
|
|
@@ -132,9 +138,10 @@ exports.communityProperties = [
|
|
|
132
138
|
name: 'authorUserId',
|
|
133
139
|
type: 'options',
|
|
134
140
|
typeOptions: { loadOptionsMethod: 'teamMember_getTeamMembersById' },
|
|
135
|
-
displayOptions: { show: { resource: ['community'], operation: ['commentOnPost'] } },
|
|
141
|
+
displayOptions: { show: { resource: ['community'], operation: ['commentOnPost', 'createCommunityPost'] } },
|
|
136
142
|
default: '',
|
|
137
|
-
|
|
143
|
+
required: true,
|
|
144
|
+
description: 'Select a team member as author. The author must have access to the target forum. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
138
145
|
},
|
|
139
146
|
{
|
|
140
147
|
displayName: 'Comment Text',
|
|
@@ -191,23 +198,87 @@ exports.communityProperties = [
|
|
|
191
198
|
type: 'options',
|
|
192
199
|
typeOptions: { loadOptionsMethod: 'community_getAreas' },
|
|
193
200
|
displayOptions: {
|
|
194
|
-
show: { resource: ['community'], operation: ['getCommunityPosts'] },
|
|
201
|
+
show: { resource: ['community'], operation: ['getCommunityPosts', 'createCommunityPost'] },
|
|
195
202
|
},
|
|
196
203
|
default: '',
|
|
197
204
|
placeholder: 'Select Area (optional)',
|
|
198
|
-
description: 'Filter
|
|
205
|
+
description: 'Filter forums by community area. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
199
206
|
},
|
|
200
207
|
{
|
|
201
208
|
displayName: 'Forum Name or ID',
|
|
202
209
|
name: 'forumId',
|
|
203
210
|
type: 'options',
|
|
204
|
-
typeOptions: {
|
|
211
|
+
typeOptions: {
|
|
212
|
+
loadOptionsMethod: 'community_getForums',
|
|
213
|
+
loadOptionsDependsOn: ['areaId'],
|
|
214
|
+
},
|
|
205
215
|
displayOptions: {
|
|
206
|
-
show: { resource: ['community'], operation: ['getCommunityPosts'] },
|
|
216
|
+
show: { resource: ['community'], operation: ['getCommunityPosts', 'createCommunityPost'] },
|
|
217
|
+
},
|
|
218
|
+
default: '',
|
|
219
|
+
placeholder: 'Select Forum',
|
|
220
|
+
description: 'The forum in which the post should be published. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Post Title',
|
|
224
|
+
name: 'postTitle',
|
|
225
|
+
type: 'string',
|
|
226
|
+
displayOptions: { show: { resource: ['community'], operation: ['createCommunityPost'] } },
|
|
227
|
+
default: '',
|
|
228
|
+
description: 'Title of the post. Only applicable to discussions.',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
displayName: 'Answer to Post ID',
|
|
232
|
+
name: 'answerToPostId',
|
|
233
|
+
type: 'string',
|
|
234
|
+
displayOptions: { show: { resource: ['community'], operation: ['createCommunityPost'] } },
|
|
235
|
+
default: '',
|
|
236
|
+
description: 'If set, this post is created as an answer to another post. Only applicable to discussions.',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
displayName: 'Content Format',
|
|
240
|
+
name: 'contentFormat',
|
|
241
|
+
type: 'options',
|
|
242
|
+
displayOptions: { show: { resource: ['community'], operation: ['createCommunityPost'] } },
|
|
243
|
+
options: [
|
|
244
|
+
{ name: 'Text or HTML', value: 'string' },
|
|
245
|
+
{ name: 'JSON Array', value: 'json' },
|
|
246
|
+
],
|
|
247
|
+
default: 'string',
|
|
248
|
+
description: 'Format to send for the post content',
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
displayName: 'Content',
|
|
252
|
+
name: 'content',
|
|
253
|
+
type: 'string',
|
|
254
|
+
typeOptions: { rows: 6 },
|
|
255
|
+
displayOptions: {
|
|
256
|
+
show: { resource: ['community'], operation: ['createCommunityPost'], contentFormat: ['string'] },
|
|
207
257
|
},
|
|
208
258
|
default: '',
|
|
209
|
-
|
|
210
|
-
description: '
|
|
259
|
+
required: true,
|
|
260
|
+
description: 'Content of the post. May be plain text or HTML.',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
displayName: 'Content JSON',
|
|
264
|
+
name: 'contentJson',
|
|
265
|
+
type: 'json',
|
|
266
|
+
typeOptions: { rows: 6 },
|
|
267
|
+
displayOptions: {
|
|
268
|
+
show: { resource: ['community'], operation: ['createCommunityPost'], contentFormat: ['json'] },
|
|
269
|
+
},
|
|
270
|
+
default: '[]',
|
|
271
|
+
required: true,
|
|
272
|
+
description: 'Content of the post as a JSON array of objects, for example Slate content',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Element JSON',
|
|
276
|
+
name: 'elementJson',
|
|
277
|
+
type: 'json',
|
|
278
|
+
typeOptions: { rows: 4 },
|
|
279
|
+
displayOptions: { show: { resource: ['community'], operation: ['createCommunityPost'] } },
|
|
280
|
+
default: '{}',
|
|
281
|
+
description: 'Optional post element as a JSON object, for example a content link. Only applicable to feed posts.',
|
|
211
282
|
},
|
|
212
283
|
{
|
|
213
284
|
displayName: 'Order',
|
|
@@ -52,6 +52,18 @@ exports.courseProperties = [
|
|
|
52
52
|
description: 'List published courses',
|
|
53
53
|
action: 'Get published courses',
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Publish Course',
|
|
57
|
+
value: 'publishCourse',
|
|
58
|
+
description: 'Publish all pending changes of a course to a new version',
|
|
59
|
+
action: 'Publish course',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'Update Lesson',
|
|
63
|
+
value: 'updateLesson',
|
|
64
|
+
description: 'Update a lesson name or visibility',
|
|
65
|
+
action: 'Update lesson',
|
|
66
|
+
},
|
|
55
67
|
],
|
|
56
68
|
},
|
|
57
69
|
{
|
|
@@ -69,6 +81,7 @@ exports.courseProperties = [
|
|
|
69
81
|
'getAccessRequests',
|
|
70
82
|
'getSubmissions',
|
|
71
83
|
'createLesson',
|
|
84
|
+
'publishCourse',
|
|
72
85
|
],
|
|
73
86
|
},
|
|
74
87
|
},
|
|
@@ -76,6 +89,20 @@ exports.courseProperties = [
|
|
|
76
89
|
required: true,
|
|
77
90
|
description: 'ID of the course. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
78
91
|
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Course Name or ID',
|
|
94
|
+
name: 'courseId',
|
|
95
|
+
type: 'options',
|
|
96
|
+
typeOptions: { loadOptionsMethod: 'course_getCourses' },
|
|
97
|
+
displayOptions: {
|
|
98
|
+
show: {
|
|
99
|
+
resource: ['course'],
|
|
100
|
+
operation: ['updateLesson'],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
default: '',
|
|
104
|
+
description: 'Optional course filter for loading modules. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
105
|
+
},
|
|
79
106
|
{
|
|
80
107
|
displayName: 'Module Name or ID',
|
|
81
108
|
name: 'moduleId',
|
|
@@ -94,6 +121,41 @@ exports.courseProperties = [
|
|
|
94
121
|
required: true,
|
|
95
122
|
description: 'Select a module. Optionally, select a course first to filter the list. Or enter an ID using an expression. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
96
123
|
},
|
|
124
|
+
{
|
|
125
|
+
displayName: 'Module Name or ID',
|
|
126
|
+
name: 'moduleId',
|
|
127
|
+
type: 'options',
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
resource: ['course'],
|
|
131
|
+
operation: ['updateLesson'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
typeOptions: {
|
|
135
|
+
loadOptionsMethod: 'course_getModules',
|
|
136
|
+
loadOptionsDependsOn: ['courseId'],
|
|
137
|
+
},
|
|
138
|
+
default: '',
|
|
139
|
+
description: 'Optional module filter for loading lessons. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
displayName: 'Lesson Name or ID',
|
|
143
|
+
name: 'lessonId',
|
|
144
|
+
type: 'options',
|
|
145
|
+
typeOptions: {
|
|
146
|
+
loadOptionsMethod: 'module_getLessons',
|
|
147
|
+
loadOptionsDependsOn: ['moduleId'],
|
|
148
|
+
},
|
|
149
|
+
displayOptions: {
|
|
150
|
+
show: {
|
|
151
|
+
resource: ['course'],
|
|
152
|
+
operation: ['updateLesson'],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
default: '',
|
|
156
|
+
required: true,
|
|
157
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
158
|
+
},
|
|
97
159
|
{
|
|
98
160
|
displayName: 'Section Name or ID',
|
|
99
161
|
name: 'sectionId',
|
|
@@ -158,6 +220,13 @@ exports.courseProperties = [
|
|
|
158
220
|
default: '',
|
|
159
221
|
displayOptions: { show: { resource: ['course'], operation: ['createLesson'] } },
|
|
160
222
|
},
|
|
223
|
+
{
|
|
224
|
+
displayName: '<b>Publishing this course goes live immediately.</b> It will include all pending changes since the last published version.',
|
|
225
|
+
name: 'notice_publishCourse',
|
|
226
|
+
type: 'notice',
|
|
227
|
+
default: '',
|
|
228
|
+
displayOptions: { show: { resource: ['course'], operation: ['publishCourse'] } },
|
|
229
|
+
},
|
|
161
230
|
{
|
|
162
231
|
displayName: 'Additional Options',
|
|
163
232
|
name: 'additionalOptions',
|
|
@@ -203,6 +272,76 @@ exports.courseProperties = [
|
|
|
203
272
|
},
|
|
204
273
|
],
|
|
205
274
|
},
|
|
275
|
+
{
|
|
276
|
+
displayName: 'Publish Options',
|
|
277
|
+
name: 'publishOptions',
|
|
278
|
+
type: 'collection',
|
|
279
|
+
placeholder: 'Add Option',
|
|
280
|
+
default: {},
|
|
281
|
+
displayOptions: { show: { resource: ['course'], operation: ['publishCourse'] } },
|
|
282
|
+
options: [
|
|
283
|
+
{
|
|
284
|
+
displayName: 'Notify Members',
|
|
285
|
+
name: 'notifyMembers',
|
|
286
|
+
type: 'boolean',
|
|
287
|
+
default: false,
|
|
288
|
+
description: 'Whether course members should receive a notification with the update message via email and notification center',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
displayName: 'Update Message',
|
|
292
|
+
name: 'updateMessage',
|
|
293
|
+
type: 'string',
|
|
294
|
+
typeOptions: { rows: 4 },
|
|
295
|
+
default: '',
|
|
296
|
+
description: 'Optional update message sent with the course update notification',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
displayName: 'Version Name',
|
|
300
|
+
name: 'versionName',
|
|
301
|
+
type: 'string',
|
|
302
|
+
default: '',
|
|
303
|
+
description: 'Optional display name of the new version',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
displayName: 'Version Notes',
|
|
307
|
+
name: 'versionNotes',
|
|
308
|
+
type: 'string',
|
|
309
|
+
typeOptions: { rows: 4 },
|
|
310
|
+
default: '',
|
|
311
|
+
description: 'Optional internal notes for the new version',
|
|
312
|
+
},
|
|
313
|
+
],
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
displayName: 'Lesson Update Fields',
|
|
317
|
+
name: 'lessonUpdateFields',
|
|
318
|
+
type: 'collection',
|
|
319
|
+
placeholder: 'Add Field',
|
|
320
|
+
default: {},
|
|
321
|
+
displayOptions: { show: { resource: ['course'], operation: ['updateLesson'] } },
|
|
322
|
+
options: [
|
|
323
|
+
{
|
|
324
|
+
displayName: 'Name',
|
|
325
|
+
name: 'name',
|
|
326
|
+
type: 'string',
|
|
327
|
+
default: '',
|
|
328
|
+
description: 'The new lesson name',
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
displayName: 'Visibility',
|
|
332
|
+
name: 'visibility',
|
|
333
|
+
type: 'options',
|
|
334
|
+
options: [
|
|
335
|
+
{ name: 'Do Not Change', value: '' },
|
|
336
|
+
{ name: 'Coming Soon', value: 'COMING_SOON' },
|
|
337
|
+
{ name: 'Draft', value: 'DRAFT' },
|
|
338
|
+
{ name: 'Visible', value: 'VISIBLE' },
|
|
339
|
+
],
|
|
340
|
+
default: '',
|
|
341
|
+
description: 'The visibility status of the lesson',
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
},
|
|
206
345
|
{
|
|
207
346
|
displayName: 'Limit',
|
|
208
347
|
name: 'limit',
|
|
@@ -15,6 +15,11 @@ exports.instantProperties = [
|
|
|
15
15
|
value: 'agentAction.executed',
|
|
16
16
|
description: 'Triggers when an AI agent action has been executed',
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
name: 'AI Agent Limit for Inaccessible Course Content Exceeded',
|
|
20
|
+
value: 'aiAgent.limitForInaccessibleCourseContentExceeded',
|
|
21
|
+
description: 'Triggers when an AI agent exceeds the limit for inaccessible course content',
|
|
22
|
+
},
|
|
18
23
|
{
|
|
19
24
|
name: 'Community Post Commented',
|
|
20
25
|
value: 'communityPost.commented',
|
|
@@ -94,6 +99,24 @@ exports.instantProperties = [
|
|
|
94
99
|
},
|
|
95
100
|
],
|
|
96
101
|
},
|
|
102
|
+
{
|
|
103
|
+
displayName: 'AI Agent Limit Options',
|
|
104
|
+
name: 'additionalAiAgentLimit',
|
|
105
|
+
type: 'collection',
|
|
106
|
+
default: {},
|
|
107
|
+
placeholder: 'Add option',
|
|
108
|
+
displayOptions: { show: { event: ['aiAgent.limitForInaccessibleCourseContentExceeded'] } },
|
|
109
|
+
options: [
|
|
110
|
+
{
|
|
111
|
+
displayName: 'Agent Name or ID',
|
|
112
|
+
name: 'agentId',
|
|
113
|
+
type: 'options',
|
|
114
|
+
default: '',
|
|
115
|
+
description: 'Optional: Only trigger for a specific AI agent. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
116
|
+
typeOptions: { loadOptionsMethod: 'ai_getAiAgents' },
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
97
120
|
// Agent Action Executed
|
|
98
121
|
{
|
|
99
122
|
displayName: 'Agent Action Executed Options',
|
|
@@ -22,6 +22,12 @@ exports.userProperties = [
|
|
|
22
22
|
default: 'sendPushNotification',
|
|
23
23
|
displayOptions: { show: { resource: ['user'] } },
|
|
24
24
|
options: [
|
|
25
|
+
{
|
|
26
|
+
name: 'Send Login Email',
|
|
27
|
+
value: 'sendLoginEmail',
|
|
28
|
+
action: 'Send login email',
|
|
29
|
+
description: 'Send a login information email with a login link to a user',
|
|
30
|
+
},
|
|
25
31
|
{
|
|
26
32
|
name: 'Send Push Notification',
|
|
27
33
|
value: 'sendPushNotification',
|
|
@@ -30,6 +36,21 @@ exports.userProperties = [
|
|
|
30
36
|
},
|
|
31
37
|
],
|
|
32
38
|
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'User Name or ID',
|
|
41
|
+
name: 'userId',
|
|
42
|
+
type: 'options',
|
|
43
|
+
typeOptions: { loadOptionsMethod: 'member_getMembers' },
|
|
44
|
+
displayOptions: {
|
|
45
|
+
show: {
|
|
46
|
+
resource: ['user'],
|
|
47
|
+
operation: ['sendLoginEmail'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
default: '',
|
|
51
|
+
required: true,
|
|
52
|
+
description: 'User ID of the user who should receive a login link email. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
53
|
+
},
|
|
33
54
|
// User IDs
|
|
34
55
|
{
|
|
35
56
|
displayName: 'User Name or IDs',
|
|
@@ -81,6 +81,10 @@ exports.webhookProperties = [
|
|
|
81
81
|
description: 'Type of event to subscribe to',
|
|
82
82
|
options: [
|
|
83
83
|
{ name: 'Agent Action Executed', value: 'agentAction.executed' },
|
|
84
|
+
{
|
|
85
|
+
name: 'AI Agent Limit for Inaccessible Course Content Exceeded',
|
|
86
|
+
value: 'aiAgent.limitForInaccessibleCourseContentExceeded',
|
|
87
|
+
},
|
|
84
88
|
{ name: 'Community Post Commented', value: 'communityPost.commented' },
|
|
85
89
|
{ name: 'Community Post Created', value: 'communityPost.created' },
|
|
86
90
|
{ name: 'Community Post Moderated', value: 'communityPost.moderated' },
|
|
@@ -111,6 +115,10 @@ exports.webhookProperties = [
|
|
|
111
115
|
description: 'Type of sample data to retrieve',
|
|
112
116
|
options: [
|
|
113
117
|
{ name: 'Agent Action Executed Events', value: 'agent-action-executed-events' },
|
|
118
|
+
{
|
|
119
|
+
name: 'AI Agent Limit for Inaccessible Course Content Exceeded Events',
|
|
120
|
+
value: 'ai-agent-limit-for-inaccessible-course-content-exceeded-events',
|
|
121
|
+
},
|
|
114
122
|
{ name: 'Community Post Commented', value: 'community-post-commented-events' },
|
|
115
123
|
{ name: 'Community Post Created Events', value: 'community-post-created-events' },
|
|
116
124
|
{ name: 'Community Post Moderated Events', value: 'community-post-moderated-events' },
|
|
@@ -162,6 +170,31 @@ exports.webhookProperties = [
|
|
|
162
170
|
},
|
|
163
171
|
],
|
|
164
172
|
},
|
|
173
|
+
// AI Agent Limit for Inaccessible Course Content Exceeded
|
|
174
|
+
{
|
|
175
|
+
displayName: 'AI Agent Limit Options',
|
|
176
|
+
name: 'additionalAiAgentLimit',
|
|
177
|
+
type: 'collection',
|
|
178
|
+
default: {},
|
|
179
|
+
placeholder: 'Add option',
|
|
180
|
+
displayOptions: {
|
|
181
|
+
show: {
|
|
182
|
+
resource: ['webhook'],
|
|
183
|
+
operation: ['createSubscription', 'updateSubscription'],
|
|
184
|
+
eventType: ['aiAgent.limitForInaccessibleCourseContentExceeded'],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
options: [
|
|
188
|
+
{
|
|
189
|
+
displayName: 'Agent Name or ID',
|
|
190
|
+
name: 'agentId',
|
|
191
|
+
type: 'options',
|
|
192
|
+
default: '',
|
|
193
|
+
description: 'Optional: Only trigger for a specific AI agent. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
194
|
+
typeOptions: { loadOptionsMethod: 'ai_getAiAgents' },
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
},
|
|
165
198
|
// Login Options
|
|
166
199
|
{
|
|
167
200
|
displayName: 'Login Options',
|
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.webhookSampleDataProperties = void 0;
|
|
5
5
|
exports.webhookSampleDataProperties = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'AI Agent Limit Options',
|
|
8
|
+
name: 'additionalAiAgentLimitSample',
|
|
9
|
+
type: 'collection',
|
|
10
|
+
default: {},
|
|
11
|
+
placeholder: 'Add option',
|
|
12
|
+
displayOptions: {
|
|
13
|
+
show: { sampleDataType: ['ai-agent-limit-for-inaccessible-course-content-exceeded-events'] },
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Agent Name or ID',
|
|
18
|
+
name: 'agentId',
|
|
19
|
+
type: 'options',
|
|
20
|
+
default: '',
|
|
21
|
+
description: 'Optional agent ID to filter AI agent inaccessible course content limit events. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
|
22
|
+
typeOptions: { loadOptionsMethod: 'ai_getAiAgents' },
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
},
|
|
6
26
|
{
|
|
7
27
|
displayName: 'Agent Action Executed Options',
|
|
8
28
|
name: 'additionalAgentActionExecutedSample',
|
|
@@ -57,6 +57,63 @@ const removeBadgesFromUser = async (ctx, i) => {
|
|
|
57
57
|
const body = { userId: memberId, badgeIds };
|
|
58
58
|
return await shared_1.lsRequest.call(ctx, 'DELETE', '/community/badges/user', { body });
|
|
59
59
|
};
|
|
60
|
+
const createCommunityPost = async (ctx, i) => {
|
|
61
|
+
const authorUserId = String(ctx.getNodeParameter('authorUserId', i, '') || '').trim();
|
|
62
|
+
const forumId = String(ctx.getNodeParameter('forumId', i, '') || '').trim();
|
|
63
|
+
const postTitle = String(ctx.getNodeParameter('postTitle', i, '') || '').trim();
|
|
64
|
+
const answerToPostId = String(ctx.getNodeParameter('answerToPostId', i, '') || '').trim();
|
|
65
|
+
const contentFormat = ctx.getNodeParameter('contentFormat', i, 'string');
|
|
66
|
+
if (!authorUserId) {
|
|
67
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Please provide authorUserId.');
|
|
68
|
+
}
|
|
69
|
+
if (!forumId) {
|
|
70
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Please provide a forum ID.');
|
|
71
|
+
}
|
|
72
|
+
let content;
|
|
73
|
+
if (contentFormat === 'json') {
|
|
74
|
+
const contentJson = ctx.getNodeParameter('contentJson', i, '[]');
|
|
75
|
+
try {
|
|
76
|
+
content = JSON.parse(contentJson);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Invalid JSON in content: ${String(err)}`);
|
|
80
|
+
}
|
|
81
|
+
if (!Array.isArray(content)) {
|
|
82
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Content JSON must be an array of objects.');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
content = String(ctx.getNodeParameter('content', i, '') || '').trim();
|
|
87
|
+
if (!content) {
|
|
88
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'The post content cannot be empty.');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const body = {
|
|
92
|
+
authorUserId,
|
|
93
|
+
forumId,
|
|
94
|
+
content,
|
|
95
|
+
};
|
|
96
|
+
if (postTitle) {
|
|
97
|
+
body.postTitle = postTitle;
|
|
98
|
+
}
|
|
99
|
+
if (answerToPostId) {
|
|
100
|
+
body.answerToPostId = answerToPostId;
|
|
101
|
+
}
|
|
102
|
+
const elementJson = String(ctx.getNodeParameter('elementJson', i, '{}') || '').trim();
|
|
103
|
+
if (elementJson && elementJson !== '{}') {
|
|
104
|
+
try {
|
|
105
|
+
const element = JSON.parse(elementJson);
|
|
106
|
+
if (!element || Array.isArray(element) || typeof element !== 'object') {
|
|
107
|
+
throw new Error('Element JSON must be an object.');
|
|
108
|
+
}
|
|
109
|
+
body.element = element;
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Invalid JSON in element: ${String(err)}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return shared_1.lsRequest.call(ctx, 'POST', '/community/posts', { body });
|
|
116
|
+
};
|
|
60
117
|
const commentOnPost = async (ctx, i) => {
|
|
61
118
|
const postId = String(ctx.getNodeParameter('postId', i, '') || '').trim();
|
|
62
119
|
const authorUserId = String(ctx.getNodeParameter('authorUserId', i, '') || '').trim();
|
|
@@ -89,6 +146,7 @@ exports.communityHandlers = {
|
|
|
89
146
|
getBadges,
|
|
90
147
|
assignBadgesToUser,
|
|
91
148
|
removeBadgesFromUser,
|
|
149
|
+
createCommunityPost,
|
|
92
150
|
commentOnPost: exports.commentOnPost,
|
|
93
151
|
getCommunityPosts,
|
|
94
152
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.courseHandlers = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
4
5
|
const shared_1 = require("../shared");
|
|
5
6
|
const getPublished = async (ctx) => shared_1.lsRequest.call(ctx, 'GET', '/courses/published');
|
|
6
7
|
const getModules = async (ctx, i) => {
|
|
@@ -76,6 +77,34 @@ const createLesson = async (ctx, i) => {
|
|
|
76
77
|
});
|
|
77
78
|
return shared_1.lsRequest.call(ctx, 'POST', `/courses/${courseId}/create-lesson/${sectionId}`, { body });
|
|
78
79
|
};
|
|
80
|
+
const publishCourse = async (ctx, i) => {
|
|
81
|
+
const courseId = ctx.getNodeParameter('courseId', i);
|
|
82
|
+
const publishOptions = ctx.getNodeParameter('publishOptions', i, {});
|
|
83
|
+
const body = {
|
|
84
|
+
versionName: publishOptions.versionName,
|
|
85
|
+
versionNotes: publishOptions.versionNotes,
|
|
86
|
+
notifyMembers: publishOptions.notifyMembers,
|
|
87
|
+
updateMessage: publishOptions.updateMessage,
|
|
88
|
+
};
|
|
89
|
+
Object.keys(body).forEach((k) => {
|
|
90
|
+
if (body[k] === '' || body[k] === undefined || body[k] === null)
|
|
91
|
+
delete body[k];
|
|
92
|
+
});
|
|
93
|
+
return shared_1.lsRequest.call(ctx, 'POST', `/courses/${courseId}/publish`, { body });
|
|
94
|
+
};
|
|
95
|
+
const updateLesson = async (ctx, i) => {
|
|
96
|
+
const lessonId = ctx.getNodeParameter('lessonId', i);
|
|
97
|
+
const fields = ctx.getNodeParameter('lessonUpdateFields', i, {});
|
|
98
|
+
const body = {};
|
|
99
|
+
if (fields.name)
|
|
100
|
+
body.name = String(fields.name);
|
|
101
|
+
if (fields.visibility)
|
|
102
|
+
body.visibility = String(fields.visibility);
|
|
103
|
+
if (!body.name && !body.visibility) {
|
|
104
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Please provide at least one lesson field to update.');
|
|
105
|
+
}
|
|
106
|
+
return shared_1.lsRequest.call(ctx, 'PUT', `/lessons/${encodeURIComponent(lessonId)}`, { body });
|
|
107
|
+
};
|
|
79
108
|
exports.courseHandlers = {
|
|
80
109
|
getPublished,
|
|
81
110
|
getModules,
|
|
@@ -84,4 +113,6 @@ exports.courseHandlers = {
|
|
|
84
113
|
getAccessRequests,
|
|
85
114
|
getSubmissions,
|
|
86
115
|
createLesson,
|
|
116
|
+
publishCourse,
|
|
117
|
+
updateLesson,
|
|
87
118
|
};
|
|
@@ -27,6 +27,11 @@ const sendPushNotification = async (ctx, i) => {
|
|
|
27
27
|
body: bodyPayload,
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
+
const sendLoginEmail = async (ctx, i) => {
|
|
31
|
+
const userId = ctx.getNodeParameter('userId', i);
|
|
32
|
+
return await shared_1.lsRequest.call(ctx, 'POST', `/user/${encodeURIComponent(userId)}/send-login-email`);
|
|
33
|
+
};
|
|
30
34
|
exports.userHandlers = {
|
|
31
|
-
|
|
35
|
+
sendLoginEmail,
|
|
36
|
+
sendPushNotification,
|
|
32
37
|
};
|
|
@@ -45,6 +45,13 @@ function buildDesiredFilter(ctx, i, eventType) {
|
|
|
45
45
|
}
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
|
+
case 'aiAgent.limitForInaccessibleCourseContentExceeded': {
|
|
49
|
+
const col = getCol(ctx, i, 'additionalAiAgentLimit');
|
|
50
|
+
if (col === null || col === void 0 ? void 0 : col.agentId) {
|
|
51
|
+
filter.agentId = String(col.agentId);
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
48
55
|
// ---------------- Community
|
|
49
56
|
case 'communityPost.commented': {
|
|
50
57
|
const col = getCol(ctx, i, 'additionalCommunityPostCommented');
|
|
@@ -239,6 +246,11 @@ const getSampleData = async (ctx, i) => {
|
|
|
239
246
|
qs = col;
|
|
240
247
|
break;
|
|
241
248
|
}
|
|
249
|
+
case 'ai-agent-limit-for-inaccessible-course-content-exceeded-events': {
|
|
250
|
+
const col = ctx.getNodeParameter('additionalAiAgentLimitSample', i, {});
|
|
251
|
+
qs = col;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
242
254
|
case 'progress-changed-events': {
|
|
243
255
|
const col = ctx.getNodeParameter('additionalProgressChangedSample', i, {});
|
|
244
256
|
qs = col;
|