@kaddo/cli 3.90.3 → 3.91.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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>admin</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CJ_ZkVBF.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-DNkI-1xG.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -366,10 +366,21 @@ function assertExternalId(externalId) {
|
|
|
366
366
|
throw new CoreError("INVALID_EXTERNAL_ID", "Invalid external work item identifier.");
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
+
function assertIntegrationId(id) {
|
|
370
|
+
if (!id || id.includes("..") || id.includes("/") || id.includes("\\") || id.startsWith(".") || !/^[a-z0-9][a-z0-9._-]*$/i.test(id)) {
|
|
371
|
+
throw new CoreError("INVALID_INTEGRATION_ID", "Invalid integration identifier.");
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function assertSecretName(name) {
|
|
375
|
+
if (!name || name.includes("..") || name.includes("/") || name.includes("\\") || !/^[a-zA-Z0-9_-]+$/.test(name)) {
|
|
376
|
+
throw new CoreError("INVALID_SECRET_NAME", "Invalid secret name.");
|
|
377
|
+
}
|
|
378
|
+
}
|
|
369
379
|
function getIntegrations(dir) {
|
|
370
380
|
return coreListIntegrations(dir);
|
|
371
381
|
}
|
|
372
382
|
async function getIntegrationStatus(dir, id) {
|
|
383
|
+
assertIntegrationId(id);
|
|
373
384
|
try {
|
|
374
385
|
return await coreVerifyIntegration(dir, id);
|
|
375
386
|
} catch (err) {
|
|
@@ -377,6 +388,7 @@ async function getIntegrationStatus(dir, id) {
|
|
|
377
388
|
}
|
|
378
389
|
}
|
|
379
390
|
async function getExternalWorkItems(dir, id, opts) {
|
|
391
|
+
assertIntegrationId(id);
|
|
380
392
|
try {
|
|
381
393
|
return await coreListExternalWorkItems(dir, id, { cursor: opts.cursor, pageSize: opts.pageSize, filters: opts.filters });
|
|
382
394
|
} catch (err) {
|
|
@@ -384,6 +396,7 @@ async function getExternalWorkItems(dir, id, opts) {
|
|
|
384
396
|
}
|
|
385
397
|
}
|
|
386
398
|
async function getExternalWorkItemDetail(dir, id, externalId) {
|
|
399
|
+
assertIntegrationId(id);
|
|
387
400
|
assertExternalId(externalId);
|
|
388
401
|
try {
|
|
389
402
|
return await coreGetExternalWorkItem(dir, id, externalId);
|
|
@@ -392,6 +405,7 @@ async function getExternalWorkItemDetail(dir, id, externalId) {
|
|
|
392
405
|
}
|
|
393
406
|
}
|
|
394
407
|
async function previewIntegrationImport(dir, id, externalId, opts) {
|
|
408
|
+
assertIntegrationId(id);
|
|
395
409
|
assertExternalId(externalId);
|
|
396
410
|
try {
|
|
397
411
|
return await corePreviewImport(dir, id, externalId, { type: opts.type });
|
|
@@ -400,6 +414,7 @@ async function previewIntegrationImport(dir, id, externalId, opts) {
|
|
|
400
414
|
}
|
|
401
415
|
}
|
|
402
416
|
async function importIntegrationWorkItem(dir, id, externalId, opts) {
|
|
417
|
+
assertIntegrationId(id);
|
|
403
418
|
assertExternalId(externalId);
|
|
404
419
|
try {
|
|
405
420
|
return await coreImportExternalWorkItem(dir, id, externalId, { type: opts.type });
|
|
@@ -409,6 +424,7 @@ async function importIntegrationWorkItem(dir, id, externalId, opts) {
|
|
|
409
424
|
}
|
|
410
425
|
}
|
|
411
426
|
function getIntegrationDetail(dir, id) {
|
|
427
|
+
assertIntegrationId(id);
|
|
412
428
|
try {
|
|
413
429
|
return coreGetIntegration(dir, id);
|
|
414
430
|
} catch (err) {
|
|
@@ -416,6 +432,7 @@ function getIntegrationDetail(dir, id) {
|
|
|
416
432
|
}
|
|
417
433
|
}
|
|
418
434
|
async function getIntegrationSecretStatusAdmin(dir, id) {
|
|
435
|
+
assertIntegrationId(id);
|
|
419
436
|
try {
|
|
420
437
|
return await coreGetIntegrationSecretStatus(dir, id);
|
|
421
438
|
} catch (err) {
|
|
@@ -433,6 +450,7 @@ function createIntegrationAdmin(dir, body) {
|
|
|
433
450
|
}
|
|
434
451
|
}
|
|
435
452
|
function updateIntegrationAdmin(dir, id, body) {
|
|
453
|
+
assertIntegrationId(id);
|
|
436
454
|
try {
|
|
437
455
|
return coreUpdateIntegration(dir, id, body);
|
|
438
456
|
} catch (err) {
|
|
@@ -440,6 +458,7 @@ function updateIntegrationAdmin(dir, id, body) {
|
|
|
440
458
|
}
|
|
441
459
|
}
|
|
442
460
|
function deleteIntegrationAdmin(dir, id) {
|
|
461
|
+
assertIntegrationId(id);
|
|
443
462
|
try {
|
|
444
463
|
coreDeleteIntegration(dir, id);
|
|
445
464
|
} catch (err) {
|
|
@@ -447,6 +466,7 @@ function deleteIntegrationAdmin(dir, id) {
|
|
|
447
466
|
}
|
|
448
467
|
}
|
|
449
468
|
function enableIntegrationAdmin(dir, id) {
|
|
469
|
+
assertIntegrationId(id);
|
|
450
470
|
try {
|
|
451
471
|
return coreEnableIntegration(dir, id);
|
|
452
472
|
} catch (err) {
|
|
@@ -454,6 +474,7 @@ function enableIntegrationAdmin(dir, id) {
|
|
|
454
474
|
}
|
|
455
475
|
}
|
|
456
476
|
function disableIntegrationAdmin(dir, id) {
|
|
477
|
+
assertIntegrationId(id);
|
|
457
478
|
try {
|
|
458
479
|
return coreDisableIntegration(dir, id);
|
|
459
480
|
} catch (err) {
|
|
@@ -461,6 +482,8 @@ function disableIntegrationAdmin(dir, id) {
|
|
|
461
482
|
}
|
|
462
483
|
}
|
|
463
484
|
async function setIntegrationSecretAdmin(dir, id, secretName, value) {
|
|
485
|
+
assertIntegrationId(id);
|
|
486
|
+
assertSecretName(secretName);
|
|
464
487
|
try {
|
|
465
488
|
await coreSetIntegrationSecret(dir, id, secretName, value);
|
|
466
489
|
} catch (err) {
|
|
@@ -468,6 +491,8 @@ async function setIntegrationSecretAdmin(dir, id, secretName, value) {
|
|
|
468
491
|
}
|
|
469
492
|
}
|
|
470
493
|
async function removeIntegrationSecretAdmin(dir, id, secretName) {
|
|
494
|
+
assertIntegrationId(id);
|
|
495
|
+
assertSecretName(secretName);
|
|
471
496
|
try {
|
|
472
497
|
await coreRemoveIntegrationSecret(dir, id, secretName);
|
|
473
498
|
} catch (err) {
|
|
@@ -482,6 +507,7 @@ async function discoverExternalWorkItemsAdmin(dir, opts) {
|
|
|
482
507
|
}
|
|
483
508
|
}
|
|
484
509
|
function getIntegrationFiltersAdmin(dir, id) {
|
|
510
|
+
assertIntegrationId(id);
|
|
485
511
|
try {
|
|
486
512
|
return coreGetIntegrationFilters(dir, id);
|
|
487
513
|
} catch (err) {
|
|
@@ -489,6 +515,7 @@ function getIntegrationFiltersAdmin(dir, id) {
|
|
|
489
515
|
}
|
|
490
516
|
}
|
|
491
517
|
function updateIntegrationFiltersAdmin(dir, id, filters) {
|
|
518
|
+
assertIntegrationId(id);
|
|
492
519
|
try {
|
|
493
520
|
return coreUpdateIntegrationFilters(dir, id, filters);
|
|
494
521
|
} catch (err) {
|
|
@@ -853,6 +880,9 @@ function statusForCode(code) {
|
|
|
853
880
|
return 409;
|
|
854
881
|
case "INVALID_INPUT":
|
|
855
882
|
case "INVALID_WORK_ITEM_ID":
|
|
883
|
+
case "INVALID_INTEGRATION_ID":
|
|
884
|
+
case "INVALID_SECRET_NAME":
|
|
885
|
+
case "INVALID_EXTERNAL_ID":
|
|
856
886
|
case "INVALID_TRANSITION":
|
|
857
887
|
return 400;
|
|
858
888
|
default:
|