@rockcarver/frodo-lib 2.0.0-2 → 2.0.0-4
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/CHANGELOG.md +9 -1
- package/cjs/api/AgentApi.js +64 -16
- package/cjs/api/AgentApi.js.map +1 -1
- package/cjs/api/ApiTypes.js +0 -55
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/BaseApi.js +21 -11
- package/cjs/api/BaseApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.js +7 -14
- package/cjs/api/cloud/SecretsApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
- package/cjs/index.js +6 -0
- package/cjs/index.js.map +1 -1
- package/cjs/ops/AdminOps.js +254 -60
- package/cjs/ops/AdminOps.js.map +1 -1
- package/cjs/ops/AgentOps.js +352 -108
- package/cjs/ops/AgentOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +262 -65
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +16 -4
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +163 -40
- package/cjs/ops/ConnectionProfileOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +7 -1
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/IdpOps.js +55 -12
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/JourneyOps.js +645 -136
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +96 -24
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.js +45 -11
- package/cjs/ops/OAuth2ClientOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js +0 -23
- package/cjs/ops/OpsTypes.js.map +1 -1
- package/cjs/ops/OrganizationOps.js +44 -10
- package/cjs/ops/OrganizationOps.js.map +1 -1
- package/cjs/ops/PolicyOps.js +86 -24
- package/cjs/ops/PolicyOps.js.map +1 -1
- package/cjs/ops/PolicySetOps.js +72 -18
- package/cjs/ops/PolicySetOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.js +24 -6
- package/cjs/ops/ResourceTypeOps.js.map +1 -1
- package/cjs/ops/Saml2Ops.js +121 -42
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/Saml2Ops.test.js.map +1 -1
- package/cjs/ops/ScriptOps.js +73 -17
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/ServiceOps.js +152 -35
- package/cjs/ops/ServiceOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +20 -5
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/cjs/ops/cloud/FeatureOps.js +4 -1
- package/cjs/ops/cloud/FeatureOps.js.map +1 -1
- package/cjs/ops/cloud/SecretsOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.js +24 -6
- package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
- package/cjs/ops/cloud/StartupOps.js +55 -11
- package/cjs/ops/cloud/StartupOps.js.map +1 -1
- package/cjs/ops/utils/Console.js +47 -22
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/DataProtection.js +12 -5
- package/cjs/ops/utils/DataProtection.js.map +1 -1
- package/cjs/ops/utils/DataProtection.test.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js +15 -8
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/ops/utils/ScriptValidationUtils.js +33 -8
- package/cjs/ops/utils/ScriptValidationUtils.js.map +1 -1
- package/cjs/ops/utils/ScriptValidationUtils.test.js.map +1 -1
- package/cjs/utils/SetupPollyForFrodoLib.js +67 -19
- package/cjs/utils/SetupPollyForFrodoLib.js.map +1 -1
- package/esm/api/AgentApi.mjs +64 -16
- package/esm/api/ApiTypes.mjs +1 -50
- package/esm/api/BaseApi.mjs +21 -11
- package/esm/api/cloud/SecretsApi.mjs +0 -5
- package/esm/api/cloud/SecretsApi.test.mjs +3 -3
- package/esm/index.mjs +1 -1
- package/esm/ops/AdminOps.mjs +254 -60
- package/esm/ops/AgentOps.mjs +352 -104
- package/esm/ops/AuthenticateOps.mjs +262 -65
- package/esm/ops/CirclesOfTrustOps.mjs +16 -4
- package/esm/ops/ConnectionProfileOps.mjs +163 -40
- package/esm/ops/EmailTemplateOps.mjs +5 -0
- package/esm/ops/IdpOps.mjs +55 -12
- package/esm/ops/JourneyOps.mjs +639 -132
- package/esm/ops/NodeOps.mjs +90 -19
- package/esm/ops/OAuth2ClientOps.mjs +45 -11
- package/esm/ops/OpsTypes.mjs +1 -22
- package/esm/ops/OrganizationOps.mjs +44 -10
- package/esm/ops/PolicyOps.mjs +86 -24
- package/esm/ops/PolicySetOps.mjs +72 -18
- package/esm/ops/ResourceTypeOps.mjs +24 -6
- package/esm/ops/Saml2Ops.mjs +120 -39
- package/esm/ops/Saml2Ops.test.mjs +10 -11
- package/esm/ops/ScriptOps.mjs +73 -17
- package/esm/ops/ServiceOps.mjs +152 -35
- package/esm/ops/ThemeOps.mjs +20 -5
- package/esm/ops/cloud/FeatureOps.mjs +4 -1
- package/esm/ops/cloud/ServiceAccountOps.mjs +24 -6
- package/esm/ops/cloud/StartupOps.mjs +55 -11
- package/esm/ops/utils/Console.mjs +33 -9
- package/esm/ops/utils/DataProtection.mjs +9 -2
- package/esm/ops/utils/DataProtection.test.mjs +8 -2
- package/esm/ops/utils/ExportImportUtils.mjs +15 -8
- package/esm/ops/utils/ScriptValidationUtils.mjs +30 -8
- package/esm/ops/utils/ScriptValidationUtils.test.mjs +14 -3
- package/esm/utils/SetupPollyForFrodoLib.mjs +64 -18
- package/package.json +1 -1
- package/types/api/AgentApi.d.ts +6 -6
- package/types/api/AgentApi.d.ts.map +1 -1
- package/types/api/ApiTypes.d.ts +12 -49
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/BaseApi.d.ts.map +1 -1
- package/types/api/cloud/SecretsApi.d.ts +1 -4
- package/types/api/cloud/SecretsApi.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/ops/AdminOps.d.ts.map +1 -1
- package/types/ops/AgentOps.d.ts +3 -6
- package/types/ops/AgentOps.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
- package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
- package/types/ops/EmailTemplateOps.d.ts +4 -0
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/ops/JourneyOps.d.ts +10 -5
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts +10 -4
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +2 -12
- package/types/ops/OpsTypes.d.ts.map +1 -1
- package/types/ops/OrganizationOps.d.ts.map +1 -1
- package/types/ops/PolicyOps.d.ts.map +1 -1
- package/types/ops/PolicySetOps.d.ts.map +1 -1
- package/types/ops/ResourceTypeOps.d.ts.map +1 -1
- package/types/ops/Saml2Ops.d.ts +0 -6
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/ScriptOps.d.ts.map +1 -1
- package/types/ops/ServiceOps.d.ts.map +1 -1
- package/types/ops/ThemeOps.d.ts.map +1 -1
- package/types/ops/cloud/FeatureOps.d.ts.map +1 -1
- package/types/ops/cloud/SecretsOps.d.ts +1 -1
- package/types/ops/cloud/SecretsOps.d.ts.map +1 -1
- package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -1
- package/types/ops/cloud/StartupOps.d.ts.map +1 -1
- package/types/ops/utils/Console.d.ts +34 -7
- package/types/ops/utils/Console.d.ts.map +1 -1
- package/types/ops/utils/DataProtection.d.ts +5 -1
- package/types/ops/utils/DataProtection.d.ts.map +1 -1
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
- package/types/ops/utils/ScriptValidationUtils.d.ts +14 -4
- package/types/ops/utils/ScriptValidationUtils.d.ts.map +1 -1
- package/types/utils/SetupPollyForFrodoLib.d.ts +5 -1
- package/types/utils/SetupPollyForFrodoLib.d.ts.map +1 -1
package/esm/ops/AgentOps.mjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { debugMessage, printMessage } from './utils/Console';
|
|
2
2
|
import { getAgentsByType, getAgentByTypeAndId as _getAgentByTypeAndId, putAgentByTypeAndId, findAgentById, deleteAgentByTypeAndId, findAgentByTypeAndId } from '../api/AgentApi';
|
|
3
3
|
import { validateImport } from './utils/ExportImportUtils';
|
|
4
|
-
export const AGENT_TYPE_IG = 'IdentityGatewayAgent';
|
|
5
|
-
export const AGENT_TYPE_JAVA = 'J2EEAgent';
|
|
6
|
-
export const AGENT_TYPE_WEB = 'WebAgent';
|
|
7
4
|
export default class AgentOps {
|
|
8
5
|
constructor(state) {
|
|
9
6
|
this.state = state;
|
|
@@ -448,7 +445,10 @@ export function createAgentExportTemplate() {
|
|
|
448
445
|
export async function getAgents({
|
|
449
446
|
state
|
|
450
447
|
}) {
|
|
451
|
-
debugMessage(
|
|
448
|
+
debugMessage({
|
|
449
|
+
message: `AgentOps.getAgents: start`,
|
|
450
|
+
state
|
|
451
|
+
});
|
|
452
452
|
let agents = [];
|
|
453
453
|
try {
|
|
454
454
|
const resolved = await Promise.all([getAgentsByType({
|
|
@@ -465,11 +465,22 @@ export async function getAgents({
|
|
|
465
465
|
agents = agents.concat(resolved[1].result);
|
|
466
466
|
agents = agents.concat(resolved[2].result);
|
|
467
467
|
} catch (error) {
|
|
468
|
-
printMessage(
|
|
469
|
-
|
|
468
|
+
printMessage({
|
|
469
|
+
message: `${error.message}`,
|
|
470
|
+
type: 'error',
|
|
471
|
+
state
|
|
472
|
+
});
|
|
473
|
+
printMessage({
|
|
474
|
+
message: error.response.data,
|
|
475
|
+
type: 'error',
|
|
476
|
+
state
|
|
477
|
+
});
|
|
470
478
|
}
|
|
471
479
|
agents.sort((a, b) => a._id.localeCompare(b._id));
|
|
472
|
-
debugMessage(
|
|
480
|
+
debugMessage({
|
|
481
|
+
message: `AgentOps.getAgents: end`,
|
|
482
|
+
state
|
|
483
|
+
});
|
|
473
484
|
return agents;
|
|
474
485
|
}
|
|
475
486
|
|
|
@@ -482,7 +493,10 @@ export async function getAgent({
|
|
|
482
493
|
agentId,
|
|
483
494
|
state
|
|
484
495
|
}) {
|
|
485
|
-
debugMessage(
|
|
496
|
+
debugMessage({
|
|
497
|
+
message: `AgentOps.getAgent: start`,
|
|
498
|
+
state
|
|
499
|
+
});
|
|
486
500
|
const agents = await findAgentById({
|
|
487
501
|
agentId,
|
|
488
502
|
state
|
|
@@ -493,7 +507,10 @@ export async function getAgent({
|
|
|
493
507
|
agentId: agents[0]._id,
|
|
494
508
|
state
|
|
495
509
|
});
|
|
496
|
-
debugMessage(
|
|
510
|
+
debugMessage({
|
|
511
|
+
message: `AgentOps.getAgent: end`,
|
|
512
|
+
state
|
|
513
|
+
});
|
|
497
514
|
return result;
|
|
498
515
|
} else if (agents.length === 0) {
|
|
499
516
|
throw new Error(`Agent '${agentId}' not found`);
|
|
@@ -513,13 +530,19 @@ export async function getAgentByTypeAndId({
|
|
|
513
530
|
agentId,
|
|
514
531
|
state
|
|
515
532
|
}) {
|
|
516
|
-
debugMessage(
|
|
533
|
+
debugMessage({
|
|
534
|
+
message: `AgentOps.getAgentByTypeAndId: start`,
|
|
535
|
+
state
|
|
536
|
+
});
|
|
517
537
|
const result = await _getAgentByTypeAndId({
|
|
518
538
|
agentType,
|
|
519
539
|
agentId,
|
|
520
540
|
state
|
|
521
541
|
});
|
|
522
|
-
debugMessage(
|
|
542
|
+
debugMessage({
|
|
543
|
+
message: `AgentOps.getAgentByTypeAndId: start`,
|
|
544
|
+
state
|
|
545
|
+
});
|
|
523
546
|
return result;
|
|
524
547
|
}
|
|
525
548
|
|
|
@@ -530,14 +553,20 @@ export async function getAgentByTypeAndId({
|
|
|
530
553
|
export async function getIdentityGatewayAgents({
|
|
531
554
|
state
|
|
532
555
|
}) {
|
|
533
|
-
debugMessage(
|
|
556
|
+
debugMessage({
|
|
557
|
+
message: `AgentOps.getIdentityGatewayAgents: start`,
|
|
558
|
+
state
|
|
559
|
+
});
|
|
534
560
|
const {
|
|
535
561
|
result
|
|
536
562
|
} = await getAgentsByType({
|
|
537
|
-
agentType:
|
|
563
|
+
agentType: 'IdentityGatewayAgent',
|
|
564
|
+
state
|
|
565
|
+
});
|
|
566
|
+
debugMessage({
|
|
567
|
+
message: `AgentOps.getIdentityGatewayAgents: end`,
|
|
538
568
|
state
|
|
539
569
|
});
|
|
540
|
-
debugMessage(`AgentOps.getIdentityGatewayAgents: end`);
|
|
541
570
|
return result;
|
|
542
571
|
}
|
|
543
572
|
|
|
@@ -550,13 +579,19 @@ export async function getIdentityGatewayAgent({
|
|
|
550
579
|
gatewayId,
|
|
551
580
|
state
|
|
552
581
|
}) {
|
|
553
|
-
debugMessage(
|
|
582
|
+
debugMessage({
|
|
583
|
+
message: `AgentOps.getIdentityGatewayAgent: start`,
|
|
584
|
+
state
|
|
585
|
+
});
|
|
554
586
|
const result = await getAgentByTypeAndId({
|
|
555
|
-
agentType:
|
|
587
|
+
agentType: 'IdentityGatewayAgent',
|
|
556
588
|
agentId: gatewayId,
|
|
557
589
|
state
|
|
558
590
|
});
|
|
559
|
-
debugMessage(
|
|
591
|
+
debugMessage({
|
|
592
|
+
message: `AgentOps.getIdentityGatewayAgent: end`,
|
|
593
|
+
state
|
|
594
|
+
});
|
|
560
595
|
return result;
|
|
561
596
|
}
|
|
562
597
|
|
|
@@ -571,14 +606,20 @@ export async function putIdentityGatewayAgent({
|
|
|
571
606
|
gatewayData,
|
|
572
607
|
state
|
|
573
608
|
}) {
|
|
574
|
-
debugMessage(
|
|
609
|
+
debugMessage({
|
|
610
|
+
message: `AgentOps.putIdentityGatewayAgent: start`,
|
|
611
|
+
state
|
|
612
|
+
});
|
|
575
613
|
const result = await putAgentByTypeAndId({
|
|
576
|
-
agentType:
|
|
614
|
+
agentType: 'IdentityGatewayAgent',
|
|
577
615
|
agentId: gatewayId,
|
|
578
616
|
agentData: gatewayData,
|
|
579
617
|
state
|
|
580
618
|
});
|
|
581
|
-
debugMessage(
|
|
619
|
+
debugMessage({
|
|
620
|
+
message: `AgentOps.putIdentityGatewayAgent: end`,
|
|
621
|
+
state
|
|
622
|
+
});
|
|
582
623
|
return result;
|
|
583
624
|
}
|
|
584
625
|
|
|
@@ -589,14 +630,20 @@ export async function putIdentityGatewayAgent({
|
|
|
589
630
|
export async function getJavaAgents({
|
|
590
631
|
state
|
|
591
632
|
}) {
|
|
592
|
-
debugMessage(
|
|
633
|
+
debugMessage({
|
|
634
|
+
message: `AgentOps.getJavaAgents: start`,
|
|
635
|
+
state
|
|
636
|
+
});
|
|
593
637
|
const {
|
|
594
638
|
result
|
|
595
639
|
} = await getAgentsByType({
|
|
596
|
-
agentType:
|
|
640
|
+
agentType: 'J2EEAgent',
|
|
641
|
+
state
|
|
642
|
+
});
|
|
643
|
+
debugMessage({
|
|
644
|
+
message: `AgentOps.getJavaAgents: end`,
|
|
597
645
|
state
|
|
598
646
|
});
|
|
599
|
-
debugMessage(`AgentOps.getJavaAgents: end`);
|
|
600
647
|
return result;
|
|
601
648
|
}
|
|
602
649
|
|
|
@@ -609,13 +656,19 @@ export async function getJavaAgent({
|
|
|
609
656
|
agentId,
|
|
610
657
|
state
|
|
611
658
|
}) {
|
|
612
|
-
debugMessage(
|
|
659
|
+
debugMessage({
|
|
660
|
+
message: `AgentOps.getJavaAgent: start`,
|
|
661
|
+
state
|
|
662
|
+
});
|
|
613
663
|
const result = await getAgentByTypeAndId({
|
|
614
|
-
agentType:
|
|
664
|
+
agentType: 'J2EEAgent',
|
|
615
665
|
agentId,
|
|
616
666
|
state
|
|
617
667
|
});
|
|
618
|
-
debugMessage(
|
|
668
|
+
debugMessage({
|
|
669
|
+
message: `AgentOps.getJavaAgent: end`,
|
|
670
|
+
state
|
|
671
|
+
});
|
|
619
672
|
return result;
|
|
620
673
|
}
|
|
621
674
|
|
|
@@ -630,14 +683,20 @@ export async function putJavaAgent({
|
|
|
630
683
|
agentData,
|
|
631
684
|
state
|
|
632
685
|
}) {
|
|
633
|
-
debugMessage(
|
|
686
|
+
debugMessage({
|
|
687
|
+
message: `AgentOps.putJavaAgent: start`,
|
|
688
|
+
state
|
|
689
|
+
});
|
|
634
690
|
const result = await putAgentByTypeAndId({
|
|
635
|
-
agentType:
|
|
691
|
+
agentType: 'J2EEAgent',
|
|
636
692
|
agentId,
|
|
637
693
|
agentData,
|
|
638
694
|
state
|
|
639
695
|
});
|
|
640
|
-
debugMessage(
|
|
696
|
+
debugMessage({
|
|
697
|
+
message: `AgentOps.putJavaAgent: end`,
|
|
698
|
+
state
|
|
699
|
+
});
|
|
641
700
|
return result;
|
|
642
701
|
}
|
|
643
702
|
|
|
@@ -648,14 +707,20 @@ export async function putJavaAgent({
|
|
|
648
707
|
export async function getWebAgents({
|
|
649
708
|
state
|
|
650
709
|
}) {
|
|
651
|
-
debugMessage(
|
|
710
|
+
debugMessage({
|
|
711
|
+
message: `AgentOps.getWebAgents: start`,
|
|
712
|
+
state
|
|
713
|
+
});
|
|
652
714
|
const {
|
|
653
715
|
result
|
|
654
716
|
} = await getAgentsByType({
|
|
655
|
-
agentType:
|
|
717
|
+
agentType: 'WebAgent',
|
|
718
|
+
state
|
|
719
|
+
});
|
|
720
|
+
debugMessage({
|
|
721
|
+
message: `AgentOps.getWebAgents: end`,
|
|
656
722
|
state
|
|
657
723
|
});
|
|
658
|
-
debugMessage(`AgentOps.getWebAgents: end`);
|
|
659
724
|
return result;
|
|
660
725
|
}
|
|
661
726
|
|
|
@@ -668,13 +733,19 @@ export async function getWebAgent({
|
|
|
668
733
|
agentId,
|
|
669
734
|
state
|
|
670
735
|
}) {
|
|
671
|
-
debugMessage(
|
|
736
|
+
debugMessage({
|
|
737
|
+
message: `AgentOps.getWebAgent: start`,
|
|
738
|
+
state
|
|
739
|
+
});
|
|
672
740
|
const result = await getAgentByTypeAndId({
|
|
673
|
-
agentType:
|
|
741
|
+
agentType: 'WebAgent',
|
|
674
742
|
agentId,
|
|
675
743
|
state
|
|
676
744
|
});
|
|
677
|
-
debugMessage(
|
|
745
|
+
debugMessage({
|
|
746
|
+
message: `AgentOps.getWebAgent: end`,
|
|
747
|
+
state
|
|
748
|
+
});
|
|
678
749
|
return result;
|
|
679
750
|
}
|
|
680
751
|
|
|
@@ -689,14 +760,20 @@ export async function putWebAgent({
|
|
|
689
760
|
agentData,
|
|
690
761
|
state
|
|
691
762
|
}) {
|
|
692
|
-
debugMessage(
|
|
763
|
+
debugMessage({
|
|
764
|
+
message: `AgentOps.putWebAgent: start`,
|
|
765
|
+
state
|
|
766
|
+
});
|
|
693
767
|
const result = await putAgentByTypeAndId({
|
|
694
|
-
agentType:
|
|
768
|
+
agentType: 'WebAgent',
|
|
695
769
|
agentId,
|
|
696
770
|
agentData,
|
|
697
771
|
state
|
|
698
772
|
});
|
|
699
|
-
debugMessage(
|
|
773
|
+
debugMessage({
|
|
774
|
+
message: `AgentOps.putWebAgent: end`,
|
|
775
|
+
state
|
|
776
|
+
});
|
|
700
777
|
return result;
|
|
701
778
|
}
|
|
702
779
|
|
|
@@ -707,7 +784,10 @@ export async function putWebAgent({
|
|
|
707
784
|
export async function exportAgents({
|
|
708
785
|
state
|
|
709
786
|
}) {
|
|
710
|
-
debugMessage(
|
|
787
|
+
debugMessage({
|
|
788
|
+
message: `AgentOps.exportAgents: start`,
|
|
789
|
+
state
|
|
790
|
+
});
|
|
711
791
|
const exportData = createAgentExportTemplate();
|
|
712
792
|
const agents = await getAgents({
|
|
713
793
|
state
|
|
@@ -715,7 +795,10 @@ export async function exportAgents({
|
|
|
715
795
|
for (const agent of agents) {
|
|
716
796
|
exportData.agents[agent._id] = agent;
|
|
717
797
|
}
|
|
718
|
-
debugMessage(
|
|
798
|
+
debugMessage({
|
|
799
|
+
message: `AgentOps.exportAgents: end`,
|
|
800
|
+
state
|
|
801
|
+
});
|
|
719
802
|
return exportData;
|
|
720
803
|
}
|
|
721
804
|
|
|
@@ -726,7 +809,10 @@ export async function exportAgents({
|
|
|
726
809
|
export async function exportIdentityGatewayAgents({
|
|
727
810
|
state
|
|
728
811
|
}) {
|
|
729
|
-
debugMessage(
|
|
812
|
+
debugMessage({
|
|
813
|
+
message: `AgentOps.exportIdentityGatewayAgents: start`,
|
|
814
|
+
state
|
|
815
|
+
});
|
|
730
816
|
const exportData = createAgentExportTemplate();
|
|
731
817
|
const agents = await getIdentityGatewayAgents({
|
|
732
818
|
state
|
|
@@ -734,7 +820,10 @@ export async function exportIdentityGatewayAgents({
|
|
|
734
820
|
for (const agent of agents) {
|
|
735
821
|
exportData.agents[agent._id] = agent;
|
|
736
822
|
}
|
|
737
|
-
debugMessage(
|
|
823
|
+
debugMessage({
|
|
824
|
+
message: `AgentOps.exportIdentityGatewayAgents: end`,
|
|
825
|
+
state
|
|
826
|
+
});
|
|
738
827
|
return exportData;
|
|
739
828
|
}
|
|
740
829
|
|
|
@@ -745,7 +834,10 @@ export async function exportIdentityGatewayAgents({
|
|
|
745
834
|
export async function exportJavaAgents({
|
|
746
835
|
state
|
|
747
836
|
}) {
|
|
748
|
-
debugMessage(
|
|
837
|
+
debugMessage({
|
|
838
|
+
message: `AgentOps.exportJavaAgents: start`,
|
|
839
|
+
state
|
|
840
|
+
});
|
|
749
841
|
const exportData = createAgentExportTemplate();
|
|
750
842
|
const agents = await getJavaAgents({
|
|
751
843
|
state
|
|
@@ -753,7 +845,10 @@ export async function exportJavaAgents({
|
|
|
753
845
|
for (const agent of agents) {
|
|
754
846
|
exportData.agents[agent._id] = agent;
|
|
755
847
|
}
|
|
756
|
-
debugMessage(
|
|
848
|
+
debugMessage({
|
|
849
|
+
message: `AgentOps.exportJavaAgents: end`,
|
|
850
|
+
state
|
|
851
|
+
});
|
|
757
852
|
return exportData;
|
|
758
853
|
}
|
|
759
854
|
|
|
@@ -764,7 +859,10 @@ export async function exportJavaAgents({
|
|
|
764
859
|
export async function exportWebAgents({
|
|
765
860
|
state
|
|
766
861
|
}) {
|
|
767
|
-
debugMessage(
|
|
862
|
+
debugMessage({
|
|
863
|
+
message: `AgentOps.exportWebAgents: start`,
|
|
864
|
+
state
|
|
865
|
+
});
|
|
768
866
|
const exportData = createAgentExportTemplate();
|
|
769
867
|
const agents = await getWebAgents({
|
|
770
868
|
state
|
|
@@ -772,7 +870,10 @@ export async function exportWebAgents({
|
|
|
772
870
|
for (const agent of agents) {
|
|
773
871
|
exportData.agents[agent._id] = agent;
|
|
774
872
|
}
|
|
775
|
-
debugMessage(
|
|
873
|
+
debugMessage({
|
|
874
|
+
message: `AgentOps.exportWebAgents: end`,
|
|
875
|
+
state
|
|
876
|
+
});
|
|
776
877
|
return exportData;
|
|
777
878
|
}
|
|
778
879
|
|
|
@@ -785,14 +886,20 @@ export async function exportAgent({
|
|
|
785
886
|
agentId,
|
|
786
887
|
state
|
|
787
888
|
}) {
|
|
788
|
-
debugMessage(
|
|
889
|
+
debugMessage({
|
|
890
|
+
message: `AgentOps.exportAgent: start`,
|
|
891
|
+
state
|
|
892
|
+
});
|
|
789
893
|
const exportData = createAgentExportTemplate();
|
|
790
894
|
const agentObject = await getAgent({
|
|
791
895
|
agentId,
|
|
792
896
|
state
|
|
793
897
|
});
|
|
794
898
|
exportData.agents[agentId] = agentObject;
|
|
795
|
-
debugMessage(
|
|
899
|
+
debugMessage({
|
|
900
|
+
message: `AgentOps.exportAgent: end`,
|
|
901
|
+
state
|
|
902
|
+
});
|
|
796
903
|
return exportData;
|
|
797
904
|
}
|
|
798
905
|
|
|
@@ -805,14 +912,20 @@ export async function exportIdentityGatewayAgent({
|
|
|
805
912
|
agentId,
|
|
806
913
|
state
|
|
807
914
|
}) {
|
|
808
|
-
debugMessage(
|
|
915
|
+
debugMessage({
|
|
916
|
+
message: `AgentOps.exportIdentityGatewayAgent: start`,
|
|
917
|
+
state
|
|
918
|
+
});
|
|
809
919
|
const exportData = createAgentExportTemplate();
|
|
810
920
|
const agentObject = await getIdentityGatewayAgent({
|
|
811
921
|
gatewayId: agentId,
|
|
812
922
|
state
|
|
813
923
|
});
|
|
814
924
|
exportData.agents[agentId] = agentObject;
|
|
815
|
-
debugMessage(
|
|
925
|
+
debugMessage({
|
|
926
|
+
message: `AgentOps.exportIdentityGatewayAgent: end`,
|
|
927
|
+
state
|
|
928
|
+
});
|
|
816
929
|
return exportData;
|
|
817
930
|
}
|
|
818
931
|
|
|
@@ -825,14 +938,20 @@ export async function exportJavaAgent({
|
|
|
825
938
|
agentId,
|
|
826
939
|
state
|
|
827
940
|
}) {
|
|
828
|
-
debugMessage(
|
|
941
|
+
debugMessage({
|
|
942
|
+
message: `AgentOps.exportJavaAgent: start`,
|
|
943
|
+
state
|
|
944
|
+
});
|
|
829
945
|
const exportData = createAgentExportTemplate();
|
|
830
946
|
const agentObject = await getJavaAgent({
|
|
831
947
|
agentId,
|
|
832
948
|
state
|
|
833
949
|
});
|
|
834
950
|
exportData.agents[agentId] = agentObject;
|
|
835
|
-
debugMessage(
|
|
951
|
+
debugMessage({
|
|
952
|
+
message: `AgentOps.exportJavaAgent: end`,
|
|
953
|
+
state
|
|
954
|
+
});
|
|
836
955
|
return exportData;
|
|
837
956
|
}
|
|
838
957
|
|
|
@@ -845,14 +964,20 @@ export async function exportWebAgent({
|
|
|
845
964
|
agentId,
|
|
846
965
|
state
|
|
847
966
|
}) {
|
|
848
|
-
debugMessage(
|
|
967
|
+
debugMessage({
|
|
968
|
+
message: `AgentOps.exportWebAgent: start`,
|
|
969
|
+
state
|
|
970
|
+
});
|
|
849
971
|
const exportData = createAgentExportTemplate();
|
|
850
972
|
const agentObject = await getWebAgent({
|
|
851
973
|
agentId,
|
|
852
974
|
state
|
|
853
975
|
});
|
|
854
976
|
exportData.agents[agentId] = agentObject;
|
|
855
|
-
debugMessage(
|
|
977
|
+
debugMessage({
|
|
978
|
+
message: `AgentOps.exportWebAgent: end`,
|
|
979
|
+
state
|
|
980
|
+
});
|
|
856
981
|
return exportData;
|
|
857
982
|
}
|
|
858
983
|
|
|
@@ -864,11 +989,17 @@ export async function importAgents({
|
|
|
864
989
|
importData,
|
|
865
990
|
state
|
|
866
991
|
}) {
|
|
867
|
-
debugMessage(
|
|
992
|
+
debugMessage({
|
|
993
|
+
message: `AgentOps.importAgents: start`,
|
|
994
|
+
state
|
|
995
|
+
});
|
|
868
996
|
if (validateImport(importData.meta)) {
|
|
869
997
|
for (const agentId of Object.keys(importData.agents)) {
|
|
870
998
|
const agentType = importData.agents[agentId]._type._id;
|
|
871
|
-
debugMessage(
|
|
999
|
+
debugMessage({
|
|
1000
|
+
message: `AgentOps.importAgents: ${agentId} [${agentType}]`,
|
|
1001
|
+
state
|
|
1002
|
+
});
|
|
872
1003
|
await putAgentByTypeAndId({
|
|
873
1004
|
agentType,
|
|
874
1005
|
agentId,
|
|
@@ -879,7 +1010,10 @@ export async function importAgents({
|
|
|
879
1010
|
} else {
|
|
880
1011
|
throw new Error('Invalid meta data.');
|
|
881
1012
|
}
|
|
882
|
-
debugMessage(
|
|
1013
|
+
debugMessage({
|
|
1014
|
+
message: `AgentOps.importAgents: end`,
|
|
1015
|
+
state
|
|
1016
|
+
});
|
|
883
1017
|
}
|
|
884
1018
|
|
|
885
1019
|
/**
|
|
@@ -890,11 +1024,14 @@ export async function importIdentityGatewayAgents({
|
|
|
890
1024
|
importData,
|
|
891
1025
|
state
|
|
892
1026
|
}) {
|
|
893
|
-
debugMessage(
|
|
1027
|
+
debugMessage({
|
|
1028
|
+
message: `AgentOps.importIdentityGatewayAgents: start`,
|
|
1029
|
+
state
|
|
1030
|
+
});
|
|
894
1031
|
if (validateImport(importData.meta)) {
|
|
895
1032
|
for (const agentId of Object.keys(importData.agents)) {
|
|
896
1033
|
const agentType = importData.agents[agentId]._type._id;
|
|
897
|
-
if (agentType !==
|
|
1034
|
+
if (agentType !== 'IdentityGatewayAgent') throw new Error(`Wrong agent type! Expected 'IdentityGatewayAgent' but got '${agentType}'.`);
|
|
898
1035
|
await putAgentByTypeAndId({
|
|
899
1036
|
agentType,
|
|
900
1037
|
agentId,
|
|
@@ -905,7 +1042,10 @@ export async function importIdentityGatewayAgents({
|
|
|
905
1042
|
} else {
|
|
906
1043
|
throw new Error('Invalid meta data.');
|
|
907
1044
|
}
|
|
908
|
-
debugMessage(
|
|
1045
|
+
debugMessage({
|
|
1046
|
+
message: `AgentOps.importIdentityGatewayAgents: end`,
|
|
1047
|
+
state
|
|
1048
|
+
});
|
|
909
1049
|
}
|
|
910
1050
|
|
|
911
1051
|
/**
|
|
@@ -916,11 +1056,14 @@ export async function importJavaAgents({
|
|
|
916
1056
|
importData,
|
|
917
1057
|
state
|
|
918
1058
|
}) {
|
|
919
|
-
debugMessage(
|
|
1059
|
+
debugMessage({
|
|
1060
|
+
message: `AgentOps.importJavaAgents: start`,
|
|
1061
|
+
state
|
|
1062
|
+
});
|
|
920
1063
|
if (validateImport(importData.meta)) {
|
|
921
1064
|
for (const agentId of Object.keys(importData.agents)) {
|
|
922
1065
|
const agentType = importData.agents[agentId]._type._id;
|
|
923
|
-
if (agentType !==
|
|
1066
|
+
if (agentType !== 'J2EEAgent') throw new Error(`Wrong agent type! Expected 'J2EEAgent' but got '${agentType}'.`);
|
|
924
1067
|
await putAgentByTypeAndId({
|
|
925
1068
|
agentType,
|
|
926
1069
|
agentId,
|
|
@@ -931,7 +1074,10 @@ export async function importJavaAgents({
|
|
|
931
1074
|
} else {
|
|
932
1075
|
throw new Error('Invalid meta data.');
|
|
933
1076
|
}
|
|
934
|
-
debugMessage(
|
|
1077
|
+
debugMessage({
|
|
1078
|
+
message: `AgentOps.importJavaAgents: end`,
|
|
1079
|
+
state
|
|
1080
|
+
});
|
|
935
1081
|
}
|
|
936
1082
|
|
|
937
1083
|
/**
|
|
@@ -942,11 +1088,14 @@ export async function importWebAgents({
|
|
|
942
1088
|
importData,
|
|
943
1089
|
state
|
|
944
1090
|
}) {
|
|
945
|
-
debugMessage(
|
|
1091
|
+
debugMessage({
|
|
1092
|
+
message: `AgentOps.importWebAgents: start`,
|
|
1093
|
+
state
|
|
1094
|
+
});
|
|
946
1095
|
if (validateImport(importData.meta)) {
|
|
947
1096
|
for (const agentId of Object.keys(importData.agents)) {
|
|
948
1097
|
const agentType = importData.agents[agentId]._type._id;
|
|
949
|
-
if (agentType !==
|
|
1098
|
+
if (agentType !== 'WebAgent') throw new Error(`Wrong agent type! Expected 'WebAgent' but got '${agentType}'.`);
|
|
950
1099
|
await putAgentByTypeAndId({
|
|
951
1100
|
agentType,
|
|
952
1101
|
agentId,
|
|
@@ -957,7 +1106,10 @@ export async function importWebAgents({
|
|
|
957
1106
|
} else {
|
|
958
1107
|
throw new Error('Invalid meta data.');
|
|
959
1108
|
}
|
|
960
|
-
debugMessage(
|
|
1109
|
+
debugMessage({
|
|
1110
|
+
message: `AgentOps.importWebAgents: end`,
|
|
1111
|
+
state
|
|
1112
|
+
});
|
|
961
1113
|
}
|
|
962
1114
|
|
|
963
1115
|
/**
|
|
@@ -971,7 +1123,10 @@ export async function importAgent({
|
|
|
971
1123
|
importData,
|
|
972
1124
|
state
|
|
973
1125
|
}) {
|
|
974
|
-
debugMessage(
|
|
1126
|
+
debugMessage({
|
|
1127
|
+
message: `AgentOps.importAgent: start`,
|
|
1128
|
+
state
|
|
1129
|
+
});
|
|
975
1130
|
if (validateImport(importData.meta)) {
|
|
976
1131
|
var _importData$agents$ag;
|
|
977
1132
|
const agentType = (_importData$agents$ag = importData.agents[agentId]) === null || _importData$agents$ag === void 0 ? void 0 : _importData$agents$ag._type._id;
|
|
@@ -981,7 +1136,10 @@ export async function importAgent({
|
|
|
981
1136
|
agentData: importData.agents[agentId],
|
|
982
1137
|
state
|
|
983
1138
|
});
|
|
984
|
-
debugMessage(
|
|
1139
|
+
debugMessage({
|
|
1140
|
+
message: `AgentOps.importAgent: end`,
|
|
1141
|
+
state
|
|
1142
|
+
});
|
|
985
1143
|
return result;
|
|
986
1144
|
} else {
|
|
987
1145
|
throw new Error('Invalid meta data.');
|
|
@@ -999,18 +1157,24 @@ export async function importIdentityGatewayAgent({
|
|
|
999
1157
|
importData,
|
|
1000
1158
|
state
|
|
1001
1159
|
}) {
|
|
1002
|
-
debugMessage(
|
|
1160
|
+
debugMessage({
|
|
1161
|
+
message: `AgentOps.importIdentityGatewayAgent: start`,
|
|
1162
|
+
state
|
|
1163
|
+
});
|
|
1003
1164
|
if (validateImport(importData.meta)) {
|
|
1004
1165
|
var _importData$agents$ag2;
|
|
1005
1166
|
const agentType = (_importData$agents$ag2 = importData.agents[agentId]) === null || _importData$agents$ag2 === void 0 ? void 0 : _importData$agents$ag2._type._id;
|
|
1006
|
-
if (agentType !==
|
|
1167
|
+
if (agentType !== 'IdentityGatewayAgent') throw new Error(`Wrong agent type! Expected 'IdentityGatewayAgent' but got '${agentType}'.`);
|
|
1007
1168
|
const result = await putAgentByTypeAndId({
|
|
1008
1169
|
agentType,
|
|
1009
1170
|
agentId,
|
|
1010
1171
|
agentData: importData.agents[agentId],
|
|
1011
1172
|
state
|
|
1012
1173
|
});
|
|
1013
|
-
debugMessage(
|
|
1174
|
+
debugMessage({
|
|
1175
|
+
message: `AgentOps.importIdentityGatewayAgent: end`,
|
|
1176
|
+
state
|
|
1177
|
+
});
|
|
1014
1178
|
return result;
|
|
1015
1179
|
} else {
|
|
1016
1180
|
throw new Error('Invalid meta data.');
|
|
@@ -1028,18 +1192,24 @@ export async function importJavaAgent({
|
|
|
1028
1192
|
importData,
|
|
1029
1193
|
state
|
|
1030
1194
|
}) {
|
|
1031
|
-
debugMessage(
|
|
1195
|
+
debugMessage({
|
|
1196
|
+
message: `AgentOps.importJavaAgent: start`,
|
|
1197
|
+
state
|
|
1198
|
+
});
|
|
1032
1199
|
if (validateImport(importData.meta)) {
|
|
1033
1200
|
var _importData$agents$ag3;
|
|
1034
1201
|
const agentType = (_importData$agents$ag3 = importData.agents[agentId]) === null || _importData$agents$ag3 === void 0 ? void 0 : _importData$agents$ag3._type._id;
|
|
1035
|
-
if (agentType !==
|
|
1202
|
+
if (agentType !== 'J2EEAgent') throw new Error(`Wrong agent type! Expected 'J2EEAgent' but got '${agentType}'.`);
|
|
1036
1203
|
const result = await putAgentByTypeAndId({
|
|
1037
1204
|
agentType,
|
|
1038
1205
|
agentId,
|
|
1039
1206
|
agentData: importData.agents[agentId],
|
|
1040
1207
|
state
|
|
1041
1208
|
});
|
|
1042
|
-
debugMessage(
|
|
1209
|
+
debugMessage({
|
|
1210
|
+
message: `AgentOps.importJavaAgent: end`,
|
|
1211
|
+
state
|
|
1212
|
+
});
|
|
1043
1213
|
return result;
|
|
1044
1214
|
} else {
|
|
1045
1215
|
throw new Error('Invalid meta data.');
|
|
@@ -1057,18 +1227,24 @@ export async function importWebAgent({
|
|
|
1057
1227
|
importData,
|
|
1058
1228
|
state
|
|
1059
1229
|
}) {
|
|
1060
|
-
debugMessage(
|
|
1230
|
+
debugMessage({
|
|
1231
|
+
message: `AgentOps.importWebAgent: start`,
|
|
1232
|
+
state
|
|
1233
|
+
});
|
|
1061
1234
|
if (validateImport(importData.meta)) {
|
|
1062
1235
|
var _importData$agents$ag4;
|
|
1063
1236
|
const agentType = (_importData$agents$ag4 = importData.agents[agentId]) === null || _importData$agents$ag4 === void 0 ? void 0 : _importData$agents$ag4._type._id;
|
|
1064
|
-
if (agentType !==
|
|
1237
|
+
if (agentType !== 'WebAgent') throw new Error(`Wrong agent type! Expected 'WebAgent' but got '${agentType}'.`);
|
|
1065
1238
|
const result = await putAgentByTypeAndId({
|
|
1066
1239
|
agentType,
|
|
1067
1240
|
agentId,
|
|
1068
1241
|
agentData: importData.agents[agentId],
|
|
1069
1242
|
state
|
|
1070
1243
|
});
|
|
1071
|
-
debugMessage(
|
|
1244
|
+
debugMessage({
|
|
1245
|
+
message: `AgentOps.importWebAgent: end`,
|
|
1246
|
+
state
|
|
1247
|
+
});
|
|
1072
1248
|
return result;
|
|
1073
1249
|
} else {
|
|
1074
1250
|
throw new Error('Invalid meta data.');
|
|
@@ -1081,19 +1257,28 @@ export async function importWebAgent({
|
|
|
1081
1257
|
export async function deleteAgents({
|
|
1082
1258
|
state
|
|
1083
1259
|
}) {
|
|
1084
|
-
debugMessage(
|
|
1260
|
+
debugMessage({
|
|
1261
|
+
message: `AgentOps.deleteAgents: start`,
|
|
1262
|
+
state
|
|
1263
|
+
});
|
|
1085
1264
|
const agents = await getAgents({
|
|
1086
1265
|
state
|
|
1087
1266
|
});
|
|
1088
1267
|
for (const agent of agents) {
|
|
1089
|
-
debugMessage(
|
|
1268
|
+
debugMessage({
|
|
1269
|
+
message: `AgentOps.deleteAgent: '${agent['_id']}'`,
|
|
1270
|
+
state
|
|
1271
|
+
});
|
|
1090
1272
|
await deleteAgentByTypeAndId({
|
|
1091
1273
|
agentType: agent['_type']['_id'],
|
|
1092
1274
|
agentId: agent['_id'],
|
|
1093
1275
|
state
|
|
1094
1276
|
});
|
|
1095
1277
|
}
|
|
1096
|
-
debugMessage(
|
|
1278
|
+
debugMessage({
|
|
1279
|
+
message: `AgentOps.deleteAgents: end`,
|
|
1280
|
+
state
|
|
1281
|
+
});
|
|
1097
1282
|
}
|
|
1098
1283
|
|
|
1099
1284
|
/**
|
|
@@ -1104,14 +1289,20 @@ export async function deleteAgent({
|
|
|
1104
1289
|
agentId,
|
|
1105
1290
|
state
|
|
1106
1291
|
}) {
|
|
1107
|
-
debugMessage(
|
|
1292
|
+
debugMessage({
|
|
1293
|
+
message: `AgentOps.deleteAgent: start`,
|
|
1294
|
+
state
|
|
1295
|
+
});
|
|
1108
1296
|
const agents = await findAgentById({
|
|
1109
1297
|
agentId,
|
|
1110
1298
|
state
|
|
1111
1299
|
});
|
|
1112
1300
|
if (agents.length) {
|
|
1113
1301
|
for (const agent of agents) {
|
|
1114
|
-
debugMessage(
|
|
1302
|
+
debugMessage({
|
|
1303
|
+
message: `AgentOps.deleteAgent: '${agent['_id']}'`,
|
|
1304
|
+
state
|
|
1305
|
+
});
|
|
1115
1306
|
await deleteAgentByTypeAndId({
|
|
1116
1307
|
agentType: agent['_type'],
|
|
1117
1308
|
agentId: agent['_id'],
|
|
@@ -1121,7 +1312,10 @@ export async function deleteAgent({
|
|
|
1121
1312
|
} else {
|
|
1122
1313
|
throw new Error(`Agent '${agentId}' not found!`);
|
|
1123
1314
|
}
|
|
1124
|
-
debugMessage(
|
|
1315
|
+
debugMessage({
|
|
1316
|
+
message: `AgentOps.deleteAgent: end`,
|
|
1317
|
+
state
|
|
1318
|
+
});
|
|
1125
1319
|
}
|
|
1126
1320
|
|
|
1127
1321
|
/**
|
|
@@ -1130,19 +1324,28 @@ export async function deleteAgent({
|
|
|
1130
1324
|
export async function deleteIdentityGatewayAgents({
|
|
1131
1325
|
state
|
|
1132
1326
|
}) {
|
|
1133
|
-
debugMessage(
|
|
1327
|
+
debugMessage({
|
|
1328
|
+
message: `AgentOps.deleteIdentityGatewayAgents: start`,
|
|
1329
|
+
state
|
|
1330
|
+
});
|
|
1134
1331
|
const agents = await getIdentityGatewayAgents({
|
|
1135
1332
|
state
|
|
1136
1333
|
});
|
|
1137
1334
|
for (const agent of agents) {
|
|
1138
|
-
debugMessage(
|
|
1335
|
+
debugMessage({
|
|
1336
|
+
message: `AgentOps.deleteIdentityGatewayAgent: '${agent['_id']}'`,
|
|
1337
|
+
state
|
|
1338
|
+
});
|
|
1139
1339
|
await deleteAgentByTypeAndId({
|
|
1140
1340
|
agentType: agent['_type']['_id'],
|
|
1141
1341
|
agentId: agent['_id'],
|
|
1142
1342
|
state
|
|
1143
1343
|
});
|
|
1144
1344
|
}
|
|
1145
|
-
debugMessage(
|
|
1345
|
+
debugMessage({
|
|
1346
|
+
message: `AgentOps.deleteIdentityGatewayAgents: end`,
|
|
1347
|
+
state
|
|
1348
|
+
});
|
|
1146
1349
|
}
|
|
1147
1350
|
|
|
1148
1351
|
/**
|
|
@@ -1153,15 +1356,21 @@ export async function deleteIdentityGatewayAgent({
|
|
|
1153
1356
|
agentId,
|
|
1154
1357
|
state
|
|
1155
1358
|
}) {
|
|
1156
|
-
debugMessage(
|
|
1359
|
+
debugMessage({
|
|
1360
|
+
message: `AgentOps.deleteIdentityGatewayAgent: start`,
|
|
1361
|
+
state
|
|
1362
|
+
});
|
|
1157
1363
|
const agents = await findAgentByTypeAndId({
|
|
1158
|
-
agentType:
|
|
1364
|
+
agentType: 'IdentityGatewayAgent',
|
|
1159
1365
|
agentId,
|
|
1160
1366
|
state
|
|
1161
1367
|
});
|
|
1162
1368
|
if (agents.length) {
|
|
1163
1369
|
for (const agent of agents) {
|
|
1164
|
-
debugMessage(
|
|
1370
|
+
debugMessage({
|
|
1371
|
+
message: `AgentOps.deleteIdentityGatewayAgent: '${agent['_id']}'`,
|
|
1372
|
+
state
|
|
1373
|
+
});
|
|
1165
1374
|
await deleteAgentByTypeAndId({
|
|
1166
1375
|
agentType: agent['_type']['_id'],
|
|
1167
1376
|
agentId: agent['_id'],
|
|
@@ -1171,7 +1380,10 @@ export async function deleteIdentityGatewayAgent({
|
|
|
1171
1380
|
} else {
|
|
1172
1381
|
throw new Error(`Identity gateway agent '${agentId}' not found!`);
|
|
1173
1382
|
}
|
|
1174
|
-
debugMessage(
|
|
1383
|
+
debugMessage({
|
|
1384
|
+
message: `AgentOps.deleteIdentityGatewayAgent: end`,
|
|
1385
|
+
state
|
|
1386
|
+
});
|
|
1175
1387
|
}
|
|
1176
1388
|
|
|
1177
1389
|
/**
|
|
@@ -1180,19 +1392,28 @@ export async function deleteIdentityGatewayAgent({
|
|
|
1180
1392
|
export async function deleteJavaAgents({
|
|
1181
1393
|
state
|
|
1182
1394
|
}) {
|
|
1183
|
-
debugMessage(
|
|
1395
|
+
debugMessage({
|
|
1396
|
+
message: `AgentOps.deleteJavaAgents: start`,
|
|
1397
|
+
state
|
|
1398
|
+
});
|
|
1184
1399
|
const agents = await getJavaAgents({
|
|
1185
1400
|
state
|
|
1186
1401
|
});
|
|
1187
1402
|
for (const agent of agents) {
|
|
1188
|
-
debugMessage(
|
|
1403
|
+
debugMessage({
|
|
1404
|
+
message: `AgentOps.deleteJavaAgent: '${agent['_id']}'`,
|
|
1405
|
+
state
|
|
1406
|
+
});
|
|
1189
1407
|
await deleteAgentByTypeAndId({
|
|
1190
1408
|
agentType: agent['_type']['_id'],
|
|
1191
1409
|
agentId: agent['_id'],
|
|
1192
1410
|
state
|
|
1193
1411
|
});
|
|
1194
1412
|
}
|
|
1195
|
-
debugMessage(
|
|
1413
|
+
debugMessage({
|
|
1414
|
+
message: `AgentOps.deleteJavaAgents: end`,
|
|
1415
|
+
state
|
|
1416
|
+
});
|
|
1196
1417
|
}
|
|
1197
1418
|
|
|
1198
1419
|
/**
|
|
@@ -1203,15 +1424,21 @@ export async function deleteJavaAgent({
|
|
|
1203
1424
|
agentId,
|
|
1204
1425
|
state
|
|
1205
1426
|
}) {
|
|
1206
|
-
debugMessage(
|
|
1427
|
+
debugMessage({
|
|
1428
|
+
message: `AgentOps.deleteJavaAgent: start`,
|
|
1429
|
+
state
|
|
1430
|
+
});
|
|
1207
1431
|
const agents = await findAgentByTypeAndId({
|
|
1208
|
-
agentType:
|
|
1432
|
+
agentType: 'J2EEAgent',
|
|
1209
1433
|
agentId,
|
|
1210
1434
|
state
|
|
1211
1435
|
});
|
|
1212
1436
|
if (agents.length) {
|
|
1213
1437
|
for (const agent of agents) {
|
|
1214
|
-
debugMessage(
|
|
1438
|
+
debugMessage({
|
|
1439
|
+
message: `AgentOps.deleteJavaAgent: '${agent['_id']}'`,
|
|
1440
|
+
state
|
|
1441
|
+
});
|
|
1215
1442
|
await deleteAgentByTypeAndId({
|
|
1216
1443
|
agentType: agent['_type']['_id'],
|
|
1217
1444
|
agentId: agent['_id'],
|
|
@@ -1221,7 +1448,10 @@ export async function deleteJavaAgent({
|
|
|
1221
1448
|
} else {
|
|
1222
1449
|
throw new Error(`Java agent '${agentId}' not found!`);
|
|
1223
1450
|
}
|
|
1224
|
-
debugMessage(
|
|
1451
|
+
debugMessage({
|
|
1452
|
+
message: `AgentOps.deleteJavaAgent: end`,
|
|
1453
|
+
state
|
|
1454
|
+
});
|
|
1225
1455
|
}
|
|
1226
1456
|
|
|
1227
1457
|
/**
|
|
@@ -1230,19 +1460,28 @@ export async function deleteJavaAgent({
|
|
|
1230
1460
|
export async function deleteWebAgents({
|
|
1231
1461
|
state
|
|
1232
1462
|
}) {
|
|
1233
|
-
debugMessage(
|
|
1463
|
+
debugMessage({
|
|
1464
|
+
message: `AgentOps.deleteWebAgents: start`,
|
|
1465
|
+
state
|
|
1466
|
+
});
|
|
1234
1467
|
const agents = await getWebAgents({
|
|
1235
1468
|
state
|
|
1236
1469
|
});
|
|
1237
1470
|
for (const agent of agents) {
|
|
1238
|
-
debugMessage(
|
|
1471
|
+
debugMessage({
|
|
1472
|
+
message: `AgentOps.deleteWebAgent: '${agent['_id']}'`,
|
|
1473
|
+
state
|
|
1474
|
+
});
|
|
1239
1475
|
await deleteAgentByTypeAndId({
|
|
1240
1476
|
agentType: agent['_type']['_id'],
|
|
1241
1477
|
agentId: agent['_id'],
|
|
1242
1478
|
state
|
|
1243
1479
|
});
|
|
1244
1480
|
}
|
|
1245
|
-
debugMessage(
|
|
1481
|
+
debugMessage({
|
|
1482
|
+
message: `AgentOps.deleteWebAgents: end`,
|
|
1483
|
+
state
|
|
1484
|
+
});
|
|
1246
1485
|
}
|
|
1247
1486
|
|
|
1248
1487
|
/**
|
|
@@ -1253,15 +1492,21 @@ export async function deleteWebAgent({
|
|
|
1253
1492
|
agentId,
|
|
1254
1493
|
state
|
|
1255
1494
|
}) {
|
|
1256
|
-
debugMessage(
|
|
1495
|
+
debugMessage({
|
|
1496
|
+
message: `AgentOps.deleteWebAgent: start`,
|
|
1497
|
+
state
|
|
1498
|
+
});
|
|
1257
1499
|
const agents = await findAgentByTypeAndId({
|
|
1258
|
-
agentType:
|
|
1500
|
+
agentType: 'WebAgent',
|
|
1259
1501
|
agentId,
|
|
1260
1502
|
state
|
|
1261
1503
|
});
|
|
1262
1504
|
if (agents.length) {
|
|
1263
1505
|
for (const agent of agents) {
|
|
1264
|
-
debugMessage(
|
|
1506
|
+
debugMessage({
|
|
1507
|
+
message: `AgentOps.deleteWebAgent: '${agent['_id']}'`,
|
|
1508
|
+
state
|
|
1509
|
+
});
|
|
1265
1510
|
await deleteAgentByTypeAndId({
|
|
1266
1511
|
agentType: agent['_type']['_id'],
|
|
1267
1512
|
agentId: agent['_id'],
|
|
@@ -1271,6 +1516,9 @@ export async function deleteWebAgent({
|
|
|
1271
1516
|
} else {
|
|
1272
1517
|
throw new Error(`Web agent '${agentId}' not found!`);
|
|
1273
1518
|
}
|
|
1274
|
-
debugMessage(
|
|
1519
|
+
debugMessage({
|
|
1520
|
+
message: `AgentOps.deleteWebAgent: end`,
|
|
1521
|
+
state
|
|
1522
|
+
});
|
|
1275
1523
|
}
|
|
1276
1524
|
//# sourceMappingURL=AgentOps.js.map
|