n8n-nodes-getcourse 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE.md +38 -0
  2. package/README.md +359 -0
  3. package/dist/credentials/GetCourseApi.credentials.d.ts +10 -0
  4. package/dist/credentials/GetCourseApi.credentials.js +58 -0
  5. package/dist/credentials/GetCourseApi.credentials.js.map +1 -0
  6. package/dist/credentials/GetCourseTechApi.credentials.d.ts +11 -0
  7. package/dist/credentials/GetCourseTechApi.credentials.js +63 -0
  8. package/dist/credentials/GetCourseTechApi.credentials.js.map +1 -0
  9. package/dist/credentials/accountAddress.d.ts +11 -0
  10. package/dist/credentials/accountAddress.js +116 -0
  11. package/dist/credentials/accountAddress.js.map +1 -0
  12. package/dist/icons/getcourse.dark.svg +15 -0
  13. package/dist/icons/getcourse.svg +11 -0
  14. package/dist/nodes/GetCourse/GetCourse.node.d.ts +9 -0
  15. package/dist/nodes/GetCourse/GetCourse.node.js +48 -0
  16. package/dist/nodes/GetCourse/GetCourse.node.js.map +1 -0
  17. package/dist/nodes/GetCourse/GetCourse.node.json +40 -0
  18. package/dist/nodes/GetCourse/v1/actions/call/index.d.ts +3 -0
  19. package/dist/nodes/GetCourse/v1/actions/call/index.js +98 -0
  20. package/dist/nodes/GetCourse/v1/actions/call/index.js.map +1 -0
  21. package/dist/nodes/GetCourse/v1/actions/deal/description.d.ts +2 -0
  22. package/dist/nodes/GetCourse/v1/actions/deal/description.js +261 -0
  23. package/dist/nodes/GetCourse/v1/actions/deal/description.js.map +1 -0
  24. package/dist/nodes/GetCourse/v1/actions/deal/execute.d.ts +2 -0
  25. package/dist/nodes/GetCourse/v1/actions/deal/execute.js +181 -0
  26. package/dist/nodes/GetCourse/v1/actions/deal/execute.js.map +1 -0
  27. package/dist/nodes/GetCourse/v1/actions/deal/index.d.ts +2 -0
  28. package/dist/nodes/GetCourse/v1/actions/deal/index.js +8 -0
  29. package/dist/nodes/GetCourse/v1/actions/deal/index.js.map +1 -0
  30. package/dist/nodes/GetCourse/v1/actions/dialog/index.d.ts +3 -0
  31. package/dist/nodes/GetCourse/v1/actions/dialog/index.js +262 -0
  32. package/dist/nodes/GetCourse/v1/actions/dialog/index.js.map +1 -0
  33. package/dist/nodes/GetCourse/v1/actions/helpdesk/index.d.ts +3 -0
  34. package/dist/nodes/GetCourse/v1/actions/helpdesk/index.js +305 -0
  35. package/dist/nodes/GetCourse/v1/actions/helpdesk/index.js.map +1 -0
  36. package/dist/nodes/GetCourse/v1/actions/index.d.ts +5 -0
  37. package/dist/nodes/GetCourse/v1/actions/index.js +119 -0
  38. package/dist/nodes/GetCourse/v1/actions/index.js.map +1 -0
  39. package/dist/nodes/GetCourse/v1/actions/lesson/index.d.ts +3 -0
  40. package/dist/nodes/GetCourse/v1/actions/lesson/index.js +180 -0
  41. package/dist/nodes/GetCourse/v1/actions/lesson/index.js.map +1 -0
  42. package/dist/nodes/GetCourse/v1/actions/offer/index.d.ts +3 -0
  43. package/dist/nodes/GetCourse/v1/actions/offer/index.js +98 -0
  44. package/dist/nodes/GetCourse/v1/actions/offer/index.js.map +1 -0
  45. package/dist/nodes/GetCourse/v1/actions/school/index.d.ts +3 -0
  46. package/dist/nodes/GetCourse/v1/actions/school/index.js +139 -0
  47. package/dist/nodes/GetCourse/v1/actions/school/index.js.map +1 -0
  48. package/dist/nodes/GetCourse/v1/actions/user/description.d.ts +2 -0
  49. package/dist/nodes/GetCourse/v1/actions/user/description.js +499 -0
  50. package/dist/nodes/GetCourse/v1/actions/user/description.js.map +1 -0
  51. package/dist/nodes/GetCourse/v1/actions/user/execute.d.ts +2 -0
  52. package/dist/nodes/GetCourse/v1/actions/user/execute.js +270 -0
  53. package/dist/nodes/GetCourse/v1/actions/user/execute.js.map +1 -0
  54. package/dist/nodes/GetCourse/v1/actions/user/index.d.ts +2 -0
  55. package/dist/nodes/GetCourse/v1/actions/user/index.js +8 -0
  56. package/dist/nodes/GetCourse/v1/actions/user/index.js.map +1 -0
  57. package/dist/nodes/GetCourse/v1/actions/webhook/index.d.ts +4 -0
  58. package/dist/nodes/GetCourse/v1/actions/webhook/index.js +179 -0
  59. package/dist/nodes/GetCourse/v1/actions/webhook/index.js.map +1 -0
  60. package/dist/nodes/GetCourse/v1/actions/webinar/index.d.ts +3 -0
  61. package/dist/nodes/GetCourse/v1/actions/webinar/index.js +376 -0
  62. package/dist/nodes/GetCourse/v1/actions/webinar/index.js.map +1 -0
  63. package/dist/nodes/GetCourse/v1/descriptions/common.d.ts +7 -0
  64. package/dist/nodes/GetCourse/v1/descriptions/common.js +142 -0
  65. package/dist/nodes/GetCourse/v1/descriptions/common.js.map +1 -0
  66. package/dist/nodes/GetCourse/v1/helpers/errors.d.ts +11 -0
  67. package/dist/nodes/GetCourse/v1/helpers/errors.js +90 -0
  68. package/dist/nodes/GetCourse/v1/helpers/errors.js.map +1 -0
  69. package/dist/nodes/GetCourse/v1/helpers/request.d.ts +7 -0
  70. package/dist/nodes/GetCourse/v1/helpers/request.js +79 -0
  71. package/dist/nodes/GetCourse/v1/helpers/request.js.map +1 -0
  72. package/dist/nodes/GetCourse/v1/methods/index.d.ts +2 -0
  73. package/dist/nodes/GetCourse/v1/methods/index.js +39 -0
  74. package/dist/nodes/GetCourse/v1/methods/index.js.map +1 -0
  75. package/dist/nodes/GetCourse/v1/methods/loadOptions.d.ts +7 -0
  76. package/dist/nodes/GetCourse/v1/methods/loadOptions.js +76 -0
  77. package/dist/nodes/GetCourse/v1/methods/loadOptions.js.map +1 -0
  78. package/dist/nodes/GetCourse/v1/transport/index.d.ts +18 -0
  79. package/dist/nodes/GetCourse/v1/transport/index.js +165 -0
  80. package/dist/nodes/GetCourse/v1/transport/index.js.map +1 -0
  81. package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.d.ts +9 -0
  82. package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.js +48 -0
  83. package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.js.map +1 -0
  84. package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.json +35 -0
  85. package/dist/nodes/GetCourseLegacy/v1/actions/deal/description.d.ts +2 -0
  86. package/dist/nodes/GetCourseLegacy/v1/actions/deal/description.js +287 -0
  87. package/dist/nodes/GetCourseLegacy/v1/actions/deal/description.js.map +1 -0
  88. package/dist/nodes/GetCourseLegacy/v1/actions/deal/execute.d.ts +2 -0
  89. package/dist/nodes/GetCourseLegacy/v1/actions/deal/execute.js +150 -0
  90. package/dist/nodes/GetCourseLegacy/v1/actions/deal/execute.js.map +1 -0
  91. package/dist/nodes/GetCourseLegacy/v1/actions/deal/index.d.ts +2 -0
  92. package/dist/nodes/GetCourseLegacy/v1/actions/deal/index.js +8 -0
  93. package/dist/nodes/GetCourseLegacy/v1/actions/deal/index.js.map +1 -0
  94. package/dist/nodes/GetCourseLegacy/v1/actions/export/description.d.ts +2 -0
  95. package/dist/nodes/GetCourseLegacy/v1/actions/export/description.js +487 -0
  96. package/dist/nodes/GetCourseLegacy/v1/actions/export/description.js.map +1 -0
  97. package/dist/nodes/GetCourseLegacy/v1/actions/export/execute.d.ts +2 -0
  98. package/dist/nodes/GetCourseLegacy/v1/actions/export/execute.js +252 -0
  99. package/dist/nodes/GetCourseLegacy/v1/actions/export/execute.js.map +1 -0
  100. package/dist/nodes/GetCourseLegacy/v1/actions/export/index.d.ts +2 -0
  101. package/dist/nodes/GetCourseLegacy/v1/actions/export/index.js +8 -0
  102. package/dist/nodes/GetCourseLegacy/v1/actions/export/index.js.map +1 -0
  103. package/dist/nodes/GetCourseLegacy/v1/actions/field/index.d.ts +3 -0
  104. package/dist/nodes/GetCourseLegacy/v1/actions/field/index.js +61 -0
  105. package/dist/nodes/GetCourseLegacy/v1/actions/field/index.js.map +1 -0
  106. package/dist/nodes/GetCourseLegacy/v1/actions/group/index.d.ts +3 -0
  107. package/dist/nodes/GetCourseLegacy/v1/actions/group/index.js +42 -0
  108. package/dist/nodes/GetCourseLegacy/v1/actions/group/index.js.map +1 -0
  109. package/dist/nodes/GetCourseLegacy/v1/actions/index.d.ts +5 -0
  110. package/dist/nodes/GetCourseLegacy/v1/actions/index.js +84 -0
  111. package/dist/nodes/GetCourseLegacy/v1/actions/index.js.map +1 -0
  112. package/dist/nodes/GetCourseLegacy/v1/actions/user/description.d.ts +2 -0
  113. package/dist/nodes/GetCourseLegacy/v1/actions/user/description.js +87 -0
  114. package/dist/nodes/GetCourseLegacy/v1/actions/user/description.js.map +1 -0
  115. package/dist/nodes/GetCourseLegacy/v1/actions/user/execute.d.ts +5 -0
  116. package/dist/nodes/GetCourseLegacy/v1/actions/user/execute.js +129 -0
  117. package/dist/nodes/GetCourseLegacy/v1/actions/user/execute.js.map +1 -0
  118. package/dist/nodes/GetCourseLegacy/v1/actions/user/index.d.ts +2 -0
  119. package/dist/nodes/GetCourseLegacy/v1/actions/user/index.js +8 -0
  120. package/dist/nodes/GetCourseLegacy/v1/actions/user/index.js.map +1 -0
  121. package/dist/nodes/GetCourseLegacy/v1/descriptions/common.d.ts +14 -0
  122. package/dist/nodes/GetCourseLegacy/v1/descriptions/common.js +198 -0
  123. package/dist/nodes/GetCourseLegacy/v1/descriptions/common.js.map +1 -0
  124. package/dist/nodes/GetCourseLegacy/v1/descriptions/constants.d.ts +7 -0
  125. package/dist/nodes/GetCourseLegacy/v1/descriptions/constants.js +116 -0
  126. package/dist/nodes/GetCourseLegacy/v1/descriptions/constants.js.map +1 -0
  127. package/dist/nodes/GetCourseLegacy/v1/helpers/errors.d.ts +18 -0
  128. package/dist/nodes/GetCourseLegacy/v1/helpers/errors.js +141 -0
  129. package/dist/nodes/GetCourseLegacy/v1/helpers/errors.js.map +1 -0
  130. package/dist/nodes/GetCourseLegacy/v1/helpers/exportRows.d.ts +8 -0
  131. package/dist/nodes/GetCourseLegacy/v1/helpers/exportRows.js +100 -0
  132. package/dist/nodes/GetCourseLegacy/v1/helpers/exportRows.js.map +1 -0
  133. package/dist/nodes/GetCourseLegacy/v1/methods/index.d.ts +2 -0
  134. package/dist/nodes/GetCourseLegacy/v1/methods/index.js +39 -0
  135. package/dist/nodes/GetCourseLegacy/v1/methods/index.js.map +1 -0
  136. package/dist/nodes/GetCourseLegacy/v1/methods/loadOptions.d.ts +5 -0
  137. package/dist/nodes/GetCourseLegacy/v1/methods/loadOptions.js +92 -0
  138. package/dist/nodes/GetCourseLegacy/v1/methods/loadOptions.js.map +1 -0
  139. package/dist/nodes/GetCourseLegacy/v1/transport/index.d.ts +13 -0
  140. package/dist/nodes/GetCourseLegacy/v1/transport/index.js +204 -0
  141. package/dist/nodes/GetCourseLegacy/v1/transport/index.js.map +1 -0
  142. package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.d.ts +12 -0
  143. package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.js +339 -0
  144. package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.js.map +1 -0
  145. package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.json +32 -0
  146. package/dist/nodes/GetCourseTrigger/payload.d.ts +14 -0
  147. package/dist/nodes/GetCourseTrigger/payload.js +66 -0
  148. package/dist/nodes/GetCourseTrigger/payload.js.map +1 -0
  149. package/dist/utils/cache.d.ts +2 -0
  150. package/dist/utils/cache.js +27 -0
  151. package/dist/utils/cache.js.map +1 -0
  152. package/dist/utils/dates.d.ts +3 -0
  153. package/dist/utils/dates.js +70 -0
  154. package/dist/utils/dates.js.map +1 -0
  155. package/dist/utils/events.d.ts +14 -0
  156. package/dist/utils/events.js +92 -0
  157. package/dist/utils/events.js.map +1 -0
  158. package/dist/utils/httpError.d.ts +4 -0
  159. package/dist/utils/httpError.js +46 -0
  160. package/dist/utils/httpError.js.map +1 -0
  161. package/dist/utils/query.d.ts +4 -0
  162. package/dist/utils/query.js +42 -0
  163. package/dist/utils/query.js.map +1 -0
  164. package/dist/utils/rateLimiter.d.ts +3 -0
  165. package/dist/utils/rateLimiter.js +44 -0
  166. package/dist/utils/rateLimiter.js.map +1 -0
  167. package/dist/utils/router.d.ts +8 -0
  168. package/dist/utils/router.js +40 -0
  169. package/dist/utils/router.js.map +1 -0
  170. package/index.js +0 -0
  171. package/package.json +68 -0
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = execute;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const dates_1 = require("../../../../../utils/dates");
6
+ const query_1 = require("../../../../../utils/query");
7
+ const router_1 = require("../../../../../utils/router");
8
+ const request_1 = require("../../helpers/request");
9
+ const transport_1 = require("../../transport");
10
+ function readRows(data) {
11
+ if (data === null || data === undefined)
12
+ return [];
13
+ if (Array.isArray(data) && data.length === 0)
14
+ return [];
15
+ return (0, request_1.toItems)(data, {}).map((json) => ({ json }));
16
+ }
17
+ function writeRows(data, detail) {
18
+ if (Array.isArray(data) && data.length > 0 && data.every((entry) => typeof entry === 'string')) {
19
+ return [{ json: { success: true, ...detail, messages: data } }];
20
+ }
21
+ return (0, request_1.toItems)(data, { success: true, ...detail }).map((json) => ({ json }));
22
+ }
23
+ const IDENTIFIED_READS = {
24
+ get: '/user/get-fields',
25
+ getCustomFields: '/user/get-custom-fields',
26
+ getDeals: '/user/get-deals',
27
+ getDiplomas: '/user/get-diplomas',
28
+ getGoals: '/user/get-goal-records',
29
+ getGroups: '/user/get-groups',
30
+ getLessonAnswers: '/user/get-lesson-answers',
31
+ getSchedule: '/user/get-schedule',
32
+ getSurveyAnswers: '/user/get-answers',
33
+ getTrainings: '/user/get-trainings',
34
+ };
35
+ const GROUP_WRITES = {
36
+ addToGroups: '/user/add-groups',
37
+ removeFromGroups: '/user/remove-groups',
38
+ setGroups: '/user/set-groups',
39
+ };
40
+ const PAGED_READS = {
41
+ getDialogs: '/user/get-dialogs',
42
+ getHelpdeskDialogs: '/user/get-helpdesk-dialogs',
43
+ };
44
+ async function getBalance(itemIndex) {
45
+ const type = this.getNodeParameter('balanceType', itemIndex, 'virtual');
46
+ const data = await transport_1.techApiRequest.call(this, 'GET', '/user/get-balance', undefined, {
47
+ ...request_1.userIdentifier.call(this, itemIndex),
48
+ type,
49
+ });
50
+ return readRows(data);
51
+ }
52
+ async function getPurchases(itemIndex) {
53
+ var _a;
54
+ const productId = String((_a = this.getNodeParameter('productId', itemIndex, '')) !== null && _a !== void 0 ? _a : '').trim();
55
+ const data = await transport_1.techApiRequest.call(this, 'GET', '/user/get-purchases', undefined, {
56
+ ...request_1.userIdentifier.call(this, itemIndex),
57
+ productId,
58
+ });
59
+ return readRows(data);
60
+ }
61
+ async function getPaged(itemIndex, endpoint) {
62
+ const returnAll = this.getNodeParameter('returnAll', itemIndex, false);
63
+ const limit = this.getNodeParameter('limit', itemIndex, 50);
64
+ const rows = await transport_1.techApiRequestAllItems.call(this, endpoint, request_1.userIdentifier.call(this, itemIndex), { limit: returnAll ? undefined : Math.max(1, limit), pageSize: 100 });
65
+ return rows.map((json) => ({ json }));
66
+ }
67
+ function chatIdParameter(itemIndex) {
68
+ var _a;
69
+ const raw = String((_a = this.getNodeParameter('chatId', itemIndex, '')) !== null && _a !== void 0 ? _a : '').trim();
70
+ if (raw === '') {
71
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No chat named', {
72
+ description: 'Give the numeric chat ID the messenger bot reports for this conversation.',
73
+ itemIndex,
74
+ });
75
+ }
76
+ const numeric = Number(raw);
77
+ return Number.isFinite(numeric) ? numeric : raw;
78
+ }
79
+ async function updateUser(itemIndex) {
80
+ const fields = this.getNodeParameter('updateFields', itemIndex, {});
81
+ const clear = this.getNodeParameter('clearFields', itemIndex, []);
82
+ const updates = (0, query_1.omitEmpty)({
83
+ gender: fields.gender,
84
+ country: fields.country,
85
+ city: fields.city,
86
+ first_name: fields.first_name,
87
+ last_name: fields.last_name,
88
+ birthday: (0, dates_1.toGetCourseDate)(fields.birthday, this.getTimezone()),
89
+ comment: fields.comment,
90
+ phone: fields.phone,
91
+ });
92
+ for (const field of clear)
93
+ updates[field] = null;
94
+ if (Object.keys(updates).length === 0) {
95
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Nothing to update', {
96
+ description: 'Add at least one field to Update Fields, or name one under Fields to Clear.',
97
+ itemIndex,
98
+ });
99
+ }
100
+ const identifier = request_1.userIdentifier.call(this, itemIndex);
101
+ if (identifier.phone !== undefined && 'phone' in updates) {
102
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'A phone number cannot be both the identifier and the new value', {
103
+ description: 'Identify the user by ID or e-mail when the operation writes or clears the phone number — the request has a single phone key, so one of the two values would silently replace the other.',
104
+ itemIndex,
105
+ });
106
+ }
107
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/user/update-fields', {
108
+ ...identifier,
109
+ ...updates,
110
+ });
111
+ return writeRows(data, { ...identifier, updated: updates });
112
+ }
113
+ async function updateCustomFields(itemIndex) {
114
+ const customFields = request_1.customFieldsPayload.call(this, itemIndex);
115
+ if (Object.keys(customFields).length === 0) {
116
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No custom fields to write', {
117
+ description: "Add at least one row with the field's numeric ID. The Tech API publishes no listing of those IDs; the GetCourse Legacy node's Custom Field resource does.",
118
+ itemIndex,
119
+ });
120
+ }
121
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/user/update-custom-fields', {
122
+ ...request_1.userIdentifier.call(this, itemIndex),
123
+ customFields,
124
+ });
125
+ return writeRows(data, { customFields });
126
+ }
127
+ async function writeGroups(itemIndex, operation, endpoint) {
128
+ const supplied = this.getNodeParameter('groups', itemIndex, []);
129
+ const groups = supplied.map((group) => Number(group)).filter((group) => Number.isFinite(group));
130
+ if (supplied.length > 0 && groups.length === 0) {
131
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'None of the groups given is an ID', {
132
+ description: `Received ${JSON.stringify(supplied)}. This field takes numeric group IDs — the School ` +
133
+ "resource's Get Many Groups operation maps names onto them. Sending nothing here would " +
134
+ 'have been read as an instruction to remove every group the user belongs to.',
135
+ itemIndex,
136
+ });
137
+ }
138
+ if (groups.length === 0 && operation !== 'setGroups') {
139
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No groups named', {
140
+ description: 'Pick at least one group, or use Set Groups to clear every membership.',
141
+ itemIndex,
142
+ });
143
+ }
144
+ const identifier = request_1.userIdentifier.call(this, itemIndex);
145
+ const data = await transport_1.techApiRequest.call(this, 'POST', endpoint, { ...identifier, groups });
146
+ return writeRows(data, { ...identifier, groups });
147
+ }
148
+ async function addBalance(itemIndex) {
149
+ var _a;
150
+ const value = this.getNodeParameter('amount', itemIndex, 0);
151
+ const type = this.getNodeParameter('addBalanceType', itemIndex, 'virtual');
152
+ const comment = String((_a = this.getNodeParameter('balanceComment', itemIndex, '')) !== null && _a !== void 0 ? _a : '');
153
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/user/add-balance', {
154
+ ...request_1.userIdentifier.call(this, itemIndex),
155
+ value,
156
+ type,
157
+ comment,
158
+ });
159
+ return writeRows(data, { value, type });
160
+ }
161
+ async function setPersonalManager(itemIndex) {
162
+ const raw = this.getNodeParameter('managerId', itemIndex, '');
163
+ const managerId = String(raw !== null && raw !== void 0 ? raw : '').trim();
164
+ const identifier = request_1.userIdentifier.call(this, itemIndex);
165
+ if (managerId !== '' && !Number.isFinite(Number(managerId))) {
166
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `"${managerId}" is not a manager ID`, {
167
+ description: 'Pick a manager from the list, or give a numeric ID. Leave the field empty to remove the personal manager — a value that is neither is refused, because it would reach GetCourse as a removal.',
168
+ itemIndex,
169
+ });
170
+ }
171
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/user/set-personal-manager', {
172
+ ...identifier,
173
+ managerId: managerId === '' ? '' : Number(managerId),
174
+ });
175
+ return writeRows(data, {
176
+ ...identifier,
177
+ managerId: managerId === '' ? null : Number(managerId),
178
+ removed: managerId === '',
179
+ });
180
+ }
181
+ async function createDiploma(itemIndex) {
182
+ var _a;
183
+ const templateId = String((_a = this.getNodeParameter('templateId', itemIndex, '')) !== null && _a !== void 0 ? _a : '').trim();
184
+ if (templateId === '') {
185
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No diploma template named', {
186
+ description: 'Give the numeric template ID. Nothing in the Tech API lists templates, so it has to be read from the account.',
187
+ itemIndex,
188
+ });
189
+ }
190
+ const fields = this.getNodeParameter('diplomaFields', itemIndex, {});
191
+ const body = {
192
+ ...request_1.userIdentifier.call(this, itemIndex),
193
+ templateId: Number(templateId),
194
+ ...(0, query_1.omitEmpty)({
195
+ number: fields.number,
196
+ trainingName: fields.trainingName,
197
+ userName: fields.userName,
198
+ }),
199
+ };
200
+ if (fields.allowDuplicates !== undefined)
201
+ body.allowDuplicates = fields.allowDuplicates === true;
202
+ if (fields.sendNotify !== undefined)
203
+ body.sendNotify = fields.sendNotify === true;
204
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/user/create-diploma', body);
205
+ return writeRows(data, { templateId: Number(templateId) });
206
+ }
207
+ async function addComment(itemIndex) {
208
+ var _a, _b, _c;
209
+ const userId = String((_a = this.getNodeParameter('commentUserId', itemIndex, '')) !== null && _a !== void 0 ? _a : '').trim();
210
+ const authorId = String((_b = this.getNodeParameter('authorId', itemIndex, '')) !== null && _b !== void 0 ? _b : '').trim();
211
+ const text = String((_c = this.getNodeParameter('text', itemIndex, '')) !== null && _c !== void 0 ? _c : '');
212
+ if (userId === '' || authorId === '' || text === '') {
213
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'A comment needs a user, an author and text', {
214
+ description: 'This endpoint takes numeric IDs only — no e-mail and no phone number. The author is the employee the comment is written as, and Get Many Personal Managers on the School resource lists the IDs.',
215
+ itemIndex,
216
+ });
217
+ }
218
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/user/add-comment', {
219
+ userId: Number(userId),
220
+ authorId: Number(authorId),
221
+ text,
222
+ });
223
+ return writeRows(data, { userId: Number(userId), authorId: Number(authorId) });
224
+ }
225
+ async function execute(operation, itemIndex) {
226
+ const read = IDENTIFIED_READS[operation];
227
+ if (read !== undefined) {
228
+ const data = await transport_1.techApiRequest.call(this, 'GET', read, undefined, request_1.userIdentifier.call(this, itemIndex));
229
+ return readRows(data);
230
+ }
231
+ const paged = PAGED_READS[operation];
232
+ if (paged !== undefined)
233
+ return await getPaged.call(this, itemIndex, paged);
234
+ const groupWrite = GROUP_WRITES[operation];
235
+ if (groupWrite !== undefined) {
236
+ return await writeGroups.call(this, itemIndex, operation, groupWrite);
237
+ }
238
+ switch (operation) {
239
+ case 'getBalance':
240
+ return await getBalance.call(this, itemIndex);
241
+ case 'getPurchases':
242
+ return await getPurchases.call(this, itemIndex);
243
+ case 'getByChatId': {
244
+ const data = await transport_1.techApiRequest.call(this, 'GET', '/user/get-user-by-chat-id', undefined, {
245
+ messengerType: this.getNodeParameter('messengerType', itemIndex, 'tg'),
246
+ chatId: chatIdParameter.call(this, itemIndex),
247
+ });
248
+ return readRows(data);
249
+ }
250
+ case 'getByTelegramChatId': {
251
+ const data = await transport_1.techApiRequest.call(this, 'GET', '/user/get-user-by-telegram-chat-id', undefined, { chatId: chatIdParameter.call(this, itemIndex) });
252
+ return readRows(data);
253
+ }
254
+ case 'update':
255
+ return await updateUser.call(this, itemIndex);
256
+ case 'updateCustomFields':
257
+ return await updateCustomFields.call(this, itemIndex);
258
+ case 'addBalance':
259
+ return await addBalance.call(this, itemIndex);
260
+ case 'setPersonalManager':
261
+ return await setPersonalManager.call(this, itemIndex);
262
+ case 'createDiploma':
263
+ return await createDiploma.call(this, itemIndex);
264
+ case 'addComment':
265
+ return await addComment.call(this, itemIndex);
266
+ default:
267
+ throw router_1.unknownOperation.call(this, 'user', operation, itemIndex);
268
+ }
269
+ }
270
+ //# sourceMappingURL=execute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../nodes/GetCourse/v1/actions/user/execute.ts"],"names":[],"mappings":";;AA+YA,0BAiEC;AA/cD,+CAAkD;AAElD,sDAA6D;AAC7D,sDAAuD;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S,EACT,EAAE,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CACjD,CAAC;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QACD,KAAK,QAAQ;YACZ,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/C,KAAK,oBAAoB;YACxB,OAAO,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACvD,KAAK,YAAY;YAChB,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/C,KAAK,oBAAoB;YACxB,OAAO,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACvD,KAAK,eAAe;YACnB,OAAO,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAClD,KAAK,YAAY;YAChB,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC/C;YACC,MAAM,yBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAClE,CAAC;AACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { description } from './description';
2
+ export { execute } from './execute';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.execute = exports.description = void 0;
4
+ var description_1 = require("./description");
5
+ Object.defineProperty(exports, "description", { enumerable: true, get: function () { return description_1.description; } });
6
+ var execute_1 = require("./execute");
7
+ Object.defineProperty(exports, "execute", { enumerable: true, get: function () { return execute_1.execute; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/GetCourse/v1/actions/user/index.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
@@ -0,0 +1,4 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeProperties, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare const WEBHOOK_EVENTS: INodePropertyOptions[];
3
+ export declare const description: INodeProperties[];
4
+ export declare function execute(this: IExecuteFunctions, operation: string, itemIndex: number): Promise<INodeExecutionData[]>;
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = exports.WEBHOOK_EVENTS = void 0;
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const request_1 = require("../../helpers/request");
7
+ const router_1 = require("../../../../../utils/router");
8
+ const transport_1 = require("../../transport");
9
+ const showFor = (operations) => ({
10
+ show: { resource: ['webhook'], operation: operations },
11
+ });
12
+ exports.WEBHOOK_EVENTS = [
13
+ {
14
+ name: 'New Dialog (Новый диалог)',
15
+ value: '1:1',
16
+ description: 'Входящие: создан новый диалог по сообщению ученика',
17
+ },
18
+ {
19
+ name: 'Dialog Reopened (Диалог переоткрыт)',
20
+ value: '1:2',
21
+ description: 'Входящие: переоткрыт закрытый диалог по сообщению ученика',
22
+ },
23
+ {
24
+ name: 'Message From Student (Сообщение от ученика)',
25
+ value: '1:3',
26
+ description: 'Входящие: поступило новое сообщение от ученика — событие есть в описании метода, схемы запроса в спецификации у него нет',
27
+ },
28
+ {
29
+ name: 'Message From Staff (Сообщение от сотрудника)',
30
+ value: '1:4',
31
+ description: 'Входящие: поступило новое сообщение от сотрудника',
32
+ },
33
+ {
34
+ name: 'Order Created (Заказ создан)',
35
+ value: '2:1',
36
+ description: 'Заказы: создан новый заказ',
37
+ },
38
+ {
39
+ name: 'Order Status Changed (Смена статуса заказа)',
40
+ value: '2:2',
41
+ description: 'Заказы: в заказе поменялся статус',
42
+ },
43
+ {
44
+ name: 'Order Paid (Заказ оплачен)',
45
+ value: '2:3',
46
+ description: 'Заказы: заказ оплачен',
47
+ },
48
+ {
49
+ name: 'Lesson Answer Added (Добавлен ответ на урок)',
50
+ value: '4:1',
51
+ description: 'Комментарии к урокам: добавлен ответ на урок — событие есть в описании метода, схемы запроса в спецификации у него нет',
52
+ },
53
+ {
54
+ name: 'Comment on Answer Added (Добавлен комментарий к ответу)',
55
+ value: '5:1',
56
+ description: 'Комментарии к ответам: добавлен комментарий к ответу — событие есть в описании метода, схемы запроса в спецификации у него нет',
57
+ },
58
+ {
59
+ name: 'Webinar Comments (Комментарии вебинара)',
60
+ value: '7:1',
61
+ description: 'Комментарии вебинаров: новые комментарии от зрителей — схемы запроса в спецификации нет, но ID комментария для модерации взять больше неоткуда',
62
+ },
63
+ {
64
+ name: 'New Calls (Новые звонки)',
65
+ value: '8:1',
66
+ description: 'Звонки: новые звонки — схемы запроса в спецификации нет, но ID звонка для комментария и расшифровки взять больше неоткуда',
67
+ },
68
+ {
69
+ name: 'HelpDesk Ticket Created (Новый тикет HelpDesk)',
70
+ value: '9:1',
71
+ description: 'HelpDesk: создан новый тикет по сообщению клиента',
72
+ },
73
+ {
74
+ name: 'HelpDesk Message From Client (Сообщение от клиента)',
75
+ value: '9:2',
76
+ description: 'HelpDesk: поступило новое сообщение от клиента',
77
+ },
78
+ {
79
+ name: 'HelpDesk Message From Staff (Сообщение от сотрудника)',
80
+ value: '9:3',
81
+ description: 'HelpDesk: поступило новое сообщение от сотрудника',
82
+ },
83
+ ];
84
+ exports.description = [
85
+ {
86
+ displayName: 'Operation',
87
+ name: 'operation',
88
+ type: 'options',
89
+ noDataExpression: true,
90
+ default: 'subscribe',
91
+ displayOptions: { show: { resource: ['webhook'] } },
92
+ options: [
93
+ {
94
+ name: 'Subscribe',
95
+ value: 'subscribe',
96
+ action: 'Subscribe a URL to an event',
97
+ description: 'Подписать адрес на событие: с этого момента GetCourse шлёт на него POST. One address per event, so this replaces whatever that event pointed at before, without saying what it displaced. The nine event schemas in the API reference describe this subscription request and not the payload that will be delivered.',
98
+ },
99
+ {
100
+ name: 'Unsubscribe',
101
+ value: 'unsubscribe',
102
+ action: 'Unsubscribe a URL from an event',
103
+ description: 'Отписать адрес от события — тот же вызов с subscribe: 0. The URL has to be repeated exactly as it was subscribed, down to the trailing slash, because there is no subscription ID and no way to list what is currently subscribed.',
104
+ },
105
+ ],
106
+ },
107
+ {
108
+ displayName: 'Один вызов подписывает ровно одно событие: чтобы получать несколько, вызовите узел несколько раз. Подписка принадлежит ключу разработчика, а не воркфлоу — удаление воркфлоу её не снимает, и увидеть список подписок в API нельзя, так что отписываться нужно явно и тем же адресом. The GetCourse Trigger node in this package makes and removes exactly this subscription by itself, so reach for this resource only when the trigger cannot: an address outside n8n, or a subscription somebody registered earlier and now wants inspected or cleared. На событие приходится один адрес: subscribing here replaces whatever that event already pointed at, a running GetCourse Trigger included. GetCourse answers success either way and lists nothing, so the trigger goes on reporting healthy while receiving nothing — deactivating and reactivating its workflow re-subscribes it.',
109
+ name: 'webhookNotice',
110
+ type: 'notice',
111
+ default: '',
112
+ displayOptions: { show: { resource: ['webhook'] } },
113
+ },
114
+ {
115
+ displayName: 'Event',
116
+ name: 'event',
117
+ type: 'options',
118
+ default: '2:3',
119
+ options: exports.WEBHOOK_EVENTS,
120
+ displayOptions: showFor(['subscribe', 'unsubscribe']),
121
+ description: "Какое событие подписываем. The value is the API's own pair, written «event_object_id:event_id», so an expression can name an event this list does not carry.",
122
+ },
123
+ {
124
+ displayName: 'URL',
125
+ name: 'url',
126
+ type: 'string',
127
+ default: '',
128
+ required: true,
129
+ placeholder: 'https://example.com/getcourse',
130
+ displayOptions: showFor(['subscribe', 'unsubscribe']),
131
+ description: 'Адрес, на который GetCourse будет слать POST с событием — поле uri в запросе. The delivery carries no signature and no shared secret of any kind, so the address itself is the only thing keeping the events private; the same address, character for character, is what an unsubscribe has to name.',
132
+ },
133
+ ];
134
+ function eventPair(event, itemIndex) {
135
+ const parts = event.split(':');
136
+ const [objectId, eventId] = parts.map((part) => (part.trim() === '' ? NaN : Number(part.trim())));
137
+ if (parts.length !== 2 || !Number.isInteger(objectId) || !Number.isInteger(eventId)) {
138
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `"${event}" is not a GetCourse event`, {
139
+ description: 'An event is written as event_object_id:event_id — 2:3, for example, is «Заказ оплачен».',
140
+ itemIndex,
141
+ });
142
+ }
143
+ return [objectId, eventId];
144
+ }
145
+ async function setUri(subscribe, itemIndex) {
146
+ var _a, _b, _c, _d;
147
+ const url = String((_a = this.getNodeParameter('url', itemIndex, '')) !== null && _a !== void 0 ? _a : '').trim();
148
+ if (url === '') {
149
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No URL given', {
150
+ description: 'Give the full address GetCourse should post to, scheme included — an unsubscribe must repeat the address it was subscribed with.',
151
+ itemIndex,
152
+ });
153
+ }
154
+ const event = String((_b = this.getNodeParameter('event', itemIndex, '')) !== null && _b !== void 0 ? _b : '').trim();
155
+ const [objectId, eventId] = eventPair.call(this, event, itemIndex);
156
+ const data = await transport_1.techApiRequest.call(this, 'POST', '/set-uri', {
157
+ uri: url,
158
+ event_object_id: objectId,
159
+ event_id: eventId,
160
+ subscribe,
161
+ });
162
+ const echo = {
163
+ subscribed: subscribe === 1,
164
+ uri: url,
165
+ event,
166
+ event_object_id: objectId,
167
+ event_id: eventId,
168
+ event_name: (_d = (_c = exports.WEBHOOK_EVENTS.find((option) => option.value === event)) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : event,
169
+ };
170
+ return (0, request_1.toItems)(data, {}).map((row) => ({ json: { ...echo, ...row } }));
171
+ }
172
+ async function execute(operation, itemIndex) {
173
+ if (operation === 'subscribe')
174
+ return await setUri.call(this, 1, itemIndex);
175
+ if (operation === 'unsubscribe')
176
+ return await setUri.call(this, 0, itemIndex);
177
+ throw router_1.unknownOperation.call(this, 'webhook', operation, itemIndex);
178
+ }
179
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/GetCourse/v1/actions/webhook/index.ts"],"names":[],"mappings":";;;AA4PA,0BASC;AA9PD,+CAAkD;AAElD,mDAAgD;AAChD,wDAA+D;AAC/D,+CAAiD;AAEjD,MAAM,OAAO,GAAG,CAAC,UAAoB,EAAqC,EAAE,CAAC,CAAC;IAC7E,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE;CACtD,CAAC,CAAC;AAyBU,QAAA,cAAc,GAA2B;IACrD;QACC,IAAI,EAAE,2BAA2B;QACjC,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,oDAAoD;KACjE;IACD;QACC,IAAI,EAAE,qCAAqC;QAC3C,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,2DAA2D;KACxE;IACD;QACC,IAAI,EAAE,6CAA6C;QACnD,KAAK,EAAE,KAAK;QACZ,WAAW,EACV,0HAA0H;KAC3H;IACD;QACC,IAAI,EAAE,8CAA8C;QACpD,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,mDAAmD;KAChE;IACD;QACC,IAAI,EAAE,8BAA8B;QACpC,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,4BAA4B;KACzC;IACD;QACC,IAAI,EAAE,6CAA6C;QACnD,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,mCAAmC;KAChD;IACD;QACC,IAAI,EAAE,4BAA4B;QAClC,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,uBAAuB;KACpC;IACD;QACC,IAAI,EAAE,8CAA8C;QACpD,KAAK,EAAE,KAAK;QACZ,WAAW,EACV,wHAAwH;KACzH;IACD;QACC,IAAI,EAAE,yDAAyD;QAC/D,KAAK,EAAE,KAAK;QACZ,WAAW,EACV,gIAAgI;KACjI;IACD;QACC,IAAI,EAAE,yCAAyC;QAC/C,KAAK,EAAE,KAAK;QACZ,WAAW,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AAI,SAAS,KAAK,WAAW;QAAE,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5E,IAAI,SAAS,KAAK,aAAa;QAAE,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;IAE9E,MAAM,yBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, operation: string, itemIndex: number): Promise<INodeExecutionData[]>;