n8n-nodes-acumatica 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/dist/nodes/ACM_Default_24_200_001/acu.png +0 -0
- package/dist/nodes/ACM_Default_25_200_001/acu.png +0 -0
- package/dist/package-lock.json +32607 -0
- package/dist/package.json +48 -0
- package/dist/src/credentials/AcumaticaOAuth2Api.credentials.d.ts +9 -0
- package/dist/src/credentials/AcumaticaOAuth2Api.credentials.js +95 -0
- package/dist/src/credentials/AcumaticaOAuth2Api.d.ts +9 -0
- package/dist/src/credentials/AcumaticaOAuth2Api.js +95 -0
- package/dist/src/nodes/ACM_Default_24_200_001/ACM_Default_24_200_001.node.d.ts +4 -0
- package/dist/src/nodes/ACM_Default_24_200_001/ACM_Default_24_200_001.node.js +72 -0
- package/dist/src/nodes/ACM_Default_24_200_001/swagger.json +102005 -0
- package/dist/src/nodes/ACM_Default_25_200_001/ACM_Default_25_200_001.node.d.ts +4 -0
- package/dist/src/nodes/ACM_Default_25_200_001/ACM_Default_25_200_001.node.js +72 -0
- package/dist/src/nodes/ACM_Default_25_200_001/swagger.json +102239 -0
- package/dist/src/parsers/AcumaticaOperationParser.d.ts +7 -0
- package/dist/src/parsers/AcumaticaOperationParser.js +77 -0
- package/dist/src/parsers/AcumaticaResourceParser.d.ts +14 -0
- package/dist/src/parsers/AcumaticaResourceParser.js +97 -0
- package/dist/tsconfig.json +25 -0
- package/package.json +48 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefaultOperationParser } from '@devlikeapro/n8n-openapi-node';
|
|
2
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
export declare class AcumaticaOperationParser extends DefaultOperationParser {
|
|
4
|
+
name(operation: OpenAPIV3.OperationObject, context: any): string;
|
|
5
|
+
value(operation: OpenAPIV3.OperationObject, context: any): string;
|
|
6
|
+
action(operation: OpenAPIV3.OperationObject, context: any): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AcumaticaOperationParser = void 0;
|
|
37
|
+
const n8n_openapi_node_1 = require("@devlikeapro/n8n-openapi-node");
|
|
38
|
+
const lodash = __importStar(require("lodash"));
|
|
39
|
+
class AcumaticaOperationParser extends n8n_openapi_node_1.DefaultOperationParser {
|
|
40
|
+
name(operation, context) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const method = context.method.toUpperCase();
|
|
43
|
+
switch (method) {
|
|
44
|
+
case 'GET':
|
|
45
|
+
return ((_a = operation.operationId) === null || _a === void 0 ? void 0 : _a.includes('GetList')) ? 'Get List' : 'Get';
|
|
46
|
+
case 'PUT':
|
|
47
|
+
return 'Insert/Update';
|
|
48
|
+
case 'DELETE':
|
|
49
|
+
return 'Delete';
|
|
50
|
+
case 'POST':
|
|
51
|
+
// Handle action endpoints
|
|
52
|
+
return ((_b = operation.operationId) === null || _b === void 0 ? void 0 : _b.includes('action')) ? 'Execute Action' : 'Create';
|
|
53
|
+
default:
|
|
54
|
+
return lodash.startCase(method);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
value(operation, context) {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
const method = context.method.toLowerCase();
|
|
60
|
+
switch (method) {
|
|
61
|
+
case 'get':
|
|
62
|
+
return ((_a = operation.operationId) === null || _a === void 0 ? void 0 : _a.includes('GetList')) ? 'getList' : 'get';
|
|
63
|
+
case 'put':
|
|
64
|
+
return 'upsert';
|
|
65
|
+
case 'delete':
|
|
66
|
+
return 'delete';
|
|
67
|
+
case 'post':
|
|
68
|
+
return ((_b = operation.operationId) === null || _b === void 0 ? void 0 : _b.includes('action')) ? 'action' : 'create';
|
|
69
|
+
default:
|
|
70
|
+
return method;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
action(operation, context) {
|
|
74
|
+
return this.name(operation, context);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.AcumaticaOperationParser = AcumaticaOperationParser;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DefaultResourceParser, DefaultOperationParser } from '@devlikeapro/n8n-openapi-node';
|
|
2
|
+
import { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
export declare class AcumaticaResourceParser extends DefaultResourceParser {
|
|
4
|
+
getResources(document: OpenAPIV3.Document): Array<{
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare class AcumaticaOperationParser extends DefaultOperationParser {
|
|
11
|
+
name(operation: OpenAPIV3.OperationObject, context: any): string;
|
|
12
|
+
value(operation: OpenAPIV3.OperationObject, context: any): string;
|
|
13
|
+
action(operation: OpenAPIV3.OperationObject, context: any): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AcumaticaOperationParser = exports.AcumaticaResourceParser = void 0;
|
|
37
|
+
const n8n_openapi_node_1 = require("@devlikeapro/n8n-openapi-node");
|
|
38
|
+
const lodash = __importStar(require("lodash"));
|
|
39
|
+
class AcumaticaResourceParser extends n8n_openapi_node_1.DefaultResourceParser {
|
|
40
|
+
// Extract entity names from paths like "/{entity}"
|
|
41
|
+
getResources(document) {
|
|
42
|
+
const entities = new Set();
|
|
43
|
+
// Parse paths to extract entity names
|
|
44
|
+
Object.keys(document.paths).forEach(path => {
|
|
45
|
+
// Match patterns like /SalesOrder, /Customer, etc.
|
|
46
|
+
const match = path.match(/^\/([A-Z][a-zA-Z]+)(?:\/|$)/);
|
|
47
|
+
if (match && match[1] !== 'entity') {
|
|
48
|
+
entities.add(match[1]);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return Array.from(entities).sort().map(entity => ({
|
|
52
|
+
name: lodash.startCase(entity),
|
|
53
|
+
value: entity,
|
|
54
|
+
description: `Operations for ${lodash.startCase(entity)}`
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.AcumaticaResourceParser = AcumaticaResourceParser;
|
|
59
|
+
class AcumaticaOperationParser extends n8n_openapi_node_1.DefaultOperationParser {
|
|
60
|
+
name(operation, context) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const method = context.method.toUpperCase();
|
|
63
|
+
switch (method) {
|
|
64
|
+
case 'GET':
|
|
65
|
+
return ((_a = operation.operationId) === null || _a === void 0 ? void 0 : _a.includes('GetList')) ? 'Get List' : 'Get';
|
|
66
|
+
case 'PUT':
|
|
67
|
+
return 'Insert/Update';
|
|
68
|
+
case 'DELETE':
|
|
69
|
+
return 'Delete';
|
|
70
|
+
case 'POST':
|
|
71
|
+
// Handle action endpoints
|
|
72
|
+
return ((_b = operation.operationId) === null || _b === void 0 ? void 0 : _b.includes('action')) ? 'Execute Action' : 'Create';
|
|
73
|
+
default:
|
|
74
|
+
return lodash.startCase(method);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
value(operation, context) {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
const method = context.method.toLowerCase();
|
|
80
|
+
switch (method) {
|
|
81
|
+
case 'get':
|
|
82
|
+
return ((_a = operation.operationId) === null || _a === void 0 ? void 0 : _a.includes('GetList')) ? 'getList' : 'get';
|
|
83
|
+
case 'put':
|
|
84
|
+
return 'upsert';
|
|
85
|
+
case 'delete':
|
|
86
|
+
return 'delete';
|
|
87
|
+
case 'post':
|
|
88
|
+
return ((_b = operation.operationId) === null || _b === void 0 ? void 0 : _b.includes('action')) ? 'action' : 'create';
|
|
89
|
+
default:
|
|
90
|
+
return method;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
action(operation, context) {
|
|
94
|
+
return this.name(operation, context);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.AcumaticaOperationParser = AcumaticaOperationParser;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2019",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": [
|
|
6
|
+
"ES2019"
|
|
7
|
+
],
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"outDir": "./dist",
|
|
10
|
+
"rootDir": "./",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"strict": false
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"**/*.ts",
|
|
19
|
+
"**/*.json"
|
|
20
|
+
],
|
|
21
|
+
"exclude": [
|
|
22
|
+
"node_modules",
|
|
23
|
+
"dist"
|
|
24
|
+
]
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-acumatica",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "n8n community nodes for Acumatica ERP API",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/lekker-solutions/n8n-nodes-acumatica",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Kyle Vanderstoep",
|
|
9
|
+
"email": "kyle@contou.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/lekker-solutions/n8n-nodes-acumatica.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"n8n-community-node-package",
|
|
17
|
+
"n8n",
|
|
18
|
+
"acumatica",
|
|
19
|
+
"erp"
|
|
20
|
+
],
|
|
21
|
+
"main": "index.js",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc && gulp build:icons",
|
|
24
|
+
"dev": "tsc --watch"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"n8n": {
|
|
30
|
+
"n8nNodesApiVersion": 1,
|
|
31
|
+
"credentials": [
|
|
32
|
+
"dist/src/credentials/AcumaticaOAuth2Api.credentials.js"
|
|
33
|
+
],
|
|
34
|
+
"nodes": [
|
|
35
|
+
"dist/src/nodes/ACM_Default_24_200_001/ACM_Default_24_200_001.node.js",
|
|
36
|
+
"dist/src/nodes/ACM_Default_25_200_001/ACM_Default_25_200_001.node.js"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^20.0.0",
|
|
41
|
+
"gulp": "^4.0.2",
|
|
42
|
+
"n8n": "^1.120.4",
|
|
43
|
+
"typescript": "^5.0.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@devlikeapro/n8n-openapi-node": "^0.1.4"
|
|
47
|
+
}
|
|
48
|
+
}
|