@deepidealab/n8n-nodes-tracira 0.2.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 +21 -0
- package/README.md +133 -0
- package/dist/credentials/TraciraApi.credentials.d.ts +10 -0
- package/dist/credentials/TraciraApi.credentials.js +39 -0
- package/dist/credentials/TraciraApi.credentials.js.map +1 -0
- package/dist/nodes/Tracira/Tracira.node.d.ts +5 -0
- package/dist/nodes/Tracira/Tracira.node.js +470 -0
- package/dist/nodes/Tracira/Tracira.node.js.map +1 -0
- package/dist/nodes/Tracira/Tracira.node.json +18 -0
- package/dist/nodes/Tracira/listSearch/getChecks.d.ts +2 -0
- package/dist/nodes/Tracira/listSearch/getChecks.js +18 -0
- package/dist/nodes/Tracira/listSearch/getChecks.js.map +1 -0
- package/dist/nodes/Tracira/listSearch/getFlows.d.ts +2 -0
- package/dist/nodes/Tracira/listSearch/getFlows.js +16 -0
- package/dist/nodes/Tracira/listSearch/getFlows.js.map +1 -0
- package/dist/nodes/Tracira/listSearch/getModels.d.ts +2 -0
- package/dist/nodes/Tracira/listSearch/getModels.js +18 -0
- package/dist/nodes/Tracira/listSearch/getModels.js.map +1 -0
- package/dist/nodes/Tracira/resources/execution/get.d.ts +2 -0
- package/dist/nodes/Tracira/resources/execution/get.js +21 -0
- package/dist/nodes/Tracira/resources/execution/get.js.map +1 -0
- package/dist/nodes/Tracira/resources/execution/getAll.d.ts +2 -0
- package/dist/nodes/Tracira/resources/execution/getAll.js +244 -0
- package/dist/nodes/Tracira/resources/execution/getAll.js.map +1 -0
- package/dist/nodes/Tracira/resources/execution/index.d.ts +2 -0
- package/dist/nodes/Tracira/resources/execution/index.js +73 -0
- package/dist/nodes/Tracira/resources/execution/index.js.map +1 -0
- package/dist/nodes/Tracira/resources/execution/log.d.ts +2 -0
- package/dist/nodes/Tracira/resources/execution/log.js +291 -0
- package/dist/nodes/Tracira/resources/execution/log.js.map +1 -0
- package/dist/nodes/Tracira/shared/transport.d.ts +2 -0
- package/dist/nodes/Tracira/shared/transport.js +14 -0
- package/dist/nodes/Tracira/shared/transport.js.map +1 -0
- package/dist/nodes/Tracira/tracira.dark.svg +7 -0
- package/dist/nodes/Tracira/tracira.svg +7 -0
- package/dist/package.json +62 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepIdea Lab
|
|
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
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# @deepidealab/n8n-nodes-tracira
|
|
2
|
+
|
|
3
|
+
This is an n8n community node for Tracira.
|
|
4
|
+
|
|
5
|
+
Tracira monitors AI outputs from your automations, evaluates them against rules, and lets you inspect execution results from inside n8n workflows.
|
|
6
|
+
|
|
7
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Follow the [n8n community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
|
|
12
|
+
|
|
13
|
+
Install package name:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
@deepidealab/n8n-nodes-tracira
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If you already installed the legacy unscoped package `n8n-nodes-tracira`, uninstall it and install the scoped package instead.
|
|
20
|
+
|
|
21
|
+
For local development:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
npm run verify
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Operations
|
|
29
|
+
|
|
30
|
+
The node currently supports the `Execution` resource with these operations:
|
|
31
|
+
|
|
32
|
+
- `Log`: Send an AI execution to Tracira for evaluation.
|
|
33
|
+
- `Get`: Fetch a single execution by ID.
|
|
34
|
+
- `Get Many`: List executions with filters such as status, flow, check, and date range.
|
|
35
|
+
|
|
36
|
+
## Credentials
|
|
37
|
+
|
|
38
|
+
Use the `Tracira API` credential.
|
|
39
|
+
|
|
40
|
+
You need a workspace webhook token from your Tracira dashboard:
|
|
41
|
+
|
|
42
|
+
1. Open Tracira.
|
|
43
|
+
2. Go to the integrations/token area of your workspace.
|
|
44
|
+
3. Copy the webhook token.
|
|
45
|
+
4. Paste it into the `Workspace Token` field in n8n.
|
|
46
|
+
|
|
47
|
+
The credential test calls `GET /api/verify` on Tracira and uses the token as a query parameter.
|
|
48
|
+
|
|
49
|
+
## Compatibility
|
|
50
|
+
|
|
51
|
+
This package is being set up against the current n8n community-node tooling and Tracira API endpoints available as of March 7, 2026.
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
Typical pattern:
|
|
56
|
+
|
|
57
|
+
1. Run your AI step in n8n.
|
|
58
|
+
2. Send the model output to `Tracira -> Execution -> Log`.
|
|
59
|
+
3. Branch on the returned `status`, `verdict`, or `confidenceScore`.
|
|
60
|
+
4. Optionally query historic executions with `Get` or `Get Many`.
|
|
61
|
+
|
|
62
|
+
Current scope intentionally focuses on token-authenticated operations. Human decision updates are not included yet because the corresponding Tracira backend route is not token-authenticated.
|
|
63
|
+
|
|
64
|
+
## Example workflow
|
|
65
|
+
|
|
66
|
+
An importable example workflow is available at [examples/log-and-branch.workflow.json](./examples/log-and-branch.workflow.json).
|
|
67
|
+
|
|
68
|
+
The example does this:
|
|
69
|
+
|
|
70
|
+
1. Starts from a manual trigger.
|
|
71
|
+
2. Logs an execution to Tracira.
|
|
72
|
+
3. Branches with an `If` node based on the returned `status`.
|
|
73
|
+
|
|
74
|
+
## Verification notes
|
|
75
|
+
|
|
76
|
+
This package is structured to align with n8n's verification guidance:
|
|
77
|
+
|
|
78
|
+
- Built with the `n8n-node` toolchain.
|
|
79
|
+
- No runtime `dependencies` in `package.json`.
|
|
80
|
+
- No access to environment variables or file system from node code.
|
|
81
|
+
- MIT licensed.
|
|
82
|
+
- Published from GitHub Actions with npm provenance configured in `.github/workflows/publish.yml`.
|
|
83
|
+
- The published package is scanned with `@n8n/scan-community-package` after npm publication.
|
|
84
|
+
|
|
85
|
+
Maintainer release instructions are documented in [PUBLISHING.md](./PUBLISHING.md).
|
|
86
|
+
|
|
87
|
+
## Resources
|
|
88
|
+
|
|
89
|
+
- [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
90
|
+
- [Tracira](https://www.tracira.com)
|
|
91
|
+
- [Tracira API schema](https://www.tracira.com/openapi.json)
|
|
92
|
+
|
|
93
|
+
## Version history
|
|
94
|
+
|
|
95
|
+
### 0.2.0
|
|
96
|
+
|
|
97
|
+
Move the package to the `@deepidealab` npm scope so the node is published under the business organization instead of a personal npm account.
|
|
98
|
+
|
|
99
|
+
### 0.1.8
|
|
100
|
+
|
|
101
|
+
Add codex categories and search aliases to improve Tracira discoverability in the editor node picker.
|
|
102
|
+
|
|
103
|
+
### 0.1.7
|
|
104
|
+
|
|
105
|
+
Remove the invalid `Developer Tools` node category so Tracira remains visible in the editor on self-hosted n8n.
|
|
106
|
+
|
|
107
|
+
### 0.1.6
|
|
108
|
+
|
|
109
|
+
Replace newer declarative node features with a plain execute-style implementation for broader self-hosted n8n compatibility.
|
|
110
|
+
|
|
111
|
+
### 0.1.5
|
|
112
|
+
|
|
113
|
+
Reduce node-description metadata to older-safe fields for self-hosted n8n compatibility.
|
|
114
|
+
|
|
115
|
+
### 0.1.4
|
|
116
|
+
|
|
117
|
+
Use a current npm CLI in the publish workflow to satisfy npm trusted publishing requirements.
|
|
118
|
+
|
|
119
|
+
### 0.1.3
|
|
120
|
+
|
|
121
|
+
Force GitHub Actions to publish via npm trusted publishing instead of any inherited token environment.
|
|
122
|
+
|
|
123
|
+
### 0.1.2
|
|
124
|
+
|
|
125
|
+
Allow GitHub Actions trusted publishing while continuing to block accidental local publishes.
|
|
126
|
+
|
|
127
|
+
### 0.1.1
|
|
128
|
+
|
|
129
|
+
First GitHub Actions release with npm provenance and trusted publishing.
|
|
130
|
+
|
|
131
|
+
### 0.1.0
|
|
132
|
+
|
|
133
|
+
Initial Tracira node setup with execution logging and read operations.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, Icon, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class TraciraApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TraciraApi = void 0;
|
|
4
|
+
class TraciraApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'traciraApi';
|
|
7
|
+
this.displayName = 'Tracira API';
|
|
8
|
+
this.icon = { light: 'file:../nodes/Tracira/tracira.svg', dark: 'file:../nodes/Tracira/tracira.dark.svg' };
|
|
9
|
+
this.documentationUrl = 'https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file#credentials';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Workspace Token',
|
|
13
|
+
name: 'webhookToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
typeOptions: { password: true },
|
|
16
|
+
required: true,
|
|
17
|
+
default: '',
|
|
18
|
+
description: 'The webhook token from your Tracira workspace',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
this.authenticate = {
|
|
22
|
+
type: 'generic',
|
|
23
|
+
properties: {
|
|
24
|
+
qs: {
|
|
25
|
+
token: '={{$credentials.webhookToken}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
this.test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: 'https://www.tracira.com/api',
|
|
32
|
+
url: '/verify',
|
|
33
|
+
method: 'GET',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.TraciraApi = TraciraApi;
|
|
39
|
+
//# sourceMappingURL=TraciraApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TraciraApi.credentials.js","sourceRoot":"","sources":["../../credentials/TraciraApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QAEpB,gBAAW,GAAG,aAAa,CAAC;QAE5B,SAAI,GAAS,EAAE,KAAK,EAAE,mCAAmC,EAAE,IAAI,EAAE,wCAAwC,EAAE,CAAC;QAE5G,qBAAgB,GAAG,iFAAiF,CAAC;QAErG,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+CAA+C;aAC5D;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,EAAE,EAAE;oBACH,KAAK,EAAE,gCAAgC;iBACvC;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,6BAA6B;gBACtC,GAAG,EAAE,SAAS;gBACd,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AArCD,gCAqCC"}
|
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Tracira = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const baseUrl = 'https://www.tracira.com/api';
|
|
6
|
+
const logDisplay = {
|
|
7
|
+
resource: ['execution'],
|
|
8
|
+
operation: ['log'],
|
|
9
|
+
};
|
|
10
|
+
const getDisplay = {
|
|
11
|
+
resource: ['execution'],
|
|
12
|
+
operation: ['get'],
|
|
13
|
+
};
|
|
14
|
+
const getAllDisplay = {
|
|
15
|
+
resource: ['execution'],
|
|
16
|
+
operation: ['getAll'],
|
|
17
|
+
};
|
|
18
|
+
function stripEmpty(data) {
|
|
19
|
+
return Object.fromEntries(Object.entries(data).filter(([, value]) => value !== '' && value !== undefined && value !== null));
|
|
20
|
+
}
|
|
21
|
+
class Tracira {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.description = {
|
|
24
|
+
displayName: 'Tracira',
|
|
25
|
+
name: 'tracira',
|
|
26
|
+
icon: 'file:tracira.svg',
|
|
27
|
+
group: ['transform'],
|
|
28
|
+
version: 1,
|
|
29
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
30
|
+
description: 'Log and inspect Tracira AI execution data',
|
|
31
|
+
codex: {
|
|
32
|
+
categories: ['AI'],
|
|
33
|
+
resources: {
|
|
34
|
+
credentialDocumentation: [
|
|
35
|
+
{
|
|
36
|
+
url: 'https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file#credentials',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
primaryDocumentation: [
|
|
40
|
+
{
|
|
41
|
+
url: 'https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
alias: ['Tracira AI', 'Tracera', 'AI monitoring', 'AI evaluation', 'LLM monitoring'],
|
|
46
|
+
},
|
|
47
|
+
defaults: {
|
|
48
|
+
name: 'Tracira',
|
|
49
|
+
},
|
|
50
|
+
inputs: ['main'],
|
|
51
|
+
outputs: ['main'],
|
|
52
|
+
credentials: [
|
|
53
|
+
{
|
|
54
|
+
name: 'traciraApi',
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
properties: [
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Resource',
|
|
61
|
+
name: 'resource',
|
|
62
|
+
type: 'options',
|
|
63
|
+
noDataExpression: true,
|
|
64
|
+
options: [
|
|
65
|
+
{
|
|
66
|
+
name: 'Execution',
|
|
67
|
+
value: 'execution',
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
default: 'execution',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Operation',
|
|
74
|
+
name: 'operation',
|
|
75
|
+
type: 'options',
|
|
76
|
+
noDataExpression: true,
|
|
77
|
+
displayOptions: {
|
|
78
|
+
show: {
|
|
79
|
+
resource: ['execution'],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
options: [
|
|
83
|
+
{
|
|
84
|
+
name: 'Log',
|
|
85
|
+
value: 'log',
|
|
86
|
+
action: 'Log an execution',
|
|
87
|
+
description: 'Send an AI execution to Tracira for evaluation',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Get',
|
|
91
|
+
value: 'get',
|
|
92
|
+
action: 'Get an execution',
|
|
93
|
+
description: 'Fetch a single execution by ID',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'Get Many',
|
|
97
|
+
value: 'getAll',
|
|
98
|
+
action: 'Get many an execution',
|
|
99
|
+
description: 'List executions from Tracira',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
default: 'log',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Execution ID',
|
|
106
|
+
name: 'executionId',
|
|
107
|
+
type: 'string',
|
|
108
|
+
required: true,
|
|
109
|
+
default: '',
|
|
110
|
+
displayOptions: {
|
|
111
|
+
show: getDisplay,
|
|
112
|
+
},
|
|
113
|
+
description: 'The execution ID to fetch',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Flow',
|
|
117
|
+
name: 'flowName',
|
|
118
|
+
type: 'string',
|
|
119
|
+
required: true,
|
|
120
|
+
default: '',
|
|
121
|
+
displayOptions: {
|
|
122
|
+
show: logDisplay,
|
|
123
|
+
},
|
|
124
|
+
description: 'The Tracira flow name for this execution',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
displayName: 'Output',
|
|
128
|
+
name: 'output',
|
|
129
|
+
type: 'string',
|
|
130
|
+
typeOptions: {
|
|
131
|
+
rows: 6,
|
|
132
|
+
},
|
|
133
|
+
required: true,
|
|
134
|
+
default: '',
|
|
135
|
+
displayOptions: {
|
|
136
|
+
show: logDisplay,
|
|
137
|
+
},
|
|
138
|
+
description: 'The AI-generated output to evaluate in Tracira',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
displayName: 'Input',
|
|
142
|
+
name: 'input',
|
|
143
|
+
type: 'string',
|
|
144
|
+
typeOptions: {
|
|
145
|
+
rows: 4,
|
|
146
|
+
},
|
|
147
|
+
default: '',
|
|
148
|
+
displayOptions: {
|
|
149
|
+
show: logDisplay,
|
|
150
|
+
},
|
|
151
|
+
description: 'Optional prompt or input text that produced the output',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
displayName: 'Check',
|
|
155
|
+
name: 'checkName',
|
|
156
|
+
type: 'string',
|
|
157
|
+
default: '',
|
|
158
|
+
displayOptions: {
|
|
159
|
+
show: logDisplay,
|
|
160
|
+
},
|
|
161
|
+
description: 'Optional Tracira check name',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
displayName: 'Model',
|
|
165
|
+
name: 'modelName',
|
|
166
|
+
type: 'string',
|
|
167
|
+
default: '',
|
|
168
|
+
displayOptions: {
|
|
169
|
+
show: logDisplay,
|
|
170
|
+
},
|
|
171
|
+
description: 'Optional AI model name to record with the execution',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
displayName: 'Options',
|
|
175
|
+
name: 'options',
|
|
176
|
+
type: 'collection',
|
|
177
|
+
placeholder: 'Add Option',
|
|
178
|
+
default: {},
|
|
179
|
+
displayOptions: {
|
|
180
|
+
show: logDisplay,
|
|
181
|
+
},
|
|
182
|
+
options: [
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Actor ID',
|
|
185
|
+
name: 'actorId',
|
|
186
|
+
type: 'string',
|
|
187
|
+
default: '',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
displayName: 'Callback URL',
|
|
191
|
+
name: 'callbackUrl',
|
|
192
|
+
type: 'string',
|
|
193
|
+
default: '',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
displayName: 'Confidence',
|
|
197
|
+
name: 'confidence',
|
|
198
|
+
type: 'number',
|
|
199
|
+
default: 0,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
displayName: 'Cost (USD)',
|
|
203
|
+
name: 'costUsd',
|
|
204
|
+
type: 'number',
|
|
205
|
+
default: 0,
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
displayName: 'Execution ID',
|
|
209
|
+
name: 'id',
|
|
210
|
+
type: 'string',
|
|
211
|
+
default: '',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
displayName: 'Latency',
|
|
215
|
+
name: 'latencyMs',
|
|
216
|
+
type: 'number',
|
|
217
|
+
default: 0,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
displayName: 'Metadata JSON',
|
|
221
|
+
name: 'metadataJson',
|
|
222
|
+
type: 'string',
|
|
223
|
+
typeOptions: {
|
|
224
|
+
rows: 4,
|
|
225
|
+
},
|
|
226
|
+
default: '',
|
|
227
|
+
description: 'Optional JSON object to store as execution metadata',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
displayName: 'Session ID',
|
|
231
|
+
name: 'sessionId',
|
|
232
|
+
type: 'string',
|
|
233
|
+
default: '',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
displayName: 'Subject ID',
|
|
237
|
+
name: 'subjectId',
|
|
238
|
+
type: 'string',
|
|
239
|
+
default: '',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
displayName: 'Status',
|
|
245
|
+
name: 'status',
|
|
246
|
+
type: 'options',
|
|
247
|
+
default: '',
|
|
248
|
+
displayOptions: {
|
|
249
|
+
show: getAllDisplay,
|
|
250
|
+
},
|
|
251
|
+
options: [
|
|
252
|
+
{ name: 'All', value: '' },
|
|
253
|
+
{ name: 'Success', value: 'success' },
|
|
254
|
+
{ name: 'Flagged', value: 'flagged' },
|
|
255
|
+
{ name: 'Failed', value: 'failed' },
|
|
256
|
+
],
|
|
257
|
+
description: 'Filter executions by status',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
displayName: 'Flow',
|
|
261
|
+
name: 'flowFilter',
|
|
262
|
+
type: 'string',
|
|
263
|
+
default: '',
|
|
264
|
+
displayOptions: {
|
|
265
|
+
show: getAllDisplay,
|
|
266
|
+
},
|
|
267
|
+
description: 'Filter executions to a specific flow name',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
displayName: 'Check',
|
|
271
|
+
name: 'checkFilter',
|
|
272
|
+
type: 'string',
|
|
273
|
+
default: '',
|
|
274
|
+
displayOptions: {
|
|
275
|
+
show: getAllDisplay,
|
|
276
|
+
},
|
|
277
|
+
description: 'Filter executions to a specific check name',
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
displayName: 'Search Query',
|
|
281
|
+
name: 'query',
|
|
282
|
+
type: 'string',
|
|
283
|
+
default: '',
|
|
284
|
+
displayOptions: {
|
|
285
|
+
show: getAllDisplay,
|
|
286
|
+
},
|
|
287
|
+
description: 'Search across flow, check, model, and context IDs',
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
displayName: 'From',
|
|
291
|
+
name: 'from',
|
|
292
|
+
type: 'dateTime',
|
|
293
|
+
default: '',
|
|
294
|
+
displayOptions: {
|
|
295
|
+
show: getAllDisplay,
|
|
296
|
+
},
|
|
297
|
+
description: 'Only include executions at or after this date',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
displayName: 'To',
|
|
301
|
+
name: 'to',
|
|
302
|
+
type: 'dateTime',
|
|
303
|
+
default: '',
|
|
304
|
+
displayOptions: {
|
|
305
|
+
show: getAllDisplay,
|
|
306
|
+
},
|
|
307
|
+
description: 'Only include executions up to this date',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
displayName: 'Limit',
|
|
311
|
+
name: 'limit',
|
|
312
|
+
type: 'number',
|
|
313
|
+
typeOptions: {
|
|
314
|
+
minValue: 1,
|
|
315
|
+
maxValue: 100,
|
|
316
|
+
},
|
|
317
|
+
default: 50,
|
|
318
|
+
displayOptions: {
|
|
319
|
+
show: getAllDisplay,
|
|
320
|
+
},
|
|
321
|
+
description: 'Max number of results to return',
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
displayName: 'Page',
|
|
325
|
+
name: 'page',
|
|
326
|
+
type: 'number',
|
|
327
|
+
typeOptions: {
|
|
328
|
+
minValue: 1,
|
|
329
|
+
},
|
|
330
|
+
default: 1,
|
|
331
|
+
displayOptions: {
|
|
332
|
+
show: getAllDisplay,
|
|
333
|
+
},
|
|
334
|
+
description: 'Results page number',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
displayName: 'Additional Filters',
|
|
338
|
+
name: 'filters',
|
|
339
|
+
type: 'collection',
|
|
340
|
+
placeholder: 'Add Filter',
|
|
341
|
+
default: {},
|
|
342
|
+
displayOptions: {
|
|
343
|
+
show: getAllDisplay,
|
|
344
|
+
},
|
|
345
|
+
options: [
|
|
346
|
+
{
|
|
347
|
+
displayName: 'Actor ID',
|
|
348
|
+
name: 'actorId',
|
|
349
|
+
type: 'string',
|
|
350
|
+
default: '',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
displayName: 'Session ID',
|
|
354
|
+
name: 'sessionId',
|
|
355
|
+
type: 'string',
|
|
356
|
+
default: '',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
displayName: 'Subject ID',
|
|
360
|
+
name: 'subjectId',
|
|
361
|
+
type: 'string',
|
|
362
|
+
default: '',
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
async execute() {
|
|
370
|
+
const items = this.getInputData();
|
|
371
|
+
const returnData = [];
|
|
372
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
373
|
+
try {
|
|
374
|
+
const operation = this.getNodeParameter('operation', itemIndex);
|
|
375
|
+
let requestOptions;
|
|
376
|
+
if (operation === 'log') {
|
|
377
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
378
|
+
let metadata;
|
|
379
|
+
if (options.metadataJson) {
|
|
380
|
+
try {
|
|
381
|
+
metadata = JSON.parse(options.metadataJson);
|
|
382
|
+
}
|
|
383
|
+
catch {
|
|
384
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Metadata JSON must be valid JSON', {
|
|
385
|
+
itemIndex,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
requestOptions = {
|
|
390
|
+
method: 'POST',
|
|
391
|
+
url: `${baseUrl}/webhook`,
|
|
392
|
+
body: stripEmpty({
|
|
393
|
+
flow: this.getNodeParameter('flowName', itemIndex),
|
|
394
|
+
output: this.getNodeParameter('output', itemIndex),
|
|
395
|
+
input: this.getNodeParameter('input', itemIndex, ''),
|
|
396
|
+
check: this.getNodeParameter('checkName', itemIndex, ''),
|
|
397
|
+
model: this.getNodeParameter('modelName', itemIndex, ''),
|
|
398
|
+
actorId: options.actorId,
|
|
399
|
+
callbackUrl: options.callbackUrl,
|
|
400
|
+
confidence: options.confidence,
|
|
401
|
+
costUsd: options.costUsd,
|
|
402
|
+
id: options.id,
|
|
403
|
+
latencyMs: options.latencyMs,
|
|
404
|
+
metadata,
|
|
405
|
+
sessionId: options.sessionId,
|
|
406
|
+
subjectId: options.subjectId,
|
|
407
|
+
}),
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
else if (operation === 'get') {
|
|
411
|
+
const executionId = this.getNodeParameter('executionId', itemIndex);
|
|
412
|
+
requestOptions = {
|
|
413
|
+
method: 'GET',
|
|
414
|
+
url: `${baseUrl}/executions/${encodeURIComponent(executionId)}`,
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
const filters = this.getNodeParameter('filters', itemIndex, {});
|
|
419
|
+
requestOptions = {
|
|
420
|
+
method: 'GET',
|
|
421
|
+
url: `${baseUrl}/executions`,
|
|
422
|
+
qs: stripEmpty({
|
|
423
|
+
status: this.getNodeParameter('status', itemIndex, ''),
|
|
424
|
+
flow: this.getNodeParameter('flowFilter', itemIndex, ''),
|
|
425
|
+
check: this.getNodeParameter('checkFilter', itemIndex, ''),
|
|
426
|
+
q: this.getNodeParameter('query', itemIndex, ''),
|
|
427
|
+
from: this.getNodeParameter('from', itemIndex, ''),
|
|
428
|
+
to: this.getNodeParameter('to', itemIndex, ''),
|
|
429
|
+
limit: this.getNodeParameter('limit', itemIndex, 50),
|
|
430
|
+
page: this.getNodeParameter('page', itemIndex, 1),
|
|
431
|
+
actorId: filters.actorId,
|
|
432
|
+
sessionId: filters.sessionId,
|
|
433
|
+
subjectId: filters.subjectId,
|
|
434
|
+
}),
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'traciraApi', requestOptions);
|
|
438
|
+
if (operation === 'getAll' && Array.isArray(response === null || response === void 0 ? void 0 : response.executions)) {
|
|
439
|
+
for (const execution of response.executions) {
|
|
440
|
+
returnData.push({
|
|
441
|
+
json: execution,
|
|
442
|
+
pairedItem: itemIndex,
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
returnData.push({
|
|
448
|
+
json: response,
|
|
449
|
+
pairedItem: itemIndex,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
catch (error) {
|
|
454
|
+
if (this.continueOnFail()) {
|
|
455
|
+
returnData.push({
|
|
456
|
+
json: {
|
|
457
|
+
error: error.message,
|
|
458
|
+
},
|
|
459
|
+
pairedItem: itemIndex,
|
|
460
|
+
});
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error instanceof Error ? error.message : 'Unknown Tracira error', { itemIndex });
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return [returnData];
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
exports.Tracira = Tracira;
|
|
470
|
+
//# sourceMappingURL=Tracira.node.js.map
|