@rjsebening/n8n-nodes-learningsuite 1.3.5 → 1.3.6

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 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
 
@@ -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 agentur-systeme.de)',
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 agentur-systeme.de)',
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 agentur-systeme.de)',
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 agentur-systeme.de)',
296
+ description: 'Interact with LearningSuite API (powered by joergsebening.de)',
297
297
  },
298
298
  inputs: [],
299
299
  outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
@@ -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: { resource: ['group'], operation: ['delete', 'getCourses', 'addCourses', 'removeCourses', 'addBundles'] },
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: Include users in group results',
151
+ description: 'Whether to include users in the group results',
143
152
  },
144
153
  ],
145
154
  },
@@ -5,6 +5,7 @@ export declare const groupHandlers: {
5
5
  delete: ExecuteHandler;
6
6
  findByName: ExecuteHandler;
7
7
  findOrCreate: ExecuteHandler;
8
+ getById: ExecuteHandler;
8
9
  addMembers: ExecuteHandler;
9
10
  removeMembers: ExecuteHandler;
10
11
  getCourses: ExecuteHandler;
@@ -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 agentur-systeme.de)',
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 agentur-systeme.de)',
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],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsebening/n8n-nodes-learningsuite",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "n8n node for LearningSuite API",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",