n8n-nodes-matrix42 0.2.1 → 0.3.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/README.md +84 -83
- package/dist/credentials/Matrix42TokenApi.credentials.js +1 -0
- package/dist/credentials/Matrix42TokenApi.credentials.js.map +1 -1
- package/dist/nodes/Matrix42/GenericFunctions.d.ts +4 -2
- package/dist/nodes/Matrix42/GenericFunctions.js +109 -2
- package/dist/nodes/Matrix42/GenericFunctions.js.map +1 -1
- package/dist/nodes/Matrix42/Matrix42TicketFunctions.js +50 -7
- package/dist/nodes/Matrix42/Matrix42TicketFunctions.js.map +1 -1
- package/dist/nodes/Matrix42/Matrix42TicketOperations.js +45 -11
- package/dist/nodes/Matrix42/Matrix42TicketOperations.js.map +1 -1
- package/dist/nodes/Matrix42/Matrix42Trigger.node.d.ts +11 -0
- package/dist/nodes/Matrix42/Matrix42Trigger.node.js +197 -0
- package/dist/nodes/Matrix42/Matrix42Trigger.node.js.map +1 -0
- package/dist/nodes/Matrix42/Matrix42Trigger.node.json +18 -0
- package/dist/nodes/Matrix42/Matrix42TriggerFunctions.d.ts +9 -0
- package/dist/nodes/Matrix42/Matrix42TriggerFunctions.js +242 -0
- package/dist/nodes/Matrix42/Matrix42TriggerFunctions.js.map +1 -0
- package/dist/package.json +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
# n8n-nodes-matrix42
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/sus-tech-gmbh/n8n-nodes-matrix42/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/n8n-nodes-matrix42)
|
|
5
|
+
[](https://www.npmjs.com/package/n8n-nodes-matrix42)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
[](LICENSE.md)
|
|
8
|
+
[](https://docs.n8n.io/integrations/community-nodes/)
|
|
9
|
+
[](CONTRIBUTING.md)
|
|
4
10
|
|
|
5
|
-
Matrix42
|
|
11
|
+
This is an n8n community node that integrates with the Matrix42 ESMP Web Services API: tickets, data fragments and objects, data queries, imports, file storage, and a polling trigger.
|
|
6
12
|
|
|
7
13
|
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
+
| Contents | |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [Installation](#installation) | Install as an n8n community node |
|
|
18
|
+
| [Operations](#operations) | All resources, operations and the trigger node |
|
|
19
|
+
| [Credentials](#credentials) | Webservice Token and Basic auth setup |
|
|
20
|
+
| [Compatibility](#compatibility) | Supported n8n, Node.js and Matrix42 versions |
|
|
21
|
+
| [Resources](#resources) | Documentation links |
|
|
22
|
+
| [Version History](#version-history) | What changed in each release |
|
|
23
|
+
| [Project](#project) | Contributing, code of conduct, security policy, releases |
|
|
24
|
+
| [Legal & Disclaimer](#legal--disclaimer) | Trademark and API-usage notes |
|
|
15
25
|
|
|
16
26
|
## Installation
|
|
17
27
|
|
|
@@ -19,91 +29,76 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
|
|
|
19
29
|
|
|
20
30
|
## Operations
|
|
21
31
|
|
|
22
|
-
This node supports multiple operations across different resources:
|
|
23
|
-
|
|
24
32
|
### Data Fragment
|
|
25
33
|
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
- **Update** (`update`): Update an existing data fragment.
|
|
31
|
-
|
|
32
|
-
- **Delete** (`delete`): Delete a data fragment by its ID.
|
|
33
|
-
|
|
34
|
+
- **Get Many** (`getAll`): Retrieve data fragments matching a search expression, with Return All / Limit paging.
|
|
35
|
+
- **Create** (`create`): Create a new data fragment in the specified Data Definition.
|
|
36
|
+
- **Update** (`update`): Update an existing data fragment.
|
|
37
|
+
- **Delete** (`delete`): Delete a data fragment by its ID.
|
|
34
38
|
|
|
35
39
|
### Data Object
|
|
36
40
|
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
- **Update** (`update`): Update an existing object.
|
|
42
|
-
|
|
43
|
-
- **Delete** (`delete`): Delete an object by its ID.
|
|
44
|
-
|
|
41
|
+
- **Create** (`create`): Create a new object for a Configuration Item.
|
|
42
|
+
- **Get** (`get`): Retrieve a single object by its ID.
|
|
43
|
+
- **Update** (`update`): Update an existing object.
|
|
44
|
+
- **Delete** (`delete`): Delete an object by its ID.
|
|
45
45
|
|
|
46
46
|
### Data Query
|
|
47
47
|
|
|
48
|
-
-
|
|
48
|
+
- **Get Data** (`getData`): Read the list items of a data query, with paging and an optional structured **User Filters** body.
|
|
49
49
|
|
|
50
50
|
### Ticket
|
|
51
51
|
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
- **Transform** (`transform`): Transform a ticket into another type.
|
|
57
|
-
|
|
58
|
-
- **Add Journal Entry** (`addJournalEntry`): Add a journal entry to a ticket.
|
|
52
|
+
- **Create** (`create`): Open a new ticket in the Service Desk, with a selectable initial State.
|
|
53
|
+
- **Close** (`close`): Close an Incident or Service Request.
|
|
54
|
+
- **Transform** (`transform`): Transform a ticket into another type.
|
|
55
|
+
- **Add Journal Entry** (`addJournalEntry`): Add a comment to a ticket, optionally with template parameters (Name/Value/Format rows) and a custom creator.
|
|
59
56
|
|
|
60
57
|
### Storage
|
|
61
58
|
|
|
62
|
-
-
|
|
59
|
+
- **Upload** (`upload`): Upload a file and attach it to a Configuration Item.
|
|
63
60
|
|
|
64
61
|
### Import
|
|
65
62
|
|
|
66
|
-
-
|
|
63
|
+
- **Execute** (`execute`): Run a predefined import definition to ingest data.
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
### Matrix42 Trigger
|
|
69
66
|
|
|
70
|
-
|
|
67
|
+
The package also ships a **Matrix42 Trigger** node - a polling trigger that starts workflows when records appear in Matrix42:
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
- **Ticket Created** (default): fires for every new Service Desk ticket, with an optional ticket-type filter (e.g. only Incidents).
|
|
70
|
+
- **Object Created**: same for any data definition, watched through a configurable creation-date attribute.
|
|
71
|
+
- **Object Created or Updated**: fires for new and changed records of any class, via the universal `TimeStamp` column.
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
1. **Server URL** — Your Matrix42 server URL (e.g. `https://matrix42.example.com`).
|
|
73
|
+
An ASQL filter, extra output columns, a per-poll limit and a Fetch Full Object option are available under Additional Fields. Output rows include the object ID as `ObjectID`, ready for the ticket operations. On activation the trigger starts from the newest existing record, so historic records never fire; "Fetch Test Event" just returns the newest matching record as a sample.
|
|
77
74
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
3. **Ignore SSL Issues (Insecure)** — Enable when the server uses a self‑signed certificate.
|
|
75
|
+
## Credentials
|
|
81
76
|
|
|
77
|
+
> **Prerequisite:** You must have access to a running Matrix42 instance with appropriate API permissions.
|
|
82
78
|
|
|
83
|
-
|
|
79
|
+
This node supports two authentication methods. Configure these under **Workflow -> Credentials**.
|
|
84
80
|
|
|
85
|
-
|
|
81
|
+
### Matrix42 Webservice Token Auth
|
|
86
82
|
|
|
87
|
-
|
|
83
|
+
1. **Server URL** - Your Matrix42 server URL (e.g. `https://matrix42.example.com`).
|
|
84
|
+
2. **Webservice Token** - Your Matrix42 API Token.
|
|
85
|
+
3. **Ignore SSL Issues (Insecure)** - Enable when the server uses a self-signed certificate.
|
|
88
86
|
|
|
87
|
+
The node exchanges the API Token for a short-lived access token and refreshes it automatically before it expires, then sends it as the Bearer token on every request.
|
|
89
88
|
|
|
90
|
-
> **Self
|
|
89
|
+
> **Self-signed certificates**: enable **Ignore SSL Issues (Insecure)** on the credential, or add the server's CA certificate to n8n's trusted store (see https://docs.n8n.io/hosting/configuration/configuration-examples/custom-certificate-authority/).
|
|
91
90
|
|
|
92
91
|
### Matrix42 Basic Auth
|
|
93
92
|
|
|
94
|
-
1.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
3. **Ignore SSL Issues (Insecure)** — As above.
|
|
93
|
+
1. **Server URL** - As above.
|
|
94
|
+
2. **User** and **Password** - Your Matrix42 user credentials.
|
|
95
|
+
3. **Ignore SSL Issues (Insecure)** - As above.
|
|
99
96
|
|
|
100
97
|
## Compatibility
|
|
101
98
|
|
|
102
|
-
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
- **Matrix42 ESMP API**: Last tested against Matrix42 26.1.0.1390.
|
|
99
|
+
- **n8n**: Node API version 1; built and tested against `n8n-workflow` 2.x. Requires n8n 1.85 or later. Last tested with n8n 2.36.9.
|
|
100
|
+
- **Node.js**: v22 or higher.
|
|
101
|
+
- **Matrix42 ESMP API**: Last tested against Matrix42 26.1.
|
|
107
102
|
|
|
108
103
|
## Resources
|
|
109
104
|
|
|
@@ -112,41 +107,47 @@ On execution, the node:
|
|
|
112
107
|
|
|
113
108
|
## Version History
|
|
114
109
|
|
|
110
|
+
**0.3.1:**
|
|
111
|
+
- Network/TLS errors (no HTTP status) are now wrapped in `NodeApiError` and surface as readable errors in the n8n UI.
|
|
112
|
+
|
|
113
|
+
**0.3.0:**
|
|
114
|
+
- New **Matrix42 Trigger** node: polling trigger with Ticket Created (default), Object Created and Object Created or Updated events, server-side type/ASQL filtering and an optional full-object fetch.
|
|
115
|
+
- Fixed Webservice Token auth failing once the access token expired (Matrix42 answers HTTP 406, which n8n's built-in refresh never reacts to); the node now refreshes the token itself.
|
|
116
|
+
- **Add Journal Entry** reworked: Parameters as Name/Value/Format rows, Creator optional (empty = API user), Type ID validated.
|
|
117
|
+
- Matrix42 validation rejections now name the rejected fields instead of a bare "Bad request".
|
|
118
|
+
|
|
115
119
|
**0.2.1:**
|
|
116
|
-
- Wrap runtime execution errors in `NodeApiError` so HTTP status codes
|
|
117
|
-
- Set the codex `nodeVersion` to `1.0
|
|
120
|
+
- Wrap runtime execution errors in `NodeApiError` so HTTP status codes surface in the n8n UI.
|
|
121
|
+
- Set the codex `nodeVersion` to `1.0`.
|
|
118
122
|
|
|
119
123
|
**0.2.0:**
|
|
120
|
-
- **Breaking (node v2):** the `ASQL` resource was split into **Data Fragment** and **Data Object**, and operations were renamed to the standard CRUD set
|
|
121
|
-
- Token auth now performs the documented API
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
- `Get Many` (fragments) gained **Return All / Limit** paging.
|
|
124
|
+
- **Breaking (node v2):** the `ASQL` resource was split into **Data Fragment** and **Data Object**, and operations were renamed to the standard CRUD set. Existing workflows must reselect the resource/operation.
|
|
125
|
+
- Token auth now performs the documented API-token -> access-token exchange.
|
|
126
|
+
- New **Data Query** resource (Get Data with paging and User Filters).
|
|
127
|
+
- Ticket **Create**: selectable **State** field and an **Extra Properties** collection for custom attributes.
|
|
128
|
+
- **Ignore SSL Issues (Insecure)** toggle and optional **Response Language** field on the credentials.
|
|
129
|
+
- **Get Many** (fragments) gained Return All / Limit paging.
|
|
127
130
|
|
|
128
131
|
**0.1.3:**
|
|
129
|
-
- Added
|
|
130
|
-
- Tickets: `addJournalEntry`
|
|
132
|
+
- Added Ticket: `addJournalEntry`.
|
|
131
133
|
|
|
132
134
|
**0.1.2:**
|
|
133
|
-
- Added
|
|
134
|
-
- Storage Operations: `uploadFile`
|
|
135
|
+
- Added Storage: `uploadFile`.
|
|
135
136
|
|
|
136
137
|
**0.1.1:**
|
|
137
|
-
- Bug
|
|
138
|
+
- Bug fixes.
|
|
138
139
|
|
|
139
140
|
**0.1.0:**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- Tickets: `createTicket`, `closeTicket`, `transformTicket`
|
|
144
|
-
- Import: `executeImportDefinition`
|
|
141
|
+
- Initial release: Data Fragment and Data Object CRUD, Ticket create/close/transform, Import execute; Token and Basic authentication.
|
|
142
|
+
|
|
143
|
+
## Project
|
|
145
144
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
| | |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| **Contributing** | [CONTRIBUTING.md](CONTRIBUTING.md) |
|
|
148
|
+
| **Code of conduct** | [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) |
|
|
149
|
+
| **Security policy** | [SECURITY.md](SECURITY.md) |
|
|
150
|
+
| **Releases** | [GitHub releases](https://github.com/sus-tech-gmbh/n8n-nodes-matrix42/releases), published to npm from CI |
|
|
150
151
|
|
|
151
152
|
## Legal & Disclaimer
|
|
152
153
|
|
|
@@ -156,7 +157,7 @@ It uses only documented, publicly available endpoints as described in the offici
|
|
|
156
157
|
|
|
157
158
|
Matrix42 **explicitly provides** a Public API and token-based authentication mechanism to support
|
|
158
159
|
third-party integrations. This node simply wraps those endpoints for easier use within n8n.
|
|
159
|
-
There is **no violation** of Matrix42
|
|
160
|
+
There is **no violation** of Matrix42's licensing or terms of service in doing so.
|
|
160
161
|
|
|
161
162
|
> **No Affiliation:**
|
|
162
163
|
> This project is **not affiliated with, endorsed, or sponsored by Matrix42 GmbH**.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matrix42TokenApi.credentials.js","sourceRoot":"","sources":["../../credentials/Matrix42TokenApi.credentials.ts"],"names":[],"mappings":";;;AASA,MAAa,gBAAgB;IAA7B;QACC,SAAI,GAAG,kBAAkB,CAAC;QAE1B,gBAAW,GAAG,oCAAoC,CAAC;QAEnD,qBAAgB,GACf,0FAA0F,CAAC;QAE5F,SAAI,GAAG,mBAA4B,CAAC;QAEpC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,mCAAmC;gBAChD,IAAI,EAAE,qCAAqC;gBAC3C,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,iGAAiG;gBACvG,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,8BAA8B;gBAC3C,IAAI,EAAE,wBAAwB;gBAC9B,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EACV,qIAAqI;aACtI;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,kBAAkB;gBACxB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,mJAAmJ;aACzJ;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,SAAS,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"Matrix42TokenApi.credentials.js","sourceRoot":"","sources":["../../credentials/Matrix42TokenApi.credentials.ts"],"names":[],"mappings":";;;AASA,MAAa,gBAAgB;IAA7B;QACC,SAAI,GAAG,kBAAkB,CAAC;QAE1B,gBAAW,GAAG,oCAAoC,CAAC;QAEnD,qBAAgB,GACf,0FAA0F,CAAC;QAE5F,SAAI,GAAG,mBAA4B,CAAC;QAEpC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,mCAAmC;gBAChD,IAAI,EAAE,qCAAqC;gBAC3C,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,kBAAkB;g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WAAW,CAAC;YACpD,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,SAAS,2DAA2D;YAC5E,4BAA4B,EAAE,WAAW,CAAC,sBAAsB,KAAK,IAAI;YACzE,OAAO,EAAE;gBACR,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,UAAU,WAAW,CAAC,eAAe,EAAE;aACtD;YACD,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,IAAI;SACV,CAAC,CAAyB,CAAC;QAE5B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IAClC,CAAC;CAqBD;AAhGD,4CAgGC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions, IPollFunctions } from 'n8n-workflow';
|
|
2
|
+
type Matrix42Context = IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions;
|
|
2
3
|
export declare function normalizeServerUrl(serverUrl: string): string;
|
|
3
4
|
export declare function escapeAsqlString(value: string): string;
|
|
4
|
-
export declare function matrix42ApiRequest(this:
|
|
5
|
+
export declare function matrix42ApiRequest(this: Matrix42Context, method: IHttpRequestMethods, endpoint: `/${string}`, body: object, query?: IDataObject, uri?: string, contentType?: string): Promise<any>;
|
|
6
|
+
export {};
|
|
@@ -3,16 +3,85 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeServerUrl = normalizeServerUrl;
|
|
4
4
|
exports.escapeAsqlString = escapeAsqlString;
|
|
5
5
|
exports.matrix42ApiRequest = matrix42ApiRequest;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
const EXPIRY_BUFFER_MS = 60000;
|
|
8
|
+
const FALLBACK_LIFETIME_MS = 5 * 60000;
|
|
9
|
+
const accessTokenCache = new WeakMap();
|
|
6
10
|
function normalizeServerUrl(serverUrl) {
|
|
7
11
|
return serverUrl.replace(/\/+$/, '');
|
|
8
12
|
}
|
|
9
13
|
function escapeAsqlString(value) {
|
|
10
14
|
return String(value !== null && value !== void 0 ? value : '').replace(/'/g, "''");
|
|
11
15
|
}
|
|
16
|
+
function decodeJwtExpiryMs(token) {
|
|
17
|
+
try {
|
|
18
|
+
const payload = JSON.parse(Buffer.from(token.split('.')[1], 'base64url').toString('utf8'));
|
|
19
|
+
if (typeof payload.exp === 'number' && Number.isFinite(payload.exp)) {
|
|
20
|
+
return payload.exp * 1000;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
async function matrix42RawRequest(options) {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
try {
|
|
30
|
+
const response = (await this.helpers.httpRequest({
|
|
31
|
+
...options,
|
|
32
|
+
returnFullResponse: true,
|
|
33
|
+
ignoreHttpStatusErrors: true,
|
|
34
|
+
}));
|
|
35
|
+
return { statusCode: response.statusCode, body: response.body };
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
const thrown = error;
|
|
39
|
+
const statusCode = Number((_b = (_a = thrown === null || thrown === void 0 ? void 0 : thrown.response) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : thrown === null || thrown === void 0 ? void 0 : thrown.httpCode);
|
|
40
|
+
if (Number.isFinite(statusCode) && statusCode > 0) {
|
|
41
|
+
return { statusCode, body: (_c = thrown === null || thrown === void 0 ? void 0 : thrown.response) === null || _c === void 0 ? void 0 : _c.data, raw: error };
|
|
42
|
+
}
|
|
43
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function getAccessToken(credentials, forceRefresh = false) {
|
|
47
|
+
var _a, _b, _c, _d;
|
|
48
|
+
const cached = accessTokenCache.get(this);
|
|
49
|
+
if (!forceRefresh && cached && cached.expiresAt - EXPIRY_BUFFER_MS > Date.now()) {
|
|
50
|
+
return cached.accessToken;
|
|
51
|
+
}
|
|
52
|
+
const response = await matrix42RawRequest.call(this, {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
url: `${normalizeServerUrl(credentials.serverUrl)}/m42Services/api/ApiToken/GenerateAccessTokenFromApiToken`,
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/json',
|
|
57
|
+
Authorization: `Bearer ${credentials.webserviceToken}`,
|
|
58
|
+
},
|
|
59
|
+
body: {},
|
|
60
|
+
json: true,
|
|
61
|
+
skipSslCertificateValidation: credentials.allowUnauthorizedCerts === true,
|
|
62
|
+
});
|
|
63
|
+
const rawToken = response.statusCode >= 200 && response.statusCode < 300
|
|
64
|
+
? (_a = response.body) === null || _a === void 0 ? void 0 : _a.RawToken
|
|
65
|
+
: undefined;
|
|
66
|
+
if (!rawToken) {
|
|
67
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), ((_c = (_b = response.raw) !== null && _b !== void 0 ? _b : response.body) !== null && _c !== void 0 ? _c : {}), {
|
|
68
|
+
message: `Matrix42 rejected the access-token exchange (HTTP ${response.statusCode})`,
|
|
69
|
+
description: 'Check the Webservice Token and Server URL on the Matrix42 credential. The token may have been revoked or expired.',
|
|
70
|
+
httpCode: String(response.statusCode),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
accessTokenCache.set(this, {
|
|
74
|
+
accessToken: rawToken,
|
|
75
|
+
expiresAt: (_d = decodeJwtExpiryMs(rawToken)) !== null && _d !== void 0 ? _d : Date.now() + FALLBACK_LIFETIME_MS,
|
|
76
|
+
});
|
|
77
|
+
return rawToken;
|
|
78
|
+
}
|
|
12
79
|
async function matrix42ApiRequest(method, endpoint, body, query, uri, contentType = 'application/json') {
|
|
80
|
+
var _a, _b;
|
|
13
81
|
const authenticationMethod = this.getNodeParameter('authentication', 0);
|
|
14
82
|
const credentialType = authenticationMethod === 'basic' ? 'matrix42BasicApi' : 'matrix42TokenApi';
|
|
15
|
-
const
|
|
83
|
+
const credentials = await this.getCredentials(credentialType);
|
|
84
|
+
const { serverUrl, allowUnauthorizedCerts, explicitLanguage } = credentials;
|
|
16
85
|
const isJson = contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase().includes('application/json');
|
|
17
86
|
const hasBody = method !== 'GET' && method !== 'HEAD' && body != null && Object.keys(body).length > 0;
|
|
18
87
|
const headers = {
|
|
@@ -33,6 +102,44 @@ async function matrix42ApiRequest(method, endpoint, body, query, uri, contentTyp
|
|
|
33
102
|
if (options.body === undefined) {
|
|
34
103
|
delete options.body;
|
|
35
104
|
}
|
|
36
|
-
|
|
105
|
+
if (authenticationMethod === 'basic') {
|
|
106
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, credentialType, options);
|
|
107
|
+
}
|
|
108
|
+
const sendWithToken = async (accessToken) => await matrix42RawRequest.call(this, {
|
|
109
|
+
...options,
|
|
110
|
+
headers: { ...headers, Authorization: `Bearer ${accessToken}` },
|
|
111
|
+
});
|
|
112
|
+
let response = await sendWithToken(await getAccessToken.call(this, credentials));
|
|
113
|
+
if (response.statusCode === 401 || response.statusCode === 406) {
|
|
114
|
+
response = await sendWithToken(await getAccessToken.call(this, credentials, true));
|
|
115
|
+
}
|
|
116
|
+
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
117
|
+
return response.body;
|
|
118
|
+
}
|
|
119
|
+
const isAuthFailure = response.statusCode === 401 || response.statusCode === 406;
|
|
120
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), ((_b = (_a = response.raw) !== null && _a !== void 0 ? _a : response.body) !== null && _b !== void 0 ? _b : {}), {
|
|
121
|
+
message: `Matrix42 request failed (HTTP ${response.statusCode})`,
|
|
122
|
+
description: isAuthFailure
|
|
123
|
+
? 'Matrix42 rejected the access token even after refreshing it. Check that the Webservice Token is still valid and its account has API access.'
|
|
124
|
+
: describeResponseBody(response.body),
|
|
125
|
+
httpCode: String(response.statusCode),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function describeResponseBody(body) {
|
|
129
|
+
if (Array.isArray(body) &&
|
|
130
|
+
body.length > 0 &&
|
|
131
|
+
body.every((entry) => entry !== null && typeof entry === 'object' && 'Name' in entry)) {
|
|
132
|
+
const fields = body.map((entry) => {
|
|
133
|
+
var _a;
|
|
134
|
+
const message = String((_a = entry.Message) !== null && _a !== void 0 ? _a : '').trim();
|
|
135
|
+
return message ? `${String(entry.Name)} (${message})` : String(entry.Name);
|
|
136
|
+
});
|
|
137
|
+
return `The server rejected the following field(s): ${fields.join(', ')}`;
|
|
138
|
+
}
|
|
139
|
+
if (typeof body === 'string')
|
|
140
|
+
return body;
|
|
141
|
+
if (body !== undefined && body !== null)
|
|
142
|
+
return JSON.stringify(body);
|
|
143
|
+
return undefined;
|
|
37
144
|
}
|
|
38
145
|
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Matrix42/GenericFunctions.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Matrix42/GenericFunctions.ts"],"names":[],"mappings":";;AA8CA,gDAEC;AAMD,4CAEC;AAyGD,gDA8EC;AArOD,+CAA4C;AAkB5C,MAAM,gBAAgB,GAAG,KAAM,CAAC;AAGhC,MAAM,oBAAoB,GAAG,CAAC,GAAG,KAAM,CAAC;AAYxC,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA6B,CAAC;AAGlE,SAAgB,kBAAkB,CAAC,SAAiB;IACnD,OAAO,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC;AAMD,SAAgB,gBAAgB,CAAC,KAAa;IAC7C,OAAO,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE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E,CAAC,CAAC,CAAC;QACH,OAAO,+CAA+C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC3E,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACrE,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -148,28 +148,71 @@ async function transformTicket(i) {
|
|
|
148
148
|
const returnData = [{ Message: 'Success' }];
|
|
149
149
|
return returnData;
|
|
150
150
|
}
|
|
151
|
+
const GUID_RE = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
152
|
+
function isBlankParameterRow(raw) {
|
|
153
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
return Object.values(raw).every((value) => value === '' || value === undefined || value === null);
|
|
157
|
+
}
|
|
158
|
+
function toJournalParameter(raw, index) {
|
|
159
|
+
var _a, _b, _c, _d, _e;
|
|
160
|
+
if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
161
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Journal parameter ${index + 1} must be an object with "Name" and "Value" keys`);
|
|
162
|
+
}
|
|
163
|
+
const entry = raw;
|
|
164
|
+
const name = (_a = entry.Name) !== null && _a !== void 0 ? _a : entry.name;
|
|
165
|
+
if (typeof name !== 'string' || name.trim() === '') {
|
|
166
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Journal parameter ${index + 1} needs a non-empty "Name"`);
|
|
167
|
+
}
|
|
168
|
+
const parameter = { Name: name, Value: (_c = (_b = entry.Value) !== null && _b !== void 0 ? _b : entry.value) !== null && _c !== void 0 ? _c : '' };
|
|
169
|
+
const format = (_d = entry.Format) !== null && _d !== void 0 ? _d : entry.format;
|
|
170
|
+
if (typeof format === 'string' && format !== '') {
|
|
171
|
+
parameter.Format = format;
|
|
172
|
+
}
|
|
173
|
+
const isCurrency = (_e = entry.IsCurrency) !== null && _e !== void 0 ? _e : entry.isCurrency;
|
|
174
|
+
if (typeof isCurrency === 'boolean') {
|
|
175
|
+
parameter.IsCurrency = isCurrency;
|
|
176
|
+
}
|
|
177
|
+
return parameter;
|
|
178
|
+
}
|
|
151
179
|
async function addJournalEntry(i) {
|
|
152
|
-
var _a, _b;
|
|
180
|
+
var _a, _b, _c, _d;
|
|
153
181
|
const ticketEoid = this.getNodeParameter('ticketEoid', i);
|
|
154
182
|
const comments = this.getNodeParameter('comments', i);
|
|
155
183
|
const entryType = toNumber.call(this, this.getNodeParameter('entryType', i), 'Type');
|
|
156
|
-
const creator = this.getNodeParameter('creator', i);
|
|
184
|
+
const creator = this.getNodeParameter('creator', i, '');
|
|
157
185
|
const visibleInPortal = this.getNodeParameter('visibleInPortal', i);
|
|
158
186
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
187
|
+
const rawParameters = [
|
|
188
|
+
...((_b = (_a = additionalFields.journalParameters) === null || _a === void 0 ? void 0 : _a.parameter) !== null && _b !== void 0 ? _b : []),
|
|
189
|
+
...parseJsonArray(additionalFields.parameters, 'Parameters'),
|
|
190
|
+
];
|
|
191
|
+
const parameters = rawParameters
|
|
192
|
+
.filter((raw) => !isBlankParameterRow(raw))
|
|
193
|
+
.map((raw, index) => toJournalParameter.call(this, raw, index));
|
|
159
194
|
const body = {
|
|
160
195
|
ObjectId: ticketEoid,
|
|
161
|
-
Publish: (
|
|
196
|
+
Publish: (_c = additionalFields.publish) !== null && _c !== void 0 ? _c : false,
|
|
162
197
|
Comments: comments,
|
|
163
198
|
EntryType: entryType,
|
|
164
|
-
Creator: creator,
|
|
165
199
|
VisibleInPortal: visibleInPortal,
|
|
166
|
-
Parameters:
|
|
167
|
-
IsFromEditDialog: (
|
|
168
|
-
...(additionalFields.typeId !== undefined && { TypeId: additionalFields.typeId }),
|
|
200
|
+
Parameters: parameters,
|
|
201
|
+
IsFromEditDialog: (_d = additionalFields.isFromEditDialog) !== null && _d !== void 0 ? _d : false,
|
|
169
202
|
...(additionalFields.fileIds !== undefined && {
|
|
170
203
|
FileIds: parseJsonArray(additionalFields.fileIds, 'File IDs'),
|
|
171
204
|
}),
|
|
172
205
|
};
|
|
206
|
+
if (!isBlankRelation(creator)) {
|
|
207
|
+
body.Creator = creator;
|
|
208
|
+
}
|
|
209
|
+
const typeId = additionalFields.typeId;
|
|
210
|
+
if (typeId !== undefined && typeId !== '') {
|
|
211
|
+
if (!GUID_RE.test(typeId)) {
|
|
212
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The "Type ID" field must be a GUID, got: ${typeId}`);
|
|
213
|
+
}
|
|
214
|
+
body.TypeId = typeId;
|
|
215
|
+
}
|
|
173
216
|
await GenericFunctions_1.matrix42ApiRequest.call(this, 'POST', '/journal/Add', body, {});
|
|
174
217
|
const returnData = [{ Message: 'Success' }];
|
|
175
218
|
return returnData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matrix42TicketFunctions.js","sourceRoot":"","sources":["../../../nodes/Matrix42/Matrix42TicketFunctions.ts"],"names":[],"mappings":";;AAmCA,oCAmFC;AAED,kCAmCC;AAED,0CA+BC;
|
|
1
|
+
{"version":3,"file":"Matrix42TicketFunctions.js","sourceRoot":"","sources":["../../../nodes/Matrix42/Matrix42TicketFunctions.ts"],"names":[],"mappings":";;AAmCA,oCAmFC;AAED,kCAmCC;AAED,0CA+BC;AAqDD,0CA8DC;AA/SD,+CAAuG;AACvG,yDAAwD;AAExD,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AAGxD,SAAS,eAAe,CAAC,KAAc;IACtC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAA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