n8n-nodes-kumiho 0.3.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.
@@ -0,0 +1,2581 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KumihoAction = void 0;
4
+ function stripProjectMetadata(value) {
5
+ if (!value)
6
+ return value;
7
+ if (Array.isArray(value)) {
8
+ return value.map((entry) => stripProjectMetadata(entry));
9
+ }
10
+ if (typeof value === 'object') {
11
+ const obj = value;
12
+ if (!Object.prototype.hasOwnProperty.call(obj, 'metadata'))
13
+ return value;
14
+ const rest = { ...obj };
15
+ delete rest.metadata;
16
+ return rest;
17
+ }
18
+ return value;
19
+ }
20
+ const n8n_workflow_1 = require("n8n-workflow");
21
+ const kumihoApi_1 = require("../helpers/kumihoApi");
22
+ const splitCsv = (value) => {
23
+ const raw = String(value !== null && value !== void 0 ? value : '')
24
+ .split(',')
25
+ .map((s) => s.trim())
26
+ .filter(Boolean);
27
+ return raw.length ? raw : undefined;
28
+ };
29
+ const parseOptionalInt = (value) => {
30
+ const raw = String(value !== null && value !== void 0 ? value : '').trim();
31
+ if (!raw)
32
+ return undefined;
33
+ const parsed = Number(raw);
34
+ if (!Number.isFinite(parsed) || !Number.isInteger(parsed) || parsed < 0) {
35
+ throw new n8n_workflow_1.ApplicationError(`Value must be a non-negative integer (got '${raw}')`);
36
+ }
37
+ return parsed;
38
+ };
39
+ const normalizeProjectName = (context, raw) => {
40
+ const input = String(raw !== null && raw !== void 0 ? raw : '').trim();
41
+ if (!input) {
42
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Project Name is required');
43
+ }
44
+ const normalized = input.replace(/^\/+/, '');
45
+ if (!normalized) {
46
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Project Name is required');
47
+ }
48
+ if (normalized.includes('/')) {
49
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Project Name must be a single URL-safe name (no "/"). Example: my-vfx-project');
50
+ }
51
+ return normalized;
52
+ };
53
+ const normalizeKumihoPath = (context, raw, fieldLabel) => {
54
+ const input = String(raw !== null && raw !== void 0 ? raw : '').trim();
55
+ if (!input) {
56
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} is required`);
57
+ }
58
+ if (input.includes('{{') || input.includes('}}') || input.startsWith('={{') || input.includes('$json')) {
59
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} looks like a template string ('{{ ... }}'). In n8n use an expression like: ={{ $json.name }}`);
60
+ }
61
+ const withoutScheme = input.replace(/^[a-z]+:\/\/[^/]+/i, '').trim();
62
+ const noLeading = withoutScheme.replace(/^\/+/, '');
63
+ const noTrailing = noLeading.replace(/\/+$/, '');
64
+ if (!noTrailing) {
65
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} is required`);
66
+ }
67
+ const normalized = `/${noTrailing}`;
68
+ const valid = /^\/[A-Za-z0-9][A-Za-z0-9._-]*(\/[A-Za-z0-9][A-Za-z0-9._-]*)*$/.test(normalized);
69
+ if (!valid) {
70
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} must be a path like 'my-project' or 'my-project/Assets' (letters, numbers, '-', '_', '.' only). Got: '${input}'`);
71
+ }
72
+ return normalized;
73
+ };
74
+ const normalizeSearchContextFilter = (context, raw) => {
75
+ const input = String(raw !== null && raw !== void 0 ? raw : '').trim();
76
+ if (!input)
77
+ return '';
78
+ if (input.includes('{{') || input.includes('}}') || input.startsWith('={{') || input.includes('$json')) {
79
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), "Context Filter looks like a template string ('{{ ... }}'). In n8n use an expression like: ={{ $json.path }}");
80
+ }
81
+ const withoutScheme = input.replace(/^[a-z]+:\/\/[^/]+/i, '').trim();
82
+ const noLeading = withoutScheme.replace(/^\/+/, '');
83
+ return noLeading.replace(/\/+$/, '');
84
+ };
85
+ const normalizeKrefString = (context, raw, fieldLabel) => {
86
+ const input = String(raw !== null && raw !== void 0 ? raw : '').trim();
87
+ if (!input) {
88
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} is required`);
89
+ }
90
+ if (input.includes('{{') || input.includes('}}')) {
91
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} looks like a template string ('{{ ... }}'). In n8n use an expression like: ={{ $json.source_kref }}`);
92
+ }
93
+ const normalized = input
94
+ .replace(/\bkref:\s*\/\//gi, 'kref://')
95
+ .replace(/\bkref:\/\//gi, 'kref://')
96
+ .trim();
97
+ if (!normalized.toLowerCase().startsWith('kref://')) {
98
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `${fieldLabel} must start with 'kref://'. Example: kref://project/space/item.kind?r=1`);
99
+ }
100
+ return normalized;
101
+ };
102
+ const emitArray = (out, value, outputFormat, returnAll, limit) => {
103
+ if (!Array.isArray(value)) {
104
+ out.push({ json: value });
105
+ return;
106
+ }
107
+ const limited = (0, kumihoApi_1.applyReturnAllLimit)(value, returnAll, limit);
108
+ if (outputFormat === 'singleArray') {
109
+ out.push({ json: limited });
110
+ return;
111
+ }
112
+ for (const entry of limited) {
113
+ out.push({ json: entry });
114
+ }
115
+ };
116
+ class KumihoAction {
117
+ constructor() {
118
+ this.description = {
119
+ displayName: 'Kumiho Action',
120
+ name: 'kumihoAction',
121
+ icon: 'file:../images/Action.svg',
122
+ usableAsTool: true,
123
+ group: ['transform'],
124
+ version: 1,
125
+ description: 'Create, read, update, or delete Kumiho resources.',
126
+ defaults: {
127
+ name: 'Kumiho Action',
128
+ },
129
+ inputs: ['main'],
130
+ outputs: ['main'],
131
+ credentials: [
132
+ {
133
+ name: 'kumihoApi',
134
+ required: true,
135
+ },
136
+ ],
137
+ properties: [
138
+ {
139
+ displayName: 'Resource',
140
+ name: 'resource',
141
+ type: 'options',
142
+ noDataExpression: true,
143
+ options: [
144
+ { name: 'Artifact', value: 'artifact' },
145
+ { name: 'Bundle', value: 'bundle' },
146
+ { name: 'Item', value: 'item' },
147
+ { name: 'Kref', value: 'kref' },
148
+ { name: 'Project', value: 'project' },
149
+ { name: 'Revision', value: 'revision' },
150
+ { name: 'Space', value: 'space' },
151
+ ],
152
+ default: 'project',
153
+ },
154
+ {
155
+ displayName: 'Operation',
156
+ name: 'operation',
157
+ type: 'options',
158
+ noDataExpression: true,
159
+ options: [
160
+ { name: 'Create', value: 'create' },
161
+ { name: 'Read', value: 'read' },
162
+ { name: 'Update', value: 'update' },
163
+ { name: 'Delete', value: 'delete' },
164
+ ],
165
+ default: 'read',
166
+ },
167
+ {
168
+ displayName: 'Create Mode',
169
+ name: 'createModeRevision',
170
+ type: 'options',
171
+ options: [
172
+ { name: 'Create Revision', value: 'revisionCreate' },
173
+ { name: 'Create Edge', value: 'graphCreateEdge' },
174
+ ],
175
+ default: 'revisionCreate',
176
+ displayOptions: {
177
+ show: {
178
+ resource: ['revision'],
179
+ operation: ['create'],
180
+ },
181
+ },
182
+ },
183
+ {
184
+ displayName: 'Create Mode',
185
+ name: 'createMode',
186
+ type: 'options',
187
+ options: [{ name: 'Create Edge', value: 'graphCreateEdge' }],
188
+ default: 'graphCreateEdge',
189
+ displayOptions: {
190
+ show: {
191
+ resource: ['graph'],
192
+ operation: ['create'],
193
+ },
194
+ },
195
+ },
196
+ {
197
+ displayName: 'Read Mode',
198
+ name: 'readModeProject',
199
+ type: 'options',
200
+ options: [
201
+ { name: 'Get Project', value: 'projectGet' },
202
+ { name: 'List Projects', value: 'projectList' },
203
+ ],
204
+ default: 'projectGet',
205
+ displayOptions: {
206
+ show: {
207
+ resource: ['project'],
208
+ operation: ['read'],
209
+ },
210
+ },
211
+ },
212
+ {
213
+ displayName: 'Read Mode',
214
+ name: 'readModeSpace',
215
+ type: 'options',
216
+ options: [
217
+ { name: 'Get Space (by Path)', value: 'spaceGet' },
218
+ { name: 'List Spaces', value: 'spaceList' },
219
+ ],
220
+ default: 'spaceGet',
221
+ displayOptions: {
222
+ show: {
223
+ resource: ['space'],
224
+ operation: ['read'],
225
+ },
226
+ },
227
+ },
228
+ {
229
+ displayName: 'Read Mode',
230
+ name: 'readModeItem',
231
+ type: 'options',
232
+ options: [
233
+ { name: 'Get Item (by Kref)', value: 'itemGet' },
234
+ { name: 'Get Item (by Name / Kind)', value: 'itemGetByPath' },
235
+ { name: 'Search Items', value: 'itemSearch' },
236
+ ],
237
+ default: 'itemGet',
238
+ displayOptions: {
239
+ show: {
240
+ resource: ['item'],
241
+ operation: ['read'],
242
+ },
243
+ },
244
+ },
245
+ {
246
+ displayName: 'Read Mode',
247
+ name: 'readModeRevision',
248
+ type: 'options',
249
+ options: [
250
+ { name: 'Analyze Impact', value: 'graphAnalyzeImpact' },
251
+ { name: 'Find Path', value: 'graphFindPath' },
252
+ { name: 'Get Dependencies', value: 'graphGetDependencies' },
253
+ { name: 'Get Revision (by Kref)', value: 'revisionGetByKref' },
254
+ { name: 'Get Revision (by Tag)', value: 'revisionGetByTag' },
255
+ { name: 'Has Tag', value: 'revisionHasTag' },
256
+ { name: 'List Edges', value: 'graphListEdges' },
257
+ { name: 'List Revision Artifacts', value: 'revisionListArtifacts' },
258
+ { name: 'List Revision Tags', value: 'revisionListTags' },
259
+ { name: 'Was Tagged', value: 'revisionWasTagged' },
260
+ ],
261
+ default: 'revisionGetByKref',
262
+ displayOptions: {
263
+ show: {
264
+ resource: ['revision'],
265
+ operation: ['read'],
266
+ },
267
+ },
268
+ },
269
+ {
270
+ displayName: 'Read Mode',
271
+ name: 'readModeArtifact',
272
+ type: 'options',
273
+ options: [
274
+ { name: 'Get Artifact (by Revision Kref + Name)', value: 'artifactGet' },
275
+ { name: 'Get Artifacts (by Location)', value: 'artifactGetByLocation' },
276
+ ],
277
+ default: 'artifactGet',
278
+ displayOptions: {
279
+ show: {
280
+ resource: ['artifact'],
281
+ operation: ['read'],
282
+ },
283
+ },
284
+ },
285
+ {
286
+ displayName: 'Read Mode',
287
+ name: 'readModeBundle',
288
+ type: 'options',
289
+ options: [
290
+ { name: 'Get Bundle', value: 'bundleGet' },
291
+ { name: 'List Bundle Members', value: 'bundleListMembers' },
292
+ { name: 'Bundle History', value: 'bundleHistory' },
293
+ ],
294
+ default: 'bundleGet',
295
+ displayOptions: {
296
+ show: {
297
+ resource: ['bundle'],
298
+ operation: ['read'],
299
+ },
300
+ },
301
+ },
302
+ {
303
+ displayName: 'Read Mode',
304
+ name: 'readModeGraph',
305
+ type: 'options',
306
+ options: [
307
+ { name: 'List Edges', value: 'graphListEdges' },
308
+ { name: 'Get Dependencies', value: 'graphGetDependencies' },
309
+ { name: 'Find Path', value: 'graphFindPath' },
310
+ { name: 'Analyze Impact', value: 'graphAnalyzeImpact' },
311
+ ],
312
+ default: 'graphListEdges',
313
+ displayOptions: {
314
+ show: {
315
+ resource: ['graph'],
316
+ operation: ['read'],
317
+ },
318
+ },
319
+ },
320
+ {
321
+ displayName: 'Read Mode',
322
+ name: 'readModeKref',
323
+ type: 'options',
324
+ options: [{ name: 'Resolve', value: 'krefResolve' }],
325
+ default: 'krefResolve',
326
+ displayOptions: {
327
+ show: {
328
+ resource: ['kref'],
329
+ operation: ['read'],
330
+ },
331
+ },
332
+ },
333
+ {
334
+ displayName: 'Update Mode',
335
+ name: 'updateModeItem',
336
+ type: 'options',
337
+ options: [
338
+ { name: 'Update Metadata', value: 'itemUpdateMetadata' },
339
+ { name: 'Set Attribute', value: 'itemSetAttribute' },
340
+ { name: 'Deprecate', value: 'itemDeprecate' },
341
+ ],
342
+ default: 'itemUpdateMetadata',
343
+ displayOptions: {
344
+ show: {
345
+ resource: ['item'],
346
+ operation: ['update'],
347
+ },
348
+ },
349
+ },
350
+ {
351
+ displayName: 'Update Mode',
352
+ name: 'updateModeRevision',
353
+ type: 'options',
354
+ options: [
355
+ { name: 'Update Metadata', value: 'revisionUpdateMetadata' },
356
+ { name: 'Deprecate', value: 'revisionDeprecate' },
357
+ { name: 'Set Tag', value: 'revisionSetTag' },
358
+ { name: 'Remove Tag', value: 'revisionRemoveTag' },
359
+ ],
360
+ default: 'revisionUpdateMetadata',
361
+ displayOptions: {
362
+ show: {
363
+ resource: ['revision'],
364
+ operation: ['update'],
365
+ },
366
+ },
367
+ },
368
+ {
369
+ displayName: 'Update Mode',
370
+ name: 'updateModeArtifact',
371
+ type: 'options',
372
+ options: [
373
+ { name: 'Update Metadata', value: 'artifactUpdateMetadata' },
374
+ { name: 'Deprecate', value: 'artifactDeprecate' },
375
+ ],
376
+ default: 'artifactUpdateMetadata',
377
+ displayOptions: {
378
+ show: {
379
+ resource: ['artifact'],
380
+ operation: ['update'],
381
+ },
382
+ },
383
+ },
384
+ {
385
+ displayName: 'Update Mode',
386
+ name: 'updateModeBundle',
387
+ type: 'options',
388
+ options: [
389
+ { name: 'Add Member', value: 'bundleAddMember' },
390
+ { name: 'Remove Member', value: 'bundleRemoveMember' },
391
+ ],
392
+ default: 'bundleAddMember',
393
+ displayOptions: {
394
+ show: {
395
+ resource: ['bundle'],
396
+ operation: ['update'],
397
+ },
398
+ },
399
+ },
400
+ {
401
+ displayName: 'Project Name',
402
+ name: 'projectName',
403
+ type: 'string',
404
+ default: '',
405
+ displayOptions: {
406
+ show: {
407
+ resource: ['project'],
408
+ operation: ['create', 'read', 'delete'],
409
+ },
410
+ },
411
+ },
412
+ {
413
+ displayName: 'Description',
414
+ name: 'projectDescription',
415
+ type: 'string',
416
+ default: '',
417
+ displayOptions: {
418
+ show: {
419
+ resource: ['project'],
420
+ operation: ['create'],
421
+ },
422
+ },
423
+ },
424
+ {
425
+ displayName: 'Force Delete',
426
+ name: 'force',
427
+ type: 'boolean',
428
+ default: false,
429
+ description: 'Whether to permanently delete and remove all contents',
430
+ displayOptions: {
431
+ show: {
432
+ resource: ['project', 'space', 'item', 'bundle', 'revision', 'artifact'],
433
+ operation: ['delete'],
434
+ },
435
+ },
436
+ },
437
+ {
438
+ displayName: 'Space Path',
439
+ name: 'spacePath',
440
+ type: 'string',
441
+ default: '',
442
+ description: 'Example: project/space',
443
+ displayOptions: {
444
+ show: {
445
+ resource: ['space'],
446
+ operation: ['read', 'delete'],
447
+ },
448
+ },
449
+ },
450
+ {
451
+ displayName: 'Parent Path',
452
+ name: 'parentPath',
453
+ type: 'string',
454
+ default: '',
455
+ description: 'Required for Space Create and Space List. Example: project or project/parent-space.',
456
+ displayOptions: {
457
+ show: {
458
+ resource: ['space'],
459
+ operation: ['create', 'read'],
460
+ },
461
+ },
462
+ },
463
+ {
464
+ displayName: 'Space Name',
465
+ name: 'spaceName',
466
+ type: 'string',
467
+ default: '',
468
+ displayOptions: {
469
+ show: {
470
+ resource: ['space'],
471
+ operation: ['create'],
472
+ },
473
+ },
474
+ },
475
+ {
476
+ displayName: 'Recursive',
477
+ name: 'recursive',
478
+ type: 'boolean',
479
+ default: false,
480
+ displayOptions: {
481
+ show: {
482
+ resource: ['space'],
483
+ operation: ['read'],
484
+ readModeSpace: ['spaceList'],
485
+ },
486
+ },
487
+ },
488
+ {
489
+ displayName: 'Item Kref',
490
+ name: 'itemKrefRevisionCreate',
491
+ type: 'string',
492
+ default: '',
493
+ displayOptions: {
494
+ show: {
495
+ resource: ['revision'],
496
+ operation: ['create'],
497
+ createModeRevision: ['revisionCreate'],
498
+ },
499
+ },
500
+ },
501
+ {
502
+ displayName: 'Item Kref',
503
+ name: 'itemKrefRevisionGetByTag',
504
+ type: 'string',
505
+ default: '',
506
+ displayOptions: {
507
+ show: {
508
+ resource: ['revision'],
509
+ operation: ['read'],
510
+ readModeRevision: ['revisionGetByTag'],
511
+ },
512
+ },
513
+ },
514
+ {
515
+ displayName: 'Item Kref',
516
+ name: 'itemKrefRevisionHasTag',
517
+ type: 'string',
518
+ default: '',
519
+ description: 'Example: kref://project/space/item.kind',
520
+ displayOptions: {
521
+ show: {
522
+ resource: ['revision'],
523
+ operation: ['read'],
524
+ readModeRevision: ['revisionHasTag'],
525
+ },
526
+ },
527
+ },
528
+ {
529
+ displayName: 'Revision Kref',
530
+ name: 'revisionKrefReadGetByKref',
531
+ type: 'string',
532
+ default: '',
533
+ description: 'Example: kref://project/space/item.kind?r=1',
534
+ displayOptions: {
535
+ show: {
536
+ resource: ['revision'],
537
+ operation: ['read'],
538
+ readModeRevision: ['revisionGetByKref'],
539
+ },
540
+ },
541
+ },
542
+ {
543
+ displayName: 'Kref',
544
+ name: 'kref',
545
+ type: 'string',
546
+ default: '',
547
+ displayOptions: {
548
+ show: {
549
+ resource: ['revision', 'kref'],
550
+ operation: ['read'],
551
+ },
552
+ hide: {
553
+ resource: ['revision'],
554
+ operation: ['read'],
555
+ readModeRevision: [
556
+ 'revisionGetByKref',
557
+ 'revisionGetByTag',
558
+ 'revisionHasTag',
559
+ 'revisionListArtifacts',
560
+ 'graphListEdges',
561
+ 'graphGetDependencies',
562
+ 'graphFindPath',
563
+ 'graphAnalyzeImpact',
564
+ ],
565
+ },
566
+ },
567
+ },
568
+ {
569
+ displayName: 'Kref',
570
+ name: 'krefRevisionUpdate',
571
+ type: 'string',
572
+ default: '',
573
+ description: 'Example: kref://project/space/item.kind?r=1',
574
+ displayOptions: {
575
+ show: {
576
+ resource: ['revision'],
577
+ operation: ['update'],
578
+ updateModeRevision: ['__legacy'],
579
+ },
580
+ },
581
+ },
582
+ {
583
+ displayName: 'Item Kref',
584
+ name: 'itemKrefItem',
585
+ type: 'string',
586
+ default: '',
587
+ description: 'Example: kref://project/space/item.kind',
588
+ displayOptions: {
589
+ show: {
590
+ resource: ['item'],
591
+ operation: ['read'],
592
+ readModeItem: ['itemGet'],
593
+ },
594
+ },
595
+ },
596
+ {
597
+ displayName: 'Item Kref',
598
+ name: 'itemKrefItem',
599
+ type: 'string',
600
+ default: '',
601
+ description: 'Example: kref://project/space/item.kind',
602
+ displayOptions: {
603
+ show: {
604
+ resource: ['item'],
605
+ operation: ['update', 'delete'],
606
+ },
607
+ },
608
+ },
609
+ {
610
+ displayName: 'Metadata',
611
+ name: 'itemMetadataCreate',
612
+ type: 'json',
613
+ default: '{}',
614
+ displayOptions: {
615
+ show: {
616
+ resource: ['item'],
617
+ operation: ['create'],
618
+ },
619
+ },
620
+ },
621
+ {
622
+ displayName: 'Metadata',
623
+ name: 'itemMetadataUpdate',
624
+ type: 'json',
625
+ default: '{}',
626
+ displayOptions: {
627
+ show: {
628
+ resource: ['item'],
629
+ operation: ['update'],
630
+ updateModeItem: ['itemUpdateMetadata'],
631
+ },
632
+ },
633
+ },
634
+ {
635
+ displayName: 'Space Path',
636
+ name: 'itemSpacePath',
637
+ type: 'string',
638
+ default: '',
639
+ description: 'Example: /project/space',
640
+ displayOptions: {
641
+ show: {
642
+ resource: ['item'],
643
+ operation: ['create'],
644
+ },
645
+ },
646
+ },
647
+ {
648
+ displayName: 'Space Path',
649
+ name: 'itemSpacePath',
650
+ type: 'string',
651
+ default: '',
652
+ description: 'Example: /project/space',
653
+ displayOptions: {
654
+ show: {
655
+ resource: ['item'],
656
+ operation: ['read'],
657
+ readModeItem: ['itemGetByPath'],
658
+ },
659
+ },
660
+ },
661
+ {
662
+ displayName: 'Item Name',
663
+ name: 'itemName',
664
+ type: 'string',
665
+ default: '',
666
+ displayOptions: {
667
+ show: {
668
+ resource: ['item'],
669
+ operation: ['create'],
670
+ },
671
+ },
672
+ },
673
+ {
674
+ displayName: 'Item Name',
675
+ name: 'itemName',
676
+ type: 'string',
677
+ default: '',
678
+ displayOptions: {
679
+ show: {
680
+ resource: ['item'],
681
+ operation: ['read'],
682
+ readModeItem: ['itemGetByPath'],
683
+ },
684
+ },
685
+ },
686
+ {
687
+ displayName: 'Kind',
688
+ name: 'itemKind',
689
+ type: 'string',
690
+ default: 'model',
691
+ displayOptions: {
692
+ show: {
693
+ resource: ['item'],
694
+ operation: ['create'],
695
+ },
696
+ },
697
+ },
698
+ {
699
+ displayName: 'Kind',
700
+ name: 'itemKind',
701
+ type: 'string',
702
+ default: 'model',
703
+ displayOptions: {
704
+ show: {
705
+ resource: ['item'],
706
+ operation: ['read'],
707
+ readModeItem: ['itemGetByPath'],
708
+ },
709
+ },
710
+ },
711
+ {
712
+ displayName: 'Context Filter',
713
+ name: 'contextFilter',
714
+ type: 'string',
715
+ default: '',
716
+ displayOptions: {
717
+ show: {
718
+ operation: ['read'],
719
+ readModeItem: ['itemSearch'],
720
+ },
721
+ },
722
+ },
723
+ {
724
+ displayName: 'Name Filter',
725
+ name: 'nameFilter',
726
+ type: 'string',
727
+ default: '',
728
+ displayOptions: {
729
+ show: {
730
+ operation: ['read'],
731
+ readModeItem: ['itemSearch'],
732
+ },
733
+ },
734
+ },
735
+ {
736
+ displayName: 'Kind Filter',
737
+ name: 'kindFilter',
738
+ type: 'string',
739
+ default: '',
740
+ displayOptions: {
741
+ show: {
742
+ operation: ['read'],
743
+ readModeItem: ['itemSearch'],
744
+ },
745
+ },
746
+ },
747
+ {
748
+ displayName: 'Attribute Key',
749
+ name: 'attributeKey',
750
+ type: 'string',
751
+ default: '',
752
+ displayOptions: {
753
+ show: {
754
+ operation: ['update'],
755
+ updateModeItem: ['itemSetAttribute'],
756
+ },
757
+ },
758
+ },
759
+ {
760
+ displayName: 'Attribute Value',
761
+ name: 'attributeValue',
762
+ type: 'string',
763
+ default: '',
764
+ displayOptions: {
765
+ show: {
766
+ operation: ['update'],
767
+ updateModeItem: ['itemSetAttribute'],
768
+ },
769
+ },
770
+ },
771
+ {
772
+ displayName: 'Deprecated',
773
+ name: 'deprecated',
774
+ type: 'boolean',
775
+ default: true,
776
+ displayOptions: {
777
+ show: {
778
+ operation: ['update'],
779
+ updateModeItem: ['itemDeprecate'],
780
+ },
781
+ },
782
+ },
783
+ {
784
+ displayName: 'Deprecated',
785
+ name: 'deprecatedRevision',
786
+ type: 'boolean',
787
+ default: true,
788
+ displayOptions: {
789
+ show: {
790
+ operation: ['update'],
791
+ updateModeRevision: ['revisionDeprecate'],
792
+ },
793
+ },
794
+ },
795
+ {
796
+ displayName: 'Deprecated',
797
+ name: 'deprecatedArtifact',
798
+ type: 'boolean',
799
+ default: true,
800
+ displayOptions: {
801
+ show: {
802
+ operation: ['update'],
803
+ updateModeArtifact: ['artifactDeprecate'],
804
+ },
805
+ },
806
+ },
807
+ {
808
+ displayName: 'Revision Number',
809
+ name: 'revisionNumberCreate',
810
+ type: 'string',
811
+ default: '',
812
+ description: 'Optional. Non-negative integer.',
813
+ displayOptions: {
814
+ show: {
815
+ resource: ['revision'],
816
+ operation: ['create'],
817
+ createModeRevision: ['revisionCreate'],
818
+ },
819
+ },
820
+ },
821
+ {
822
+ displayName: 'Revision Number',
823
+ name: 'revisionNumberRead',
824
+ type: 'string',
825
+ default: '',
826
+ description: 'Optional. Non-negative integer.',
827
+ displayOptions: {
828
+ show: {
829
+ resource: ['revision'],
830
+ operation: ['read'],
831
+ readModeRevision: ['revisionListArtifacts', 'revisionListTags', 'revisionWasTagged'],
832
+ },
833
+ },
834
+ },
835
+ {
836
+ displayName: 'Revision Number',
837
+ name: 'revisionNumberUpdateDelete',
838
+ type: 'string',
839
+ default: '',
840
+ description: 'Optional. Non-negative integer.',
841
+ displayOptions: {
842
+ show: {
843
+ resource: ['revision'],
844
+ operation: ['update'],
845
+ updateModeRevision: ['__legacy'],
846
+ },
847
+ },
848
+ },
849
+ {
850
+ displayName: 'Tag',
851
+ name: 'tagRead',
852
+ type: 'string',
853
+ default: 'latest',
854
+ displayOptions: {
855
+ show: {
856
+ resource: ['revision'],
857
+ operation: ['read'],
858
+ readModeRevision: ['revisionGetByTag', 'revisionHasTag', 'revisionWasTagged'],
859
+ },
860
+ },
861
+ },
862
+ {
863
+ displayName: 'Revision Kref',
864
+ name: 'revisionKrefUpdateMetadata',
865
+ type: 'string',
866
+ default: '',
867
+ description: 'Example: kref://project/space/item.kind?r=1',
868
+ displayOptions: {
869
+ show: {
870
+ resource: ['revision'],
871
+ operation: ['update'],
872
+ updateModeRevision: ['revisionUpdateMetadata'],
873
+ },
874
+ },
875
+ },
876
+ {
877
+ displayName: 'Metadata',
878
+ name: 'revisionMetadataUpdate',
879
+ type: 'json',
880
+ default: '{}',
881
+ displayOptions: {
882
+ show: {
883
+ resource: ['revision'],
884
+ operation: ['update'],
885
+ updateModeRevision: ['revisionUpdateMetadata'],
886
+ },
887
+ },
888
+ },
889
+ {
890
+ displayName: 'Revision Kref',
891
+ name: 'revisionKrefTagUpdate',
892
+ type: 'string',
893
+ default: '',
894
+ description: 'Example: kref://project/space/item.kind?r=1',
895
+ displayOptions: {
896
+ show: {
897
+ resource: ['revision'],
898
+ operation: ['update'],
899
+ updateModeRevision: ['revisionSetTag', 'revisionRemoveTag'],
900
+ },
901
+ },
902
+ },
903
+ {
904
+ displayName: 'Revision Tag',
905
+ name: 'tagUpdate',
906
+ type: 'string',
907
+ default: 'latest',
908
+ displayOptions: {
909
+ show: {
910
+ resource: ['revision'],
911
+ operation: ['update'],
912
+ updateModeRevision: ['revisionSetTag', 'revisionRemoveTag'],
913
+ },
914
+ },
915
+ },
916
+ {
917
+ displayName: 'Revision Kref',
918
+ name: 'revisionKrefDeprecate',
919
+ type: 'string',
920
+ default: '',
921
+ description: 'Example: kref://project/space/item.kind?r=1',
922
+ displayOptions: {
923
+ show: {
924
+ resource: ['revision'],
925
+ operation: ['update'],
926
+ updateModeRevision: ['revisionDeprecate'],
927
+ },
928
+ },
929
+ },
930
+ {
931
+ displayName: 'Revision Kref',
932
+ name: 'revisionKrefDelete',
933
+ type: 'string',
934
+ default: '',
935
+ description: 'Example: kref://project/space/item.kind?r=1',
936
+ displayOptions: {
937
+ show: {
938
+ resource: ['revision'],
939
+ operation: ['delete'],
940
+ },
941
+ },
942
+ },
943
+ {
944
+ displayName: 'Revision Kref',
945
+ name: 'revisionKrefRevision',
946
+ type: 'string',
947
+ default: '',
948
+ displayOptions: {
949
+ show: {
950
+ resource: ['revision'],
951
+ operation: ['read'],
952
+ readModeRevision: ['revisionListArtifacts'],
953
+ },
954
+ },
955
+ },
956
+ {
957
+ displayName: 'Revision Kref',
958
+ name: 'revisionKrefArtifact',
959
+ type: 'string',
960
+ default: '',
961
+ displayOptions: {
962
+ show: {
963
+ resource: ['artifact'],
964
+ operation: ['read'],
965
+ readModeArtifact: ['artifactGet'],
966
+ },
967
+ },
968
+ },
969
+ {
970
+ displayName: 'Revision Kref',
971
+ name: 'revisionKrefGraph',
972
+ type: 'string',
973
+ default: '',
974
+ displayOptions: {
975
+ show: {
976
+ resource: ['revision'],
977
+ operation: ['read'],
978
+ readModeRevision: ['graphListEdges', 'graphGetDependencies', 'graphAnalyzeImpact'],
979
+ },
980
+ },
981
+ },
982
+ {
983
+ displayName: 'Artifact Name',
984
+ name: 'artifactName',
985
+ type: 'string',
986
+ default: '',
987
+ displayOptions: {
988
+ show: {
989
+ resource: ['artifact', 'kref'],
990
+ operation: ['read'],
991
+ readModeArtifact: ['artifactGet'],
992
+ },
993
+ },
994
+ },
995
+ {
996
+ displayName: 'Location',
997
+ name: 'locationQuery',
998
+ type: 'string',
999
+ default: '',
1000
+ displayOptions: {
1001
+ show: {
1002
+ resource: ['artifact'],
1003
+ operation: ['read'],
1004
+ readModeArtifact: ['artifactGetByLocation'],
1005
+ },
1006
+ },
1007
+ },
1008
+ {
1009
+ displayName: 'Bundle Kref',
1010
+ name: 'bundleKref',
1011
+ type: 'string',
1012
+ default: '',
1013
+ displayOptions: {
1014
+ show: {
1015
+ resource: ['bundle'],
1016
+ operation: ['update'],
1017
+ },
1018
+ },
1019
+ },
1020
+ {
1021
+ displayName: 'Bundle Kref',
1022
+ name: 'bundleKref',
1023
+ type: 'string',
1024
+ default: '',
1025
+ displayOptions: {
1026
+ show: {
1027
+ resource: ['bundle'],
1028
+ operation: ['read'],
1029
+ readModeBundle: ['bundleListMembers', 'bundleHistory'],
1030
+ },
1031
+ },
1032
+ },
1033
+ {
1034
+ displayName: 'Bundle Kref',
1035
+ name: 'bundleKrefDelete',
1036
+ type: 'string',
1037
+ default: '',
1038
+ description: 'Example: kref://project/space/bundle.bundle',
1039
+ displayOptions: {
1040
+ show: {
1041
+ resource: ['bundle'],
1042
+ operation: ['delete'],
1043
+ },
1044
+ },
1045
+ },
1046
+ {
1047
+ displayName: 'Bundle Name',
1048
+ name: 'bundleName',
1049
+ type: 'string',
1050
+ default: '',
1051
+ displayOptions: {
1052
+ show: {
1053
+ resource: ['bundle'],
1054
+ operation: ['create'],
1055
+ },
1056
+ },
1057
+ },
1058
+ {
1059
+ displayName: 'Bundle Name',
1060
+ name: 'bundleName',
1061
+ type: 'string',
1062
+ default: '',
1063
+ displayOptions: {
1064
+ show: {
1065
+ resource: ['bundle'],
1066
+ operation: ['read'],
1067
+ readModeBundle: ['bundleGet'],
1068
+ },
1069
+ },
1070
+ },
1071
+ {
1072
+ displayName: 'Space Path',
1073
+ name: 'bundleSpacePath',
1074
+ type: 'string',
1075
+ default: '',
1076
+ displayOptions: {
1077
+ show: {
1078
+ resource: ['bundle'],
1079
+ operation: ['create'],
1080
+ },
1081
+ },
1082
+ },
1083
+ {
1084
+ displayName: 'Space Path',
1085
+ name: 'bundleSpacePath',
1086
+ type: 'string',
1087
+ default: '',
1088
+ displayOptions: {
1089
+ show: {
1090
+ resource: ['bundle'],
1091
+ operation: ['read'],
1092
+ readModeBundle: ['bundleGet'],
1093
+ },
1094
+ },
1095
+ },
1096
+ {
1097
+ displayName: 'Advanced: Bundle Kref Override',
1098
+ name: 'bundleKrefOverrideEnabled',
1099
+ type: 'boolean',
1100
+ default: false,
1101
+ displayOptions: {
1102
+ show: {
1103
+ resource: ['bundle'],
1104
+ operation: ['read'],
1105
+ readModeBundle: ['bundleGet'],
1106
+ },
1107
+ },
1108
+ },
1109
+ {
1110
+ displayName: 'Bundle Kref (Override)',
1111
+ name: 'bundleKrefOverride',
1112
+ type: 'string',
1113
+ default: '',
1114
+ description: 'Optional. When set, this Kref is used instead of computing it from Space Path + Bundle Name.',
1115
+ displayOptions: {
1116
+ show: {
1117
+ resource: ['bundle'],
1118
+ operation: ['read'],
1119
+ readModeBundle: ['bundleGet'],
1120
+ bundleKrefOverrideEnabled: [true],
1121
+ },
1122
+ },
1123
+ },
1124
+ {
1125
+ displayName: 'Item Kref',
1126
+ name: 'bundleItemKref',
1127
+ type: 'string',
1128
+ default: '',
1129
+ displayOptions: {
1130
+ show: {
1131
+ resource: ['bundle'],
1132
+ operation: ['update'],
1133
+ updateModeBundle: ['bundleAddMember', 'bundleRemoveMember'],
1134
+ },
1135
+ },
1136
+ },
1137
+ {
1138
+ displayName: 'Member Revision Number',
1139
+ name: 'bundleRevisionNumber',
1140
+ type: 'string',
1141
+ default: '',
1142
+ description: 'Optional. Non-negative integer.',
1143
+ displayOptions: {
1144
+ show: {
1145
+ resource: ['bundle'],
1146
+ operation: ['read'],
1147
+ readModeBundle: ['bundleListMembers'],
1148
+ },
1149
+ },
1150
+ },
1151
+ {
1152
+ displayName: 'Source Kref',
1153
+ name: 'sourceKref',
1154
+ type: 'string',
1155
+ default: '',
1156
+ displayOptions: {
1157
+ show: {
1158
+ resource: ['revision'],
1159
+ operation: ['create', 'read'],
1160
+ createModeRevision: ['graphCreateEdge'],
1161
+ },
1162
+ },
1163
+ },
1164
+ {
1165
+ displayName: 'Target Kref',
1166
+ name: 'targetKref',
1167
+ type: 'string',
1168
+ default: '',
1169
+ displayOptions: {
1170
+ show: {
1171
+ resource: ['revision'],
1172
+ operation: ['create', 'read'],
1173
+ createModeRevision: ['graphCreateEdge'],
1174
+ },
1175
+ },
1176
+ },
1177
+ {
1178
+ displayName: 'Edge Type',
1179
+ name: 'edgeType',
1180
+ type: 'options',
1181
+ options: [
1182
+ { name: 'Belongs To', value: 'BELONGS_TO' },
1183
+ { name: 'Contains', value: 'CONTAINS' },
1184
+ { name: 'Created From', value: 'CREATED_FROM' },
1185
+ { name: 'Depends On', value: 'DEPENDS_ON' },
1186
+ { name: 'Derived From', value: 'DERIVED_FROM' },
1187
+ { name: 'Referenced', value: 'REFERENCED' },
1188
+ ],
1189
+ default: 'DEPENDS_ON',
1190
+ displayOptions: {
1191
+ show: {
1192
+ resource: ['revision'],
1193
+ operation: ['create'],
1194
+ createModeRevision: ['graphCreateEdge'],
1195
+ },
1196
+ },
1197
+ },
1198
+ {
1199
+ displayName: 'Edge Type Filter',
1200
+ name: 'edgeTypeFilter',
1201
+ type: 'string',
1202
+ default: '',
1203
+ description: 'Optional. Single edge type.',
1204
+ displayOptions: {
1205
+ show: {
1206
+ resource: ['revision'],
1207
+ operation: ['read'],
1208
+ readModeRevision: ['graphListEdges'],
1209
+ },
1210
+ },
1211
+ },
1212
+ {
1213
+ displayName: 'Direction',
1214
+ name: 'direction',
1215
+ type: 'options',
1216
+ options: [
1217
+ { name: 'Outgoing', value: 0 },
1218
+ { name: 'Incoming', value: 1 },
1219
+ { name: 'Both', value: 2 },
1220
+ ],
1221
+ default: 0,
1222
+ displayOptions: {
1223
+ show: {
1224
+ resource: ['revision'],
1225
+ operation: ['read'],
1226
+ readModeRevision: ['graphListEdges'],
1227
+ },
1228
+ },
1229
+ },
1230
+ {
1231
+ displayName: 'Max Depth',
1232
+ name: 'maxDepth',
1233
+ type: 'number',
1234
+ default: 5,
1235
+ displayOptions: {
1236
+ show: {
1237
+ resource: ['revision'],
1238
+ operation: ['read'],
1239
+ readModeRevision: ['graphGetDependencies', 'graphFindPath', 'graphAnalyzeImpact'],
1240
+ },
1241
+ },
1242
+ },
1243
+ {
1244
+ displayName: 'Edge Types',
1245
+ name: 'edgeTypes',
1246
+ type: 'string',
1247
+ default: '',
1248
+ description: 'Optional. Comma-separated list (e.g., DEPENDS_ON,DERIVED_FROM).',
1249
+ displayOptions: {
1250
+ show: {
1251
+ resource: ['revision'],
1252
+ operation: ['read'],
1253
+ readModeRevision: ['graphGetDependencies', 'graphFindPath', 'graphAnalyzeImpact'],
1254
+ },
1255
+ },
1256
+ },
1257
+ {
1258
+ displayName: 'Revision Kref',
1259
+ name: 'artifactRevisionKref',
1260
+ type: 'string',
1261
+ default: '',
1262
+ displayOptions: {
1263
+ show: {
1264
+ resource: ['artifact'],
1265
+ operation: ['create'],
1266
+ },
1267
+ },
1268
+ },
1269
+ {
1270
+ displayName: 'Name',
1271
+ name: 'name',
1272
+ type: 'string',
1273
+ default: '',
1274
+ displayOptions: {
1275
+ show: {
1276
+ resource: ['artifact'],
1277
+ operation: ['create'],
1278
+ },
1279
+ },
1280
+ },
1281
+ {
1282
+ displayName: 'Location',
1283
+ name: 'locationCreate',
1284
+ type: 'string',
1285
+ default: '',
1286
+ displayOptions: {
1287
+ show: {
1288
+ resource: ['artifact'],
1289
+ operation: ['create'],
1290
+ },
1291
+ },
1292
+ },
1293
+ {
1294
+ displayName: 'Metadata',
1295
+ name: 'artifactMetadataCreate',
1296
+ type: 'json',
1297
+ default: '{}',
1298
+ displayOptions: {
1299
+ show: {
1300
+ resource: ['artifact'],
1301
+ operation: ['create'],
1302
+ },
1303
+ },
1304
+ },
1305
+ {
1306
+ displayName: 'Metadata',
1307
+ name: 'metadata',
1308
+ type: 'json',
1309
+ default: '{}',
1310
+ displayOptions: {
1311
+ show: {
1312
+ operation: ['create', 'update'],
1313
+ resource: ['revision', 'bundle', 'graph'],
1314
+ },
1315
+ hide: {
1316
+ resource: ['revision'],
1317
+ operation: ['update'],
1318
+ updateModeRevision: ['revisionUpdateMetadata', 'revisionSetTag', 'revisionRemoveTag', 'revisionDeprecate'],
1319
+ },
1320
+ },
1321
+ },
1322
+ {
1323
+ displayName: 'Artifact Kref',
1324
+ name: 'artifactKref',
1325
+ type: 'string',
1326
+ default: '',
1327
+ displayOptions: {
1328
+ show: {
1329
+ resource: ['artifact'],
1330
+ operation: ['update', 'delete'],
1331
+ },
1332
+ },
1333
+ },
1334
+ {
1335
+ displayName: 'Metadata',
1336
+ name: 'artifactMetadataUpdate',
1337
+ type: 'json',
1338
+ default: '{}',
1339
+ displayOptions: {
1340
+ show: {
1341
+ resource: ['artifact'],
1342
+ operation: ['update'],
1343
+ updateModeArtifact: ['artifactUpdateMetadata'],
1344
+ },
1345
+ },
1346
+ },
1347
+ {
1348
+ displayName: 'Resolve Revision Number',
1349
+ name: 'krefResolveRevisionNumber',
1350
+ type: 'string',
1351
+ default: '',
1352
+ description: 'Optional. Non-negative integer (maps to r).',
1353
+ displayOptions: {
1354
+ show: {
1355
+ resource: ['kref'],
1356
+ operation: ['read'],
1357
+ readModeKref: ['krefResolveAdvanced'],
1358
+ },
1359
+ },
1360
+ },
1361
+ {
1362
+ displayName: 'Resolve Tag',
1363
+ name: 'krefResolveTag',
1364
+ type: 'string',
1365
+ default: '',
1366
+ description: 'Optional (maps to t)',
1367
+ displayOptions: {
1368
+ show: {
1369
+ resource: ['kref'],
1370
+ operation: ['read'],
1371
+ readModeKref: ['krefResolveAdvanced'],
1372
+ },
1373
+ },
1374
+ },
1375
+ {
1376
+ displayName: 'Resolve Artifact Name',
1377
+ name: 'krefResolveArtifactName',
1378
+ type: 'string',
1379
+ default: '',
1380
+ description: 'Optional (maps to a)',
1381
+ displayOptions: {
1382
+ show: {
1383
+ resource: ['kref'],
1384
+ operation: ['read'],
1385
+ readModeKref: ['krefResolveAdvanced'],
1386
+ },
1387
+ },
1388
+ },
1389
+ {
1390
+ displayName: 'Output Format',
1391
+ name: 'outputFormatProject',
1392
+ type: 'options',
1393
+ options: [
1394
+ { name: 'Split Into Items', value: 'split' },
1395
+ { name: 'Single Item (Array)', value: 'singleArray' },
1396
+ ],
1397
+ default: 'split',
1398
+ displayOptions: {
1399
+ show: {
1400
+ resource: ['project'],
1401
+ operation: ['read'],
1402
+ readModeProject: ['projectList'],
1403
+ },
1404
+ },
1405
+ },
1406
+ {
1407
+ displayName: 'Return All',
1408
+ name: 'returnAllProject',
1409
+ type: 'boolean',
1410
+ default: true,
1411
+ description: 'Whether to return all results or limit the result size',
1412
+ displayOptions: {
1413
+ show: {
1414
+ resource: ['project'],
1415
+ operation: ['read'],
1416
+ readModeProject: ['projectList'],
1417
+ },
1418
+ },
1419
+ },
1420
+ {
1421
+ displayName: 'Limit',
1422
+ name: 'limitProject',
1423
+ type: 'number',
1424
+ default: 100,
1425
+ typeOptions: { minValue: 1 },
1426
+ displayOptions: {
1427
+ show: {
1428
+ resource: ['project'],
1429
+ operation: ['read'],
1430
+ readModeProject: ['projectList'],
1431
+ returnAllProject: [false],
1432
+ },
1433
+ },
1434
+ },
1435
+ {
1436
+ displayName: 'Output Format',
1437
+ name: 'outputFormatSpace',
1438
+ type: 'options',
1439
+ options: [
1440
+ { name: 'Split Into Items', value: 'split' },
1441
+ { name: 'Single Item (Array)', value: 'singleArray' },
1442
+ ],
1443
+ default: 'split',
1444
+ displayOptions: {
1445
+ show: {
1446
+ resource: ['space'],
1447
+ operation: ['read'],
1448
+ readModeSpace: ['spaceList'],
1449
+ },
1450
+ },
1451
+ },
1452
+ {
1453
+ displayName: 'Return All',
1454
+ name: 'returnAllSpace',
1455
+ type: 'boolean',
1456
+ default: true,
1457
+ displayOptions: {
1458
+ show: {
1459
+ resource: ['space'],
1460
+ operation: ['read'],
1461
+ readModeSpace: ['spaceList'],
1462
+ },
1463
+ },
1464
+ },
1465
+ {
1466
+ displayName: 'Limit',
1467
+ name: 'limitSpace',
1468
+ type: 'number',
1469
+ default: 100,
1470
+ typeOptions: { minValue: 1 },
1471
+ displayOptions: {
1472
+ show: {
1473
+ resource: ['space'],
1474
+ operation: ['read'],
1475
+ readModeSpace: ['spaceList'],
1476
+ returnAllSpace: [false],
1477
+ },
1478
+ },
1479
+ },
1480
+ {
1481
+ displayName: 'Output Format',
1482
+ name: 'outputFormatItem',
1483
+ type: 'options',
1484
+ options: [
1485
+ { name: 'Split Into Items', value: 'split' },
1486
+ { name: 'Single Item (Array)', value: 'singleArray' },
1487
+ ],
1488
+ default: 'split',
1489
+ displayOptions: {
1490
+ show: {
1491
+ resource: ['item'],
1492
+ operation: ['read'],
1493
+ readModeItem: ['itemSearch'],
1494
+ },
1495
+ },
1496
+ },
1497
+ {
1498
+ displayName: 'Return All',
1499
+ name: 'returnAllItem',
1500
+ type: 'boolean',
1501
+ default: true,
1502
+ displayOptions: {
1503
+ show: {
1504
+ resource: ['item'],
1505
+ operation: ['read'],
1506
+ readModeItem: ['itemSearch'],
1507
+ },
1508
+ },
1509
+ },
1510
+ {
1511
+ displayName: 'Limit',
1512
+ name: 'limitItem',
1513
+ type: 'number',
1514
+ default: 100,
1515
+ typeOptions: { minValue: 1 },
1516
+ displayOptions: {
1517
+ show: {
1518
+ resource: ['item'],
1519
+ operation: ['read'],
1520
+ readModeItem: ['itemSearch'],
1521
+ returnAllItem: [false],
1522
+ },
1523
+ },
1524
+ },
1525
+ {
1526
+ displayName: 'Output Format',
1527
+ name: 'outputFormatRevision',
1528
+ type: 'options',
1529
+ options: [
1530
+ { name: 'Split Into Items', value: 'split' },
1531
+ { name: 'Single Item (Array)', value: 'singleArray' },
1532
+ ],
1533
+ default: 'split',
1534
+ displayOptions: {
1535
+ show: {
1536
+ resource: ['revision'],
1537
+ operation: ['read'],
1538
+ readModeRevision: ['revisionListArtifacts'],
1539
+ },
1540
+ },
1541
+ },
1542
+ {
1543
+ displayName: 'Return All',
1544
+ name: 'returnAllRevision',
1545
+ type: 'boolean',
1546
+ default: true,
1547
+ displayOptions: {
1548
+ show: {
1549
+ resource: ['revision'],
1550
+ operation: ['read'],
1551
+ readModeRevision: ['revisionListArtifacts'],
1552
+ },
1553
+ },
1554
+ },
1555
+ {
1556
+ displayName: 'Limit',
1557
+ name: 'limitRevision',
1558
+ type: 'number',
1559
+ default: 100,
1560
+ typeOptions: { minValue: 1 },
1561
+ displayOptions: {
1562
+ show: {
1563
+ resource: ['revision'],
1564
+ operation: ['read'],
1565
+ readModeRevision: ['revisionListArtifacts'],
1566
+ returnAllRevision: [false],
1567
+ },
1568
+ },
1569
+ },
1570
+ {
1571
+ displayName: 'Output Format',
1572
+ name: 'outputFormatArtifact',
1573
+ type: 'options',
1574
+ options: [
1575
+ { name: 'Split Into Items', value: 'split' },
1576
+ { name: 'Single Item (Array)', value: 'singleArray' },
1577
+ ],
1578
+ default: 'split',
1579
+ displayOptions: {
1580
+ show: {
1581
+ resource: ['artifact'],
1582
+ operation: ['read'],
1583
+ readModeArtifact: ['artifactGetByLocation'],
1584
+ },
1585
+ },
1586
+ },
1587
+ {
1588
+ displayName: 'Return All',
1589
+ name: 'returnAllArtifact',
1590
+ type: 'boolean',
1591
+ default: true,
1592
+ displayOptions: {
1593
+ show: {
1594
+ resource: ['artifact'],
1595
+ operation: ['read'],
1596
+ readModeArtifact: ['artifactGetByLocation'],
1597
+ },
1598
+ },
1599
+ },
1600
+ {
1601
+ displayName: 'Limit',
1602
+ name: 'limitArtifact',
1603
+ type: 'number',
1604
+ default: 100,
1605
+ typeOptions: { minValue: 1 },
1606
+ displayOptions: {
1607
+ show: {
1608
+ resource: ['artifact'],
1609
+ operation: ['read'],
1610
+ readModeArtifact: ['artifactGetByLocation'],
1611
+ returnAllArtifact: [false],
1612
+ },
1613
+ },
1614
+ },
1615
+ {
1616
+ displayName: 'Output Format',
1617
+ name: 'outputFormatBundle',
1618
+ type: 'options',
1619
+ options: [
1620
+ { name: 'Split Into Items', value: 'split' },
1621
+ { name: 'Single Item (Array)', value: 'singleArray' },
1622
+ ],
1623
+ default: 'split',
1624
+ displayOptions: {
1625
+ show: {
1626
+ resource: ['bundle'],
1627
+ operation: ['read'],
1628
+ readModeBundle: ['bundleListMembers', 'bundleHistory'],
1629
+ },
1630
+ },
1631
+ },
1632
+ {
1633
+ displayName: 'Return All',
1634
+ name: 'returnAllBundle',
1635
+ type: 'boolean',
1636
+ default: true,
1637
+ displayOptions: {
1638
+ show: {
1639
+ resource: ['bundle'],
1640
+ operation: ['read'],
1641
+ readModeBundle: ['bundleListMembers', 'bundleHistory'],
1642
+ },
1643
+ },
1644
+ },
1645
+ {
1646
+ displayName: 'Limit',
1647
+ name: 'limitBundle',
1648
+ type: 'number',
1649
+ default: 100,
1650
+ typeOptions: { minValue: 1 },
1651
+ displayOptions: {
1652
+ show: {
1653
+ resource: ['bundle'],
1654
+ operation: ['read'],
1655
+ readModeBundle: ['bundleListMembers', 'bundleHistory'],
1656
+ returnAllBundle: [false],
1657
+ },
1658
+ },
1659
+ },
1660
+ {
1661
+ displayName: 'Output Format',
1662
+ name: 'outputFormatGraph',
1663
+ type: 'options',
1664
+ options: [
1665
+ { name: 'Split Into Items', value: 'split' },
1666
+ { name: 'Single Item (Array)', value: 'singleArray' },
1667
+ ],
1668
+ default: 'split',
1669
+ displayOptions: {
1670
+ show: {
1671
+ resource: ['revision'],
1672
+ operation: ['read'],
1673
+ readModeRevision: ['graphListEdges'],
1674
+ },
1675
+ },
1676
+ },
1677
+ {
1678
+ displayName: 'Return All',
1679
+ name: 'returnAllGraph',
1680
+ type: 'boolean',
1681
+ default: true,
1682
+ displayOptions: {
1683
+ show: {
1684
+ resource: ['revision'],
1685
+ operation: ['read'],
1686
+ readModeRevision: ['graphListEdges'],
1687
+ },
1688
+ },
1689
+ },
1690
+ {
1691
+ displayName: 'Limit',
1692
+ name: 'limitGraph',
1693
+ type: 'number',
1694
+ default: 100,
1695
+ typeOptions: { minValue: 1 },
1696
+ displayOptions: {
1697
+ show: {
1698
+ resource: ['revision'],
1699
+ operation: ['read'],
1700
+ readModeRevision: ['graphListEdges'],
1701
+ returnAllGraph: [false],
1702
+ },
1703
+ },
1704
+ },
1705
+ ],
1706
+ };
1707
+ }
1708
+ async execute() {
1709
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30;
1710
+ const items = this.getInputData();
1711
+ const out = [];
1712
+ for (let index = 0; index < items.length; index += 1) {
1713
+ const resource = this.getNodeParameter('resource', index);
1714
+ const operation = this.getNodeParameter('operation', index);
1715
+ let outputFormat = 'split';
1716
+ let returnAll = true;
1717
+ let limit = 100;
1718
+ if (operation === 'read') {
1719
+ if (resource === 'project') {
1720
+ const readMode = this.getNodeParameter('readModeProject', index);
1721
+ if (readMode === 'projectList') {
1722
+ outputFormat = this.getNodeParameter('outputFormatProject', index, 'split');
1723
+ returnAll = this.getNodeParameter('returnAllProject', index, true);
1724
+ limit = this.getNodeParameter('limitProject', index, 100);
1725
+ }
1726
+ }
1727
+ if (resource === 'space') {
1728
+ const readMode = this.getNodeParameter('readModeSpace', index);
1729
+ if (readMode === 'spaceList') {
1730
+ outputFormat = this.getNodeParameter('outputFormatSpace', index, 'split');
1731
+ returnAll = this.getNodeParameter('returnAllSpace', index, true);
1732
+ limit = this.getNodeParameter('limitSpace', index, 100);
1733
+ }
1734
+ }
1735
+ if (resource === 'item') {
1736
+ const readMode = this.getNodeParameter('readModeItem', index);
1737
+ if (readMode === 'itemSearch') {
1738
+ outputFormat = this.getNodeParameter('outputFormatItem', index, 'split');
1739
+ returnAll = this.getNodeParameter('returnAllItem', index, true);
1740
+ limit = this.getNodeParameter('limitItem', index, 100);
1741
+ }
1742
+ }
1743
+ if (resource === 'revision') {
1744
+ const readMode = this.getNodeParameter('readModeRevision', index);
1745
+ if (readMode === 'revisionListArtifacts') {
1746
+ outputFormat = this.getNodeParameter('outputFormatRevision', index, 'split');
1747
+ returnAll = this.getNodeParameter('returnAllRevision', index, true);
1748
+ limit = this.getNodeParameter('limitRevision', index, 100);
1749
+ }
1750
+ if (readMode === 'graphListEdges') {
1751
+ outputFormat = this.getNodeParameter('outputFormatGraph', index, 'split');
1752
+ returnAll = this.getNodeParameter('returnAllGraph', index, true);
1753
+ limit = this.getNodeParameter('limitGraph', index, 100);
1754
+ }
1755
+ }
1756
+ if (resource === 'artifact') {
1757
+ const readMode = this.getNodeParameter('readModeArtifact', index);
1758
+ if (readMode === 'artifactGetByLocation') {
1759
+ outputFormat = this.getNodeParameter('outputFormatArtifact', index, 'split');
1760
+ returnAll = this.getNodeParameter('returnAllArtifact', index, true);
1761
+ limit = this.getNodeParameter('limitArtifact', index, 100);
1762
+ }
1763
+ }
1764
+ if (resource === 'bundle') {
1765
+ const readMode = this.getNodeParameter('readModeBundle', index);
1766
+ if (readMode === 'bundleListMembers' || readMode === 'bundleHistory') {
1767
+ outputFormat = this.getNodeParameter('outputFormatBundle', index, 'split');
1768
+ returnAll = this.getNodeParameter('returnAllBundle', index, true);
1769
+ limit = this.getNodeParameter('limitBundle', index, 100);
1770
+ }
1771
+ }
1772
+ if (resource === 'graph') {
1773
+ const readMode = this.getNodeParameter('readModeGraph', index);
1774
+ if (readMode === 'graphListEdges') {
1775
+ outputFormat = this.getNodeParameter('outputFormatGraph', index, 'split');
1776
+ returnAll = this.getNodeParameter('returnAllGraph', index, true);
1777
+ limit = this.getNodeParameter('limitGraph', index, 100);
1778
+ }
1779
+ }
1780
+ }
1781
+ if (resource === 'project') {
1782
+ if (operation === 'create') {
1783
+ const name = normalizeProjectName(this, this.getNodeParameter('projectName', index));
1784
+ const description = String((_a = this.getNodeParameter('projectDescription', index, '')) !== null && _a !== void 0 ? _a : '').trim();
1785
+ const body = { name };
1786
+ if (description)
1787
+ body.description = description;
1788
+ try {
1789
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1790
+ method: 'POST',
1791
+ path: '/api/v1/projects',
1792
+ body,
1793
+ });
1794
+ out.push({ json: stripProjectMetadata(data) });
1795
+ continue;
1796
+ }
1797
+ catch (error) {
1798
+ const err = error;
1799
+ const httpCode = Number((_b = err === null || err === void 0 ? void 0 : err.httpCode) !== null && _b !== void 0 ? _b : (_c = err === null || err === void 0 ? void 0 : err.kumiho) === null || _c === void 0 ? void 0 : _c.status_code);
1800
+ if ([500, 502, 503, 504].includes(httpCode)) {
1801
+ try {
1802
+ const existing = await (0, kumihoApi_1.kumihoRequest)(this, {
1803
+ method: 'GET',
1804
+ path: `/api/v1/projects/${encodeURIComponent(name)}`,
1805
+ maxAttempts: 1,
1806
+ timeoutMs: 15000,
1807
+ retryBudgetMs: 15000,
1808
+ });
1809
+ out.push({ json: stripProjectMetadata(existing) });
1810
+ continue;
1811
+ }
1812
+ catch {
1813
+ }
1814
+ }
1815
+ throw error;
1816
+ }
1817
+ }
1818
+ if (operation === 'read') {
1819
+ const readMode = this.getNodeParameter('readModeProject', index);
1820
+ if (readMode === 'projectGet') {
1821
+ const name = normalizeProjectName(this, this.getNodeParameter('projectName', index));
1822
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1823
+ method: 'GET',
1824
+ path: `/api/v1/projects/${encodeURIComponent(name)}`,
1825
+ });
1826
+ out.push({ json: stripProjectMetadata(data) });
1827
+ continue;
1828
+ }
1829
+ if (readMode === 'projectList') {
1830
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, { method: 'GET', path: '/api/v1/projects' });
1831
+ emitArray(out, stripProjectMetadata(data), outputFormat, returnAll, limit);
1832
+ continue;
1833
+ }
1834
+ }
1835
+ if (operation === 'delete') {
1836
+ const name = normalizeProjectName(this, this.getNodeParameter('projectName', index));
1837
+ const force = this.getNodeParameter('force', index, false);
1838
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1839
+ method: 'DELETE',
1840
+ path: `/api/v1/projects/${encodeURIComponent(name)}`,
1841
+ qs: { force },
1842
+ });
1843
+ out.push({ json: data });
1844
+ continue;
1845
+ }
1846
+ }
1847
+ if (resource === 'space') {
1848
+ if (operation === 'create') {
1849
+ const parentPath = normalizeKumihoPath(this, this.getNodeParameter('parentPath', index), 'Parent Path');
1850
+ const name = String((_d = this.getNodeParameter('spaceName', index)) !== null && _d !== void 0 ? _d : '').trim();
1851
+ if (!parentPath) {
1852
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Parent Path is required');
1853
+ }
1854
+ if (!name) {
1855
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Space Name is required');
1856
+ }
1857
+ try {
1858
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1859
+ method: 'POST',
1860
+ path: '/api/v1/spaces',
1861
+ body: { parent_path: parentPath, name },
1862
+ });
1863
+ out.push({ json: data });
1864
+ continue;
1865
+ }
1866
+ catch (error) {
1867
+ const err = error;
1868
+ const httpCode = Number((_e = err === null || err === void 0 ? void 0 : err.httpCode) !== null && _e !== void 0 ? _e : (_f = err === null || err === void 0 ? void 0 : err.kumiho) === null || _f === void 0 ? void 0 : _f.status_code);
1869
+ if ([500, 502, 503, 504].includes(httpCode)) {
1870
+ try {
1871
+ const fullPath = `${parentPath}/${name}`;
1872
+ const existing = await (0, kumihoApi_1.kumihoRequest)(this, {
1873
+ method: 'GET',
1874
+ path: '/api/v1/spaces/by-path',
1875
+ qs: { path: fullPath },
1876
+ maxAttempts: 1,
1877
+ timeoutMs: 15000,
1878
+ retryBudgetMs: 15000,
1879
+ });
1880
+ out.push({ json: existing });
1881
+ continue;
1882
+ }
1883
+ catch {
1884
+ }
1885
+ }
1886
+ throw error;
1887
+ }
1888
+ }
1889
+ if (operation === 'read') {
1890
+ const readMode = this.getNodeParameter('readModeSpace', index);
1891
+ if (readMode === 'spaceGet') {
1892
+ const path = normalizeKumihoPath(this, this.getNodeParameter('spacePath', index), 'Space Path');
1893
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1894
+ method: 'GET',
1895
+ path: '/api/v1/spaces/by-path',
1896
+ qs: { path },
1897
+ });
1898
+ out.push({ json: data });
1899
+ continue;
1900
+ }
1901
+ if (readMode === 'spaceList') {
1902
+ const parentPath = normalizeKumihoPath(this, this.getNodeParameter('parentPath', index), 'Parent Path');
1903
+ const recursive = this.getNodeParameter('recursive', index, false);
1904
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1905
+ method: 'GET',
1906
+ path: '/api/v1/spaces',
1907
+ qs: { parent_path: parentPath, recursive },
1908
+ });
1909
+ emitArray(out, data, outputFormat, returnAll, limit);
1910
+ continue;
1911
+ }
1912
+ }
1913
+ if (operation === 'delete') {
1914
+ const path = normalizeKumihoPath(this, this.getNodeParameter('spacePath', index), 'Space Path');
1915
+ const force = this.getNodeParameter('force', index, false);
1916
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1917
+ method: 'DELETE',
1918
+ path: '/api/v1/spaces/by-path',
1919
+ qs: { path, force },
1920
+ });
1921
+ out.push({ json: data });
1922
+ continue;
1923
+ }
1924
+ }
1925
+ if (resource === 'item') {
1926
+ if (operation === 'create') {
1927
+ const spacePath = normalizeKumihoPath(this, this.getNodeParameter('itemSpacePath', index), 'Space Path');
1928
+ const itemName = this.getNodeParameter('itemName', index);
1929
+ const kind = this.getNodeParameter('itemKind', index);
1930
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('itemMetadataCreate', index, this.getNodeParameter('metadata', index, {})));
1931
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1932
+ method: 'POST',
1933
+ path: '/api/v1/items',
1934
+ body: {
1935
+ space_path: spacePath,
1936
+ item_name: itemName,
1937
+ kind,
1938
+ metadata,
1939
+ },
1940
+ });
1941
+ out.push({ json: data });
1942
+ continue;
1943
+ }
1944
+ if (operation === 'read') {
1945
+ const readMode = this.getNodeParameter('readModeItem', index);
1946
+ if (readMode === 'itemGet') {
1947
+ const kref = (String((_g = this.getNodeParameter('itemKrefItem', index, '')) !== null && _g !== void 0 ? _g : '').trim() ||
1948
+ String((_h = this.getNodeParameter('kref', index, '')) !== null && _h !== void 0 ? _h : '').trim());
1949
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1950
+ method: 'GET',
1951
+ path: '/api/v1/items/by-kref',
1952
+ qs: { kref },
1953
+ });
1954
+ out.push({ json: data });
1955
+ continue;
1956
+ }
1957
+ if (readMode === 'itemGetByPath') {
1958
+ const spacePath = normalizeKumihoPath(this, this.getNodeParameter('itemSpacePath', index), 'Space Path');
1959
+ const itemName = this.getNodeParameter('itemName', index);
1960
+ const kind = this.getNodeParameter('itemKind', index);
1961
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1962
+ method: 'GET',
1963
+ path: '/api/v1/items/by-path',
1964
+ qs: { space_path: spacePath, item_name: itemName, kind },
1965
+ });
1966
+ out.push({ json: data });
1967
+ continue;
1968
+ }
1969
+ if (readMode === 'itemSearch') {
1970
+ const contextFilter = normalizeSearchContextFilter(this, this.getNodeParameter('contextFilter', index, ''));
1971
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1972
+ method: 'GET',
1973
+ path: '/api/v1/items/search',
1974
+ qs: {
1975
+ context_filter: contextFilter,
1976
+ name_filter: this.getNodeParameter('nameFilter', index, ''),
1977
+ kind_filter: this.getNodeParameter('kindFilter', index, ''),
1978
+ },
1979
+ });
1980
+ emitArray(out, data, outputFormat, returnAll, limit);
1981
+ continue;
1982
+ }
1983
+ }
1984
+ if (operation === 'update') {
1985
+ const updateMode = this.getNodeParameter('updateModeItem', index);
1986
+ const kref = (String((_j = this.getNodeParameter('itemKrefItem', index, '')) !== null && _j !== void 0 ? _j : '').trim() ||
1987
+ String((_k = this.getNodeParameter('kref', index, '')) !== null && _k !== void 0 ? _k : '').trim());
1988
+ if (updateMode === 'itemUpdateMetadata') {
1989
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('itemMetadataUpdate', index, this.getNodeParameter('metadata', index, {})));
1990
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
1991
+ method: 'PATCH',
1992
+ path: '/api/v1/items/by-kref',
1993
+ qs: { kref },
1994
+ body: { metadata },
1995
+ });
1996
+ out.push({ json: data });
1997
+ continue;
1998
+ }
1999
+ if (updateMode === 'itemSetAttribute') {
2000
+ const key = this.getNodeParameter('attributeKey', index);
2001
+ const value = this.getNodeParameter('attributeValue', index);
2002
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2003
+ method: 'POST',
2004
+ path: '/api/v1/attributes',
2005
+ body: { kref, key, value },
2006
+ });
2007
+ out.push({ json: data });
2008
+ continue;
2009
+ }
2010
+ if (updateMode === 'itemDeprecate') {
2011
+ const deprecated = this.getNodeParameter('deprecated', index, true);
2012
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2013
+ method: 'POST',
2014
+ path: '/api/v1/items/deprecate',
2015
+ qs: { kref, deprecated },
2016
+ });
2017
+ out.push({ json: data });
2018
+ continue;
2019
+ }
2020
+ }
2021
+ if (operation === 'delete') {
2022
+ const kref = (String((_l = this.getNodeParameter('itemKrefItem', index, '')) !== null && _l !== void 0 ? _l : '').trim() ||
2023
+ String((_m = this.getNodeParameter('kref', index, '')) !== null && _m !== void 0 ? _m : '').trim());
2024
+ const force = this.getNodeParameter('force', index, false);
2025
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2026
+ method: 'DELETE',
2027
+ path: '/api/v1/items/by-kref',
2028
+ qs: { kref, force },
2029
+ });
2030
+ out.push({ json: data });
2031
+ continue;
2032
+ }
2033
+ }
2034
+ if (resource === 'revision') {
2035
+ const revisionNumber = parseOptionalInt(this.getNodeParameter('revisionNumberRead', index, '') ||
2036
+ this.getNodeParameter('revisionNumberCreate', index, '') ||
2037
+ this.getNodeParameter('revisionNumberUpdateDelete', index, '') ||
2038
+ this.getNodeParameter('revisionNumber', index, ''));
2039
+ if (operation === 'create') {
2040
+ const createMode = this.getNodeParameter('createModeRevision', index, 'revisionCreate');
2041
+ if (createMode === 'revisionCreate') {
2042
+ const itemKref = (String((_o = this.getNodeParameter('itemKrefRevisionCreate', index, '')) !== null && _o !== void 0 ? _o : '').trim() ||
2043
+ String((_p = this.getNodeParameter('itemKref', index, '')) !== null && _p !== void 0 ? _p : '').trim());
2044
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2045
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2046
+ method: 'POST',
2047
+ path: '/api/v1/revisions',
2048
+ body: {
2049
+ item_kref: itemKref,
2050
+ metadata,
2051
+ number: revisionNumber,
2052
+ },
2053
+ });
2054
+ out.push({ json: data });
2055
+ continue;
2056
+ }
2057
+ if (createMode === 'graphCreateEdge') {
2058
+ const sourceKref = normalizeKrefString(this, this.getNodeParameter('sourceKref', index, ''), 'Source Kref');
2059
+ const targetKref = normalizeKrefString(this, this.getNodeParameter('targetKref', index, ''), 'Target Kref');
2060
+ const edgeType = this.getNodeParameter('edgeType', index);
2061
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2062
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2063
+ method: 'POST',
2064
+ path: '/api/v1/graph/edges',
2065
+ body: { source_kref: sourceKref, target_kref: targetKref, edge_type: edgeType, metadata },
2066
+ });
2067
+ out.push({ json: data });
2068
+ continue;
2069
+ }
2070
+ }
2071
+ if (operation === 'read') {
2072
+ const readMode = this.getNodeParameter('readModeRevision', index);
2073
+ if (readMode === 'revisionGetByKref') {
2074
+ const revisionKref = (String((_q = this.getNodeParameter('revisionKrefReadGetByKref', index, '')) !== null && _q !== void 0 ? _q : '').trim() ||
2075
+ String((_r = this.getNodeParameter('kref', index, '')) !== null && _r !== void 0 ? _r : '').trim());
2076
+ const normalizedRevisionKref = normalizeKrefString(this, revisionKref, 'Revision Kref');
2077
+ const qs = { kref: normalizedRevisionKref };
2078
+ if (revisionNumber !== undefined)
2079
+ qs.r = revisionNumber;
2080
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2081
+ method: 'GET',
2082
+ path: '/api/v1/revisions/by-kref',
2083
+ qs,
2084
+ });
2085
+ out.push({ json: data });
2086
+ continue;
2087
+ }
2088
+ if (readMode === 'revisionGetByTag') {
2089
+ const itemKref = (String((_s = this.getNodeParameter('itemKrefRevisionGetByTag', index, '')) !== null && _s !== void 0 ? _s : '').trim() ||
2090
+ String((_t = this.getNodeParameter('itemKref', index, '')) !== null && _t !== void 0 ? _t : '').trim() ||
2091
+ String((_u = this.getNodeParameter('kref', index, '')) !== null && _u !== void 0 ? _u : '').trim());
2092
+ const tag = (String((_v = this.getNodeParameter('tagRead', index, 'latest')) !== null && _v !== void 0 ? _v : '').trim() ||
2093
+ String((_w = this.getNodeParameter('tag', index, 'latest')) !== null && _w !== void 0 ? _w : '').trim() ||
2094
+ 'latest');
2095
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2096
+ method: 'GET',
2097
+ path: '/api/v1/revisions/by-kref',
2098
+ qs: { kref: itemKref, t: tag },
2099
+ });
2100
+ out.push({ json: data });
2101
+ continue;
2102
+ }
2103
+ if (readMode === 'revisionListArtifacts') {
2104
+ const revisionKref = this.getNodeParameter('revisionKrefRevision', index);
2105
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2106
+ method: 'GET',
2107
+ path: '/api/v1/artifacts',
2108
+ qs: { revision_kref: revisionKref, r: revisionNumber },
2109
+ });
2110
+ emitArray(out, data, outputFormat, returnAll, limit);
2111
+ continue;
2112
+ }
2113
+ if (readMode === 'revisionListTags') {
2114
+ const kref = this.getNodeParameter('kref', index);
2115
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2116
+ method: 'GET',
2117
+ path: '/api/v1/revisions/by-kref',
2118
+ qs: { kref, r: revisionNumber },
2119
+ });
2120
+ out.push({ json: data });
2121
+ continue;
2122
+ }
2123
+ if (readMode === 'revisionHasTag') {
2124
+ const itemKref = (String((_x = this.getNodeParameter('itemKrefRevisionHasTag', index, '')) !== null && _x !== void 0 ? _x : '').trim() ||
2125
+ String((_y = this.getNodeParameter('itemKref', index, '')) !== null && _y !== void 0 ? _y : '').trim() ||
2126
+ String((_z = this.getNodeParameter('kref', index, '')) !== null && _z !== void 0 ? _z : '').trim());
2127
+ const normalizedItemKref = normalizeKrefString(this, itemKref, 'Item Kref');
2128
+ const tag = (String((_0 = this.getNodeParameter('tagRead', index, '')) !== null && _0 !== void 0 ? _0 : '').trim() ||
2129
+ String((_1 = this.getNodeParameter('tag', index, '')) !== null && _1 !== void 0 ? _1 : '').trim());
2130
+ try {
2131
+ await (0, kumihoApi_1.kumihoRequest)(this, {
2132
+ method: 'GET',
2133
+ path: '/api/v1/revisions/by-kref',
2134
+ qs: { kref: normalizedItemKref, t: tag },
2135
+ });
2136
+ out.push({ json: { has_tag: true, tag } });
2137
+ }
2138
+ catch (error) {
2139
+ const err = error;
2140
+ const httpCode = Number((_2 = err === null || err === void 0 ? void 0 : err.httpCode) !== null && _2 !== void 0 ? _2 : (_3 = err === null || err === void 0 ? void 0 : err.kumiho) === null || _3 === void 0 ? void 0 : _3.status_code);
2141
+ if (httpCode === 404) {
2142
+ out.push({ json: { has_tag: false, tag } });
2143
+ }
2144
+ else {
2145
+ throw error;
2146
+ }
2147
+ }
2148
+ continue;
2149
+ }
2150
+ if (readMode === 'revisionWasTagged') {
2151
+ const kref = this.getNodeParameter('kref', index);
2152
+ const tag = (String((_4 = this.getNodeParameter('tagRead', index, '')) !== null && _4 !== void 0 ? _4 : '').trim() ||
2153
+ String((_5 = this.getNodeParameter('tag', index, '')) !== null && _5 !== void 0 ? _5 : '').trim());
2154
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2155
+ method: 'GET',
2156
+ path: '/api/v1/revisions/tags/history',
2157
+ qs: { kref, tag, r: revisionNumber },
2158
+ });
2159
+ out.push({ json: data });
2160
+ continue;
2161
+ }
2162
+ if (readMode === 'graphListEdges') {
2163
+ const revisionKref = this.getNodeParameter('revisionKrefGraph', index);
2164
+ const edgeType = String((_6 = this.getNodeParameter('edgeTypeFilter', index, '')) !== null && _6 !== void 0 ? _6 : '').trim();
2165
+ const direction = this.getNodeParameter('direction', index, 0);
2166
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2167
+ method: 'GET',
2168
+ path: '/api/v1/graph/edges',
2169
+ qs: { revision_kref: revisionKref, edge_type: edgeType || undefined, direction },
2170
+ });
2171
+ emitArray(out, data, outputFormat, returnAll, limit);
2172
+ continue;
2173
+ }
2174
+ if (readMode === 'graphGetDependencies') {
2175
+ const revisionKref = this.getNodeParameter('revisionKrefGraph', index);
2176
+ const maxDepth = this.getNodeParameter('maxDepth', index, 5);
2177
+ const edgeTypes = splitCsv(this.getNodeParameter('edgeTypes', index, ''));
2178
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2179
+ method: 'GET',
2180
+ path: '/api/v1/graph/dependencies',
2181
+ qs: { revision_kref: revisionKref, max_depth: maxDepth, edge_types: edgeTypes },
2182
+ });
2183
+ out.push({ json: data });
2184
+ continue;
2185
+ }
2186
+ if (readMode === 'graphFindPath') {
2187
+ const sourceKref = normalizeKrefString(this, this.getNodeParameter('sourceKref', index, ''), 'Source Kref');
2188
+ const targetKref = normalizeKrefString(this, this.getNodeParameter('targetKref', index, ''), 'Target Kref');
2189
+ const maxDepth = this.getNodeParameter('maxDepth', index, 5);
2190
+ const edgeTypes = splitCsv(this.getNodeParameter('edgeTypes', index, ''));
2191
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2192
+ method: 'GET',
2193
+ path: '/api/v1/graph/path',
2194
+ qs: { source_kref: sourceKref, target_kref: targetKref, max_depth: maxDepth, edge_types: edgeTypes },
2195
+ });
2196
+ out.push({ json: data });
2197
+ continue;
2198
+ }
2199
+ if (readMode === 'graphAnalyzeImpact') {
2200
+ const revisionKref = this.getNodeParameter('revisionKrefGraph', index);
2201
+ const maxDepth = this.getNodeParameter('maxDepth', index, 5);
2202
+ const edgeTypes = splitCsv(this.getNodeParameter('edgeTypes', index, ''));
2203
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2204
+ method: 'GET',
2205
+ path: '/api/v1/graph/impact',
2206
+ qs: { revision_kref: revisionKref, max_depth: maxDepth, edge_types: edgeTypes },
2207
+ });
2208
+ out.push({ json: data });
2209
+ continue;
2210
+ }
2211
+ }
2212
+ if (operation === 'update') {
2213
+ const updateMode = this.getNodeParameter('updateModeRevision', index);
2214
+ if (updateMode === 'revisionUpdateMetadata') {
2215
+ const revisionKref = (String((_7 = this.getNodeParameter('revisionKrefUpdateMetadata', index, '')) !== null && _7 !== void 0 ? _7 : '').trim() ||
2216
+ String((_8 = this.getNodeParameter('krefRevisionUpdate', index, '')) !== null && _8 !== void 0 ? _8 : '').trim() ||
2217
+ String((_9 = this.getNodeParameter('kref', index, '')) !== null && _9 !== void 0 ? _9 : '').trim());
2218
+ const normalizedRevisionKref = normalizeKrefString(this, revisionKref, 'Revision Kref');
2219
+ const metadataFromRevisionField = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('revisionMetadataUpdate', index, {}));
2220
+ const metadataFromLegacyField = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2221
+ const metadata = Object.keys(metadataFromRevisionField).length > 0 ? metadataFromRevisionField : metadataFromLegacyField;
2222
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2223
+ method: 'PATCH',
2224
+ path: '/api/v1/revisions/by-kref',
2225
+ qs: { kref: normalizedRevisionKref },
2226
+ body: { metadata },
2227
+ });
2228
+ out.push({ json: data });
2229
+ continue;
2230
+ }
2231
+ if (updateMode === 'revisionDeprecate') {
2232
+ const revisionKref = (String((_10 = this.getNodeParameter('revisionKrefDeprecate', index, '')) !== null && _10 !== void 0 ? _10 : '').trim() ||
2233
+ String((_11 = this.getNodeParameter('krefRevisionUpdate', index, '')) !== null && _11 !== void 0 ? _11 : '').trim() ||
2234
+ String((_12 = this.getNodeParameter('kref', index, '')) !== null && _12 !== void 0 ? _12 : '').trim());
2235
+ const normalizedRevisionKref = normalizeKrefString(this, revisionKref, 'Revision Kref');
2236
+ const deprecated = this.getNodeParameter('deprecatedRevision', index, true);
2237
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2238
+ method: 'POST',
2239
+ path: '/api/v1/revisions/deprecate',
2240
+ qs: { kref: normalizedRevisionKref, deprecated },
2241
+ });
2242
+ out.push({ json: data });
2243
+ continue;
2244
+ }
2245
+ if (updateMode === 'revisionSetTag') {
2246
+ const revisionKref = (String((_13 = this.getNodeParameter('revisionKrefTagUpdate', index, '')) !== null && _13 !== void 0 ? _13 : '').trim() ||
2247
+ String((_14 = this.getNodeParameter('kref', index, '')) !== null && _14 !== void 0 ? _14 : '').trim());
2248
+ const normalizedRevisionKref = normalizeKrefString(this, revisionKref, 'Revision Kref');
2249
+ const tag = (String((_15 = this.getNodeParameter('tagUpdate', index, '')) !== null && _15 !== void 0 ? _15 : '').trim() ||
2250
+ String((_16 = this.getNodeParameter('tag', index, '')) !== null && _16 !== void 0 ? _16 : '').trim());
2251
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2252
+ method: 'POST',
2253
+ path: '/api/v1/revisions/tags',
2254
+ qs: { kref: normalizedRevisionKref },
2255
+ body: { tag },
2256
+ });
2257
+ out.push({ json: data });
2258
+ continue;
2259
+ }
2260
+ if (updateMode === 'revisionRemoveTag') {
2261
+ const revisionKref = (String((_17 = this.getNodeParameter('revisionKrefTagUpdate', index, '')) !== null && _17 !== void 0 ? _17 : '').trim() ||
2262
+ String((_18 = this.getNodeParameter('kref', index, '')) !== null && _18 !== void 0 ? _18 : '').trim());
2263
+ const normalizedRevisionKref = normalizeKrefString(this, revisionKref, 'Revision Kref');
2264
+ const tag = (String((_19 = this.getNodeParameter('tagUpdate', index, '')) !== null && _19 !== void 0 ? _19 : '').trim() ||
2265
+ String((_20 = this.getNodeParameter('tag', index, '')) !== null && _20 !== void 0 ? _20 : '').trim());
2266
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2267
+ method: 'DELETE',
2268
+ path: '/api/v1/revisions/tags',
2269
+ qs: { kref: normalizedRevisionKref, tag },
2270
+ });
2271
+ out.push({ json: data });
2272
+ continue;
2273
+ }
2274
+ }
2275
+ if (operation === 'delete') {
2276
+ const revisionKref = (String((_21 = this.getNodeParameter('revisionKrefDelete', index, '')) !== null && _21 !== void 0 ? _21 : '').trim() ||
2277
+ String((_22 = this.getNodeParameter('kref', index, '')) !== null && _22 !== void 0 ? _22 : '').trim());
2278
+ const normalizedRevisionKref = normalizeKrefString(this, revisionKref, 'Revision Kref');
2279
+ const force = this.getNodeParameter('force', index, false);
2280
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2281
+ method: 'DELETE',
2282
+ path: '/api/v1/revisions/by-kref',
2283
+ qs: { kref: normalizedRevisionKref, force },
2284
+ });
2285
+ out.push({ json: data });
2286
+ continue;
2287
+ }
2288
+ }
2289
+ if (resource === 'artifact') {
2290
+ if (operation === 'create') {
2291
+ const revisionKref = this.getNodeParameter('artifactRevisionKref', index);
2292
+ const name = this.getNodeParameter('name', index);
2293
+ const location = this.getNodeParameter('locationCreate', index);
2294
+ const metadataFromArtifactField = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('artifactMetadataCreate', index, {}));
2295
+ const metadataFromLegacyField = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2296
+ const metadata = Object.keys(metadataFromArtifactField).length > 0 ? metadataFromArtifactField : metadataFromLegacyField;
2297
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2298
+ method: 'POST',
2299
+ path: '/api/v1/artifacts',
2300
+ body: { revision_kref: revisionKref, name, location, metadata },
2301
+ });
2302
+ out.push({ json: data });
2303
+ continue;
2304
+ }
2305
+ if (operation === 'read') {
2306
+ const readMode = this.getNodeParameter('readModeArtifact', index);
2307
+ if (readMode === 'artifactGet') {
2308
+ const revisionKref = this.getNodeParameter('revisionKrefArtifact', index);
2309
+ const name = this.getNodeParameter('artifactName', index);
2310
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2311
+ method: 'GET',
2312
+ path: '/api/v1/artifacts/by-kref',
2313
+ qs: { revision_kref: revisionKref, name },
2314
+ });
2315
+ out.push({ json: data });
2316
+ continue;
2317
+ }
2318
+ if (readMode === 'artifactGetByLocation') {
2319
+ const location = this.getNodeParameter('locationQuery', index);
2320
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2321
+ method: 'GET',
2322
+ path: '/api/v1/artifacts/by-location',
2323
+ qs: { location },
2324
+ });
2325
+ emitArray(out, data, outputFormat, returnAll, limit);
2326
+ continue;
2327
+ }
2328
+ }
2329
+ if (operation === 'update') {
2330
+ const updateMode = this.getNodeParameter('updateModeArtifact', index);
2331
+ const kref = this.getNodeParameter('artifactKref', index);
2332
+ if (updateMode === 'artifactUpdateMetadata') {
2333
+ const metadataFromArtifactField = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('artifactMetadataUpdate', index, {}));
2334
+ const metadataFromLegacyField = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2335
+ const metadata = Object.keys(metadataFromArtifactField).length > 0 ? metadataFromArtifactField : metadataFromLegacyField;
2336
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2337
+ method: 'PATCH',
2338
+ path: '/api/v1/artifacts/by-kref',
2339
+ qs: { kref },
2340
+ body: { metadata },
2341
+ });
2342
+ out.push({ json: data });
2343
+ continue;
2344
+ }
2345
+ if (updateMode === 'artifactDeprecate') {
2346
+ const deprecated = this.getNodeParameter('deprecatedArtifact', index, true);
2347
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2348
+ method: 'POST',
2349
+ path: '/api/v1/artifacts/deprecate',
2350
+ qs: { kref, deprecated },
2351
+ });
2352
+ out.push({ json: data });
2353
+ continue;
2354
+ }
2355
+ }
2356
+ if (operation === 'delete') {
2357
+ const kref = this.getNodeParameter('artifactKref', index);
2358
+ const force = this.getNodeParameter('force', index, false);
2359
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2360
+ method: 'DELETE',
2361
+ path: '/api/v1/artifacts/by-kref',
2362
+ qs: { kref, force },
2363
+ });
2364
+ out.push({ json: data });
2365
+ continue;
2366
+ }
2367
+ }
2368
+ if (resource === 'bundle') {
2369
+ if (operation === 'create') {
2370
+ const spacePath = normalizeKumihoPath(this, this.getNodeParameter('bundleSpacePath', index), 'Space Path');
2371
+ const bundleName = this.getNodeParameter('bundleName', index);
2372
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2373
+ try {
2374
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2375
+ method: 'POST',
2376
+ path: '/api/v1/bundles',
2377
+ body: { space_path: spacePath, bundle_name: bundleName, metadata },
2378
+ });
2379
+ out.push({ json: data });
2380
+ continue;
2381
+ }
2382
+ catch (error) {
2383
+ const err = error;
2384
+ const httpCode = Number((_23 = err === null || err === void 0 ? void 0 : err.httpCode) !== null && _23 !== void 0 ? _23 : (_24 = err === null || err === void 0 ? void 0 : err.kumiho) === null || _24 === void 0 ? void 0 : _24.status_code);
2385
+ if (httpCode === 409) {
2386
+ try {
2387
+ const normalized = spacePath.replace(/^\/+/, '');
2388
+ const bundleKref = `kref://${normalized}/${bundleName}.bundle`;
2389
+ const existing = await (0, kumihoApi_1.kumihoRequest)(this, {
2390
+ method: 'GET',
2391
+ path: '/api/v1/bundles/by-kref',
2392
+ qs: { kref: bundleKref },
2393
+ maxAttempts: 1,
2394
+ timeoutMs: 15000,
2395
+ retryBudgetMs: 15000,
2396
+ });
2397
+ out.push({ json: existing });
2398
+ continue;
2399
+ }
2400
+ catch {
2401
+ }
2402
+ }
2403
+ throw error;
2404
+ }
2405
+ }
2406
+ if (operation === 'read') {
2407
+ const readMode = this.getNodeParameter('readModeBundle', index);
2408
+ if (readMode === 'bundleGet') {
2409
+ const spacePath = normalizeKumihoPath(this, this.getNodeParameter('bundleSpacePath', index), 'Space Path');
2410
+ const bundleName = this.getNodeParameter('bundleName', index);
2411
+ const overrideEnabled = this.getNodeParameter('bundleKrefOverrideEnabled', index, false);
2412
+ const overrideKref = String((_25 = this.getNodeParameter('bundleKrefOverride', index, '')) !== null && _25 !== void 0 ? _25 : '').trim();
2413
+ const normalized = spacePath.replace(/^\/+/, '');
2414
+ const computedKref = `kref://${normalized}/${bundleName}.bundle`;
2415
+ const bundleKref = overrideEnabled && overrideKref ? overrideKref : computedKref;
2416
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2417
+ method: 'GET',
2418
+ path: '/api/v1/bundles/by-kref',
2419
+ qs: { kref: bundleKref },
2420
+ });
2421
+ out.push({ json: data });
2422
+ continue;
2423
+ }
2424
+ if (readMode === 'bundleListMembers') {
2425
+ const bundleKref = this.getNodeParameter('bundleKref', index);
2426
+ const revisionNumber = parseOptionalInt(this.getNodeParameter('bundleRevisionNumber', index, ''));
2427
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2428
+ method: 'GET',
2429
+ path: '/api/v1/bundles/members',
2430
+ qs: { bundle_kref: bundleKref, revision_number: revisionNumber },
2431
+ });
2432
+ emitArray(out, data, outputFormat, returnAll, limit);
2433
+ continue;
2434
+ }
2435
+ if (readMode === 'bundleHistory') {
2436
+ const bundleKref = this.getNodeParameter('bundleKref', index);
2437
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2438
+ method: 'GET',
2439
+ path: '/api/v1/bundles/history',
2440
+ qs: { bundle_kref: bundleKref },
2441
+ });
2442
+ emitArray(out, data, outputFormat, returnAll, limit);
2443
+ continue;
2444
+ }
2445
+ }
2446
+ if (operation === 'update') {
2447
+ const updateMode = this.getNodeParameter('updateModeBundle', index);
2448
+ const bundleKref = this.getNodeParameter('bundleKref', index);
2449
+ const itemKref = this.getNodeParameter('bundleItemKref', index);
2450
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2451
+ if (updateMode === 'bundleAddMember') {
2452
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2453
+ method: 'POST',
2454
+ path: '/api/v1/bundles/members/add',
2455
+ body: { bundle_kref: bundleKref, item_kref: itemKref, metadata },
2456
+ });
2457
+ out.push({ json: data });
2458
+ continue;
2459
+ }
2460
+ if (updateMode === 'bundleRemoveMember') {
2461
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2462
+ method: 'POST',
2463
+ path: '/api/v1/bundles/members/remove',
2464
+ body: { bundle_kref: bundleKref, item_kref: itemKref, metadata },
2465
+ });
2466
+ out.push({ json: data });
2467
+ continue;
2468
+ }
2469
+ }
2470
+ if (operation === 'delete') {
2471
+ const bundleKref = (String((_26 = this.getNodeParameter('bundleKrefDelete', index, '')) !== null && _26 !== void 0 ? _26 : '').trim() ||
2472
+ String((_27 = this.getNodeParameter('bundleKref', index, '')) !== null && _27 !== void 0 ? _27 : '').trim());
2473
+ const normalizedBundleKref = normalizeKrefString(this, bundleKref, 'Bundle Kref');
2474
+ const force = this.getNodeParameter('force', index, false);
2475
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2476
+ method: 'DELETE',
2477
+ path: '/api/v1/bundles/by-kref',
2478
+ qs: { kref: normalizedBundleKref, force },
2479
+ });
2480
+ out.push({ json: data });
2481
+ continue;
2482
+ }
2483
+ }
2484
+ if (resource === 'graph') {
2485
+ if (operation === 'create') {
2486
+ const createMode = this.getNodeParameter('createMode', index);
2487
+ if (createMode === 'graphCreateEdge') {
2488
+ const sourceKref = this.getNodeParameter('sourceKref', index);
2489
+ const targetKref = this.getNodeParameter('targetKref', index);
2490
+ const edgeType = this.getNodeParameter('edgeType', index);
2491
+ const metadata = (0, kumihoApi_1.normalizeMetadata)(this.getNodeParameter('metadata', index, {}));
2492
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2493
+ method: 'POST',
2494
+ path: '/api/v1/graph/edges',
2495
+ body: { source_kref: sourceKref, target_kref: targetKref, edge_type: edgeType, metadata },
2496
+ });
2497
+ out.push({ json: data });
2498
+ continue;
2499
+ }
2500
+ }
2501
+ if (operation === 'read') {
2502
+ const readMode = this.getNodeParameter('readModeGraph', index);
2503
+ const maxDepth = this.getNodeParameter('maxDepth', index, 5);
2504
+ const edgeTypes = splitCsv(this.getNodeParameter('edgeTypes', index, ''));
2505
+ if (readMode === 'graphListEdges') {
2506
+ const revisionKref = this.getNodeParameter('revisionKrefGraph', index);
2507
+ const edgeType = String((_28 = this.getNodeParameter('edgeTypeFilter', index, '')) !== null && _28 !== void 0 ? _28 : '').trim();
2508
+ const direction = this.getNodeParameter('direction', index, 0);
2509
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2510
+ method: 'GET',
2511
+ path: '/api/v1/graph/edges',
2512
+ qs: { revision_kref: revisionKref, edge_type: edgeType || undefined, direction },
2513
+ });
2514
+ emitArray(out, data, outputFormat, returnAll, limit);
2515
+ continue;
2516
+ }
2517
+ if (readMode === 'graphGetDependencies') {
2518
+ const revisionKref = this.getNodeParameter('revisionKrefGraph', index);
2519
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2520
+ method: 'GET',
2521
+ path: '/api/v1/graph/dependencies',
2522
+ qs: { revision_kref: revisionKref, max_depth: maxDepth, edge_types: edgeTypes },
2523
+ });
2524
+ out.push({ json: data });
2525
+ continue;
2526
+ }
2527
+ if (readMode === 'graphFindPath') {
2528
+ const sourceKref = this.getNodeParameter('sourceKref', index);
2529
+ const targetKref = this.getNodeParameter('targetKref', index);
2530
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2531
+ method: 'GET',
2532
+ path: '/api/v1/graph/path',
2533
+ qs: { source_kref: sourceKref, target_kref: targetKref, max_depth: maxDepth, edge_types: edgeTypes },
2534
+ });
2535
+ out.push({ json: data });
2536
+ continue;
2537
+ }
2538
+ if (readMode === 'graphAnalyzeImpact') {
2539
+ const revisionKref = this.getNodeParameter('revisionKrefGraph', index);
2540
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2541
+ method: 'GET',
2542
+ path: '/api/v1/graph/impact',
2543
+ qs: { revision_kref: revisionKref, max_depth: maxDepth, edge_types: edgeTypes },
2544
+ });
2545
+ out.push({ json: data });
2546
+ continue;
2547
+ }
2548
+ }
2549
+ }
2550
+ if (resource === 'kref') {
2551
+ if (operation === 'read') {
2552
+ const readMode = this.getNodeParameter('readModeKref', index);
2553
+ if (readMode === 'krefResolve') {
2554
+ const kref = this.getNodeParameter('kref', index);
2555
+ const r = parseOptionalInt(this.getNodeParameter('krefResolveRevisionNumber', index, ''));
2556
+ const t = String((_29 = this.getNodeParameter('krefResolveTag', index, '')) !== null && _29 !== void 0 ? _29 : '').trim() || undefined;
2557
+ const a = String((_30 = this.getNodeParameter('krefResolveArtifactName', index, '')) !== null && _30 !== void 0 ? _30 : '').trim() || undefined;
2558
+ const qs = { kref };
2559
+ if (r !== undefined)
2560
+ qs.r = r;
2561
+ if (t !== undefined)
2562
+ qs.t = t;
2563
+ if (a !== undefined)
2564
+ qs.a = a;
2565
+ const data = await (0, kumihoApi_1.kumihoRequest)(this, {
2566
+ method: 'GET',
2567
+ path: '/api/v1/resolve',
2568
+ qs,
2569
+ });
2570
+ out.push({ json: data });
2571
+ continue;
2572
+ }
2573
+ }
2574
+ }
2575
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported combination: resource=${resource}, operation=${operation}`);
2576
+ }
2577
+ return [out];
2578
+ }
2579
+ }
2580
+ exports.KumihoAction = KumihoAction;
2581
+ //# sourceMappingURL=KumihoAction.node.js.map