n8n-nodes-apiinfo 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.
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiInfo = void 0;
|
|
4
|
+
class ApiInfo {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Api Info',
|
|
8
|
+
name: 'apiInfo',
|
|
9
|
+
icon: 'file:apiInfo.svg',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
13
|
+
description: 'Interact with ApiInfo API',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'Api Info',
|
|
16
|
+
},
|
|
17
|
+
inputs: ['main'],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
credentials: [],
|
|
20
|
+
properties: [
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Resource',
|
|
23
|
+
name: 'resource',
|
|
24
|
+
type: 'options',
|
|
25
|
+
noDataExpression: true,
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
name: 'Info',
|
|
29
|
+
value: 'info',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
default: 'info',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Operation',
|
|
36
|
+
name: 'operation',
|
|
37
|
+
type: 'options',
|
|
38
|
+
noDataExpression: true,
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
resource: [
|
|
42
|
+
'info',
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
options: [
|
|
47
|
+
{
|
|
48
|
+
name: 'Get',
|
|
49
|
+
value: 'get',
|
|
50
|
+
action: 'Get info',
|
|
51
|
+
description: 'Get information',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
default: 'get',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async execute() {
|
|
60
|
+
const items = this.getInputData();
|
|
61
|
+
const returnData = [];
|
|
62
|
+
const length = items.length;
|
|
63
|
+
const qs = {};
|
|
64
|
+
let responseData;
|
|
65
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
66
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
67
|
+
for (let i = 0; i < length; i++) {
|
|
68
|
+
if (resource === 'info') {
|
|
69
|
+
if (operation === 'get') {
|
|
70
|
+
// Placeholder for actual API call
|
|
71
|
+
responseData = {
|
|
72
|
+
message: 'ApiInfo Node executed successfully',
|
|
73
|
+
timestamp: new Date().toISOString(),
|
|
74
|
+
inputIndex: i,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (Array.isArray(responseData)) {
|
|
79
|
+
returnData.push.apply(returnData, responseData);
|
|
80
|
+
}
|
|
81
|
+
else if (responseData !== undefined) {
|
|
82
|
+
returnData.push({ json: responseData });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [returnData];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.ApiInfo = ApiInfo;
|
|
89
|
+
//# sourceMappingURL=ApiInfo.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiInfo.node.js","sourceRoot":"","sources":["../../../nodes/ApiInfo/ApiInfo.node.ts"],"names":[],"mappings":";;;AAQA,MAAa,OAAO;IAApB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE;gBACN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,EAAE;YAC7B,IAAI,QAAQ,KAAK,MAAM,EAAE;gBACrB,IAAI,SAAS,KAAK,KAAK,EAAE;oBACrB,kCAAkC;oBAClC,YAAY,GAAG;wBACX,OAAO,EAAE,oCAAoC;wBAC7C,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBACnC,UAAU,EAAE,CAAC;qBAChB,CAAC;iBACL;aACJ;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;gBAC7B,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,YAAoC,CAAC,CAAC;aAC3E;iBAAM,IAAI,YAAY,KAAK,SAAS,EAAE;gBACnC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAwB,CAAC,CAAC;aACjE;SACJ;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;CACJ;AAlFD,0BAkFC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-apiinfo",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n node for ApiInfo",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package"
|
|
7
|
+
],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "User",
|
|
11
|
+
"email": "user@example.com"
|
|
12
|
+
},
|
|
13
|
+
"main": "index.js",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && gulp build:icons",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"lint": "tslint -p tsconfig.json -c tslint.json",
|
|
18
|
+
"test": "npm run lint && npm run build"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"n8n": {
|
|
24
|
+
"nodes": [
|
|
25
|
+
"dist/nodes/ApiInfo/ApiInfo.node.js"
|
|
26
|
+
],
|
|
27
|
+
"credentials": []
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/express": "^4.17.6",
|
|
31
|
+
"gulp": "^4.0.2",
|
|
32
|
+
"n8n-core": "^0.124.0",
|
|
33
|
+
"n8n-workflow": "^0.117.0",
|
|
34
|
+
"prettier": "^2.1.2",
|
|
35
|
+
"tslint": "^6.1.2",
|
|
36
|
+
"typescript": "^4.0.2"
|
|
37
|
+
}
|
|
38
|
+
}
|