@rockcarver/frodo-lib 0.16.2-2 → 0.16.2-3

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/cjs/api/AgentApi.js +221 -0
  3. package/cjs/api/AgentApi.js.map +1 -0
  4. package/cjs/api/AgentApi.test.js.map +1 -0
  5. package/cjs/api/ApiTypes.js.map +1 -1
  6. package/cjs/api/BaseApi.js +15 -11
  7. package/cjs/api/BaseApi.js.map +1 -1
  8. package/cjs/index.js +5 -1
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/ops/AgentOps.js +805 -0
  11. package/cjs/ops/AgentOps.js.map +1 -0
  12. package/cjs/ops/AgentOps.test.js.map +1 -0
  13. package/cjs/ops/AuthenticateOps.js +8 -8
  14. package/cjs/ops/AuthenticateOps.js.map +1 -1
  15. package/cjs/ops/JourneyOps.test.js.map +1 -1
  16. package/cjs/ops/OpsTypes.js.map +1 -1
  17. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +22 -0
  18. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/api_client.json +22 -0
  19. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json +22 -0
  20. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json +32 -0
  21. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/J2EEAgent/javaAgent.json +623 -0
  22. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/J2EEAgent/tomcatagent.json +630 -0
  23. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/WebAgent/apacheagent.json +456 -0
  24. package/cjs/test/mocks/AgentApi/deleteAgentByTypeAndId/WebAgent/webserver.json +455 -0
  25. package/cjs/test/mocks/AgentApi/findAgentById/ajays_client.json +19 -0
  26. package/cjs/test/mocks/AgentApi/findAgentById/apacheagent.json +142 -0
  27. package/cjs/test/mocks/AgentApi/findAgentById/api_client.json +19 -0
  28. package/cjs/test/mocks/AgentApi/findAgentById/ig_chico.json +19 -0
  29. package/cjs/test/mocks/AgentApi/findAgentById/ig_mytestrun_com.json +29 -0
  30. package/cjs/test/mocks/AgentApi/findAgentById/javaAgent.json +190 -0
  31. package/cjs/test/mocks/AgentApi/findAgentById/tomcatagent.json +191 -0
  32. package/cjs/test/mocks/AgentApi/findAgentById/webserver.json +144 -0
  33. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +23 -0
  34. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/api_client.json +22 -0
  35. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json +22 -0
  36. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json +33 -0
  37. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/J2EEAgent/javaAgent.json +193 -0
  38. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/J2EEAgent/tomcatagent.json +195 -0
  39. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/WebAgent/apacheagent.json +145 -0
  40. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/WebAgent/webserver.json +148 -0
  41. package/cjs/test/mocks/AgentApi/findAgentByTypeAndId/not_found.json +8 -0
  42. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +22 -0
  43. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/api_client.json +22 -0
  44. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json +22 -0
  45. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json +32 -0
  46. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/javaAgent.json +623 -0
  47. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/tomcatagent.json +630 -0
  48. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/apacheagent.json +456 -0
  49. package/cjs/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/webserver.json +455 -0
  50. package/cjs/test/mocks/AgentApi/getAgentTypes/agentTypes.json +54 -0
  51. package/cjs/test/mocks/AgentApi/getAgents/agents.json +3862 -0
  52. package/cjs/test/mocks/AgentApi/getAgentsByType/IdentityGatewayAgents.json +73 -0
  53. package/cjs/test/mocks/AgentApi/getAgentsByType/J2EEAgents.json +379 -0
  54. package/cjs/test/mocks/AgentApi/getAgentsByType/WebAgents.json +284 -0
  55. package/cjs/test/mocks/ForgeRockApiMockEngine.js +147 -20
  56. package/cjs/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
  57. package/esm/api/AgentApi.mjs +164 -0
  58. package/esm/api/AgentApi.test.mjs +267 -0
  59. package/esm/api/BaseApi.mjs +16 -4
  60. package/esm/index.mjs +2 -0
  61. package/esm/ops/AgentOps.mjs +576 -0
  62. package/esm/ops/AgentOps.test.mjs +1212 -0
  63. package/esm/ops/AuthenticateOps.mjs +8 -8
  64. package/esm/ops/JourneyOps.test.mjs +4 -8
  65. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +22 -0
  66. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/api_client.json +22 -0
  67. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json +22 -0
  68. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json +32 -0
  69. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/J2EEAgent/javaAgent.json +623 -0
  70. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/J2EEAgent/tomcatagent.json +630 -0
  71. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/WebAgent/apacheagent.json +456 -0
  72. package/esm/test/mocks/AgentApi/deleteAgentByTypeAndId/WebAgent/webserver.json +455 -0
  73. package/esm/test/mocks/AgentApi/findAgentById/ajays_client.json +19 -0
  74. package/esm/test/mocks/AgentApi/findAgentById/apacheagent.json +142 -0
  75. package/esm/test/mocks/AgentApi/findAgentById/api_client.json +19 -0
  76. package/esm/test/mocks/AgentApi/findAgentById/ig_chico.json +19 -0
  77. package/esm/test/mocks/AgentApi/findAgentById/ig_mytestrun_com.json +29 -0
  78. package/esm/test/mocks/AgentApi/findAgentById/javaAgent.json +190 -0
  79. package/esm/test/mocks/AgentApi/findAgentById/tomcatagent.json +191 -0
  80. package/esm/test/mocks/AgentApi/findAgentById/webserver.json +144 -0
  81. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +23 -0
  82. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/api_client.json +22 -0
  83. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json +22 -0
  84. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json +33 -0
  85. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/J2EEAgent/javaAgent.json +193 -0
  86. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/J2EEAgent/tomcatagent.json +195 -0
  87. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/WebAgent/apacheagent.json +145 -0
  88. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/WebAgent/webserver.json +148 -0
  89. package/esm/test/mocks/AgentApi/findAgentByTypeAndId/not_found.json +8 -0
  90. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ajays_client.json +22 -0
  91. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/api_client.json +22 -0
  92. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ig_chico.json +22 -0
  93. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/IdentityGatewayAgent/ig_mytestrun_com.json +32 -0
  94. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/javaAgent.json +623 -0
  95. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/J2EEAgent/tomcatagent.json +630 -0
  96. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/apacheagent.json +456 -0
  97. package/esm/test/mocks/AgentApi/getAgentByTypeAndId/WebAgent/webserver.json +455 -0
  98. package/esm/test/mocks/AgentApi/getAgentTypes/agentTypes.json +54 -0
  99. package/esm/test/mocks/AgentApi/getAgents/agents.json +3862 -0
  100. package/esm/test/mocks/AgentApi/getAgentsByType/IdentityGatewayAgents.json +73 -0
  101. package/esm/test/mocks/AgentApi/getAgentsByType/J2EEAgents.json +379 -0
  102. package/esm/test/mocks/AgentApi/getAgentsByType/WebAgents.json +284 -0
  103. package/esm/test/mocks/ForgeRockApiMockEngine.mjs +136 -20
  104. package/package.json +2 -2
  105. package/types/api/AgentApi.d.ts +51 -0
  106. package/types/api/AgentApi.d.ts.map +1 -0
  107. package/types/api/ApiTypes.d.ts +3 -0
  108. package/types/api/ApiTypes.d.ts.map +1 -1
  109. package/types/api/BaseApi.d.ts.map +1 -1
  110. package/types/index.d.ts +2 -0
  111. package/types/index.d.ts.map +1 -1
  112. package/types/ops/AgentOps.d.ts +210 -0
  113. package/types/ops/AgentOps.d.ts.map +1 -0
  114. package/types/ops/AuthenticateOps.d.ts.map +1 -1
  115. package/types/ops/OpsTypes.d.ts +5 -1
  116. package/types/ops/OpsTypes.d.ts.map +1 -1
  117. package/types/test/mocks/ForgeRockApiMockEngine.d.ts +35 -2
  118. package/types/test/mocks/ForgeRockApiMockEngine.d.ts.map +1 -1
@@ -0,0 +1,805 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AGENT_TYPE_WEB = exports.AGENT_TYPE_JAVA = exports.AGENT_TYPE_IG = void 0;
7
+ exports.createAgentExportTemplate = createAgentExportTemplate;
8
+ exports.deleteAgent = deleteAgent;
9
+ exports.deleteAgents = deleteAgents;
10
+ exports.deleteIdentityGatewayAgent = deleteIdentityGatewayAgent;
11
+ exports.deleteIdentityGatewayAgents = deleteIdentityGatewayAgents;
12
+ exports.deleteJavaAgent = deleteJavaAgent;
13
+ exports.deleteJavaAgents = deleteJavaAgents;
14
+ exports.deleteWebAgent = deleteWebAgent;
15
+ exports.deleteWebAgents = deleteWebAgents;
16
+ exports.exportAgent = exportAgent;
17
+ exports.exportAgents = exportAgents;
18
+ exports.exportIdentityGatewayAgent = exportIdentityGatewayAgent;
19
+ exports.exportIdentityGatewayAgents = exportIdentityGatewayAgents;
20
+ exports.exportJavaAgent = exportJavaAgent;
21
+ exports.exportJavaAgents = exportJavaAgents;
22
+ exports.exportWebAgent = exportWebAgent;
23
+ exports.exportWebAgents = exportWebAgents;
24
+ exports.getAgent = getAgent;
25
+ exports.getAgentByTypeAndId = getAgentByTypeAndId;
26
+ exports.getAgents = getAgents;
27
+ exports.getIdentityGatewayAgent = getIdentityGatewayAgent;
28
+ exports.getIdentityGatewayAgents = getIdentityGatewayAgents;
29
+ exports.getJavaAgent = getJavaAgent;
30
+ exports.getJavaAgents = getJavaAgents;
31
+ exports.getWebAgent = getWebAgent;
32
+ exports.getWebAgents = getWebAgents;
33
+ exports.importAgent = importAgent;
34
+ exports.importAgents = importAgents;
35
+ exports.importIdentityGatewayAgent = importIdentityGatewayAgent;
36
+ exports.importIdentityGatewayAgents = importIdentityGatewayAgents;
37
+ exports.importJavaAgent = importJavaAgent;
38
+ exports.importJavaAgents = importJavaAgents;
39
+ exports.importWebAgent = importWebAgent;
40
+ exports.importWebAgents = importWebAgents;
41
+ exports.putIdentityGatewayAgent = putIdentityGatewayAgent;
42
+ exports.putJavaAgent = putJavaAgent;
43
+ exports.putWebAgent = putWebAgent;
44
+ var _Console = require("./utils/Console");
45
+ var _AgentApi = require("../api/AgentApi");
46
+ var _ExportImportUtils = require("./utils/ExportImportUtils");
47
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
48
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
49
+ var AGENT_TYPE_IG = 'IdentityGatewayAgent';
50
+ exports.AGENT_TYPE_IG = AGENT_TYPE_IG;
51
+ var AGENT_TYPE_JAVA = 'J2EEAgent';
52
+ exports.AGENT_TYPE_JAVA = AGENT_TYPE_JAVA;
53
+ var AGENT_TYPE_WEB = 'WebAgent';
54
+
55
+ /**
56
+ * Create an empty single tree export template
57
+ * @returns {SingleTreeExportInterface} an empty single tree export template
58
+ */
59
+ exports.AGENT_TYPE_WEB = AGENT_TYPE_WEB;
60
+ function createAgentExportTemplate() {
61
+ return {
62
+ meta: {},
63
+ agents: {}
64
+ };
65
+ }
66
+
67
+ /**
68
+ * Get all agents. Results are sorted aphabetically.
69
+ * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array of agent objects
70
+ */
71
+ function getAgents() {
72
+ return _getAgents.apply(this, arguments);
73
+ }
74
+ /**
75
+ * Get agent
76
+ * @param {string} agentId agent id/name
77
+ * @returns {Promise} a promise that resolves to an agent object
78
+ */
79
+ function _getAgents() {
80
+ _getAgents = _asyncToGenerator(function* () {
81
+ (0, _Console.debugMessage)("AgentOps.getAgents: start");
82
+ var agents = [];
83
+ try {
84
+ var resolved = yield Promise.all([(0, _AgentApi.getAgentsByType)('IdentityGatewayAgent'), (0, _AgentApi.getAgentsByType)('J2EEAgent'), (0, _AgentApi.getAgentsByType)('WebAgent')]);
85
+ agents = agents.concat(resolved[0].result);
86
+ agents = agents.concat(resolved[1].result);
87
+ agents = agents.concat(resolved[2].result);
88
+ } catch (error) {
89
+ (0, _Console.printMessage)("".concat(error.message), 'error');
90
+ (0, _Console.printMessage)(error.response.data, 'error');
91
+ }
92
+ agents.sort((a, b) => a._id.localeCompare(b._id));
93
+ (0, _Console.debugMessage)("AgentOps.getAgents: end");
94
+ return agents;
95
+ });
96
+ return _getAgents.apply(this, arguments);
97
+ }
98
+ function getAgent(_x) {
99
+ return _getAgent.apply(this, arguments);
100
+ }
101
+ /**
102
+ * Get agent by type and id
103
+ * @param {string} agentType agent type (IdentityGatewayAgent, J2EEAgent, WebAgent)
104
+ * @param {string} agentId agent id/name
105
+ * @returns {Promise} a promise that resolves to an agent object
106
+ */
107
+ function _getAgent() {
108
+ _getAgent = _asyncToGenerator(function* (agentId) {
109
+ (0, _Console.debugMessage)("AgentOps.getAgent: start");
110
+ var agents = yield (0, _AgentApi.findAgentById)(agentId);
111
+ if (agents.length === 1) {
112
+ var result = yield (0, _AgentApi.getAgentByTypeAndId)(agents[0]._type, agents[0]._id);
113
+ (0, _Console.debugMessage)("AgentOps.getAgent: end");
114
+ return result;
115
+ } else if (agents.length === 0) {
116
+ throw new Error("Agent '".concat(agentId, "' not found"));
117
+ } else {
118
+ throw new Error("".concat(agents.length, " agents '").concat(agentId, "' found"));
119
+ }
120
+ });
121
+ return _getAgent.apply(this, arguments);
122
+ }
123
+ function getAgentByTypeAndId(_x2, _x3) {
124
+ return _getAgentByTypeAndId2.apply(this, arguments);
125
+ }
126
+ /**
127
+ * Get identity gateway agents
128
+ * @returns {Promise} a promise that resolves to an array of IdentityGatewayAgent objects
129
+ */
130
+ function _getAgentByTypeAndId2() {
131
+ _getAgentByTypeAndId2 = _asyncToGenerator(function* (agentType, agentId) {
132
+ (0, _Console.debugMessage)("AgentOps.getAgentByTypeAndId: start");
133
+ var result = yield (0, _AgentApi.getAgentByTypeAndId)(agentType, agentId);
134
+ (0, _Console.debugMessage)("AgentOps.getAgentByTypeAndId: start");
135
+ return result;
136
+ });
137
+ return _getAgentByTypeAndId2.apply(this, arguments);
138
+ }
139
+ function getIdentityGatewayAgents() {
140
+ return _getIdentityGatewayAgents.apply(this, arguments);
141
+ }
142
+ /**
143
+ * Get identity gateway agent
144
+ * @param {string} gatewayId gateway id
145
+ * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object
146
+ */
147
+ function _getIdentityGatewayAgents() {
148
+ _getIdentityGatewayAgents = _asyncToGenerator(function* () {
149
+ (0, _Console.debugMessage)("AgentOps.getIdentityGatewayAgents: start");
150
+ var {
151
+ result
152
+ } = yield (0, _AgentApi.getAgentsByType)(AGENT_TYPE_IG);
153
+ (0, _Console.debugMessage)("AgentOps.getIdentityGatewayAgents: end");
154
+ return result;
155
+ });
156
+ return _getIdentityGatewayAgents.apply(this, arguments);
157
+ }
158
+ function getIdentityGatewayAgent(_x4) {
159
+ return _getIdentityGatewayAgent.apply(this, arguments);
160
+ }
161
+ /**
162
+ * Put identity gateway agent
163
+ * @param {string} gatewayId gateway id
164
+ * @param {Object} gatewayData IdentityGatewayAgent object
165
+ * @returns {Promise} a promise that resolves to an object containing an IdentityGatewayAgent object
166
+ */
167
+ function _getIdentityGatewayAgent() {
168
+ _getIdentityGatewayAgent = _asyncToGenerator(function* (gatewayId) {
169
+ (0, _Console.debugMessage)("AgentOps.getIdentityGatewayAgent: start");
170
+ var result = yield getAgentByTypeAndId(AGENT_TYPE_IG, gatewayId);
171
+ (0, _Console.debugMessage)("AgentOps.getIdentityGatewayAgent: end");
172
+ return result;
173
+ });
174
+ return _getIdentityGatewayAgent.apply(this, arguments);
175
+ }
176
+ function putIdentityGatewayAgent(_x5, _x6) {
177
+ return _putIdentityGatewayAgent.apply(this, arguments);
178
+ }
179
+ /**
180
+ * Get java agents
181
+ * @returns {Promise} a promise that resolves to an array of J2EEAgent objects
182
+ */
183
+ function _putIdentityGatewayAgent() {
184
+ _putIdentityGatewayAgent = _asyncToGenerator(function* (gatewayId, gatewayData) {
185
+ (0, _Console.debugMessage)("AgentOps.putIdentityGatewayAgent: start");
186
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(AGENT_TYPE_IG, gatewayId, gatewayData);
187
+ (0, _Console.debugMessage)("AgentOps.putIdentityGatewayAgent: end");
188
+ return result;
189
+ });
190
+ return _putIdentityGatewayAgent.apply(this, arguments);
191
+ }
192
+ function getJavaAgents() {
193
+ return _getJavaAgents.apply(this, arguments);
194
+ }
195
+ /**
196
+ * Get java agent
197
+ * @param {string} agentId java agent id
198
+ * @returns {Promise} a promise that resolves to an object containing an J2EEAgent object
199
+ */
200
+ function _getJavaAgents() {
201
+ _getJavaAgents = _asyncToGenerator(function* () {
202
+ (0, _Console.debugMessage)("AgentOps.getJavaAgents: start");
203
+ var {
204
+ result
205
+ } = yield (0, _AgentApi.getAgentsByType)(AGENT_TYPE_JAVA);
206
+ (0, _Console.debugMessage)("AgentOps.getJavaAgents: end");
207
+ return result;
208
+ });
209
+ return _getJavaAgents.apply(this, arguments);
210
+ }
211
+ function getJavaAgent(_x7) {
212
+ return _getJavaAgent.apply(this, arguments);
213
+ }
214
+ /**
215
+ * Put java agent
216
+ * @param {string} agentId java agent id
217
+ * @param {Object} agentData java agent object
218
+ * @returns {Promise} a promise that resolves to an object containing an java agent object
219
+ */
220
+ function _getJavaAgent() {
221
+ _getJavaAgent = _asyncToGenerator(function* (agentId) {
222
+ (0, _Console.debugMessage)("AgentOps.getJavaAgent: start");
223
+ var result = yield getAgentByTypeAndId(AGENT_TYPE_JAVA, agentId);
224
+ (0, _Console.debugMessage)("AgentOps.getJavaAgent: end");
225
+ return result;
226
+ });
227
+ return _getJavaAgent.apply(this, arguments);
228
+ }
229
+ function putJavaAgent(_x8, _x9) {
230
+ return _putJavaAgent.apply(this, arguments);
231
+ }
232
+ /**
233
+ * Get web agents
234
+ * @returns {Promise} a promise that resolves to an array of WebAgent objects
235
+ */
236
+ function _putJavaAgent() {
237
+ _putJavaAgent = _asyncToGenerator(function* (agentId, agentData) {
238
+ (0, _Console.debugMessage)("AgentOps.putJavaAgent: start");
239
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(AGENT_TYPE_JAVA, agentId, agentData);
240
+ (0, _Console.debugMessage)("AgentOps.putJavaAgent: end");
241
+ return result;
242
+ });
243
+ return _putJavaAgent.apply(this, arguments);
244
+ }
245
+ function getWebAgents() {
246
+ return _getWebAgents.apply(this, arguments);
247
+ }
248
+ /**
249
+ * Get web agent
250
+ * @param {string} agentId web agent id
251
+ * @returns {Promise} a promise that resolves to an object containing an WebAgent object
252
+ */
253
+ function _getWebAgents() {
254
+ _getWebAgents = _asyncToGenerator(function* () {
255
+ (0, _Console.debugMessage)("AgentOps.getWebAgents: start");
256
+ var {
257
+ result
258
+ } = yield (0, _AgentApi.getAgentsByType)(AGENT_TYPE_WEB);
259
+ (0, _Console.debugMessage)("AgentOps.getWebAgents: end");
260
+ return result;
261
+ });
262
+ return _getWebAgents.apply(this, arguments);
263
+ }
264
+ function getWebAgent(_x10) {
265
+ return _getWebAgent.apply(this, arguments);
266
+ }
267
+ /**
268
+ * Put web agent
269
+ * @param {string} agentId web agent id
270
+ * @param {Object} agentData WebAgent object
271
+ * @returns {Promise} a promise that resolves to an object containing an WebAgent object
272
+ */
273
+ function _getWebAgent() {
274
+ _getWebAgent = _asyncToGenerator(function* (agentId) {
275
+ (0, _Console.debugMessage)("AgentOps.getWebAgent: start");
276
+ var result = yield getAgentByTypeAndId(AGENT_TYPE_WEB, agentId);
277
+ (0, _Console.debugMessage)("AgentOps.getWebAgent: end");
278
+ return result;
279
+ });
280
+ return _getWebAgent.apply(this, arguments);
281
+ }
282
+ function putWebAgent(_x11, _x12) {
283
+ return _putWebAgent.apply(this, arguments);
284
+ }
285
+ /**
286
+ * Export all agents. The response can be saved to file as is.
287
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
288
+ */
289
+ function _putWebAgent() {
290
+ _putWebAgent = _asyncToGenerator(function* (agentId, agentData) {
291
+ (0, _Console.debugMessage)("AgentOps.putWebAgent: start");
292
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(AGENT_TYPE_WEB, agentId, agentData);
293
+ (0, _Console.debugMessage)("AgentOps.putWebAgent: end");
294
+ return result;
295
+ });
296
+ return _putWebAgent.apply(this, arguments);
297
+ }
298
+ function exportAgents() {
299
+ return _exportAgents.apply(this, arguments);
300
+ }
301
+ /**
302
+ * Export all identity gateway agents. The response can be saved to file as is.
303
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
304
+ */
305
+ function _exportAgents() {
306
+ _exportAgents = _asyncToGenerator(function* () {
307
+ (0, _Console.debugMessage)("AgentOps.exportAgents: start");
308
+ var exportData = createAgentExportTemplate();
309
+ var agents = yield getAgents();
310
+ for (var agent of agents) {
311
+ exportData.agents[agent._id] = agent;
312
+ }
313
+ (0, _Console.debugMessage)("AgentOps.exportAgents: end");
314
+ return exportData;
315
+ });
316
+ return _exportAgents.apply(this, arguments);
317
+ }
318
+ function exportIdentityGatewayAgents() {
319
+ return _exportIdentityGatewayAgents.apply(this, arguments);
320
+ }
321
+ /**
322
+ * Export all java agents. The response can be saved to file as is.
323
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
324
+ */
325
+ function _exportIdentityGatewayAgents() {
326
+ _exportIdentityGatewayAgents = _asyncToGenerator(function* () {
327
+ (0, _Console.debugMessage)("AgentOps.exportIdentityGatewayAgents: start");
328
+ var exportData = createAgentExportTemplate();
329
+ var agents = yield getIdentityGatewayAgents();
330
+ for (var agent of agents) {
331
+ exportData.agents[agent._id] = agent;
332
+ }
333
+ (0, _Console.debugMessage)("AgentOps.exportIdentityGatewayAgents: end");
334
+ return exportData;
335
+ });
336
+ return _exportIdentityGatewayAgents.apply(this, arguments);
337
+ }
338
+ function exportJavaAgents() {
339
+ return _exportJavaAgents.apply(this, arguments);
340
+ }
341
+ /**
342
+ * Export all web agents. The response can be saved to file as is.
343
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
344
+ */
345
+ function _exportJavaAgents() {
346
+ _exportJavaAgents = _asyncToGenerator(function* () {
347
+ (0, _Console.debugMessage)("AgentOps.exportJavaAgents: start");
348
+ var exportData = createAgentExportTemplate();
349
+ var agents = yield getJavaAgents();
350
+ for (var agent of agents) {
351
+ exportData.agents[agent._id] = agent;
352
+ }
353
+ (0, _Console.debugMessage)("AgentOps.exportJavaAgents: end");
354
+ return exportData;
355
+ });
356
+ return _exportJavaAgents.apply(this, arguments);
357
+ }
358
+ function exportWebAgents() {
359
+ return _exportWebAgents.apply(this, arguments);
360
+ }
361
+ /**
362
+ * Export agent. The response can be saved to file as is.
363
+ * @param agentId agent id/name
364
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
365
+ */
366
+ function _exportWebAgents() {
367
+ _exportWebAgents = _asyncToGenerator(function* () {
368
+ (0, _Console.debugMessage)("AgentOps.exportWebAgents: start");
369
+ var exportData = createAgentExportTemplate();
370
+ var agents = yield getWebAgents();
371
+ for (var agent of agents) {
372
+ exportData.agents[agent._id] = agent;
373
+ }
374
+ (0, _Console.debugMessage)("AgentOps.exportWebAgents: end");
375
+ return exportData;
376
+ });
377
+ return _exportWebAgents.apply(this, arguments);
378
+ }
379
+ function exportAgent(_x13) {
380
+ return _exportAgent.apply(this, arguments);
381
+ }
382
+ /**
383
+ * Export identity gateway agent. The response can be saved to file as is.
384
+ * @param agentId agent id/name
385
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
386
+ */
387
+ function _exportAgent() {
388
+ _exportAgent = _asyncToGenerator(function* (agentId) {
389
+ (0, _Console.debugMessage)("AgentOps.exportAgent: start");
390
+ var exportData = createAgentExportTemplate();
391
+ var agentObject = yield getAgent(agentId);
392
+ exportData.agents[agentId] = agentObject;
393
+ (0, _Console.debugMessage)("AgentOps.exportAgent: end");
394
+ return exportData;
395
+ });
396
+ return _exportAgent.apply(this, arguments);
397
+ }
398
+ function exportIdentityGatewayAgent(_x14) {
399
+ return _exportIdentityGatewayAgent.apply(this, arguments);
400
+ }
401
+ /**
402
+ * Export java agent. The response can be saved to file as is.
403
+ * @param agentId agent id/name
404
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
405
+ */
406
+ function _exportIdentityGatewayAgent() {
407
+ _exportIdentityGatewayAgent = _asyncToGenerator(function* (agentId) {
408
+ (0, _Console.debugMessage)("AgentOps.exportIdentityGatewayAgent: start");
409
+ var exportData = createAgentExportTemplate();
410
+ var agentObject = yield getIdentityGatewayAgent(agentId);
411
+ exportData.agents[agentId] = agentObject;
412
+ (0, _Console.debugMessage)("AgentOps.exportIdentityGatewayAgent: end");
413
+ return exportData;
414
+ });
415
+ return _exportIdentityGatewayAgent.apply(this, arguments);
416
+ }
417
+ function exportJavaAgent(_x15) {
418
+ return _exportJavaAgent.apply(this, arguments);
419
+ }
420
+ /**
421
+ * Export web agent. The response can be saved to file as is.
422
+ * @param agentId agent id/name
423
+ * @returns {Promise<AgentExportInterface} Promise resolving to an AgentExportInterface object.
424
+ */
425
+ function _exportJavaAgent() {
426
+ _exportJavaAgent = _asyncToGenerator(function* (agentId) {
427
+ (0, _Console.debugMessage)("AgentOps.exportJavaAgent: start");
428
+ var exportData = createAgentExportTemplate();
429
+ var agentObject = yield getJavaAgent(agentId);
430
+ exportData.agents[agentId] = agentObject;
431
+ (0, _Console.debugMessage)("AgentOps.exportJavaAgent: end");
432
+ return exportData;
433
+ });
434
+ return _exportJavaAgent.apply(this, arguments);
435
+ }
436
+ function exportWebAgent(_x16) {
437
+ return _exportWebAgent.apply(this, arguments);
438
+ }
439
+ /**
440
+ * Import agents. The import data is usually read from an agent export file.
441
+ * @param {AgentExportInterface} importData agent import data.
442
+ */
443
+ function _exportWebAgent() {
444
+ _exportWebAgent = _asyncToGenerator(function* (agentId) {
445
+ (0, _Console.debugMessage)("AgentOps.exportWebAgent: start");
446
+ var exportData = createAgentExportTemplate();
447
+ var agentObject = yield getWebAgent(agentId);
448
+ exportData.agents[agentId] = agentObject;
449
+ (0, _Console.debugMessage)("AgentOps.exportWebAgent: end");
450
+ return exportData;
451
+ });
452
+ return _exportWebAgent.apply(this, arguments);
453
+ }
454
+ function importAgents(_x17) {
455
+ return _importAgents.apply(this, arguments);
456
+ }
457
+ /**
458
+ * Import identity gateway agents. The import data is usually read from an agent export file.
459
+ * @param {AgentExportInterface} importData agent import data.
460
+ */
461
+ function _importAgents() {
462
+ _importAgents = _asyncToGenerator(function* (importData) {
463
+ (0, _Console.debugMessage)("AgentOps.importAgents: start");
464
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
465
+ for (var agentId of Object.keys(importData.agents)) {
466
+ var agentType = importData.agents[agentId]._type._id;
467
+ (0, _Console.debugMessage)("AgentOps.importAgents: ".concat(agentId, " [").concat(agentType, "]"));
468
+ yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
469
+ }
470
+ } else {
471
+ throw new Error('Invalid meta data.');
472
+ }
473
+ (0, _Console.debugMessage)("AgentOps.importAgents: end");
474
+ });
475
+ return _importAgents.apply(this, arguments);
476
+ }
477
+ function importIdentityGatewayAgents(_x18) {
478
+ return _importIdentityGatewayAgents.apply(this, arguments);
479
+ }
480
+ /**
481
+ * Import java agents. The import data is usually read from an agent export file.
482
+ * @param {AgentExportInterface} importData agent import data.
483
+ */
484
+ function _importIdentityGatewayAgents() {
485
+ _importIdentityGatewayAgents = _asyncToGenerator(function* (importData) {
486
+ (0, _Console.debugMessage)("AgentOps.importIdentityGatewayAgents: start");
487
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
488
+ for (var agentId of Object.keys(importData.agents)) {
489
+ var agentType = importData.agents[agentId]._type._id;
490
+ if (agentType !== AGENT_TYPE_IG) throw new Error("Wrong agent type! Expected '".concat(AGENT_TYPE_IG, "' but got '").concat(agentType, "'."));
491
+ yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
492
+ }
493
+ } else {
494
+ throw new Error('Invalid meta data.');
495
+ }
496
+ (0, _Console.debugMessage)("AgentOps.importIdentityGatewayAgents: end");
497
+ });
498
+ return _importIdentityGatewayAgents.apply(this, arguments);
499
+ }
500
+ function importJavaAgents(_x19) {
501
+ return _importJavaAgents.apply(this, arguments);
502
+ }
503
+ /**
504
+ * Import web agents. The import data is usually read from an agent export file.
505
+ * @param {AgentExportInterface} importData agent import data.
506
+ */
507
+ function _importJavaAgents() {
508
+ _importJavaAgents = _asyncToGenerator(function* (importData) {
509
+ (0, _Console.debugMessage)("AgentOps.importJavaAgents: start");
510
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
511
+ for (var agentId of Object.keys(importData.agents)) {
512
+ var agentType = importData.agents[agentId]._type._id;
513
+ if (agentType !== AGENT_TYPE_JAVA) throw new Error("Wrong agent type! Expected '".concat(AGENT_TYPE_JAVA, "' but got '").concat(agentType, "'."));
514
+ yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
515
+ }
516
+ } else {
517
+ throw new Error('Invalid meta data.');
518
+ }
519
+ (0, _Console.debugMessage)("AgentOps.importJavaAgents: end");
520
+ });
521
+ return _importJavaAgents.apply(this, arguments);
522
+ }
523
+ function importWebAgents(_x20) {
524
+ return _importWebAgents.apply(this, arguments);
525
+ }
526
+ /**
527
+ * Import agent. The import data is usually read from an agent export file.
528
+ * @param {string} agentId agent id/name
529
+ * @param {AgentExportInterface} importData agent import data.
530
+ * @returns {Promise} Promise resolving to an agent object.
531
+ */
532
+ function _importWebAgents() {
533
+ _importWebAgents = _asyncToGenerator(function* (importData) {
534
+ (0, _Console.debugMessage)("AgentOps.importWebAgents: start");
535
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
536
+ for (var agentId of Object.keys(importData.agents)) {
537
+ var agentType = importData.agents[agentId]._type._id;
538
+ if (agentType !== AGENT_TYPE_WEB) throw new Error("Wrong agent type! Expected '".concat(AGENT_TYPE_WEB, "' but got '").concat(agentType, "'."));
539
+ yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
540
+ }
541
+ } else {
542
+ throw new Error('Invalid meta data.');
543
+ }
544
+ (0, _Console.debugMessage)("AgentOps.importWebAgents: end");
545
+ });
546
+ return _importWebAgents.apply(this, arguments);
547
+ }
548
+ function importAgent(_x21, _x22) {
549
+ return _importAgent.apply(this, arguments);
550
+ }
551
+ /**
552
+ * Import identity gateway agent. The import data is usually read from an agent export file.
553
+ * @param {string} agentId agent id/name
554
+ * @param {AgentExportInterface} importData agent import data.
555
+ * @returns {Promise} Promise resolving to an agent object.
556
+ */
557
+ function _importAgent() {
558
+ _importAgent = _asyncToGenerator(function* (agentId, importData) {
559
+ (0, _Console.debugMessage)("AgentOps.importAgent: start");
560
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
561
+ var _importData$agents$ag;
562
+ var agentType = (_importData$agents$ag = importData.agents[agentId]) === null || _importData$agents$ag === void 0 ? void 0 : _importData$agents$ag._type._id;
563
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
564
+ (0, _Console.debugMessage)("AgentOps.importAgent: end");
565
+ return result;
566
+ } else {
567
+ throw new Error('Invalid meta data.');
568
+ }
569
+ });
570
+ return _importAgent.apply(this, arguments);
571
+ }
572
+ function importIdentityGatewayAgent(_x23, _x24) {
573
+ return _importIdentityGatewayAgent.apply(this, arguments);
574
+ }
575
+ /**
576
+ * Import java agent. The import data is usually read from an agent export file.
577
+ * @param {string} agentId agent id/name
578
+ * @param {AgentExportInterface} importData agent import data.
579
+ * @returns {Promise} Promise resolving to an agent object.
580
+ */
581
+ function _importIdentityGatewayAgent() {
582
+ _importIdentityGatewayAgent = _asyncToGenerator(function* (agentId, importData) {
583
+ (0, _Console.debugMessage)("AgentOps.importIdentityGatewayAgent: start");
584
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
585
+ var _importData$agents$ag2;
586
+ var agentType = (_importData$agents$ag2 = importData.agents[agentId]) === null || _importData$agents$ag2 === void 0 ? void 0 : _importData$agents$ag2._type._id;
587
+ if (agentType !== AGENT_TYPE_IG) throw new Error("Wrong agent type! Expected '".concat(AGENT_TYPE_IG, "' but got '").concat(agentType, "'."));
588
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
589
+ (0, _Console.debugMessage)("AgentOps.importIdentityGatewayAgent: end");
590
+ return result;
591
+ } else {
592
+ throw new Error('Invalid meta data.');
593
+ }
594
+ });
595
+ return _importIdentityGatewayAgent.apply(this, arguments);
596
+ }
597
+ function importJavaAgent(_x25, _x26) {
598
+ return _importJavaAgent.apply(this, arguments);
599
+ }
600
+ /**
601
+ * Import java agent. The import data is usually read from an agent export file.
602
+ * @param {string} agentId agent id/name
603
+ * @param {AgentExportInterface} importData agent import data.
604
+ * @returns {Promise} Promise resolving to an agent object.
605
+ */
606
+ function _importJavaAgent() {
607
+ _importJavaAgent = _asyncToGenerator(function* (agentId, importData) {
608
+ (0, _Console.debugMessage)("AgentOps.importJavaAgent: start");
609
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
610
+ var _importData$agents$ag3;
611
+ var agentType = (_importData$agents$ag3 = importData.agents[agentId]) === null || _importData$agents$ag3 === void 0 ? void 0 : _importData$agents$ag3._type._id;
612
+ if (agentType !== AGENT_TYPE_JAVA) throw new Error("Wrong agent type! Expected '".concat(AGENT_TYPE_JAVA, "' but got '").concat(agentType, "'."));
613
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
614
+ (0, _Console.debugMessage)("AgentOps.importJavaAgent: end");
615
+ return result;
616
+ } else {
617
+ throw new Error('Invalid meta data.');
618
+ }
619
+ });
620
+ return _importJavaAgent.apply(this, arguments);
621
+ }
622
+ function importWebAgent(_x27, _x28) {
623
+ return _importWebAgent.apply(this, arguments);
624
+ }
625
+ /**
626
+ * Delete all agents
627
+ */
628
+ function _importWebAgent() {
629
+ _importWebAgent = _asyncToGenerator(function* (agentId, importData) {
630
+ (0, _Console.debugMessage)("AgentOps.importWebAgent: start");
631
+ if ((0, _ExportImportUtils.validateImport)(importData.meta)) {
632
+ var _importData$agents$ag4;
633
+ var agentType = (_importData$agents$ag4 = importData.agents[agentId]) === null || _importData$agents$ag4 === void 0 ? void 0 : _importData$agents$ag4._type._id;
634
+ if (agentType !== AGENT_TYPE_WEB) throw new Error("Wrong agent type! Expected '".concat(AGENT_TYPE_WEB, "' but got '").concat(agentType, "'."));
635
+ var result = yield (0, _AgentApi.putAgentByTypeAndId)(agentType, agentId, importData.agents[agentId]);
636
+ (0, _Console.debugMessage)("AgentOps.importWebAgent: end");
637
+ return result;
638
+ } else {
639
+ throw new Error('Invalid meta data.');
640
+ }
641
+ });
642
+ return _importWebAgent.apply(this, arguments);
643
+ }
644
+ function deleteAgents() {
645
+ return _deleteAgents.apply(this, arguments);
646
+ }
647
+ /**
648
+ * Delete agent
649
+ * @param agentId agent id/name
650
+ */
651
+ function _deleteAgents() {
652
+ _deleteAgents = _asyncToGenerator(function* () {
653
+ (0, _Console.debugMessage)("AgentOps.deleteAgents: start");
654
+ var agents = yield getAgents();
655
+ for (var agent of agents) {
656
+ (0, _Console.debugMessage)("AgentOps.deleteAgent: '".concat(agent['_id'], "'"));
657
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
658
+ }
659
+ (0, _Console.debugMessage)("AgentOps.deleteAgents: end");
660
+ });
661
+ return _deleteAgents.apply(this, arguments);
662
+ }
663
+ function deleteAgent(_x29) {
664
+ return _deleteAgent.apply(this, arguments);
665
+ }
666
+ /**
667
+ * Delete all identity gateway agents
668
+ */
669
+ function _deleteAgent() {
670
+ _deleteAgent = _asyncToGenerator(function* (agentId) {
671
+ (0, _Console.debugMessage)("AgentOps.deleteAgent: start");
672
+ var agents = yield (0, _AgentApi.findAgentById)(agentId);
673
+ if (agents.length) {
674
+ for (var agent of agents) {
675
+ (0, _Console.debugMessage)("AgentOps.deleteAgent: '".concat(agent['_id'], "'"));
676
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type'], agent['_id']);
677
+ }
678
+ } else {
679
+ throw new Error("Agent '".concat(agentId, "' not found!"));
680
+ }
681
+ (0, _Console.debugMessage)("AgentOps.deleteAgent: end");
682
+ });
683
+ return _deleteAgent.apply(this, arguments);
684
+ }
685
+ function deleteIdentityGatewayAgents() {
686
+ return _deleteIdentityGatewayAgents.apply(this, arguments);
687
+ }
688
+ /**
689
+ * Delete identity gateway agent
690
+ * @param agentId agent id/name
691
+ */
692
+ function _deleteIdentityGatewayAgents() {
693
+ _deleteIdentityGatewayAgents = _asyncToGenerator(function* () {
694
+ (0, _Console.debugMessage)("AgentOps.deleteIdentityGatewayAgents: start");
695
+ var agents = yield getIdentityGatewayAgents();
696
+ for (var agent of agents) {
697
+ (0, _Console.debugMessage)("AgentOps.deleteIdentityGatewayAgent: '".concat(agent['_id'], "'"));
698
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
699
+ }
700
+ (0, _Console.debugMessage)("AgentOps.deleteIdentityGatewayAgents: end");
701
+ });
702
+ return _deleteIdentityGatewayAgents.apply(this, arguments);
703
+ }
704
+ function deleteIdentityGatewayAgent(_x30) {
705
+ return _deleteIdentityGatewayAgent.apply(this, arguments);
706
+ }
707
+ /**
708
+ * Delete all java agents
709
+ */
710
+ function _deleteIdentityGatewayAgent() {
711
+ _deleteIdentityGatewayAgent = _asyncToGenerator(function* (agentId) {
712
+ (0, _Console.debugMessage)("AgentOps.deleteIdentityGatewayAgent: start");
713
+ var agents = yield (0, _AgentApi.findAgentByTypeAndId)(AGENT_TYPE_IG, agentId);
714
+ if (agents.length) {
715
+ for (var agent of agents) {
716
+ (0, _Console.debugMessage)("AgentOps.deleteIdentityGatewayAgent: '".concat(agent['_id'], "'"));
717
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
718
+ }
719
+ } else {
720
+ throw new Error("Identity gateway agent '".concat(agentId, "' not found!"));
721
+ }
722
+ (0, _Console.debugMessage)("AgentOps.deleteIdentityGatewayAgent: end");
723
+ });
724
+ return _deleteIdentityGatewayAgent.apply(this, arguments);
725
+ }
726
+ function deleteJavaAgents() {
727
+ return _deleteJavaAgents.apply(this, arguments);
728
+ }
729
+ /**
730
+ * Delete java agent
731
+ * @param agentId agent id/name
732
+ */
733
+ function _deleteJavaAgents() {
734
+ _deleteJavaAgents = _asyncToGenerator(function* () {
735
+ (0, _Console.debugMessage)("AgentOps.deleteJavaAgents: start");
736
+ var agents = yield getJavaAgents();
737
+ for (var agent of agents) {
738
+ (0, _Console.debugMessage)("AgentOps.deleteJavaAgent: '".concat(agent['_id'], "'"));
739
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
740
+ }
741
+ (0, _Console.debugMessage)("AgentOps.deleteJavaAgents: end");
742
+ });
743
+ return _deleteJavaAgents.apply(this, arguments);
744
+ }
745
+ function deleteJavaAgent(_x31) {
746
+ return _deleteJavaAgent.apply(this, arguments);
747
+ }
748
+ /**
749
+ * Delete all web agents
750
+ */
751
+ function _deleteJavaAgent() {
752
+ _deleteJavaAgent = _asyncToGenerator(function* (agentId) {
753
+ (0, _Console.debugMessage)("AgentOps.deleteJavaAgent: start");
754
+ var agents = yield (0, _AgentApi.findAgentByTypeAndId)(AGENT_TYPE_JAVA, agentId);
755
+ if (agents.length) {
756
+ for (var agent of agents) {
757
+ (0, _Console.debugMessage)("AgentOps.deleteJavaAgent: '".concat(agent['_id'], "'"));
758
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
759
+ }
760
+ } else {
761
+ throw new Error("Java agent '".concat(agentId, "' not found!"));
762
+ }
763
+ (0, _Console.debugMessage)("AgentOps.deleteJavaAgent: end");
764
+ });
765
+ return _deleteJavaAgent.apply(this, arguments);
766
+ }
767
+ function deleteWebAgents() {
768
+ return _deleteWebAgents.apply(this, arguments);
769
+ }
770
+ /**
771
+ * Delete web agent
772
+ * @param agentId agent id/name
773
+ */
774
+ function _deleteWebAgents() {
775
+ _deleteWebAgents = _asyncToGenerator(function* () {
776
+ (0, _Console.debugMessage)("AgentOps.deleteWebAgents: start");
777
+ var agents = yield getWebAgents();
778
+ for (var agent of agents) {
779
+ (0, _Console.debugMessage)("AgentOps.deleteWebAgent: '".concat(agent['_id'], "'"));
780
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
781
+ }
782
+ (0, _Console.debugMessage)("AgentOps.deleteWebAgents: end");
783
+ });
784
+ return _deleteWebAgents.apply(this, arguments);
785
+ }
786
+ function deleteWebAgent(_x32) {
787
+ return _deleteWebAgent.apply(this, arguments);
788
+ }
789
+ function _deleteWebAgent() {
790
+ _deleteWebAgent = _asyncToGenerator(function* (agentId) {
791
+ (0, _Console.debugMessage)("AgentOps.deleteWebAgent: start");
792
+ var agents = yield (0, _AgentApi.findAgentByTypeAndId)(AGENT_TYPE_WEB, agentId);
793
+ if (agents.length) {
794
+ for (var agent of agents) {
795
+ (0, _Console.debugMessage)("AgentOps.deleteWebAgent: '".concat(agent['_id'], "'"));
796
+ yield (0, _AgentApi.deleteAgentByTypeAndId)(agent['_type']['_id'], agent['_id']);
797
+ }
798
+ } else {
799
+ throw new Error("Web agent '".concat(agentId, "' not found!"));
800
+ }
801
+ (0, _Console.debugMessage)("AgentOps.deleteWebAgent: end");
802
+ });
803
+ return _deleteWebAgent.apply(this, arguments);
804
+ }
805
+ //# sourceMappingURL=AgentOps.js.map