n8n-nodes-smartschool 0.1.3
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/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/credentials/SmartSchoolApi.credentials.d.ts +21 -0
- package/dist/credentials/SmartSchoolApi.credentials.js +53 -0
- package/dist/credentials/SmartSchoolApi.credentials.js.map +1 -0
- package/dist/icons/github.dark.svg +3 -0
- package/dist/icons/github.svg +3 -0
- package/dist/icons/smartschool.logo.dark.svg +1 -0
- package/dist/icons/smartschool.logo.svg +1 -0
- package/dist/nodes/SmartSchool/GenericFunctions.d.ts +6 -0
- package/dist/nodes/SmartSchool/GenericFunctions.js +171 -0
- package/dist/nodes/SmartSchool/GenericFunctions.js.map +1 -0
- package/dist/nodes/SmartSchool/SmartSchool.node.d.ts +5 -0
- package/dist/nodes/SmartSchool/SmartSchool.node.js +2270 -0
- package/dist/nodes/SmartSchool/SmartSchool.node.js.map +1 -0
- package/dist/nodes/SmartSchool/SmartSchool.node.json +13 -0
- package/dist/nodes/SmartSchool/shared/errorCodes.d.ts +1 -0
- package/dist/nodes/SmartSchool/shared/errorCodes.js +63 -0
- package/dist/nodes/SmartSchool/shared/errorCodes.js.map +1 -0
- package/dist/nodes/SmartSchool/shared/fields.d.ts +3 -0
- package/dist/nodes/SmartSchool/shared/fields.js +18 -0
- package/dist/nodes/SmartSchool/shared/fields.js.map +1 -0
- package/dist/nodes/SmartSchool/smartschool.logo.dark.svg +1 -0
- package/dist/nodes/SmartSchool/smartschool.logo.svg +1 -0
- package/dist/package.json +53 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,2270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartSchool = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
6
|
+
const fields_1 = require("./shared/fields");
|
|
7
|
+
const errorCodes_1 = require("./shared/errorCodes");
|
|
8
|
+
class SmartSchool {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'SmartSchool',
|
|
12
|
+
name: 'smartSchool',
|
|
13
|
+
icon: { light: 'file:smartschool.logo.svg', dark: 'file:smartschool.logo.dark.svg' },
|
|
14
|
+
group: ['transform'],
|
|
15
|
+
version: 1,
|
|
16
|
+
description: 'Interact with the SmartSchool API',
|
|
17
|
+
defaults: { name: 'SmartSchool' },
|
|
18
|
+
subtitle: '={{$parameter.operation + ": " + $parameter.resource}}',
|
|
19
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
20
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
21
|
+
usableAsTool: true,
|
|
22
|
+
credentials: [
|
|
23
|
+
{
|
|
24
|
+
name: 'smartSchoolApi',
|
|
25
|
+
required: true,
|
|
26
|
+
testedBy: 'smartSchool',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
requestDefaults: {
|
|
30
|
+
baseURL: '={{$credentials.apiEndpoint}}',
|
|
31
|
+
},
|
|
32
|
+
properties: [
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Resource',
|
|
35
|
+
name: 'resource',
|
|
36
|
+
type: 'options',
|
|
37
|
+
noDataExpression: true,
|
|
38
|
+
default: 'group',
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
name: 'Absence',
|
|
42
|
+
value: 'absence',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Account',
|
|
46
|
+
value: 'account',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Course',
|
|
50
|
+
value: 'course',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Group',
|
|
54
|
+
value: 'group',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Helpdesk',
|
|
58
|
+
value: 'helpdesk',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Message',
|
|
62
|
+
value: 'message',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Parameter',
|
|
66
|
+
value: 'parameter',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'System',
|
|
70
|
+
value: 'system',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Operation',
|
|
76
|
+
name: 'operation',
|
|
77
|
+
type: 'options',
|
|
78
|
+
noDataExpression: true,
|
|
79
|
+
default: 'getUserDetails',
|
|
80
|
+
displayOptions: {
|
|
81
|
+
show: {
|
|
82
|
+
resource: ['account'],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
options: [
|
|
86
|
+
{
|
|
87
|
+
name: 'Change Internal Number',
|
|
88
|
+
value: 'changeInternNumber',
|
|
89
|
+
description: 'Change the internal number for a user',
|
|
90
|
+
action: 'Change internal number',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'Change Password at Next Login',
|
|
94
|
+
value: 'changePasswordAtNextLogin',
|
|
95
|
+
description: 'Force a password change on next login',
|
|
96
|
+
action: 'Change password at next login',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'Change Username',
|
|
100
|
+
value: 'changeUsername',
|
|
101
|
+
description: 'Change a username using the internal number',
|
|
102
|
+
action: 'Change username',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Deactivate Two-Factor Authentication',
|
|
106
|
+
value: 'deactivateTwoFactorAuthentication',
|
|
107
|
+
description: 'Deprecated SmartSchool method to disable 2FA',
|
|
108
|
+
action: 'Deactivate two factor authentication',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'Delete User',
|
|
112
|
+
value: 'delUser',
|
|
113
|
+
description: 'Remove a user from SmartSchool',
|
|
114
|
+
action: 'Delete user',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'Force Password Reset',
|
|
118
|
+
value: 'forcePasswordReset',
|
|
119
|
+
description: 'Force a password reset for a user account',
|
|
120
|
+
action: 'Force password reset',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'Get User Details',
|
|
124
|
+
value: 'getUserDetails',
|
|
125
|
+
description: 'Get user details by SmartSchool identifier',
|
|
126
|
+
action: 'Get user details',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'Get User Details by Number',
|
|
130
|
+
value: 'getUserDetailsByNumber',
|
|
131
|
+
description: 'Get user details by internal number',
|
|
132
|
+
action: 'Get user details by number',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'Get User Details by Scannable Code',
|
|
136
|
+
value: 'getUserDetailsByScannableCode',
|
|
137
|
+
action: 'Get user details by scannable code',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'Get User Details by Username',
|
|
141
|
+
value: 'getUserDetailsByUsername',
|
|
142
|
+
action: 'Get user details by username',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'Get User Official Class',
|
|
146
|
+
value: 'getUserOfficialClass',
|
|
147
|
+
description: 'Retrieve the official class for a user',
|
|
148
|
+
action: 'Get user official class',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'Remove Co-Account',
|
|
152
|
+
value: 'removeCoAccount',
|
|
153
|
+
description: 'Remove a co-account from a user',
|
|
154
|
+
action: 'Remove co account',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'Replace Internal Number',
|
|
158
|
+
value: 'replaceInum',
|
|
159
|
+
description: 'Replace a user internal number with a new one',
|
|
160
|
+
action: 'Replace internal number',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'Save Password',
|
|
164
|
+
value: 'savePassword',
|
|
165
|
+
description: 'Set a new password for a user account',
|
|
166
|
+
action: 'Save password',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'Save User',
|
|
170
|
+
value: 'saveUser',
|
|
171
|
+
description: 'Create or update a SmartSchool user',
|
|
172
|
+
action: 'Save user',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'Save User Parameter',
|
|
176
|
+
value: 'saveUserParameter',
|
|
177
|
+
description: 'Update a SmartSchool user parameter',
|
|
178
|
+
action: 'Save user parameter',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'Set Account Status',
|
|
182
|
+
value: 'setAccountStatus',
|
|
183
|
+
description: 'Activate, deactivate, or set account status',
|
|
184
|
+
action: 'Set account status',
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
displayName: 'Operation',
|
|
190
|
+
name: 'operation',
|
|
191
|
+
type: 'options',
|
|
192
|
+
noDataExpression: true,
|
|
193
|
+
default: 'getAbsents',
|
|
194
|
+
displayOptions: {
|
|
195
|
+
show: {
|
|
196
|
+
resource: ['absence'],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
options: [
|
|
200
|
+
{
|
|
201
|
+
name: 'Get Absents',
|
|
202
|
+
value: 'getAbsents',
|
|
203
|
+
description: 'Get absences for a user and school year',
|
|
204
|
+
action: 'Get absents',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'Get Absents by Date',
|
|
208
|
+
value: 'getAbsentsByDate',
|
|
209
|
+
description: 'Get absences for all students on a date',
|
|
210
|
+
action: 'Get absents by date',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'Get Absents by Date and Group',
|
|
214
|
+
value: 'getAbsentsByDateAndGroup',
|
|
215
|
+
description: 'Get absences for a date filtered by group',
|
|
216
|
+
action: 'Get absents by date and group',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'Get Absents with Alias',
|
|
220
|
+
value: 'getAbsentsWithAlias',
|
|
221
|
+
description: 'Get absences with alias labels for a user and school year',
|
|
222
|
+
action: 'Get absents with alias',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'Get Absents with Alias by Date',
|
|
226
|
+
value: 'getAbsentsWithAliasByDate',
|
|
227
|
+
description: 'Get absences with aliases for all students on a date',
|
|
228
|
+
action: 'Get absents with alias by date',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: 'Get Absents with Internal Number by Date',
|
|
232
|
+
value: 'getAbsentsWithInternalNumberByDate',
|
|
233
|
+
description: 'Get absences indexed by internal number for a date',
|
|
234
|
+
action: 'Get absents by internal number',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'Get Absents with Username by Date',
|
|
238
|
+
value: 'getAbsentsWithUsernameByDate',
|
|
239
|
+
description: 'Get absences indexed by username for a date',
|
|
240
|
+
action: 'Get absents by username',
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
displayName: 'Operation',
|
|
246
|
+
name: 'operation',
|
|
247
|
+
type: 'options',
|
|
248
|
+
noDataExpression: true,
|
|
249
|
+
default: 'getCourses',
|
|
250
|
+
displayOptions: {
|
|
251
|
+
show: {
|
|
252
|
+
resource: ['course'],
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
options: [
|
|
256
|
+
{
|
|
257
|
+
name: 'Get Courses',
|
|
258
|
+
value: 'getCourses',
|
|
259
|
+
description: 'List available courses (CSV response)',
|
|
260
|
+
action: 'Get courses',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'Add Course',
|
|
264
|
+
value: 'addCourse',
|
|
265
|
+
description: 'Create a new course',
|
|
266
|
+
action: 'Add course',
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'Add Course Students',
|
|
270
|
+
value: 'addCourseStudents',
|
|
271
|
+
description: 'Assign groups/classes to a course',
|
|
272
|
+
action: 'Add course students',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'Add Course Teacher',
|
|
276
|
+
value: 'addCourseTeacher',
|
|
277
|
+
description: 'Assign a teacher to a course',
|
|
278
|
+
action: 'Add course teacher',
|
|
279
|
+
},
|
|
280
|
+
],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
displayName: 'Operation',
|
|
284
|
+
name: 'operation',
|
|
285
|
+
type: 'options',
|
|
286
|
+
noDataExpression: true,
|
|
287
|
+
default: 'startSkoreSync',
|
|
288
|
+
displayOptions: {
|
|
289
|
+
show: {
|
|
290
|
+
resource: ['system'],
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
options: [
|
|
294
|
+
{
|
|
295
|
+
name: 'Start Skore Sync',
|
|
296
|
+
value: 'startSkoreSync',
|
|
297
|
+
description: 'Start the Skore sync process',
|
|
298
|
+
action: 'Start skore sync',
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: 'Check Status',
|
|
302
|
+
value: 'checkStatus',
|
|
303
|
+
description: 'Check Skore sync status',
|
|
304
|
+
action: 'Check status',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: 'Get Student Career',
|
|
308
|
+
value: 'getStudentCareer',
|
|
309
|
+
description: 'Retrieve student career history',
|
|
310
|
+
action: 'Get student career',
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'Get Deliberation Lines',
|
|
314
|
+
value: 'getDeliberationLines',
|
|
315
|
+
description: 'Retrieve deliberation lines for a date in the school year',
|
|
316
|
+
action: 'Get deliberation lines',
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
displayName: 'Operation',
|
|
322
|
+
name: 'operation',
|
|
323
|
+
type: 'options',
|
|
324
|
+
noDataExpression: true,
|
|
325
|
+
default: 'getAllAccounts',
|
|
326
|
+
displayOptions: {
|
|
327
|
+
show: {
|
|
328
|
+
resource: ['group'],
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
options: [
|
|
332
|
+
{
|
|
333
|
+
name: 'Change Group Visibility',
|
|
334
|
+
value: 'changeGroupVisibility',
|
|
335
|
+
description: 'Toggle visibility of a group or class',
|
|
336
|
+
action: 'Change group visibility',
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: 'Clear Group',
|
|
340
|
+
value: 'clearGroup',
|
|
341
|
+
description: 'Remove all users from a group',
|
|
342
|
+
action: 'Clear group',
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: 'Delete Class',
|
|
346
|
+
value: 'delClass',
|
|
347
|
+
description: 'Delete a class or group',
|
|
348
|
+
action: 'Delete class',
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: 'Get All Accounts',
|
|
352
|
+
value: 'getAllAccounts',
|
|
353
|
+
description: 'List all user accounts from a SmartSchool group',
|
|
354
|
+
action: 'Get all accounts',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: 'Get All Accounts (Extended)',
|
|
358
|
+
value: 'getAllAccountsExtended',
|
|
359
|
+
description: 'List all user accounts from a SmartSchool group with extended metadata',
|
|
360
|
+
action: 'Get all accounts extended',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
name: 'Get All Groups and Classes',
|
|
364
|
+
value: 'getAllGroupsAndClasses',
|
|
365
|
+
description: 'Retrieve the entire group/class hierarchy',
|
|
366
|
+
action: 'Get all groups and classes',
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: 'Get Class List (CSV)',
|
|
370
|
+
value: 'getClassList',
|
|
371
|
+
description: 'Download the class list in CSV format',
|
|
372
|
+
action: 'Get class list csv',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: 'Get Class List (JSON)',
|
|
376
|
+
value: 'getClassListJson',
|
|
377
|
+
description: 'Download the class list in JSON format',
|
|
378
|
+
action: 'Get class list json',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: 'Get Class Teachers',
|
|
382
|
+
value: 'getClassTeachers',
|
|
383
|
+
description: 'List titular teachers per class',
|
|
384
|
+
action: 'Get class teachers',
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
name: 'Get Schoolyear Data of Class',
|
|
388
|
+
value: 'getSchoolyearDataOfClass',
|
|
389
|
+
description: 'Retrieve schoolyear metadata for a class',
|
|
390
|
+
action: 'Get schoolyear data of class',
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
name: 'Get Skore Class Teacher Course Relation',
|
|
394
|
+
value: 'getSkoreClassTeacherCourseRelation',
|
|
395
|
+
description: 'Retrieve Skore class-teacher-course relations',
|
|
396
|
+
action: 'Get skore class teacher course relation',
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'Remove User From Group',
|
|
400
|
+
value: 'removeUserFromGroup',
|
|
401
|
+
description: 'Remove a user from a class or group',
|
|
402
|
+
action: 'Remove user from group',
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: 'Save Class',
|
|
406
|
+
value: 'saveClass',
|
|
407
|
+
description: 'Create or update a class',
|
|
408
|
+
action: 'Save class',
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: 'Save Class List (CSV)',
|
|
412
|
+
value: 'saveClassList',
|
|
413
|
+
description: 'Bulk update class list from CSV',
|
|
414
|
+
action: 'Save class list csv',
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: 'Save Class List (JSON)',
|
|
418
|
+
value: 'saveClassListJson',
|
|
419
|
+
description: 'Bulk update class list from JSON',
|
|
420
|
+
action: 'Save class list json',
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
name: 'Save Group',
|
|
424
|
+
value: 'saveGroup',
|
|
425
|
+
description: 'Create or update a group',
|
|
426
|
+
action: 'Save group',
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
name: 'Save Schoolyear Data of Class',
|
|
430
|
+
value: 'saveSchoolyearDataOfClass',
|
|
431
|
+
description: 'Update schoolyear metadata for a class',
|
|
432
|
+
action: 'Save schoolyear data of class',
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: 'Save User to Group',
|
|
436
|
+
value: 'saveUserToGroup',
|
|
437
|
+
description: 'Assign a user to a class or group',
|
|
438
|
+
action: 'Save user to group',
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: 'Unregister Student',
|
|
442
|
+
value: 'unregisterStudent',
|
|
443
|
+
description: 'Unregister a student from all groups',
|
|
444
|
+
action: 'Unregister student',
|
|
445
|
+
},
|
|
446
|
+
],
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
displayName: 'Operation',
|
|
450
|
+
name: 'operation',
|
|
451
|
+
type: 'options',
|
|
452
|
+
noDataExpression: true,
|
|
453
|
+
default: 'getReferenceField',
|
|
454
|
+
displayOptions: {
|
|
455
|
+
show: {
|
|
456
|
+
resource: ['parameter'],
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
options: [
|
|
460
|
+
{
|
|
461
|
+
name: 'Get Reference Field',
|
|
462
|
+
value: 'getReferenceField',
|
|
463
|
+
description: 'Retrieve the reference field configuration',
|
|
464
|
+
action: 'Get reference field',
|
|
465
|
+
},
|
|
466
|
+
],
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
displayName: 'Operation',
|
|
470
|
+
name: 'operation',
|
|
471
|
+
type: 'options',
|
|
472
|
+
noDataExpression: true,
|
|
473
|
+
default: 'sendMsg',
|
|
474
|
+
displayOptions: {
|
|
475
|
+
show: {
|
|
476
|
+
resource: ['message'],
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
options: [
|
|
480
|
+
{
|
|
481
|
+
name: 'Send Message',
|
|
482
|
+
value: 'sendMsg',
|
|
483
|
+
description: 'Send a SmartSchool message to a user or co-account',
|
|
484
|
+
action: 'Send smart school message',
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
name: 'Save Signature',
|
|
488
|
+
value: 'saveSignature',
|
|
489
|
+
description: 'Save a message signature for a user account',
|
|
490
|
+
action: 'Save signature',
|
|
491
|
+
},
|
|
492
|
+
],
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
displayName: 'Operation',
|
|
496
|
+
name: 'operation',
|
|
497
|
+
type: 'options',
|
|
498
|
+
noDataExpression: true,
|
|
499
|
+
default: 'getHelpdeskMiniDbItems',
|
|
500
|
+
displayOptions: {
|
|
501
|
+
show: {
|
|
502
|
+
resource: ['helpdesk'],
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
options: [
|
|
506
|
+
{
|
|
507
|
+
name: 'List Helpdesk Items',
|
|
508
|
+
value: 'getHelpdeskMiniDbItems',
|
|
509
|
+
description: 'List available helpdesk mini database items',
|
|
510
|
+
action: 'List helpdesk items',
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: 'Create Helpdesk Ticket',
|
|
514
|
+
value: 'addHelpdeskTicket',
|
|
515
|
+
description: 'Add a new ticket to the SmartSchool helpdesk',
|
|
516
|
+
action: 'Create helpdesk ticket',
|
|
517
|
+
},
|
|
518
|
+
],
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
displayName: 'Group Code',
|
|
522
|
+
name: 'code',
|
|
523
|
+
type: 'string',
|
|
524
|
+
default: '',
|
|
525
|
+
required: true,
|
|
526
|
+
description: 'Unique code that identifies the class or group',
|
|
527
|
+
displayOptions: {
|
|
528
|
+
show: {
|
|
529
|
+
resource: ['group', 'absence'],
|
|
530
|
+
operation: [
|
|
531
|
+
'getAllAccounts',
|
|
532
|
+
'getAllAccountsExtended',
|
|
533
|
+
'getAbsentsByDateAndGroup',
|
|
534
|
+
'clearGroup',
|
|
535
|
+
'changeGroupVisibility',
|
|
536
|
+
],
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
displayName: 'Include Subgroups',
|
|
542
|
+
name: 'recursive',
|
|
543
|
+
type: 'boolean',
|
|
544
|
+
default: false,
|
|
545
|
+
description: 'Whether to include the accounts of all descendant subgroups (SmartSchool expects 1 or 0)',
|
|
546
|
+
displayOptions: {
|
|
547
|
+
show: {
|
|
548
|
+
resource: ['group'],
|
|
549
|
+
operation: ['getAllAccounts', 'getAllAccountsExtended'],
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
displayName: 'Get All Owners',
|
|
555
|
+
name: 'getAllOwners',
|
|
556
|
+
type: 'boolean',
|
|
557
|
+
default: false,
|
|
558
|
+
description: 'Whether to retrieve every titular teacher per class instead of only the first',
|
|
559
|
+
displayOptions: {
|
|
560
|
+
show: {
|
|
561
|
+
resource: ['group'],
|
|
562
|
+
operation: ['getClassTeachers'],
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
displayName: 'Group Visibility',
|
|
568
|
+
name: 'groupVisibility',
|
|
569
|
+
type: 'options',
|
|
570
|
+
options: fields_1.VISIBILITY_OPTIONS,
|
|
571
|
+
default: 1,
|
|
572
|
+
description: 'Visibility status for the group/class',
|
|
573
|
+
displayOptions: {
|
|
574
|
+
show: {
|
|
575
|
+
resource: ['group'],
|
|
576
|
+
operation: ['changeGroupVisibility'],
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
displayName: 'Group/Class Details',
|
|
582
|
+
name: 'groupClassDetails',
|
|
583
|
+
type: 'fixedCollection',
|
|
584
|
+
default: {},
|
|
585
|
+
description: 'Details for creating or updating a class or group',
|
|
586
|
+
displayOptions: {
|
|
587
|
+
show: {
|
|
588
|
+
resource: ['group'],
|
|
589
|
+
operation: ['saveGroup', 'saveClass'],
|
|
590
|
+
},
|
|
591
|
+
},
|
|
592
|
+
options: [
|
|
593
|
+
{
|
|
594
|
+
displayName: 'Required',
|
|
595
|
+
name: 'required',
|
|
596
|
+
values: [
|
|
597
|
+
{
|
|
598
|
+
displayName: 'Code',
|
|
599
|
+
name: 'code',
|
|
600
|
+
type: 'string',
|
|
601
|
+
default: '',
|
|
602
|
+
required: true,
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
displayName: 'Description',
|
|
606
|
+
name: 'desc',
|
|
607
|
+
type: 'string',
|
|
608
|
+
default: '',
|
|
609
|
+
required: true,
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
displayName: 'Name',
|
|
613
|
+
name: 'name',
|
|
614
|
+
type: 'string',
|
|
615
|
+
default: '',
|
|
616
|
+
required: true,
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
displayName: 'Parent Code',
|
|
620
|
+
name: 'parent',
|
|
621
|
+
type: 'string',
|
|
622
|
+
default: '',
|
|
623
|
+
required: true,
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
displayName: 'Untis Code',
|
|
627
|
+
name: 'untis',
|
|
628
|
+
type: 'string',
|
|
629
|
+
default: '',
|
|
630
|
+
required: true,
|
|
631
|
+
},
|
|
632
|
+
],
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
displayName: 'Optional (Classes Only)',
|
|
636
|
+
name: 'optional',
|
|
637
|
+
values: [
|
|
638
|
+
{
|
|
639
|
+
displayName: 'Institute Number',
|
|
640
|
+
name: 'instituteNumber',
|
|
641
|
+
type: 'string',
|
|
642
|
+
default: '',
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
displayName: 'Administrative Number',
|
|
646
|
+
name: 'adminNumber',
|
|
647
|
+
type: 'string',
|
|
648
|
+
default: '',
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
displayName: 'School Year Date',
|
|
652
|
+
name: 'schoolYearDate',
|
|
653
|
+
type: 'string',
|
|
654
|
+
default: '',
|
|
655
|
+
},
|
|
656
|
+
],
|
|
657
|
+
},
|
|
658
|
+
],
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
displayName: 'Class/Group Code',
|
|
662
|
+
name: 'classCode',
|
|
663
|
+
type: 'string',
|
|
664
|
+
default: '',
|
|
665
|
+
required: true,
|
|
666
|
+
description: 'Class or group code',
|
|
667
|
+
displayOptions: {
|
|
668
|
+
show: {
|
|
669
|
+
resource: ['group'],
|
|
670
|
+
operation: [
|
|
671
|
+
'saveUserToGroup',
|
|
672
|
+
'removeUserFromGroup',
|
|
673
|
+
'delClass',
|
|
674
|
+
'getSchoolyearDataOfClass',
|
|
675
|
+
'saveSchoolyearDataOfClass',
|
|
676
|
+
],
|
|
677
|
+
},
|
|
678
|
+
},
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
displayName: 'Class List (CSV)',
|
|
682
|
+
name: 'classListCsv',
|
|
683
|
+
type: 'string',
|
|
684
|
+
typeOptions: {
|
|
685
|
+
rows: 6,
|
|
686
|
+
},
|
|
687
|
+
default: '',
|
|
688
|
+
required: true,
|
|
689
|
+
description: 'Serialized CSV list of classes',
|
|
690
|
+
displayOptions: {
|
|
691
|
+
show: {
|
|
692
|
+
resource: ['group'],
|
|
693
|
+
operation: ['saveClassList'],
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
displayName: 'Class List (JSON)',
|
|
699
|
+
name: 'classListJson',
|
|
700
|
+
type: 'string',
|
|
701
|
+
typeOptions: {
|
|
702
|
+
rows: 6,
|
|
703
|
+
},
|
|
704
|
+
default: '',
|
|
705
|
+
required: true,
|
|
706
|
+
description: 'Serialized JSON list of classes',
|
|
707
|
+
displayOptions: {
|
|
708
|
+
show: {
|
|
709
|
+
resource: ['group'],
|
|
710
|
+
operation: ['saveClassListJson'],
|
|
711
|
+
},
|
|
712
|
+
},
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
displayName: 'School Year Date',
|
|
716
|
+
name: 'schoolyearDate',
|
|
717
|
+
type: 'string',
|
|
718
|
+
default: '',
|
|
719
|
+
required: true,
|
|
720
|
+
description: 'School year date (YYYY-MM-DD)',
|
|
721
|
+
displayOptions: {
|
|
722
|
+
show: {
|
|
723
|
+
resource: ['group'],
|
|
724
|
+
operation: ['saveSchoolyearDataOfClass'],
|
|
725
|
+
},
|
|
726
|
+
},
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
displayName: 'Institute Number',
|
|
730
|
+
name: 'schoolyearInstituteNumber',
|
|
731
|
+
type: 'string',
|
|
732
|
+
default: '',
|
|
733
|
+
required: true,
|
|
734
|
+
description: 'Institute number for the school year data',
|
|
735
|
+
displayOptions: {
|
|
736
|
+
show: {
|
|
737
|
+
resource: ['group'],
|
|
738
|
+
operation: ['saveSchoolyearDataOfClass'],
|
|
739
|
+
},
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
displayName: 'Administrative Group Number',
|
|
744
|
+
name: 'administrativeGroupNumber',
|
|
745
|
+
type: 'string',
|
|
746
|
+
default: '',
|
|
747
|
+
required: true,
|
|
748
|
+
displayOptions: {
|
|
749
|
+
show: {
|
|
750
|
+
resource: ['group'],
|
|
751
|
+
operation: ['saveSchoolyearDataOfClass'],
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
displayName: 'Residence',
|
|
757
|
+
name: 'residence',
|
|
758
|
+
type: 'string',
|
|
759
|
+
default: '',
|
|
760
|
+
required: true,
|
|
761
|
+
description: 'Residence location',
|
|
762
|
+
displayOptions: {
|
|
763
|
+
show: {
|
|
764
|
+
resource: ['group'],
|
|
765
|
+
operation: ['saveSchoolyearDataOfClass'],
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
displayName: 'Domain',
|
|
771
|
+
name: 'domain',
|
|
772
|
+
type: 'string',
|
|
773
|
+
default: '',
|
|
774
|
+
required: true,
|
|
775
|
+
description: 'Domain of study',
|
|
776
|
+
displayOptions: {
|
|
777
|
+
show: {
|
|
778
|
+
resource: ['group'],
|
|
779
|
+
operation: ['saveSchoolyearDataOfClass'],
|
|
780
|
+
},
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
displayName: 'Principal',
|
|
785
|
+
name: 'principal',
|
|
786
|
+
type: 'string',
|
|
787
|
+
default: '',
|
|
788
|
+
required: true,
|
|
789
|
+
description: 'Principal name or identifier',
|
|
790
|
+
displayOptions: {
|
|
791
|
+
show: {
|
|
792
|
+
resource: ['group'],
|
|
793
|
+
operation: ['saveSchoolyearDataOfClass'],
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
displayName: 'School Year',
|
|
799
|
+
name: 'schoolYear',
|
|
800
|
+
type: 'string',
|
|
801
|
+
default: '',
|
|
802
|
+
required: true,
|
|
803
|
+
description: 'School year to retrieve absences for (YYYY)',
|
|
804
|
+
displayOptions: {
|
|
805
|
+
show: {
|
|
806
|
+
resource: ['absence'],
|
|
807
|
+
operation: ['getAbsents', 'getAbsentsWithAlias'],
|
|
808
|
+
},
|
|
809
|
+
},
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
displayName: 'Course Name',
|
|
813
|
+
name: 'courseName',
|
|
814
|
+
type: 'string',
|
|
815
|
+
default: '',
|
|
816
|
+
required: true,
|
|
817
|
+
description: 'Full course name',
|
|
818
|
+
displayOptions: {
|
|
819
|
+
show: {
|
|
820
|
+
resource: ['course'],
|
|
821
|
+
operation: ['addCourse', 'addCourseStudents', 'addCourseTeacher'],
|
|
822
|
+
},
|
|
823
|
+
},
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
displayName: 'Course Code',
|
|
827
|
+
name: 'courseCode',
|
|
828
|
+
type: 'string',
|
|
829
|
+
default: '',
|
|
830
|
+
required: true,
|
|
831
|
+
description: 'Unique course code/description',
|
|
832
|
+
displayOptions: {
|
|
833
|
+
show: {
|
|
834
|
+
resource: ['course'],
|
|
835
|
+
operation: ['addCourse', 'addCourseStudents', 'addCourseTeacher'],
|
|
836
|
+
},
|
|
837
|
+
},
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
displayName: 'Visibility',
|
|
841
|
+
name: 'courseVisibility',
|
|
842
|
+
type: 'options',
|
|
843
|
+
options: fields_1.VISIBILITY_OPTIONS,
|
|
844
|
+
default: 1,
|
|
845
|
+
description: 'Course visibility status',
|
|
846
|
+
displayOptions: {
|
|
847
|
+
show: {
|
|
848
|
+
resource: ['course'],
|
|
849
|
+
operation: ['addCourse'],
|
|
850
|
+
},
|
|
851
|
+
},
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
displayName: 'Group Codes',
|
|
855
|
+
name: 'courseGroupIds',
|
|
856
|
+
type: 'string',
|
|
857
|
+
default: '',
|
|
858
|
+
required: true,
|
|
859
|
+
description: 'Comma-separated class/group codes to assign',
|
|
860
|
+
displayOptions: {
|
|
861
|
+
show: {
|
|
862
|
+
resource: ['course'],
|
|
863
|
+
operation: ['addCourseStudents'],
|
|
864
|
+
},
|
|
865
|
+
},
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
displayName: 'Teacher Internal Number',
|
|
869
|
+
name: 'courseTeacherInternNumber',
|
|
870
|
+
type: 'string',
|
|
871
|
+
default: '',
|
|
872
|
+
required: true,
|
|
873
|
+
description: 'Teacher internal number identifier',
|
|
874
|
+
displayOptions: {
|
|
875
|
+
show: {
|
|
876
|
+
resource: ['course'],
|
|
877
|
+
operation: ['addCourseTeacher'],
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
displayName: 'Service ID',
|
|
883
|
+
name: 'serviceId',
|
|
884
|
+
type: 'string',
|
|
885
|
+
default: '',
|
|
886
|
+
required: true,
|
|
887
|
+
description: 'Service identifier returned by Start Skore Sync',
|
|
888
|
+
displayOptions: {
|
|
889
|
+
show: {
|
|
890
|
+
resource: ['system'],
|
|
891
|
+
operation: ['checkStatus'],
|
|
892
|
+
},
|
|
893
|
+
},
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
displayName: 'Deliberation Date',
|
|
897
|
+
name: 'deliberationDate',
|
|
898
|
+
type: 'string',
|
|
899
|
+
default: '',
|
|
900
|
+
required: true,
|
|
901
|
+
description: 'Date in the school year (YYYY-MM-DD)',
|
|
902
|
+
displayOptions: {
|
|
903
|
+
show: {
|
|
904
|
+
resource: ['system'],
|
|
905
|
+
operation: ['getDeliberationLines'],
|
|
906
|
+
},
|
|
907
|
+
},
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
displayName: 'Absence Date',
|
|
911
|
+
name: 'absenceDate',
|
|
912
|
+
type: 'string',
|
|
913
|
+
default: '',
|
|
914
|
+
required: true,
|
|
915
|
+
description: 'Date to retrieve absences for (YYYY-MM-DD)',
|
|
916
|
+
displayOptions: {
|
|
917
|
+
show: {
|
|
918
|
+
resource: ['absence'],
|
|
919
|
+
operation: [
|
|
920
|
+
'getAbsentsByDate',
|
|
921
|
+
'getAbsentsWithAliasByDate',
|
|
922
|
+
'getAbsentsWithInternalNumberByDate',
|
|
923
|
+
'getAbsentsWithUsernameByDate',
|
|
924
|
+
'getAbsentsByDateAndGroup',
|
|
925
|
+
],
|
|
926
|
+
},
|
|
927
|
+
},
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
displayName: 'Title',
|
|
931
|
+
name: 'title',
|
|
932
|
+
type: 'string',
|
|
933
|
+
default: '',
|
|
934
|
+
required: true,
|
|
935
|
+
description: 'Subject line for the helpdesk ticket or message',
|
|
936
|
+
displayOptions: {
|
|
937
|
+
show: {
|
|
938
|
+
resource: ['helpdesk', 'message'],
|
|
939
|
+
operation: ['addHelpdeskTicket', 'sendMsg'],
|
|
940
|
+
},
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
displayName: 'Description',
|
|
945
|
+
name: 'ticketDescription',
|
|
946
|
+
type: 'string',
|
|
947
|
+
typeOptions: {
|
|
948
|
+
rows: 4,
|
|
949
|
+
},
|
|
950
|
+
default: '',
|
|
951
|
+
required: true,
|
|
952
|
+
description: 'Explain the problem or request in detail',
|
|
953
|
+
displayOptions: {
|
|
954
|
+
show: {
|
|
955
|
+
resource: ['helpdesk'],
|
|
956
|
+
operation: ['addHelpdeskTicket'],
|
|
957
|
+
},
|
|
958
|
+
},
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
displayName: 'Message Body',
|
|
962
|
+
name: 'messageBody',
|
|
963
|
+
type: 'string',
|
|
964
|
+
typeOptions: {
|
|
965
|
+
rows: 4,
|
|
966
|
+
},
|
|
967
|
+
default: '',
|
|
968
|
+
required: true,
|
|
969
|
+
description: 'Content of the SmartSchool message',
|
|
970
|
+
displayOptions: {
|
|
971
|
+
show: {
|
|
972
|
+
resource: ['message'],
|
|
973
|
+
operation: ['sendMsg'],
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
displayName: 'Priority',
|
|
979
|
+
name: 'priority',
|
|
980
|
+
type: 'number',
|
|
981
|
+
typeOptions: {
|
|
982
|
+
minValue: 1,
|
|
983
|
+
maxValue: 5,
|
|
984
|
+
},
|
|
985
|
+
default: 3,
|
|
986
|
+
description: '1 = low, 3 = normal, 5 = high (values depend on your SmartSchool setup)',
|
|
987
|
+
displayOptions: {
|
|
988
|
+
show: {
|
|
989
|
+
resource: ['helpdesk'],
|
|
990
|
+
operation: ['addHelpdeskTicket'],
|
|
991
|
+
},
|
|
992
|
+
},
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
displayName: 'Mini Database Item ID',
|
|
996
|
+
name: 'miniDbItem',
|
|
997
|
+
type: 'string',
|
|
998
|
+
default: '',
|
|
999
|
+
required: true,
|
|
1000
|
+
description: 'Identifier of the helpdesk category item (retrieve via the "List Helpdesk Items" operation)',
|
|
1001
|
+
displayOptions: {
|
|
1002
|
+
show: {
|
|
1003
|
+
resource: ['helpdesk'],
|
|
1004
|
+
operation: ['addHelpdeskTicket'],
|
|
1005
|
+
},
|
|
1006
|
+
},
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
displayName: 'User Identifier',
|
|
1010
|
+
name: 'userIdentifier',
|
|
1011
|
+
type: 'string',
|
|
1012
|
+
default: '',
|
|
1013
|
+
required: true,
|
|
1014
|
+
description: 'Username or identifier of the ticket creator, recipient, or lookup target',
|
|
1015
|
+
displayOptions: {
|
|
1016
|
+
show: {
|
|
1017
|
+
resource: ['helpdesk', 'message', 'account', 'absence', 'course', 'system'],
|
|
1018
|
+
operation: [
|
|
1019
|
+
'addHelpdeskTicket',
|
|
1020
|
+
'sendMsg',
|
|
1021
|
+
'saveSignature',
|
|
1022
|
+
'getUserDetails',
|
|
1023
|
+
'getUserOfficialClass',
|
|
1024
|
+
'getAbsents',
|
|
1025
|
+
'getAbsentsWithAlias',
|
|
1026
|
+
'delUser',
|
|
1027
|
+
'setAccountStatus',
|
|
1028
|
+
'changePasswordAtNextLogin',
|
|
1029
|
+
'forcePasswordReset',
|
|
1030
|
+
'saveUserParameter',
|
|
1031
|
+
'removeCoAccount',
|
|
1032
|
+
'savePassword',
|
|
1033
|
+
'deactivateTwoFactorAuthentication',
|
|
1034
|
+
'saveUserToGroup',
|
|
1035
|
+
'removeUserFromGroup',
|
|
1036
|
+
'unregisterStudent',
|
|
1037
|
+
'addCourseTeacher',
|
|
1038
|
+
'getStudentCareer',
|
|
1039
|
+
],
|
|
1040
|
+
},
|
|
1041
|
+
},
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
displayName: 'Internal Number',
|
|
1045
|
+
name: 'internalNumber',
|
|
1046
|
+
type: 'string',
|
|
1047
|
+
default: '',
|
|
1048
|
+
required: true,
|
|
1049
|
+
description: 'Internal SmartSchool number of the user',
|
|
1050
|
+
displayOptions: {
|
|
1051
|
+
show: {
|
|
1052
|
+
resource: ['account'],
|
|
1053
|
+
operation: ['getUserDetailsByNumber', 'changeUsername'],
|
|
1054
|
+
},
|
|
1055
|
+
},
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
displayName: 'Username',
|
|
1059
|
+
name: 'accountUsername',
|
|
1060
|
+
type: 'string',
|
|
1061
|
+
default: '',
|
|
1062
|
+
required: true,
|
|
1063
|
+
description: 'SmartSchool username',
|
|
1064
|
+
displayOptions: {
|
|
1065
|
+
show: {
|
|
1066
|
+
resource: ['account'],
|
|
1067
|
+
operation: ['getUserDetailsByUsername', 'changeInternNumber'],
|
|
1068
|
+
},
|
|
1069
|
+
},
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
displayName: 'Scannable Code',
|
|
1073
|
+
name: 'scannableCode',
|
|
1074
|
+
type: 'string',
|
|
1075
|
+
default: '',
|
|
1076
|
+
required: true,
|
|
1077
|
+
description: 'Scannable code linked to the user (badge/UUID)',
|
|
1078
|
+
displayOptions: {
|
|
1079
|
+
show: {
|
|
1080
|
+
resource: ['account'],
|
|
1081
|
+
operation: ['getUserDetailsByScannableCode'],
|
|
1082
|
+
},
|
|
1083
|
+
},
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
displayName: 'Official Class Date',
|
|
1087
|
+
name: 'officialClassDate',
|
|
1088
|
+
type: 'string',
|
|
1089
|
+
default: '',
|
|
1090
|
+
description: 'Date (YYYY-MM-DD). Leave empty to use today.',
|
|
1091
|
+
displayOptions: {
|
|
1092
|
+
show: {
|
|
1093
|
+
resource: ['account'],
|
|
1094
|
+
operation: ['getUserOfficialClass'],
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
displayName: 'New Username',
|
|
1100
|
+
name: 'newUsername',
|
|
1101
|
+
type: 'string',
|
|
1102
|
+
default: '',
|
|
1103
|
+
required: true,
|
|
1104
|
+
description: 'New username to assign',
|
|
1105
|
+
displayOptions: {
|
|
1106
|
+
show: {
|
|
1107
|
+
resource: ['account'],
|
|
1108
|
+
operation: ['changeUsername'],
|
|
1109
|
+
},
|
|
1110
|
+
},
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
displayName: 'New Internal Number',
|
|
1114
|
+
name: 'newInternNumber',
|
|
1115
|
+
type: 'string',
|
|
1116
|
+
default: '',
|
|
1117
|
+
required: true,
|
|
1118
|
+
description: 'New internal number to assign',
|
|
1119
|
+
displayOptions: {
|
|
1120
|
+
show: {
|
|
1121
|
+
resource: ['account'],
|
|
1122
|
+
operation: ['changeInternNumber'],
|
|
1123
|
+
},
|
|
1124
|
+
},
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
displayName: 'Account Status',
|
|
1128
|
+
name: 'accountStatus',
|
|
1129
|
+
type: 'options',
|
|
1130
|
+
default: 'actief',
|
|
1131
|
+
required: true,
|
|
1132
|
+
description: 'SmartSchool account status',
|
|
1133
|
+
options: fields_1.ACCOUNT_STATUS_OPTIONS,
|
|
1134
|
+
displayOptions: {
|
|
1135
|
+
show: {
|
|
1136
|
+
resource: ['account'],
|
|
1137
|
+
operation: ['setAccountStatus'],
|
|
1138
|
+
},
|
|
1139
|
+
},
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
displayName: 'Account Type',
|
|
1143
|
+
name: 'accountType',
|
|
1144
|
+
type: 'number',
|
|
1145
|
+
typeOptions: {
|
|
1146
|
+
minValue: 0,
|
|
1147
|
+
},
|
|
1148
|
+
default: 0,
|
|
1149
|
+
description: '0 = main account, 1 = first co-account, etc',
|
|
1150
|
+
displayOptions: {
|
|
1151
|
+
show: {
|
|
1152
|
+
resource: ['account'],
|
|
1153
|
+
operation: [
|
|
1154
|
+
'changePasswordAtNextLogin',
|
|
1155
|
+
'forcePasswordReset',
|
|
1156
|
+
'removeCoAccount',
|
|
1157
|
+
'savePassword',
|
|
1158
|
+
'deactivateTwoFactorAuthentication',
|
|
1159
|
+
],
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
displayName: 'Signature Account Type',
|
|
1165
|
+
name: 'signatureAccountType',
|
|
1166
|
+
type: 'number',
|
|
1167
|
+
typeOptions: {
|
|
1168
|
+
minValue: 0,
|
|
1169
|
+
},
|
|
1170
|
+
default: 0,
|
|
1171
|
+
description: '0 = main account, 1 = first co-account, etc',
|
|
1172
|
+
displayOptions: {
|
|
1173
|
+
show: {
|
|
1174
|
+
resource: ['message'],
|
|
1175
|
+
operation: ['saveSignature'],
|
|
1176
|
+
},
|
|
1177
|
+
},
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
displayName: 'Password',
|
|
1181
|
+
name: 'password',
|
|
1182
|
+
type: 'string',
|
|
1183
|
+
default: '',
|
|
1184
|
+
required: true,
|
|
1185
|
+
typeOptions: {
|
|
1186
|
+
password: true,
|
|
1187
|
+
},
|
|
1188
|
+
description: 'New password to set for the user',
|
|
1189
|
+
displayOptions: {
|
|
1190
|
+
show: {
|
|
1191
|
+
resource: ['account'],
|
|
1192
|
+
operation: ['savePassword'],
|
|
1193
|
+
},
|
|
1194
|
+
},
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
displayName: 'Change Password at Next Login',
|
|
1198
|
+
name: 'mustChangePassword',
|
|
1199
|
+
type: 'boolean',
|
|
1200
|
+
default: false,
|
|
1201
|
+
description: 'Whether to force the user to change password at next login',
|
|
1202
|
+
displayOptions: {
|
|
1203
|
+
show: {
|
|
1204
|
+
resource: ['account'],
|
|
1205
|
+
operation: ['savePassword'],
|
|
1206
|
+
},
|
|
1207
|
+
},
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
displayName: 'Parameter Name',
|
|
1211
|
+
name: 'paramName',
|
|
1212
|
+
type: 'string',
|
|
1213
|
+
default: '',
|
|
1214
|
+
required: true,
|
|
1215
|
+
description: 'User parameter name to update (e.g., email, status_coaccount1)',
|
|
1216
|
+
displayOptions: {
|
|
1217
|
+
show: {
|
|
1218
|
+
resource: ['account'],
|
|
1219
|
+
operation: ['saveUserParameter'],
|
|
1220
|
+
},
|
|
1221
|
+
},
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
displayName: 'Parameter Value',
|
|
1225
|
+
name: 'paramValue',
|
|
1226
|
+
type: 'string',
|
|
1227
|
+
default: '',
|
|
1228
|
+
required: true,
|
|
1229
|
+
description: 'Value to set for the parameter',
|
|
1230
|
+
displayOptions: {
|
|
1231
|
+
show: {
|
|
1232
|
+
resource: ['account'],
|
|
1233
|
+
operation: ['saveUserParameter'],
|
|
1234
|
+
},
|
|
1235
|
+
},
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
displayName: 'Official Date',
|
|
1239
|
+
name: 'officialDate',
|
|
1240
|
+
type: 'string',
|
|
1241
|
+
default: '',
|
|
1242
|
+
description: 'Date to apply the change (YYYY-MM-DD)',
|
|
1243
|
+
displayOptions: {
|
|
1244
|
+
show: {
|
|
1245
|
+
resource: ['account', 'group'],
|
|
1246
|
+
operation: [
|
|
1247
|
+
'delUser',
|
|
1248
|
+
'saveUserToGroup',
|
|
1249
|
+
'removeUserFromGroup',
|
|
1250
|
+
'clearGroup',
|
|
1251
|
+
'unregisterStudent',
|
|
1252
|
+
],
|
|
1253
|
+
},
|
|
1254
|
+
},
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
displayName: 'Old Internal Number',
|
|
1258
|
+
name: 'oldInum',
|
|
1259
|
+
type: 'string',
|
|
1260
|
+
default: '',
|
|
1261
|
+
required: true,
|
|
1262
|
+
description: 'Existing internal number to replace',
|
|
1263
|
+
displayOptions: {
|
|
1264
|
+
show: {
|
|
1265
|
+
resource: ['account'],
|
|
1266
|
+
operation: ['replaceInum'],
|
|
1267
|
+
},
|
|
1268
|
+
},
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
displayName: 'New Internal Number',
|
|
1272
|
+
name: 'newInum',
|
|
1273
|
+
type: 'string',
|
|
1274
|
+
default: '',
|
|
1275
|
+
required: true,
|
|
1276
|
+
description: 'Replacement internal number',
|
|
1277
|
+
displayOptions: {
|
|
1278
|
+
show: {
|
|
1279
|
+
resource: ['account'],
|
|
1280
|
+
operation: ['replaceInum'],
|
|
1281
|
+
},
|
|
1282
|
+
},
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
displayName: 'User Profile',
|
|
1286
|
+
name: 'userProfile',
|
|
1287
|
+
type: 'fixedCollection',
|
|
1288
|
+
default: {},
|
|
1289
|
+
description: 'Core SmartSchool user fields',
|
|
1290
|
+
displayOptions: {
|
|
1291
|
+
show: {
|
|
1292
|
+
resource: ['account'],
|
|
1293
|
+
operation: ['saveUser'],
|
|
1294
|
+
},
|
|
1295
|
+
},
|
|
1296
|
+
options: [
|
|
1297
|
+
{
|
|
1298
|
+
displayName: 'Required',
|
|
1299
|
+
name: 'required',
|
|
1300
|
+
values: [
|
|
1301
|
+
{
|
|
1302
|
+
displayName: 'Username',
|
|
1303
|
+
name: 'username',
|
|
1304
|
+
type: 'string',
|
|
1305
|
+
default: '',
|
|
1306
|
+
required: true,
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
displayName: 'First Name',
|
|
1310
|
+
name: 'name',
|
|
1311
|
+
type: 'string',
|
|
1312
|
+
default: '',
|
|
1313
|
+
required: true,
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
displayName: 'Last Name',
|
|
1317
|
+
name: 'surname',
|
|
1318
|
+
type: 'string',
|
|
1319
|
+
default: '',
|
|
1320
|
+
required: true,
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
displayName: 'Base Role',
|
|
1324
|
+
name: 'basisrol',
|
|
1325
|
+
type: 'options',
|
|
1326
|
+
options: [
|
|
1327
|
+
{ name: 'Student (Leerling)', value: 'leerling' },
|
|
1328
|
+
{ name: 'Teacher (Leerkracht)', value: 'leerkracht' },
|
|
1329
|
+
{ name: 'Management (Directie)', value: 'directie' },
|
|
1330
|
+
{ name: 'Other (Andere)', value: 'andere' },
|
|
1331
|
+
],
|
|
1332
|
+
default: 'leerling',
|
|
1333
|
+
required: true,
|
|
1334
|
+
},
|
|
1335
|
+
],
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
displayName: 'Optional',
|
|
1339
|
+
name: 'optional',
|
|
1340
|
+
values: [
|
|
1341
|
+
{
|
|
1342
|
+
displayName: 'Address',
|
|
1343
|
+
name: 'address',
|
|
1344
|
+
type: 'string',
|
|
1345
|
+
default: '',
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
displayName: 'Birth City',
|
|
1349
|
+
name: 'birthcity',
|
|
1350
|
+
type: 'string',
|
|
1351
|
+
default: '',
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
displayName: 'Birth Country',
|
|
1355
|
+
name: 'birthcountry',
|
|
1356
|
+
type: 'string',
|
|
1357
|
+
default: '',
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
displayName: 'Birthdate',
|
|
1361
|
+
name: 'birthdate',
|
|
1362
|
+
type: 'string',
|
|
1363
|
+
default: '',
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
displayName: 'City',
|
|
1367
|
+
name: 'city',
|
|
1368
|
+
type: 'string',
|
|
1369
|
+
default: '',
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
displayName: 'Country',
|
|
1373
|
+
name: 'country',
|
|
1374
|
+
type: 'string',
|
|
1375
|
+
default: '',
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
displayName: 'Email',
|
|
1379
|
+
name: 'email',
|
|
1380
|
+
type: 'string',
|
|
1381
|
+
placeholder: 'name@email.com',
|
|
1382
|
+
default: '',
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
displayName: 'Extra Names',
|
|
1386
|
+
name: 'extranames',
|
|
1387
|
+
type: 'string',
|
|
1388
|
+
default: '',
|
|
1389
|
+
},
|
|
1390
|
+
{
|
|
1391
|
+
displayName: 'Initials',
|
|
1392
|
+
name: 'initials',
|
|
1393
|
+
type: 'string',
|
|
1394
|
+
default: '',
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
displayName: 'Internal Number',
|
|
1398
|
+
name: 'internnumber',
|
|
1399
|
+
type: 'string',
|
|
1400
|
+
default: '',
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
displayName: 'Mobile',
|
|
1404
|
+
name: 'mobile',
|
|
1405
|
+
type: 'string',
|
|
1406
|
+
default: '',
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
displayName: 'Nationality',
|
|
1410
|
+
name: 'nationality',
|
|
1411
|
+
type: 'string',
|
|
1412
|
+
default: '',
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
displayName: 'Phone',
|
|
1416
|
+
name: 'phone',
|
|
1417
|
+
type: 'string',
|
|
1418
|
+
default: '',
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
displayName: 'Postal Code',
|
|
1422
|
+
name: 'postalcode',
|
|
1423
|
+
type: 'string',
|
|
1424
|
+
default: '',
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
displayName: 'Primary Password',
|
|
1428
|
+
name: 'passwd1',
|
|
1429
|
+
type: 'string',
|
|
1430
|
+
default: '',
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
displayName: 'Secondary Password',
|
|
1434
|
+
name: 'passwd2',
|
|
1435
|
+
type: 'string',
|
|
1436
|
+
default: '',
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
displayName: 'Sex',
|
|
1440
|
+
name: 'sex',
|
|
1441
|
+
type: 'string',
|
|
1442
|
+
default: '',
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
displayName: 'Tertiary Password',
|
|
1446
|
+
name: 'passwd3',
|
|
1447
|
+
type: 'string',
|
|
1448
|
+
default: '',
|
|
1449
|
+
},
|
|
1450
|
+
],
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
displayName: 'Custom Fields',
|
|
1454
|
+
name: 'custom',
|
|
1455
|
+
values: [
|
|
1456
|
+
{
|
|
1457
|
+
displayName: 'Custom Fields (JSON)',
|
|
1458
|
+
name: 'customFields',
|
|
1459
|
+
type: 'string',
|
|
1460
|
+
typeOptions: {
|
|
1461
|
+
rows: 4,
|
|
1462
|
+
},
|
|
1463
|
+
default: '',
|
|
1464
|
+
description: 'JSON object of additional SmartSchool fields',
|
|
1465
|
+
},
|
|
1466
|
+
],
|
|
1467
|
+
},
|
|
1468
|
+
],
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
displayName: 'Sender Identifier',
|
|
1472
|
+
name: 'senderIdentifier',
|
|
1473
|
+
type: 'string',
|
|
1474
|
+
default: '',
|
|
1475
|
+
required: true,
|
|
1476
|
+
description: 'Identifier of the account sending the message (use "Null" to hide sender)',
|
|
1477
|
+
displayOptions: {
|
|
1478
|
+
show: {
|
|
1479
|
+
resource: ['message'],
|
|
1480
|
+
operation: ['sendMsg'],
|
|
1481
|
+
},
|
|
1482
|
+
},
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
displayName: 'Signature',
|
|
1486
|
+
name: 'signature',
|
|
1487
|
+
type: 'string',
|
|
1488
|
+
typeOptions: {
|
|
1489
|
+
rows: 4,
|
|
1490
|
+
},
|
|
1491
|
+
default: '',
|
|
1492
|
+
required: true,
|
|
1493
|
+
description: 'Signature text to save',
|
|
1494
|
+
displayOptions: {
|
|
1495
|
+
show: {
|
|
1496
|
+
resource: ['message'],
|
|
1497
|
+
operation: ['saveSignature'],
|
|
1498
|
+
},
|
|
1499
|
+
},
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
displayName: 'Send to Co-Account',
|
|
1503
|
+
name: 'coaccount',
|
|
1504
|
+
type: 'number',
|
|
1505
|
+
typeOptions: {
|
|
1506
|
+
minValue: 0,
|
|
1507
|
+
},
|
|
1508
|
+
default: 0,
|
|
1509
|
+
description: '0 = main account, 1 = first co-account, etc',
|
|
1510
|
+
displayOptions: {
|
|
1511
|
+
show: {
|
|
1512
|
+
resource: ['message'],
|
|
1513
|
+
operation: ['sendMsg'],
|
|
1514
|
+
},
|
|
1515
|
+
},
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
displayName: 'Copy to LVS',
|
|
1519
|
+
name: 'copyToLVS',
|
|
1520
|
+
type: 'boolean',
|
|
1521
|
+
default: false,
|
|
1522
|
+
description: 'Whether to copy the message to the SmartSchool LVS (student tracking system)',
|
|
1523
|
+
displayOptions: {
|
|
1524
|
+
show: {
|
|
1525
|
+
resource: ['message'],
|
|
1526
|
+
operation: ['sendMsg'],
|
|
1527
|
+
},
|
|
1528
|
+
},
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
displayName: 'Attachments',
|
|
1532
|
+
name: 'attachments',
|
|
1533
|
+
type: 'fixedCollection',
|
|
1534
|
+
typeOptions: {
|
|
1535
|
+
multipleValues: true,
|
|
1536
|
+
},
|
|
1537
|
+
default: {},
|
|
1538
|
+
description: 'Optional base64-encoded attachments',
|
|
1539
|
+
displayOptions: {
|
|
1540
|
+
show: {
|
|
1541
|
+
resource: ['message'],
|
|
1542
|
+
operation: ['sendMsg'],
|
|
1543
|
+
},
|
|
1544
|
+
},
|
|
1545
|
+
options: [
|
|
1546
|
+
{
|
|
1547
|
+
displayName: 'Attachment',
|
|
1548
|
+
name: 'attachment',
|
|
1549
|
+
values: [
|
|
1550
|
+
{
|
|
1551
|
+
displayName: 'Filename',
|
|
1552
|
+
name: 'filename',
|
|
1553
|
+
type: 'string',
|
|
1554
|
+
default: '',
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
displayName: 'File Data (Base64)',
|
|
1558
|
+
name: 'filedata',
|
|
1559
|
+
type: 'string',
|
|
1560
|
+
typeOptions: {
|
|
1561
|
+
rows: 4,
|
|
1562
|
+
},
|
|
1563
|
+
default: '',
|
|
1564
|
+
},
|
|
1565
|
+
],
|
|
1566
|
+
},
|
|
1567
|
+
],
|
|
1568
|
+
},
|
|
1569
|
+
],
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
async execute() {
|
|
1573
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1574
|
+
const items = this.getInputData();
|
|
1575
|
+
const returnData = [];
|
|
1576
|
+
const { accesscode } = await GenericFunctions_1.getSmartSchoolCredentials.call(this);
|
|
1577
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
1578
|
+
const normalizeAndPush = (data) => {
|
|
1579
|
+
if (Array.isArray(data)) {
|
|
1580
|
+
for (const entry of data) {
|
|
1581
|
+
returnData.push({
|
|
1582
|
+
json: (entry !== null && entry !== void 0 ? entry : {}),
|
|
1583
|
+
pairedItem: { item: itemIndex },
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
if (data === null || data === undefined) {
|
|
1589
|
+
returnData.push({
|
|
1590
|
+
json: {},
|
|
1591
|
+
pairedItem: { item: itemIndex },
|
|
1592
|
+
});
|
|
1593
|
+
return;
|
|
1594
|
+
}
|
|
1595
|
+
if (typeof data !== 'object') {
|
|
1596
|
+
returnData.push({
|
|
1597
|
+
json: { value: data },
|
|
1598
|
+
pairedItem: { item: itemIndex },
|
|
1599
|
+
});
|
|
1600
|
+
return;
|
|
1601
|
+
}
|
|
1602
|
+
returnData.push({
|
|
1603
|
+
json: data,
|
|
1604
|
+
pairedItem: { item: itemIndex },
|
|
1605
|
+
});
|
|
1606
|
+
};
|
|
1607
|
+
const maybeThrowSmartschoolError = (result) => {
|
|
1608
|
+
const code = typeof result === 'number'
|
|
1609
|
+
? result
|
|
1610
|
+
: typeof result === 'string' && /^\d+$/.test(result)
|
|
1611
|
+
? Number(result)
|
|
1612
|
+
: null;
|
|
1613
|
+
if (code !== null && errorCodes_1.SMARTSCHOOL_ERROR_CODES[code]) {
|
|
1614
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `SmartSchool error ${code}: ${errorCodes_1.SMARTSCHOOL_ERROR_CODES[code]}`, { itemIndex });
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
const callMethod = async (method, params) => {
|
|
1618
|
+
const result = await GenericFunctions_1.callSmartschoolSoap.call(this, method, {
|
|
1619
|
+
accesscode,
|
|
1620
|
+
...params,
|
|
1621
|
+
});
|
|
1622
|
+
maybeThrowSmartschoolError(result);
|
|
1623
|
+
return result;
|
|
1624
|
+
};
|
|
1625
|
+
try {
|
|
1626
|
+
const resource = this.getNodeParameter('resource', itemIndex);
|
|
1627
|
+
const operation = this.getNodeParameter('operation', itemIndex);
|
|
1628
|
+
if (resource === 'group' &&
|
|
1629
|
+
(operation === 'getAllAccounts' || operation === 'getAllAccountsExtended')) {
|
|
1630
|
+
const code = this.getNodeParameter('code', itemIndex);
|
|
1631
|
+
const recursive = this.getNodeParameter('recursive', itemIndex, false);
|
|
1632
|
+
const recursiveFlag = recursive ? '1' : '0';
|
|
1633
|
+
const response = await callMethod(operation === 'getAllAccounts' ? 'getAllAccounts' : 'getAllAccountsExtended', {
|
|
1634
|
+
code,
|
|
1635
|
+
recursive: recursiveFlag,
|
|
1636
|
+
});
|
|
1637
|
+
normalizeAndPush(response);
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
if (resource === 'group') {
|
|
1641
|
+
if (operation === 'getAllGroupsAndClasses') {
|
|
1642
|
+
const response = await callMethod('getAllGroupsAndClasses', {});
|
|
1643
|
+
normalizeAndPush(response);
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
if (operation === 'getClassList') {
|
|
1647
|
+
const response = await callMethod('getClassList', {});
|
|
1648
|
+
returnData.push({
|
|
1649
|
+
json: { csv: response },
|
|
1650
|
+
pairedItem: { item: itemIndex },
|
|
1651
|
+
});
|
|
1652
|
+
continue;
|
|
1653
|
+
}
|
|
1654
|
+
if (operation === 'getClassListJson') {
|
|
1655
|
+
const response = await callMethod('getClassListJson', {});
|
|
1656
|
+
normalizeAndPush(response);
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1659
|
+
if (operation === 'getClassTeachers') {
|
|
1660
|
+
const getAllOwners = this.getNodeParameter('getAllOwners', itemIndex, false);
|
|
1661
|
+
const response = await callMethod('getClassTeachers', { getAllOwners });
|
|
1662
|
+
normalizeAndPush(response);
|
|
1663
|
+
continue;
|
|
1664
|
+
}
|
|
1665
|
+
if (operation === 'changeGroupVisibility') {
|
|
1666
|
+
const code = this.getNodeParameter('code', itemIndex);
|
|
1667
|
+
const visibility = this.getNodeParameter('groupVisibility', itemIndex);
|
|
1668
|
+
const response = await callMethod('changeGroupVisibility', {
|
|
1669
|
+
code,
|
|
1670
|
+
visbility: visibility,
|
|
1671
|
+
});
|
|
1672
|
+
normalizeAndPush(response);
|
|
1673
|
+
continue;
|
|
1674
|
+
}
|
|
1675
|
+
if (operation === 'saveGroup' || operation === 'saveClass') {
|
|
1676
|
+
const details = this.getNodeParameter('groupClassDetails', itemIndex, {});
|
|
1677
|
+
const required = ((_a = details.required) !== null && _a !== void 0 ? _a : {});
|
|
1678
|
+
const optional = ((_b = details.optional) !== null && _b !== void 0 ? _b : {});
|
|
1679
|
+
const payload = {
|
|
1680
|
+
name: required.name,
|
|
1681
|
+
desc: required.desc,
|
|
1682
|
+
code: required.code,
|
|
1683
|
+
parent: required.parent,
|
|
1684
|
+
untis: required.untis,
|
|
1685
|
+
};
|
|
1686
|
+
if (operation === 'saveClass') {
|
|
1687
|
+
if (optional.instituteNumber) {
|
|
1688
|
+
payload.instituteNumber = optional.instituteNumber;
|
|
1689
|
+
}
|
|
1690
|
+
if (optional.adminNumber) {
|
|
1691
|
+
payload.adminNumber = optional.adminNumber;
|
|
1692
|
+
}
|
|
1693
|
+
if (optional.schoolYearDate) {
|
|
1694
|
+
payload.schoolYearDate = optional.schoolYearDate;
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
const response = operation === 'saveGroup'
|
|
1698
|
+
? await callMethod('saveGroup', payload)
|
|
1699
|
+
: await callMethod('saveClass', payload);
|
|
1700
|
+
returnData.push({
|
|
1701
|
+
json: { success: response },
|
|
1702
|
+
pairedItem: { item: itemIndex },
|
|
1703
|
+
});
|
|
1704
|
+
continue;
|
|
1705
|
+
}
|
|
1706
|
+
if (operation === 'saveUserToGroup') {
|
|
1707
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1708
|
+
const classCode = this.getNodeParameter('classCode', itemIndex);
|
|
1709
|
+
const officialDate = this.getNodeParameter('officialDate', itemIndex, '');
|
|
1710
|
+
const payload = {
|
|
1711
|
+
userIdentifier,
|
|
1712
|
+
class: classCode,
|
|
1713
|
+
};
|
|
1714
|
+
if (officialDate) {
|
|
1715
|
+
payload.officialDate = officialDate;
|
|
1716
|
+
}
|
|
1717
|
+
const response = await callMethod('saveUserToClass', payload);
|
|
1718
|
+
returnData.push({
|
|
1719
|
+
json: { success: response },
|
|
1720
|
+
pairedItem: { item: itemIndex },
|
|
1721
|
+
});
|
|
1722
|
+
continue;
|
|
1723
|
+
}
|
|
1724
|
+
if (operation === 'removeUserFromGroup') {
|
|
1725
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1726
|
+
const classCode = this.getNodeParameter('classCode', itemIndex);
|
|
1727
|
+
const officialDate = this.getNodeParameter('officialDate', itemIndex, '');
|
|
1728
|
+
const payload = {
|
|
1729
|
+
userIdentifier,
|
|
1730
|
+
class: classCode,
|
|
1731
|
+
};
|
|
1732
|
+
if (officialDate) {
|
|
1733
|
+
payload.officialDate = officialDate;
|
|
1734
|
+
}
|
|
1735
|
+
const response = await callMethod('removeUserFromGroup', payload);
|
|
1736
|
+
returnData.push({
|
|
1737
|
+
json: { success: response },
|
|
1738
|
+
pairedItem: { item: itemIndex },
|
|
1739
|
+
});
|
|
1740
|
+
continue;
|
|
1741
|
+
}
|
|
1742
|
+
if (operation === 'delClass') {
|
|
1743
|
+
const classCode = this.getNodeParameter('classCode', itemIndex);
|
|
1744
|
+
const response = await callMethod('delClass', { code: classCode });
|
|
1745
|
+
returnData.push({
|
|
1746
|
+
json: { success: response },
|
|
1747
|
+
pairedItem: { item: itemIndex },
|
|
1748
|
+
});
|
|
1749
|
+
continue;
|
|
1750
|
+
}
|
|
1751
|
+
if (operation === 'saveClassList') {
|
|
1752
|
+
const serializedList = this.getNodeParameter('classListCsv', itemIndex);
|
|
1753
|
+
const response = await callMethod('saveClassList', { serializedList });
|
|
1754
|
+
normalizeAndPush(response);
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
if (operation === 'saveClassListJson') {
|
|
1758
|
+
const jsonList = this.getNodeParameter('classListJson', itemIndex);
|
|
1759
|
+
const response = await callMethod('saveClassListJson', { jsonList });
|
|
1760
|
+
normalizeAndPush(response);
|
|
1761
|
+
continue;
|
|
1762
|
+
}
|
|
1763
|
+
if (operation === 'getSchoolyearDataOfClass') {
|
|
1764
|
+
const classCode = this.getNodeParameter('classCode', itemIndex);
|
|
1765
|
+
const response = await callMethod('getSchoolyearDataOfClass', { classCode });
|
|
1766
|
+
normalizeAndPush(response);
|
|
1767
|
+
continue;
|
|
1768
|
+
}
|
|
1769
|
+
if (operation === 'saveSchoolyearDataOfClass') {
|
|
1770
|
+
const classCode = this.getNodeParameter('classCode', itemIndex);
|
|
1771
|
+
const date = this.getNodeParameter('schoolyearDate', itemIndex);
|
|
1772
|
+
const instituteNumber = this.getNodeParameter('schoolyearInstituteNumber', itemIndex);
|
|
1773
|
+
const administrativeGroupNumber = this.getNodeParameter('administrativeGroupNumber', itemIndex);
|
|
1774
|
+
const residence = this.getNodeParameter('residence', itemIndex);
|
|
1775
|
+
const domain = this.getNodeParameter('domain', itemIndex);
|
|
1776
|
+
const principal = this.getNodeParameter('principal', itemIndex);
|
|
1777
|
+
const response = await callMethod('saveSchoolyearDataOfClass', {
|
|
1778
|
+
classCode,
|
|
1779
|
+
date,
|
|
1780
|
+
instituteNumber,
|
|
1781
|
+
administrativeGroupNumber,
|
|
1782
|
+
residence,
|
|
1783
|
+
domain,
|
|
1784
|
+
principal,
|
|
1785
|
+
});
|
|
1786
|
+
returnData.push({
|
|
1787
|
+
json: { success: response },
|
|
1788
|
+
pairedItem: { item: itemIndex },
|
|
1789
|
+
});
|
|
1790
|
+
continue;
|
|
1791
|
+
}
|
|
1792
|
+
if (operation === 'getSkoreClassTeacherCourseRelation') {
|
|
1793
|
+
const response = await callMethod('getSkoreClassTeacherCourseRelation', {});
|
|
1794
|
+
normalizeAndPush(response);
|
|
1795
|
+
continue;
|
|
1796
|
+
}
|
|
1797
|
+
if (operation === 'clearGroup') {
|
|
1798
|
+
const groupCode = this.getNodeParameter('code', itemIndex);
|
|
1799
|
+
const officialDate = this.getNodeParameter('officialDate', itemIndex, '');
|
|
1800
|
+
const payload = {
|
|
1801
|
+
group: groupCode,
|
|
1802
|
+
};
|
|
1803
|
+
if (officialDate) {
|
|
1804
|
+
payload.officialDate = officialDate;
|
|
1805
|
+
}
|
|
1806
|
+
const response = await callMethod('clearGroup', payload);
|
|
1807
|
+
returnData.push({
|
|
1808
|
+
json: { success: response },
|
|
1809
|
+
pairedItem: { item: itemIndex },
|
|
1810
|
+
});
|
|
1811
|
+
continue;
|
|
1812
|
+
}
|
|
1813
|
+
if (operation === 'unregisterStudent') {
|
|
1814
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1815
|
+
const officialDate = this.getNodeParameter('officialDate', itemIndex, '');
|
|
1816
|
+
const payload = {
|
|
1817
|
+
userIdentifier,
|
|
1818
|
+
};
|
|
1819
|
+
if (officialDate) {
|
|
1820
|
+
payload.officialDate = officialDate;
|
|
1821
|
+
}
|
|
1822
|
+
const response = await callMethod('unregisterStudent', payload);
|
|
1823
|
+
returnData.push({
|
|
1824
|
+
json: { success: response },
|
|
1825
|
+
pairedItem: { item: itemIndex },
|
|
1826
|
+
});
|
|
1827
|
+
continue;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
if (resource === 'account') {
|
|
1831
|
+
if (operation === 'getUserDetails') {
|
|
1832
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1833
|
+
const response = await callMethod('getUserDetails', { userIdentifier });
|
|
1834
|
+
normalizeAndPush(response);
|
|
1835
|
+
continue;
|
|
1836
|
+
}
|
|
1837
|
+
if (operation === 'getUserDetailsByNumber') {
|
|
1838
|
+
const number = this.getNodeParameter('internalNumber', itemIndex);
|
|
1839
|
+
const response = await callMethod('getUserDetailsByNumber', { number });
|
|
1840
|
+
normalizeAndPush(response);
|
|
1841
|
+
continue;
|
|
1842
|
+
}
|
|
1843
|
+
if (operation === 'getUserDetailsByUsername') {
|
|
1844
|
+
const username = this.getNodeParameter('accountUsername', itemIndex);
|
|
1845
|
+
const response = await callMethod('getUserDetailsByUsername', { username });
|
|
1846
|
+
normalizeAndPush(response);
|
|
1847
|
+
continue;
|
|
1848
|
+
}
|
|
1849
|
+
if (operation === 'getUserDetailsByScannableCode') {
|
|
1850
|
+
const scannableCode = this.getNodeParameter('scannableCode', itemIndex);
|
|
1851
|
+
const response = await callMethod('getUserDetailsByScannableCode', { scannableCode });
|
|
1852
|
+
normalizeAndPush(response);
|
|
1853
|
+
continue;
|
|
1854
|
+
}
|
|
1855
|
+
if (operation === 'getUserOfficialClass') {
|
|
1856
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1857
|
+
const date = this.getNodeParameter('officialClassDate', itemIndex, '') ||
|
|
1858
|
+
new Date().toISOString().slice(0, 10);
|
|
1859
|
+
const response = await callMethod('getUserOfficialClass', { userIdentifier, date });
|
|
1860
|
+
normalizeAndPush(response);
|
|
1861
|
+
continue;
|
|
1862
|
+
}
|
|
1863
|
+
if (operation === 'saveUser') {
|
|
1864
|
+
const profile = this.getNodeParameter('userProfile', itemIndex, {});
|
|
1865
|
+
const required = ((_c = profile.required) !== null && _c !== void 0 ? _c : {});
|
|
1866
|
+
const optional = ((_d = profile.optional) !== null && _d !== void 0 ? _d : {});
|
|
1867
|
+
const custom = ((_e = profile.custom) !== null && _e !== void 0 ? _e : {});
|
|
1868
|
+
const customFieldsRaw = ((_f = custom.customFields) !== null && _f !== void 0 ? _f : '');
|
|
1869
|
+
let customFields = {};
|
|
1870
|
+
if (customFieldsRaw) {
|
|
1871
|
+
try {
|
|
1872
|
+
customFields = JSON.parse(customFieldsRaw);
|
|
1873
|
+
}
|
|
1874
|
+
catch {
|
|
1875
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Custom fields must be valid JSON.', { itemIndex });
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
const payload = {
|
|
1879
|
+
username: required.username,
|
|
1880
|
+
name: required.name,
|
|
1881
|
+
surname: required.surname,
|
|
1882
|
+
basisrol: required.basisrol,
|
|
1883
|
+
};
|
|
1884
|
+
const addIfValue = (key, value) => {
|
|
1885
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
1886
|
+
payload[key] = value;
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
addIfValue('passwd1', optional.passwd1);
|
|
1890
|
+
addIfValue('passwd2', optional.passwd2);
|
|
1891
|
+
addIfValue('passwd3', optional.passwd3);
|
|
1892
|
+
addIfValue('internnumber', optional.internnumber);
|
|
1893
|
+
addIfValue('extranames', optional.extranames);
|
|
1894
|
+
addIfValue('initials', optional.initials);
|
|
1895
|
+
addIfValue('sex', optional.sex);
|
|
1896
|
+
addIfValue('birthday', optional.birthdate);
|
|
1897
|
+
addIfValue('birthplace', optional.birthcity);
|
|
1898
|
+
addIfValue('birthcountry', optional.birthcountry);
|
|
1899
|
+
addIfValue('address', optional.address);
|
|
1900
|
+
addIfValue('postalcode', optional.postalcode);
|
|
1901
|
+
addIfValue('location', optional.city);
|
|
1902
|
+
addIfValue('country', optional.country);
|
|
1903
|
+
addIfValue('email', optional.email);
|
|
1904
|
+
addIfValue('mobilephone', optional.mobile);
|
|
1905
|
+
addIfValue('homephone', optional.phone);
|
|
1906
|
+
for (const [key, value] of Object.entries(customFields)) {
|
|
1907
|
+
addIfValue(key, value);
|
|
1908
|
+
}
|
|
1909
|
+
const response = await callMethod('saveUser', payload);
|
|
1910
|
+
returnData.push({
|
|
1911
|
+
json: { success: response },
|
|
1912
|
+
pairedItem: { item: itemIndex },
|
|
1913
|
+
});
|
|
1914
|
+
continue;
|
|
1915
|
+
}
|
|
1916
|
+
if (operation === 'delUser') {
|
|
1917
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1918
|
+
const officialDate = this.getNodeParameter('officialDate', itemIndex, '');
|
|
1919
|
+
const payload = {
|
|
1920
|
+
userIdentifier,
|
|
1921
|
+
};
|
|
1922
|
+
if (officialDate) {
|
|
1923
|
+
payload.officialDate = officialDate;
|
|
1924
|
+
}
|
|
1925
|
+
const response = await callMethod('delUser', payload);
|
|
1926
|
+
returnData.push({
|
|
1927
|
+
json: { success: response },
|
|
1928
|
+
pairedItem: { item: itemIndex },
|
|
1929
|
+
});
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1932
|
+
if (operation === 'setAccountStatus') {
|
|
1933
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1934
|
+
const accountStatus = this.getNodeParameter('accountStatus', itemIndex);
|
|
1935
|
+
const response = await callMethod('setAccountStatus', { userIdentifier, accountStatus });
|
|
1936
|
+
returnData.push({
|
|
1937
|
+
json: { success: response },
|
|
1938
|
+
pairedItem: { item: itemIndex },
|
|
1939
|
+
});
|
|
1940
|
+
continue;
|
|
1941
|
+
}
|
|
1942
|
+
if (operation === 'changeUsername') {
|
|
1943
|
+
const internNumber = this.getNodeParameter('internalNumber', itemIndex);
|
|
1944
|
+
const newUsername = this.getNodeParameter('newUsername', itemIndex);
|
|
1945
|
+
const response = await callMethod('changeUsername', { internNumber, newUsername });
|
|
1946
|
+
returnData.push({
|
|
1947
|
+
json: { success: response },
|
|
1948
|
+
pairedItem: { item: itemIndex },
|
|
1949
|
+
});
|
|
1950
|
+
continue;
|
|
1951
|
+
}
|
|
1952
|
+
if (operation === 'changeInternNumber') {
|
|
1953
|
+
const username = this.getNodeParameter('accountUsername', itemIndex);
|
|
1954
|
+
const newInternNumber = this.getNodeParameter('newInternNumber', itemIndex);
|
|
1955
|
+
const response = await callMethod('changeInternNumber', { username, newInternNumber });
|
|
1956
|
+
returnData.push({
|
|
1957
|
+
json: { success: response },
|
|
1958
|
+
pairedItem: { item: itemIndex },
|
|
1959
|
+
});
|
|
1960
|
+
continue;
|
|
1961
|
+
}
|
|
1962
|
+
if (operation === 'changePasswordAtNextLogin') {
|
|
1963
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1964
|
+
const accountType = this.getNodeParameter('accountType', itemIndex);
|
|
1965
|
+
const response = await callMethod('changePasswordAtNextLogin', {
|
|
1966
|
+
userIdentifier,
|
|
1967
|
+
accountType,
|
|
1968
|
+
});
|
|
1969
|
+
returnData.push({
|
|
1970
|
+
json: { success: response },
|
|
1971
|
+
pairedItem: { item: itemIndex },
|
|
1972
|
+
});
|
|
1973
|
+
continue;
|
|
1974
|
+
}
|
|
1975
|
+
if (operation === 'forcePasswordReset') {
|
|
1976
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1977
|
+
const accountType = this.getNodeParameter('accountType', itemIndex);
|
|
1978
|
+
const response = await callMethod('forcePasswordReset', { userIdentifier, accountType });
|
|
1979
|
+
returnData.push({
|
|
1980
|
+
json: { success: response },
|
|
1981
|
+
pairedItem: { item: itemIndex },
|
|
1982
|
+
});
|
|
1983
|
+
continue;
|
|
1984
|
+
}
|
|
1985
|
+
if (operation === 'replaceInum') {
|
|
1986
|
+
const oldInum = this.getNodeParameter('oldInum', itemIndex);
|
|
1987
|
+
const newInum = this.getNodeParameter('newInum', itemIndex);
|
|
1988
|
+
const response = await callMethod('replaceInum', { oldInum, newInum });
|
|
1989
|
+
returnData.push({
|
|
1990
|
+
json: { success: response },
|
|
1991
|
+
pairedItem: { item: itemIndex },
|
|
1992
|
+
});
|
|
1993
|
+
continue;
|
|
1994
|
+
}
|
|
1995
|
+
if (operation === 'saveUserParameter') {
|
|
1996
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
1997
|
+
const paramName = this.getNodeParameter('paramName', itemIndex);
|
|
1998
|
+
const paramValue = this.getNodeParameter('paramValue', itemIndex);
|
|
1999
|
+
const response = await callMethod('saveUserParameter', {
|
|
2000
|
+
userIdentifier,
|
|
2001
|
+
paramName,
|
|
2002
|
+
paramValue,
|
|
2003
|
+
});
|
|
2004
|
+
returnData.push({
|
|
2005
|
+
json: { success: response },
|
|
2006
|
+
pairedItem: { item: itemIndex },
|
|
2007
|
+
});
|
|
2008
|
+
continue;
|
|
2009
|
+
}
|
|
2010
|
+
if (operation === 'removeCoAccount') {
|
|
2011
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2012
|
+
const accountType = this.getNodeParameter('accountType', itemIndex);
|
|
2013
|
+
const response = await callMethod('removeCoAccount', { userIdentifier, accountType });
|
|
2014
|
+
returnData.push({
|
|
2015
|
+
json: { success: response },
|
|
2016
|
+
pairedItem: { item: itemIndex },
|
|
2017
|
+
});
|
|
2018
|
+
continue;
|
|
2019
|
+
}
|
|
2020
|
+
if (operation === 'savePassword') {
|
|
2021
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2022
|
+
const accountType = this.getNodeParameter('accountType', itemIndex);
|
|
2023
|
+
const password = this.getNodeParameter('password', itemIndex);
|
|
2024
|
+
const mustChangePassword = this.getNodeParameter('mustChangePassword', itemIndex);
|
|
2025
|
+
const response = await callMethod('savePassword', {
|
|
2026
|
+
userIdentifier,
|
|
2027
|
+
accountType,
|
|
2028
|
+
password,
|
|
2029
|
+
changePasswordAtNextLogin: mustChangePassword ? 1 : 0,
|
|
2030
|
+
});
|
|
2031
|
+
returnData.push({
|
|
2032
|
+
json: { success: response },
|
|
2033
|
+
pairedItem: { item: itemIndex },
|
|
2034
|
+
});
|
|
2035
|
+
continue;
|
|
2036
|
+
}
|
|
2037
|
+
if (operation === 'deactivateTwoFactorAuthentication') {
|
|
2038
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2039
|
+
const accountType = this.getNodeParameter('accountType', itemIndex);
|
|
2040
|
+
const response = await callMethod('deactivateTwoFactorAuthentication', {
|
|
2041
|
+
userIdentifier,
|
|
2042
|
+
accountType,
|
|
2043
|
+
});
|
|
2044
|
+
returnData.push({
|
|
2045
|
+
json: { success: response },
|
|
2046
|
+
pairedItem: { item: itemIndex },
|
|
2047
|
+
});
|
|
2048
|
+
continue;
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
if (resource === 'absence') {
|
|
2052
|
+
if (operation === 'getAbsents' || operation === 'getAbsentsWithAlias') {
|
|
2053
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2054
|
+
const schoolYear = this.getNodeParameter('schoolYear', itemIndex);
|
|
2055
|
+
const response = operation === 'getAbsents'
|
|
2056
|
+
? await callMethod('getAbsents', { userIdentifier, schoolYear })
|
|
2057
|
+
: await callMethod('getAbsentsWithAlias', { userIdentifier, schoolYear });
|
|
2058
|
+
normalizeAndPush(response);
|
|
2059
|
+
continue;
|
|
2060
|
+
}
|
|
2061
|
+
if (operation === 'getAbsentsByDate') {
|
|
2062
|
+
const date = this.getNodeParameter('absenceDate', itemIndex);
|
|
2063
|
+
const response = await callMethod('getAbsentsByDate', { date });
|
|
2064
|
+
normalizeAndPush(response);
|
|
2065
|
+
continue;
|
|
2066
|
+
}
|
|
2067
|
+
if (operation === 'getAbsentsWithAliasByDate') {
|
|
2068
|
+
const date = this.getNodeParameter('absenceDate', itemIndex);
|
|
2069
|
+
const response = await callMethod('getAbsentsWithAliasByDate', { date });
|
|
2070
|
+
normalizeAndPush(response);
|
|
2071
|
+
continue;
|
|
2072
|
+
}
|
|
2073
|
+
if (operation === 'getAbsentsWithInternalNumberByDate') {
|
|
2074
|
+
const date = this.getNodeParameter('absenceDate', itemIndex);
|
|
2075
|
+
const response = await callMethod('getAbsentsWithInternalNumberByDate', { date });
|
|
2076
|
+
normalizeAndPush(response);
|
|
2077
|
+
continue;
|
|
2078
|
+
}
|
|
2079
|
+
if (operation === 'getAbsentsWithUsernameByDate') {
|
|
2080
|
+
const date = this.getNodeParameter('absenceDate', itemIndex);
|
|
2081
|
+
const response = await callMethod('getAbsentsWithUsernameByDate', { date });
|
|
2082
|
+
normalizeAndPush(response);
|
|
2083
|
+
continue;
|
|
2084
|
+
}
|
|
2085
|
+
if (operation === 'getAbsentsByDateAndGroup') {
|
|
2086
|
+
const date = this.getNodeParameter('absenceDate', itemIndex);
|
|
2087
|
+
const code = this.getNodeParameter('code', itemIndex);
|
|
2088
|
+
const response = await callMethod('getAbsentsByDateAndGroup', { date, code });
|
|
2089
|
+
normalizeAndPush(response);
|
|
2090
|
+
continue;
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
if (resource === 'course') {
|
|
2094
|
+
if (operation === 'getCourses') {
|
|
2095
|
+
const response = await callMethod('getCourses', {});
|
|
2096
|
+
returnData.push({
|
|
2097
|
+
json: { csv: response },
|
|
2098
|
+
pairedItem: { item: itemIndex },
|
|
2099
|
+
});
|
|
2100
|
+
continue;
|
|
2101
|
+
}
|
|
2102
|
+
if (operation === 'addCourse') {
|
|
2103
|
+
const coursename = this.getNodeParameter('courseName', itemIndex);
|
|
2104
|
+
const coursedesc = this.getNodeParameter('courseCode', itemIndex);
|
|
2105
|
+
const visibility = this.getNodeParameter('courseVisibility', itemIndex);
|
|
2106
|
+
const response = await callMethod('addCourse', { coursename, coursedesc, visibility });
|
|
2107
|
+
returnData.push({
|
|
2108
|
+
json: { success: response },
|
|
2109
|
+
pairedItem: { item: itemIndex },
|
|
2110
|
+
});
|
|
2111
|
+
continue;
|
|
2112
|
+
}
|
|
2113
|
+
if (operation === 'addCourseStudents') {
|
|
2114
|
+
const coursename = this.getNodeParameter('courseName', itemIndex);
|
|
2115
|
+
const coursedesc = this.getNodeParameter('courseCode', itemIndex);
|
|
2116
|
+
const groupIds = this.getNodeParameter('courseGroupIds', itemIndex);
|
|
2117
|
+
const response = await callMethod('addCourseStudents', {
|
|
2118
|
+
coursename,
|
|
2119
|
+
coursedesc,
|
|
2120
|
+
groupIds,
|
|
2121
|
+
});
|
|
2122
|
+
returnData.push({
|
|
2123
|
+
json: { success: response },
|
|
2124
|
+
pairedItem: { item: itemIndex },
|
|
2125
|
+
});
|
|
2126
|
+
continue;
|
|
2127
|
+
}
|
|
2128
|
+
if (operation === 'addCourseTeacher') {
|
|
2129
|
+
const coursename = this.getNodeParameter('courseName', itemIndex);
|
|
2130
|
+
const coursedesc = this.getNodeParameter('courseCode', itemIndex);
|
|
2131
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2132
|
+
const internnummer = this.getNodeParameter('courseTeacherInternNumber', itemIndex);
|
|
2133
|
+
const response = await callMethod('addCourseTeacher', {
|
|
2134
|
+
coursename,
|
|
2135
|
+
coursedesc,
|
|
2136
|
+
internnummer,
|
|
2137
|
+
userlist: userIdentifier,
|
|
2138
|
+
});
|
|
2139
|
+
returnData.push({
|
|
2140
|
+
json: { success: response },
|
|
2141
|
+
pairedItem: { item: itemIndex },
|
|
2142
|
+
});
|
|
2143
|
+
continue;
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
if (resource === 'system') {
|
|
2147
|
+
if (operation === 'startSkoreSync') {
|
|
2148
|
+
const response = await callMethod('startSkoreSync', {});
|
|
2149
|
+
normalizeAndPush(response);
|
|
2150
|
+
continue;
|
|
2151
|
+
}
|
|
2152
|
+
if (operation === 'checkStatus') {
|
|
2153
|
+
const serviceId = this.getNodeParameter('serviceId', itemIndex);
|
|
2154
|
+
const response = await callMethod('checkStatus', { serviceId });
|
|
2155
|
+
normalizeAndPush(response);
|
|
2156
|
+
continue;
|
|
2157
|
+
}
|
|
2158
|
+
if (operation === 'getStudentCareer') {
|
|
2159
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2160
|
+
const response = await callMethod('getStudentCareer', { userIdentifier });
|
|
2161
|
+
normalizeAndPush(response);
|
|
2162
|
+
continue;
|
|
2163
|
+
}
|
|
2164
|
+
if (operation === 'getDeliberationLines') {
|
|
2165
|
+
const dateInSchoolYear = this.getNodeParameter('deliberationDate', itemIndex);
|
|
2166
|
+
const response = await callMethod('getDeliberationLines', { dateInSchoolYear });
|
|
2167
|
+
normalizeAndPush(response);
|
|
2168
|
+
continue;
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
if (resource === 'helpdesk') {
|
|
2172
|
+
if (operation === 'getHelpdeskMiniDbItems') {
|
|
2173
|
+
const response = await callMethod('getHelpdeskMiniDbItems', {});
|
|
2174
|
+
normalizeAndPush(response);
|
|
2175
|
+
continue;
|
|
2176
|
+
}
|
|
2177
|
+
if (operation === 'addHelpdeskTicket') {
|
|
2178
|
+
const title = this.getNodeParameter('title', itemIndex);
|
|
2179
|
+
const description = this.getNodeParameter('ticketDescription', itemIndex);
|
|
2180
|
+
const priority = this.getNodeParameter('priority', itemIndex);
|
|
2181
|
+
const miniDbItem = this.getNodeParameter('miniDbItem', itemIndex);
|
|
2182
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2183
|
+
const response = await callMethod('addHelpdeskTicket', {
|
|
2184
|
+
title,
|
|
2185
|
+
description,
|
|
2186
|
+
priority,
|
|
2187
|
+
miniDbItem,
|
|
2188
|
+
userIdentifier,
|
|
2189
|
+
});
|
|
2190
|
+
returnData.push({
|
|
2191
|
+
json: typeof response === 'object' && response !== null
|
|
2192
|
+
? response
|
|
2193
|
+
: { success: response },
|
|
2194
|
+
pairedItem: { item: itemIndex },
|
|
2195
|
+
});
|
|
2196
|
+
continue;
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
if (resource === 'message' && operation === 'sendMsg') {
|
|
2200
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2201
|
+
const title = this.getNodeParameter('title', itemIndex);
|
|
2202
|
+
const body = this.getNodeParameter('messageBody', itemIndex);
|
|
2203
|
+
const senderIdentifier = this.getNodeParameter('senderIdentifier', itemIndex);
|
|
2204
|
+
const coaccount = this.getNodeParameter('coaccount', itemIndex, 0);
|
|
2205
|
+
const copyToLVS = this.getNodeParameter('copyToLVS', itemIndex, false);
|
|
2206
|
+
const attachmentCollection = this.getNodeParameter('attachments', itemIndex, {});
|
|
2207
|
+
const payload = {
|
|
2208
|
+
userIdentifier,
|
|
2209
|
+
title,
|
|
2210
|
+
body,
|
|
2211
|
+
senderIdentifier,
|
|
2212
|
+
coaccount,
|
|
2213
|
+
copyToLVS,
|
|
2214
|
+
};
|
|
2215
|
+
const attachmentValues = ((_g = attachmentCollection.attachment) !== null && _g !== void 0 ? _g : []);
|
|
2216
|
+
const cleanedAttachments = attachmentValues.filter((entry) => (entry === null || entry === void 0 ? void 0 : entry.filename) && (entry === null || entry === void 0 ? void 0 : entry.filedata));
|
|
2217
|
+
if (cleanedAttachments.length) {
|
|
2218
|
+
payload.attachments = JSON.stringify(cleanedAttachments);
|
|
2219
|
+
}
|
|
2220
|
+
const response = await callMethod('sendMsg', payload);
|
|
2221
|
+
returnData.push({
|
|
2222
|
+
json: { success: response },
|
|
2223
|
+
pairedItem: { item: itemIndex },
|
|
2224
|
+
});
|
|
2225
|
+
continue;
|
|
2226
|
+
}
|
|
2227
|
+
if (resource === 'message' && operation === 'saveSignature') {
|
|
2228
|
+
const userIdentifier = this.getNodeParameter('userIdentifier', itemIndex);
|
|
2229
|
+
const signature = this.getNodeParameter('signature', itemIndex);
|
|
2230
|
+
const accountType = this.getNodeParameter('signatureAccountType', itemIndex);
|
|
2231
|
+
const response = await callMethod('saveSignature', {
|
|
2232
|
+
userIdentifier,
|
|
2233
|
+
accountType,
|
|
2234
|
+
signature,
|
|
2235
|
+
});
|
|
2236
|
+
returnData.push({
|
|
2237
|
+
json: { success: response },
|
|
2238
|
+
pairedItem: { item: itemIndex },
|
|
2239
|
+
});
|
|
2240
|
+
continue;
|
|
2241
|
+
}
|
|
2242
|
+
if (resource === 'parameter' && operation === 'getReferenceField') {
|
|
2243
|
+
const response = await callMethod('getReferenceField', {});
|
|
2244
|
+
normalizeAndPush(response);
|
|
2245
|
+
continue;
|
|
2246
|
+
}
|
|
2247
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported resource "${resource}" or operation "${operation}"`, { itemIndex });
|
|
2248
|
+
}
|
|
2249
|
+
catch (error) {
|
|
2250
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
2251
|
+
if (this.continueOnFail()) {
|
|
2252
|
+
returnData.push({
|
|
2253
|
+
json: {
|
|
2254
|
+
error: errorMessage,
|
|
2255
|
+
},
|
|
2256
|
+
pairedItem: { item: itemIndex },
|
|
2257
|
+
});
|
|
2258
|
+
continue;
|
|
2259
|
+
}
|
|
2260
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
|
2261
|
+
throw error;
|
|
2262
|
+
}
|
|
2263
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), errorMessage, { itemIndex });
|
|
2264
|
+
}
|
|
2265
|
+
}
|
|
2266
|
+
return [returnData];
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
exports.SmartSchool = SmartSchool;
|
|
2270
|
+
//# sourceMappingURL=SmartSchool.node.js.map
|