@deepidealab/n8n-nodes-tracira 0.8.2 → 0.9.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.
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TraciraTrigger = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const transport_1 = require("../Tracira/shared/transport");
6
+ class TraciraTrigger {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'Tracira Trigger',
10
+ name: 'traciraTrigger',
11
+ icon: { light: 'file:tracira.svg', dark: 'file:tracira.dark.svg' },
12
+ group: ['trigger'],
13
+ version: 1,
14
+ subtitle: 'Watch decisions',
15
+ description: 'Starts the workflow the moment a log gets a verdict or a human decision in Tracira',
16
+ codex: {
17
+ categories: ['Analytics'],
18
+ resources: {
19
+ credentialDocumentation: [
20
+ {
21
+ url: 'https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file#credentials',
22
+ },
23
+ ],
24
+ primaryDocumentation: [
25
+ {
26
+ url: 'https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file',
27
+ },
28
+ ],
29
+ },
30
+ alias: ['Tracira AI', 'AI approval', 'human in the loop', 'AI monitoring'],
31
+ },
32
+ defaults: {
33
+ name: 'Tracira Trigger',
34
+ },
35
+ eventTriggerDescription: 'Waiting for a Tracira verdict or decision',
36
+ activationMessage: 'Your workflow will now start when a log gets a verdict or a human decision in Tracira.',
37
+ inputs: [],
38
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
39
+ credentials: [
40
+ {
41
+ name: 'traciraApi',
42
+ required: true,
43
+ },
44
+ ],
45
+ webhooks: [
46
+ {
47
+ name: 'default',
48
+ httpMethod: 'POST',
49
+ responseMode: 'onReceived',
50
+ path: 'webhook',
51
+ },
52
+ ],
53
+ properties: [
54
+ {
55
+ displayName: 'Watch',
56
+ name: 'events',
57
+ type: 'multiOptions',
58
+ required: true,
59
+ default: ['approved', 'rejected', 'changed'],
60
+ options: [
61
+ { name: 'Approved by a Human', value: 'approved' },
62
+ { name: 'Evaluation Error', value: 'error' },
63
+ { name: 'Flagged for Review', value: 'flagged' },
64
+ { name: 'Passed All Rules', value: 'pass' },
65
+ { name: 'Rejected by a Human', value: 'rejected' },
66
+ { name: 'Sent Back for Changes', value: 'changed' },
67
+ ],
68
+ description: 'Which Tracira events start this workflow. The default (approved / rejected / sent back for changes) fires once a human has made a decision - the usual choice for approval flows. Decision events include the AI output and the log metadata, so the workflow can deliver an approved reply directly. No setup is needed in Tracira: activating this workflow registers the trigger automatically.',
69
+ },
70
+ ],
71
+ };
72
+ this.webhookMethods = {
73
+ default: {
74
+ async checkExists() {
75
+ var _a;
76
+ const webhookData = this.getWorkflowStaticData('node');
77
+ if (!webhookData.subscriptionId)
78
+ return false;
79
+ const webhookUrl = this.getNodeWebhookUrl('default');
80
+ let response;
81
+ try {
82
+ response = (await transport_1.traciraApiRequest.call(this, 'GET', '/subscriptions'));
83
+ }
84
+ catch (error) {
85
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
86
+ }
87
+ return ((_a = response.subscriptions) !== null && _a !== void 0 ? _a : []).some((subscription) => subscription.id === webhookData.subscriptionId && subscription.url === webhookUrl);
88
+ },
89
+ async create() {
90
+ const webhookUrl = this.getNodeWebhookUrl('default');
91
+ const events = this.getNodeParameter('events');
92
+ let response;
93
+ try {
94
+ response = (await transport_1.traciraApiRequest.call(this, 'POST', '/subscriptions', {}, {
95
+ url: webhookUrl,
96
+ events,
97
+ source: 'n8n',
98
+ }));
99
+ }
100
+ catch (error) {
101
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
102
+ }
103
+ const webhookData = this.getWorkflowStaticData('node');
104
+ webhookData.subscriptionId = response.id;
105
+ return true;
106
+ },
107
+ async delete() {
108
+ const webhookData = this.getWorkflowStaticData('node');
109
+ if (webhookData.subscriptionId) {
110
+ try {
111
+ await transport_1.traciraApiRequest.call(this, 'DELETE', `/subscriptions/${webhookData.subscriptionId}`);
112
+ }
113
+ catch {
114
+ return false;
115
+ }
116
+ delete webhookData.subscriptionId;
117
+ }
118
+ return true;
119
+ },
120
+ },
121
+ };
122
+ }
123
+ async webhook() {
124
+ const body = this.getBodyData();
125
+ return {
126
+ workflowData: [this.helpers.returnJsonArray(body)],
127
+ };
128
+ }
129
+ }
130
+ exports.TraciraTrigger = TraciraTrigger;
131
+ //# sourceMappingURL=TraciraTrigger.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TraciraTrigger.node.js","sourceRoot":"","sources":["../../../nodes/TraciraTrigger/TraciraTrigger.node.ts"],"names":[],"mappings":";;;AASA,+CAAiE;AACjE,2DAAgE;AAKhE,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,uBAAuB,EAAE;YAClE,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EACV,oFAAoF;YACrF,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,WAAW,CAAC;gBACzB,SAAS,EAAE;oBACV,uBAAuB,EAAE;wBACxB;4BACC,GAAG,EAAE,iFAAiF;yBACtF;qBACD;oBACD,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,qEAAqE;yBAC1E;qBACD;iBACD;gBACD,KAAK,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,CAAC;aAC1E;YACD,QAAQ,EAAE;gBACT,IAAI,EAAE,iBAAiB;aACvB;YACD,uBAAuB,EAAE,2CAA2C;YACpE,iBAAiB,EAChB,wFAAwF;YACzF,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,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C,cAAc,EAAE,CAAC;wBAChC,IAAI,CAAC;4BACJ,MAAM,6BAAiB,CAAC,IAAI,CAC3B,IAAI,EACJ,QAAQ,EACR,kBAAkB,WAAW,CAAC,cAAc,EAAE,CAC9C,CAAC;wBACH,CAAC;wBAAC,MAAM,CAAC;4BACR,OAAO,KAAK,CAAC;wBACd,CAAC;wBACD,OAAO,WAAW,CAAC,cAAc,CAAC;oBACnC,CAAC;oBACD,OAAO,IAAI,CAAC;gBACb,CAAC;aACD;SACD,CAAC;IAQH,CAAC;IANA,KAAK,CAAC,OAAO;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAiB,CAAC;QAC/C,OAAO;YACN,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAClD,CAAC;IACH,CAAC;CACD;AAzID,wCAyIC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "@deepidealab/n8n-nodes-tracira.traciraTrigger",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Analytics"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file#credentials"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://github.com/deepidealab/n8n-nodes-tracira?tab=readme-ov-file"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 442 442">
2
+ <rect width="442" height="442" rx="96" fill="#d97706"/>
3
+ <g transform="translate(-78 0)" fill="#fff">
4
+ <path d="M194.59,73.86c19.77.06,39.54-.04,59.31-.28,8.48-.05,23.28-.49,31.18.41-23.53,11.43-34.68,25.04-48.67,45.69-27.42,1.15-61.92.18-89.94.14-.2-15.26-.16-30.53.13-45.79l48-.17Z"/>
5
+ <path d="M367.28,73.81c11.36-.64,24.42-.34,35.94-.29l-.05,46.37c-29.26-.06-65.87-5.01-87.45,16.61-6.77,6.76-11.42,15.34-13.39,24.7-3.23,15.65-2.24,57.89-2.25,76.27l-.13,136.31h-13.24s-37.2-.01-37.2-.01l-.04-131.67c0-25.67-1.48-57.25,2.9-82.08,3.01-17.08,12.61-36.68,24.29-49.58,25.84-28.52,54.35-34.32,90.64-36.63Z"/>
6
+ </g>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 442 442">
2
+ <rect width="442" height="442" rx="96" fill="#d97706"/>
3
+ <g transform="translate(-78 0)" fill="#fff">
4
+ <path d="M194.59,73.86c19.77.06,39.54-.04,59.31-.28,8.48-.05,23.28-.49,31.18.41-23.53,11.43-34.68,25.04-48.67,45.69-27.42,1.15-61.92.18-89.94.14-.2-15.26-.16-30.53.13-45.79l48-.17Z"/>
5
+ <path d="M367.28,73.81c11.36-.64,24.42-.34,35.94-.29l-.05,46.37c-29.26-.06-65.87-5.01-87.45,16.61-6.77,6.76-11.42,15.34-13.39,24.7-3.23,15.65-2.24,57.89-2.25,76.27l-.13,136.31h-13.24s-37.2-.01-37.2-.01l-.04-131.67c0-25.67-1.48-57.25,2.9-82.08,3.01-17.08,12.61-36.68,24.29-49.58,25.84-28.52,54.35-34.32,90.64-36.63Z"/>
6
+ </g>
7
+ </svg>
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepidealab/n8n-nodes-tracira",
3
- "version": "0.8.2",
3
+ "version": "0.9.1",
4
4
  "description": "Official n8n community node for Tracira AI output monitoring and approval workflows.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/deepidealab/n8n-nodes-tracira",
@@ -46,7 +46,8 @@
46
46
  "dist/credentials/TraciraApi.credentials.js"
47
47
  ],
48
48
  "nodes": [
49
- "dist/nodes/Tracira/Tracira.node.js"
49
+ "dist/nodes/Tracira/Tracira.node.js",
50
+ "dist/nodes/TraciraTrigger/TraciraTrigger.node.js"
50
51
  ]
51
52
  },
52
53
  "devDependencies": {