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.
- package/LICENSE.md +38 -0
- package/README.md +359 -0
- package/dist/credentials/GetCourseApi.credentials.d.ts +10 -0
- package/dist/credentials/GetCourseApi.credentials.js +58 -0
- package/dist/credentials/GetCourseApi.credentials.js.map +1 -0
- package/dist/credentials/GetCourseTechApi.credentials.d.ts +11 -0
- package/dist/credentials/GetCourseTechApi.credentials.js +63 -0
- package/dist/credentials/GetCourseTechApi.credentials.js.map +1 -0
- package/dist/credentials/accountAddress.d.ts +11 -0
- package/dist/credentials/accountAddress.js +116 -0
- package/dist/credentials/accountAddress.js.map +1 -0
- package/dist/icons/getcourse.dark.svg +15 -0
- package/dist/icons/getcourse.svg +11 -0
- package/dist/nodes/GetCourse/GetCourse.node.d.ts +9 -0
- package/dist/nodes/GetCourse/GetCourse.node.js +48 -0
- package/dist/nodes/GetCourse/GetCourse.node.js.map +1 -0
- package/dist/nodes/GetCourse/GetCourse.node.json +40 -0
- package/dist/nodes/GetCourse/v1/actions/call/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/call/index.js +98 -0
- package/dist/nodes/GetCourse/v1/actions/call/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/deal/description.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/actions/deal/description.js +261 -0
- package/dist/nodes/GetCourse/v1/actions/deal/description.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/deal/execute.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/actions/deal/execute.js +181 -0
- package/dist/nodes/GetCourse/v1/actions/deal/execute.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/deal/index.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/actions/deal/index.js +8 -0
- package/dist/nodes/GetCourse/v1/actions/deal/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/dialog/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/dialog/index.js +262 -0
- package/dist/nodes/GetCourse/v1/actions/dialog/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/helpdesk/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/helpdesk/index.js +305 -0
- package/dist/nodes/GetCourse/v1/actions/helpdesk/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/index.d.ts +5 -0
- package/dist/nodes/GetCourse/v1/actions/index.js +119 -0
- package/dist/nodes/GetCourse/v1/actions/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/lesson/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/lesson/index.js +180 -0
- package/dist/nodes/GetCourse/v1/actions/lesson/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/offer/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/offer/index.js +98 -0
- package/dist/nodes/GetCourse/v1/actions/offer/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/school/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/school/index.js +139 -0
- package/dist/nodes/GetCourse/v1/actions/school/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/user/description.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/actions/user/description.js +499 -0
- package/dist/nodes/GetCourse/v1/actions/user/description.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/user/execute.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/actions/user/execute.js +270 -0
- package/dist/nodes/GetCourse/v1/actions/user/execute.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/user/index.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/actions/user/index.js +8 -0
- package/dist/nodes/GetCourse/v1/actions/user/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/webhook/index.d.ts +4 -0
- package/dist/nodes/GetCourse/v1/actions/webhook/index.js +179 -0
- package/dist/nodes/GetCourse/v1/actions/webhook/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/actions/webinar/index.d.ts +3 -0
- package/dist/nodes/GetCourse/v1/actions/webinar/index.js +376 -0
- package/dist/nodes/GetCourse/v1/actions/webinar/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/descriptions/common.d.ts +7 -0
- package/dist/nodes/GetCourse/v1/descriptions/common.js +142 -0
- package/dist/nodes/GetCourse/v1/descriptions/common.js.map +1 -0
- package/dist/nodes/GetCourse/v1/helpers/errors.d.ts +11 -0
- package/dist/nodes/GetCourse/v1/helpers/errors.js +90 -0
- package/dist/nodes/GetCourse/v1/helpers/errors.js.map +1 -0
- package/dist/nodes/GetCourse/v1/helpers/request.d.ts +7 -0
- package/dist/nodes/GetCourse/v1/helpers/request.js +79 -0
- package/dist/nodes/GetCourse/v1/helpers/request.js.map +1 -0
- package/dist/nodes/GetCourse/v1/methods/index.d.ts +2 -0
- package/dist/nodes/GetCourse/v1/methods/index.js +39 -0
- package/dist/nodes/GetCourse/v1/methods/index.js.map +1 -0
- package/dist/nodes/GetCourse/v1/methods/loadOptions.d.ts +7 -0
- package/dist/nodes/GetCourse/v1/methods/loadOptions.js +76 -0
- package/dist/nodes/GetCourse/v1/methods/loadOptions.js.map +1 -0
- package/dist/nodes/GetCourse/v1/transport/index.d.ts +18 -0
- package/dist/nodes/GetCourse/v1/transport/index.js +165 -0
- package/dist/nodes/GetCourse/v1/transport/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.d.ts +9 -0
- package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.js +48 -0
- package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/GetCourseLegacy.node.json +35 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/description.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/description.js +287 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/description.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/execute.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/execute.js +150 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/execute.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/index.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/index.js +8 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/deal/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/description.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/description.js +487 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/description.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/execute.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/execute.js +252 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/execute.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/index.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/index.js +8 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/export/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/field/index.d.ts +3 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/field/index.js +61 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/field/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/group/index.d.ts +3 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/group/index.js +42 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/group/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/index.d.ts +5 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/index.js +84 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/description.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/description.js +87 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/description.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/execute.d.ts +5 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/execute.js +129 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/execute.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/index.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/index.js +8 -0
- package/dist/nodes/GetCourseLegacy/v1/actions/user/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/descriptions/common.d.ts +14 -0
- package/dist/nodes/GetCourseLegacy/v1/descriptions/common.js +198 -0
- package/dist/nodes/GetCourseLegacy/v1/descriptions/common.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/descriptions/constants.d.ts +7 -0
- package/dist/nodes/GetCourseLegacy/v1/descriptions/constants.js +116 -0
- package/dist/nodes/GetCourseLegacy/v1/descriptions/constants.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/helpers/errors.d.ts +18 -0
- package/dist/nodes/GetCourseLegacy/v1/helpers/errors.js +141 -0
- package/dist/nodes/GetCourseLegacy/v1/helpers/errors.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/helpers/exportRows.d.ts +8 -0
- package/dist/nodes/GetCourseLegacy/v1/helpers/exportRows.js +100 -0
- package/dist/nodes/GetCourseLegacy/v1/helpers/exportRows.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/methods/index.d.ts +2 -0
- package/dist/nodes/GetCourseLegacy/v1/methods/index.js +39 -0
- package/dist/nodes/GetCourseLegacy/v1/methods/index.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/methods/loadOptions.d.ts +5 -0
- package/dist/nodes/GetCourseLegacy/v1/methods/loadOptions.js +92 -0
- package/dist/nodes/GetCourseLegacy/v1/methods/loadOptions.js.map +1 -0
- package/dist/nodes/GetCourseLegacy/v1/transport/index.d.ts +13 -0
- package/dist/nodes/GetCourseLegacy/v1/transport/index.js +204 -0
- package/dist/nodes/GetCourseLegacy/v1/transport/index.js.map +1 -0
- package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.d.ts +12 -0
- package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.js +339 -0
- package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.js.map +1 -0
- package/dist/nodes/GetCourseTrigger/GetCourseTrigger.node.json +32 -0
- package/dist/nodes/GetCourseTrigger/payload.d.ts +14 -0
- package/dist/nodes/GetCourseTrigger/payload.js +66 -0
- package/dist/nodes/GetCourseTrigger/payload.js.map +1 -0
- package/dist/utils/cache.d.ts +2 -0
- package/dist/utils/cache.js +27 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/dates.d.ts +3 -0
- package/dist/utils/dates.js +70 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/events.d.ts +14 -0
- package/dist/utils/events.js +92 -0
- package/dist/utils/events.js.map +1 -0
- package/dist/utils/httpError.d.ts +4 -0
- package/dist/utils/httpError.js +46 -0
- package/dist/utils/httpError.js.map +1 -0
- package/dist/utils/query.d.ts +4 -0
- package/dist/utils/query.js +42 -0
- package/dist/utils/query.js.map +1 -0
- package/dist/utils/rateLimiter.d.ts +3 -0
- package/dist/utils/rateLimiter.js +44 -0
- package/dist/utils/rateLimiter.js.map +1 -0
- package/dist/utils/router.d.ts +8 -0
- package/dist/utils/router.js +40 -0
- package/dist/utils/router.js.map +1 -0
- package/index.js +0 -0
- package/package.json +68 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export interface EventObject {
|
|
3
|
+
id: number;
|
|
4
|
+
label: string;
|
|
5
|
+
events: Array<{
|
|
6
|
+
id: number;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare const EVENT_OBJECTS: EventObject[];
|
|
12
|
+
export declare const EVENT_OBJECT_OPTIONS: INodePropertyOptions[];
|
|
13
|
+
export declare function eventOptions(objectId: number): INodePropertyOptions[];
|
|
14
|
+
export declare const EVENT_PAIR_OPTIONS: INodePropertyOptions[];
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVENT_PAIR_OPTIONS = exports.EVENT_OBJECT_OPTIONS = exports.EVENT_OBJECTS = void 0;
|
|
4
|
+
exports.eventOptions = eventOptions;
|
|
5
|
+
exports.EVENT_OBJECTS = [
|
|
6
|
+
{
|
|
7
|
+
id: 1,
|
|
8
|
+
label: 'Incoming Messages',
|
|
9
|
+
events: [
|
|
10
|
+
{
|
|
11
|
+
id: 1,
|
|
12
|
+
label: 'Dialog Created',
|
|
13
|
+
description: 'Создан новый диалог по сообщению ученика',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 2,
|
|
17
|
+
label: 'Dialog Reopened',
|
|
18
|
+
description: 'Переоткрыт закрытый диалог по сообщению ученика',
|
|
19
|
+
},
|
|
20
|
+
{ id: 3, label: 'Message From Student', description: 'Поступило новое сообщение от ученика' },
|
|
21
|
+
{
|
|
22
|
+
id: 4,
|
|
23
|
+
label: 'Message From Staff',
|
|
24
|
+
description: 'Поступило новое сообщение от сотрудника',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 2,
|
|
30
|
+
label: 'Orders',
|
|
31
|
+
events: [
|
|
32
|
+
{ id: 1, label: 'Order Created', description: 'Создан новый заказ' },
|
|
33
|
+
{ id: 2, label: 'Order Status Changed', description: 'Смена статуса заказа' },
|
|
34
|
+
{ id: 3, label: 'Order Paid', description: 'Заказ оплачен' },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 4,
|
|
39
|
+
label: 'Lesson Answers',
|
|
40
|
+
events: [{ id: 1, label: 'Answer Added', description: 'Добавлен ответ на урок' }],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 5,
|
|
44
|
+
label: 'Answer Comments',
|
|
45
|
+
events: [{ id: 1, label: 'Comment Added', description: 'Добавлен комментарий к ответу' }],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 7,
|
|
49
|
+
label: 'Webinar Comments',
|
|
50
|
+
events: [
|
|
51
|
+
{ id: 1, label: 'Comment Posted', description: 'Получение новых комментариев от зрителей' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 8,
|
|
56
|
+
label: 'Calls',
|
|
57
|
+
events: [{ id: 1, label: 'Call Registered', description: 'Получение новых звонков' }],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 9,
|
|
61
|
+
label: 'HelpDesk',
|
|
62
|
+
events: [
|
|
63
|
+
{ id: 1, label: 'Ticket Created', description: 'Создан новый тикет по сообщению клиента' },
|
|
64
|
+
{ id: 2, label: 'Message From Client', description: 'Поступило новое сообщение от клиента' },
|
|
65
|
+
{
|
|
66
|
+
id: 3,
|
|
67
|
+
label: 'Message From Staff',
|
|
68
|
+
description: 'Поступило новое сообщение от сотрудника',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
exports.EVENT_OBJECT_OPTIONS = exports.EVENT_OBJECTS.map((object) => ({
|
|
74
|
+
name: object.label,
|
|
75
|
+
value: object.id,
|
|
76
|
+
description: `event_object_id ${object.id}`,
|
|
77
|
+
}));
|
|
78
|
+
function eventOptions(objectId) {
|
|
79
|
+
var _a;
|
|
80
|
+
const object = exports.EVENT_OBJECTS.find((candidate) => candidate.id === objectId);
|
|
81
|
+
return ((_a = object === null || object === void 0 ? void 0 : object.events) !== null && _a !== void 0 ? _a : []).map((event) => ({
|
|
82
|
+
name: event.label,
|
|
83
|
+
value: event.id,
|
|
84
|
+
description: `${event.description} (event_id ${event.id})`,
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
exports.EVENT_PAIR_OPTIONS = exports.EVENT_OBJECTS.flatMap((object) => object.events.map((event) => ({
|
|
88
|
+
name: `${object.label}: ${event.label}`,
|
|
89
|
+
value: `${object.id}:${event.id}`,
|
|
90
|
+
description: `${event.description} (event_object_id ${object.id}, event_id ${event.id})`,
|
|
91
|
+
})));
|
|
92
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../utils/events.ts"],"names":[],"mappings":";;;AAqGA,oCAQC;AArFY,QAAA,aAAa,GAAkB;IAC3C;QACC,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,mBAAmB;QAC1B,MAAM,EAAE;YACP;gBACC,EAAE,EAAE,CAAC;gBACL,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,0CAA0C;aACvD;YACD;gBACC,EAAE,EAAE,CAAC;gBACL,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,iDAAiD;aAC9D;YACD,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,sCAAsC,EAAE;YAC7F;gBACC,EAAE,EAAE,CAAC;gBACL,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,yCAAyC;aACtD;SACD;KACD;IACD;QACC,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE;YACP,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE;YACpE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,sBAAsB,EAAE;YAC7E,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE;SAC5D;KACD;IACD;QACC,EAAE,EAAE,CAAC;QACL,KAAK,EAAE,gBAAgB;QACvB,MAAM,E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AAC,QAAgB;;IAC5C,MAAM,MAAM,GAAG,qBAAa,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAE5E,OAAO,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7C,IAAI,EAAE,KAAK,CAAC,KAAK;QACjB,KAAK,EAAE,KAAK,CAAC,EAAE;QACf,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,cAAc,KAAK,CAAC,EAAE,GAAG;KAC1D,CAAC,CAAC,CAAC;AACL,CAAC;AAUY,QAAA,kBAAkB,GAA2B,qBAAa,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1F,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC7B,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE;IACvC,KAAK,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,KAAK,CAAC,EAAE,EAAE;IACjC,WAAW,EAAE,GAAG,KAAK,CAAC,WAAW,qBAAqB,MAAM,CAAC,EAAE,cAAc,KAAK,CAAC,EAAE,GAAG;CACxF,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IDataObject } from 'n8n-workflow';
|
|
2
|
+
export declare function extractStatusCode(error: unknown): number | undefined;
|
|
3
|
+
export declare function extractResponseBody(error: unknown): IDataObject | undefined;
|
|
4
|
+
export declare function extractRetryAfterMs(error: unknown): number | undefined;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractStatusCode = extractStatusCode;
|
|
4
|
+
exports.extractResponseBody = extractResponseBody;
|
|
5
|
+
exports.extractRetryAfterMs = extractRetryAfterMs;
|
|
6
|
+
function extractStatusCode(error) {
|
|
7
|
+
var _a, _b, _c, _d, _e;
|
|
8
|
+
const candidates = [
|
|
9
|
+
error === null || error === void 0 ? void 0 : error.httpCode,
|
|
10
|
+
(_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.status,
|
|
11
|
+
error === null || error === void 0 ? void 0 : error.statusCode,
|
|
12
|
+
(_c = (_b = error === null || error === void 0 ? void 0 : error.cause) === null || _b === void 0 ? void 0 : _b.response) === null || _c === void 0 ? void 0 : _c.status,
|
|
13
|
+
(_d = error === null || error === void 0 ? void 0 : error.cause) === null || _d === void 0 ? void 0 : _d.statusCode,
|
|
14
|
+
(_e = error === null || error === void 0 ? void 0 : error.context) === null || _e === void 0 ? void 0 : _e.statusCode,
|
|
15
|
+
];
|
|
16
|
+
for (const candidate of candidates) {
|
|
17
|
+
const parsed = Number(candidate);
|
|
18
|
+
if (Number.isFinite(parsed) && parsed >= 100 && parsed < 600)
|
|
19
|
+
return parsed;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function extractResponseBody(error) {
|
|
24
|
+
var _a, _b, _c, _d, _e;
|
|
25
|
+
const candidates = [
|
|
26
|
+
(_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data,
|
|
27
|
+
(_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.body,
|
|
28
|
+
(_d = (_c = error === null || error === void 0 ? void 0 : error.cause) === null || _c === void 0 ? void 0 : _c.response) === null || _d === void 0 ? void 0 : _d.data,
|
|
29
|
+
(_e = error === null || error === void 0 ? void 0 : error.cause) === null || _e === void 0 ? void 0 : _e.error,
|
|
30
|
+
error === null || error === void 0 ? void 0 : error.error,
|
|
31
|
+
];
|
|
32
|
+
for (const candidate of candidates) {
|
|
33
|
+
if (candidate !== null && typeof candidate === 'object' && !Array.isArray(candidate)) {
|
|
34
|
+
return candidate;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
function extractRetryAfterMs(error) {
|
|
40
|
+
var _a, _b, _c, _d, _e;
|
|
41
|
+
const headers = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : (_d = (_c = error === null || error === void 0 ? void 0 : error.cause) === null || _c === void 0 ? void 0 : _c.response) === null || _d === void 0 ? void 0 : _d.headers;
|
|
42
|
+
const raw = (_e = headers === null || headers === void 0 ? void 0 : headers['retry-after']) !== null && _e !== void 0 ? _e : headers === null || headers === void 0 ? void 0 : headers['Retry-After'];
|
|
43
|
+
const seconds = Number(raw);
|
|
44
|
+
return Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : undefined;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=httpError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../utils/httpError.ts"],"names":[],"mappings":";;AASA,8CAgBC;AAGD,kDAgBC;AAGD,kDAUC;AAhDD,SAAgB,iBAAiB,CAAC,KAAc;;IAC/C,MAAM,UAAU,GAAG;QACjB,KAAqB,aAArB,KAAK,uBAAL,KAAK,CAAkB,QAAQ;QAChC,MAAE,KAAqB,aAArB,KAAK,uBAAL,KAAK,CAAkB,QAAwB,0CAAE,MAAM;QACxD,KAAqB,aAArB,KAAK,uBAAL,KAAK,CAAkB,UAAU;QAClC,MAAC,MAAE,KAAqB,aAArB,KAAK,uBAAL,KAAK,CAAkB,KAAqB,0CAAE,QAAwB,0CAAE,MAAM;QACjF,MAAE,KAAqB,aAArB,KAAK,uBAAL,KAAK,CAAkB,KAAqB,0CAAE,UAAU;QAC1D,MAAE,KAAqB,aAArB,KAAK,uBAAL,KAAK,CAAkB,OAAuB,0CAAE,UAAU;KA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AA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,aAAa,CAAC,mCAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,aAAa,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAE5B,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flattenQuery = flattenQuery;
|
|
4
|
+
exports.omitEmpty = omitEmpty;
|
|
5
|
+
exports.splitList = splitList;
|
|
6
|
+
function flattenQuery(input) {
|
|
7
|
+
const output = {};
|
|
8
|
+
const walk = (value, path) => {
|
|
9
|
+
if (value === undefined || value === null || value === '')
|
|
10
|
+
return;
|
|
11
|
+
if (Array.isArray(value)) {
|
|
12
|
+
value.forEach((entry, index) => walk(entry, `${path}[${index}]`));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (typeof value === 'object') {
|
|
16
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
17
|
+
walk(entry, `${path}[${key}]`);
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
output[path] = value;
|
|
22
|
+
};
|
|
23
|
+
for (const [key, value] of Object.entries(input !== null && input !== void 0 ? input : {}))
|
|
24
|
+
walk(value, key);
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
27
|
+
function omitEmpty(input) {
|
|
28
|
+
const output = {};
|
|
29
|
+
for (const [key, value] of Object.entries(input)) {
|
|
30
|
+
if (value === undefined || value === null || value === '')
|
|
31
|
+
continue;
|
|
32
|
+
output[key] = value;
|
|
33
|
+
}
|
|
34
|
+
return output;
|
|
35
|
+
}
|
|
36
|
+
function splitList(value) {
|
|
37
|
+
return String(value !== null && value !== void 0 ? value : '')
|
|
38
|
+
.split(',')
|
|
39
|
+
.map((entry) => entry.trim())
|
|
40
|
+
.filter((entry) => entry !== '');
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../utils/query.ts"],"names":[],"mappings":";;AAUA,oCAwBC;AAGD,8BASC;AAGD,8BAKC;AA5CD,SAAgB,YAAY,CAAC,KAAmB;IAC/C,MAAM,MAAM,GAAgB,EAAE,CAAC;IAE/B,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,IAAY,EAAQ,EAAE;QACnD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;YAAE,OAAO;QAElE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;YAClE,OAAO;QACR,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAoB,CAAC,EAAE,CAAC;gBACjE,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC,CAAC;YAChC,CAAC;YACD,OAAO;QACR,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,GAAG,KAAkC,CAAC;IACnD,CAAC,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;QAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEzE,OAAO,MAAM,CAAC;AACf,CAAC;AAGD,SAAgB,SAAS,CAAC,KAAkB;IAC3C,MAAM,MAAM,GAAgB,EAAE,CAAC;IAE/B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE;YAAE,SAAS;QACpE,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAGD,SAAgB,SAAS,CAAC,KAAc;IACvC,OAAO,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;SACxB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acquireSlot = acquireSlot;
|
|
4
|
+
exports.slotDelay = slotDelay;
|
|
5
|
+
exports.resetRateLimiter = resetRateLimiter;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
const windows = new Map();
|
|
8
|
+
async function acquireSlot(key, limit, windowMs, maxWaitMs = Number.POSITIVE_INFINITY) {
|
|
9
|
+
const size = Math.max(1, Math.floor(limit) || 1);
|
|
10
|
+
let slots = windows.get(key);
|
|
11
|
+
if (slots === undefined) {
|
|
12
|
+
slots = [];
|
|
13
|
+
windows.set(key, slots);
|
|
14
|
+
}
|
|
15
|
+
const now = Date.now();
|
|
16
|
+
while (slots.length > 0 && slots[0] <= now - windowMs)
|
|
17
|
+
slots.shift();
|
|
18
|
+
if (slots.length < size) {
|
|
19
|
+
slots.push(now);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
const readyAt = slots[slots.length - size] + windowMs;
|
|
23
|
+
const wait = Math.max(0, readyAt - now);
|
|
24
|
+
if (wait > maxWaitMs)
|
|
25
|
+
return false;
|
|
26
|
+
slots.push(readyAt);
|
|
27
|
+
await (0, n8n_workflow_1.sleep)(wait);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function slotDelay(key, limit, windowMs) {
|
|
31
|
+
const slots = windows.get(key);
|
|
32
|
+
if (slots === undefined)
|
|
33
|
+
return 0;
|
|
34
|
+
const size = Math.max(1, Math.floor(limit) || 1);
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
const live = slots.filter((moment) => moment > now - windowMs);
|
|
37
|
+
if (live.length < size)
|
|
38
|
+
return 0;
|
|
39
|
+
return Math.max(0, live[live.length - size] + windowMs - now);
|
|
40
|
+
}
|
|
41
|
+
function resetRateLimiter() {
|
|
42
|
+
windows.clear();
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=rateLimiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../../utils/rateLimiter.ts"],"names":[],"mappings":";;AA6BA,kCAgCC;AAGD,8BAWC;AAGD,4CAEC;AAnED,+CAAqC;AAGrC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;AAarC,KAAK,UAAU,WAAW,CAChC,GAAW,EACX,KAAa,EACb,QAAgB,EAChB,SAAS,GAAG,MAAM,CAAC,iBAAiB;IAEpC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjD,IAAI,KAAK,GAAG,OAAO,CAAC,GAAG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GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC;IAE/D,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI;QAAE,OAAO,CAAC,CAAC;IAEjC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,QAAQ,GAAG,GAAG,CAAC,CAAC;AAC/D,CAAC;AAGD,SAAgB,gBAAgB;IAC/B,OAAO,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { NodeOperationError } from 'n8n-workflow';
|
|
3
|
+
export interface ResourceModule {
|
|
4
|
+
description: INodeProperties[];
|
|
5
|
+
execute(this: IExecuteFunctions, operation: string, itemIndex: number): Promise<INodeExecutionData[]>;
|
|
6
|
+
}
|
|
7
|
+
export declare function routeItems(this: IExecuteFunctions, resources: Record<string, ResourceModule>): Promise<INodeExecutionData[][]>;
|
|
8
|
+
export declare function unknownOperation(this: IExecuteFunctions, resourceLabel: string, operation: string, itemIndex: number): NodeOperationError;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.routeItems = routeItems;
|
|
4
|
+
exports.unknownOperation = unknownOperation;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
function errorItem(error, itemIndex) {
|
|
7
|
+
return {
|
|
8
|
+
json: { error: error instanceof Error ? error.message : String(error) },
|
|
9
|
+
pairedItem: { item: itemIndex },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
async function routeItems(resources) {
|
|
13
|
+
var _a;
|
|
14
|
+
const items = this.getInputData();
|
|
15
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
16
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
17
|
+
const module = resources[resource];
|
|
18
|
+
if (module === undefined) {
|
|
19
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource "${resource}"`);
|
|
20
|
+
}
|
|
21
|
+
const output = [];
|
|
22
|
+
for (let index = 0; index < items.length; index++) {
|
|
23
|
+
try {
|
|
24
|
+
const results = await module.execute.call(this, operation, index);
|
|
25
|
+
for (const result of results) {
|
|
26
|
+
output.push({ ...result, pairedItem: (_a = result.pairedItem) !== null && _a !== void 0 ? _a : { item: index } });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (!this.continueOnFail())
|
|
31
|
+
throw error;
|
|
32
|
+
output.push(errorItem(error, index));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return [output];
|
|
36
|
+
}
|
|
37
|
+
function unknownOperation(resourceLabel, operation, itemIndex) {
|
|
38
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), `The ${resourceLabel} resource has no operation "${operation}"`, { itemIndex });
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../utils/router.ts"],"names":[],"mappings":";;AAkCA,gCA6BC;AAGD,4CAWC;AA5ED,+CAAkD;AAmBlD,SAAS,SAAS,CAAC,KAAc,EAAE,SAAiB;IACnD,OAAO;QACN,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QACvE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC;AASM,KAAK,UAAU,UAAU,CAE/B,SAAyC;;IAEzC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,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,EACd,OAAO,aAAa,+BAA+B,SAAS,GAAG,EAC/D,EAAE,SAAS,EAAE,CACb,CAAC;AACH,CAAC"}
|
package/index.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-getcourse",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "GetCourse nodes for n8n: the Tech API v1, the legacy Import/Export API and a webhook trigger",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"n8n",
|
|
8
|
+
"getcourse",
|
|
9
|
+
"lms",
|
|
10
|
+
"crm",
|
|
11
|
+
"online-courses"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "https://github.com/zenland-dev/n8n-nodes-getcourse",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "zenland-dev",
|
|
17
|
+
"email": "zenland.dev@gmail.com"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/zenland-dev/n8n-nodes-getcourse.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/zenland-dev/n8n-nodes-getcourse/issues"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20.19"
|
|
28
|
+
},
|
|
29
|
+
"main": "index.js",
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "n8n-node build",
|
|
32
|
+
"dev": "n8n-node dev",
|
|
33
|
+
"lint": "n8n-node lint",
|
|
34
|
+
"lint:fix": "n8n-node lint --fix",
|
|
35
|
+
"format": "prettier nodes credentials --write",
|
|
36
|
+
"release": "n8n-node release",
|
|
37
|
+
"prepublishOnly": "n8n-node prerelease"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"n8n": {
|
|
43
|
+
"n8nNodesApiVersion": 1,
|
|
44
|
+
"strict": true,
|
|
45
|
+
"credentials": [
|
|
46
|
+
"dist/credentials/GetCourseApi.credentials.js",
|
|
47
|
+
"dist/credentials/GetCourseTechApi.credentials.js"
|
|
48
|
+
],
|
|
49
|
+
"nodes": [
|
|
50
|
+
"dist/nodes/GetCourse/GetCourse.node.js",
|
|
51
|
+
"dist/nodes/GetCourseLegacy/GetCourseLegacy.node.js",
|
|
52
|
+
"dist/nodes/GetCourseTrigger/GetCourseTrigger.node.js"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@n8n/node-cli": "^0.46.4",
|
|
57
|
+
"eslint": "9.39.4",
|
|
58
|
+
"prettier": "3.8.3",
|
|
59
|
+
"release-it": "^19.0.4",
|
|
60
|
+
"typescript": "5.9.3"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"n8n-workflow": "*"
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
}
|
|
68
|
+
}
|