Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Further improve exports using the -a and -A options to no longer stop prematurely if errors are encountered. This version resolves issues with large sets of IDM configurations.

## [3.0.8] - 2025-09-11

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
]
},
"devDependencies": {
"@rockcarver/frodo-lib": "3.3.2",
"@rockcarver/frodo-lib": "3.3.3",
"@types/colors": "^1.2.1",
"@types/fs-extra": "^11.0.1",
"@types/jest": "^29.2.3",
Expand Down
20 changes: 20 additions & 0 deletions src/cli/shell/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@ import repl from 'node:repl';

import { frodo } from '@rockcarver/frodo-lib';
import { Option } from 'commander';
import util from 'util';
import vm from 'vm';

import * as s from '../../help/SampleData';
import { getTokens } from '../../ops/AuthenticateOps';
import { printMessage } from '../../utils/Console';
import { FrodoCommand } from '../FrodoCommand';

async function startRepl(allowAwait = false) {
const baseConfig = {
prompt: '> ',
ignoreUndefined: true,
useGlobal: true,
useColors: true,
writer: function (output) {
// Check if the output is an object
if (typeof output === 'object' && output !== null) {
// Use util.inspect with desired depth
return util.inspect(output, {
depth: 10,
colors: true,
maxArrayLength: null,
});
}
// For non-object outputs, return as is
return output;
},
};

const configWithoutAwait = {
Expand All @@ -25,6 +41,7 @@ async function startRepl(allowAwait = false) {
const replServer = repl.start(allowAwait ? baseConfig : configWithoutAwait);

replServer.context.frodoLib = frodo;
replServer.context.frodo = frodo;
}

export default function setup() {
Expand Down Expand Up @@ -59,6 +76,9 @@ export default function setup() {
command
);
if (host) await getTokens();
printMessage(
'Welcome to the interactive frodo shell!\nFor help type ".help", to quit shell type ".exit".\n\nType "frodo" to see a hierarchy of all available Frodo Library commands.\n\nSample commands:\n - "frodo.info.getInfo()" - prints information about the currently connected environment\n - "frodo.login.getTokens()" - gets fresh or cached tokens\n'
);
startRepl(options.allowAwait);
});
return program;
Expand Down
12 changes: 10 additions & 2 deletions src/ops/JourneyOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ export async function exportJourneyToFile(
delete fileData.meta;
if (verbose)
spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);
saveJsonToFile({ trees: { [fileData.tree._id]: fileData } }, filePath, includeMeta);
saveJsonToFile(
{ trees: { [fileData.tree._id]: fileData } },
filePath,
includeMeta
);
stopProgressIndicator(
spinnerId,
`Exported ${journeyId['brightCyan']} to ${filePath['brightCyan']}.`,
Expand Down Expand Up @@ -270,7 +274,11 @@ export async function exportJourneysToFiles(
const file = getFilePath(getTypedFilename(`${treeId}`, 'journey'), true);
try {
updateProgressIndicator(indicatorId, `Saving ${treeId} to ${file}`);
saveJsonToFile({ trees: { [treeValue.tree._id]: treeValue } }, file, includeMeta);
saveJsonToFile(
{ trees: { [treeValue.tree._id]: treeValue } },
file,
includeMeta
);
stopProgressIndicator(indicatorId, `${treeId} saved to ${file}`);
} catch (error) {
stopProgressIndicator(indicatorId, `Error saving ${treeId} to ${file}`);
Expand Down
150 changes: 150 additions & 0 deletions src/ops/templates/GenericExtensionAttributesTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,156 @@
"userEditable": true,
"viewable": true
},
"frIndexedString6": {
"description": "Generic Indexed String 6",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 6",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString7": {
"description": "Generic Indexed String 7",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 7",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString8": {
"description": "Generic Indexed String 8",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 8",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString9": {
"description": "Generic Indexed String 9",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 9",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString10": {
"description": "Generic Indexed String 10",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 10",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString11": {
"description": "Generic Indexed String 11",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 11",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString12": {
"description": "Generic Indexed String 12",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 12",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString13": {
"description": "Generic Indexed String 13",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 13",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString14": {
"description": "Generic Indexed String 14",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 14",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString15": {
"description": "Generic Indexed String 15",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 15",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString16": {
"description": "Generic Indexed String 16",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 16",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString17": {
"description": "Generic Indexed String 17",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 17",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString18": {
"description": "Generic Indexed String 18",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 18",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString19": {
"description": "Generic Indexed String 19",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 19",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frIndexedString20": {
"description": "Generic Indexed String 20",
"isPersonal": false,
"searchable": true,
"title": "Generic Indexed String 20",
"type": "string",
"usageDescription": "",
"userEditable": true,
"viewable": true
},
"frUnindexedDate1": {
"description": "Generic Unindexed Date 1",
"isPersonal": false,
Expand Down
4 changes: 3 additions & 1 deletion src/utils/Console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ export function printError(error: Error, message?: string) {
errorMessage += code ? `\n Code: ${code}` : '';
errorMessage += status ? `\n Status: ${status}` : '';
errorMessage += message ? `\n Message: ${message}` : '';
errorMessage += detail ? `\n Detail: ${detail}` : '';
errorMessage += detail
? `\n Detail: ${typeof detail === 'object' ? JSON.stringify(detail) : detail}`
: '';
printMessage(errorMessage, 'error');
break;
}
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/__snapshots__/authz-policy-delete.e2e.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ exports[`frodo authz policy delete "frodo authz policy delete --policy-id 'Test
✖ Error deleting policy Test Policy
Error deleting alpha realm policy Test Policy
HTTP client error
Code: ERR_BAD_REQUEST
URL: https://openam-frodo-dev.forgeblocks.com/am/json/realms/root/realms/alpha/policies/Test Policy
Status: 404
Code: ERR_BAD_REQUEST
Reason: Not Found
Message: Policy Test Policy does not exist.
"
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/__snapshots__/authz-set-delete.e2e.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ exports[`frodo authz set delete "frodo authz set delete --set-id test-policy-set
✖ Error deleting policy set test-policy-set
Error deleting alpha realm policy set test-policy-set
HTTP client error
Code: ERR_BAD_REQUEST
URL: https://openam-frodo-dev.forgeblocks.com/am/json/realms/root/realms/alpha/applications/test-policy-set
Status: 404
Code: ERR_BAD_REQUEST
Reason: Not Found
Message: test-policy-set application not found in realm.
"
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/__snapshots__/authz-type-delete.e2e.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ exports[`frodo authz type delete "frodo authz type delete --type-id 0aa5ed25-0c6
✖ Error deleting resource type 0aa5ed25-0c62-4ff5-9a42-3bda8c5cbb76
Error deleting alpha realm resource type 0aa5ed25-0c62-4ff5-9a42-3bda8c5cbb76
HTTP client error
Code: ERR_BAD_REQUEST
URL: https://openam-frodo-dev.forgeblocks.com/am/json/realms/root/realms/alpha/resourcetypes/0aa5ed25-0c62-4ff5-9a42-3bda8c5cbb76
Status: 404
Code: ERR_BAD_REQUEST
Reason: Not Found
Message: Resource Type 0aa5ed25-0c62-4ff5-9a42-3bda8c5cbb76 does not exist in realm /alpha
"
Expand Down
Loading