@learningsuite/n8n-nodes-learningsuite 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.
Files changed (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.de.md +555 -0
  3. package/README.md +427 -0
  4. package/dist/credentials/LearningSuiteApi.credentials.d.ts +10 -0
  5. package/dist/credentials/LearningSuiteApi.credentials.js +49 -0
  6. package/dist/credentials/learningsuite.svg +1 -0
  7. package/dist/nodes/LearningSuite/LearningSuite.node.d.ts +65 -0
  8. package/dist/nodes/LearningSuite/LearningSuite.node.js +221 -0
  9. package/dist/nodes/LearningSuite/LearningSuiteTrigger.node.d.ts +66 -0
  10. package/dist/nodes/LearningSuite/LearningSuiteTrigger.node.js +433 -0
  11. package/dist/nodes/LearningSuite/descriptions/ai.properties.d.ts +2 -0
  12. package/dist/nodes/LearningSuite/descriptions/ai.properties.js +141 -0
  13. package/dist/nodes/LearningSuite/descriptions/apiCall.properties.d.ts +2 -0
  14. package/dist/nodes/LearningSuite/descriptions/apiCall.properties.js +87 -0
  15. package/dist/nodes/LearningSuite/descriptions/bundle.properties.d.ts +2 -0
  16. package/dist/nodes/LearningSuite/descriptions/bundle.properties.js +32 -0
  17. package/dist/nodes/LearningSuite/descriptions/community.properties.d.ts +2 -0
  18. package/dist/nodes/LearningSuite/descriptions/community.properties.js +229 -0
  19. package/dist/nodes/LearningSuite/descriptions/course.properties.d.ts +2 -0
  20. package/dist/nodes/LearningSuite/descriptions/course.properties.js +248 -0
  21. package/dist/nodes/LearningSuite/descriptions/customFields.properties.d.ts +2 -0
  22. package/dist/nodes/LearningSuite/descriptions/customFields.properties.js +452 -0
  23. package/dist/nodes/LearningSuite/descriptions/group.properties.d.ts +2 -0
  24. package/dist/nodes/LearningSuite/descriptions/group.properties.js +165 -0
  25. package/dist/nodes/LearningSuite/descriptions/hub.properties.d.ts +2 -0
  26. package/dist/nodes/LearningSuite/descriptions/hub.properties.js +167 -0
  27. package/dist/nodes/LearningSuite/descriptions/member.properties.d.ts +2 -0
  28. package/dist/nodes/LearningSuite/descriptions/member.properties.js +625 -0
  29. package/dist/nodes/LearningSuite/descriptions/module.properties.d.ts +2 -0
  30. package/dist/nodes/LearningSuite/descriptions/module.properties.js +84 -0
  31. package/dist/nodes/LearningSuite/descriptions/popup.properties.d.ts +2 -0
  32. package/dist/nodes/LearningSuite/descriptions/popup.properties.js +73 -0
  33. package/dist/nodes/LearningSuite/descriptions/resource.selector.d.ts +2 -0
  34. package/dist/nodes/LearningSuite/descriptions/resource.selector.js +87 -0
  35. package/dist/nodes/LearningSuite/descriptions/role.properties.d.ts +2 -0
  36. package/dist/nodes/LearningSuite/descriptions/role.properties.js +14 -0
  37. package/dist/nodes/LearningSuite/descriptions/teamMember.properties.d.ts +2 -0
  38. package/dist/nodes/LearningSuite/descriptions/teamMember.properties.js +74 -0
  39. package/dist/nodes/LearningSuite/descriptions/trigger.instant.properties.d.ts +2 -0
  40. package/dist/nodes/LearningSuite/descriptions/trigger.instant.properties.js +542 -0
  41. package/dist/nodes/LearningSuite/descriptions/user.properties.d.ts +2 -0
  42. package/dist/nodes/LearningSuite/descriptions/user.properties.js +135 -0
  43. package/dist/nodes/LearningSuite/descriptions/webhook.properties.d.ts +2 -0
  44. package/dist/nodes/LearningSuite/descriptions/webhook.properties.js +672 -0
  45. package/dist/nodes/LearningSuite/descriptions/webhook.sampleData.properties.d.ts +2 -0
  46. package/dist/nodes/LearningSuite/descriptions/webhook.sampleData.properties.js +401 -0
  47. package/dist/nodes/LearningSuite/exec.types.d.ts +5 -0
  48. package/dist/nodes/LearningSuite/exec.types.js +2 -0
  49. package/dist/nodes/LearningSuite/execute/ai.handlers.d.ts +4 -0
  50. package/dist/nodes/LearningSuite/execute/ai.handlers.js +23 -0
  51. package/dist/nodes/LearningSuite/execute/apiCall.handlers.d.ts +4 -0
  52. package/dist/nodes/LearningSuite/execute/apiCall.handlers.js +46 -0
  53. package/dist/nodes/LearningSuite/execute/bundle.handlers.d.ts +5 -0
  54. package/dist/nodes/LearningSuite/execute/bundle.handlers.js +12 -0
  55. package/dist/nodes/LearningSuite/execute/community.handlers.d.ts +11 -0
  56. package/dist/nodes/LearningSuite/execute/community.handlers.js +94 -0
  57. package/dist/nodes/LearningSuite/execute/course.handlers.d.ts +10 -0
  58. package/dist/nodes/LearningSuite/execute/course.handlers.js +87 -0
  59. package/dist/nodes/LearningSuite/execute/customFields.handlers.d.ts +16 -0
  60. package/dist/nodes/LearningSuite/execute/customFields.handlers.js +342 -0
  61. package/dist/nodes/LearningSuite/execute/group.handlers.d.ts +15 -0
  62. package/dist/nodes/LearningSuite/execute/group.handlers.js +99 -0
  63. package/dist/nodes/LearningSuite/execute/hub.handlers.d.ts +9 -0
  64. package/dist/nodes/LearningSuite/execute/hub.handlers.js +65 -0
  65. package/dist/nodes/LearningSuite/execute/member.handlers.d.ts +23 -0
  66. package/dist/nodes/LearningSuite/execute/member.handlers.js +244 -0
  67. package/dist/nodes/LearningSuite/execute/module.handlers.d.ts +6 -0
  68. package/dist/nodes/LearningSuite/execute/module.handlers.js +36 -0
  69. package/dist/nodes/LearningSuite/execute/popup.handlers.d.ts +7 -0
  70. package/dist/nodes/LearningSuite/execute/popup.handlers.js +24 -0
  71. package/dist/nodes/LearningSuite/execute/registry.d.ts +2 -0
  72. package/dist/nodes/LearningSuite/execute/registry.js +35 -0
  73. package/dist/nodes/LearningSuite/execute/role.handlers.d.ts +4 -0
  74. package/dist/nodes/LearningSuite/execute/role.handlers.js +6 -0
  75. package/dist/nodes/LearningSuite/execute/teamMember.handlers.d.ts +6 -0
  76. package/dist/nodes/LearningSuite/execute/teamMember.handlers.js +21 -0
  77. package/dist/nodes/LearningSuite/execute/user.handlers.d.ts +4 -0
  78. package/dist/nodes/LearningSuite/execute/user.handlers.js +32 -0
  79. package/dist/nodes/LearningSuite/execute/webhook.handlers.d.ts +9 -0
  80. package/dist/nodes/LearningSuite/execute/webhook.handlers.js +306 -0
  81. package/dist/nodes/LearningSuite/icons/learningsuite-icon-dark.svg +1 -0
  82. package/dist/nodes/LearningSuite/icons/learningsuite-icon-light.svg +1 -0
  83. package/dist/nodes/LearningSuite/index.d.ts +1 -0
  84. package/dist/nodes/LearningSuite/index.js +17 -0
  85. package/dist/nodes/LearningSuite/methods/loadOptions/apiCall.loadOptions.d.ts +1 -0
  86. package/dist/nodes/LearningSuite/methods/loadOptions/apiCall.loadOptions.js +2 -0
  87. package/dist/nodes/LearningSuite/methods/loadOptions/bundle.loadOptions.d.ts +2 -0
  88. package/dist/nodes/LearningSuite/methods/loadOptions/bundle.loadOptions.js +7 -0
  89. package/dist/nodes/LearningSuite/methods/loadOptions/common.d.ts +7 -0
  90. package/dist/nodes/LearningSuite/methods/loadOptions/common.js +22 -0
  91. package/dist/nodes/LearningSuite/methods/loadOptions/community.loadOptions.d.ts +5 -0
  92. package/dist/nodes/LearningSuite/methods/loadOptions/community.loadOptions.js +80 -0
  93. package/dist/nodes/LearningSuite/methods/loadOptions/course.loadOptions.d.ts +5 -0
  94. package/dist/nodes/LearningSuite/methods/loadOptions/course.loadOptions.js +58 -0
  95. package/dist/nodes/LearningSuite/methods/loadOptions/customFields.loadOptions.d.ts +12 -0
  96. package/dist/nodes/LearningSuite/methods/loadOptions/customFields.loadOptions.js +55 -0
  97. package/dist/nodes/LearningSuite/methods/loadOptions/group.loadOptions.d.ts +2 -0
  98. package/dist/nodes/LearningSuite/methods/loadOptions/group.loadOptions.js +7 -0
  99. package/dist/nodes/LearningSuite/methods/loadOptions/hub.loadOptions.d.ts +3 -0
  100. package/dist/nodes/LearningSuite/methods/loadOptions/hub.loadOptions.js +11 -0
  101. package/dist/nodes/LearningSuite/methods/loadOptions/member.loadOptions.d.ts +9 -0
  102. package/dist/nodes/LearningSuite/methods/loadOptions/member.loadOptions.js +27 -0
  103. package/dist/nodes/LearningSuite/methods/loadOptions/module.loadOptions.d.ts +5 -0
  104. package/dist/nodes/LearningSuite/methods/loadOptions/module.loadOptions.js +29 -0
  105. package/dist/nodes/LearningSuite/methods/loadOptions/popup.loadOptions.d.ts +2 -0
  106. package/dist/nodes/LearningSuite/methods/loadOptions/popup.loadOptions.js +7 -0
  107. package/dist/nodes/LearningSuite/methods/loadOptions/role.loadOptions.d.ts +2 -0
  108. package/dist/nodes/LearningSuite/methods/loadOptions/role.loadOptions.js +7 -0
  109. package/dist/nodes/LearningSuite/methods/loadOptions/teamMember.loadOptions.d.ts +9 -0
  110. package/dist/nodes/LearningSuite/methods/loadOptions/teamMember.loadOptions.js +35 -0
  111. package/dist/nodes/LearningSuite/methods/loadOptions/webhook.loadOptions.d.ts +6 -0
  112. package/dist/nodes/LearningSuite/methods/loadOptions/webhook.loadOptions.js +18 -0
  113. package/dist/nodes/LearningSuite/methods/resourceMappers/customFields.resourceMapper.d.ts +2 -0
  114. package/dist/nodes/LearningSuite/methods/resourceMappers/customFields.resourceMapper.js +35 -0
  115. package/dist/nodes/LearningSuite/methods/resourceMappers/hub.resourceMapper.d.ts +2 -0
  116. package/dist/nodes/LearningSuite/methods/resourceMappers/hub.resourceMapper.js +34 -0
  117. package/dist/nodes/LearningSuite/shared/customFields.helpers.d.ts +4 -0
  118. package/dist/nodes/LearningSuite/shared/customFields.helpers.js +56 -0
  119. package/dist/nodes/LearningSuite/shared/customFields.shared.d.ts +42 -0
  120. package/dist/nodes/LearningSuite/shared/customFields.shared.js +101 -0
  121. package/dist/nodes/LearningSuite/shared/customFields.upload.d.ts +13 -0
  122. package/dist/nodes/LearningSuite/shared/customFields.upload.js +198 -0
  123. package/dist/nodes/LearningSuite/shared/errors.d.ts +1 -0
  124. package/dist/nodes/LearningSuite/shared/errors.js +16 -0
  125. package/dist/nodes/LearningSuite/shared/getScopedParam.d.ts +2 -0
  126. package/dist/nodes/LearningSuite/shared/getScopedParam.js +39 -0
  127. package/dist/nodes/LearningSuite/shared/index.d.ts +4 -0
  128. package/dist/nodes/LearningSuite/shared/index.js +20 -0
  129. package/dist/nodes/LearningSuite/shared/parsing.d.ts +1 -0
  130. package/dist/nodes/LearningSuite/shared/parsing.js +15 -0
  131. package/dist/nodes/LearningSuite/shared/request.d.ts +13 -0
  132. package/dist/nodes/LearningSuite/shared/request.js +53 -0
  133. package/dist/nodes/LearningSuitePollingTrigger/LearningSuitePollingTrigger.node.d.ts +11 -0
  134. package/dist/nodes/LearningSuitePollingTrigger/LearningSuitePollingTrigger.node.js +278 -0
  135. package/dist/nodes/LearningSuitePollingTrigger/descriptions/trigger.polling.properties.d.ts +2 -0
  136. package/dist/nodes/LearningSuitePollingTrigger/descriptions/trigger.polling.properties.js +193 -0
  137. package/package.json +65 -0
@@ -0,0 +1,433 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.LearningSuiteTrigger = void 0;
37
+ const n8n_workflow_1 = require("n8n-workflow");
38
+ const request_1 = require("./shared/request");
39
+ const trigger_instant_properties_1 = require("./descriptions/trigger.instant.properties");
40
+ const parsing_1 = require("./shared/parsing");
41
+ // methods - loadOptions
42
+ const loBundle = __importStar(require("./methods/loadOptions/bundle.loadOptions"));
43
+ const loCommunity = __importStar(require("./methods/loadOptions/community.loadOptions"));
44
+ const loCourse = __importStar(require("./methods/loadOptions/course.loadOptions"));
45
+ const loGroup = __importStar(require("./methods/loadOptions/group.loadOptions"));
46
+ const loHub = __importStar(require("./methods/loadOptions/hub.loadOptions"));
47
+ const loMember = __importStar(require("./methods/loadOptions/member.loadOptions"));
48
+ const loModule = __importStar(require("./methods/loadOptions/module.loadOptions"));
49
+ const loPopup = __importStar(require("./methods/loadOptions/popup.loadOptions"));
50
+ const loRole = __importStar(require("./methods/loadOptions/role.loadOptions"));
51
+ const loWebhook = __importStar(require("./methods/loadOptions/webhook.loadOptions"));
52
+ const loTeamMember = __importStar(require("./methods/loadOptions/teamMember.loadOptions"));
53
+ const loCustomFields = __importStar(require("./methods/loadOptions/customFields.loadOptions"));
54
+ const INSTANT_EVENTS = new Set([
55
+ 'accessRequest.created',
56
+ 'communityPost.created',
57
+ 'communityPost.commented',
58
+ 'communityPost.moderated',
59
+ 'courseProgress.changed',
60
+ 'customPopup.interaction',
61
+ 'exam.completed',
62
+ 'exam.graded',
63
+ 'feedback.created',
64
+ 'group.userAccessChanged',
65
+ 'lesson.completed',
66
+ 'login.new',
67
+ 'submission.created',
68
+ 'course.updated',
69
+ 'course.memberAdded',
70
+ 'customField.valueChanged',
71
+ 'user.activationStatusChanged',
72
+ ]);
73
+ function buildDesiredFilter(event) {
74
+ var _a;
75
+ const filter = {};
76
+ const getCol = (path) => {
77
+ try {
78
+ const v = this.getNodeParameter(path);
79
+ return v && typeof v === 'object' ? v : {};
80
+ }
81
+ catch {
82
+ return {};
83
+ }
84
+ };
85
+ const getStr = (path) => {
86
+ try {
87
+ const v = this.getNodeParameter(path);
88
+ return (v !== null && v !== void 0 ? v : '').toString().trim();
89
+ }
90
+ catch {
91
+ return '';
92
+ }
93
+ };
94
+ const getNum = (path, fallback = 0) => {
95
+ try {
96
+ const v = this.getNodeParameter(path);
97
+ return Number.isFinite(v) ? v : fallback;
98
+ }
99
+ catch {
100
+ return fallback;
101
+ }
102
+ };
103
+ switch (event) {
104
+ // ---------------- Community
105
+ case 'communityPost.commented': {
106
+ const col = getCol('additionalCommunityPostCommented');
107
+ if (col === null || col === void 0 ? void 0 : col.areaId)
108
+ filter.areaId = String(col.areaId);
109
+ if (col === null || col === void 0 ? void 0 : col.forumId)
110
+ filter.forumId = String(col.forumId);
111
+ const ids = (0, parsing_1.toIdArray)((_a = col === null || col === void 0 ? void 0 : col.mentionedUserIds) !== null && _a !== void 0 ? _a : []);
112
+ if (ids.length)
113
+ filter.mentionedUserIds = ids;
114
+ break;
115
+ }
116
+ case 'communityPost.created': {
117
+ const col = getCol('additionalCommunityPostCreated');
118
+ if (col === null || col === void 0 ? void 0 : col.areaId)
119
+ filter.areaId = String(col.areaId);
120
+ if (col === null || col === void 0 ? void 0 : col.forumId)
121
+ filter.forumId = String(col.forumId);
122
+ if ((col === null || col === void 0 ? void 0 : col.publishStatus) && col.publishStatus !== 'both') {
123
+ filter.published = col.publishStatus === 'published'; // boolean
124
+ }
125
+ break;
126
+ }
127
+ case 'communityPost.moderated': {
128
+ const col = getCol('additionalCommunityPostModerated');
129
+ if (col === null || col === void 0 ? void 0 : col.areaId)
130
+ filter.areaId = String(col.areaId);
131
+ if (col === null || col === void 0 ? void 0 : col.forumId)
132
+ filter.forumId = String(col.forumId);
133
+ if ((col === null || col === void 0 ? void 0 : col.approved) && col.approved !== 'both') {
134
+ filter.approved = col.approved === 'approved'; // boolean
135
+ }
136
+ break;
137
+ }
138
+ // ---------------- Custom Field
139
+ case 'customField.valueChanged': {
140
+ const col = getCol('additionalCustomFieldValueChanged');
141
+ if (col === null || col === void 0 ? void 0 : col.customFieldCardId) {
142
+ filter.customFieldCardId = String(col.customFieldCardId);
143
+ }
144
+ break;
145
+ }
146
+ // ---------------- Login
147
+ case 'login.new': {
148
+ const col = getCol('additionalLoginNew');
149
+ if (col === null || col === void 0 ? void 0 : col.loginType) {
150
+ filter.loginType = String(col.loginType);
151
+ }
152
+ if (col === null || col === void 0 ? void 0 : col.userRoleId) {
153
+ filter.userRoleId = String(col.userRoleId);
154
+ }
155
+ break;
156
+ }
157
+ // ---------------- Custom Popup
158
+ case 'customPopup.interaction': {
159
+ const col = getCol('additionalPopupInteraction');
160
+ if (col === null || col === void 0 ? void 0 : col.customPopupId) {
161
+ filter.customPopupId = String(col.customPopupId);
162
+ }
163
+ if (col === null || col === void 0 ? void 0 : col.interactionType) {
164
+ filter.interactionType = String(col.interactionType);
165
+ }
166
+ break;
167
+ }
168
+ // ---------------- Progress
169
+ case 'courseProgress.changed': {
170
+ // API: threshold + optional courseInstanceId
171
+ const aboveRaw = getNum('threshold', 0);
172
+ filter.above = Math.max(0, Math.floor(aboveRaw));
173
+ const col = getCol('additionalCourseProgress');
174
+ if (col.courseId)
175
+ filter.courseInstanceId = String(col.courseId);
176
+ break;
177
+ }
178
+ // ---------------- Exams
179
+ case 'exam.completed':
180
+ case 'exam.graded': {
181
+ const col = getCol('additionalExamOptions');
182
+ if (col === null || col === void 0 ? void 0 : col.courseId) {
183
+ filter.courseInstanceId = String(col.courseId);
184
+ }
185
+ if (col === null || col === void 0 ? void 0 : col.examModuleId) {
186
+ filter.examModuleId = String(col.examModuleId);
187
+ }
188
+ break;
189
+ }
190
+ // course.updated
191
+ case 'course.memberAdded':
192
+ case 'course.updated': {
193
+ const col = getCol('additionalCourseOptions');
194
+ if (col === null || col === void 0 ? void 0 : col.courseId) {
195
+ filter.courseInstanceId = String(col.courseId);
196
+ }
197
+ break;
198
+ }
199
+ // feedback.created
200
+ case 'feedback.created': {
201
+ const col = getCol('additionalFeedbackOptions');
202
+ if (col === null || col === void 0 ? void 0 : col.courseId) {
203
+ filter.courseInstanceId = String(col.courseId);
204
+ }
205
+ break;
206
+ }
207
+ // ---------------- Access Request (required in UI)
208
+ case 'accessRequest.created': {
209
+ const courseId = getStr('courseId');
210
+ if (courseId)
211
+ filter.courseInstanceId = courseId;
212
+ break;
213
+ }
214
+ // ---------------- Group Access
215
+ case 'group.userAccessChanged': {
216
+ const col = getCol('additionalGroupAccess');
217
+ const actionType = getStr('actionType');
218
+ if (actionType)
219
+ filter.actionType = actionType; // 'added' | 'removed'
220
+ if (col.groupId)
221
+ filter.groupId = String(col.groupId);
222
+ break;
223
+ }
224
+ // ---------------- Lesson Completed (kaskadiert)
225
+ case 'lesson.completed': {
226
+ const col = getCol('additionalLessonCompleted');
227
+ if (col.courseId)
228
+ filter.courseInstanceId = String(col.courseId);
229
+ if (col.moduleId)
230
+ filter.moduleId = String(col.moduleId);
231
+ if (col.lessonId)
232
+ filter.lessonId = String(col.lessonId);
233
+ break;
234
+ }
235
+ // ---------------- Submission (optional course)
236
+ case 'submission.created': {
237
+ const col = getCol('additionalSubmission');
238
+ if (col.courseId)
239
+ filter.courseInstanceId = String(col.courseId);
240
+ break;
241
+ }
242
+ // ---------------- User Activation Status Changed
243
+ case 'user.activationStatusChanged': {
244
+ const col = getCol('additionalUserActivationStatus');
245
+ if (col === null || col === void 0 ? void 0 : col.action)
246
+ filter.action = String(col.action);
247
+ if (col === null || col === void 0 ? void 0 : col.roleId)
248
+ filter.roleId = String(col.roleId);
249
+ break;
250
+ }
251
+ default:
252
+ break;
253
+ }
254
+ return { filter, hasFilter: true };
255
+ }
256
+ function isApiErrorLike(error) {
257
+ return typeof error === 'object' && error !== null;
258
+ }
259
+ class LearningSuiteTrigger {
260
+ constructor() {
261
+ this.description = {
262
+ displayName: 'LearningSuite Trigger',
263
+ name: 'learningSuiteTrigger',
264
+ icon: {
265
+ light: 'file:./icons/learningsuite-icon-light.svg',
266
+ dark: 'file:./icons/learningsuite-icon-dark.svg',
267
+ },
268
+ group: ['trigger'],
269
+ version: 1,
270
+ description: 'Interact with LearningSuite API (powered by agentur-systeme.de)',
271
+ subtitle: '={{$parameter["event"]}}',
272
+ defaults: {
273
+ name: 'LearningSuite Trigger',
274
+ // @ts-expect-error -- description is required by n8n node linting for defaults
275
+ description: 'Interact with LearningSuite API (powered by agentur-systeme.de)',
276
+ },
277
+ inputs: [],
278
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
279
+ usableAsTool: true,
280
+ credentials: [
281
+ {
282
+ name: 'learningSuiteApi',
283
+ required: true,
284
+ // @ts-expect-error -- credential description is accepted by n8n but missing from typings here
285
+ description: 'Uses LearningSuite API Key via header X-API-KEY',
286
+ },
287
+ ],
288
+ webhooks: [{ name: 'default', httpMethod: 'POST', responseMode: 'onReceived', isFullPath: true, path: '' }],
289
+ properties: trigger_instant_properties_1.instantProperties,
290
+ };
291
+ this.methods = {
292
+ loadOptions: {
293
+ ...loBundle,
294
+ ...loCommunity,
295
+ ...loCourse,
296
+ ...loGroup,
297
+ ...loHub,
298
+ ...loMember,
299
+ ...loModule,
300
+ ...loPopup,
301
+ ...loRole,
302
+ ...loTeamMember,
303
+ ...loWebhook,
304
+ ...loCustomFields,
305
+ },
306
+ };
307
+ this.webhookMethods = {
308
+ default: {
309
+ async checkExists() {
310
+ var _a, _b;
311
+ const event = this.getNodeParameter('event');
312
+ if (!INSTANT_EVENTS.has(event))
313
+ return true;
314
+ const webhookData = this.getWorkflowStaticData('node');
315
+ const storedId = webhookData.subscriptionId;
316
+ if (!storedId)
317
+ return false;
318
+ const desiredHookUrl = this.getNodeWebhookUrl('default');
319
+ const { filter: desiredFilterRaw } = buildDesiredFilter.call(this, event);
320
+ const desiredFilter = desiredFilterRaw && typeof desiredFilterRaw === 'object' ? desiredFilterRaw : {};
321
+ try {
322
+ const remote = (await request_1.apiRequest.call(this, {
323
+ method: 'GET',
324
+ path: `/webhooks/subscription/${encodeURIComponent(storedId)}`,
325
+ }));
326
+ const remoteType = remote.type;
327
+ const remoteUrl = remote.url;
328
+ const remoteFilter = (_a = remote.filter) !== null && _a !== void 0 ? _a : {};
329
+ const typeDiffers = remoteType !== event;
330
+ const urlDiffers = remoteUrl !== desiredHookUrl;
331
+ let filterDiffers = false;
332
+ const keys = new Set([...Object.keys(remoteFilter || {}), ...Object.keys(desiredFilter || {})]);
333
+ for (const k of keys) {
334
+ const a = remoteFilter[k];
335
+ const b = desiredFilter[k];
336
+ if (a !== b) {
337
+ filterDiffers = true;
338
+ break;
339
+ }
340
+ }
341
+ if (typeDiffers || urlDiffers || filterDiffers) {
342
+ const body = {
343
+ hookUrl: desiredHookUrl,
344
+ type: event,
345
+ filter: desiredFilter,
346
+ };
347
+ await request_1.apiRequest.call(this, {
348
+ method: 'PUT',
349
+ path: `/webhooks/subscription/${encodeURIComponent(storedId)}`,
350
+ body,
351
+ });
352
+ }
353
+ return true;
354
+ }
355
+ catch (error) {
356
+ if (isApiErrorLike(error) && (error.statusCode === 404 || ((_b = error.response) === null || _b === void 0 ? void 0 : _b.statusCode) === 404)) {
357
+ delete webhookData.subscriptionId;
358
+ return false;
359
+ }
360
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
361
+ message: 'Failed to verify/update existing webhook subscription',
362
+ });
363
+ }
364
+ },
365
+ async create() {
366
+ const event = this.getNodeParameter('event');
367
+ if (!INSTANT_EVENTS.has(event))
368
+ return true;
369
+ const webhookUrl = this.getNodeWebhookUrl('default');
370
+ const { filter: rawFilter } = buildDesiredFilter.call(this, event);
371
+ const filter = rawFilter && typeof rawFilter === 'object' ? rawFilter : {};
372
+ const body = {
373
+ hookUrl: webhookUrl,
374
+ type: event,
375
+ filter,
376
+ };
377
+ try {
378
+ const response = (await request_1.apiRequest.call(this, {
379
+ method: 'POST',
380
+ path: '/webhooks/subscription',
381
+ body,
382
+ }));
383
+ const webhookData = this.getWorkflowStaticData('node');
384
+ webhookData.subscriptionId = response.id;
385
+ return true;
386
+ }
387
+ catch (error) {
388
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
389
+ message: 'Failed to create webhook subscription',
390
+ });
391
+ }
392
+ },
393
+ async delete() {
394
+ var _a;
395
+ const event = this.getNodeParameter('event');
396
+ if (!INSTANT_EVENTS.has(event))
397
+ return true;
398
+ const webhookData = this.getWorkflowStaticData('node');
399
+ const id = webhookData.subscriptionId;
400
+ if (!id)
401
+ return true;
402
+ try {
403
+ await request_1.apiRequest.call(this, {
404
+ method: 'DELETE',
405
+ path: `/webhooks/subscription/${encodeURIComponent(id)}`,
406
+ });
407
+ }
408
+ catch (error) {
409
+ if (!isApiErrorLike(error) || (error.statusCode !== 404 && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.statusCode) !== 404)) {
410
+ delete webhookData.subscriptionId;
411
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
412
+ message: 'Failed to delete webhook subscription',
413
+ });
414
+ }
415
+ }
416
+ delete webhookData.subscriptionId;
417
+ return true;
418
+ },
419
+ },
420
+ };
421
+ }
422
+ async webhook() {
423
+ const body = this.getBodyData();
424
+ if (Array.isArray(body)) {
425
+ return { workflowData: [this.helpers.returnJsonArray(body)] };
426
+ }
427
+ if (body && typeof body === 'object') {
428
+ return { workflowData: [this.helpers.returnJsonArray([body])] };
429
+ }
430
+ return { workflowData: [this.helpers.returnJsonArray([{ error: 'No JSON body' }])] };
431
+ }
432
+ }
433
+ exports.LearningSuiteTrigger = LearningSuiteTrigger;
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const aiProperties: INodeProperties[];
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiProperties = void 0;
4
+ exports.aiProperties = [
5
+ {
6
+ displayName: 'Operation',
7
+ name: 'operation',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ default: 'ragChat',
11
+ displayOptions: { show: { resource: ['ai'] } },
12
+ options: [
13
+ {
14
+ name: 'RAG Chat',
15
+ value: 'ragChat',
16
+ description: 'Ask a question using the AI RAG chat endpoint',
17
+ action: 'Ask AI question',
18
+ },
19
+ ],
20
+ },
21
+ {
22
+ displayName: 'Question',
23
+ name: 'question',
24
+ type: 'string',
25
+ required: true,
26
+ default: '',
27
+ description: 'The question to ask the AI',
28
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
29
+ },
30
+ {
31
+ displayName: 'User Name or ID',
32
+ name: 'userId',
33
+ type: 'options',
34
+ typeOptions: { loadOptionsMethod: 'member_getMembers' },
35
+ default: '',
36
+ 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>.',
37
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
38
+ },
39
+ {
40
+ displayName: 'Conversation ID',
41
+ name: 'conversationId',
42
+ type: 'string',
43
+ default: '',
44
+ description: 'If set, the conversation history with this ID will be taken into account',
45
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
46
+ },
47
+ {
48
+ displayName: 'Answer Length',
49
+ name: 'answerLength',
50
+ type: 'options',
51
+ default: 'standard',
52
+ description: 'The desired length of the AI’s answer',
53
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
54
+ options: [
55
+ {
56
+ name: 'Concise',
57
+ value: 'concise',
58
+ description: 'A short and to-the-point answer',
59
+ },
60
+ {
61
+ name: 'Standard',
62
+ value: 'standard',
63
+ description: 'A balanced answer with sufficient detail',
64
+ },
65
+ {
66
+ name: 'Detailed',
67
+ value: 'detailed',
68
+ description: 'A comprehensive and detailed answer',
69
+ },
70
+ ],
71
+ },
72
+ {
73
+ displayName: 'Tone',
74
+ name: 'tone',
75
+ type: 'options',
76
+ default: 'neutral',
77
+ description: 'The desired tone of the AI’s answer',
78
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
79
+ options: [
80
+ {
81
+ name: 'Friendly',
82
+ value: 'friendly',
83
+ description: 'A warm and approachable tone',
84
+ },
85
+ {
86
+ name: 'Neutral',
87
+ value: 'neutral',
88
+ description: 'A neutral and factual tone',
89
+ },
90
+ {
91
+ name: 'Professional',
92
+ value: 'professional',
93
+ description: 'A formal and professional tone',
94
+ },
95
+ ],
96
+ },
97
+ {
98
+ displayName: 'Format',
99
+ name: 'format',
100
+ type: 'options',
101
+ default: 'markdown',
102
+ description: 'The desired output format of the AI’s answer',
103
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
104
+ options: [
105
+ {
106
+ name: 'Markdown',
107
+ value: 'markdown',
108
+ description: 'Formatted output using Markdown',
109
+ },
110
+ {
111
+ name: 'Plain Text',
112
+ value: 'plaintext',
113
+ description: 'Unformatted plain text output',
114
+ },
115
+ ],
116
+ },
117
+ {
118
+ displayName: 'Add Citations',
119
+ name: 'addCitations',
120
+ type: 'boolean',
121
+ default: false,
122
+ description: 'Whether the AI will add citations to its answer',
123
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
124
+ },
125
+ {
126
+ displayName: 'Unlock Content Drip',
127
+ name: 'unlockContentDrip',
128
+ type: 'boolean',
129
+ default: false,
130
+ description: 'Whether the AI will have access to content that is normally restricted by content drip settings',
131
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
132
+ },
133
+ {
134
+ displayName: 'System Prompt Addition',
135
+ name: 'systemPromptAddition',
136
+ type: 'string',
137
+ default: '',
138
+ description: 'Additional system prompt instructions to guide the AI’s behavior',
139
+ displayOptions: { show: { resource: ['ai'], operation: ['ragChat'] } },
140
+ },
141
+ ];
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const apiCallProperties: INodeProperties[];
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.apiCallProperties = void 0;
4
+ exports.apiCallProperties = [
5
+ {
6
+ displayName: 'Operation',
7
+ name: 'operation',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ default: 'makeRequest',
11
+ displayOptions: { show: { resource: ['apiCall'] } },
12
+ options: [
13
+ {
14
+ name: 'Make Request',
15
+ value: 'makeRequest',
16
+ description: 'Make an arbitrary API call',
17
+ action: 'Custom api call',
18
+ },
19
+ ],
20
+ },
21
+ {
22
+ displayName: 'HTTP Method',
23
+ name: 'httpMethod',
24
+ type: 'options',
25
+ displayOptions: { show: { resource: ['apiCall'], operation: ['makeRequest'] } },
26
+ options: [
27
+ { name: 'DELETE', value: 'DELETE' },
28
+ { name: 'GET', value: 'GET' },
29
+ { name: 'PATCH', value: 'PATCH' },
30
+ { name: 'POST', value: 'POST' },
31
+ { name: 'PUT', value: 'PUT' },
32
+ ],
33
+ default: 'GET',
34
+ required: true,
35
+ description: 'HTTP method for the API call',
36
+ },
37
+ {
38
+ displayName: 'Endpoint',
39
+ name: 'endpoint',
40
+ type: 'string',
41
+ displayOptions: { show: { resource: ['apiCall'], operation: ['makeRequest'] } },
42
+ default: '',
43
+ required: true,
44
+ placeholder: '/members/123/courses',
45
+ description: 'API endpoint path (without base URL)',
46
+ },
47
+ {
48
+ displayName: 'Request Body',
49
+ name: 'requestBody',
50
+ type: 'json',
51
+ displayOptions: {
52
+ show: { resource: ['apiCall'], operation: ['makeRequest'], httpMethod: ['POST', 'PUT', 'PATCH'] },
53
+ },
54
+ default: '{}',
55
+ description: 'Request body as JSON',
56
+ },
57
+ {
58
+ displayName: 'Query Parameters',
59
+ name: 'queryParameters',
60
+ type: 'fixedCollection',
61
+ typeOptions: { multipleValues: true },
62
+ displayOptions: { show: { resource: ['apiCall'], operation: ['makeRequest'] } },
63
+ default: {},
64
+ options: [
65
+ {
66
+ name: 'parameter',
67
+ displayName: 'Parameter',
68
+ values: [
69
+ {
70
+ displayName: 'Name',
71
+ name: 'name',
72
+ type: 'string',
73
+ default: '',
74
+ description: 'Name of the query parameter',
75
+ },
76
+ {
77
+ displayName: 'Value',
78
+ name: 'value',
79
+ type: 'string',
80
+ default: '',
81
+ description: 'Value of the query parameter',
82
+ },
83
+ ],
84
+ },
85
+ ],
86
+ },
87
+ ];
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const bundleProperties: INodeProperties[];