n8n-nodes-engine4 0.0.0-stage → 1.0.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 +21 -0
- package/README.md +91 -2
- package/dist/credentials/Engine4Api.credentials.d.ts +13 -0
- package/dist/credentials/Engine4Api.credentials.js +106 -0
- package/dist/credentials/Engine4Api.credentials.js.map +1 -0
- package/dist/nodes/Engine4/Engine4.node.d.ts +20 -0
- package/dist/nodes/Engine4/Engine4.node.js +136 -0
- package/dist/nodes/Engine4/Engine4.node.js.map +1 -0
- package/dist/nodes/Engine4/Engine4.node.json +18 -0
- package/dist/nodes/Engine4/actions/record/create.d.ts +3 -0
- package/dist/nodes/Engine4/actions/record/create.js +16 -0
- package/dist/nodes/Engine4/actions/record/create.js.map +1 -0
- package/dist/nodes/Engine4/actions/record/createInView.d.ts +3 -0
- package/dist/nodes/Engine4/actions/record/createInView.js +17 -0
- package/dist/nodes/Engine4/actions/record/createInView.js.map +1 -0
- package/dist/nodes/Engine4/actions/record/getMany.d.ts +3 -0
- package/dist/nodes/Engine4/actions/record/getMany.js +94 -0
- package/dist/nodes/Engine4/actions/record/getMany.js.map +1 -0
- package/dist/nodes/Engine4/actions/record/index.d.ts +7 -0
- package/dist/nodes/Engine4/actions/record/index.js +89 -0
- package/dist/nodes/Engine4/actions/record/index.js.map +1 -0
- package/dist/nodes/Engine4/actions/record/update.d.ts +3 -0
- package/dist/nodes/Engine4/actions/record/update.js +17 -0
- package/dist/nodes/Engine4/actions/record/update.js.map +1 -0
- package/dist/nodes/Engine4/engine4.dark.svg +1 -0
- package/dist/nodes/Engine4/engine4.svg +1 -0
- package/dist/nodes/helpers/api.d.ts +10 -0
- package/dist/nodes/helpers/api.js +74 -0
- package/dist/nodes/helpers/api.js.map +1 -0
- package/dist/nodes/helpers/fields.d.ts +21 -0
- package/dist/nodes/helpers/fields.js +316 -0
- package/dist/nodes/helpers/fields.js.map +1 -0
- package/dist/nodes/helpers/functions.d.ts +7 -0
- package/dist/nodes/helpers/functions.js +195 -0
- package/dist/nodes/helpers/functions.js.map +1 -0
- package/dist/nodes/helpers/records.d.ts +7 -0
- package/dist/nodes/helpers/records.js +50 -0
- package/dist/nodes/helpers/records.js.map +1 -0
- package/dist/nodes/helpers/types.d.ts +143 -0
- package/dist/nodes/helpers/types.js +49 -0
- package/dist/nodes/helpers/types.js.map +1 -0
- package/dist/package.json +56 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +55 -5
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mobile Function GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# n8n-nodes-engine4
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This is an n8n community node. It lets you use [ENGINE4](https://www.mobile-function.com/) in your n8n workflows.
|
|
4
|
+
|
|
5
|
+
ENGINE4 by Mobile Function is a low-code platform for building business applications. Its data is organized in entities (tables) and views. This node creates, updates and finds records in your ENGINE4 entities through the ENGINE4 External API.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
8
|
+
|
|
9
|
+
[Installation](#installation)
|
|
10
|
+
[Operations](#operations)
|
|
11
|
+
[Credentials](#credentials)
|
|
12
|
+
[Compatibility](#compatibility)
|
|
13
|
+
[Usage](#usage)
|
|
14
|
+
[Resources](#resources)
|
|
15
|
+
[Version history](#version-history)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation and install the package `n8n-nodes-engine4`.
|
|
20
|
+
|
|
21
|
+
## Operations
|
|
22
|
+
|
|
23
|
+
**Record**
|
|
24
|
+
|
|
25
|
+
| Operation | Description |
|
|
26
|
+
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| Create | Creates a new record in an entity. |
|
|
28
|
+
| Create in View | Creates a new record using only the fields of an insert view of the entity. |
|
|
29
|
+
| Get Many | Finds all records of an entity that match the filters, sorted as set. Each record becomes its own n8n item, so following nodes (e.g. Update) run once per record. |
|
|
30
|
+
| Update | Updates an existing record by its Data ID. Only fields with a value are changed. |
|
|
31
|
+
|
|
32
|
+
Only entities that are released for the External API are listed. Inactive records are not returned by Get Many.
|
|
33
|
+
|
|
34
|
+
Besides these operations, the node offers **Custom API Call** to send any request to the ENGINE4 External API with the stored credential.
|
|
35
|
+
|
|
36
|
+
## Credentials
|
|
37
|
+
|
|
38
|
+
The node uses the **ENGINE4 API** credential, which logs in with an ENGINE4 user account. The access token is requested and renewed automatically.
|
|
39
|
+
|
|
40
|
+
Prerequisites:
|
|
41
|
+
|
|
42
|
+
- An ENGINE4 user that is allowed to use the External API
|
|
43
|
+
- The client ID of your ENGINE4 instance (ask your ENGINE4 administrator or mobile function GmbH)
|
|
44
|
+
|
|
45
|
+
| Field | Description |
|
|
46
|
+
| --------- | ------------------------------------------------------------------------------------------ |
|
|
47
|
+
| Base URL | URL of your ENGINE4 instance, without a trailing slash. Default: `https://prod.engine4.io` |
|
|
48
|
+
| Client ID | Client ID of your ENGINE4 instance |
|
|
49
|
+
| Username | Email address of the ENGINE4 user |
|
|
50
|
+
| Password | Password of the ENGINE4 user |
|
|
51
|
+
|
|
52
|
+
The node can only read and write what this user is allowed to access in ENGINE4. Using a dedicated user for n8n with only the permissions you need is recommended.
|
|
53
|
+
|
|
54
|
+
## Compatibility
|
|
55
|
+
|
|
56
|
+
Built with the `@n8n/node-cli` and tested with n8n 2.48.6. Requires an ENGINE4 instance with the External API enabled.
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
### Field mapping
|
|
61
|
+
|
|
62
|
+
Create, Create in View and Update load the fields of the selected entity or view. Add the fields you want to write and set their values, e.g. with expressions from previous nodes. Only these fields are sent to ENGINE4.
|
|
63
|
+
|
|
64
|
+
Fields are shown as `Label (ColumnName)`. Display-only fields such as text blocks are not offered.
|
|
65
|
+
|
|
66
|
+
### Filters in Get Many
|
|
67
|
+
|
|
68
|
+
- Each filter consists of a field, an operator and a value. System columns such as `Created Date` and `Data ID` are available as well.
|
|
69
|
+
- **Combine Filters** decides whether all filters (AND) or at least one filter (OR) must match.
|
|
70
|
+
- **Like** uses `%` and `_` as wildcards. **In List** takes several values separated by commas.
|
|
71
|
+
- Sorting is set under **Options → Sort**. To get the newest record, sort by `Created Date (System)` descending and set **Limit** to 1.
|
|
72
|
+
|
|
73
|
+
### Find and update a record
|
|
74
|
+
|
|
75
|
+
A common pattern is to look a record up and then change it:
|
|
76
|
+
|
|
77
|
+
1. **ENGINE4 → Get Many**: filter for the record, e.g. by an order number.
|
|
78
|
+
2. **ENGINE4 → Update**: set **Entity** to `By ID` with `{{ $json.EntityId }}` and **Data ID** to `{{ $json.DataId }}`, then map the fields to change.
|
|
79
|
+
|
|
80
|
+
If Get Many finds several records, Update runs once for each of them, so all matching records are updated.
|
|
81
|
+
|
|
82
|
+
When the entity comes from an expression, the field list can only be loaded once the previous node has produced data. Run the previous node once before mapping the fields.
|
|
83
|
+
|
|
84
|
+
## Resources
|
|
85
|
+
|
|
86
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
87
|
+
- [ENGINE4 API documentation](https://docs.engine4.io/api)
|
|
88
|
+
- [Mobile Function](https://www.mobile-function.com/)
|
|
89
|
+
|
|
90
|
+
## Version history
|
|
91
|
+
|
|
92
|
+
See [CHANGELOG.md](CHANGELOG.md).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialDataDecryptedObject, ICredentialTestRequest, ICredentialType, IHttpRequestHelper, Icon, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class Engine4Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: Icon;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
preAuthentication(this: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject): Promise<{
|
|
9
|
+
accessToken: string;
|
|
10
|
+
}>;
|
|
11
|
+
authenticate: IAuthenticateGeneric;
|
|
12
|
+
test: ICredentialTestRequest;
|
|
13
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Engine4Api = void 0;
|
|
4
|
+
class Engine4Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'engine4Api';
|
|
7
|
+
this.displayName = 'ENGINE4 API';
|
|
8
|
+
this.documentationUrl = 'https://docs.engine4.io/api';
|
|
9
|
+
this.icon = {
|
|
10
|
+
light: 'file:../nodes/Engine4/engine4.svg',
|
|
11
|
+
dark: 'file:../nodes/Engine4/engine4.dark.svg',
|
|
12
|
+
};
|
|
13
|
+
this.properties = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Base URL',
|
|
16
|
+
name: 'baseUrl',
|
|
17
|
+
type: 'string',
|
|
18
|
+
default: 'https://prod.engine4.io',
|
|
19
|
+
placeholder: 'e.g. https://prod.engine4.io',
|
|
20
|
+
description: 'URL of the ENGINE4 instance, without a trailing slash',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Client ID',
|
|
25
|
+
name: 'clientId',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: '',
|
|
28
|
+
description: 'Client ID of the ENGINE4 instance',
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Username',
|
|
33
|
+
name: 'username',
|
|
34
|
+
type: 'string',
|
|
35
|
+
default: '',
|
|
36
|
+
placeholder: 'e.g. name@example.com',
|
|
37
|
+
description: 'Email address of the ENGINE4 user',
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Password',
|
|
42
|
+
name: 'password',
|
|
43
|
+
type: 'string',
|
|
44
|
+
typeOptions: {
|
|
45
|
+
password: true,
|
|
46
|
+
},
|
|
47
|
+
default: '',
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Access Token',
|
|
52
|
+
name: 'accessToken',
|
|
53
|
+
type: 'hidden',
|
|
54
|
+
typeOptions: {
|
|
55
|
+
expirable: true,
|
|
56
|
+
password: true,
|
|
57
|
+
},
|
|
58
|
+
default: '',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
this.authenticate = {
|
|
62
|
+
type: 'generic',
|
|
63
|
+
properties: {
|
|
64
|
+
headers: {
|
|
65
|
+
Authorization: '=Bearer {{$credentials.accessToken}}',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
this.test = {
|
|
70
|
+
request: {
|
|
71
|
+
baseURL: '={{$credentials.baseUrl.replace(/\\/+$/, "")}}',
|
|
72
|
+
url: '/webapi/external/GetGenericEntities',
|
|
73
|
+
method: 'GET',
|
|
74
|
+
qs: {
|
|
75
|
+
listAllEntities: false,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async preAuthentication(credentials) {
|
|
81
|
+
var _a, _b;
|
|
82
|
+
const baseUrl = credentials.baseUrl.replace(/\/+$/, '');
|
|
83
|
+
const response = (await this.helpers.httpRequest({
|
|
84
|
+
method: 'POST',
|
|
85
|
+
url: `${baseUrl}/token`,
|
|
86
|
+
json: true,
|
|
87
|
+
ignoreHttpStatusErrors: true,
|
|
88
|
+
returnFullResponse: true,
|
|
89
|
+
body: {
|
|
90
|
+
client_id: credentials.clientId,
|
|
91
|
+
grant_type: 'password',
|
|
92
|
+
username: credentials.username,
|
|
93
|
+
password: credentials.password,
|
|
94
|
+
with_refresh_token: false,
|
|
95
|
+
},
|
|
96
|
+
}));
|
|
97
|
+
const token = response.body;
|
|
98
|
+
if (response.statusCode >= 400 || !(token === null || token === void 0 ? void 0 : token.access_token)) {
|
|
99
|
+
const reason = (_b = (_a = token === null || token === void 0 ? void 0 : token.error_description) !== null && _a !== void 0 ? _a : token === null || token === void 0 ? void 0 : token.error) !== null && _b !== void 0 ? _b : `HTTP ${response.statusCode}`;
|
|
100
|
+
throw new Error(`Could not log in to ENGINE4 (${reason}). Check the client ID, username and password.`);
|
|
101
|
+
}
|
|
102
|
+
return { accessToken: token.access_token };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.Engine4Api = Engine4Api;
|
|
106
|
+
//# sourceMappingURL=Engine4Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Engine4Api.credentials.js","sourceRoot":"","sources":["../../credentials/Engine4Api.credentials.ts"],"names":[],"mappings":";;;AAoBA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QAEpB,gBAAW,GAAG,aAAa,CAAC;QAE5B,qBAAgB,GAAG,6BAA6B,CAAC;QAEjD,SAAI,GAAS;YACZ,KAAK,EAAE,mCAAmC;YAC1C,IAAI,EAAE,wCAAwC;SAC9C,CAAC;QAEF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,yBAAyB;gBAClC,WAAW,EAAE,8BAA8B;gBAC3C,WAAW,EAAE,uDAAuD;gBACpE,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,mCAAmC;gBAChD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uBAAuB;gBACpC,WAAW,EAAE,mCAAmC;gBAChD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI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KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,mCAAI,QAAQ,QAAQ,CAAC,UAAU,EAAE,CAAC;YACzF,MAAM,IAAI,KAAK,CACd,gCAAgC,MAAM,gDAAgD,CACtF,CAAC;QACH,CAAC;QAED,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;IAC5C,CAAC;CAqBD;AA9GD,gCA8GC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getEntityFields, getEntityFieldsForUpdate, getFilterFields, getViewFields, searchEntities, getInsertViews } from '../helpers/functions';
|
|
3
|
+
export declare class Engine4 implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getFilterFields: typeof getFilterFields;
|
|
8
|
+
};
|
|
9
|
+
listSearch: {
|
|
10
|
+
searchEntities: typeof searchEntities;
|
|
11
|
+
searchInsertViews: typeof getInsertViews;
|
|
12
|
+
};
|
|
13
|
+
resourceMapping: {
|
|
14
|
+
getEntityFields: typeof getEntityFields;
|
|
15
|
+
getEntityFieldsForUpdate: typeof getEntityFieldsForUpdate;
|
|
16
|
+
getViewFields: typeof getViewFields;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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.Engine4 = void 0;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const record = __importStar(require("./actions/record"));
|
|
39
|
+
const functions_1 = require("../helpers/functions");
|
|
40
|
+
class Engine4 {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.description = {
|
|
43
|
+
displayName: 'ENGINE4',
|
|
44
|
+
name: 'engine4',
|
|
45
|
+
icon: { light: 'file:engine4.svg', dark: 'file:engine4.dark.svg' },
|
|
46
|
+
group: ['output'],
|
|
47
|
+
version: [1],
|
|
48
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
49
|
+
description: 'Create, update and find records in your ENGINE4 entities and views',
|
|
50
|
+
defaults: {
|
|
51
|
+
name: 'ENGINE4',
|
|
52
|
+
},
|
|
53
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
54
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
55
|
+
usableAsTool: true,
|
|
56
|
+
credentials: [
|
|
57
|
+
{
|
|
58
|
+
name: 'engine4Api',
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
properties: [
|
|
63
|
+
{
|
|
64
|
+
displayName: 'Resource',
|
|
65
|
+
name: 'resource',
|
|
66
|
+
type: 'options',
|
|
67
|
+
noDataExpression: true,
|
|
68
|
+
options: [
|
|
69
|
+
{
|
|
70
|
+
name: 'Record',
|
|
71
|
+
value: 'record',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
default: 'record',
|
|
75
|
+
},
|
|
76
|
+
...record.description,
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
this.methods = {
|
|
80
|
+
loadOptions: {
|
|
81
|
+
getFilterFields: functions_1.getFilterFields,
|
|
82
|
+
},
|
|
83
|
+
listSearch: {
|
|
84
|
+
searchEntities: functions_1.searchEntities,
|
|
85
|
+
searchInsertViews: functions_1.getInsertViews,
|
|
86
|
+
},
|
|
87
|
+
resourceMapping: {
|
|
88
|
+
getEntityFields: functions_1.getEntityFields,
|
|
89
|
+
getEntityFieldsForUpdate: functions_1.getEntityFieldsForUpdate,
|
|
90
|
+
getViewFields: functions_1.getViewFields,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async execute() {
|
|
95
|
+
const items = this.getInputData();
|
|
96
|
+
const returnData = [];
|
|
97
|
+
for (let i = 0; i < items.length; i++) {
|
|
98
|
+
try {
|
|
99
|
+
const resource = this.getNodeParameter('resource', i);
|
|
100
|
+
const operation = this.getNodeParameter('operation', i);
|
|
101
|
+
switch (`${resource}:${operation}`) {
|
|
102
|
+
case 'record:create':
|
|
103
|
+
returnData.push(...(await record.create.execute.call(this, i)));
|
|
104
|
+
break;
|
|
105
|
+
case 'record:createInView':
|
|
106
|
+
returnData.push(...(await record.createInView.execute.call(this, i)));
|
|
107
|
+
break;
|
|
108
|
+
case 'record:getMany':
|
|
109
|
+
returnData.push(...(await record.getMany.execute.call(this, i)));
|
|
110
|
+
break;
|
|
111
|
+
case 'record:update':
|
|
112
|
+
returnData.push(...(await record.update.execute.call(this, i)));
|
|
113
|
+
break;
|
|
114
|
+
default:
|
|
115
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${operation}" for resource "${resource}" is not supported`, { itemIndex: i });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (this.continueOnFail()) {
|
|
120
|
+
returnData.push({
|
|
121
|
+
json: { error: error.message },
|
|
122
|
+
pairedItem: { item: i },
|
|
123
|
+
});
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
|
127
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
|
|
128
|
+
}
|
|
129
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return [returnData];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.Engine4 = Engine4;
|
|
136
|
+
//# sourceMappingURL=Engine4.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Engine4.node.js","sourceRoot":"","sources":["../../../nodes/Engine4/Engine4.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,+CAAqF;AAErF,yDAA2C;AAC3C,oDAO8B;AAE9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,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;wBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBAED,IAAI,KAAK,YAAY,iCAAkB,EAAE,CAAC;oBACzC,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;gBACvE,CAAC;gBAED,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAC/E,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA3GD,0BA2GC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-engine4.engine4",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Data & Storage"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://github.com/Mobile-Function-GmbH/n8n-nodes-engine4?tab=readme-ov-file#credentials"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://github.com/Mobile-Function-GmbH/n8n-nodes-engine4?tab=readme-ov-file"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const fields_1 = require("../../../helpers/fields");
|
|
6
|
+
const records_1 = require("../../../helpers/records");
|
|
7
|
+
const displayOptions = (0, fields_1.showFor)('record', ['create']);
|
|
8
|
+
exports.description = [
|
|
9
|
+
(0, fields_1.entityField)(displayOptions),
|
|
10
|
+
(0, fields_1.propertyField)(displayOptions),
|
|
11
|
+
(0, fields_1.optionsCollection)(displayOptions, [fields_1.returnTypeOption]),
|
|
12
|
+
];
|
|
13
|
+
async function execute(itemIndex) {
|
|
14
|
+
return await records_1.saveRecordFromParameters.call(this, itemIndex);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../nodes/Engine4/actions/record/create.ts"],"names":[],"mappings":";;;AAmBA,0BAKC;AAtBD,oDAMiC;AACjC,sDAAoE;AAEpE,MAAM,cAAc,GAAG,IAAA,gBAAO,EAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExC,QAAA,WAAW,GAAsB;IAC7C,IAAA,oBAAW,EAAC,cAAc,CAAC;IAC3B,IAAA,sBAAa,EAAC,cAAc,CAAC;IAC7B,IAAA,0BAAiB,EAAC,cAAc,EAAE,CAAC,yBAAgB,CAAC,CAAC;CACrD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,OAAO,MAAM,kCAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const fields_1 = require("../../../helpers/fields");
|
|
6
|
+
const records_1 = require("../../../helpers/records");
|
|
7
|
+
const displayOptions = (0, fields_1.showFor)('record', ['createInView']);
|
|
8
|
+
exports.description = [
|
|
9
|
+
(0, fields_1.entityField)(displayOptions),
|
|
10
|
+
(0, fields_1.viewField)(displayOptions),
|
|
11
|
+
(0, fields_1.propertyField)(displayOptions, 'view'),
|
|
12
|
+
(0, fields_1.optionsCollection)(displayOptions, [fields_1.returnTypeOption]),
|
|
13
|
+
];
|
|
14
|
+
async function execute(itemIndex) {
|
|
15
|
+
return await records_1.saveRecordFromParameters.call(this, itemIndex, { onlyMappedColumns: true });
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=createInView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInView.js","sourceRoot":"","sources":["../../../../../nodes/Engine4/actions/record/createInView.ts"],"names":[],"mappings":";;;AAqBA,0BAKC;AAxBD,oDAOiC;AACjC,sDAAoE;AAEpE,MAAM,cAAc,GAAG,IAAA,gBAAO,EAAC,QAAQ,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;AAE9C,QAAA,WAAW,GAAsB;IAC7C,IAAA,oBAAW,EAAC,cAAc,CAAC;IAC3B,IAAA,kBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,sBAAa,EAAC,cAAc,EAAE,MAAM,CAAC;IACrC,IAAA,0BAAiB,EAAC,cAAc,EAAE,CAAC,yBAAgB,CAAC,CAAC;CACrD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,OAAO,MAAM,kCAAwB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const api_1 = require("../../../helpers/api");
|
|
7
|
+
const fields_1 = require("../../../helpers/fields");
|
|
8
|
+
const displayOptions = (0, fields_1.showFor)('record', ['getMany']);
|
|
9
|
+
const PAGE_SIZE = 100;
|
|
10
|
+
exports.description = [
|
|
11
|
+
(0, fields_1.entityField)(displayOptions),
|
|
12
|
+
(0, fields_1.returnAllField)(displayOptions),
|
|
13
|
+
(0, fields_1.limitField)(displayOptions),
|
|
14
|
+
(0, fields_1.filtersField)(displayOptions),
|
|
15
|
+
(0, fields_1.combineFiltersField)(displayOptions),
|
|
16
|
+
(0, fields_1.optionsCollection)(displayOptions, [fields_1.sortOption]),
|
|
17
|
+
];
|
|
18
|
+
function buildFilter(rows, logic) {
|
|
19
|
+
const conditions = rows
|
|
20
|
+
.filter((row) => row.field)
|
|
21
|
+
.map((row) => {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
const operator = (_a = row.operator) !== null && _a !== void 0 ? _a : 'equal';
|
|
24
|
+
const condition = {
|
|
25
|
+
GenericName: row.field,
|
|
26
|
+
CompareOperator: fields_1.FILTER_OPERATOR_MAP[operator],
|
|
27
|
+
};
|
|
28
|
+
if (operator === 'inList') {
|
|
29
|
+
condition.Value = ((_b = row.value) !== null && _b !== void 0 ? _b : '')
|
|
30
|
+
.split(',')
|
|
31
|
+
.map((value) => value.trim().replace(/^(["'])(.*)\1$/, '$2'))
|
|
32
|
+
.filter((value) => value !== '');
|
|
33
|
+
}
|
|
34
|
+
else if (!fields_1.NO_VALUE_OPERATORS.includes(operator)) {
|
|
35
|
+
condition.Value = (_c = row.value) !== null && _c !== void 0 ? _c : '';
|
|
36
|
+
}
|
|
37
|
+
return condition;
|
|
38
|
+
});
|
|
39
|
+
if (conditions.length === 0)
|
|
40
|
+
return null;
|
|
41
|
+
const [first, ...others] = conditions;
|
|
42
|
+
if (others.length === 0)
|
|
43
|
+
return first;
|
|
44
|
+
return {
|
|
45
|
+
...first,
|
|
46
|
+
Logic: logic,
|
|
47
|
+
Groups: others.map((condition) => ({ ...condition, Logic: logic })),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function execute(itemIndex) {
|
|
51
|
+
var _a;
|
|
52
|
+
const entityId = this.getNodeParameter('entity', itemIndex, '', {
|
|
53
|
+
extractValue: true,
|
|
54
|
+
});
|
|
55
|
+
const returnAll = this.getNodeParameter('returnAll', itemIndex, false);
|
|
56
|
+
const limit = returnAll ? Infinity : this.getNodeParameter('limit', itemIndex, 50);
|
|
57
|
+
const filterRows = this.getNodeParameter('filters.conditions', itemIndex, []);
|
|
58
|
+
const logic = this.getNodeParameter('combineFilters', itemIndex, 'AND');
|
|
59
|
+
const sortRules = this.getNodeParameter('options.sort.rules', itemIndex, []);
|
|
60
|
+
const filter = buildFilter(filterRows, logic);
|
|
61
|
+
const sortings = sortRules
|
|
62
|
+
.filter((rule) => rule.field)
|
|
63
|
+
.map((rule) => ({ GenericName: rule.field, Descending: rule.descending === true }));
|
|
64
|
+
const records = [];
|
|
65
|
+
let skip = 0;
|
|
66
|
+
while (records.length < limit) {
|
|
67
|
+
const take = Math.min(PAGE_SIZE, limit - records.length);
|
|
68
|
+
const response = await api_1.fetchRecords.call(this, {
|
|
69
|
+
EntityId: entityId,
|
|
70
|
+
Take: take,
|
|
71
|
+
Skip: skip,
|
|
72
|
+
Filter: filter,
|
|
73
|
+
Sortings: sortings,
|
|
74
|
+
IsActive: true,
|
|
75
|
+
WithLongValues: true,
|
|
76
|
+
ConvertAllCustomDataToStrings: true,
|
|
77
|
+
WithTotalCount: false,
|
|
78
|
+
});
|
|
79
|
+
if (response.Items !== undefined && !Array.isArray(response.Items)) {
|
|
80
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `ENGINE4 returned the records in an unexpected format [item ${itemIndex}]`, {
|
|
81
|
+
itemIndex,
|
|
82
|
+
description: 'Check that the selected entity can be read through the ENGINE4 External API',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const page = (_a = response.Items) !== null && _a !== void 0 ? _a : [];
|
|
86
|
+
records.push(...page);
|
|
87
|
+
if (page.length < take) {
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
skip += page.length;
|
|
91
|
+
}
|
|
92
|
+
return records.map((json) => ({ json, pairedItem: { item: itemIndex } }));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=getMany.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMany.js","sourceRoot":"","sources":["../../../../../nodes/Engine4/actions/record/getMany.ts"],"names":[],"mappings":";;;AA6EA,0BA0DC;AAtID,+CAAkD;AAElD,8CAAoD;AACpD,oDAWiC;AAIjC,MAAM,cAAc,GAAG,IAAA,gBAAO,EAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AAEtD,MAAM,SAAS,GAAG,GAAG,CAAC;AAET,QAAA,WAAW,GAAsB;IAC7C,IAAA,oBAAW,EAAC,cAAc,CAAC;IAC3B,IAAA,uBAAc,EAAC,cAAc,CAAC;IAC9B,IAAA,mBAAU,EAAC,cAAc,CAAC;IAC1B,IAAA,qBAAY,EAAC,cAAc,CAAC;IAC5B,IAAA,4BAAmB,EAAC,cAAc,CAAC;IACnC,IAAA,0BAAiB,EAAC,cAAc,EAAE,CAAC,mBAAU,CAAC,CAAC;CAC/C,CAAC;AAaF,SAAS,WAAW,CAAC,IAAiB,EAAE,KAAmB;IAC1D,MAAM,UAAU,GAAmB,IAAI;SACrC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC;SAC1B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;;QACZ,MAAM,QAAQ,GAAG,MAAA,GAAG,CAAC,QAAQ,mCAAI,OAAO,CAAC;QACzC,MAAM,SAAS,GAAiB;YAC/B,WAAW,EAAE,GAAG,CAAC,KAAe;YAChC,eAAe,EAAE,4BAAmB,CAAC,QAAQ,CAAC;SAC9C,CAAC;QAEF,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC3B,SAAS,CAAC,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C,cAAc,EAAE,KAAK;SACrB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACpE,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,8DAA8D,SAAS,GAAG,EAC1E;gBACC,SAAS;gBACT,WAAW,EACV,6EAA6E;aAC9E,CACD,CAAC;QACH,CAAC;QAED,MAAM,IAAI,GAAG,MAAA,QAAQ,CAAC,KAAK,mCAAI,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAEtB,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;YACxB,MAAM;QACP,CAAC;QACD,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import * as create from './create';
|
|
3
|
+
import * as createInView from './createInView';
|
|
4
|
+
import * as getMany from './getMany';
|
|
5
|
+
import * as update from './update';
|
|
6
|
+
export { create, createInView, getMany, update };
|
|
7
|
+
export declare const description: INodeProperties[];
|