@deepidealab/n8n-nodes-tracira 0.7.0 → 0.8.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 +11 -11
- package/dist/nodes/Tracira/Tracira.node.d.ts +8 -0
- package/dist/nodes/Tracira/Tracira.node.js +232 -99
- package/dist/nodes/Tracira/Tracira.node.js.map +1 -1
- package/dist/nodes/Tracira/listSearch/getProjects.d.ts +2 -0
- package/dist/nodes/Tracira/listSearch/{getFlows.js → getProjects.js} +8 -8
- package/dist/nodes/Tracira/listSearch/getProjects.js.map +1 -0
- package/dist/nodes/Tracira/listSearch/{getFlows.d.ts → getTasks.d.ts} +1 -1
- package/dist/nodes/Tracira/listSearch/getTasks.js +18 -0
- package/dist/nodes/Tracira/listSearch/getTasks.js.map +1 -0
- package/dist/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/nodes/Tracira/listSearch/getChecks.d.ts +0 -2
- package/dist/nodes/Tracira/listSearch/getChecks.js +0 -18
- package/dist/nodes/Tracira/listSearch/getChecks.js.map +0 -1
- package/dist/nodes/Tracira/listSearch/getFlows.js.map +0 -1
- package/dist/nodes/Tracira/listSearch/getModels.d.ts +0 -2
- package/dist/nodes/Tracira/listSearch/getModels.js +0 -18
- package/dist/nodes/Tracira/listSearch/getModels.js.map +0 -1
- package/dist/nodes/Tracira/resources/execution/get.d.ts +0 -2
- package/dist/nodes/Tracira/resources/execution/get.js +0 -21
- package/dist/nodes/Tracira/resources/execution/get.js.map +0 -1
- package/dist/nodes/Tracira/resources/execution/getAll.d.ts +0 -2
- package/dist/nodes/Tracira/resources/execution/getAll.js +0 -244
- package/dist/nodes/Tracira/resources/execution/getAll.js.map +0 -1
- package/dist/nodes/Tracira/resources/execution/index.d.ts +0 -2
- package/dist/nodes/Tracira/resources/execution/index.js +0 -73
- package/dist/nodes/Tracira/resources/execution/index.js.map +0 -1
- package/dist/nodes/Tracira/resources/execution/log.d.ts +0 -2
- package/dist/nodes/Tracira/resources/execution/log.js +0 -291
- package/dist/nodes/Tracira/resources/execution/log.js.map +0 -1
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Tracira = void 0;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const getProjects_1 = require("./listSearch/getProjects");
|
|
6
|
+
const getTasks_1 = require("./listSearch/getTasks");
|
|
5
7
|
const baseUrl = 'https://www.tracira.com/api';
|
|
6
8
|
const logResourceDisplay = {
|
|
7
9
|
resource: ['log'],
|
|
@@ -19,7 +21,7 @@ const getDisplay = {
|
|
|
19
21
|
};
|
|
20
22
|
const getAllDisplay = {
|
|
21
23
|
resource: ['log'],
|
|
22
|
-
operation: ['
|
|
24
|
+
operation: ['search'],
|
|
23
25
|
};
|
|
24
26
|
const setDecisionDisplay = {
|
|
25
27
|
resource: ['log'],
|
|
@@ -40,15 +42,15 @@ const apiCallDisplay = {
|
|
|
40
42
|
function stripEmpty(data) {
|
|
41
43
|
return Object.fromEntries(Object.entries(data).filter(([, value]) => value !== '' && value !== undefined && value !== null));
|
|
42
44
|
}
|
|
43
|
-
function normalizeApiPath(path) {
|
|
45
|
+
function normalizeApiPath(path, node) {
|
|
44
46
|
if (!path.trim())
|
|
45
47
|
return '/';
|
|
46
48
|
if (path.startsWith('http://') || path.startsWith('https://')) {
|
|
47
|
-
throw new n8n_workflow_1.
|
|
49
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Use a path relative to https://www.tracira.com/api, for example /logs');
|
|
48
50
|
}
|
|
49
51
|
return path.startsWith('/') ? path : `/${path}`;
|
|
50
52
|
}
|
|
51
|
-
function parseJsonObject(text, fieldName) {
|
|
53
|
+
function parseJsonObject(text, fieldName, node) {
|
|
52
54
|
if (!text.trim())
|
|
53
55
|
return {};
|
|
54
56
|
let parsed;
|
|
@@ -56,10 +58,10 @@ function parseJsonObject(text, fieldName) {
|
|
|
56
58
|
parsed = JSON.parse(text);
|
|
57
59
|
}
|
|
58
60
|
catch {
|
|
59
|
-
throw new n8n_workflow_1.
|
|
61
|
+
throw new n8n_workflow_1.NodeOperationError(node, `${fieldName} must be valid JSON`);
|
|
60
62
|
}
|
|
61
63
|
if (parsed === null || Array.isArray(parsed) || typeof parsed !== 'object') {
|
|
62
|
-
throw new n8n_workflow_1.
|
|
64
|
+
throw new n8n_workflow_1.NodeOperationError(node, `${fieldName} must be a JSON object`);
|
|
63
65
|
}
|
|
64
66
|
return parsed;
|
|
65
67
|
}
|
|
@@ -86,11 +88,12 @@ class Tracira {
|
|
|
86
88
|
this.description = {
|
|
87
89
|
displayName: 'Tracira',
|
|
88
90
|
name: 'tracira',
|
|
89
|
-
icon: 'file:tracira.svg',
|
|
91
|
+
icon: { light: 'file:tracira.svg', dark: 'file:tracira.dark.svg' },
|
|
90
92
|
group: ['transform'],
|
|
91
93
|
version: 1,
|
|
92
94
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
93
95
|
description: 'Log and inspect Tracira AI log data',
|
|
96
|
+
usableAsTool: true,
|
|
94
97
|
codex: {
|
|
95
98
|
categories: ['AI'],
|
|
96
99
|
resources: {
|
|
@@ -110,8 +113,8 @@ class Tracira {
|
|
|
110
113
|
defaults: {
|
|
111
114
|
name: 'Tracira',
|
|
112
115
|
},
|
|
113
|
-
inputs: [
|
|
114
|
-
outputs: [
|
|
116
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
117
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
115
118
|
credentials: [
|
|
116
119
|
{
|
|
117
120
|
name: 'traciraApi',
|
|
@@ -146,37 +149,37 @@ class Tracira {
|
|
|
146
149
|
},
|
|
147
150
|
options: [
|
|
148
151
|
{
|
|
149
|
-
name: '
|
|
152
|
+
name: 'Create a Log',
|
|
153
|
+
value: 'log',
|
|
154
|
+
action: 'Create a log',
|
|
155
|
+
description: 'Send an AI output to Tracira and create a log for evaluation. Returns a verdict, confidence score, and explanation based on your configured rules.',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'Flag a Log',
|
|
150
159
|
value: 'flag',
|
|
151
|
-
action: 'Flag a log
|
|
160
|
+
action: 'Flag a log',
|
|
152
161
|
description: 'Flag an evaluated log for human review, e.g. when an end-user reports an issue',
|
|
153
162
|
},
|
|
154
163
|
{
|
|
155
|
-
name: 'Get',
|
|
164
|
+
name: 'Get a Log',
|
|
156
165
|
value: 'get',
|
|
157
166
|
action: 'Get a log',
|
|
158
|
-
description: 'Fetch a single log by ID',
|
|
167
|
+
description: 'Fetch a single log by ID, including verdict, explanation, and human decision',
|
|
159
168
|
},
|
|
160
169
|
{
|
|
161
|
-
name: '
|
|
162
|
-
value: '
|
|
163
|
-
action: '
|
|
164
|
-
description: '
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: 'Log',
|
|
168
|
-
value: 'log',
|
|
169
|
-
action: 'Log an AI output',
|
|
170
|
-
description: 'Send an AI output to Tracira for evaluation',
|
|
170
|
+
name: 'Search Logs',
|
|
171
|
+
value: 'search',
|
|
172
|
+
action: 'Search logs',
|
|
173
|
+
description: 'Return a filtered list of logs from Tracira. Filter by status, project, task name, or date range.',
|
|
171
174
|
},
|
|
172
175
|
{
|
|
173
|
-
name: 'Set Decision',
|
|
176
|
+
name: 'Set a Decision',
|
|
174
177
|
value: 'setDecision',
|
|
175
|
-
action: 'Set a decision
|
|
176
|
-
description: 'Approve or
|
|
178
|
+
action: 'Set a decision',
|
|
179
|
+
description: 'Approve, reject, or send a flagged log back to the AI with a comment',
|
|
177
180
|
},
|
|
178
181
|
{
|
|
179
|
-
name: 'Upload File',
|
|
182
|
+
name: 'Upload a File',
|
|
180
183
|
value: 'upload',
|
|
181
184
|
action: 'Upload a file',
|
|
182
185
|
description: 'Upload a large file directly to Tracira storage, then attach it to a log by key',
|
|
@@ -235,20 +238,20 @@ class Tracira {
|
|
|
235
238
|
},
|
|
236
239
|
options: [
|
|
237
240
|
{
|
|
238
|
-
name: '
|
|
241
|
+
name: 'Approve',
|
|
239
242
|
value: 'approved',
|
|
240
243
|
},
|
|
241
244
|
{
|
|
242
|
-
name: '
|
|
243
|
-
value: '
|
|
244
|
-
description: 'Send the log back to the AI with a comment to regenerate',
|
|
245
|
+
name: 'Reject',
|
|
246
|
+
value: 'rejected',
|
|
245
247
|
},
|
|
246
248
|
{
|
|
247
|
-
name: '
|
|
248
|
-
value: '
|
|
249
|
+
name: 'Send Back for Changes',
|
|
250
|
+
value: 'changed',
|
|
251
|
+
description: 'Send the log back to the AI with a comment to regenerate',
|
|
249
252
|
},
|
|
250
253
|
],
|
|
251
|
-
description: '
|
|
254
|
+
description: 'Approve or reject the flagged log, or send it back to the AI with a comment',
|
|
252
255
|
},
|
|
253
256
|
{
|
|
254
257
|
displayName: 'Comment',
|
|
@@ -265,7 +268,7 @@ class Tracira {
|
|
|
265
268
|
decision: ['changed'],
|
|
266
269
|
},
|
|
267
270
|
},
|
|
268
|
-
description: 'The instruction sent back to the AI describing what to change. Required when Decision is
|
|
271
|
+
description: 'The instruction sent back to the AI describing what to change. Required when Decision is Send Back for Changes. The AI should regenerate the output and resubmit it with the Create a Log operation, setting Revision Of to this log ID.',
|
|
269
272
|
},
|
|
270
273
|
{
|
|
271
274
|
displayName: 'Log ID',
|
|
@@ -314,18 +317,44 @@ class Tracira {
|
|
|
314
317
|
description: 'Optional file name. Overrides the binary field name; its extension is used to detect the file type.',
|
|
315
318
|
},
|
|
316
319
|
{
|
|
317
|
-
displayName: '
|
|
318
|
-
name: '
|
|
320
|
+
displayName: 'Content Type',
|
|
321
|
+
name: 'uploadContentType',
|
|
319
322
|
type: 'string',
|
|
320
|
-
required: true,
|
|
321
323
|
default: '',
|
|
324
|
+
displayOptions: {
|
|
325
|
+
show: uploadDisplay,
|
|
326
|
+
},
|
|
327
|
+
description: 'Optional. Override the MIME type (e.g. application/pdf, image/png). Only needed when the file name has no recognizable extension.',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
displayName: 'Project Name',
|
|
331
|
+
name: 'projectName',
|
|
332
|
+
type: 'resourceLocator',
|
|
333
|
+
required: true,
|
|
334
|
+
default: { mode: 'list', value: '' },
|
|
322
335
|
displayOptions: {
|
|
323
336
|
show: logOperationDisplay,
|
|
324
337
|
},
|
|
325
|
-
description: '
|
|
338
|
+
description: 'Select an existing project or enter a new name — it will be auto-created in Tracira on first use',
|
|
339
|
+
modes: [
|
|
340
|
+
{
|
|
341
|
+
displayName: 'From List',
|
|
342
|
+
name: 'list',
|
|
343
|
+
type: 'list',
|
|
344
|
+
typeOptions: {
|
|
345
|
+
searchListMethod: 'getProjects',
|
|
346
|
+
searchable: true,
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
displayName: 'Name',
|
|
351
|
+
name: 'name',
|
|
352
|
+
type: 'string',
|
|
353
|
+
},
|
|
354
|
+
],
|
|
326
355
|
},
|
|
327
356
|
{
|
|
328
|
-
displayName: 'Output',
|
|
357
|
+
displayName: 'AI Output',
|
|
329
358
|
name: 'output',
|
|
330
359
|
type: 'string',
|
|
331
360
|
typeOptions: {
|
|
@@ -336,10 +365,10 @@ class Tracira {
|
|
|
336
365
|
displayOptions: {
|
|
337
366
|
show: logOperationDisplay,
|
|
338
367
|
},
|
|
339
|
-
description: 'The AI-generated output to evaluate
|
|
368
|
+
description: 'The AI-generated output to evaluate against your Tracira rules',
|
|
340
369
|
},
|
|
341
370
|
{
|
|
342
|
-
displayName: '
|
|
371
|
+
displayName: 'Text Prompt',
|
|
343
372
|
name: 'input',
|
|
344
373
|
type: 'string',
|
|
345
374
|
typeOptions: {
|
|
@@ -349,7 +378,7 @@ class Tracira {
|
|
|
349
378
|
displayOptions: {
|
|
350
379
|
show: logOperationDisplay,
|
|
351
380
|
},
|
|
352
|
-
description: 'Optional
|
|
381
|
+
description: 'Optional text sent to your AI model alongside any attachments',
|
|
353
382
|
},
|
|
354
383
|
{
|
|
355
384
|
displayName: 'Attachments',
|
|
@@ -363,23 +392,12 @@ class Tracira {
|
|
|
363
392
|
displayOptions: {
|
|
364
393
|
show: logOperationDisplay,
|
|
365
394
|
},
|
|
366
|
-
description: 'Files to attach to the log (the source the AI worked from)',
|
|
395
|
+
description: 'Files to attach to the log (the source the AI worked from). Tracira auto-detects whether each attachment is an image, audio file, or document.',
|
|
367
396
|
options: [
|
|
368
397
|
{
|
|
369
398
|
name: 'attachment',
|
|
370
399
|
displayName: 'Attachment',
|
|
371
400
|
values: [
|
|
372
|
-
{
|
|
373
|
-
displayName: 'Source',
|
|
374
|
-
name: 'source',
|
|
375
|
-
type: 'options',
|
|
376
|
-
default: 'uploaded',
|
|
377
|
-
options: [
|
|
378
|
-
{ name: 'Uploaded File (Key)', value: 'uploaded' },
|
|
379
|
-
{ name: 'URL', value: 'url' },
|
|
380
|
-
],
|
|
381
|
-
description: 'Where the file comes from',
|
|
382
|
-
},
|
|
383
401
|
{
|
|
384
402
|
displayName: 'Attachment Key',
|
|
385
403
|
name: 'key',
|
|
@@ -390,50 +408,103 @@ class Tracira {
|
|
|
390
408
|
source: ['uploaded'],
|
|
391
409
|
},
|
|
392
410
|
},
|
|
393
|
-
description: 'The key returned by an Upload File operation. Use this for large files (over 3 MB) that cannot be sent inline.',
|
|
411
|
+
description: 'The key returned by an Upload a File operation. Use this for large files (over 3 MB) that cannot be sent inline.',
|
|
394
412
|
},
|
|
395
413
|
{
|
|
396
|
-
displayName: '
|
|
397
|
-
name: '
|
|
414
|
+
displayName: 'File Name',
|
|
415
|
+
name: 'filename',
|
|
398
416
|
type: 'string',
|
|
399
417
|
default: '',
|
|
418
|
+
description: 'Optional original file name shown to reviewers',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
displayName: 'Input Binary Field',
|
|
422
|
+
name: 'binaryProperty',
|
|
423
|
+
type: 'string',
|
|
424
|
+
default: 'data',
|
|
400
425
|
displayOptions: {
|
|
401
426
|
show: {
|
|
402
|
-
source: ['
|
|
427
|
+
source: ['upload'],
|
|
403
428
|
},
|
|
404
429
|
},
|
|
405
|
-
|
|
430
|
+
hint: 'The name of the input field containing the binary file to attach',
|
|
431
|
+
description: 'The file is sent inline with this request. The whole request is limited to 4.5 MB, so keep inline files under ~3 MB. For larger files, use the Upload a File operation first, then attach with source "Tracira Upload".',
|
|
406
432
|
},
|
|
407
433
|
{
|
|
408
|
-
displayName: '
|
|
409
|
-
name: '
|
|
434
|
+
displayName: 'Source',
|
|
435
|
+
name: 'source',
|
|
436
|
+
type: 'options',
|
|
437
|
+
default: 'upload',
|
|
438
|
+
options: [
|
|
439
|
+
{
|
|
440
|
+
name: 'From URL',
|
|
441
|
+
value: 'url',
|
|
442
|
+
description: 'HTTPS URL to a publicly accessible file',
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: 'Tracira Upload',
|
|
446
|
+
value: 'uploaded',
|
|
447
|
+
description: 'A key returned by the Upload a File operation — use for files over ~3 MB',
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: 'Upload File',
|
|
451
|
+
value: 'upload',
|
|
452
|
+
description: 'Send a binary file inline with this request (keep under ~3 MB)',
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
description: 'Where the file comes from',
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
displayName: 'URL',
|
|
459
|
+
name: 'url',
|
|
410
460
|
type: 'string',
|
|
411
461
|
default: '',
|
|
412
|
-
|
|
462
|
+
displayOptions: {
|
|
463
|
+
show: {
|
|
464
|
+
source: ['url'],
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
description: 'HTTPS URL to a publicly accessible image, audio file, or PDF',
|
|
413
468
|
},
|
|
414
469
|
],
|
|
415
470
|
},
|
|
416
471
|
],
|
|
417
472
|
},
|
|
418
473
|
{
|
|
419
|
-
displayName: 'Task',
|
|
474
|
+
displayName: 'Task Name',
|
|
420
475
|
name: 'taskName',
|
|
421
|
-
type: '
|
|
422
|
-
default: '',
|
|
476
|
+
type: 'resourceLocator',
|
|
477
|
+
default: { mode: 'list', value: '' },
|
|
423
478
|
displayOptions: {
|
|
424
479
|
show: logOperationDisplay,
|
|
425
480
|
},
|
|
426
|
-
description: 'Optional
|
|
481
|
+
description: 'Optional. Select an existing task or enter a new name (e.g. "Tone Validator", "Reply Generator").',
|
|
482
|
+
modes: [
|
|
483
|
+
{
|
|
484
|
+
displayName: 'From List',
|
|
485
|
+
name: 'list',
|
|
486
|
+
type: 'list',
|
|
487
|
+
typeOptions: {
|
|
488
|
+
searchListMethod: 'getTasks',
|
|
489
|
+
searchable: true,
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
displayName: 'Name',
|
|
494
|
+
name: 'name',
|
|
495
|
+
type: 'string',
|
|
496
|
+
},
|
|
497
|
+
],
|
|
427
498
|
},
|
|
428
499
|
{
|
|
429
|
-
displayName: 'Model',
|
|
500
|
+
displayName: 'AI Model',
|
|
430
501
|
name: 'modelName',
|
|
431
502
|
type: 'string',
|
|
432
503
|
default: '',
|
|
433
504
|
displayOptions: {
|
|
434
505
|
show: logOperationDisplay,
|
|
435
506
|
},
|
|
436
|
-
description: 'Optional AI model
|
|
507
|
+
description: 'Optional. The name of the AI model that produced this output, exactly as you use it — e.g. "gpt-4o", "claude-sonnet-4-5".',
|
|
437
508
|
},
|
|
438
509
|
{
|
|
439
510
|
displayName: 'Wait for Verdict',
|
|
@@ -562,24 +633,56 @@ class Tracira {
|
|
|
562
633
|
description: 'Filter logs by status',
|
|
563
634
|
},
|
|
564
635
|
{
|
|
565
|
-
displayName: 'Project',
|
|
636
|
+
displayName: 'Project Name',
|
|
566
637
|
name: 'projectFilter',
|
|
567
|
-
type: '
|
|
568
|
-
default: '',
|
|
638
|
+
type: 'resourceLocator',
|
|
639
|
+
default: { mode: 'list', value: '' },
|
|
569
640
|
displayOptions: {
|
|
570
641
|
show: getAllDisplay,
|
|
571
642
|
},
|
|
572
|
-
description: 'Filter logs to a specific project name',
|
|
643
|
+
description: 'Optional. Filter logs to a specific project name.',
|
|
644
|
+
modes: [
|
|
645
|
+
{
|
|
646
|
+
displayName: 'From List',
|
|
647
|
+
name: 'list',
|
|
648
|
+
type: 'list',
|
|
649
|
+
typeOptions: {
|
|
650
|
+
searchListMethod: 'getProjects',
|
|
651
|
+
searchable: true,
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
displayName: 'Name',
|
|
656
|
+
name: 'name',
|
|
657
|
+
type: 'string',
|
|
658
|
+
},
|
|
659
|
+
],
|
|
573
660
|
},
|
|
574
661
|
{
|
|
575
|
-
displayName: 'Task',
|
|
662
|
+
displayName: 'Task Name',
|
|
576
663
|
name: 'taskFilter',
|
|
577
|
-
type: '
|
|
578
|
-
default: '',
|
|
664
|
+
type: 'resourceLocator',
|
|
665
|
+
default: { mode: 'list', value: '' },
|
|
579
666
|
displayOptions: {
|
|
580
667
|
show: getAllDisplay,
|
|
581
668
|
},
|
|
582
|
-
description: 'Filter logs to a specific task name',
|
|
669
|
+
description: 'Optional. Filter logs to a specific task name within a project.',
|
|
670
|
+
modes: [
|
|
671
|
+
{
|
|
672
|
+
displayName: 'From List',
|
|
673
|
+
name: 'list',
|
|
674
|
+
type: 'list',
|
|
675
|
+
typeOptions: {
|
|
676
|
+
searchListMethod: 'getTasks',
|
|
677
|
+
searchable: true,
|
|
678
|
+
},
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
displayName: 'Name',
|
|
682
|
+
name: 'name',
|
|
683
|
+
type: 'string',
|
|
684
|
+
},
|
|
685
|
+
],
|
|
583
686
|
},
|
|
584
687
|
{
|
|
585
688
|
displayName: 'Search Query',
|
|
@@ -592,7 +695,7 @@ class Tracira {
|
|
|
592
695
|
description: 'Search across project, task, model, and context IDs',
|
|
593
696
|
},
|
|
594
697
|
{
|
|
595
|
-
displayName: 'From',
|
|
698
|
+
displayName: 'From Date',
|
|
596
699
|
name: 'from',
|
|
597
700
|
type: 'dateTime',
|
|
598
701
|
default: '',
|
|
@@ -602,7 +705,7 @@ class Tracira {
|
|
|
602
705
|
description: 'Only include logs at or after this date',
|
|
603
706
|
},
|
|
604
707
|
{
|
|
605
|
-
displayName: 'To',
|
|
708
|
+
displayName: 'To Date',
|
|
606
709
|
name: 'to',
|
|
607
710
|
type: 'dateTime',
|
|
608
711
|
default: '',
|
|
@@ -738,6 +841,12 @@ class Tracira {
|
|
|
738
841
|
},
|
|
739
842
|
],
|
|
740
843
|
};
|
|
844
|
+
this.methods = {
|
|
845
|
+
listSearch: {
|
|
846
|
+
getProjects: getProjects_1.getProjects,
|
|
847
|
+
getTasks: getTasks_1.getTasks,
|
|
848
|
+
},
|
|
849
|
+
};
|
|
741
850
|
}
|
|
742
851
|
async execute() {
|
|
743
852
|
var _a, _b;
|
|
@@ -763,22 +872,41 @@ class Tracira {
|
|
|
763
872
|
}
|
|
764
873
|
const attachmentsParam = this.getNodeParameter('attachments', itemIndex, {});
|
|
765
874
|
const attachmentRows = (_a = attachmentsParam.attachment) !== null && _a !== void 0 ? _a : [];
|
|
766
|
-
const attachments =
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
875
|
+
const attachments = [];
|
|
876
|
+
for (const row of attachmentRows) {
|
|
877
|
+
if (row.source === 'upload') {
|
|
878
|
+
const binaryProperty = row.binaryProperty || 'data';
|
|
879
|
+
const binary = this.helpers.assertBinaryData(itemIndex, binaryProperty);
|
|
880
|
+
const buffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryProperty);
|
|
881
|
+
attachments.push(stripEmpty({
|
|
882
|
+
source: 'upload',
|
|
883
|
+
data: buffer.toString('base64'),
|
|
884
|
+
filename: row.filename || binary.fileName || 'file',
|
|
885
|
+
}));
|
|
886
|
+
continue;
|
|
887
|
+
}
|
|
888
|
+
const entry = stripEmpty({
|
|
889
|
+
source: row.source,
|
|
890
|
+
key: row.key,
|
|
891
|
+
url: row.url,
|
|
892
|
+
filename: row.filename,
|
|
893
|
+
});
|
|
894
|
+
if (entry.key !== undefined || entry.url !== undefined) {
|
|
895
|
+
attachments.push(entry);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
774
898
|
requestOptions = {
|
|
775
899
|
method: 'POST',
|
|
776
900
|
url: `${baseUrl}/logs`,
|
|
777
901
|
body: stripEmpty({
|
|
778
|
-
project: this.getNodeParameter('projectName', itemIndex
|
|
902
|
+
project: this.getNodeParameter('projectName', itemIndex, '', {
|
|
903
|
+
extractValue: true,
|
|
904
|
+
}),
|
|
779
905
|
output: this.getNodeParameter('output', itemIndex),
|
|
780
906
|
input: this.getNodeParameter('input', itemIndex, ''),
|
|
781
|
-
task: this.getNodeParameter('taskName', itemIndex, ''
|
|
907
|
+
task: this.getNodeParameter('taskName', itemIndex, '', {
|
|
908
|
+
extractValue: true,
|
|
909
|
+
}),
|
|
782
910
|
model: this.getNodeParameter('modelName', itemIndex, ''),
|
|
783
911
|
attachments: attachments.length ? attachments : undefined,
|
|
784
912
|
actorId: options.actorId,
|
|
@@ -804,15 +932,19 @@ class Tracira {
|
|
|
804
932
|
url: `${baseUrl}/logs/${encodeURIComponent(logId)}`,
|
|
805
933
|
};
|
|
806
934
|
}
|
|
807
|
-
else if (resource === 'log' && operation === '
|
|
935
|
+
else if (resource === 'log' && operation === 'search') {
|
|
808
936
|
const filters = this.getNodeParameter('filters', itemIndex, {});
|
|
809
937
|
requestOptions = {
|
|
810
938
|
method: 'GET',
|
|
811
939
|
url: `${baseUrl}/logs`,
|
|
812
940
|
qs: stripEmpty({
|
|
813
941
|
status: this.getNodeParameter('status', itemIndex, ''),
|
|
814
|
-
project: this.getNodeParameter('projectFilter', itemIndex, ''
|
|
815
|
-
|
|
942
|
+
project: this.getNodeParameter('projectFilter', itemIndex, '', {
|
|
943
|
+
extractValue: true,
|
|
944
|
+
}),
|
|
945
|
+
task: this.getNodeParameter('taskFilter', itemIndex, '', {
|
|
946
|
+
extractValue: true,
|
|
947
|
+
}),
|
|
816
948
|
q: this.getNodeParameter('query', itemIndex, ''),
|
|
817
949
|
from: this.getNodeParameter('from', itemIndex, ''),
|
|
818
950
|
to: this.getNodeParameter('to', itemIndex, ''),
|
|
@@ -831,7 +963,7 @@ class Tracira {
|
|
|
831
963
|
? this.getNodeParameter('comment', itemIndex, '')
|
|
832
964
|
: '';
|
|
833
965
|
if (decision === 'changed' && !comment.trim()) {
|
|
834
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Comment is required when Decision is
|
|
966
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Comment is required when Decision is Send Back for Changes', { itemIndex });
|
|
835
967
|
}
|
|
836
968
|
requestOptions = {
|
|
837
969
|
method: 'PATCH',
|
|
@@ -857,6 +989,7 @@ class Tracira {
|
|
|
857
989
|
else if (resource === 'log' && operation === 'upload') {
|
|
858
990
|
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', itemIndex, 'data');
|
|
859
991
|
const fileNameOverride = this.getNodeParameter('uploadFileName', itemIndex, '');
|
|
992
|
+
const contentTypeOverride = this.getNodeParameter('uploadContentType', itemIndex, '');
|
|
860
993
|
const binary = this.helpers.assertBinaryData(itemIndex, binaryPropertyName);
|
|
861
994
|
const buffer = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
|
|
862
995
|
const filename = fileNameOverride || binary.fileName || 'file';
|
|
@@ -865,13 +998,13 @@ class Tracira {
|
|
|
865
998
|
url: `${baseUrl}/uploads`,
|
|
866
999
|
body: stripEmpty({
|
|
867
1000
|
filename,
|
|
868
|
-
contentType: binary.mimeType,
|
|
1001
|
+
contentType: contentTypeOverride || binary.mimeType,
|
|
869
1002
|
sizeBytes: buffer.length,
|
|
870
1003
|
}),
|
|
871
1004
|
}));
|
|
872
1005
|
const uploadUrl = presign.uploadUrl;
|
|
873
1006
|
const key = presign.key;
|
|
874
|
-
const contentType = (_b = presign.contentType) !== null && _b !== void 0 ? _b : binary.mimeType;
|
|
1007
|
+
const contentType = (_b = presign.contentType) !== null && _b !== void 0 ? _b : (contentTypeOverride || binary.mimeType);
|
|
875
1008
|
if (!uploadUrl || !key) {
|
|
876
1009
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Tracira did not return an upload URL', { itemIndex });
|
|
877
1010
|
}
|
|
@@ -889,12 +1022,12 @@ class Tracira {
|
|
|
889
1022
|
continue;
|
|
890
1023
|
}
|
|
891
1024
|
else if (resource === 'api' && operation === 'call') {
|
|
892
|
-
const headers = parseJsonObject(this.getNodeParameter('apiHeadersJson', itemIndex, '{}'), 'Headers JSON');
|
|
893
|
-
const qs = parseJsonObject(this.getNodeParameter('apiQueryJson', itemIndex, '{}'), 'Query String JSON');
|
|
1025
|
+
const headers = parseJsonObject(this.getNodeParameter('apiHeadersJson', itemIndex, '{}'), 'Headers JSON', this.getNode());
|
|
1026
|
+
const qs = parseJsonObject(this.getNodeParameter('apiQueryJson', itemIndex, '{}'), 'Query String JSON', this.getNode());
|
|
894
1027
|
const body = parseOptionalJsonBody(this.getNodeParameter('apiBody', itemIndex, ''));
|
|
895
1028
|
requestOptions = {
|
|
896
1029
|
method: this.getNodeParameter('apiMethod', itemIndex),
|
|
897
|
-
url: `${baseUrl}${normalizeApiPath(this.getNodeParameter('apiPath', itemIndex))}`,
|
|
1030
|
+
url: `${baseUrl}${normalizeApiPath(this.getNodeParameter('apiPath', itemIndex), this.getNode())}`,
|
|
898
1031
|
headers,
|
|
899
1032
|
qs,
|
|
900
1033
|
body,
|
|
@@ -907,7 +1040,7 @@ class Tracira {
|
|
|
907
1040
|
});
|
|
908
1041
|
}
|
|
909
1042
|
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'traciraApi', requestOptions);
|
|
910
|
-
if (resource === 'log' && operation === '
|
|
1043
|
+
if (resource === 'log' && operation === 'search' && Array.isArray(response === null || response === void 0 ? void 0 : response.executions)) {
|
|
911
1044
|
for (const log of response.executions) {
|
|
912
1045
|
returnData.push({
|
|
913
1046
|
json: log,
|