@rockcarver/frodo-cli 2.0.0-60 → 2.0.0-62
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 +18 -1
- package/dist/app.cjs +214 -116
- package/dist/app.cjs.map +1 -1
- package/package.json +7 -8
package/dist/app.cjs
CHANGED
|
@@ -125544,7 +125544,7 @@ function stringify(obj) {
|
|
|
125544
125544
|
}
|
|
125545
125545
|
var package_default = {
|
|
125546
125546
|
name: "@rockcarver/frodo-lib",
|
|
125547
|
-
version: "2.0.0-
|
|
125547
|
+
version: "2.0.0-86",
|
|
125548
125548
|
type: "commonjs",
|
|
125549
125549
|
main: "./dist/index.js",
|
|
125550
125550
|
module: "./dist/esm/index.js",
|
|
@@ -125569,7 +125569,7 @@ var package_default = {
|
|
|
125569
125569
|
build: "npx tsup && npm run clean-types && npm run generate-types",
|
|
125570
125570
|
doc: "npx typedoc",
|
|
125571
125571
|
"prettier:fix": "npm run prettier write",
|
|
125572
|
-
dev: "npx tsup --watch src"
|
|
125572
|
+
dev: "npx tsup --watch src --onSuccess 'npx tsup --dts-only'"
|
|
125573
125573
|
},
|
|
125574
125574
|
description: "A library to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
125575
125575
|
keywords: [
|
|
@@ -144545,6 +144545,9 @@ var ScriptOps_default = (state2) => {
|
|
|
144545
144545
|
async readScripts() {
|
|
144546
144546
|
return readScripts({ state: state2 });
|
|
144547
144547
|
},
|
|
144548
|
+
getLibraryScriptNames(scriptObj) {
|
|
144549
|
+
return getLibraryScriptNames(scriptObj);
|
|
144550
|
+
},
|
|
144548
144551
|
async readScript(scriptId) {
|
|
144549
144552
|
return readScript({ scriptId, state: state2 });
|
|
144550
144553
|
},
|
|
@@ -144566,14 +144569,26 @@ var ScriptOps_default = (state2) => {
|
|
|
144566
144569
|
async deleteScripts() {
|
|
144567
144570
|
return deleteScripts2({ state: state2 });
|
|
144568
144571
|
},
|
|
144569
|
-
async exportScript(scriptId
|
|
144570
|
-
|
|
144572
|
+
async exportScript(scriptId, options2 = {
|
|
144573
|
+
includeLibraries: true,
|
|
144574
|
+
includeDefault: true,
|
|
144575
|
+
useStringArrays: true
|
|
144576
|
+
}) {
|
|
144577
|
+
return exportScript({ scriptId, options: options2, state: state2 });
|
|
144571
144578
|
},
|
|
144572
|
-
async exportScriptByName(scriptName
|
|
144573
|
-
|
|
144579
|
+
async exportScriptByName(scriptName, options2 = {
|
|
144580
|
+
includeLibraries: true,
|
|
144581
|
+
includeDefault: true,
|
|
144582
|
+
useStringArrays: true
|
|
144583
|
+
}) {
|
|
144584
|
+
return exportScriptByName({ scriptName, options: options2, state: state2 });
|
|
144574
144585
|
},
|
|
144575
|
-
async exportScripts(
|
|
144576
|
-
|
|
144586
|
+
async exportScripts(options2 = {
|
|
144587
|
+
includeLibraries: true,
|
|
144588
|
+
includeDefault: false,
|
|
144589
|
+
useStringArrays: true
|
|
144590
|
+
}) {
|
|
144591
|
+
return exportScripts({ options: options2, state: state2 });
|
|
144577
144592
|
},
|
|
144578
144593
|
async importScripts(scriptName, importData, options2 = {
|
|
144579
144594
|
reUuid: false,
|
|
@@ -144620,12 +144635,19 @@ async function readScripts({
|
|
|
144620
144635
|
throw new FrodoError(`Error reading scripts`, error2);
|
|
144621
144636
|
}
|
|
144622
144637
|
}
|
|
144638
|
+
function getLibraryScriptNames(scriptObj) {
|
|
144639
|
+
const script = Array.isArray(scriptObj.script) ? scriptObj.script.join("\n") : decode(scriptObj.script);
|
|
144640
|
+
const regex2 = /require\(['|"](.+?)['|"]\)/g;
|
|
144641
|
+
const matches = [...script.matchAll(regex2)];
|
|
144642
|
+
return matches.map((m2) => String(m2[1]));
|
|
144643
|
+
}
|
|
144623
144644
|
async function readScript({
|
|
144624
144645
|
scriptId,
|
|
144625
144646
|
state: state2
|
|
144626
144647
|
}) {
|
|
144627
144648
|
try {
|
|
144628
|
-
|
|
144649
|
+
const result2 = await getScript({ scriptId, state: state2 });
|
|
144650
|
+
return result2;
|
|
144629
144651
|
} catch (error2) {
|
|
144630
144652
|
throw new FrodoError(`Error reading script ${scriptId}`, error2);
|
|
144631
144653
|
}
|
|
@@ -144733,14 +144755,33 @@ async function deleteScripts2({
|
|
|
144733
144755
|
}
|
|
144734
144756
|
async function exportScript({
|
|
144735
144757
|
scriptId,
|
|
144758
|
+
options: options2 = {
|
|
144759
|
+
includeLibraries: true,
|
|
144760
|
+
includeDefault: true,
|
|
144761
|
+
useStringArrays: true
|
|
144762
|
+
},
|
|
144736
144763
|
state: state2
|
|
144737
144764
|
}) {
|
|
144738
144765
|
try {
|
|
144739
144766
|
debugMessage({ message: `ScriptOps.exportScriptById: start`, state: state2 });
|
|
144767
|
+
const { includeLibraries } = options2;
|
|
144740
144768
|
const scriptData = await getScript({ scriptId, state: state2 });
|
|
144741
144769
|
scriptData.script = convertBase64TextToArray(scriptData.script);
|
|
144742
144770
|
const exportData = createScriptExportTemplate({ state: state2 });
|
|
144743
144771
|
exportData.script[scriptData._id] = scriptData;
|
|
144772
|
+
if (includeLibraries) {
|
|
144773
|
+
const scriptNames = getLibraryScriptNames(scriptData);
|
|
144774
|
+
for (const scriptName of scriptNames) {
|
|
144775
|
+
const libScriptObject = await readScriptByName({
|
|
144776
|
+
scriptName,
|
|
144777
|
+
state: state2
|
|
144778
|
+
});
|
|
144779
|
+
libScriptObject.script = convertBase64TextToArray(
|
|
144780
|
+
libScriptObject.script
|
|
144781
|
+
);
|
|
144782
|
+
exportData.script[libScriptObject._id] = libScriptObject;
|
|
144783
|
+
}
|
|
144784
|
+
}
|
|
144744
144785
|
debugMessage({ message: `ScriptOps.exportScriptById: end`, state: state2 });
|
|
144745
144786
|
return exportData;
|
|
144746
144787
|
} catch (error2) {
|
|
@@ -144749,14 +144790,33 @@ async function exportScript({
|
|
|
144749
144790
|
}
|
|
144750
144791
|
async function exportScriptByName({
|
|
144751
144792
|
scriptName,
|
|
144793
|
+
options: options2 = {
|
|
144794
|
+
includeLibraries: true,
|
|
144795
|
+
includeDefault: true,
|
|
144796
|
+
useStringArrays: true
|
|
144797
|
+
},
|
|
144752
144798
|
state: state2
|
|
144753
144799
|
}) {
|
|
144754
144800
|
try {
|
|
144755
144801
|
debugMessage({ message: `ScriptOps.exportScriptByName: start`, state: state2 });
|
|
144802
|
+
const { includeLibraries } = options2;
|
|
144756
144803
|
const scriptData = await readScriptByName({ scriptName, state: state2 });
|
|
144757
144804
|
scriptData.script = convertBase64TextToArray(scriptData.script);
|
|
144758
144805
|
const exportData = createScriptExportTemplate({ state: state2 });
|
|
144759
144806
|
exportData.script[scriptData._id] = scriptData;
|
|
144807
|
+
if (includeLibraries) {
|
|
144808
|
+
const scriptNames = getLibraryScriptNames(scriptData);
|
|
144809
|
+
for (const scriptName2 of scriptNames) {
|
|
144810
|
+
const libScriptObject = await readScriptByName({
|
|
144811
|
+
scriptName: scriptName2,
|
|
144812
|
+
state: state2
|
|
144813
|
+
});
|
|
144814
|
+
libScriptObject.script = convertBase64TextToArray(
|
|
144815
|
+
libScriptObject.script
|
|
144816
|
+
);
|
|
144817
|
+
exportData.script[libScriptObject._id] = libScriptObject;
|
|
144818
|
+
}
|
|
144819
|
+
}
|
|
144760
144820
|
debugMessage({ message: `ScriptOps.exportScriptByName: end`, state: state2 });
|
|
144761
144821
|
return exportData;
|
|
144762
144822
|
} catch (error2) {
|
|
@@ -144764,12 +144824,17 @@ async function exportScriptByName({
|
|
|
144764
144824
|
}
|
|
144765
144825
|
}
|
|
144766
144826
|
async function exportScripts({
|
|
144767
|
-
|
|
144827
|
+
options: options2 = {
|
|
144828
|
+
includeLibraries: true,
|
|
144829
|
+
includeDefault: false,
|
|
144830
|
+
useStringArrays: true
|
|
144831
|
+
},
|
|
144768
144832
|
state: state2
|
|
144769
144833
|
}) {
|
|
144770
144834
|
const errors = [];
|
|
144771
144835
|
let indicatorId;
|
|
144772
144836
|
try {
|
|
144837
|
+
const { includeLibraries, includeDefault } = options2;
|
|
144773
144838
|
let scriptList = await readScripts({ state: state2 });
|
|
144774
144839
|
if (!includeDefault)
|
|
144775
144840
|
scriptList = scriptList.filter((script) => !script.default);
|
|
@@ -144779,6 +144844,7 @@ async function exportScripts({
|
|
|
144779
144844
|
message: `Exporting ${scriptList.length} scripts...`,
|
|
144780
144845
|
state: state2
|
|
144781
144846
|
});
|
|
144847
|
+
const name2uuid = {};
|
|
144782
144848
|
for (const script of scriptList) {
|
|
144783
144849
|
try {
|
|
144784
144850
|
updateProgressIndicator({
|
|
@@ -144794,6 +144860,22 @@ async function exportScripts({
|
|
|
144794
144860
|
scriptData.script
|
|
144795
144861
|
);
|
|
144796
144862
|
exportData.script[scriptData._id] = scriptData;
|
|
144863
|
+
if (includeLibraries) {
|
|
144864
|
+
const scriptNames = getLibraryScriptNames(scriptData);
|
|
144865
|
+
for (const scriptName of scriptNames) {
|
|
144866
|
+
if (name2uuid[scriptName] === void 0) {
|
|
144867
|
+
const libScriptObject = await readScriptByName({
|
|
144868
|
+
scriptName,
|
|
144869
|
+
state: state2
|
|
144870
|
+
});
|
|
144871
|
+
name2uuid[scriptName] = libScriptObject._id;
|
|
144872
|
+
libScriptObject.script = convertBase64TextToArray(
|
|
144873
|
+
libScriptObject.script
|
|
144874
|
+
);
|
|
144875
|
+
exportData.script[libScriptObject._id] = libScriptObject;
|
|
144876
|
+
}
|
|
144877
|
+
}
|
|
144878
|
+
}
|
|
144797
144879
|
} catch (error2) {
|
|
144798
144880
|
errors.push(error2);
|
|
144799
144881
|
}
|
|
@@ -145119,7 +145201,7 @@ async function exportOAuth2ClientDependencies(clientData, options2, exportData,
|
|
|
145119
145201
|
);
|
|
145120
145202
|
exportData.script[scriptId] = scriptData;
|
|
145121
145203
|
} catch (error2) {
|
|
145122
|
-
if (!(
|
|
145204
|
+
if (!(error2.httpStatus === 403 && error2.httpMessage === "This operation is not available in ForgeRock Identity Cloud.")) {
|
|
145123
145205
|
throw new FrodoError(
|
|
145124
145206
|
`Error retrieving script ${scriptId} referenced by ${key} key in client ${clientData["_id"]}`,
|
|
145125
145207
|
error2
|
|
@@ -145742,7 +145824,7 @@ async function updateOAuth2TrustedJwtIssuer({
|
|
|
145742
145824
|
});
|
|
145743
145825
|
return response2;
|
|
145744
145826
|
} catch (error2) {
|
|
145745
|
-
if (_optionalChain([error2, 'access',
|
|
145827
|
+
if (_optionalChain([error2, 'access', _51 => _51.response, 'optionalAccess', _52 => _52.status]) === 400 && _optionalChain([error2, 'access', _53 => _53.response, 'optionalAccess', _54 => _54.data, 'optionalAccess', _55 => _55.message]) === "Invalid attribute specified.") {
|
|
145746
145828
|
try {
|
|
145747
145829
|
const { validAttributes } = error2.response.data.detail;
|
|
145748
145830
|
validAttributes.push("_id");
|
|
@@ -149611,7 +149693,7 @@ async function importAgent({
|
|
|
149611
149693
|
}) {
|
|
149612
149694
|
try {
|
|
149613
149695
|
debugMessage({ message: `AgentOps.importAgent: start`, state: state2 });
|
|
149614
|
-
const agentType = _optionalChain([importData, 'access',
|
|
149696
|
+
const agentType = _optionalChain([importData, 'access', _56 => _56.agents, 'access', _57 => _57[agentId], 'optionalAccess', _58 => _58._type, 'access', _59 => _59._id]);
|
|
149615
149697
|
const result2 = await putAgentByTypeAndId({
|
|
149616
149698
|
agentType,
|
|
149617
149699
|
agentId,
|
|
@@ -149634,7 +149716,7 @@ async function importIdentityGatewayAgent({
|
|
|
149634
149716
|
message: `AgentOps.importIdentityGatewayAgent: start`,
|
|
149635
149717
|
state: state2
|
|
149636
149718
|
});
|
|
149637
|
-
const agentType = _optionalChain([importData, 'access',
|
|
149719
|
+
const agentType = _optionalChain([importData, 'access', _60 => _60.agents, 'access', _61 => _61[agentId], 'optionalAccess', _62 => _62._type, 'access', _63 => _63._id]);
|
|
149638
149720
|
if (agentType !== "IdentityGatewayAgent")
|
|
149639
149721
|
throw new FrodoError(
|
|
149640
149722
|
`Wrong agent type! Expected 'IdentityGatewayAgent' but got '${agentType}'.`
|
|
@@ -149664,7 +149746,7 @@ async function importJavaAgent({
|
|
|
149664
149746
|
}) {
|
|
149665
149747
|
try {
|
|
149666
149748
|
debugMessage({ message: `AgentOps.importJavaAgent: start`, state: state2 });
|
|
149667
|
-
const agentType = _optionalChain([importData, 'access',
|
|
149749
|
+
const agentType = _optionalChain([importData, 'access', _64 => _64.agents, 'access', _65 => _65[agentId], 'optionalAccess', _66 => _66._type, 'access', _67 => _67._id]);
|
|
149668
149750
|
if (agentType !== "J2EEAgent")
|
|
149669
149751
|
throw new FrodoError(
|
|
149670
149752
|
`Wrong agent type! Expected 'J2EEAgent' but got '${agentType}'.`
|
|
@@ -149688,7 +149770,7 @@ async function importWebAgent({
|
|
|
149688
149770
|
}) {
|
|
149689
149771
|
try {
|
|
149690
149772
|
debugMessage({ message: `AgentOps.importWebAgent: start`, state: state2 });
|
|
149691
|
-
const agentType = _optionalChain([importData, 'access',
|
|
149773
|
+
const agentType = _optionalChain([importData, 'access', _68 => _68.agents, 'access', _69 => _69[agentId], 'optionalAccess', _70 => _70._type, 'access', _71 => _71._id]);
|
|
149692
149774
|
if (agentType !== "WebAgent")
|
|
149693
149775
|
throw new FrodoError(
|
|
149694
149776
|
`Wrong agent type! Expected 'WebAgent' but got '${agentType}'.`
|
|
@@ -151004,7 +151086,7 @@ async function createCircleOfTrust2({
|
|
|
151004
151086
|
const response2 = await createCircleOfTrust({ cotData, state: state2 });
|
|
151005
151087
|
return response2;
|
|
151006
151088
|
} catch (createError) {
|
|
151007
|
-
if (_optionalChain([createError, 'access',
|
|
151089
|
+
if (_optionalChain([createError, 'access', _72 => _72.response, 'optionalAccess', _73 => _73.data, 'optionalAccess', _74 => _74.code]) === 500 && _optionalChain([createError, 'access', _75 => _75.response, 'optionalAccess', _76 => _76.data, 'optionalAccess', _77 => _77.message]) === "Unable to update entity provider's circle of trust") {
|
|
151008
151090
|
try {
|
|
151009
151091
|
const response2 = await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
151010
151092
|
return response2;
|
|
@@ -151031,7 +151113,7 @@ async function updateCircleOfTrust2({
|
|
|
151031
151113
|
const response2 = await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
151032
151114
|
return response2 || cotData;
|
|
151033
151115
|
} catch (error2) {
|
|
151034
|
-
if (_optionalChain([error2, 'access',
|
|
151116
|
+
if (_optionalChain([error2, 'access', _78 => _78.response, 'optionalAccess', _79 => _79.data, 'optionalAccess', _80 => _80.code]) === 500 && (_optionalChain([error2, 'access', _81 => _81.response, 'optionalAccess', _82 => _82.data, 'optionalAccess', _83 => _83.message]) === "Unable to update entity provider's circle of trust" || _optionalChain([error2, 'access', _84 => _84.response, 'optionalAccess', _85 => _85.data, 'optionalAccess', _86 => _86.message]) === "An error occurred while updating the COT memberships")) {
|
|
151035
151117
|
try {
|
|
151036
151118
|
const response2 = await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
151037
151119
|
return response2 || cotData;
|
|
@@ -151427,7 +151509,7 @@ ${providers.map((it) => it.split("|")[0]).join("\n")}.`,
|
|
|
151427
151509
|
}
|
|
151428
151510
|
} catch (error2) {
|
|
151429
151511
|
debugMessage({
|
|
151430
|
-
message: `Error ${_optionalChain([error2, 'access',
|
|
151512
|
+
message: `Error ${_optionalChain([error2, 'access', _87 => _87.response, 'optionalAccess', _88 => _88.status])} creating/updating circle of trust: ${_optionalChain([error2, 'access', _89 => _89.response, 'optionalAccess', _90 => _90.data, 'optionalAccess', _91 => _91.message])}`,
|
|
151431
151513
|
state: state2
|
|
151432
151514
|
});
|
|
151433
151515
|
errors.push(error2);
|
|
@@ -152175,7 +152257,7 @@ async function exportConfigEntities({
|
|
|
152175
152257
|
!(error2.httpStatus === 404 && error2.httpMessage === "No configuration exists for id org.apache.felix.fileinstall/openidm")
|
|
152176
152258
|
) {
|
|
152177
152259
|
printMessage({
|
|
152178
|
-
message: _optionalChain([readConfigEntityError, 'access',
|
|
152260
|
+
message: _optionalChain([readConfigEntityError, 'access', _92 => _92.response, 'optionalAccess', _93 => _93.data]),
|
|
152179
152261
|
type: "error",
|
|
152180
152262
|
state: state2
|
|
152181
152263
|
});
|
|
@@ -154623,7 +154705,7 @@ async function getFeatures2({
|
|
|
154623
154705
|
const { result: result2 } = await getFeatures({ state: state2 });
|
|
154624
154706
|
state2.setFeatures(JSON.parse(JSON.stringify(result2)));
|
|
154625
154707
|
} catch (error2) {
|
|
154626
|
-
debugMessage({ message: _optionalChain([error2, 'access',
|
|
154708
|
+
debugMessage({ message: _optionalChain([error2, 'access', _94 => _94.response, 'optionalAccess', _95 => _95.data]), state: state2 });
|
|
154627
154709
|
state2.setFeatures([]);
|
|
154628
154710
|
}
|
|
154629
154711
|
return state2.getFeatures();
|
|
@@ -156141,7 +156223,7 @@ async function determineDeploymentType(state2) {
|
|
|
156141
156223
|
state: state2
|
|
156142
156224
|
});
|
|
156143
156225
|
} catch (e) {
|
|
156144
|
-
if (_optionalChain([e, 'access',
|
|
156226
|
+
if (_optionalChain([e, 'access', _96 => _96.response, 'optionalAccess', _97 => _97.status]) === 302 && _optionalChain([e, 'access', _98 => _98.response, 'access', _99 => _99.headers, 'optionalAccess', _100 => _100.location, 'optionalAccess', _101 => _101.indexOf, 'call', _102 => _102("code=")]) > -1) {
|
|
156145
156227
|
verboseMessage({
|
|
156146
156228
|
message: `ForgeRock Identity Cloud`["brightCyan"] + ` detected.`,
|
|
156147
156229
|
state: state2
|
|
@@ -156157,7 +156239,7 @@ async function determineDeploymentType(state2) {
|
|
|
156157
156239
|
state: state2
|
|
156158
156240
|
});
|
|
156159
156241
|
} catch (ex) {
|
|
156160
|
-
if (_optionalChain([ex, 'access',
|
|
156242
|
+
if (_optionalChain([ex, 'access', _103 => _103.response, 'optionalAccess', _104 => _104.status]) === 302 && _optionalChain([ex, 'access', _105 => _105.response, 'access', _106 => _106.headers, 'optionalAccess', _107 => _107.location, 'optionalAccess', _108 => _108.indexOf, 'call', _109 => _109("code=")]) > -1) {
|
|
156161
156243
|
adminClientId = forgeopsClientId;
|
|
156162
156244
|
verboseMessage({
|
|
156163
156245
|
message: `ForgeOps deployment`["brightCyan"] + ` detected.`,
|
|
@@ -156305,7 +156387,7 @@ async function getAuthCode(redirectURL, codeChallenge, codeChallengeMethod, stat
|
|
|
156305
156387
|
throw error2;
|
|
156306
156388
|
}
|
|
156307
156389
|
}
|
|
156308
|
-
const redirectLocationURL = _optionalChain([response2, 'access',
|
|
156390
|
+
const redirectLocationURL = _optionalChain([response2, 'access', _110 => _110.headers, 'optionalAccess', _111 => _111.location]);
|
|
156309
156391
|
const queryObject = _url2.default.parse(redirectLocationURL, true).query;
|
|
156310
156392
|
if ("code" in queryObject) {
|
|
156311
156393
|
return queryObject.code;
|
|
@@ -156440,7 +156522,7 @@ async function getFreshSaBearerToken({
|
|
|
156440
156522
|
});
|
|
156441
156523
|
} catch (error2) {
|
|
156442
156524
|
const err = error2;
|
|
156443
|
-
if (err.isHttpError && err.httpErrorText === "invalid_scope" && _optionalChain([err, 'access',
|
|
156525
|
+
if (err.isHttpError && err.httpErrorText === "invalid_scope" && _optionalChain([err, 'access', _112 => _112.httpDescription, 'optionalAccess', _113 => _113.startsWith, 'call', _114 => _114("Unsupported scope for service account: ")])) {
|
|
156444
156526
|
const invalidScopes = err.httpDescription.substring(39).split(",");
|
|
156445
156527
|
const finalScopes = scope.split(" ").filter((el) => {
|
|
156446
156528
|
return !invalidScopes.includes(el);
|
|
@@ -156557,9 +156639,9 @@ function scheduleAutoRefresh(forceLoginAsUser, autoRefresh, state2) {
|
|
|
156557
156639
|
clearTimeout(timer);
|
|
156558
156640
|
}
|
|
156559
156641
|
if (autoRefresh) {
|
|
156560
|
-
const expires = state2.getDeploymentType() === Constants_default.CLASSIC_DEPLOYMENT_TYPE_KEY ? _optionalChain([state2, 'access',
|
|
156561
|
-
_optionalChain([state2, 'access',
|
|
156562
|
-
_optionalChain([state2, 'access',
|
|
156642
|
+
const expires = state2.getDeploymentType() === Constants_default.CLASSIC_DEPLOYMENT_TYPE_KEY ? _optionalChain([state2, 'access', _115 => _115.getUserSessionTokenMeta, 'call', _116 => _116(), 'optionalAccess', _117 => _117.expires]) : state2.getUseBearerTokenForAmApis() ? _optionalChain([state2, 'access', _118 => _118.getBearerTokenMeta, 'call', _119 => _119(), 'optionalAccess', _120 => _120.expires]) : Math.min(
|
|
156643
|
+
_optionalChain([state2, 'access', _121 => _121.getBearerTokenMeta, 'call', _122 => _122(), 'optionalAccess', _123 => _123.expires]),
|
|
156644
|
+
_optionalChain([state2, 'access', _124 => _124.getUserSessionTokenMeta, 'call', _125 => _125(), 'optionalAccess', _126 => _126.expires])
|
|
156563
156645
|
);
|
|
156564
156646
|
let timeout4 = expires - Date.now() - 1e3 * 25;
|
|
156565
156647
|
if (timeout4 < 1e3 * 30) {
|
|
@@ -156655,10 +156737,10 @@ async function getTokens({
|
|
|
156655
156737
|
throw new FrodoError(`Incomplete or no credentials`);
|
|
156656
156738
|
}
|
|
156657
156739
|
if (state2.getCookieValue() || state2.getUseBearerTokenForAmApis() && state2.getBearerToken()) {
|
|
156658
|
-
if (_optionalChain([state2, 'access',
|
|
156740
|
+
if (_optionalChain([state2, 'access', _127 => _127.getBearerTokenMeta, 'call', _128 => _128(), 'optionalAccess', _129 => _129.from_cache])) {
|
|
156659
156741
|
verboseMessage({ message: `Using cached bearer token.`, state: state2 });
|
|
156660
156742
|
}
|
|
156661
|
-
if (!state2.getUseBearerTokenForAmApis() && _optionalChain([state2, 'access',
|
|
156743
|
+
if (!state2.getUseBearerTokenForAmApis() && _optionalChain([state2, 'access', _130 => _130.getUserSessionTokenMeta, 'call', _131 => _131(), 'optionalAccess', _132 => _132.from_cache])) {
|
|
156662
156744
|
verboseMessage({ message: `Using cached session token.`, state: state2 });
|
|
156663
156745
|
}
|
|
156664
156746
|
scheduleAutoRefresh(forceLoginAsUser, autoRefresh, state2);
|
|
@@ -157065,7 +157147,7 @@ async function updateAdminFederationProvider({
|
|
|
157065
157147
|
});
|
|
157066
157148
|
return response2;
|
|
157067
157149
|
} catch (importError) {
|
|
157068
|
-
if (_optionalChain([importError, 'access',
|
|
157150
|
+
if (_optionalChain([importError, 'access', _133 => _133.response, 'optionalAccess', _134 => _134.status]) === 400 && _optionalChain([importError, 'access', _135 => _135.response, 'optionalAccess', _136 => _136.data, 'optionalAccess', _137 => _137.message]) === "Invalid attribute specified.") {
|
|
157069
157151
|
const { validAttributes } = importError.response.data.detail;
|
|
157070
157152
|
validAttributes.push("_id", "_type");
|
|
157071
157153
|
for (const attribute of Object.keys(providerData)) {
|
|
@@ -158488,7 +158570,7 @@ async function checkForUpdates({
|
|
|
158488
158570
|
state: state2
|
|
158489
158571
|
});
|
|
158490
158572
|
}
|
|
158491
|
-
const updateCount = _optionalChain([updates, 'access',
|
|
158573
|
+
const updateCount = _optionalChain([updates, 'access', _138 => _138.secrets, 'optionalAccess', _139 => _139.length]) + _optionalChain([updates, 'access', _140 => _140.variables, 'optionalAccess', _141 => _141.length]) || 0;
|
|
158492
158574
|
if (updateCount > 0) {
|
|
158493
158575
|
stopProgressIndicator({
|
|
158494
158576
|
id: indicatorId,
|
|
@@ -158581,7 +158663,7 @@ async function applyUpdates({
|
|
|
158581
158663
|
} catch (error2) {
|
|
158582
158664
|
stopProgressIndicator({
|
|
158583
158665
|
id: indicatorId,
|
|
158584
|
-
message: `Error: ${_optionalChain([error2, 'access',
|
|
158666
|
+
message: `Error: ${_optionalChain([error2, 'access', _142 => _142.response, 'optionalAccess', _143 => _143.data, 'optionalAccess', _144 => _144.code]) || error2} - ${_optionalChain([error2, 'access', _145 => _145.response, 'optionalAccess', _146 => _146.data, 'optionalAccess', _147 => _147.message])}`,
|
|
158585
158667
|
status: "fail",
|
|
158586
158668
|
state: state2
|
|
158587
158669
|
});
|
|
@@ -159100,7 +159182,7 @@ async function updateSocialIdentityProvider({
|
|
|
159100
159182
|
});
|
|
159101
159183
|
return response2;
|
|
159102
159184
|
} catch (error2) {
|
|
159103
|
-
if (_optionalChain([error2, 'access',
|
|
159185
|
+
if (_optionalChain([error2, 'access', _148 => _148.response, 'optionalAccess', _149 => _149.status]) === 400 && _optionalChain([error2, 'access', _150 => _150.response, 'optionalAccess', _151 => _151.data, 'optionalAccess', _152 => _152.message]) === "Invalid attribute specified.") {
|
|
159104
159186
|
const { validAttributes } = error2.response.data.detail;
|
|
159105
159187
|
validAttributes.push("_id", "_type");
|
|
159106
159188
|
for (const attribute of Object.keys(providerData)) {
|
|
@@ -161118,7 +161200,7 @@ async function getSaml2NodeDependencies(nodeObject, allProviders, allCirclesOfTr
|
|
|
161118
161200
|
}
|
|
161119
161201
|
saml2EntityPromises.push(providerResponse);
|
|
161120
161202
|
} catch (error2) {
|
|
161121
|
-
error2.message = `Error reading saml2 dependencies: ${_optionalChain([error2, 'access',
|
|
161203
|
+
error2.message = `Error reading saml2 dependencies: ${_optionalChain([error2, 'access', _153 => _153.response, 'optionalAccess', _154 => _154.data, 'optionalAccess', _155 => _155.message]) || error2.message}`;
|
|
161122
161204
|
errors.push(error2);
|
|
161123
161205
|
}
|
|
161124
161206
|
}
|
|
@@ -161147,7 +161229,7 @@ async function getSaml2NodeDependencies(nodeObject, allProviders, allCirclesOfTr
|
|
|
161147
161229
|
circlesOfTrust
|
|
161148
161230
|
};
|
|
161149
161231
|
} catch (error2) {
|
|
161150
|
-
error2.message = `Error reading saml2 dependencies: ${_optionalChain([error2, 'access',
|
|
161232
|
+
error2.message = `Error reading saml2 dependencies: ${_optionalChain([error2, 'access', _156 => _156.response, 'optionalAccess', _157 => _157.data, 'optionalAccess', _158 => _158.message]) || error2.message}`;
|
|
161151
161233
|
errors.push(error2);
|
|
161152
161234
|
}
|
|
161153
161235
|
if (errors.length) {
|
|
@@ -161246,7 +161328,7 @@ async function exportJourney({
|
|
|
161246
161328
|
});
|
|
161247
161329
|
exportData.nodes[nodeObject._id] = nodeObject;
|
|
161248
161330
|
if (deps && hasScriptDependency(nodeObject) && nodeObject.script !== emptyScriptPlaceholder) {
|
|
161249
|
-
scriptPromises.push(
|
|
161331
|
+
scriptPromises.push(readScript({ scriptId: nodeObject.script, state: state2 }));
|
|
161250
161332
|
}
|
|
161251
161333
|
if (deps && state2.getDeploymentType() === Constants_default.CLOUD_DEPLOYMENT_TYPE_KEY || state2.getDeploymentType() === Constants_default.FORGEOPS_DEPLOYMENT_TYPE_KEY) {
|
|
161252
161334
|
if (emailTemplateNodes.includes(nodeType)) {
|
|
@@ -161257,7 +161339,7 @@ async function exportJourney({
|
|
|
161257
161339
|
});
|
|
161258
161340
|
emailTemplatePromises.push(emailTemplate);
|
|
161259
161341
|
} catch (error2) {
|
|
161260
|
-
error2.message = `Error reading email template ${nodeObject.emailTemplateName}: ${_optionalChain([error2, 'access',
|
|
161342
|
+
error2.message = `Error reading email template ${nodeObject.emailTemplateName}: ${_optionalChain([error2, 'access', _159 => _159.response, 'optionalAccess', _160 => _160.data, 'optionalAccess', _161 => _161.message]) || error2.message}`;
|
|
161261
161343
|
errors.push(error2);
|
|
161262
161344
|
}
|
|
161263
161345
|
}
|
|
@@ -161347,7 +161429,7 @@ async function exportJourney({
|
|
|
161347
161429
|
exportData.innerNodes[innerNodeId] = innerNodeObject;
|
|
161348
161430
|
if (deps && hasScriptDependency(innerNodeObject)) {
|
|
161349
161431
|
scriptPromises.push(
|
|
161350
|
-
|
|
161432
|
+
readScript({ scriptId: innerNodeObject.script, state: state2 })
|
|
161351
161433
|
);
|
|
161352
161434
|
}
|
|
161353
161435
|
if (deps && state2.getDeploymentType() === Constants_default.CLOUD_DEPLOYMENT_TYPE_KEY || state2.getDeploymentType() === Constants_default.FORGEOPS_DEPLOYMENT_TYPE_KEY) {
|
|
@@ -161500,7 +161582,7 @@ async function exportJourney({
|
|
|
161500
161582
|
state: state2
|
|
161501
161583
|
});
|
|
161502
161584
|
scriptPromises.push(
|
|
161503
|
-
|
|
161585
|
+
readScript({ scriptId: socialProvider.transform, state: state2 })
|
|
161504
161586
|
);
|
|
161505
161587
|
exportData.socialIdentityProviders[socialProvider._id] = socialProvider;
|
|
161506
161588
|
}
|
|
@@ -161515,6 +161597,7 @@ async function exportJourney({
|
|
|
161515
161597
|
printMessage({ message: "\n - Scripts:", newline: false, state: state2 });
|
|
161516
161598
|
try {
|
|
161517
161599
|
const scriptObjects = await Promise.all(scriptPromises);
|
|
161600
|
+
const name2uuid = {};
|
|
161518
161601
|
for (const scriptObject of scriptObjects) {
|
|
161519
161602
|
if (scriptObject) {
|
|
161520
161603
|
if (verbose)
|
|
@@ -161527,6 +161610,18 @@ async function exportJourney({
|
|
|
161527
161610
|
});
|
|
161528
161611
|
scriptObject.script = useStringArrays ? convertBase64TextToArray(scriptObject.script) : JSON.stringify(decode(scriptObject.script));
|
|
161529
161612
|
exportData.scripts[scriptObject._id] = scriptObject;
|
|
161613
|
+
const scriptNames = getLibraryScriptNames(scriptObject);
|
|
161614
|
+
for (const scriptName of scriptNames) {
|
|
161615
|
+
if (name2uuid[scriptName] === void 0) {
|
|
161616
|
+
const libScriptObject = await readScriptByName({
|
|
161617
|
+
scriptName,
|
|
161618
|
+
state: state2
|
|
161619
|
+
});
|
|
161620
|
+
name2uuid[scriptName] = libScriptObject._id;
|
|
161621
|
+
libScriptObject.script = useStringArrays ? convertBase64TextToArray(libScriptObject.script) : JSON.stringify(decode(scriptObject.script));
|
|
161622
|
+
exportData.scripts[libScriptObject._id] = libScriptObject;
|
|
161623
|
+
}
|
|
161624
|
+
}
|
|
161530
161625
|
}
|
|
161531
161626
|
}
|
|
161532
161627
|
} catch (error2) {
|
|
@@ -161540,7 +161635,7 @@ async function exportJourney({
|
|
|
161540
161635
|
for (const themeObject of themePromiseResults) {
|
|
161541
161636
|
if (themeObject && // has the theme been specified by id or name in a page node?
|
|
161542
161637
|
(themes.includes(themeObject._id) || themes.includes(themeObject.name) || // has this journey been linked to a theme?
|
|
161543
|
-
_optionalChain([themeObject, 'access',
|
|
161638
|
+
_optionalChain([themeObject, 'access', _162 => _162.linkedTrees, 'optionalAccess', _163 => _163.includes, 'call', _164 => _164(treeObject._id)]))) {
|
|
161544
161639
|
if (verbose)
|
|
161545
161640
|
printMessage({
|
|
161546
161641
|
message: `
|
|
@@ -161823,7 +161918,7 @@ async function importJourney({
|
|
|
161823
161918
|
state: state2
|
|
161824
161919
|
});
|
|
161825
161920
|
} catch (error2) {
|
|
161826
|
-
if (_optionalChain([error2, 'access',
|
|
161921
|
+
if (_optionalChain([error2, 'access', _165 => _165.response, 'optionalAccess', _166 => _166.status]) === 500 && _optionalChain([error2, 'access', _167 => _167.response, 'optionalAccess', _168 => _168.data, 'optionalAccess', _169 => _169.message]) === "Unable to update SMS config: Data validation failed for the attribute, Redirect after form post URL") {
|
|
161827
161922
|
providerData["redirectAfterFormPostURI"] = "";
|
|
161828
161923
|
try {
|
|
161829
161924
|
await putProviderByTypeAndId2({
|
|
@@ -161934,7 +162029,7 @@ async function importJourney({
|
|
|
161934
162029
|
try {
|
|
161935
162030
|
await createCircleOfTrust({ cotData, state: state2 });
|
|
161936
162031
|
} catch (error2) {
|
|
161937
|
-
if (_optionalChain([error2, 'access',
|
|
162032
|
+
if (_optionalChain([error2, 'access', _170 => _170.response, 'optionalAccess', _171 => _171.status]) === 409 || _optionalChain([error2, 'access', _172 => _172.response, 'optionalAccess', _173 => _173.status]) === 500) {
|
|
161938
162033
|
try {
|
|
161939
162034
|
await updateCircleOfTrust({ cotId, cotData, state: state2 });
|
|
161940
162035
|
} catch (updateCotErr) {
|
|
@@ -162021,14 +162116,14 @@ async function importJourney({
|
|
|
162021
162116
|
state: state2
|
|
162022
162117
|
});
|
|
162023
162118
|
} catch (nodeImportError) {
|
|
162024
|
-
if (_optionalChain([nodeImportError, 'access',
|
|
162119
|
+
if (_optionalChain([nodeImportError, 'access', _174 => _174.response, 'optionalAccess', _175 => _175.status]) === 400 && _optionalChain([nodeImportError, 'access', _176 => _176.response, 'optionalAccess', _177 => _177.data, 'optionalAccess', _178 => _178.message]) === "Data validation failed for the attribute, Script") {
|
|
162025
162120
|
errors.push(
|
|
162026
162121
|
new FrodoError(
|
|
162027
162122
|
`Missing script ${innerNodeData["script"]} referenced by inner node ${innerNodeId}${innerNodeId === newUuid ? "" : ` [${newUuid}]`} (${innerNodeData["_type"]["_id"]}) in journey ${treeId}`,
|
|
162028
162123
|
nodeImportError
|
|
162029
162124
|
)
|
|
162030
162125
|
);
|
|
162031
|
-
} else if (_optionalChain([nodeImportError, 'access',
|
|
162126
|
+
} else if (_optionalChain([nodeImportError, 'access', _179 => _179.response, 'optionalAccess', _180 => _180.status]) === 400 && _optionalChain([nodeImportError, 'access', _181 => _181.response, 'optionalAccess', _182 => _182.data, 'optionalAccess', _183 => _183.message]) === "Invalid attribute specified.") {
|
|
162032
162127
|
const { validAttributes } = nodeImportError.response.data.detail;
|
|
162033
162128
|
validAttributes.push("_id");
|
|
162034
162129
|
for (const attribute of Object.keys(innerNodeData)) {
|
|
@@ -162131,14 +162226,14 @@ async function importJourney({
|
|
|
162131
162226
|
try {
|
|
162132
162227
|
await putNode({ nodeId: newUuid, nodeType, nodeData, state: state2 });
|
|
162133
162228
|
} catch (nodeImportError) {
|
|
162134
|
-
if (_optionalChain([nodeImportError, 'access',
|
|
162229
|
+
if (_optionalChain([nodeImportError, 'access', _184 => _184.response, 'optionalAccess', _185 => _185.status]) === 400 && _optionalChain([nodeImportError, 'access', _186 => _186.response, 'optionalAccess', _187 => _187.data, 'optionalAccess', _188 => _188.message]) === "Data validation failed for the attribute, Script") {
|
|
162135
162230
|
errors.push(
|
|
162136
162231
|
new FrodoError(
|
|
162137
162232
|
`Missing script ${nodeData["script"]} referenced by node ${nodeId}${nodeId === newUuid ? "" : ` [${newUuid}]`} (${nodeData["_type"]["_id"]}) in journey ${treeId}`,
|
|
162138
162233
|
nodeImportError
|
|
162139
162234
|
)
|
|
162140
162235
|
);
|
|
162141
|
-
} else if (_optionalChain([nodeImportError, 'access',
|
|
162236
|
+
} else if (_optionalChain([nodeImportError, 'access', _189 => _189.response, 'optionalAccess', _190 => _190.status]) === 400 && _optionalChain([nodeImportError, 'access', _191 => _191.response, 'optionalAccess', _192 => _192.data, 'optionalAccess', _193 => _193.message]) === "Invalid attribute specified.") {
|
|
162142
162237
|
const { validAttributes } = nodeImportError.response.data.detail;
|
|
162143
162238
|
validAttributes.push("_id");
|
|
162144
162239
|
for (const attribute of Object.keys(nodeData)) {
|
|
@@ -162225,7 +162320,7 @@ async function importJourney({
|
|
|
162225
162320
|
state: state2
|
|
162226
162321
|
});
|
|
162227
162322
|
} catch (importError) {
|
|
162228
|
-
if (_optionalChain([importError, 'access',
|
|
162323
|
+
if (_optionalChain([importError, 'access', _194 => _194.response, 'optionalAccess', _195 => _195.status]) === 400 && _optionalChain([importError, 'access', _196 => _196.response, 'optionalAccess', _197 => _197.data, 'optionalAccess', _198 => _198.message]) === "Invalid attribute specified.") {
|
|
162229
162324
|
const { validAttributes } = importError.response.data.detail;
|
|
162230
162325
|
validAttributes.push("_id");
|
|
162231
162326
|
for (const attribute of Object.keys(importData.tree)) {
|
|
@@ -162434,7 +162529,7 @@ var fileByIdTreeExportResolver = async function(treeId, state2) {
|
|
|
162434
162529
|
message: `fileByIdTreeExportResolver: resolved '${treeId}' to ${file}`,
|
|
162435
162530
|
state: state2
|
|
162436
162531
|
});
|
|
162437
|
-
if (_optionalChain([jsonData, 'access',
|
|
162532
|
+
if (_optionalChain([jsonData, 'access', _199 => _199.tree, 'optionalAccess', _200 => _200._id]) === treeId) {
|
|
162438
162533
|
treeExport = jsonData;
|
|
162439
162534
|
} else if (jsonData.trees && jsonData.trees[treeId]) {
|
|
162440
162535
|
treeExport = jsonData.trees[treeId];
|
|
@@ -162453,7 +162548,7 @@ function createFileParamTreeExportResolver(file, state2) {
|
|
|
162453
162548
|
let treeExport = createSingleTreeExportTemplate({ state: state2 });
|
|
162454
162549
|
try {
|
|
162455
162550
|
const jsonData = JSON.parse(_fs3.default.readFileSync(file, "utf8"));
|
|
162456
|
-
if (_optionalChain([jsonData, 'access',
|
|
162551
|
+
if (_optionalChain([jsonData, 'access', _201 => _201.tree, 'optionalAccess', _202 => _202._id]) === treeId) {
|
|
162457
162552
|
treeExport = jsonData;
|
|
162458
162553
|
} else if (jsonData.trees && jsonData.trees[treeId]) {
|
|
162459
162554
|
treeExport = jsonData.trees[treeId];
|
|
@@ -162678,7 +162773,7 @@ async function deleteJourney({
|
|
|
162678
162773
|
});
|
|
162679
162774
|
return response2;
|
|
162680
162775
|
}).catch((error2) => {
|
|
162681
|
-
if (_optionalChain([error2, 'optionalAccess',
|
|
162776
|
+
if (_optionalChain([error2, 'optionalAccess', _203 => _203.response, 'optionalAccess', _204 => _204.data, 'optionalAccess', _205 => _205.code]) === 500 && error2.response.data.message === "Unable to read SMS config: Node did not exist") {
|
|
162682
162777
|
status.nodes[containerNode._id] = { status: "success" };
|
|
162683
162778
|
if (verbose)
|
|
162684
162779
|
printMessage({
|
|
@@ -163670,7 +163765,7 @@ async function importPolicySet({
|
|
|
163670
163765
|
response2 = await createPolicySet({ policySetData, state: state2 });
|
|
163671
163766
|
imported.push(id7);
|
|
163672
163767
|
} catch (error2) {
|
|
163673
|
-
if (_optionalChain([error2, 'access',
|
|
163768
|
+
if (_optionalChain([error2, 'access', _206 => _206.response, 'optionalAccess', _207 => _207.status]) === 409) {
|
|
163674
163769
|
response2 = await updatePolicySet({ policySetData, state: state2 });
|
|
163675
163770
|
imported.push(id7);
|
|
163676
163771
|
} else throw error2;
|
|
@@ -163729,7 +163824,7 @@ async function importFirstPolicySet({
|
|
|
163729
163824
|
response2 = await createPolicySet({ policySetData, state: state2 });
|
|
163730
163825
|
imported.push(id7);
|
|
163731
163826
|
} catch (error2) {
|
|
163732
|
-
if (_optionalChain([error2, 'access',
|
|
163827
|
+
if (_optionalChain([error2, 'access', _208 => _208.response, 'optionalAccess', _209 => _209.status]) === 409) {
|
|
163733
163828
|
response2 = await updatePolicySet({ policySetData, state: state2 });
|
|
163734
163829
|
imported.push(id7);
|
|
163735
163830
|
} else throw error2;
|
|
@@ -163783,7 +163878,7 @@ async function importPolicySets({
|
|
|
163783
163878
|
try {
|
|
163784
163879
|
response2 = await createPolicySet({ policySetData, state: state2 });
|
|
163785
163880
|
} catch (error2) {
|
|
163786
|
-
if (_optionalChain([error2, 'access',
|
|
163881
|
+
if (_optionalChain([error2, 'access', _210 => _210.response, 'optionalAccess', _211 => _211.status]) === 409) {
|
|
163787
163882
|
response2 = await updatePolicySet({ policySetData, state: state2 });
|
|
163788
163883
|
} else throw error2;
|
|
163789
163884
|
}
|
|
@@ -164001,7 +164096,7 @@ async function exportResourceType({
|
|
|
164001
164096
|
debugMessage({ message: `ResourceTypeOps.exportResourceType: end`, state: state2 });
|
|
164002
164097
|
return exportData;
|
|
164003
164098
|
} catch (error2) {
|
|
164004
|
-
if (_optionalChain([error2, 'access',
|
|
164099
|
+
if (_optionalChain([error2, 'access', _212 => _212.response, 'optionalAccess', _213 => _213.status]) === 404) {
|
|
164005
164100
|
throw new FrodoError(
|
|
164006
164101
|
`Resource type ${resourceTypeUuid} does not exist`,
|
|
164007
164102
|
error2
|
|
@@ -164095,7 +164190,7 @@ async function importResourceType({
|
|
|
164095
164190
|
try {
|
|
164096
164191
|
response2 = await createResourceType({ resourceTypeData, state: state2 });
|
|
164097
164192
|
} catch (createError) {
|
|
164098
|
-
if (_optionalChain([createError, 'access',
|
|
164193
|
+
if (_optionalChain([createError, 'access', _214 => _214.response, 'optionalAccess', _215 => _215.status]) === 409)
|
|
164099
164194
|
response2 = await putResourceType({
|
|
164100
164195
|
resourceTypeUuid: id7,
|
|
164101
164196
|
resourceTypeData,
|
|
@@ -164138,7 +164233,7 @@ async function importResourceTypeByName({
|
|
|
164138
164233
|
try {
|
|
164139
164234
|
response2 = await createResourceType({ resourceTypeData, state: state2 });
|
|
164140
164235
|
} catch (createError) {
|
|
164141
|
-
if (_optionalChain([createError, 'access',
|
|
164236
|
+
if (_optionalChain([createError, 'access', _216 => _216.response, 'optionalAccess', _217 => _217.status]) === 409)
|
|
164142
164237
|
response2 = await putResourceType({
|
|
164143
164238
|
resourceTypeUuid: id7,
|
|
164144
164239
|
resourceTypeData,
|
|
@@ -164180,7 +164275,7 @@ async function importFirstResourceType({
|
|
|
164180
164275
|
try {
|
|
164181
164276
|
response2 = await createResourceType({ resourceTypeData, state: state2 });
|
|
164182
164277
|
} catch (createError) {
|
|
164183
|
-
if (_optionalChain([createError, 'access',
|
|
164278
|
+
if (_optionalChain([createError, 'access', _218 => _218.response, 'optionalAccess', _219 => _219.status]) === 409)
|
|
164184
164279
|
response2 = await putResourceType({
|
|
164185
164280
|
resourceTypeUuid: id7,
|
|
164186
164281
|
resourceTypeData,
|
|
@@ -164215,7 +164310,7 @@ async function importResourceTypes({
|
|
|
164215
164310
|
try {
|
|
164216
164311
|
response2.push(await createResourceType({ resourceTypeData, state: state2 }));
|
|
164217
164312
|
} catch (createError) {
|
|
164218
|
-
if (_optionalChain([createError, 'access',
|
|
164313
|
+
if (_optionalChain([createError, 'access', _220 => _220.response, 'optionalAccess', _221 => _221.status]) === 409)
|
|
164219
164314
|
response2.push(
|
|
164220
164315
|
await putResourceType({
|
|
164221
164316
|
resourceTypeUuid: id7,
|
|
@@ -165309,8 +165404,8 @@ async function getFullServices({
|
|
|
165309
165404
|
nextDescendents
|
|
165310
165405
|
};
|
|
165311
165406
|
} catch (error2) {
|
|
165312
|
-
if (!(_optionalChain([error2, 'access',
|
|
165313
|
-
const message = _optionalChain([error2, 'access',
|
|
165407
|
+
if (!(_optionalChain([error2, 'access', _222 => _222.response, 'optionalAccess', _223 => _223.status]) === 403 && _optionalChain([error2, 'access', _224 => _224.response, 'optionalAccess', _225 => _225.data, 'optionalAccess', _226 => _226.message]) === "This operation is not available in ForgeRock Identity Cloud.")) {
|
|
165408
|
+
const message = _optionalChain([error2, 'access', _227 => _227.response, 'optionalAccess', _228 => _228.data, 'optionalAccess', _229 => _229.message]);
|
|
165314
165409
|
printMessage({
|
|
165315
165410
|
message: `Unable to retrieve data for ${listItem._id} with error: ${message}`,
|
|
165316
165411
|
type: "error",
|
|
@@ -165350,7 +165445,7 @@ async function putFullService({
|
|
|
165350
165445
|
debugMessage({ message: `ServiceOps.putFullService: clean`, state: state2 });
|
|
165351
165446
|
await deleteFullService({ serviceId, globalConfig, state: state2 });
|
|
165352
165447
|
} catch (error2) {
|
|
165353
|
-
if (!(_optionalChain([error2, 'access',
|
|
165448
|
+
if (!(_optionalChain([error2, 'access', _230 => _230.response, 'optionalAccess', _231 => _231.status]) === 404 && _optionalChain([error2, 'access', _232 => _232.response, 'optionalAccess', _233 => _233.data, 'optionalAccess', _234 => _234.message]) === "Not Found")) {
|
|
165354
165449
|
throw new FrodoError(
|
|
165355
165450
|
`Error deleting service '${serviceId}' before import`,
|
|
165356
165451
|
error2
|
|
@@ -165515,8 +165610,8 @@ async function deleteFullServices({
|
|
|
165515
165610
|
state: state2
|
|
165516
165611
|
});
|
|
165517
165612
|
} catch (error2) {
|
|
165518
|
-
if (!(_optionalChain([error2, 'access',
|
|
165519
|
-
const message = _optionalChain([error2, 'access',
|
|
165613
|
+
if (!(_optionalChain([error2, 'access', _235 => _235.response, 'optionalAccess', _236 => _236.status]) === 403 && _optionalChain([error2, 'access', _237 => _237.response, 'optionalAccess', _238 => _238.data, 'optionalAccess', _239 => _239.message]) === "This operation is not available in ForgeRock Identity Cloud.")) {
|
|
165614
|
+
const message = _optionalChain([error2, 'access', _240 => _240.response, 'optionalAccess', _241 => _241.data, 'optionalAccess', _242 => _242.message]);
|
|
165520
165615
|
printMessage({
|
|
165521
165616
|
message: `Delete service '${serviceListItem._id}': ${message}`,
|
|
165522
165617
|
state: state2,
|
|
@@ -165734,20 +165829,20 @@ async function exportFullConfiguration({
|
|
|
165734
165829
|
exportSaml2Providers,
|
|
165735
165830
|
stateObj,
|
|
165736
165831
|
errors
|
|
165737
|
-
)), 'optionalAccess', async
|
|
165832
|
+
)), 'optionalAccess', async _243 => _243.saml]);
|
|
165738
165833
|
const cotExport = await exportOrImportWithErrorHandling(
|
|
165739
165834
|
exportCirclesOfTrust,
|
|
165740
165835
|
stateObj,
|
|
165741
165836
|
errors
|
|
165742
165837
|
);
|
|
165743
165838
|
if (saml) {
|
|
165744
|
-
saml.cot = _optionalChain([cotExport, 'optionalAccess',
|
|
165839
|
+
saml.cot = _optionalChain([cotExport, 'optionalAccess', _244 => _244.saml, 'access', _245 => _245.cot]);
|
|
165745
165840
|
} else {
|
|
165746
|
-
saml = _optionalChain([cotExport, 'optionalAccess',
|
|
165841
|
+
saml = _optionalChain([cotExport, 'optionalAccess', _246 => _246.saml]);
|
|
165747
165842
|
}
|
|
165748
165843
|
const fullExport = {
|
|
165749
165844
|
meta: getMetadata(stateObj),
|
|
165750
|
-
agents: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(exportAgents, stateObj, errors)), 'optionalAccess', async
|
|
165845
|
+
agents: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(exportAgents, stateObj, errors)), 'optionalAccess', async _247 => _247.agents]),
|
|
165751
165846
|
application: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165752
165847
|
exportOAuth2Clients,
|
|
165753
165848
|
{
|
|
@@ -165755,27 +165850,27 @@ async function exportFullConfiguration({
|
|
|
165755
165850
|
state: state2
|
|
165756
165851
|
},
|
|
165757
165852
|
errors
|
|
165758
|
-
)), 'optionalAccess', async
|
|
165853
|
+
)), 'optionalAccess', async _248 => _248.application]),
|
|
165759
165854
|
authentication: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165760
165855
|
exportAuthenticationSettings,
|
|
165761
165856
|
stateObj,
|
|
165762
165857
|
errors
|
|
165763
|
-
)), 'optionalAccess', async
|
|
165858
|
+
)), 'optionalAccess', async _249 => _249.authentication]),
|
|
165764
165859
|
config: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165765
165860
|
exportConfigEntities,
|
|
165766
165861
|
stateObj,
|
|
165767
165862
|
errors
|
|
165768
|
-
)), 'optionalAccess', async
|
|
165863
|
+
)), 'optionalAccess', async _250 => _250.config]),
|
|
165769
165864
|
emailTemplate: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165770
165865
|
exportEmailTemplates,
|
|
165771
165866
|
stateObj,
|
|
165772
165867
|
errors
|
|
165773
|
-
)), 'optionalAccess', async
|
|
165868
|
+
)), 'optionalAccess', async _251 => _251.emailTemplate]),
|
|
165774
165869
|
idp: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165775
165870
|
exportSocialIdentityProviders,
|
|
165776
165871
|
stateObj,
|
|
165777
165872
|
errors
|
|
165778
|
-
)), 'optionalAccess', async
|
|
165873
|
+
)), 'optionalAccess', async _252 => _252.idp]),
|
|
165779
165874
|
managedApplication: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165780
165875
|
exportApplications,
|
|
165781
165876
|
{
|
|
@@ -165783,7 +165878,7 @@ async function exportFullConfiguration({
|
|
|
165783
165878
|
state: state2
|
|
165784
165879
|
},
|
|
165785
165880
|
errors
|
|
165786
|
-
)), 'optionalAccess', async
|
|
165881
|
+
)), 'optionalAccess', async _253 => _253.managedApplication]),
|
|
165787
165882
|
policy: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165788
165883
|
exportPolicies,
|
|
165789
165884
|
{
|
|
@@ -165791,7 +165886,7 @@ async function exportFullConfiguration({
|
|
|
165791
165886
|
state: state2
|
|
165792
165887
|
},
|
|
165793
165888
|
errors
|
|
165794
|
-
)), 'optionalAccess', async
|
|
165889
|
+
)), 'optionalAccess', async _254 => _254.policy]),
|
|
165795
165890
|
policyset: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165796
165891
|
exportPolicySets,
|
|
165797
165892
|
{
|
|
@@ -165799,22 +165894,22 @@ async function exportFullConfiguration({
|
|
|
165799
165894
|
state: state2
|
|
165800
165895
|
},
|
|
165801
165896
|
errors
|
|
165802
|
-
)), 'optionalAccess', async
|
|
165897
|
+
)), 'optionalAccess', async _255 => _255.policyset]),
|
|
165803
165898
|
resourcetype: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165804
165899
|
exportResourceTypes,
|
|
165805
165900
|
stateObj,
|
|
165806
165901
|
errors
|
|
165807
|
-
)), 'optionalAccess', async
|
|
165902
|
+
)), 'optionalAccess', async _256 => _256.resourcetype]),
|
|
165808
165903
|
saml,
|
|
165809
165904
|
script: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165810
165905
|
exportScripts,
|
|
165811
165906
|
{
|
|
165812
|
-
includeDefault,
|
|
165907
|
+
options: { includeLibraries: false, includeDefault, useStringArrays },
|
|
165813
165908
|
state: state2
|
|
165814
165909
|
},
|
|
165815
165910
|
errors
|
|
165816
|
-
)), 'optionalAccess', async
|
|
165817
|
-
secrets: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(exportSecrets, stateObj, errors)), 'optionalAccess', async
|
|
165911
|
+
)), 'optionalAccess', async _257 => _257.script]),
|
|
165912
|
+
secrets: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(exportSecrets, stateObj, errors)), 'optionalAccess', async _258 => _258.secrets]),
|
|
165818
165913
|
service: {
|
|
165819
165914
|
...await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165820
165915
|
exportServices,
|
|
@@ -165823,7 +165918,7 @@ async function exportFullConfiguration({
|
|
|
165823
165918
|
state: state2
|
|
165824
165919
|
},
|
|
165825
165920
|
errors
|
|
165826
|
-
)), 'optionalAccess', async
|
|
165921
|
+
)), 'optionalAccess', async _259 => _259.service]),
|
|
165827
165922
|
...await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165828
165923
|
exportServices,
|
|
165829
165924
|
{
|
|
@@ -165831,9 +165926,9 @@ async function exportFullConfiguration({
|
|
|
165831
165926
|
state: state2
|
|
165832
165927
|
},
|
|
165833
165928
|
errors
|
|
165834
|
-
)), 'optionalAccess', async
|
|
165929
|
+
)), 'optionalAccess', async _260 => _260.service])
|
|
165835
165930
|
},
|
|
165836
|
-
theme: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(exportThemes, stateObj, errors)), 'optionalAccess', async
|
|
165931
|
+
theme: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(exportThemes, stateObj, errors)), 'optionalAccess', async _261 => _261.theme]),
|
|
165837
165932
|
trees: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165838
165933
|
exportJourneys,
|
|
165839
165934
|
{
|
|
@@ -165841,7 +165936,7 @@ async function exportFullConfiguration({
|
|
|
165841
165936
|
state: state2
|
|
165842
165937
|
},
|
|
165843
165938
|
errors
|
|
165844
|
-
)), 'optionalAccess', async
|
|
165939
|
+
)), 'optionalAccess', async _262 => _262.trees]),
|
|
165845
165940
|
variables: await _asyncOptionalChain([(await exportOrImportWithErrorHandling(
|
|
165846
165941
|
exportVariables,
|
|
165847
165942
|
{
|
|
@@ -165849,7 +165944,7 @@ async function exportFullConfiguration({
|
|
|
165849
165944
|
state: state2
|
|
165850
165945
|
},
|
|
165851
165946
|
errors
|
|
165852
|
-
)), 'optionalAccess', async
|
|
165947
|
+
)), 'optionalAccess', async _263 => _263.variables])
|
|
165853
165948
|
};
|
|
165854
165949
|
if (throwErrors && errors.length > 0) {
|
|
165855
165950
|
throw new FrodoError(`Error exporting full config`, errors);
|
|
@@ -167350,10 +167445,10 @@ var FrodoStubCommand = class extends Command {
|
|
|
167350
167445
|
if (!process.listenerCount("unhandledRejection")) {
|
|
167351
167446
|
process.on("unhandledRejection", (error2) => {
|
|
167352
167447
|
printMessage2(
|
|
167353
|
-
`${_optionalChain([error2, 'access',
|
|
167448
|
+
`${_optionalChain([error2, 'access', _264 => _264.config, 'optionalAccess', _265 => _265.method]) ? error2.config.method + " " : ""}${_optionalChain([error2, 'access', _266 => _266.config, 'optionalAccess', _267 => _267.url]) ? error2.config.url : ""}`,
|
|
167354
167449
|
"error"
|
|
167355
167450
|
);
|
|
167356
|
-
printMessage2(_optionalChain([error2, 'access',
|
|
167451
|
+
printMessage2(_optionalChain([error2, 'access', _268 => _268.response, 'optionalAccess', _269 => _269.data]), "error");
|
|
167357
167452
|
printMessage2(error2.stack, "error");
|
|
167358
167453
|
printMessage2(
|
|
167359
167454
|
`Please report this unhandled error here: https://github.com/rockcarver/frodo-cli/issues`,
|
|
@@ -169060,7 +169155,7 @@ In AM, create a trusted issuer in the ${state.getRealm()} realm with the followi
|
|
|
169060
169155
|
]);
|
|
169061
169156
|
issuer.push([
|
|
169062
169157
|
"Allowed Subjects "["brightCyan"],
|
|
169063
|
-
_optionalChain([artefacts, 'access',
|
|
169158
|
+
_optionalChain([artefacts, 'access', _270 => _270.issuer, 'access', _271 => _271.allowedSubjects, 'optionalAccess', _272 => _272.value, 'access', _273 => _273.length]) ? _optionalChain([artefacts, 'access', _274 => _274.issuer, 'access', _275 => _275.allowedSubjects, 'optionalAccess', _276 => _276.value, 'access', _277 => _277.join, 'call', _278 => _278(", ")]) : `Any ${state.getRealm()} realm user`
|
|
169064
169159
|
]);
|
|
169065
169160
|
issuer.push([
|
|
169066
169161
|
"JWKS (Public Key)"["brightCyan"],
|
|
@@ -169188,7 +169283,7 @@ async function executeRfc7523AuthZGrantFlow2(clientId, iss, jwk, sub, scope, jso
|
|
|
169188
169283
|
stopProgressIndicator2(
|
|
169189
169284
|
spinnerId,
|
|
169190
169285
|
`Error executing rfc7523 authz grant flow: ${stringify9(
|
|
169191
|
-
_optionalChain([error2, 'access',
|
|
169286
|
+
_optionalChain([error2, 'access', _279 => _279.response, 'optionalAccess', _280 => _280.data]) || error2.message
|
|
169192
169287
|
)}`,
|
|
169193
169288
|
"fail"
|
|
169194
169289
|
);
|
|
@@ -176057,7 +176152,11 @@ async function exportScriptsToFile(file, includeMeta = true, includeDefault = fa
|
|
|
176057
176152
|
if (file) {
|
|
176058
176153
|
fileName = file;
|
|
176059
176154
|
}
|
|
176060
|
-
const scriptExport = await exportScripts2(
|
|
176155
|
+
const scriptExport = await exportScripts2({
|
|
176156
|
+
includeLibraries: true,
|
|
176157
|
+
includeDefault,
|
|
176158
|
+
useStringArrays: true
|
|
176159
|
+
});
|
|
176061
176160
|
saveJsonToFile10(scriptExport, getFilePath11(fileName, true), includeMeta);
|
|
176062
176161
|
debugMessage2(`Cli.ScriptOps.exportScriptsToFile: end`);
|
|
176063
176162
|
return true;
|
|
@@ -177062,7 +177161,7 @@ async function tailLogs(source, levels, txid, cookie, nf) {
|
|
|
177062
177161
|
filteredLogs = logsObject.result.filter(
|
|
177063
177162
|
(el) => !noiseFilter.includes(
|
|
177064
177163
|
el.payload.logger
|
|
177065
|
-
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el))) && (typeof txid === "undefined" || txid === null || _optionalChain([el, 'access',
|
|
177164
|
+
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el))) && (typeof txid === "undefined" || txid === null || _optionalChain([el, 'access', _281 => _281.payload, 'access', _282 => _282.transactionId, 'optionalAccess', _283 => _283.includes, 'call', _284 => _284(
|
|
177066
177165
|
txid
|
|
177067
177166
|
)]))
|
|
177068
177167
|
);
|
|
@@ -177086,7 +177185,7 @@ async function fetchLogs(source, startTs, endTs, levels, txid, ffString, cookie,
|
|
|
177086
177185
|
filteredLogs = logsObject.result.filter(
|
|
177087
177186
|
(el) => !noiseFilter.includes(
|
|
177088
177187
|
el.payload.logger
|
|
177089
|
-
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el))) && (typeof txid === "undefined" || txid === null || _optionalChain([el, 'access',
|
|
177188
|
+
) && !noiseFilter.includes(el.type) && (levels[0] === "ALL" || levels.includes(resolvePayloadLevel2(el))) && (typeof txid === "undefined" || txid === null || _optionalChain([el, 'access', _285 => _285.payload, 'access', _286 => _286.transactionId, 'optionalAccess', _287 => _287.includes, 'call', _288 => _288(
|
|
177090
177189
|
txid
|
|
177091
177190
|
)]))
|
|
177092
177191
|
);
|
|
@@ -177240,9 +177339,9 @@ function setup79() {
|
|
|
177240
177339
|
`Created log API key ${creds.api_key_id} and secret.`
|
|
177241
177340
|
);
|
|
177242
177341
|
} catch (error2) {
|
|
177243
|
-
printMessage2(_optionalChain([error2, 'access',
|
|
177342
|
+
printMessage2(_optionalChain([error2, 'access', _289 => _289.response, 'optionalAccess', _290 => _290.data]), "error");
|
|
177244
177343
|
printMessage2(
|
|
177245
|
-
`Error creating log API key and secret: ${_optionalChain([error2, 'access',
|
|
177344
|
+
`Error creating log API key and secret: ${_optionalChain([error2, 'access', _291 => _291.response, 'optionalAccess', _292 => _292.data, 'optionalAccess', _293 => _293.message])}`,
|
|
177246
177345
|
"error"
|
|
177247
177346
|
);
|
|
177248
177347
|
process.exitCode = 1;
|
|
@@ -177929,7 +178028,7 @@ function setup86() {
|
|
|
177929
178028
|
printMessage2(updatesTable.toString(), "data");
|
|
177930
178029
|
}
|
|
177931
178030
|
if (!options2.checkOnly) {
|
|
177932
|
-
if (_optionalChain([updates, 'access',
|
|
178031
|
+
if (_optionalChain([updates, 'access', _294 => _294.secrets, 'optionalAccess', _295 => _295.length]) || _optionalChain([updates, 'access', _296 => _296.variables, 'optionalAccess', _297 => _297.length]) || options2.force) {
|
|
177933
178032
|
const ok = options2.yes || await (0, import_yesno.default)({
|
|
177934
178033
|
question: `
|
|
177935
178034
|
Changes may take up to 10 minutes to propagate, during which time you will not be able to make further updates.
|
|
@@ -181110,7 +181209,7 @@ function getNodeClassificationMd(nodeType) {
|
|
|
181110
181209
|
function getOneLineDescription5(nodeObj, nodeRef) {
|
|
181111
181210
|
const description = `[${nodeObj._id["brightCyan"]}] (${getNodeClassification2(
|
|
181112
181211
|
nodeObj._type._id
|
|
181113
|
-
).join(", ")}) ${nodeObj._type._id}${nodeRef ? " - " + _optionalChain([nodeRef, 'optionalAccess',
|
|
181212
|
+
).join(", ")}) ${nodeObj._type._id}${nodeRef ? " - " + _optionalChain([nodeRef, 'optionalAccess', _298 => _298.displayName]) : ""}`;
|
|
181114
181213
|
return description;
|
|
181115
181214
|
}
|
|
181116
181215
|
function getTableHeaderMd5() {
|
|
@@ -181845,7 +181944,7 @@ async function listJourneys(long = false, analyze = false) {
|
|
|
181845
181944
|
table.push([
|
|
181846
181945
|
`${journeyStub._id}`,
|
|
181847
181946
|
journeyStub.enabled === false ? "disabled"["brightRed"] : "enabled"["brightGreen"],
|
|
181848
|
-
_optionalChain([journeyStub, 'access',
|
|
181947
|
+
_optionalChain([journeyStub, 'access', _299 => _299.uiConfig, 'optionalAccess', _300 => _300.categories]) ? wordwrap(
|
|
181849
181948
|
JSON.parse(journeyStub.uiConfig.categories).join(", "),
|
|
181850
181949
|
60
|
|
181851
181950
|
) : ""
|
|
@@ -181887,7 +181986,7 @@ async function listJourneys(long = false, analyze = false) {
|
|
|
181887
181986
|
`${journeyExport.tree._id}`,
|
|
181888
181987
|
journeyExport.tree.enabled === false ? "disabled"["brightRed"] : "enabled"["brightGreen"],
|
|
181889
181988
|
getJourneyClassification2(journeyExport).join(", "),
|
|
181890
|
-
_optionalChain([journeyExport, 'access',
|
|
181989
|
+
_optionalChain([journeyExport, 'access', _301 => _301.tree, 'access', _302 => _302.uiConfig, 'optionalAccess', _303 => _303.categories]) ? wordwrap(
|
|
181891
181990
|
JSON.parse(journeyExport.tree.uiConfig.categories).join(
|
|
181892
181991
|
", "
|
|
181893
181992
|
),
|
|
@@ -182290,7 +182389,7 @@ async function describeJourney(journeyData, resolveTreeExport = onlineTreeExport
|
|
|
182290
182389
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
182291
182390
|
}
|
|
182292
182391
|
}
|
|
182293
|
-
if (!state.getAmVersion() && _optionalChain([journeyData, 'access',
|
|
182392
|
+
if (!state.getAmVersion() && _optionalChain([journeyData, 'access', _304 => _304.meta, 'optionalAccess', _305 => _305.originAmVersion])) {
|
|
182294
182393
|
state.setAmVersion(journeyData.meta.originAmVersion);
|
|
182295
182394
|
}
|
|
182296
182395
|
printMessage2(`${getOneLineDescription8(journeyData.tree)}`, "data");
|
|
@@ -182314,7 +182413,7 @@ ${getJourneyClassification2(journeyData).join(", ")}`,
|
|
|
182314
182413
|
"data"
|
|
182315
182414
|
);
|
|
182316
182415
|
}
|
|
182317
|
-
if (_optionalChain([journeyData, 'access',
|
|
182416
|
+
if (_optionalChain([journeyData, 'access', _306 => _306.tree, 'access', _307 => _307.uiConfig, 'optionalAccess', _308 => _308.categories]) && journeyData.tree.uiConfig.categories != "[]") {
|
|
182318
182417
|
printMessage2("\nCategories/Tags", "data");
|
|
182319
182418
|
printMessage2(
|
|
182320
182419
|
`${JSON.parse(journeyData.tree.uiConfig.categories).join(", ")}`,
|
|
@@ -182356,7 +182455,7 @@ Nodes (${Object.entries(allNodes).length}):`, "data");
|
|
|
182356
182455
|
);
|
|
182357
182456
|
}
|
|
182358
182457
|
}
|
|
182359
|
-
if (_optionalChain([journeyData, 'access',
|
|
182458
|
+
if (_optionalChain([journeyData, 'access', _309 => _309.themes, 'optionalAccess', _310 => _310.length])) {
|
|
182360
182459
|
printMessage2(`
|
|
182361
182460
|
Themes (${journeyData.themes.length}):`, "data");
|
|
182362
182461
|
for (const themeData of journeyData.themes) {
|
|
@@ -182450,14 +182549,14 @@ async function describeJourneyMd(journeyData, resolveTreeExport = onlineTreeExpo
|
|
|
182450
182549
|
nodeTypeMap[nodeData._type._id] = 1;
|
|
182451
182550
|
}
|
|
182452
182551
|
}
|
|
182453
|
-
if (!state.getAmVersion() && _optionalChain([journeyData, 'access',
|
|
182552
|
+
if (!state.getAmVersion() && _optionalChain([journeyData, 'access', _311 => _311.meta, 'optionalAccess', _312 => _312.originAmVersion])) {
|
|
182454
182553
|
state.setAmVersion(journeyData.meta.originAmVersion);
|
|
182455
182554
|
}
|
|
182456
182555
|
printMessage2(
|
|
182457
182556
|
`# ${getOneLineDescriptionMd(journeyData.tree)} - ${journeyData.tree.enabled === false ? ":o: `disabled`" : ":white_check_mark: `enabled`"}, ${getJourneyClassificationMd(journeyData).join(", ")}`,
|
|
182458
182557
|
"data"
|
|
182459
182558
|
);
|
|
182460
|
-
if (_optionalChain([journeyData, 'access',
|
|
182559
|
+
if (_optionalChain([journeyData, 'access', _313 => _313.tree, 'access', _314 => _314.uiConfig, 'optionalAccess', _315 => _315.categories]) && journeyData.tree.uiConfig.categories != "[]") {
|
|
182461
182560
|
printMessage2(
|
|
182462
182561
|
`\`${JSON.parse(journeyData.tree.uiConfig.categories).join("`, `")}\``,
|
|
182463
182562
|
"data"
|
|
@@ -182501,7 +182600,7 @@ ${journeyData.tree.description}`, "data");
|
|
|
182501
182600
|
);
|
|
182502
182601
|
}
|
|
182503
182602
|
}
|
|
182504
|
-
if (_optionalChain([journeyData, 'access',
|
|
182603
|
+
if (_optionalChain([journeyData, 'access', _316 => _316.themes, 'optionalAccess', _317 => _317.length])) {
|
|
182505
182604
|
printMessage2(`## Themes (${journeyData.themes.length})`, "data");
|
|
182506
182605
|
printMessage2(getTableHeaderMd7(), "data");
|
|
182507
182606
|
for (const themeData of journeyData.themes) {
|
|
@@ -182771,9 +182870,9 @@ function setup119() {
|
|
|
182771
182870
|
journeyData = fileData.trees[options2.journeyId];
|
|
182772
182871
|
} else if (typeof options2.journeyId === "undefined" && fileData.trees) {
|
|
182773
182872
|
[journeyData] = Object.values(fileData.trees);
|
|
182774
|
-
} else if (typeof options2.journeyId !== "undefined" && options2.journeyId === _optionalChain([fileData, 'access',
|
|
182873
|
+
} else if (typeof options2.journeyId !== "undefined" && options2.journeyId === _optionalChain([fileData, 'access', _318 => _318.tree, 'optionalAccess', _319 => _319._id])) {
|
|
182775
182874
|
journeyData = fileData;
|
|
182776
|
-
} else if (typeof options2.journeyId === "undefined" && _optionalChain([fileData, 'access',
|
|
182875
|
+
} else if (typeof options2.journeyId === "undefined" && _optionalChain([fileData, 'access', _320 => _320.tree, 'optionalAccess', _321 => _321._id])) {
|
|
182777
182876
|
journeyData = fileData;
|
|
182778
182877
|
} else {
|
|
182779
182878
|
throw new Error(
|
|
@@ -184146,7 +184245,7 @@ async function listRealms(long = false) {
|
|
|
184146
184245
|
} catch (error2) {
|
|
184147
184246
|
printMessage2(error2, "error");
|
|
184148
184247
|
printMessage2(`Error listing realms: ${error2.rmessage}`, "error");
|
|
184149
|
-
printMessage2(_optionalChain([error2, 'access',
|
|
184248
|
+
printMessage2(_optionalChain([error2, 'access', _322 => _322.response, 'optionalAccess', _323 => _323.data]), "error");
|
|
184150
184249
|
}
|
|
184151
184250
|
}
|
|
184152
184251
|
async function describeRealm(realm2) {
|
|
@@ -185306,7 +185405,7 @@ async function importServiceFromFile(serviceId, file, options2 = {
|
|
|
185306
185405
|
);
|
|
185307
185406
|
const data2 = _fs3.default.readFileSync(filePath, "utf8");
|
|
185308
185407
|
const importData = JSON.parse(data2);
|
|
185309
|
-
if (_optionalChain([importData, 'optionalAccess',
|
|
185408
|
+
if (_optionalChain([importData, 'optionalAccess', _324 => _324.service, 'access', _325 => _325[serviceId]])) {
|
|
185310
185409
|
await importService2(serviceId, importData, options2);
|
|
185311
185410
|
stopProgressIndicator2(
|
|
185312
185411
|
indicatorId,
|
|
@@ -186090,7 +186189,7 @@ var compareVersions = (v12, v2) => {
|
|
|
186090
186189
|
// package.json
|
|
186091
186190
|
var package_default2 = {
|
|
186092
186191
|
name: "@rockcarver/frodo-cli",
|
|
186093
|
-
version: "2.0.0-
|
|
186192
|
+
version: "2.0.0-62",
|
|
186094
186193
|
type: "module",
|
|
186095
186194
|
description: "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
|
|
186096
186195
|
keywords: [
|
|
@@ -186120,14 +186219,13 @@ var package_default2 = {
|
|
|
186120
186219
|
main: "dist/launch.cjs",
|
|
186121
186220
|
scripts: {
|
|
186122
186221
|
test: "npm run test:only",
|
|
186123
|
-
"test:only": "NODE_OPTIONS
|
|
186124
|
-
"test:debug": "NODE_OPTIONS
|
|
186125
|
-
test2: "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
186126
|
-
"test:local": "npm run build && node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
186127
|
-
"test:debug2": "node --no-warnings --experimental-vm-modules --experimental-specifier-resolution=node node_modules/jest/bin/jest.js --verbose=true --silent=false",
|
|
186222
|
+
"test:only": "NODE_OPTIONS='--no-warnings --experimental-vm-modules' npx jest --silent",
|
|
186223
|
+
"test:debug": "NODE_OPTIONS='--no-warnings --experimental-vm-modules' npx jest --verbose=true --silent=false",
|
|
186128
186224
|
lint: "eslint --ext .ts --ignore-path .gitignore .",
|
|
186129
186225
|
"lint:fix": "eslint --fix --ext .ts --ignore-path .gitignore .",
|
|
186130
|
-
build: "
|
|
186226
|
+
build: "npm run build:binary",
|
|
186227
|
+
"build:only": "npx tsup && npx tsc",
|
|
186228
|
+
"build:binary": "npm run build:only && npm run dist-pkg",
|
|
186131
186229
|
"dist-pkg": "pkg -C Gzip -t node18 --config package.json -o frodo dist/app.cjs",
|
|
186132
186230
|
link: "npm link ../frodo-lib",
|
|
186133
186231
|
dev: "npx tsup --watch src"
|
|
@@ -186201,7 +186299,7 @@ var package_default2 = {
|
|
|
186201
186299
|
]
|
|
186202
186300
|
},
|
|
186203
186301
|
devDependencies: {
|
|
186204
|
-
"@rockcarver/frodo-lib": "2.0.0-
|
|
186302
|
+
"@rockcarver/frodo-lib": "2.0.0-86",
|
|
186205
186303
|
"@types/colors": "^1.2.1",
|
|
186206
186304
|
"@types/fs-extra": "^11.0.1",
|
|
186207
186305
|
"@types/jest": "^29.2.3",
|