n8n-nodes-base 1.90.0 → 1.91.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/dist/credentials/GSuiteAdminOAuth2Api.credentials.js +3 -1
- package/dist/credentials/GSuiteAdminOAuth2Api.credentials.js.map +1 -1
- package/dist/methods/defined.json +2 -1
- package/dist/methods/referenced.json +1 -0
- package/dist/nodes/Calendly/CalendlyTrigger.node.js +11 -0
- package/dist/nodes/Calendly/CalendlyTrigger.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js +2 -2
- package/dist/nodes/EmailReadImap/v1/EmailReadImapV1.node.js.map +1 -1
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js +2 -2
- package/dist/nodes/EmailReadImap/v2/EmailReadImapV2.node.js.map +1 -1
- package/dist/nodes/Files/ReadWriteFile/actions/read.operation.js +0 -1
- package/dist/nodes/Files/ReadWriteFile/actions/read.operation.js.map +1 -1
- package/dist/nodes/Form/utils.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/DeviceDescription.js +381 -0
- package/dist/nodes/Google/GSuiteAdmin/DeviceDescription.js.map +1 -0
- package/dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js +395 -88
- package/dist/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/GenericFunctions.js +6 -2
- package/dist/nodes/Google/GSuiteAdmin/GenericFunctions.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/GroupDescripion.js +112 -88
- package/dist/nodes/Google/GSuiteAdmin/GroupDescripion.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/SearchFunctions.js +101 -0
- package/dist/nodes/Google/GSuiteAdmin/SearchFunctions.js.map +1 -0
- package/dist/nodes/Google/GSuiteAdmin/UserDescription.js +538 -195
- package/dist/nodes/Google/GSuiteAdmin/UserDescription.js.map +1 -1
- package/dist/nodes/Google/GSuiteAdmin/gSuiteAdmin.svg +1 -0
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js +11 -0
- package/dist/nodes/HttpRequest/V2/HttpRequestV2.node.js.map +1 -1
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js +8 -0
- package/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js.map +1 -1
- package/dist/nodes/Jira/GenericFunctions.js +25 -12
- package/dist/nodes/Jira/GenericFunctions.js.map +1 -1
- package/dist/nodes/Jira/Jira.node.js +11 -7
- package/dist/nodes/Jira/Jira.node.js.map +1 -1
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js +2 -2
- package/dist/nodes/LocalFileTrigger/LocalFileTrigger.node.js.map +1 -1
- package/dist/nodes/MQTT/MqttTrigger.node.js +2 -2
- package/dist/nodes/MQTT/MqttTrigger.node.js.map +1 -1
- package/dist/nodes/Postgres/PostgresTrigger.node.js +2 -2
- package/dist/nodes/Postgres/PostgresTrigger.node.js.map +1 -1
- package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js +2 -2
- package/dist/nodes/RabbitMQ/RabbitMQTrigger.node.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/asset/upload.operation.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/row/get.operation.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/row/list.operation.js.map +1 -1
- package/dist/nodes/SeaTable/v2/actions/row/search.operation.js.map +1 -1
- package/dist/nodes/SseTrigger/SseTrigger.node.js +2 -2
- package/dist/nodes/SseTrigger/SseTrigger.node.js.map +1 -1
- package/dist/nodes/Transform/Summarize/utils.js +7 -7
- package/dist/nodes/Transform/Summarize/utils.js.map +1 -1
- package/dist/test/nodes/Helpers.d.ts +5 -0
- package/dist/test/nodes/Helpers.js +16 -170
- package/dist/test/nodes/Helpers.js.map +1 -1
- package/dist/types/credentials.json +1 -1
- package/dist/types/nodes.json +11 -11
- package/package.json +4 -4
- package/dist/nodes/Google/GSuiteAdmin/google-workspace-admin.png +0 -0
- package/dist/test/nodes/ExecuteWorkflow.js +0 -120
- package/dist/test/nodes/ExecuteWorkflow.js.map +0 -1
- package/dist/test/nodes/credential-types.js +0 -57
- package/dist/test/nodes/credential-types.js.map +0 -1
- package/dist/test/nodes/credentials-helper.js +0 -76
- package/dist/test/nodes/credentials-helper.js.map +0 -1
- package/dist/test/nodes/load-nodes-and-credentials.js +0 -68
- package/dist/test/nodes/load-nodes-and-credentials.js.map +0 -1
- package/dist/test/nodes/node-types.js +0 -56
- package/dist/test/nodes/node-types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.91.0",
|
|
4
4
|
"description": "Base nodes of n8n",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -853,7 +853,7 @@
|
|
|
853
853
|
"@types/xml2js": "^0.4.14",
|
|
854
854
|
"eslint-plugin-n8n-nodes-base": "^1.16.3",
|
|
855
855
|
"@n8n/typescript-config": "1.2.0",
|
|
856
|
-
"n8n-core": "1.
|
|
856
|
+
"n8n-core": "1.91.0"
|
|
857
857
|
},
|
|
858
858
|
"dependencies": {
|
|
859
859
|
"@aws-sdk/client-sso-oidc": "3.666.0",
|
|
@@ -924,8 +924,8 @@
|
|
|
924
924
|
"xmlhttprequest-ssl": "3.1.0",
|
|
925
925
|
"@n8n/config": "1.38.0",
|
|
926
926
|
"@n8n/di": "0.5.0",
|
|
927
|
-
"n8n
|
|
928
|
-
"
|
|
927
|
+
"@n8n/imap": "0.9.0",
|
|
928
|
+
"n8n-workflow": "1.90.0"
|
|
929
929
|
},
|
|
930
930
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
931
931
|
"homepage": "https://n8n.io",
|
|
Binary file
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var ExecuteWorkflow_exports = {};
|
|
30
|
-
__export(ExecuteWorkflow_exports, {
|
|
31
|
-
executeWorkflow: () => executeWorkflow
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(ExecuteWorkflow_exports);
|
|
34
|
-
var import_di = require("@n8n/di");
|
|
35
|
-
var import_jest_mock_extended = require("jest-mock-extended");
|
|
36
|
-
var import_n8n_core = require("n8n-core");
|
|
37
|
-
var import_n8n_workflow = require("n8n-workflow");
|
|
38
|
-
var import_nock = __toESM(require("nock"));
|
|
39
|
-
var import_credentials_helper = require("./credentials-helper");
|
|
40
|
-
var import_node_types = require("./node-types");
|
|
41
|
-
async function executeWorkflow(testData) {
|
|
42
|
-
const nodeTypes = import_di.Container.get(import_node_types.NodeTypes);
|
|
43
|
-
const credentialsHelper = import_di.Container.get(import_credentials_helper.CredentialsHelper);
|
|
44
|
-
credentialsHelper.setCredentials(testData.credentials ?? {});
|
|
45
|
-
if (testData.nock) {
|
|
46
|
-
const { baseUrl, mocks } = testData.nock;
|
|
47
|
-
const agent = (0, import_nock.default)(baseUrl);
|
|
48
|
-
mocks.forEach(
|
|
49
|
-
({
|
|
50
|
-
method,
|
|
51
|
-
path,
|
|
52
|
-
statusCode,
|
|
53
|
-
requestBody,
|
|
54
|
-
requestHeaders,
|
|
55
|
-
responseBody,
|
|
56
|
-
responseHeaders
|
|
57
|
-
}) => {
|
|
58
|
-
let mock2 = agent[method](path, requestBody);
|
|
59
|
-
if (requestHeaders && Object.keys(requestHeaders).length > 0) {
|
|
60
|
-
Object.entries(requestHeaders).forEach(([key, value]) => {
|
|
61
|
-
mock2 = mock2.matchHeader(key, value);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
mock2.reply(statusCode, responseBody, responseHeaders);
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
const executionMode = testData.trigger?.mode ?? "manual";
|
|
69
|
-
const workflowInstance = new import_n8n_workflow.Workflow({
|
|
70
|
-
id: "test",
|
|
71
|
-
nodes: testData.input.workflowData.nodes,
|
|
72
|
-
connections: testData.input.workflowData.connections,
|
|
73
|
-
active: false,
|
|
74
|
-
nodeTypes,
|
|
75
|
-
settings: testData.input.workflowData.settings
|
|
76
|
-
});
|
|
77
|
-
const waitPromise = (0, import_n8n_workflow.createDeferredPromise)();
|
|
78
|
-
const nodeExecutionOrder = [];
|
|
79
|
-
const hooks = new import_n8n_core.ExecutionLifecycleHooks("trigger", "1", (0, import_jest_mock_extended.mock)());
|
|
80
|
-
hooks.addHandler("nodeExecuteAfter", (nodeName) => {
|
|
81
|
-
nodeExecutionOrder.push(nodeName);
|
|
82
|
-
});
|
|
83
|
-
hooks.addHandler("workflowExecuteAfter", (fullRunData) => waitPromise.resolve(fullRunData));
|
|
84
|
-
const additionalData = (0, import_jest_mock_extended.mock)({
|
|
85
|
-
hooks,
|
|
86
|
-
// Get from node.parameters
|
|
87
|
-
currentNodeParameters: void 0
|
|
88
|
-
});
|
|
89
|
-
additionalData.credentialsHelper = credentialsHelper;
|
|
90
|
-
let executionData;
|
|
91
|
-
const runExecutionData = {
|
|
92
|
-
resultData: {
|
|
93
|
-
runData: {}
|
|
94
|
-
},
|
|
95
|
-
executionData: {
|
|
96
|
-
metadata: {},
|
|
97
|
-
contextData: {},
|
|
98
|
-
waitingExecution: {},
|
|
99
|
-
waitingExecutionSource: null,
|
|
100
|
-
nodeExecutionStack: [
|
|
101
|
-
{
|
|
102
|
-
node: workflowInstance.getStartNode(),
|
|
103
|
-
data: {
|
|
104
|
-
main: [[testData.trigger?.input ?? { json: {} }]]
|
|
105
|
-
},
|
|
106
|
-
source: null
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const workflowExecute = new import_n8n_core.WorkflowExecute(additionalData, executionMode, runExecutionData);
|
|
112
|
-
executionData = await workflowExecute.processRunExecutionData(workflowInstance);
|
|
113
|
-
const result = await waitPromise.promise;
|
|
114
|
-
return { executionData, result, nodeExecutionOrder };
|
|
115
|
-
}
|
|
116
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
117
|
-
0 && (module.exports = {
|
|
118
|
-
executeWorkflow
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=ExecuteWorkflow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../test/nodes/ExecuteWorkflow.ts"],"sourcesContent":["import { Container } from '@n8n/di';\nimport { mock } from 'jest-mock-extended';\nimport { ExecutionLifecycleHooks, WorkflowExecute } from 'n8n-core';\nimport type {\n\tIRun,\n\tIRunExecutionData,\n\tIWorkflowExecuteAdditionalData,\n\tWorkflowTestData,\n} from 'n8n-workflow';\nimport { createDeferredPromise, Workflow } from 'n8n-workflow';\nimport nock from 'nock';\n\nimport { CredentialsHelper } from './credentials-helper';\nimport { NodeTypes } from './node-types';\n\nexport async function executeWorkflow(testData: WorkflowTestData) {\n\tconst nodeTypes = Container.get(NodeTypes);\n\n\tconst credentialsHelper = Container.get(CredentialsHelper);\n\tcredentialsHelper.setCredentials(testData.credentials ?? {});\n\n\tif (testData.nock) {\n\t\tconst { baseUrl, mocks } = testData.nock;\n\t\tconst agent = nock(baseUrl);\n\t\tmocks.forEach(\n\t\t\t({\n\t\t\t\tmethod,\n\t\t\t\tpath,\n\t\t\t\tstatusCode,\n\t\t\t\trequestBody,\n\t\t\t\trequestHeaders,\n\t\t\t\tresponseBody,\n\t\t\t\tresponseHeaders,\n\t\t\t}) => {\n\t\t\t\tlet mock = agent[method](path, requestBody);\n\n\t\t\t\t// nock interceptor reqheaders option is ignored, so we chain matchHeader()\n\t\t\t\t// agent[method](path, requestBody, { reqheaders: requestHeaders }).reply(statusCode, responseBody, responseHeaders)\n\t\t\t\t// https://github.com/nock/nock/issues/2545\n\t\t\t\tif (requestHeaders && Object.keys(requestHeaders).length > 0) {\n\t\t\t\t\tObject.entries(requestHeaders).forEach(([key, value]) => {\n\t\t\t\t\t\tmock = mock.matchHeader(key, value);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tmock.reply(statusCode, responseBody, responseHeaders);\n\t\t\t},\n\t\t);\n\t}\n\n\tconst executionMode = testData.trigger?.mode ?? 'manual';\n\tconst workflowInstance = new Workflow({\n\t\tid: 'test',\n\t\tnodes: testData.input.workflowData.nodes,\n\t\tconnections: testData.input.workflowData.connections,\n\t\tactive: false,\n\t\tnodeTypes,\n\t\tsettings: testData.input.workflowData.settings,\n\t});\n\tconst waitPromise = createDeferredPromise<IRun>();\n\tconst nodeExecutionOrder: string[] = [];\n\n\tconst hooks = new ExecutionLifecycleHooks('trigger', '1', mock());\n\thooks.addHandler('nodeExecuteAfter', (nodeName) => {\n\t\tnodeExecutionOrder.push(nodeName);\n\t});\n\thooks.addHandler('workflowExecuteAfter', (fullRunData) => waitPromise.resolve(fullRunData));\n\n\tconst additionalData = mock<IWorkflowExecuteAdditionalData>({\n\t\thooks,\n\t\t// Get from node.parameters\n\t\tcurrentNodeParameters: undefined,\n\t});\n\tadditionalData.credentialsHelper = credentialsHelper;\n\n\tlet executionData: IRun;\n\tconst runExecutionData: IRunExecutionData = {\n\t\tresultData: {\n\t\t\trunData: {},\n\t\t},\n\t\texecutionData: {\n\t\t\tmetadata: {},\n\t\t\tcontextData: {},\n\t\t\twaitingExecution: {},\n\t\t\twaitingExecutionSource: null,\n\t\t\tnodeExecutionStack: [\n\t\t\t\t{\n\t\t\t\t\tnode: workflowInstance.getStartNode()!,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tmain: [[testData.trigger?.input ?? { json: {} }]],\n\t\t\t\t\t},\n\t\t\t\t\tsource: null,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n\tconst workflowExecute = new WorkflowExecute(additionalData, executionMode, runExecutionData);\n\texecutionData = await workflowExecute.processRunExecutionData(workflowInstance);\n\n\tconst result = await waitPromise.promise;\n\treturn { executionData, result, nodeExecutionOrder };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA0B;AAC1B,gCAAqB;AACrB,sBAAyD;AAOzD,0BAAgD;AAChD,kBAAiB;AAEjB,gCAAkC;AAClC,wBAA0B;AAE1B,eAAsB,gBAAgB,UAA4B;AACjE,QAAM,YAAY,oBAAU,IAAI,2BAAS;AAEzC,QAAM,oBAAoB,oBAAU,IAAI,2CAAiB;AACzD,oBAAkB,eAAe,SAAS,eAAe,CAAC,CAAC;AAE3D,MAAI,SAAS,MAAM;AAClB,UAAM,EAAE,SAAS,MAAM,IAAI,SAAS;AACpC,UAAM,YAAQ,YAAAA,SAAK,OAAO;AAC1B,UAAM;AAAA,MACL,CAAC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,MAAM;AACL,YAAIC,QAAO,MAAM,MAAM,EAAE,MAAM,WAAW;AAK1C,YAAI,kBAAkB,OAAO,KAAK,cAAc,EAAE,SAAS,GAAG;AAC7D,iBAAO,QAAQ,cAAc,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACxD,YAAAA,QAAOA,MAAK,YAAY,KAAK,KAAK;AAAA,UACnC,CAAC;AAAA,QACF;AAEA,QAAAA,MAAK,MAAM,YAAY,cAAc,eAAe;AAAA,MACrD;AAAA,IACD;AAAA,EACD;AAEA,QAAM,gBAAgB,SAAS,SAAS,QAAQ;AAChD,QAAM,mBAAmB,IAAI,6BAAS;AAAA,IACrC,IAAI;AAAA,IACJ,OAAO,SAAS,MAAM,aAAa;AAAA,IACnC,aAAa,SAAS,MAAM,aAAa;AAAA,IACzC,QAAQ;AAAA,IACR;AAAA,IACA,UAAU,SAAS,MAAM,aAAa;AAAA,EACvC,CAAC;AACD,QAAM,kBAAc,2CAA4B;AAChD,QAAM,qBAA+B,CAAC;AAEtC,QAAM,QAAQ,IAAI,wCAAwB,WAAW,SAAK,gCAAK,CAAC;AAChE,QAAM,WAAW,oBAAoB,CAAC,aAAa;AAClD,uBAAmB,KAAK,QAAQ;AAAA,EACjC,CAAC;AACD,QAAM,WAAW,wBAAwB,CAAC,gBAAgB,YAAY,QAAQ,WAAW,CAAC;AAE1F,QAAM,qBAAiB,gCAAqC;AAAA,IAC3D;AAAA;AAAA,IAEA,uBAAuB;AAAA,EACxB,CAAC;AACD,iBAAe,oBAAoB;AAEnC,MAAI;AACJ,QAAM,mBAAsC;AAAA,IAC3C,YAAY;AAAA,MACX,SAAS,CAAC;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACd,UAAU,CAAC;AAAA,MACX,aAAa,CAAC;AAAA,MACd,kBAAkB,CAAC;AAAA,MACnB,wBAAwB;AAAA,MACxB,oBAAoB;AAAA,QACnB;AAAA,UACC,MAAM,iBAAiB,aAAa;AAAA,UACpC,MAAM;AAAA,YACL,MAAM,CAAC,CAAC,SAAS,SAAS,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAAA,UACjD;AAAA,UACA,QAAQ;AAAA,QACT;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACA,QAAM,kBAAkB,IAAI,gCAAgB,gBAAgB,eAAe,gBAAgB;AAC3F,kBAAgB,MAAM,gBAAgB,wBAAwB,gBAAgB;AAE9E,QAAM,SAAS,MAAM,YAAY;AACjC,SAAO,EAAE,eAAe,QAAQ,mBAAmB;AACpD;","names":["nock","mock"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
if (decorator = decorators[i])
|
|
23
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result) __defProp(target, key, result);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
var credential_types_exports = {};
|
|
28
|
-
__export(credential_types_exports, {
|
|
29
|
-
CredentialTypes: () => CredentialTypes
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(credential_types_exports);
|
|
32
|
-
var import_di = require("@n8n/di");
|
|
33
|
-
let CredentialTypes = class {
|
|
34
|
-
constructor(loadNodesAndCredentials) {
|
|
35
|
-
this.loadNodesAndCredentials = loadNodesAndCredentials;
|
|
36
|
-
}
|
|
37
|
-
recognizes(type) {
|
|
38
|
-
return this.loadNodesAndCredentials.recognizesCredential(type);
|
|
39
|
-
}
|
|
40
|
-
getByName(type) {
|
|
41
|
-
return this.loadNodesAndCredentials.getCredential(type).type;
|
|
42
|
-
}
|
|
43
|
-
getSupportedNodes(type) {
|
|
44
|
-
return this.loadNodesAndCredentials.known.credentials[type]?.supportedNodes ?? [];
|
|
45
|
-
}
|
|
46
|
-
getParentTypes(_type) {
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
CredentialTypes = __decorateClass([
|
|
51
|
-
(0, import_di.Service)()
|
|
52
|
-
], CredentialTypes);
|
|
53
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
-
0 && (module.exports = {
|
|
55
|
-
CredentialTypes
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=credential-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../test/nodes/credential-types.ts"],"sourcesContent":["import { Service } from '@n8n/di';\nimport type { ICredentialType, ICredentialTypes } from 'n8n-workflow';\n\nimport { LoadNodesAndCredentials } from './load-nodes-and-credentials';\n\n@Service()\nexport class CredentialTypes implements ICredentialTypes {\n\tconstructor(private readonly loadNodesAndCredentials: LoadNodesAndCredentials) {}\n\n\trecognizes(type: string): boolean {\n\t\treturn this.loadNodesAndCredentials.recognizesCredential(type);\n\t}\n\n\tgetByName(type: string): ICredentialType {\n\t\treturn this.loadNodesAndCredentials.getCredential(type).type;\n\t}\n\n\tgetSupportedNodes(type: string): string[] {\n\t\treturn this.loadNodesAndCredentials.known.credentials[type]?.supportedNodes ?? [];\n\t}\n\n\tgetParentTypes(_type: string): string[] {\n\t\treturn [];\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAwB;AAMjB,IAAM,kBAAN,MAAkD;AAAA,EACxD,YAA6B,yBAAkD;AAAlD;AAAA,EAAmD;AAAA,EAEhF,WAAW,MAAuB;AACjC,WAAO,KAAK,wBAAwB,qBAAqB,IAAI;AAAA,EAC9D;AAAA,EAEA,UAAU,MAA+B;AACxC,WAAO,KAAK,wBAAwB,cAAc,IAAI,EAAE;AAAA,EACzD;AAAA,EAEA,kBAAkB,MAAwB;AACzC,WAAO,KAAK,wBAAwB,MAAM,YAAY,IAAI,GAAG,kBAAkB,CAAC;AAAA,EACjF;AAAA,EAEA,eAAe,OAAyB;AACvC,WAAO,CAAC;AAAA,EACT;AACD;AAlBa,kBAAN;AAAA,MADN,mBAAQ;AAAA,GACI;","names":[]}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
if (decorator = decorators[i])
|
|
23
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result) __defProp(target, key, result);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
var credentials_helper_exports = {};
|
|
28
|
-
__export(credentials_helper_exports, {
|
|
29
|
-
CredentialsHelper: () => CredentialsHelper
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(credentials_helper_exports);
|
|
32
|
-
var import_di = require("@n8n/di");
|
|
33
|
-
var import_n8n_core = require("n8n-core");
|
|
34
|
-
var import_n8n_workflow = require("n8n-workflow");
|
|
35
|
-
var import_credential_types = require("./credential-types");
|
|
36
|
-
let CredentialsHelper = class extends import_n8n_workflow.ICredentialsHelper {
|
|
37
|
-
constructor() {
|
|
38
|
-
super(...arguments);
|
|
39
|
-
this.credentialsMap = {};
|
|
40
|
-
}
|
|
41
|
-
setCredentials(credentialsMap) {
|
|
42
|
-
this.credentialsMap = credentialsMap;
|
|
43
|
-
}
|
|
44
|
-
getCredentialsProperties() {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
async authenticate(credentials, typeName, requestParams) {
|
|
48
|
-
const credentialType = import_di.Container.get(import_credential_types.CredentialTypes).getByName(typeName);
|
|
49
|
-
if (typeof credentialType.authenticate === "function") {
|
|
50
|
-
return await credentialType.authenticate(credentials, requestParams);
|
|
51
|
-
}
|
|
52
|
-
return requestParams;
|
|
53
|
-
}
|
|
54
|
-
async preAuthentication(_helpers, _credentials, _typeName, _node, _credentialsExpired) {
|
|
55
|
-
return void 0;
|
|
56
|
-
}
|
|
57
|
-
getParentTypes(_name) {
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
async getDecrypted(_additionalData, _nodeCredentials, type) {
|
|
61
|
-
return this.credentialsMap[type] ?? {};
|
|
62
|
-
}
|
|
63
|
-
async getCredentials(_nodeCredentials, _type) {
|
|
64
|
-
return new import_n8n_core.Credentials({ id: null, name: "" }, "", "");
|
|
65
|
-
}
|
|
66
|
-
async updateCredentials(_nodeCredentials, _type, _data) {
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
CredentialsHelper = __decorateClass([
|
|
70
|
-
(0, import_di.Service)()
|
|
71
|
-
], CredentialsHelper);
|
|
72
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
-
0 && (module.exports = {
|
|
74
|
-
CredentialsHelper
|
|
75
|
-
});
|
|
76
|
-
//# sourceMappingURL=credentials-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../test/nodes/credentials-helper.ts"],"sourcesContent":["import { Container, Service } from '@n8n/di';\nimport { Credentials } from 'n8n-core';\nimport { ICredentialsHelper } from 'n8n-workflow';\nimport type {\n\tICredentialDataDecryptedObject,\n\tIHttpRequestHelper,\n\tIHttpRequestOptions,\n\tINode,\n\tINodeCredentialsDetails,\n\tIWorkflowExecuteAdditionalData,\n} from 'n8n-workflow';\n\nimport { CredentialTypes } from './credential-types';\n\n@Service()\nexport class CredentialsHelper extends ICredentialsHelper {\n\tprivate credentialsMap: Record<string, ICredentialDataDecryptedObject> = {};\n\n\tsetCredentials(credentialsMap: Record<string, ICredentialDataDecryptedObject>) {\n\t\tthis.credentialsMap = credentialsMap;\n\t}\n\n\tgetCredentialsProperties() {\n\t\treturn [];\n\t}\n\n\tasync authenticate(\n\t\tcredentials: ICredentialDataDecryptedObject,\n\t\ttypeName: string,\n\t\trequestParams: IHttpRequestOptions,\n\t): Promise<IHttpRequestOptions> {\n\t\tconst credentialType = Container.get(CredentialTypes).getByName(typeName);\n\t\tif (typeof credentialType.authenticate === 'function') {\n\t\t\treturn await credentialType.authenticate(credentials, requestParams);\n\t\t}\n\t\treturn requestParams;\n\t}\n\n\tasync preAuthentication(\n\t\t_helpers: IHttpRequestHelper,\n\t\t_credentials: ICredentialDataDecryptedObject,\n\t\t_typeName: string,\n\t\t_node: INode,\n\t\t_credentialsExpired: boolean,\n\t): Promise<ICredentialDataDecryptedObject | undefined> {\n\t\treturn undefined;\n\t}\n\n\tgetParentTypes(_name: string): string[] {\n\t\treturn [];\n\t}\n\n\tasync getDecrypted(\n\t\t_additionalData: IWorkflowExecuteAdditionalData,\n\t\t_nodeCredentials: INodeCredentialsDetails,\n\t\ttype: string,\n\t): Promise<ICredentialDataDecryptedObject> {\n\t\treturn this.credentialsMap[type] ?? {};\n\t}\n\n\tasync getCredentials(\n\t\t_nodeCredentials: INodeCredentialsDetails,\n\t\t_type: string,\n\t): Promise<Credentials> {\n\t\treturn new Credentials({ id: null, name: '' }, '', '');\n\t}\n\n\tasync updateCredentials(\n\t\t_nodeCredentials: INodeCredentialsDetails,\n\t\t_type: string,\n\t\t_data: ICredentialDataDecryptedObject,\n\t): Promise<void> {}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAmC;AACnC,sBAA4B;AAC5B,0BAAmC;AAUnC,8BAAgC;AAGzB,IAAM,oBAAN,cAAgC,uCAAmB;AAAA,EAAnD;AAAA;AACN,SAAQ,iBAAiE,CAAC;AAAA;AAAA,EAE1E,eAAe,gBAAgE;AAC9E,SAAK,iBAAiB;AAAA,EACvB;AAAA,EAEA,2BAA2B;AAC1B,WAAO,CAAC;AAAA,EACT;AAAA,EAEA,MAAM,aACL,aACA,UACA,eAC+B;AAC/B,UAAM,iBAAiB,oBAAU,IAAI,uCAAe,EAAE,UAAU,QAAQ;AACxE,QAAI,OAAO,eAAe,iBAAiB,YAAY;AACtD,aAAO,MAAM,eAAe,aAAa,aAAa,aAAa;AAAA,IACpE;AACA,WAAO;AAAA,EACR;AAAA,EAEA,MAAM,kBACL,UACA,cACA,WACA,OACA,qBACsD;AACtD,WAAO;AAAA,EACR;AAAA,EAEA,eAAe,OAAyB;AACvC,WAAO,CAAC;AAAA,EACT;AAAA,EAEA,MAAM,aACL,iBACA,kBACA,MAC0C;AAC1C,WAAO,KAAK,eAAe,IAAI,KAAK,CAAC;AAAA,EACtC;AAAA,EAEA,MAAM,eACL,kBACA,OACuB;AACvB,WAAO,IAAI,4BAAY,EAAE,IAAI,MAAM,MAAM,GAAG,GAAG,IAAI,EAAE;AAAA,EACtD;AAAA,EAEA,MAAM,kBACL,kBACA,OACA,OACgB;AAAA,EAAC;AACnB;AAzDa,oBAAN;AAAA,MADN,mBAAQ;AAAA,GACI;","names":[]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
if (decorator = decorators[i])
|
|
23
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result) __defProp(target, key, result);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
var load_nodes_and_credentials_exports = {};
|
|
28
|
-
__export(load_nodes_and_credentials_exports, {
|
|
29
|
-
LoadNodesAndCredentials: () => LoadNodesAndCredentials
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(load_nodes_and_credentials_exports);
|
|
32
|
-
var import_di = require("@n8n/di");
|
|
33
|
-
var import_n8n_core = require("n8n-core");
|
|
34
|
-
const fixSourcePath = (loadInfo) => {
|
|
35
|
-
if (!loadInfo) return;
|
|
36
|
-
loadInfo.sourcePath = loadInfo.sourcePath.replace(/^dist\//, "./").replace(/\.js$/, ".ts");
|
|
37
|
-
};
|
|
38
|
-
let LoadNodesAndCredentials = class {
|
|
39
|
-
constructor(baseDir) {
|
|
40
|
-
this.known = { nodes: {}, credentials: {} };
|
|
41
|
-
this.loader = new import_n8n_core.LazyPackageDirectoryLoader(baseDir);
|
|
42
|
-
}
|
|
43
|
-
async init() {
|
|
44
|
-
await this.loader.loadAll();
|
|
45
|
-
this.known.credentials = this.loader.known.credentials;
|
|
46
|
-
this.known.nodes = this.loader.known.nodes;
|
|
47
|
-
}
|
|
48
|
-
recognizesCredential(credentialType) {
|
|
49
|
-
return credentialType in this.known.credentials;
|
|
50
|
-
}
|
|
51
|
-
getCredential(credentialType) {
|
|
52
|
-
fixSourcePath(this.known.credentials[credentialType]);
|
|
53
|
-
return this.loader.getCredential(credentialType);
|
|
54
|
-
}
|
|
55
|
-
getNode(fullNodeType) {
|
|
56
|
-
const nodeType = fullNodeType.split(".")[1];
|
|
57
|
-
fixSourcePath(this.known.nodes[nodeType]);
|
|
58
|
-
return this.loader.getNode(nodeType);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
LoadNodesAndCredentials = __decorateClass([
|
|
62
|
-
(0, import_di.Service)()
|
|
63
|
-
], LoadNodesAndCredentials);
|
|
64
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
-
0 && (module.exports = {
|
|
66
|
-
LoadNodesAndCredentials
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=load-nodes-and-credentials.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../test/nodes/load-nodes-and-credentials.ts"],"sourcesContent":["import { Service } from '@n8n/di';\nimport { LazyPackageDirectoryLoader } from 'n8n-core';\nimport type {\n\tICredentialType,\n\tINodeType,\n\tIVersionedNodeType,\n\tKnownNodesAndCredentials,\n\tLoadedClass,\n\tLoadingDetails,\n} from 'n8n-workflow';\n\n/** This rewrites the nodes/credentials source path to load the typescript code instead of the compiled javascript code */\nconst fixSourcePath = (loadInfo: LoadingDetails) => {\n\tif (!loadInfo) return;\n\tloadInfo.sourcePath = loadInfo.sourcePath.replace(/^dist\\//, './').replace(/\\.js$/, '.ts');\n};\n\n@Service()\nexport class LoadNodesAndCredentials {\n\tprivate loader: LazyPackageDirectoryLoader;\n\n\treadonly known: KnownNodesAndCredentials = { nodes: {}, credentials: {} };\n\n\tconstructor(baseDir: string) {\n\t\tthis.loader = new LazyPackageDirectoryLoader(baseDir);\n\t}\n\n\tasync init() {\n\t\tawait this.loader.loadAll();\n\t\tthis.known.credentials = this.loader.known.credentials;\n\t\tthis.known.nodes = this.loader.known.nodes;\n\t}\n\n\trecognizesCredential(credentialType: string): boolean {\n\t\treturn credentialType in this.known.credentials;\n\t}\n\n\tgetCredential(credentialType: string): LoadedClass<ICredentialType> {\n\t\tfixSourcePath(this.known.credentials[credentialType]);\n\t\treturn this.loader.getCredential(credentialType);\n\t}\n\n\tgetNode(fullNodeType: string): LoadedClass<INodeType | IVersionedNodeType> {\n\t\tconst nodeType = fullNodeType.split('.')[1];\n\t\tfixSourcePath(this.known.nodes[nodeType]);\n\t\treturn this.loader.getNode(nodeType);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAwB;AACxB,sBAA2C;AAW3C,MAAM,gBAAgB,CAAC,aAA6B;AACnD,MAAI,CAAC,SAAU;AACf,WAAS,aAAa,SAAS,WAAW,QAAQ,WAAW,IAAI,EAAE,QAAQ,SAAS,KAAK;AAC1F;AAGO,IAAM,0BAAN,MAA8B;AAAA,EAKpC,YAAY,SAAiB;AAF7B,SAAS,QAAkC,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC,EAAE;AAGvE,SAAK,SAAS,IAAI,2CAA2B,OAAO;AAAA,EACrD;AAAA,EAEA,MAAM,OAAO;AACZ,UAAM,KAAK,OAAO,QAAQ;AAC1B,SAAK,MAAM,cAAc,KAAK,OAAO,MAAM;AAC3C,SAAK,MAAM,QAAQ,KAAK,OAAO,MAAM;AAAA,EACtC;AAAA,EAEA,qBAAqB,gBAAiC;AACrD,WAAO,kBAAkB,KAAK,MAAM;AAAA,EACrC;AAAA,EAEA,cAAc,gBAAsD;AACnE,kBAAc,KAAK,MAAM,YAAY,cAAc,CAAC;AACpD,WAAO,KAAK,OAAO,cAAc,cAAc;AAAA,EAChD;AAAA,EAEA,QAAQ,cAAmE;AAC1E,UAAM,WAAW,aAAa,MAAM,GAAG,EAAE,CAAC;AAC1C,kBAAc,KAAK,MAAM,MAAM,QAAQ,CAAC;AACxC,WAAO,KAAK,OAAO,QAAQ,QAAQ;AAAA,EACpC;AACD;AA7Ba,0BAAN;AAAA,MADN,mBAAQ;AAAA,GACI;","names":[]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
if (decorator = decorators[i])
|
|
23
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result) __defProp(target, key, result);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
var node_types_exports = {};
|
|
28
|
-
__export(node_types_exports, {
|
|
29
|
-
NodeTypes: () => NodeTypes
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(node_types_exports);
|
|
32
|
-
var import_di = require("@n8n/di");
|
|
33
|
-
var import_n8n_workflow = require("n8n-workflow");
|
|
34
|
-
let NodeTypes = class {
|
|
35
|
-
constructor(loadNodesAndCredentials) {
|
|
36
|
-
this.loadNodesAndCredentials = loadNodesAndCredentials;
|
|
37
|
-
}
|
|
38
|
-
getByName(type) {
|
|
39
|
-
return this.loadNodesAndCredentials.getNode(type).type;
|
|
40
|
-
}
|
|
41
|
-
getByNameAndVersion(type, version) {
|
|
42
|
-
const node = this.loadNodesAndCredentials.getNode(type);
|
|
43
|
-
return import_n8n_workflow.NodeHelpers.getVersionedNodeType(node.type, version);
|
|
44
|
-
}
|
|
45
|
-
getKnownTypes() {
|
|
46
|
-
return this.loadNodesAndCredentials.known.nodes;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
NodeTypes = __decorateClass([
|
|
50
|
-
(0, import_di.Service)()
|
|
51
|
-
], NodeTypes);
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
NodeTypes
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=node-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../test/nodes/node-types.ts"],"sourcesContent":["import { Service } from '@n8n/di';\nimport { NodeHelpers } from 'n8n-workflow';\nimport type { INodeType, INodeTypes, IVersionedNodeType } from 'n8n-workflow';\n\nimport { LoadNodesAndCredentials } from './load-nodes-and-credentials';\n\n@Service()\nexport class NodeTypes implements INodeTypes {\n\tconstructor(private readonly loadNodesAndCredentials: LoadNodesAndCredentials) {}\n\n\tgetByName(type: string): INodeType | IVersionedNodeType {\n\t\treturn this.loadNodesAndCredentials.getNode(type).type;\n\t}\n\n\tgetByNameAndVersion(type: string, version?: number): INodeType {\n\t\tconst node = this.loadNodesAndCredentials.getNode(type);\n\t\treturn NodeHelpers.getVersionedNodeType(node.type, version);\n\t}\n\n\tgetKnownTypes() {\n\t\treturn this.loadNodesAndCredentials.known.nodes;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAwB;AACxB,0BAA4B;AAMrB,IAAM,YAAN,MAAsC;AAAA,EAC5C,YAA6B,yBAAkD;AAAlD;AAAA,EAAmD;AAAA,EAEhF,UAAU,MAA8C;AACvD,WAAO,KAAK,wBAAwB,QAAQ,IAAI,EAAE;AAAA,EACnD;AAAA,EAEA,oBAAoB,MAAc,SAA6B;AAC9D,UAAM,OAAO,KAAK,wBAAwB,QAAQ,IAAI;AACtD,WAAO,gCAAY,qBAAqB,KAAK,MAAM,OAAO;AAAA,EAC3D;AAAA,EAEA,gBAAgB;AACf,WAAO,KAAK,wBAAwB,MAAM;AAAA,EAC3C;AACD;AAfa,YAAN;AAAA,MADN,mBAAQ;AAAA,GACI;","names":[]}
|