@rockcarver/frodo-cli 2.0.0-41 → 2.0.0-42

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 CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.0-41] - 2023-12-23
11
+
10
12
  ## [2.0.0-40] - 2023-12-22
11
13
 
12
14
  ## [2.0.0-39] - 2023-12-19
@@ -1447,7 +1449,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1447
1449
  - Fixed problem with adding connection profiles
1448
1450
  - Miscellaneous bug fixes
1449
1451
 
1450
- [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-40...HEAD
1452
+ [Unreleased]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-41...HEAD
1453
+
1454
+ [2.0.0-41]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-40...v2.0.0-41
1451
1455
 
1452
1456
  [2.0.0-40]: https://github.com/rockcarver/frodo-cli/compare/v2.0.0-39...v2.0.0-40
1453
1457
 
@@ -1 +1 @@
1
- {"version":3,"file":"admin-execute-rfc7523-authz-grant-flow.js","names":["frodo","Option","fs","v4","uuidv4","s","executeRfc7523AuthZGrantFlow","printMessage","FrodoCommand","getTokens","login","program","description","addOption","default","addHelpText","amBaseUrl","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","clientId","jwk","undefined","jwkFile","data","readFileSync","JSON","parse","toString","error","message","outcome","iss","sub","scope","split","json","process","exitCode"],"sources":["../../../src/cli/admin/admin-execute-rfc7523-authz-grant-flow.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { JwkRsa } from '@rockcarver/frodo-lib/types/ops/JoseOps.js';\nimport { Option } from 'commander';\nimport fs from 'fs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as s from '../../help/SampleData';\nimport { executeRfc7523AuthZGrantFlow } from '../../ops/AdminOps.js';\nimport { printMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand.js';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand(\n 'frodo admin execute-rfc7523-authz-grant-flow'\n);\n\nprogram\n .description('Execute RFC7523 authorization grant flow.')\n .addOption(new Option('--client-id [id]', 'Client id.'))\n .addOption(\n new Option(\n '--jwk-file [file]',\n 'Path to JSON Web Key (JWK) file containing private key.'\n )\n )\n .addOption(\n new Option(\n '--sub [subject]',\n 'Subject identifier, typically a UUID. Must resolve to a valid user in the realm.'\n )\n )\n .addOption(new Option('--iss [issuer]', 'Trusted issuer, typically a URL.'))\n .addOption(\n new Option('--scope [scope]', 'Space-delimited list of scopes.').default(\n 'openid fr:am:* fr:idm:*'\n )\n )\n .addOption(new Option('--json', 'Output in JSON format.'))\n .addHelpText(\n 'after',\n `Usage Examples:\\n` +\n ` If you used frodo to create the RFC7523 configuration (see 'Related Commands' below), then you can test your configuration with minimal input and frodo will locate the missing parameters. The command below returns access token and identity token:\\n` +\n ` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Same as above but output raw json:\\n` +\n ` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 --json ${s.amBaseUrl}'\\n`[\n 'brightCyan'\n ] +\n ` Same as first command above but explicitly provide all parameters:\\n` +\n ` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --jwk-file rfc7523-client1_private.jwk.json ${s.amBaseUrl}'\\n`[\n 'brightCyan'\n ] +\n `\\nRelated Commands:\\n` +\n ` Run ${'frodo admin generate-rfc7523-authz-grant-artefacts --help'['brightCyan']} to see how to create the required configuration artefacts for ${'frodo admin execute-rfc7523-authz-grant-flow'['brightCyan']}:\\n`\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n printMessage(`Executing RFC7523 authorization grant flow...`);\n let clientId = uuidv4();\n if (options.clientId) {\n clientId = options.clientId;\n }\n let jwk: JwkRsa = undefined;\n if (options.jwkFile) {\n try {\n const data = fs.readFileSync(options.jwkFile);\n jwk = JSON.parse(data.toString());\n } catch (error) {\n printMessage(\n `Error parsing JWK from file ${options.jwkFile}: ${error.message}`,\n 'error'\n );\n }\n }\n const outcome = await executeRfc7523AuthZGrantFlow(\n clientId,\n options.iss,\n jwk,\n options.sub,\n options.scope.split(' '),\n options.json\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAC9B,8CACF,CAAC;AAEDG,OAAO,CACJC,WAAW,CAAC,2CAA2C,CAAC,CACxDC,SAAS,CAAC,IAAIZ,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,CACvDY,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,yDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,iBAAiB,EACjB,kFACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC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;MACnC,CAAC,CAAC,OAAOC,KAAK,EAAE;QACd3B,YAAY,CACT,+BAA8Be,OAAO,CAACM,OAAQ,KAAIM,KAAK,CAACC,OAAQ,EAAC,EAClE,OACF,CAAC;MACH;IACF;IACA,MAAMC,OAAO,GAAG,MAAM9B,4BAA4B,CAChDmB,QAAQ,EACRH,OAAO,CAACe,GAAG,EACXX,GAAG,EACHJ,OAAO,CAACgB,GAAG,EACXhB,OAAO,CAACiB,KAAK,CAACC,KAAK,CAAC,GAAG,CAAC,EACxBlB,OAAO,CAACmB,IACV,CAAC;IACD,IAAI,CAACL,OAAO,EAAEM,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHhC,OAAO,CAACqB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"admin-execute-rfc7523-authz-grant-flow.js","names":["frodo","Option","fs","v4","uuidv4","s","executeRfc7523AuthZGrantFlow","printMessage","FrodoCommand","getTokens","login","program","description","addOption","default","addHelpText","amBaseUrl","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","clientId","jwk","undefined","jwkFile","data","readFileSync","JSON","parse","toString","error","message","outcome","iss","sub","scope","split","json","process","exitCode"],"sources":["../../../src/cli/admin/admin-execute-rfc7523-authz-grant-flow.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { JwkRsa } from '@rockcarver/frodo-lib/types/ops/JoseOps.js';\nimport { Option } from 'commander';\nimport fs from 'fs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as s from '../../help/SampleData';\nimport { executeRfc7523AuthZGrantFlow } from '../../ops/AdminOps.js';\nimport { printMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand.js';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand(\n 'frodo admin execute-rfc7523-authz-grant-flow'\n);\n\nprogram\n .description('Execute RFC7523 authorization grant flow.')\n .addOption(new Option('--client-id [id]', 'Client id.'))\n .addOption(\n new Option(\n '--jwk-file [file]',\n 'Path to JSON Web Key (JWK) file containing private key.'\n )\n )\n .addOption(\n new Option(\n '--sub [subject]',\n 'Subject identifier, typically a UUID. Must resolve to a valid user in the realm.'\n )\n )\n .addOption(new Option('--iss [issuer]', 'Trusted issuer, typically a URL.'))\n .addOption(\n new Option('--scope [scope]', 'Space-delimited list of scopes.').default(\n 'openid fr:am:* fr:idm:*'\n )\n )\n .addOption(new Option('--json', 'Output in JSON format.'))\n .addHelpText(\n 'after',\n `Usage Examples:\\n` +\n ` If you used frodo to create the RFC7523 configuration (see 'Related Commands' below), then you can test your configuration with minimal input and frodo will locate the missing parameters. The command below returns access token and identity token:\\n` +\n ` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Same as above but output raw json:\\n` +\n ` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 --json ${s.amBaseUrl}'\\n`[\n 'brightCyan'\n ] +\n ` Same as first command above but explicitly provide all parameters:\\n` +\n ` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --jwk-file rfc7523-client1_private.jwk.json ${s.amBaseUrl}'\\n`[\n 'brightCyan'\n ] +\n `\\nRelated Commands:\\n` +\n ` Run ${\n 'frodo admin generate-rfc7523-authz-grant-artefacts --help'[\n 'brightCyan'\n ]\n } to see how to create the required configuration artefacts for ${\n 'frodo admin execute-rfc7523-authz-grant-flow'['brightCyan']\n }:\\n`\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n printMessage(`Executing RFC7523 authorization grant flow...`);\n let clientId = uuidv4();\n if (options.clientId) {\n clientId = options.clientId;\n }\n let jwk: JwkRsa = undefined;\n if (options.jwkFile) {\n try {\n const data = fs.readFileSync(options.jwkFile);\n jwk = JSON.parse(data.toString());\n } catch (error) {\n printMessage(\n `Error parsing JWK from file ${options.jwkFile}: ${error.message}`,\n 'error'\n );\n }\n }\n const outcome = await executeRfc7523AuthZGrantFlow(\n clientId,\n options.iss,\n jwk,\n options.sub,\n options.scope.split(' '),\n options.json\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAE7C,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,MAAM;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAACU,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAC9B,8CACF,CAAC;AAEDG,OAAO,CACJC,WAAW,CAAC,2CAA2C,CAAC,CACxDC,SAAS,CAAC,IAAIZ,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,CACvDY,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,yDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,iBAAiB,EACjB,kFACF,CACF,CAAC,CACAY,SAAS,CAAC,IAAIZ,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,CAAC,CAAC,CAC3EY,SAAS,CACR,IAAIZ,MAAM,CAAC,iBAAiB,EAAE,iCAAiC,CAAC,CAACa,OAAO,CACtE,yBACF,CACF,CAAC,CACAD,SAAS,CAAC,IAAIZ,MAAM,CAAC,QAAQ,EAAE,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AQ,EACRH,OAAO,CAACe,GAAG,EACXX,GAAG,EACHJ,OAAO,CAACgB,GAAG,EACXhB,OAAO,CAACiB,KAAK,CAACC,KAAK,CAAC,GAAG,CAAC,EACxBlB,OAAO,CAACmB,IACV,CAAC;IACD,IAAI,CAACL,OAAO,EAAEM,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHhC,OAAO,CAACqB,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"admin-generate-rfc7523-authz-grant-artefacts.js","names":["frodo","state","Option","fs","v4","uuidv4","s","generateRfc7523AuthZGrantArtefacts","printMessage","FrodoCommand","getTokens","login","program","description","addOption","default","addHelpText","amBaseUrl","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","clientId","jwk","undefined","jwkFile","data","readFileSync","JSON","parse","toString","error","message","outcome","iss","sub","scope","split","save","json","process","exitCode"],"sources":["../../../src/cli/admin/admin-generate-rfc7523-authz-grant-artefacts.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { JwkRsa } from '@rockcarver/frodo-lib/types/ops/JoseOps.js';\nimport { Option } from 'commander';\nimport fs from 'fs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as s from '../../help/SampleData';\nimport { generateRfc7523AuthZGrantArtefacts } from '../../ops/AdminOps.js';\nimport { printMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand.js';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand(\n 'frodo admin generate-rfc7523-authz-grant-artefacts'\n);\n\nprogram\n .description('Generate RFC7523 authorization grant artefacts.')\n .addOption(new Option('--client-id [id]', 'Client id.'))\n .addOption(\n new Option(\n '--jwk-file [file]',\n 'Path to JSON Web Key (JWK) file containing private key.'\n )\n )\n .addOption(\n new Option(\n '--sub [subject]',\n 'Subject identifier, typically a UUID. Must resolve to a valid user in the realm. Restricts the trusted issuer to only this subject by adding the identifier to the list of allowed subjects. Omitting this option allows the trusted issuer to request tokens for any realm user without restrictions.'\n )\n )\n .addOption(new Option('--iss [issuer]', 'Trusted issuer, typically a URL.'))\n .addOption(\n new Option('--scope [scope]', 'Space-delimited list of scopes.').default(\n 'openid fr:am:* fr:idm:*'\n )\n )\n .addOption(\n new Option(\n '--no-save',\n 'Do not save artefacts in AM and to file By default this command creates a fully configured oauth2 client and trusted issuer in AM and saves the generated JWK (private key) and JWKS (public key set) to files.'\n )\n )\n .addOption(new Option('--json', 'Output in JSON format.'))\n .addHelpText(\n 'after',\n `Usage Examples:\\n` +\n ` Generate, output to console, and save all the artefacts for an RFC7523 authorization grant flow configuration limited to one particular subject:\\n` +\n ` - Fully configured OAuth2 client - named '<clientId>'\\n` +\n ` - Fully configured OAuth2 trusted issuer - named '<clientId>-issuer'\\n` +\n ` - Private Key as Json Web Key (JWK) - named '<clientId>_private.jwk.json'\\n` +\n ` - Public Key as Json Web Key Set (JWKS) - named '<clientId>_public.jwks.json'\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Same as above but use an existing JWK file instead of creating one.\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --jwk-file rfc7523-client1_private.jwk.json ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Generate and output to console all the artefacts for an RFC7523 authorization grant flow configuration but do not create any configuration or files.\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --no-save ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Generate and output in json format all the artefacts for an RFC7523 authorization grant flow configuration.\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --json ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n `\\nRelated Commands:\\n` +\n ` Run ${'frodo admin execute-rfc7523-authz-grant-flow --help'['brightCyan']} to see how to test your configuration created with ${'frodo admin generate-rfc7523-authz-grant-artefacts'['brightCyan']}:\\n`\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n printMessage(\n `Generating RFC7523 authorization grant artefacts in realm \"${state.getRealm()}\"...`\n );\n let clientId = uuidv4();\n if (options.clientId) {\n clientId = options.clientId;\n }\n let jwk: JwkRsa = undefined;\n if (options.jwkFile) {\n try {\n const data = fs.readFileSync(options.jwkFile);\n jwk = JSON.parse(data.toString());\n } catch (error) {\n printMessage(\n `Error parsing JWK from file ${options.jwkFile}: ${error.message}`,\n 'error'\n );\n }\n }\n const outcome = await generateRfc7523AuthZGrantArtefacts(\n clientId,\n options.iss,\n jwk,\n options.sub,\n options.scope.split(' '),\n { save: options.save },\n options.json\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,kCAAkC,QAAQ,uBAAuB;AAC1E,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,MAAM;EAAE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file":"admin-generate-rfc7523-authz-grant-artefacts.js","names":["frodo","state","Option","fs","v4","uuidv4","s","generateRfc7523AuthZGrantArtefacts","printMessage","FrodoCommand","getTokens","login","program","description","addOption","default","addHelpText","amBaseUrl","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","getRealm","clientId","jwk","undefined","jwkFile","data","readFileSync","JSON","parse","toString","error","message","outcome","iss","sub","scope","split","save","json","process","exitCode"],"sources":["../../../src/cli/admin/admin-generate-rfc7523-authz-grant-artefacts.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { JwkRsa } from '@rockcarver/frodo-lib/types/ops/JoseOps.js';\nimport { Option } from 'commander';\nimport fs from 'fs';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport * as s from '../../help/SampleData';\nimport { generateRfc7523AuthZGrantArtefacts } from '../../ops/AdminOps.js';\nimport { printMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand.js';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand(\n 'frodo admin generate-rfc7523-authz-grant-artefacts'\n);\n\nprogram\n .description('Generate RFC7523 authorization grant artefacts.')\n .addOption(new Option('--client-id [id]', 'Client id.'))\n .addOption(\n new Option(\n '--jwk-file [file]',\n 'Path to JSON Web Key (JWK) file containing private key.'\n )\n )\n .addOption(\n new Option(\n '--sub [subject]',\n 'Subject identifier, typically a UUID. Must resolve to a valid user in the realm. Restricts the trusted issuer to only this subject by adding the identifier to the list of allowed subjects. Omitting this option allows the trusted issuer to request tokens for any realm user without restrictions.'\n )\n )\n .addOption(new Option('--iss [issuer]', 'Trusted issuer, typically a URL.'))\n .addOption(\n new Option('--scope [scope]', 'Space-delimited list of scopes.').default(\n 'openid fr:am:* fr:idm:*'\n )\n )\n .addOption(\n new Option(\n '--no-save',\n 'Do not save artefacts in AM and to file By default this command creates a fully configured oauth2 client and trusted issuer in AM and saves the generated JWK (private key) and JWKS (public key set) to files.'\n )\n )\n .addOption(new Option('--json', 'Output in JSON format.'))\n .addHelpText(\n 'after',\n `Usage Examples:\\n` +\n ` Generate, output to console, and save all the artefacts for an RFC7523 authorization grant flow configuration limited to one particular subject:\\n` +\n ` - Fully configured OAuth2 client - named '<clientId>'\\n` +\n ` - Fully configured OAuth2 trusted issuer - named '<clientId>-issuer'\\n` +\n ` - Private Key as Json Web Key (JWK) - named '<clientId>_private.jwk.json'\\n` +\n ` - Public Key as Json Web Key Set (JWKS) - named '<clientId>_public.jwks.json'\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Same as above but use an existing JWK file instead of creating one.\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --jwk-file rfc7523-client1_private.jwk.json ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Generate and output to console all the artefacts for an RFC7523 authorization grant flow configuration but do not create any configuration or files.\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --no-save ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n ` Generate and output in json format all the artefacts for an RFC7523 authorization grant flow configuration.\\n` +\n ` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --json ${s.amBaseUrl}\\n`[\n 'brightCyan'\n ] +\n `\\nRelated Commands:\\n` +\n ` Run ${\n 'frodo admin execute-rfc7523-authz-grant-flow --help'['brightCyan']\n } to see how to test your configuration created with ${\n 'frodo admin generate-rfc7523-authz-grant-artefacts'['brightCyan']\n }:\\n`\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n printMessage(\n `Generating RFC7523 authorization grant artefacts in realm \"${state.getRealm()}\"...`\n );\n let clientId = uuidv4();\n if (options.clientId) {\n clientId = options.clientId;\n }\n let jwk: JwkRsa = undefined;\n if (options.jwkFile) {\n try {\n const data = fs.readFileSync(options.jwkFile);\n jwk = JSON.parse(data.toString());\n } catch (error) {\n printMessage(\n `Error parsing JWK from file ${options.jwkFile}: ${error.message}`,\n 'error'\n );\n }\n }\n const outcome = await generateRfc7523AuthZGrantArtefacts(\n clientId,\n options.iss,\n jwk,\n options.sub,\n options.scope.split(' '),\n { save: options.save },\n options.json\n );\n if (!outcome) process.exitCode = 1;\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,EAAE,MAAM,IAAI;AACnB,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,kCAAkC,QAAQ,uBAAuB;AAC1E,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,MAAM;EAAEC;AAAU,CAAC,GAAGV,KAAK,CAACW,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAC9B,oDACF,CAAC;AAEDG,OAAO,CACJC,WAAW,CAAC,iDAAiD,CAAC,CAC9DC,SAAS,CAAC,IAAIZ,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,CACvDY,SAAS,CACR,IAAIZ,MAAM,CACR,mBAAmB,EACnB,yDACF,CACF,CAAC,CACAY,SAAS,CACR,IAAIZ,MAAM,CACR,iBAAiB,EACjB,wSACF,CACF,CAAC,CAC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O,CAACI,QAAQ;IAC7B;IACA,IAAIC,GAAW,GAAGC,SAAS;IAC3B,IAAIN,OAAO,CAACO,OAAO,EAAE;MACnB,IAAI;QACF,MAAMC,IAAI,GAAG5B,EAAE,CAAC6B,YAAY,CAACT,OAAO,CAACO,OAAO,CAAC;QAC7CF,GAAG,GAAGK,IAAI,CAACC,KAAK,CAACH,IAAI,CAACI,QAAQ,CAAC,CAAC,CAAC;MACnC,CAAC,CAAC,OAAOC,KAAK,EAAE;QACd5B,YAAY,CACT,+BAA8Be,OAAO,CAACO,OAAQ,KAAIM,KAAK,CAACC,OAAQ,EAAC,EAClE,OACF,CAAC;MACH;IACF;IACA,MAAMC,OAAO,GAAG,MAAM/B,kCAAkC,CACtDoB,QAAQ,EACRJ,OAAO,CAACgB,GAAG,EACXX,GAAG,EACHL,OAAO,CAACiB,GAAG,EACXjB,OAAO,CAACkB,KAAK,CAACC,KAAK,CAAC,GAAG,CAAC,EACxB;MAAEC,IAAI,EAAEpB,OAAO,CAACoB;IAAK,CAAC,EACtBpB,OAAO,CAACqB,IACV,CAAC;IACD,IAAI,CAACN,OAAO,EAAEO,OAAO,CAACC,QAAQ,GAAG,CAAC;EACpC,CAAC,MAAM;IACLD,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlC,OAAO,CAACsB,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-delete.js","names":["frodo","Option","s","deleteApplication","deleteApplications","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","amBaseUrl","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","appId","status","deep","process","exitCode","all","help","parse"],"sources":["../../../src/cli/app/app-delete.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport {\n deleteApplication,\n deleteApplications,\n} from '../../ops/ApplicationOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app delete');\n\nprogram\n .description('Delete applications.')\n .addOption(\n new Option(\n '-i, --app-id <id>',\n 'Application name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option('-a, --all', 'Delete all applications. Ignored with -i.')\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${'frodo app'['brightCyan']} command to manage OAuth2 clients in v1.x has been renamed to ${'frodo oauth client'['brightCyan']} in v2.x\\n` +\n ` The ${'frodo app'['brightCyan']} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${'frodo oauth client'['brightCyan']} command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Delete application 'myApp':\\n` +\n ` $ frodo app delete -i 'myApp' ${s.amBaseUrl}\\n`['brightCyan'] +\n ` Delete all applications:\\n` +\n ` $ frodo app delete -a ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // delete app by name\n if (options.appId && (await getTokens())) {\n verboseMessage('Deleting application...');\n const status = await deleteApplication(options.appId, options.deep);\n if (!status) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all applications...');\n const status = await deleteApplications(options.deep);\n if (!status) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SACEC,iB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CAACG,KAAK,EAAEH,OAAO,CAACK,IAAI,CAAC;IACnE,IAAI,CAACD,MAAM,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK,IAAIP,OAAO,CAACQ,GAAG,KAAK,MAAMrB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,8BAA8B,CAAC;IAC9C,MAAMmB,MAAM,GAAG,MAAMpB,kBAAkB,CAACgB,OAAO,CAACK,IAAI,CAAC;IACrD,IAAI,CAACD,MAAM,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK;IACHtB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACoB,IAAI,CAAC,CAAC;IACdH,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlB,OAAO,CAACqB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"app-delete.js","names":["frodo","Option","s","deleteApplication","deleteApplications","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","amBaseUrl","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","appId","status","deep","process","exitCode","all","help","parse"],"sources":["../../../src/cli/app/app-delete.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport {\n deleteApplication,\n deleteApplications,\n} from '../../ops/ApplicationOps';\nimport { verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app delete');\n\nprogram\n .description('Delete applications.')\n .addOption(\n new Option(\n '-i, --app-id <id>',\n 'Application name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option('-a, --all', 'Delete all applications. Ignored with -i.')\n )\n .addOption(\n new Option(\n '--no-deep',\n 'No deep delete. This leaves orphaned configuration artifacts behind.'\n )\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${\n 'frodo app'['brightCyan']\n } command to manage OAuth2 clients in v1.x has been renamed to ${\n 'frodo oauth client'['brightCyan']\n } in v2.x\\n` +\n ` The ${\n 'frodo app'['brightCyan']\n } command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${\n 'frodo oauth client'['brightCyan']\n } command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Delete application 'myApp':\\n` +\n ` $ frodo app delete -i 'myApp' ${s.amBaseUrl}\\n`['brightCyan'] +\n ` Delete all applications:\\n` +\n ` $ frodo app delete -a ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // delete app by name\n if (options.appId && (await getTokens())) {\n verboseMessage('Deleting application...');\n const status = await deleteApplication(options.appId, options.deep);\n if (!status) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Deleting all applications...');\n const status = await deleteApplications(options.deep);\n if (!status) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SACEC,iBAAiB,EACjBC,kBAAkB,QACb,0BAA0B;AACjC,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGP,KAAK,CAACQ,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAEpDG,OAAO,CACJC,WAAW,CAAC,sBAAsB,CAAC,CACnC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AO,CAACK,IAAI,CAAC;IACrD,IAAI,CAACD,MAAM,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK;IACHtB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACoB,IAAI,CAAC,CAAC;IACdH,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlB,OAAO,CAACqB,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-describe.js","names":["frodo","Option","s","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/app/app-describe.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app describe');\n\nprogram\n .description('Describe application.')\n .addOption(new Option('-i, --app-id <id>', 'Application name.'))\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${'frodo app'['brightCyan']} command to manage OAuth2 clients in v1.x has been renamed to ${'frodo oauth client'['brightCyan']} in v2.x\\n` +\n ` The ${'frodo app'['brightCyan']} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${'frodo oauth client'['brightCyan']} command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Describe application 'myApp':\\n` +\n ` $ frodo app describe -i myApp ${s.connId}\\n`['brightCyan'] +\n ` Describe application 'myApp' in raw JSON:\\n` +\n ` $ frodo app describe -i myApp --json ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // code goes here\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGJ,KAAK,CAACK,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,oBAAoB,CAAC;AAEtDG,OAAO,CACJC,WAAW,CAAC,uBAAuB,CAAC,CACpCC,SAAS,CAAC,IAAIP,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAC/DQ,WAAW,CACV,OAAO,EACN,mBAAkB,CAAC,cAAc,CAAC,GAChC,SAAQ,WAAW,CAAC,YAAY,CAAE,iEAAgE,oBAAoB,CAAC,YAAY,CAAE,YAAW,GAChJ,SAAQ,WAAW,CAAC,YAAY,CAAE,2JAA0J,oBAAoB,CAAC,YAAY,CAAE,eAAc,GAC7O,mBAAkB,GAClB,mCAAkC,GAClC,mCAAkCP,CAAC,CAACQ,MAAO,IAAG,CAAC,YAAY,CAAC,GAC5D,+CAA8C,GAC9C,0CAAyCR,CAAC,CAACQ,MAAO,IAAG,CAAC,YAAY,CACvE,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMb,SAAS,CAAC,CAAC,EAAE;IACrB;EAAA,CACD,MAAM;IACLe,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"app-describe.js","names":["frodo","Option","s","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","process","exitCode","parse"],"sources":["../../../src/cli/app/app-describe.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app describe');\n\nprogram\n .description('Describe application.')\n .addOption(new Option('-i, --app-id <id>', 'Application name.'))\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${\n 'frodo app'['brightCyan']\n } command to manage OAuth2 clients in v1.x has been renamed to ${\n 'frodo oauth client'['brightCyan']\n } in v2.x\\n` +\n ` The ${\n 'frodo app'['brightCyan']\n } command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${\n 'frodo oauth client'['brightCyan']\n } command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Describe application 'myApp':\\n` +\n ` $ frodo app describe -i myApp ${s.connId}\\n`['brightCyan'] +\n ` Describe application 'myApp' in raw JSON:\\n` +\n ` $ frodo app describe -i myApp --json ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n // code goes here\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGJ,KAAK,CAACK,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,oBAAoB,CAAC;AAEtDG,OAAO,CACJC,WAAW,CAAC,uBAAuB,CAAC,CACpCC,SAAS,CAAC,IAAIP,MAAM,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAC/DQ,WAAW,CACV,OAAO,EACN,mBAAkB,CAAC,cAAc,CAAC,GAChC,SACC,WAAW,CAAC,YAAY,CACzB,iEACC,oBAAoB,CAAC,YAAY,CAClC,YAAW,GACX,SACC,WAAW,CAAC,YAAY,CACzB,2JACC,oBAAoB,CAAC,YAAY,CAClC,eAAc,GACd,mBAAkB,GAClB,mCAAkC,GAClC,mCAAkCP,CAAC,CAACQ,MAAO,IAAG,CAAC,YAAY,CAAC,GAC5D,+CAA8C,GAC9C,0CAAyCR,CAAC,CAACQ,MAAO,IAAG,CAAC,YAAY,CACvE,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BN,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMb,SAAS,CAAC,CAAC,EAAE;IACrB;EAAA,CACD,MAAM;IACLe,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHd,OAAO,CAACe,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-export.js","names":["frodo","Option","s","exportApplicationsToFile","exportApplicationsToFiles","exportApplicationToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","appId","status","file","metadata","useStringArrays","deps","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/app/app-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport {\n exportApplicationsToFile,\n exportApplicationsToFiles,\n exportApplicationToFile,\n} from '../../ops/ApplicationOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app export');\n\nprogram\n .description('Export applications.')\n .addOption(\n new Option(\n '-i, --app-id <app-id>',\n 'Application name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all applications to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all applications to separate files (*.application.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(\n new Option('--no-deps', 'Do not include any dependencies (scripts).')\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${'frodo app'['brightCyan']} command to manage OAuth2 clients in v1.x has been renamed to ${'frodo oauth client'['brightCyan']} in v2.x\\n` +\n ` The ${'frodo app'['brightCyan']} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${'frodo oauth client'['brightCyan']} command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Export all applications to a single export file with an auto-generated filename using a connection profile:\\n` +\n ` $ frodo app export -a ${s.connId}\\n`['brightCyan'] +\n ` Export the first application to a single export file with a custom filename:\\n` +\n ` $ frodo app export -f ./allMyApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Export all applications to separate export files with an auto-generated filenames:\\n` +\n ` $ frodo app export -A ${s.connId}\\n`['brightCyan'] +\n ` Export all applications without dependencies to a single export file:\\n` +\n ` $ frodo app export --no-deps -a ${s.connId}\\n`['brightCyan'] +\n ` Export the application 'myApp' to a file with an auto-generated filename of 'myApp.application.json':\\n` +\n ` $ frodo app export -i myApp ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.appId && (await getTokens())) {\n verboseMessage('Exporting application...');\n const status = await exportApplicationToFile(\n options.appId,\n options.file,\n options.metadata,\n {\n useStringArrays: true,\n deps: options.deps,\n }\n );\n if (!status) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all applications to file...');\n const status = await exportApplicationsToFile(\n options.file,\n options.metadata,\n {\n useStringArrays: true,\n deps: options.deps,\n }\n );\n if (!status) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all applications to separate files...');\n const status = await exportApplicationsToFiles(options.metadata, {\n useStringArrays: true,\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SACEC,wBAAwB,EACxBC,yBAAyB,EACzBC,uBAAuB,QAClB,0BAA0B;AACjC,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAEpDG,OAAO,CACJC,WAAW,CAAC,sBAAsB,CAAC,CACnCC,SAAS,CACR,IAAIX,MAAM,CACR,uBAAuB,EACvB,wDACF,CACF,CAAC,CACAW,SAAS,CAAC,IAAIX,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEW,SAAS,CACR,IAAIX,MAA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KAAK,EACbH,OAAO,CAACK,IAAI,EACZL,OAAO,CAACM,QAAQ,EAChB;MACEC,eAAe,EAAE,IAAI;MACrBC,IAAI,EAAER,OAAO,CAACQ;IAChB,CACF,CAAC;IACD,IAAI,CAACJ,MAAM,EAAEK,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK,IAAIV,OAAO,CAACW,GAAG,KAAK,MAAMvB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,uCAAuC,CAAC;IACvD,MAAMkB,MAAM,GAAG,MAAMrB,wBAAwB,CAC3CiB,OAAO,CAACK,IAAI,EACZL,OAAO,CAACM,QAAQ,EAChB;MACEC,eAAe,EAAE,IAAI;MACrBC,IAAI,EAAER,OAAO,CAACQ;IAChB,CACF,CAAC;IACD,IAAI,CAACJ,MAAM,EAAEK,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK,IAAIV,OAAO,CAACY,WAAW,KAAK,MAAMxB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CAAC,iDAAiD,CAAC;IACjE,MAAMkB,MAAM,GAAG,MAAMpB,yBAAyB,CAACgB,OAAO,CAACM,QAAQ,EAAE;MAC/DC,eAAe,EAAE,IAAI;MACrBC,IAAI,EAAER,OAAO,CAACQ;IAChB,CAAC,CAAC;IACF,IAAI,CAACJ,MAAM,EAAEK,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK;IACHxB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACuB,IAAI,CAAC,CAAC;IACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHpB,OAAO,CAACwB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"app-export.js","names":["frodo","Option","s","exportApplicationsToFile","exportApplicationsToFiles","exportApplicationToFile","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","appId","status","file","metadata","useStringArrays","deps","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/app/app-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport {\n exportApplicationsToFile,\n exportApplicationsToFiles,\n exportApplicationToFile,\n} from '../../ops/ApplicationOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app export');\n\nprogram\n .description('Export applications.')\n .addOption(\n new Option(\n '-i, --app-id <app-id>',\n 'Application name. If specified, -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Export all applications to a single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all applications to separate files (*.application.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(\n new Option('--no-deps', 'Do not include any dependencies (scripts).')\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${\n 'frodo app'['brightCyan']\n } command to manage OAuth2 clients in v1.x has been renamed to ${\n 'frodo oauth client'['brightCyan']\n } in v2.x\\n` +\n ` The ${\n 'frodo app'['brightCyan']\n } command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${\n 'frodo oauth client'['brightCyan']\n } command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Export all applications to a single export file with an auto-generated filename using a connection profile:\\n` +\n ` $ frodo app export -a ${s.connId}\\n`['brightCyan'] +\n ` Export the first application to a single export file with a custom filename:\\n` +\n ` $ frodo app export -f ./allMyApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Export all applications to separate export files with an auto-generated filenames:\\n` +\n ` $ frodo app export -A ${s.connId}\\n`['brightCyan'] +\n ` Export all applications without dependencies to a single export file:\\n` +\n ` $ frodo app export --no-deps -a ${s.connId}\\n`['brightCyan'] +\n ` Export the application 'myApp' to a file with an auto-generated filename of 'myApp.application.json':\\n` +\n ` $ frodo app export -i myApp ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.appId && (await getTokens())) {\n verboseMessage('Exporting application...');\n const status = await exportApplicationToFile(\n options.appId,\n options.file,\n options.metadata,\n {\n useStringArrays: true,\n deps: options.deps,\n }\n );\n if (!status) process.exitCode = 1;\n }\n // -a/--all\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all applications to file...');\n const status = await exportApplicationsToFile(\n options.file,\n options.metadata,\n {\n useStringArrays: true,\n deps: options.deps,\n }\n );\n if (!status) process.exitCode = 1;\n }\n // -A/--all-separate\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all applications to separate files...');\n const status = await exportApplicationsToFiles(options.metadata, {\n useStringArrays: true,\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SACEC,wBAAwB,EACxBC,yBAAyB,EACzBC,uBAAuB,QAClB,0BAA0B;AACjC,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IA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J,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHpB,OAAO,CAACwB,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-import.js","names":["frodo","Option","s","importApplicationFromFile","importApplicationsFromFile","importApplicationsFromFiles","importFirstApplicationFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","appId","status","deps","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/app/app-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport {\n importApplicationFromFile,\n importApplicationsFromFile,\n importApplicationsFromFiles,\n importFirstApplicationFromFile,\n} from '../../ops/ApplicationOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app import');\n\nprogram\n .description('Import applications.')\n .addOption(\n new Option(\n '-i, --app-id <id>',\n 'Application name. If specified, only one application is imported and the options -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all applications from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all applications from separate files (*.app.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option('--no-deps', 'Do not include any dependencies (scripts).')\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${'frodo app'['brightCyan']} command to manage OAuth2 clients in v1.x has been renamed to ${'frodo oauth client'['brightCyan']} in v2.x\\n` +\n ` The ${'frodo app'['brightCyan']} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${'frodo oauth client'['brightCyan']} command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Import all applications from a single export file using a connection profile:\\n` +\n ` $ frodo app import -a -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Import the first application from a single export file:\\n` +\n ` $ frodo app import -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Import all applications from separate export files:\\n` +\n ` $ frodo app import -A ${s.connId}\\n`['brightCyan'] +\n ` Import all applications without dependencies from a single export file:\\n` +\n ` $ frodo app import --no-deps -a -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Import only the application 'myApp' from a file with an export file containing multiple applications:\\n` +\n ` $ frodo app import -i myApp -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ]\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.appId && (await getTokens())) {\n verboseMessage(`Importing application \"${options.appId}\"...`);\n const status = await importApplicationFromFile(\n options.appId,\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!status) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all applications from a single file (${options.file})...`\n );\n const status = await importApplicationsFromFile(options.file, {\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all applications from separate files in current directory...'\n );\n const status = await importApplicationsFromFiles({\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // import first provider from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first application from file \"${options.file}\"...`\n );\n const status = await importFirstApplicationFromFile(options.file, {\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }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C,CAAC,CAAC,EAAE;IACpEF,cAAc,CACZ,wEACF,CAAC;IACD,MAAMmB,MAAM,GAAG,MAAMtB,2BAA2B,CAAC;MAC/CuB,IAAI,EAAEN,OAAO,CAACM;IAChB,CAAC,CAAC;IACF,IAAI,CAACD,MAAM,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK,IAAIR,OAAO,CAACG,IAAI,KAAK,MAAMf,SAAS,CAAC,CAAC,CAAC,EAAE;IAC5CF,cAAc,CACX,0CAAyCc,OAAO,CAACG,IAAK,MACzD,CAAC;IACD,MAAME,MAAM,GAAG,MAAMrB,8BAA8B,CAACgB,OAAO,CAACG,IAAI,EAAE;MAChEG,IAAI,EAAEN,OAAO,CAACM;IAChB,CAAC,CAAC;IACF,IAAI,CAACD,MAAM,EAAEE,OAAO,CAACC,QAAQ,GAAG,CAAC;EACnC;EACA;EAAA,KACK;IACHvB,YAAY,CAAC,sDAAsD,CAAC;IACpEK,OAAO,CAACqB,IAAI,CAAC,CAAC;IACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlB,OAAO,CAACsB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"app-import.js","names":["frodo","Option","s","importApplicationFromFile","importApplicationsFromFile","importApplicationsFromFiles","importFirstApplicationFromFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","addHelpText","connId","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","file","appId","status","deps","process","exitCode","all","allSeparate","help","parse"],"sources":["../../../src/cli/app/app-import.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport {\n importApplicationFromFile,\n importApplicationsFromFile,\n importApplicationsFromFiles,\n importFirstApplicationFromFile,\n} from '../../ops/ApplicationOps';\nimport { printMessage, verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app import');\n\nprogram\n .description('Import applications.')\n .addOption(\n new Option(\n '-i, --app-id <id>',\n 'Application name. If specified, only one application is imported and the options -a and -A are ignored.'\n )\n )\n .addOption(new Option('-f, --file <file>', 'Name of the file to import.'))\n .addOption(\n new Option(\n '-a, --all',\n 'Import all applications from single file. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Import all applications from separate files (*.app.json) in the current directory. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option('--no-deps', 'Do not include any dependencies (scripts).')\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${\n 'frodo app'['brightCyan']\n } command to manage OAuth2 clients in v1.x has been renamed to ${\n 'frodo oauth client'['brightCyan']\n } in v2.x\\n` +\n ` The ${\n 'frodo app'['brightCyan']\n } command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${\n 'frodo oauth client'['brightCyan']\n } command.\\n\\n` +\n `Usage Examples:\\n` +\n ` Import all applications from a single export file using a connection profile:\\n` +\n ` $ frodo app import -a -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Import the first application from a single export file:\\n` +\n ` $ frodo app import -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Import all applications from separate export files:\\n` +\n ` $ frodo app import -A ${s.connId}\\n`['brightCyan'] +\n ` Import all applications without dependencies from a single export file:\\n` +\n ` $ frodo app import --no-deps -a -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ] +\n ` Import only the application 'myApp' from a file with an export file containing multiple applications:\\n` +\n ` $ frodo app import -i myApp -f ./allAlphaApplications.application.json ${s.connId}\\n`[\n 'brightCyan'\n ]\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // import by id\n if (options.file && options.appId && (await getTokens())) {\n verboseMessage(`Importing application \"${options.appId}\"...`);\n const status = await importApplicationFromFile(\n options.appId,\n options.file,\n {\n deps: options.deps,\n }\n );\n if (!status) process.exitCode = 1;\n }\n // --all -a\n else if (options.all && options.file && (await getTokens())) {\n verboseMessage(\n `Importing all applications from a single file (${options.file})...`\n );\n const status = await importApplicationsFromFile(options.file, {\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // --all-separate -A\n else if (options.allSeparate && !options.file && (await getTokens())) {\n verboseMessage(\n 'Importing all applications from separate files in current directory...'\n );\n const status = await importApplicationsFromFiles({\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // import first provider from file\n else if (options.file && (await getTokens())) {\n verboseMessage(\n `Importing first application from file \"${options.file}\"...`\n );\n const status = await importFirstApplicationFromFile(options.file, {\n deps: options.deps,\n });\n if (!status) process.exitCode = 1;\n }\n // unrecognized combination of options or no options\n else {\n printMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SACEC,yBAAyB,EACzBC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,8BAA8B,QACzB,0BAA0B;AACjC,SAASC,YAAY,EAAEC,cAAc,QAAQ,wBAAwB;AACrE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGV,KAAK,CAACW,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,kBAAkB,CAAC;AAEpDG,OAAO,CACJC,WAAW,CAAC,sBAAsB,CAAC,CACnCC,SAAS,CACR,IAAIb,MAAM,CACR,mBAAmB,EACnB,yGACF,CACF,CAAC,CACAa,SAAS,CAAC,IAAIb,MAAM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sD,CAAC;IACpEK,OAAO,CAACqB,IAAI,CAAC,CAAC;IACdJ,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlB,OAAO,CAACsB,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app-list.js","names":["frodo","Option","s","listApplications","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","addHelpText","amBaseUrl","username","password","connId","action","host","realm","user","options","command","handleDefaultArgsAndOpts","long","process","exitCode","parse"],"sources":["../../../src/cli/app/app-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport { listApplications } from '../../ops/ApplicationOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app list');\n\nprogram\n .description('List applications.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${'frodo app'['brightCyan']} command to manage OAuth2 clients in v1.x has been renamed to ${'frodo oauth client'['brightCyan']} in v2.x\\n` +\n ` The ${'frodo app'['brightCyan']} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${'frodo oauth client'['brightCyan']} command.\\n\\n` +\n `Usage Examples:\\n` +\n ` List applications using AM base URL, username, and password (note the quotes around password to allow special characters):\\n` +\n ` $ frodo app list ${s.amBaseUrl} ${s.username} '${s.password}'\\n`[\n 'brightCyan'\n ] +\n ` List applications using a connection profile (identified by the full AM base URL):\\n` +\n ` $ frodo app list ${s.amBaseUrl}\\n`['brightCyan'] +\n ` List applications using a connection profile (identified by a unique substring of the AM base URL):\\n` +\n ` $ frodo app list ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing applications...`);\n await listApplications(options.long);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGN,KAAK,CAACO,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,gBAAgB,CAAC;AAElDG,OAAO,CACJC,WAAW,CAAC,oBAAoB,CAAC,CACjCC,SAAS,CACR,IAAIT,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACU,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1E,CAAC,CACAC,WAAW,CACV,OAAO,EACN,mBAAkB,CAAC,cAAc,CAAC,GAChC,SAAQ,WAAW,CAAC,YAAY,CAAE,iEAAgE,oBAAoB,CAAC,YAAY,CAAE,YAAW,GAChJ,SAAQ,WAAW,CAAC,YAAY,CAAE,2JAA0J,oBAAoB,CAAC,YAAY,CAAE,eAAc,GAC7O,mBAAkB,GAClB,gIAA+H,GAC/H,sBAAqBV,CAAC,CAACW,SAAU,IAAGX,CAAC,CAACY,QAAS,KAAIZ,CAAC,CAACa,QAAS,KAAI,CACjE,YAAY,CACb,GACA,wFAAuF,GACvF,sBAAqBb,CAAC,CAACW,SAAU,IAAG,CAAC,YAAY,CAAC,GAClD,yGAAwG,GACxG,sBAAqBX,CAAC,CAACc,MAAO,IAAG,CAAC,YAAY,CACnD,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEL,QAAQ,EAAEM,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BL,IAAI,EACJC,KAAK,EACLC,IAAI,EACJL,QAAQ,EACRM,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMhB,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,yBAAwB,CAAC;IACzC,MAAMD,gBAAgB,CAACkB,OAAO,CAACG,IAAI,CAAC;EACtC,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"app-list.js","names":["frodo","Option","s","listApplications","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","addHelpText","amBaseUrl","username","password","connId","action","host","realm","user","options","command","handleDefaultArgsAndOpts","long","process","exitCode","parse"],"sources":["../../../src/cli/app/app-list.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport * as s from '../../help/SampleData';\nimport { listApplications } from '../../ops/ApplicationOps';\nimport { verboseMessage } from '../../utils/Console.js';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo app list');\n\nprogram\n .description('List applications.')\n .addOption(\n new Option('-l, --long', 'Long with all fields.').default(false, 'false')\n )\n .addHelpText(\n 'after',\n `Important Note:\\n`['brightYellow'] +\n ` The ${\n 'frodo app'['brightCyan']\n } command to manage OAuth2 clients in v1.x has been renamed to ${\n 'frodo oauth client'['brightCyan']\n } in v2.x\\n` +\n ` The ${\n 'frodo app'['brightCyan']\n } command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${\n 'frodo oauth client'['brightCyan']\n } command.\\n\\n` +\n `Usage Examples:\\n` +\n ` List applications using AM base URL, username, and password (note the quotes around password to allow special characters):\\n` +\n ` $ frodo app list ${s.amBaseUrl} ${s.username} '${s.password}'\\n`[\n 'brightCyan'\n ] +\n ` List applications using a connection profile (identified by the full AM base URL):\\n` +\n ` $ frodo app list ${s.amBaseUrl}\\n`['brightCyan'] +\n ` List applications using a connection profile (identified by a unique substring of the AM base URL):\\n` +\n ` $ frodo app list ${s.connId}\\n`['brightCyan']\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n if (await getTokens()) {\n verboseMessage(`Listing applications...`);\n await listApplications(options.long);\n } else {\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,OAAO,KAAKC,CAAC,MAAM,uBAAuB;AAC1C,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGN,KAAK,CAACO,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,gBAAgB,CAAC;AAElDG,OAAO,CACJC,WAAW,CAAC,oBAAoB,CAAC,CACjCC,SAAS,CACR,IAAIT,MAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAACU,OAAO,CAAC,KAAK,EAAE,OAAO,CAC1E,CAAC,CACAC,WAAW,CACV,OAAO,EACN,mBAAkB,CAAC,cAAc,CAAC,GAChC,SACC,WAAW,CAAC,YAAY,CACzB,iEACC,oBAAoB,CAAC,YAAY,CAClC,YAAW,GACX,SACC,WAAW,CAAC,YAAY,CACzB,2JACC,oBAAoB,CAAC,YAAY,CAClC,eAAc,GACd,mBAAkB,GAClB,gIAA+H,GAC/H,sBAAqBV,CAAC,CAACW,SAAU,IAAGX,CAAC,CAACY,QAAS,KAAIZ,CAAC,CAACa,QAAS,KAAI,CACjE,YAAY,CACb,GACA,wFAAuF,GACvF,sBAAqBb,CAAC,CAACW,SAAU,IAAG,CAAC,YAAY,CAAC,GAClD,yGAAwG,GACxG,sBAAqBX,CAAC,CAACc,MAAO,IAAG,CAAC,YAAY,CACnD,CAAC,CACAC,MAAM;AACL;AACA,OAAOC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEL,QAAQ,EAAEM,OAAO,EAAEC,OAAO,KAAK;EACvDA,OAAO,CAACC,wBAAwB,CAC9BL,IAAI,EACJC,KAAK,EACLC,IAAI,EACJL,QAAQ,EACRM,OAAO,EACPC,OACF,CAAC;EACD,IAAI,MAAMhB,SAAS,CAAC,CAAC,EAAE;IACrBF,cAAc,CAAE,yBAAwB,CAAC;IACzC,MAAMD,gBAAgB,CAACkB,OAAO,CAACG,IAAI,CAAC;EACtC,CAAC,MAAM;IACLC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHlB,OAAO,CAACmB,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","names":["path","fileURLToPath","FrodoStubCommand","__dirname","dirname","import","meta","url","setup","program","description","executableDir","addHelpText","command"],"sources":["../../../src/cli/app/app.ts"],"sourcesContent":["import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { FrodoStubCommand } from '../FrodoCommand';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('app')\n .description('Manage applications.')\n .executableDir(__dirname)\n .addHelpText(\n 'after',\n `\\nImportant Note:\\n`['brightYellow'] +\n ` The ${'frodo app'['brightCyan']} command to manage OAuth2 clients in v1.x has been renamed to ${'frodo oauth client'['brightCyan']} in v2.x\\n` +\n ` The ${'frodo app'['brightCyan']} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${'frodo oauth client'['brightCyan']} command.\\n\\n`\n );\n\n program.command('list', 'List applications.');\n\n // program\n // .command('describe', 'Describe applications.');\n\n program.command('export', 'Export applications.');\n\n program.command('import', 'Import applications.');\n\n program.command('delete', 'Delete applications.');\n\n return program;\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,SAASC,gBAAgB,QAAQ,iBAAiB;AAElD,MAAMC,SAAS,GAAGH,IAAI,CAACI,OAAO,CAACH,aAAa,CAACI,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIP,gBAAgB,CAAC,KAAK,CAAC,CACxCQ,WAAW,CAAC,sBAAsB,CAAC,CACnCC,aAAa,CAACR,SAAS,CAAC,CACxBS,WAAW,CACV,OAAO,EACN,qBAAoB,CAAC,cAAc,CAAC,GAClC,SAAQ,WAAW,CAAC,YAAY,CAAE,iEAAgE,oBAAoB,CAAC,YAAY,CAAE,YAAW,GAChJ,SAAQ,WAAW,CAAC,YAAY,CAAE,2JAA0J,oBAAoB,CAAC,YAAY,CAAE,eACpO,CAAC;EAEHH,OAAO,CAACI,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC;;EAE7C;EACA;;EAEAJ,OAAO,CAACI,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;EAEjDJ,OAAO,CAACI,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;EAEjDJ,OAAO,CAACI,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;EAEjD,OAAOJ,OAAO;AAChB"}
1
+ {"version":3,"file":"app.js","names":["path","fileURLToPath","FrodoStubCommand","__dirname","dirname","import","meta","url","setup","program","description","executableDir","addHelpText","command"],"sources":["../../../src/cli/app/app.ts"],"sourcesContent":["import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport { FrodoStubCommand } from '../FrodoCommand';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport default function setup() {\n const program = new FrodoStubCommand('app')\n .description('Manage applications.')\n .executableDir(__dirname)\n .addHelpText(\n 'after',\n `\\nImportant Note:\\n`['brightYellow'] +\n ` The ${\n 'frodo app'['brightCyan']\n } command to manage OAuth2 clients in v1.x has been renamed to ${\n 'frodo oauth client'['brightCyan']\n } in v2.x\\n` +\n ` The ${\n 'frodo app'['brightCyan']\n } command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${\n 'frodo oauth client'['brightCyan']\n } command.\\n\\n`\n );\n\n program.command('list', 'List applications.');\n\n // program\n // .command('describe', 'Describe applications.');\n\n program.command('export', 'Export applications.');\n\n program.command('import', 'Import applications.');\n\n program.command('delete', 'Delete applications.');\n\n return program;\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,aAAa,QAAQ,KAAK;AAEnC,SAASC,gBAAgB,QAAQ,iBAAiB;AAElD,MAAMC,SAAS,GAAGH,IAAI,CAACI,OAAO,CAACH,aAAa,CAACI,MAAM,CAACC,IAAI,CAACC,GAAG,CAAC,CAAC;AAE9D,eAAe,SAASC,KAAKA,CAAA,EAAG;EAC9B,MAAMC,OAAO,GAAG,IAAIP,gBAAgB,CAAC,KAAK,CAAC,CACxCQ,WAAW,CAAC,sBAAsB,CAAC,CACnCC,aAAa,CAACR,SAAS,CAAC,CACxBS,WAAW,CACV,OAAO,EACN,qBAAoB,CAAC,cAAc,CAAC,GAClC,SACC,WAAW,CAAC,YAAY,CACzB,iEACC,oBAAoB,CAAC,YAAY,CAClC,YAAW,GACX,SACC,WAAW,CAAC,YAAY,CACzB,2JACC,oBAAoB,CAAC,YAAY,CAClC,eACL,CAAC;EAEHH,OAAO,CAACI,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC;;EAE7C;EACA;;EAEAJ,OAAO,CAACI,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;EAEjDJ,OAAO,CAACI,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;EAEjDJ,OAAO,CAACI,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;EAEjD,OAAOJ,OAAO;AAChB"}
@@ -7,7 +7,7 @@ const {
7
7
  getTokens
8
8
  } = frodo.login;
9
9
  const program = new FrodoCommand('frodo config export');
10
- program.description('Export full cloud configuration for all ops that currently support export.').addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export everything to a single file.')).addOption(new Option('-A, --all-separate', 'Export everything to separate files in the -D directory. Ignored with -a.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-decode', 'Do not include decoded variable value in variable export').default(false, 'false')).addOption(new Option('-x, --extract', 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).action(
10
+ program.description('Export full cloud configuration for all ops that currently support export.').addOption(new Option('-f, --file <file>', 'Name of the export file.')).addOption(new Option('-a, --all', 'Export everything to a single file.')).addOption(new Option('-A, --all-separate', 'Export everything to separate files in the -D directory. Ignored with -a.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-decode', 'Do not include decoded variable value in variable export').default(false, 'false')).addOption(new Option('-x, --extract', 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).addOption(new Option('--no-coords', 'Do not include the x and y coordinate positions of the journey/tree nodes.')).action(
11
11
  // implement command logic inside action handler
12
12
  async (host, realm, user, password, options, command) => {
13
13
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -16,7 +16,8 @@ async (host, realm, user, password, options, command) => {
16
16
  verboseMessage('Exporting everything to a single file...');
17
17
  await exportEverythingToFile(options.file, options.metadata, {
18
18
  useStringArrays: options.useStringArrays,
19
- noDecode: options.decode
19
+ noDecode: options.decode,
20
+ coords: options.coords
20
21
  });
21
22
  // require --directory -D for all-separate function
22
23
  } else if (options.allSeparate && !state.getDirectory()) {
@@ -28,7 +29,8 @@ async (host, realm, user, password, options, command) => {
28
29
  verboseMessage('Exporting everything to separate files...');
29
30
  await exportEverythingToFiles(options.extract, options.metadata, {
30
31
  useStringArrays: options.useStringArrays,
31
- noDecode: options.decode
32
+ noDecode: options.decode,
33
+ coords: options.coords
32
34
  });
33
35
  // unrecognized combination of options or no options
34
36
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"config-export.js","names":["frodo","state","Option","exportEverythingToFile","exportEverythingToFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","all","file","metadata","useStringArrays","noDecode","decode","allSeparate","getDirectory","help","process","exitCode","extract","parse"],"sources":["../../../src/cli/config/config-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEverythingToFile,\n exportEverythingToFiles,\n} from '../../ops/ConfigOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config export');\n\nprogram\n .description(\n 'Export full cloud configuration for all ops that currently support export.'\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(new Option('-a, --all', 'Export everything to a single file.'))\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export everything to separate files in the -D directory. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in variable export'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-x, --extract',\n 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // --all -a\n if (options.all && (await getTokens())) {\n verboseMessage('Exporting everything to a single file...');\n await exportEverythingToFile(options.file, options.metadata, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // require --directory -D for all-separate function\n } else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n // --all-separate -A\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting everything to separate files...');\n await exportEverythingToFiles(options.extract, options.metadata, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n });\n // unrecognized combination of options or no options\n } else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,sBAAsB,EACtBC,uBAAuB,QAClB,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,qBAAqB,CAAC;AAEvDG,OAAO,CACJC,WAAW,CACV,4EACF,CAAC,CACAC,SAAS,CAAC,IAAIV,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEU,SAAS,CAAC,IAAIV,MAAM,CAAC,WAAW,EAAE,qCAAqC,CAAC,CAAC,CACzEU,SAAS,CACR,IAAIV,MAAM,CACR,oBAAoB,EACpB,2EACF,CACF,CAAC,CACAU,SAAS,CACR,IAAIV,MAAM,CACR,qBAAqB,E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/DC,eAAe,EAAEN,OAAO,CAACM,eAAe;MACxCC,QAAQ,EAAEP,OAAO,CAACQ;IACpB,CAAC,CAAC;IACF;EACF,CAAC,MAAM;IACLrB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACoB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHtB,OAAO,CAACwB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"config-export.js","names":["frodo","state","Option","exportEverythingToFile","exportEverythingToFiles","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","all","file","metadata","useStringArrays","noDecode","decode","coords","allSeparate","getDirectory","help","process","exitCode","extract","parse"],"sources":["../../../src/cli/config/config-export.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportEverythingToFile,\n exportEverythingToFiles,\n} from '../../ops/ConfigOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo config export');\n\nprogram\n .description(\n 'Export full cloud configuration for all ops that currently support export.'\n )\n .addOption(new Option('-f, --file <file>', 'Name of the export file.'))\n .addOption(new Option('-a, --all', 'Export everything to a single file.'))\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export everything to separate files in the -D directory. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-decode',\n 'Do not include decoded variable value in variable export'\n ).default(false, 'false')\n )\n .addOption(\n new Option(\n '-x, --extract',\n 'Extract scripts from the exported file, and save it to a separate file. Ignored with -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(\n new Option(\n '--no-coords',\n 'Do not include the x and y coordinate positions of the journey/tree nodes.'\n )\n )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // --all -a\n if (options.all && (await getTokens())) {\n verboseMessage('Exporting everything to a single file...');\n await exportEverythingToFile(options.file, options.metadata, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n coords: options.coords,\n });\n // require --directory -D for all-separate function\n } else if (options.allSeparate && !state.getDirectory()) {\n printMessage(\n '-D or --directory required when using -A or --all-separate',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n // --all-separate -A\n } else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting everything to separate files...');\n await exportEverythingToFiles(options.extract, options.metadata, {\n useStringArrays: options.useStringArrays,\n noDecode: options.decode,\n coords: options.coords,\n });\n // unrecognized combination of options or no options\n } else {\n verboseMessage('Unrecognized combination of options or no options...');\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AACpD,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,sBAAsB,EACtBC,uBAAuB,QAClB,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,qBAAqB,CAAC;AAEvDG,OAAO,CACJC,WAAW,CACV,4EACF,CAAC,CACAC,SAAS,CAAC,IAAIV,MAAM,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC,CACtEU,SAAS,CAAC,IAAIV,MAAM,CAAC,WAAW,EAAE,qCAAqC,CAAC,CAAC,CACzEU,SAAS,CACR,IAAIV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,IAAId,OAAO,CAACU,WAAW,KAAK,MAAMrB,SAAS,CAAC,CAAC,CAAC,EAAE;IACrDF,cAAc,CAAC,2CAA2C,CAAC;IAC3D,MAAMF,uBAAuB,CAACe,OAAO,CAACe,OAAO,EAAEf,OAAO,CAACK,QAAQ,EAAE;MAC/DC,eAAe,EAAEN,OAAO,CAACM,eAAe;MACxCC,QAAQ,EAAEP,OAAO,CAACQ,MAAM;MACxBC,MAAM,EAAET,OAAO,CAACS;IAClB,CAAC,CAAC;IACF;EACF,CAAC,MAAM;IACLtB,cAAc,CAAC,sDAAsD,CAAC;IACtEI,OAAO,CAACqB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHvB,OAAO,CAACyB,KAAK,CAAC,CAAC"}
@@ -7,7 +7,7 @@ const {
7
7
  getTokens
8
8
  } = frodo.login;
9
9
  const program = new FrodoCommand('frodo journey export');
10
- program.description('Export journeys/trees.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to write the exported journey(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-deps', 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'))
10
+ program.description('Export journeys/trees.').addOption(new Option('-i, --journey-id <journey>', 'Name of a journey/tree. If specified, -a and -A are ignored.')).addOption(new Option('-f, --file <file>', 'Name of the file to write the exported journey(s) to. Ignored with -A.')).addOption(new Option('-a, --all', 'Export all the journeys/trees in a realm. Ignored with -i.')).addOption(new Option('-A, --all-separate', 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.')).addOption(new Option('-N, --no-metadata', 'Does not include metadata in the export file.')).addOption(new Option('--use-string-arrays', 'Where applicable, use string arrays to store multi-line text (e.g. scripts).').default(false, 'off')).addOption(new Option('--no-deps', 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).')).addOption(new Option('--no-coords', 'Do not include the x and y coordinate positions of the journey/tree nodes.'))
11
11
  // .addOption(
12
12
  // new Option(
13
13
  // '-O, --organize <method>',
@@ -26,7 +26,8 @@ async (host, realm, user, password, options, command) => {
26
26
  verboseMessage('Exporting journey...');
27
27
  await exportJourneyToFile(options.journeyId, options.file, options.metadata, {
28
28
  useStringArrays: options.useStringArrays,
29
- deps: options.deps
29
+ deps: options.deps,
30
+ coords: options.coords
30
31
  });
31
32
  }
32
33
  // --all -a
@@ -34,7 +35,8 @@ async (host, realm, user, password, options, command) => {
34
35
  verboseMessage('Exporting all journeys to a single file...');
35
36
  await exportJourneysToFile(options.file, options.metadata, {
36
37
  useStringArrays: options.useStringArrays,
37
- deps: options.deps
38
+ deps: options.deps,
39
+ coords: options.coords
38
40
  });
39
41
  }
40
42
  // --all-separate -A
@@ -42,7 +44,8 @@ async (host, realm, user, password, options, command) => {
42
44
  verboseMessage('Exporting all journeys to separate files...');
43
45
  await exportJourneysToFiles(options.metadata, {
44
46
  useStringArrays: options.useStringArrays,
45
- deps: options.deps
47
+ deps: options.deps,
48
+ coords: options.coords
46
49
  });
47
50
  }
48
51
  // unrecognized combination of options or no options
@@ -1 +1 @@
1
- {"version":3,"file":"journey-export.js","names":["frodo","Option","exportJourneysToFile","exportJourneysToFiles","exportJourneyToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","file","metadata","useStringArrays","deps","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/journey/journey-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportJourneysToFile,\n exportJourneysToFiles,\n exportJourneyToFile,\n} from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo journey export');\n\nprogram\n .description('Export journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to write the exported journey(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\n )\n )\n // .addOption(\n // new Option(\n // '-O, --organize <method>',\n // 'Organize exports into folders using the indicated method. Valid values for method:\\n' +\n // 'id: folders named by id of exported object\\n' +\n // 'type: folders named by type (e.g. script, journey, idp)\\n' +\n // 'type/id: folders named by type with sub-folders named by id'\n // )\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.journeyId && (await getTokens())) {\n verboseMessage('Exporting journey...');\n await exportJourneyToFile(\n options.journeyId,\n options.file,\n options.metadata,\n {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n }\n );\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all journeys to a single file...');\n await exportJourneysToFile(options.file, options.metadata, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all journeys to separate files...');\n await exportJourneysToFiles(options.metadata, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n });\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,mBAAmB,QACd,sBAAsB;AAC7B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,sBAAsB,CAAC;AAExDG,OAAO,CACJC,WAAW,CAAC,wBAAwB,CAAC,CACrCC,SAAS,CACR,IAAIX,MAAM,CACR,4BAA4B,EAC5B,8DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,wEACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,WAAW,EACX,4DACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,oBAAoB,EACpB,6GACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,mBAAmB,EACnB,+CACF,CACF,CAAC,CACAW,SAAS,CACR,IAAIX,MAAM,CACR,qBAAqB,EACrB,8EACF,CAAC,CAACY,OAAO,CAAC,KAAK,EAAE,KAAK,CACxB,CAAC,CACAD,SAAS,CACR,IAAIX,MAAM,CACR,WA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O,CAACmB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHrB,OAAO,CAACsB,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"journey-export.js","names":["frodo","Option","exportJourneysToFile","exportJourneysToFiles","exportJourneyToFile","printMessage","verboseMessage","FrodoCommand","getTokens","login","program","description","addOption","default","action","host","realm","user","password","options","command","handleDefaultArgsAndOpts","journeyId","file","metadata","useStringArrays","deps","coords","all","allSeparate","help","process","exitCode","parse"],"sources":["../../../src/cli/journey/journey-export.ts"],"sourcesContent":["import { frodo } from '@rockcarver/frodo-lib';\nimport { Option } from 'commander';\n\nimport {\n exportJourneysToFile,\n exportJourneysToFiles,\n exportJourneyToFile,\n} from '../../ops/JourneyOps';\nimport { printMessage, verboseMessage } from '../../utils/Console';\nimport { FrodoCommand } from '../FrodoCommand';\n\nconst { getTokens } = frodo.login;\n\nconst program = new FrodoCommand('frodo journey export');\n\nprogram\n .description('Export journeys/trees.')\n .addOption(\n new Option(\n '-i, --journey-id <journey>',\n 'Name of a journey/tree. If specified, -a and -A are ignored.'\n )\n )\n .addOption(\n new Option(\n '-f, --file <file>',\n 'Name of the file to write the exported journey(s) to. Ignored with -A.'\n )\n )\n .addOption(\n new Option(\n '-a, --all',\n 'Export all the journeys/trees in a realm. Ignored with -i.'\n )\n )\n .addOption(\n new Option(\n '-A, --all-separate',\n 'Export all the journeys/trees in a realm as separate files <journey/tree name>.json. Ignored with -i or -a.'\n )\n )\n .addOption(\n new Option(\n '-N, --no-metadata',\n 'Does not include metadata in the export file.'\n )\n )\n .addOption(\n new Option(\n '--use-string-arrays',\n 'Where applicable, use string arrays to store multi-line text (e.g. scripts).'\n ).default(false, 'off')\n )\n .addOption(\n new Option(\n '--no-deps',\n 'Do not include any dependencies (scripts, email templates, SAML entity providers and circles of trust, social identity providers, themes).'\n )\n )\n .addOption(\n new Option(\n '--no-coords',\n 'Do not include the x and y coordinate positions of the journey/tree nodes.'\n )\n )\n // .addOption(\n // new Option(\n // '-O, --organize <method>',\n // 'Organize exports into folders using the indicated method. Valid values for method:\\n' +\n // 'id: folders named by id of exported object\\n' +\n // 'type: folders named by type (e.g. script, journey, idp)\\n' +\n // 'type/id: folders named by type with sub-folders named by id'\n // )\n // )\n .action(\n // implement command logic inside action handler\n async (host, realm, user, password, options, command) => {\n command.handleDefaultArgsAndOpts(\n host,\n realm,\n user,\n password,\n options,\n command\n );\n // export\n if (options.journeyId && (await getTokens())) {\n verboseMessage('Exporting journey...');\n await exportJourneyToFile(\n options.journeyId,\n options.file,\n options.metadata,\n {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n coords: options.coords,\n }\n );\n }\n // --all -a\n else if (options.all && (await getTokens())) {\n verboseMessage('Exporting all journeys to a single file...');\n await exportJourneysToFile(options.file, options.metadata, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n coords: options.coords,\n });\n }\n // --all-separate -A\n else if (options.allSeparate && (await getTokens())) {\n verboseMessage('Exporting all journeys to separate files...');\n await exportJourneysToFiles(options.metadata, {\n useStringArrays: options.useStringArrays,\n deps: options.deps,\n coords: options.coords,\n });\n }\n // unrecognized combination of options or no options\n else {\n printMessage(\n 'Unrecognized combination of options or no options...',\n 'error'\n );\n program.help();\n process.exitCode = 1;\n }\n }\n // end command logic inside action handler\n );\n\nprogram.parse();\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,MAAM,QAAQ,WAAW;AAElC,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,mBAAmB,QACd,sBAAsB;AAC7B,SAASC,YAAY,EAAEC,cAAc,QAAQ,qBAAqB;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAM;EAAEC;AAAU,CAAC,GAAGR,KAAK,CAACS,KAAK;AAEjC,MAAMC,OAAO,GAAG,IAAIH,YAAY,CAAC,sBAAsB,CAAC;AAExDG,OAAO,CACJC,WAAW,CAAC,w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AAMpB,SAAS,CAAC,CAAC,CAAC,EAAE;IAC3CF,cAAc,CAAC,4CAA4C,CAAC;IAC5D,MAAMJ,oBAAoB,CAACiB,OAAO,CAACI,IAAI,EAAEJ,OAAO,CAACK,QAAQ,EAAE;MACzDC,eAAe,EAAEN,OAAO,CAACM,eAAe;MACxCC,IAAI,EAAEP,OAAO,CAACO,IAAI;MAClBC,MAAM,EAAER,OAAO,CAACQ;IAClB,CAAC,CAAC;EACJ;EACA;EAAA,KACK,IAAIR,OAAO,CAACU,WAAW,KAAK,MAAMrB,SAAS,CAAC,CAAC,CAAC,EAAE;IACnDF,cAAc,CAAC,6CAA6C,CAAC;IAC7D,MAAMH,qBAAqB,CAACgB,OAAO,CAACK,QAAQ,EAAE;MAC5CC,eAAe,EAAEN,OAAO,CAACM,eAAe;MACxCC,IAAI,EAAEP,OAAO,CAACO,IAAI;MAClBC,MAAM,EAAER,OAAO,CAACQ;IAClB,CAAC,CAAC;EACJ;EACA;EAAA,KACK;IACHtB,YAAY,CACV,sDAAsD,EACtD,OACF,CAAC;IACDK,OAAO,CAACoB,IAAI,CAAC,CAAC;IACdC,OAAO,CAACC,QAAQ,GAAG,CAAC;EACtB;AACF;AACA;AACF,CAAC;AAEHtB,OAAO,CAACuB,KAAK,CAAC,CAAC"}
@@ -28,7 +28,8 @@ const {
28
28
  */
29
29
  export async function exportEverythingToFile(file, includeMeta = true, options = {
30
30
  useStringArrays: true,
31
- noDecode: false
31
+ noDecode: false,
32
+ coords: true
32
33
  }) {
33
34
  const exportData = await exportFullConfiguration(options);
34
35
  let fileName = getTypedFilename(`${titleCase(getRealmName(state.getRealm()))}`, `everything`);
@@ -46,7 +47,8 @@ export async function exportEverythingToFile(file, includeMeta = true, options =
46
47
  */
47
48
  export async function exportEverythingToFiles(extract = false, includeMeta = true, options = {
48
49
  useStringArrays: true,
49
- noDecode: false
50
+ noDecode: false,
51
+ coords: true
50
52
  }) {
51
53
  const exportData = await exportFullConfiguration(options);
52
54
  delete exportData.meta;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigOps.js","names":["frodo","state","fs","fse","getFullExportConfig","getFullExportConfigFromDirectory","printMessage","extractScriptToFile","getRealmName","getTypedFilename","titleCase","saveJsonToFile","getFilePath","getWorkingDirectory","utils","exportFullConfiguration","importFullConfiguration","config","stringify","json","exportEverythingToFile","file","includeMeta","options","useStringArrays","noDecode","exportData","fileName","getRealm","exportEverythingToFiles","extract","meta","baseDirectory","Object","entries","forEach","type","obj","existsSync","mkdirSync","samlData","saml","cot","hosted","metadata","remote","id","value","concat","filename","entityId","samlType","authentication","includes","slice","lastIndexOf","recursive","outputFile","err","name","importEverythingFromFile","reUuidJourneys","reUuidScripts","cleanServices","global","realm","data","importEverythingFromFiles","getDirectory"],"sources":["../../src/ops/ConfigOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport {\n type FullExportInterface,\n type FullExportOptions,\n type FullImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/ConfigOps';\nimport { ScriptExportInterface } from '@rockcarver/frodo-lib/types/ops/ScriptOps';\nimport fs from 'fs';\nimport fse from 'fs-extra';\n\nimport {\n getFullExportConfig,\n getFullExportConfigFromDirectory,\n} from '../utils/Config';\nimport { printMessage } from '../utils/Console';\nimport { extractScriptToFile } from './ScriptOps';\n\nconst {\n getRealmName,\n getTypedFilename,\n titleCase,\n saveJsonToFile,\n getFilePath,\n getWorkingDirectory,\n} = frodo.utils;\nconst { exportFullConfiguration, importFullConfiguration } = frodo.config;\nconst { stringify } = frodo.utils.json;\n\n/**\n * Export everything to separate files\n * @param {String} file file name\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {FullExportOptions} options export options\n */\nexport async function exportEverythingToFile(\n file: string,\n includeMeta: boolean = true,\n options: FullExportOptions = {\n useStringArrays: true,\n noDecode: false,\n }\n): Promise<void> {\n const exportData = await exportFullConfiguration(options);\n let fileName = getTypedFilename(\n `${titleCase(getRealmName(state.getRealm()))}`,\n `everything`\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, getFilePath(fileName, true), includeMeta);\n}\n\n/**\n * Export everything to separate files\n * @param {boolean} extract Extracts the scripts from the exports into separate files if true\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {FullExportOptions} options export options\n */\nexport async function exportEverythingToFiles(\n extract: boolean = false,\n includeMeta: boolean = true,\n options: FullExportOptions = {\n useStringArrays: true,\n noDecode: false,\n }\n): Promise<void> {\n const exportData: FullExportInterface =\n await exportFullConfiguration(options);\n delete exportData.meta;\n const baseDirectory = getWorkingDirectory(true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(exportData).forEach(([type, obj]: [string, any]) => {\n if (obj) {\n if (!fs.existsSync(`${baseDirectory}/${type}`)) {\n fs.mkdirSync(`${baseDirectory}/${type}`);\n }\n if (type == 'saml') {\n const samlData = {\n saml: {\n cot: {},\n hosted: {},\n metadata: {},\n remote: {},\n },\n };\n if (obj.cot) {\n if (!fs.existsSync(`${baseDirectory}/cot`)) {\n fs.mkdirSync(`${baseDirectory}/cot`);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(obj.cot).forEach(([id, value]: [string, any]) => {\n samlData.saml.cot = {\n [id]: value,\n };\n saveJsonToFile(\n samlData,\n `${baseDirectory}/cot/${getTypedFilename(id, 'cot.saml')}`,\n includeMeta\n );\n });\n samlData.saml.cot = {};\n }\n Object.entries(obj.hosted)\n .concat(Object.entries(obj.remote))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .forEach(([id, value]: [string, any]) => {\n const filename = getTypedFilename(\n value.entityId ? value.entityId : id,\n type\n );\n const samlType = obj.hosted[id] ? 'hosted' : 'remote';\n samlData.saml[samlType][id] = value;\n samlData.saml.metadata = {\n [id]: obj.metadata[id],\n };\n saveJsonToFile(\n samlData,\n `${baseDirectory}/${type}/${filename}`,\n includeMeta\n );\n samlData.saml[samlType] = {};\n });\n } else if (type == 'authentication') {\n const fileName = getTypedFilename(\n `${frodo.utils.getRealmName(state.getRealm())}Realm`,\n 'authentication.settings'\n );\n saveJsonToFile(\n {\n authentication: obj,\n },\n `${baseDirectory}/${type}/${fileName}`,\n includeMeta\n );\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(obj).forEach(([id, value]: [string, any]) => {\n if (type == 'config') {\n if (value != null) {\n const filename = `${id}.json`;\n if (filename.includes('/')) {\n fs.mkdirSync(\n `${baseDirectory}/${type}/${filename.slice(\n 0,\n filename.lastIndexOf('/')\n )}`,\n {\n recursive: true,\n }\n );\n }\n fse.outputFile(\n `${baseDirectory}/${type}/${filename}`,\n stringify(value),\n (err) => {\n if (err) {\n return printMessage(\n `ERROR - can't save config ${id} to file - ${err}`,\n 'error'\n );\n }\n }\n );\n }\n } else {\n const filename = getTypedFilename(\n value && value.name ? value.name : id,\n type\n );\n if (extract && type == 'script') {\n extractScriptToFile(\n exportData as ScriptExportInterface,\n id,\n type\n );\n }\n saveJsonToFile(\n {\n [type]: {\n [id]: value,\n },\n },\n `${baseDirectory}/${type}/${filename}`,\n includeMeta\n );\n }\n });\n }\n }\n });\n}\n\n/**\n * Import everything from a single file\n * @param {String} file The file path\n * @param {FullImportOptions} options import options\n */\nexport async function importEverythingFromFile(\n file: string,\n options: FullImportOptions = {\n reUuidJourneys: false,\n reUuidScripts: false,\n cleanServices: false,\n global: false,\n realm: false,\n }\n) {\n const data = await getFullExportConfig(file);\n await importFullConfiguration(data, options);\n}\n\n/**\n * Import everything from separate files\n */\nexport async function importEverythingFromFiles(\n options: FullImportOptions = {\n reUuidJourneys: false,\n reUuidScripts: false,\n cleanServices: false,\n global: false,\n realm: false,\n }\n) {\n const data = await getFullExportConfigFromDirectory(state.getDirectory());\n await importFullConfiguration(data, options);\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAOpD,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,GAAG,MAAM,UAAU;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;AACT,CAAC,EACD;EACA,MAAMC,IAAI,GAAG,MAAM9D,mBAAmB,CAACiB,IAAI,CAAC;EAC5C,MAAML,uBAAuB,CAACkD,IAAI,EAAE3C,OAAO,CAAC;AAC9C;;AAEA;AACA;AACA;AACA,OAAO,eAAe4C,yBAAyBA,CAC7C5C,OAA0B,GAAG;EAC3BsC,cAAc,EAAE,KAAK;EACrBC,aAAa,EAAE,KAAK;EACpBC,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,KAAK;EACbC,KAAK,EAAE;AACT,CAAC,EACD;EACA,MAAMC,IAAI,GAAG,MAAM7D,gCAAgC,CAACJ,KAAK,CAACmE,YAAY,CAAC,CAAC,CAAC;EACzE,MAAMpD,uBAAuB,CAACkD,IAAI,EAAE3C,OAAO,CAAC;AAC9C"}
1
+ {"version":3,"file":"ConfigOps.js","names":["frodo","state","fs","fse","getFullExportConfig","getFullExportConfigFromDirectory","printMessage","extractScriptToFile","getRealmName","getTypedFilename","titleCase","saveJsonToFile","getFilePath","getWorkingDirectory","utils","exportFullConfiguration","importFullConfiguration","config","stringify","json","exportEverythingToFile","file","includeMeta","options","useStringArrays","noDecode","coords","exportData","fileName","getRealm","exportEverythingToFiles","extract","meta","baseDirectory","Object","entries","forEach","type","obj","existsSync","mkdirSync","samlData","saml","cot","hosted","metadata","remote","id","value","concat","filename","entityId","samlType","authentication","includes","slice","lastIndexOf","recursive","outputFile","err","name","importEverythingFromFile","reUuidJourneys","reUuidScripts","cleanServices","global","realm","data","importEverythingFromFiles","getDirectory"],"sources":["../../src/ops/ConfigOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport {\n type FullExportInterface,\n type FullExportOptions,\n type FullImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/ConfigOps';\nimport { ScriptExportInterface } from '@rockcarver/frodo-lib/types/ops/ScriptOps';\nimport fs from 'fs';\nimport fse from 'fs-extra';\n\nimport {\n getFullExportConfig,\n getFullExportConfigFromDirectory,\n} from '../utils/Config';\nimport { printMessage } from '../utils/Console';\nimport { extractScriptToFile } from './ScriptOps';\n\nconst {\n getRealmName,\n getTypedFilename,\n titleCase,\n saveJsonToFile,\n getFilePath,\n getWorkingDirectory,\n} = frodo.utils;\nconst { exportFullConfiguration, importFullConfiguration } = frodo.config;\nconst { stringify } = frodo.utils.json;\n\n/**\n * Export everything to separate files\n * @param {String} file file name\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {FullExportOptions} options export options\n */\nexport async function exportEverythingToFile(\n file: string,\n includeMeta: boolean = true,\n options: FullExportOptions = {\n useStringArrays: true,\n noDecode: false,\n coords: true,\n }\n): Promise<void> {\n const exportData = await exportFullConfiguration(options);\n let fileName = getTypedFilename(\n `${titleCase(getRealmName(state.getRealm()))}`,\n `everything`\n );\n if (file) {\n fileName = file;\n }\n saveJsonToFile(exportData, getFilePath(fileName, true), includeMeta);\n}\n\n/**\n * Export everything to separate files\n * @param {boolean} extract Extracts the scripts from the exports into separate files if true\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {FullExportOptions} options export options\n */\nexport async function exportEverythingToFiles(\n extract: boolean = false,\n includeMeta: boolean = true,\n options: FullExportOptions = {\n useStringArrays: true,\n noDecode: false,\n coords: true,\n }\n): Promise<void> {\n const exportData: FullExportInterface =\n await exportFullConfiguration(options);\n delete exportData.meta;\n const baseDirectory = getWorkingDirectory(true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(exportData).forEach(([type, obj]: [string, any]) => {\n if (obj) {\n if (!fs.existsSync(`${baseDirectory}/${type}`)) {\n fs.mkdirSync(`${baseDirectory}/${type}`);\n }\n if (type == 'saml') {\n const samlData = {\n saml: {\n cot: {},\n hosted: {},\n metadata: {},\n remote: {},\n },\n };\n if (obj.cot) {\n if (!fs.existsSync(`${baseDirectory}/cot`)) {\n fs.mkdirSync(`${baseDirectory}/cot`);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(obj.cot).forEach(([id, value]: [string, any]) => {\n samlData.saml.cot = {\n [id]: value,\n };\n saveJsonToFile(\n samlData,\n `${baseDirectory}/cot/${getTypedFilename(id, 'cot.saml')}`,\n includeMeta\n );\n });\n samlData.saml.cot = {};\n }\n Object.entries(obj.hosted)\n .concat(Object.entries(obj.remote))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .forEach(([id, value]: [string, any]) => {\n const filename = getTypedFilename(\n value.entityId ? value.entityId : id,\n type\n );\n const samlType = obj.hosted[id] ? 'hosted' : 'remote';\n samlData.saml[samlType][id] = value;\n samlData.saml.metadata = {\n [id]: obj.metadata[id],\n };\n saveJsonToFile(\n samlData,\n `${baseDirectory}/${type}/${filename}`,\n includeMeta\n );\n samlData.saml[samlType] = {};\n });\n } else if (type == 'authentication') {\n const fileName = getTypedFilename(\n `${frodo.utils.getRealmName(state.getRealm())}Realm`,\n 'authentication.settings'\n );\n saveJsonToFile(\n {\n authentication: obj,\n },\n `${baseDirectory}/${type}/${fileName}`,\n includeMeta\n );\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Object.entries(obj).forEach(([id, value]: [string, any]) => {\n if (type == 'config') {\n if (value != null) {\n const filename = `${id}.json`;\n if (filename.includes('/')) {\n fs.mkdirSync(\n `${baseDirectory}/${type}/${filename.slice(\n 0,\n filename.lastIndexOf('/')\n )}`,\n {\n recursive: true,\n }\n );\n }\n fse.outputFile(\n `${baseDirectory}/${type}/${filename}`,\n stringify(value),\n (err) => {\n if (err) {\n return printMessage(\n `ERROR - can't save config ${id} to file - ${err}`,\n 'error'\n );\n }\n }\n );\n }\n } else {\n const filename = getTypedFilename(\n value && value.name ? value.name : id,\n type\n );\n if (extract && type == 'script') {\n extractScriptToFile(\n exportData as ScriptExportInterface,\n id,\n type\n );\n }\n saveJsonToFile(\n {\n [type]: {\n [id]: value,\n },\n },\n `${baseDirectory}/${type}/${filename}`,\n includeMeta\n );\n }\n });\n }\n }\n });\n}\n\n/**\n * Import everything from a single file\n * @param {String} file The file path\n * @param {FullImportOptions} options import options\n */\nexport async function importEverythingFromFile(\n file: string,\n options: FullImportOptions = {\n reUuidJourneys: false,\n reUuidScripts: false,\n cleanServices: false,\n global: false,\n realm: false,\n }\n) {\n const data = await getFullExportConfig(file);\n await importFullConfiguration(data, options);\n}\n\n/**\n * Import everything from separate files\n */\nexport async function importEverythingFromFiles(\n options: FullImportOptions = {\n reUuidJourneys: false,\n reUuidScripts: false,\n cleanServices: false,\n global: false,\n realm: false,\n }\n) {\n const data = await getFullExportConfigFromDirectory(state.getDirectory());\n await importFullConfiguration(data, options);\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAOpD,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,GAAG,MAAM,UAAU;AAE1B,SACEC,mBAAmB,EACnBC,gCAAgC,QAC3B,iBAAiB;AACxB,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,aAAa;AAEjD,MAAM;EACJC,YAAY;EACZC,gBAAgB;EAChBC,SAAS;EACTC,cAAc;EACdC,WAAW;EACXC;AACF,CAAC,GAAGb,KAAK,CAACc,KAAK;AACf,MAAM;EAAEC,uBAAuB;EAAEC;AAAwB,CAAC,GAAGhB,KAAK,CAACiB,MAAM;AACzE,MAAM;EAAEC;AAAU,CAAC,GAAGlB,KAAK,CAACc,KAAK,CAACK,IAAI;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,sBAAsBA,CAC1CC,IAAY,EACZC,WAAoB,GAAG,IAAI,EAC3BC,OAA0B,GAAG;EAC3BC,eAAe,EAAE,IAAI;EACrBC,QAAQ,EAAE,KAAK;EACfC,MAAM,EAAE;AACV,CAAC,EACc;EACf,MAAMC,UAAU,GAAG,MAAMZ,uBAAuB,CAACQ,OAAO,CAAC;EACzD,IAAIK,QAAQ,GAAGnB,gBAAgB,CAC5B,GAAEC,SAAS,CAACF,YAAY,CAACP,KAAK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CV,IACF,CAAC;YACD,IAAIN,OAAO,IAAIM,IAAI,IAAI,QAAQ,EAAE;cAC/B9B,mBAAmB,CACjBoB,UAAU,EACVoB,EAAE,EACFV,IACF,CAAC;YACH;YACA1B,cAAc,CACZ;cACE,CAAC0B,IAAI,GAAG;gBACN,CAACU,EAAE,GAAGC;cACR;YACF,CAAC,EACA,GAAEf,aAAc,IAAGI,IAAK,IAAGa,QAAS,EAAC,EACtC5B,WACF,CAAC;UACH;QACF,CAAC,CAAC;MACJ;IACF;EACF,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeuC,wBAAwBA,CAC5CxC,IAAY,EACZE,OAA0B,GAAG;EAC3BuC,cAAc,EAAE,KAAK;EACrBC,aAAa,EAAE,KAAK;EACpBC,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,KAAK;EACbC,KAAK,EAAE;AACT,CAAC,EACD;EACA,MAAMC,IAAI,GAAG,MAAM/D,mBAAmB,CAACiB,IAAI,CAAC;EAC5C,MAAML,uBAAuB,CAACmD,IAAI,EAAE5C,OAAO,CAAC;AAC9C;;AAEA;AACA;AACA;AACA,OAAO,eAAe6C,yBAAyBA,CAC7C7C,OAA0B,GAAG;EAC3BuC,cAAc,EAAE,KAAK;EACrBC,aAAa,EAAE,KAAK;EACpBC,aAAa,EAAE,KAAK;EACpBC,MAAM,EAAE,KAAK;EACbC,KAAK,EAAE;AACT,CAAC,EACD;EACA,MAAMC,IAAI,GAAG,MAAM9D,gCAAgC,CAACJ,KAAK,CAACoE,YAAY,CAAC,CAAC,CAAC;EACzE,MAAMrD,uBAAuB,CAACmD,IAAI,EAAE5C,OAAO,CAAC;AAC9C"}
@@ -61,7 +61,8 @@ export async function listJourneys(long = false, analyze = false) {
61
61
  for (const journeyStub of journeys) {
62
62
  exportPromises.push(exportJourney(journeyStub['_id'], {
63
63
  useStringArrays: false,
64
- deps: false
64
+ deps: false,
65
+ coords: true
65
66
  }));
66
67
  }
67
68
  const journeyExports = await Promise.all(exportPromises);
@@ -94,7 +95,8 @@ export async function listJourneys(long = false, analyze = false) {
94
95
  */
95
96
  export async function exportJourneyToFile(journeyId, file, includeMeta = true, options = {
96
97
  deps: false,
97
- useStringArrays: false
98
+ useStringArrays: false,
99
+ coords: true
98
100
  }) {
99
101
  debugMessage(`exportJourneyToFile: start`);
100
102
  const verbose = state.getVerbose();
@@ -123,7 +125,8 @@ export async function exportJourneyToFile(journeyId, file, includeMeta = true, o
123
125
  */
124
126
  export async function exportJourneysToFile(file, includeMeta = true, options = {
125
127
  deps: false,
126
- useStringArrays: false
128
+ useStringArrays: false,
129
+ coords: true
127
130
  }) {
128
131
  if (!file) {
129
132
  file = getTypedFilename(`all${getRealmString()}Journeys`, 'journey');
@@ -140,7 +143,8 @@ export async function exportJourneysToFile(file, includeMeta = true, options = {
140
143
  */
141
144
  export async function exportJourneysToFiles(includeMeta = true, options = {
142
145
  deps: false,
143
- useStringArrays: false
146
+ useStringArrays: false,
147
+ coords: true
144
148
  }) {
145
149
  const journeysExport = await exportJourneys(options);
146
150
  const trees = Object.entries(journeysExport.trees);
@@ -1 +1 @@
1
- {"version":3,"file":"JourneyOps.js","names":["frodo","state","fs","createProgressIndicator","createTable","debugMessage","printMessage","stopProgressIndicator","updateProgressIndicator","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","cloneDeep","wordwrap","getTypedFilename","saveJsonToFile","getRealmString","getFilePath","getWorkingDirectory","utils","readJourneys","exportJourney","exportJourneys","resolveDependencies","importJourneys","importJourney","getTreeDescendents","getNodeRef","onlineTreeExportResolver","getJourneyClassification","_getJourneyClassification","disableJourney","_disableJourney","enableJourney","_enableJourney","authn","journey","listJourneys","long","analyze","journeys","journeyStub","table","_journeyStub$uiConfig","push","_id","enabled","uiConfig","categories","JSON","parse","join","toString","spinnerId","exportPromises","useStringArrays","deps","journeyExports","Promise","all","journeyExport","_journeyExport$tree$u","tree","error","response","data","_error$response","exportJourneyToFile","journeyId","file","includeMeta","options","verbose","getVerbose","filePath","fileData","exportJourneysToFile","exportJourneysToFiles","journeysExport","trees","Object","entries","treeId","treeValue","indicatorId","meta","importJourneyFromFile","readFileSync","journeyData","installedJourneys","map","x","unresolvedJourneys","resolvedJourneys","indicatorId1","keys","length","indicatorId2","importError","indicatorId3","importFirstJourneyFromFile","hasOwnProperty","call","depSpinnerId","importSpinnerId","importJourneysFromFile","name","message","type","importJourneysFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","allJourneysData","_error$response2","it","getJourneyClassificationMd","getOneLineDescription","treeObj","description","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","values","indent","Array","fill","descendent","describeTreeDescendentsMd","markdown","describeJourney","resolveTreeExport","_journeyData$meta","_journeyData$tree$uiC","_journeyData$themes","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","getAmVersion","originAmVersion","setAmVersion","stack","nodeType","count","String","getNodeClassification","nodeObj","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","_journeyData$meta2","_journeyData$tree$uiC2","_journeyData$themes2","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["../../src/ops/JourneyOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type NodeSkeleton } from '@rockcarver/frodo-lib/types/api/NodeApi';\nimport { type TreeSkeleton } from '@rockcarver/frodo-lib/types/api/TreeApi';\nimport {\n type JourneyClassificationType,\n type MultiTreeExportInterface,\n type SingleTreeExportInterface,\n type TreeDependencyMapInterface,\n type TreeExportOptions,\n type TreeExportResolverInterface,\n type TreeImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/JourneyOps';\nimport fs from 'fs';\n\nimport {\n createProgressIndicator,\n createTable,\n debugMessage,\n printMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport * as CirclesOfTrust from './CirclesOfTrustOps';\nimport * as EmailTemplate from './EmailTemplateOps';\nimport * as Idp from './IdpOps';\nimport * as Node from './NodeOps';\nimport * as Saml2 from './Saml2Ops';\nimport * as Script from './ScriptOps';\nimport * as Theme from './ThemeOps';\nimport { cloneDeep } from './utils/OpsUtils';\nimport wordwrap from './utils/Wordwrap';\n\nconst {\n getTypedFilename,\n saveJsonToFile,\n getRealmString,\n getFilePath,\n getWorkingDirectory,\n} = frodo.utils;\nconst {\n readJourneys,\n exportJourney,\n exportJourneys,\n resolveDependencies,\n importJourneys,\n importJourney,\n getTreeDescendents,\n getNodeRef,\n onlineTreeExportResolver,\n getJourneyClassification: _getJourneyClassification,\n disableJourney: _disableJourney,\n enableJourney: _enableJourney,\n} = frodo.authn.journey;\n\n/**\n * List all the journeys/trees\n * @param {boolean} long Long version, all the fields\n * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)\n * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects\n */\nexport async function listJourneys(\n long = false,\n analyze = false\n): Promise<TreeSkeleton[]> {\n let journeys = [];\n try {\n journeys = await readJourneys();\n if (!long && !analyze) {\n for (const journeyStub of journeys) {\n printMessage(`${journeyStub['_id']}`, 'data');\n }\n } else {\n if (!analyze) {\n const table = createTable(['Name', 'Status', 'Tags']);\n for (const journeyStub of journeys) {\n table.push([\n `${journeyStub._id}`,\n journeyStub.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n journeyStub.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyStub.uiConfig.categories).join(', '),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n const spinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Retrieving details of all journeys...`\n );\n const exportPromises = [];\n try {\n for (const journeyStub of journeys) {\n exportPromises.push(\n exportJourney(journeyStub['_id'], {\n useStringArrays: false,\n deps: false,\n })\n );\n }\n const journeyExports = await Promise.all(exportPromises);\n stopProgressIndicator(\n spinnerId,\n 'Retrieved details of all journeys.',\n 'success'\n );\n const table = createTable([\n 'Name',\n 'Status',\n 'Classification',\n 'Tags',\n ]);\n for (const journeyExport of journeyExports) {\n table.push([\n `${journeyExport.tree._id}`,\n journeyExport.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n getJourneyClassification(journeyExport).join(', '),\n journeyExport.tree.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyExport.tree.uiConfig.categories).join(\n ', '\n ),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } catch (error) {\n stopProgressIndicator(\n spinnerId,\n 'Error retrieving details of all journeys.',\n 'fail'\n );\n printMessage(error.response.data, 'error');\n }\n }\n }\n } catch (error) {\n printMessage(error.response?.data, 'error');\n }\n return journeys;\n}\n\n/**\n * Export journey by id/name to file\n * @param {string} journeyId journey id/name\n * @param {string} file optional export file name\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneyToFile(\n journeyId: string,\n file: string,\n includeMeta = true,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n debugMessage(`exportJourneyToFile: start`);\n const verbose = state.getVerbose();\n if (!file) {\n file = getTypedFilename(journeyId, 'journey');\n }\n const filePath = getFilePath(file, true);\n let spinnerId: string;\n if (!verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n try {\n const fileData: SingleTreeExportInterface = await exportJourney(\n journeyId,\n options\n );\n if (verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n saveJsonToFile(fileData, filePath, includeMeta);\n stopProgressIndicator(\n spinnerId,\n `Exported ${journeyId['brightCyan']} to ${filePath['brightCyan']}.`,\n 'success'\n );\n } catch (error) {\n if (verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n stopProgressIndicator(\n spinnerId,\n `Error exporting journey ${journeyId}: ${error}`,\n 'fail'\n );\n }\n}\n\n/**\n * Export all journeys to file\n * @param {string} file optional export file name\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFile(\n file: string,\n includeMeta = true,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n if (!file) {\n file = getTypedFilename(`all${getRealmString()}Journeys`, 'journey');\n }\n const filePath = getFilePath(file, true);\n const fileData: MultiTreeExportInterface = await exportJourneys(options);\n saveJsonToFile(fileData, filePath, includeMeta);\n}\n\n/**\n * Export all journeys to separate files\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFiles(\n includeMeta = true,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n }\n): Promise<void> {\n const journeysExport = await exportJourneys(options);\n const trees = Object.entries(journeysExport.trees);\n for (const [treeId, treeValue] of trees) {\n const indicatorId = createProgressIndicator(\n 'determinate',\n 1,\n `Saving ${treeId}...`\n );\n const file = getFilePath(getTypedFilename(`${treeId}`, 'journey'), true);\n treeValue['meta'] = journeysExport.meta;\n try {\n updateProgressIndicator(indicatorId, `Saving ${treeId} to ${file}`);\n saveJsonToFile(treeValue, file, includeMeta);\n stopProgressIndicator(indicatorId, `${treeId} saved to ${file}`);\n } catch (error) {\n stopProgressIndicator(indicatorId, `Error saving ${treeId} to ${file}`);\n }\n }\n}\n\n/**\n * Import a journey from file\n * @param {string} journeyId journey id/name\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneyFromFile(\n journeyId: string,\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n let journeyData = JSON.parse(data);\n // check if this is a file with multiple trees and get journey by id\n if (journeyData.trees && journeyData.trees[journeyId]) {\n journeyData = journeyData.trees[journeyId];\n } else if (journeyData.trees) {\n journeyData = null;\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId === journeyData.tree._id) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n const indicatorId1 = createProgressIndicator(\n 'indeterminate',\n 0,\n 'Resolving dependencies'\n );\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n stopProgressIndicator(\n indicatorId1,\n `Resolved all dependencies.`,\n 'success'\n );\n\n let indicatorId2: string;\n if (!verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n try {\n await importJourney(journeyData, options);\n if (verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(\n indicatorId2,\n `Imported ${journeyId}.`,\n 'success'\n );\n } catch (importError) {\n if (verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(indicatorId2, `${importError}`, 'fail');\n }\n } else {\n stopProgressIndicator(indicatorId1, `Unresolved dependencies:`, 'fail');\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n // end dependency resolution for single tree import\n } else {\n const indicatorId3 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(indicatorId3, `${journeyId} not found!`, 'fail');\n }\n } catch (error) {\n printMessage(`Error importing journey ${journeyId}: ${error}`, 'error');\n }\n}\n\n/**\n * Import first journey from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importFirstJourneyFromFile(\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n let journeyData = cloneDeep(JSON.parse(data));\n let journeyId = null;\n // single tree\n if (journeyData.tree) {\n journeyId = cloneDeep(journeyData.tree._id);\n }\n // multiple trees, so get the first tree\n else if (journeyData.trees) {\n for (const treeId in journeyData.trees) {\n if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {\n journeyId = treeId;\n journeyData = journeyData.trees[treeId];\n break;\n }\n }\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n const depSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n 'Resolving dependencies'\n );\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n stopProgressIndicator(\n depSpinnerId,\n `Resolved all dependencies.`,\n 'success'\n );\n\n let importSpinnerId: string;\n if (!verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n try {\n await importJourney(journeyData, options);\n if (verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(\n importSpinnerId,\n `Imported ${journeyId}.`,\n 'success'\n );\n } catch (importError) {\n if (verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(importSpinnerId, `${importError}`, 'fail');\n }\n } else {\n stopProgressIndicator(depSpinnerId, `Unresolved dependencies:`, 'fail');\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n } else {\n const importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing...`\n );\n stopProgressIndicator(importSpinnerId, `No journeys found!`, 'fail');\n }\n // end dependency resolution for single tree import\n } catch (error) {\n printMessage(`Error importing first journey: ${error}`, 'error');\n }\n}\n\n/**\n * Import all journeys from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFile(\n file: string,\n options: TreeImportOptions\n) {\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n try {\n const fileData = JSON.parse(data);\n await importJourneys(fileData, options);\n } catch (error) {\n if (error.name === 'UnresolvedDependenciesError') {\n for (const journey of Object.keys(error.unresolvedJourneys)) {\n printMessage({\n message: ` - ${journey} requires ${error.unresolvedJourneys[journey]}`,\n type: 'info',\n state,\n });\n }\n } else {\n printMessage(`${error.message}`, 'error');\n }\n }\n } catch (error) {\n printMessage(`Error importing journeys: ${error}`, 'error');\n }\n}\n\n/**\n * Import all journeys from separate files\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFiles(options: TreeImportOptions) {\n const names = fs.readdirSync(getWorkingDirectory());\n const jsonFiles = names\n .filter((name) => name.toLowerCase().endsWith('.journey.json'))\n .map((name) => getFilePath(name));\n const allJourneysData = { trees: {} };\n for (const file of jsonFiles) {\n const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));\n allJourneysData.trees[journeyData.tree._id] = journeyData;\n }\n try {\n await importJourneys(allJourneysData as MultiTreeExportInterface, options);\n } catch (error) {\n printMessage(`${error.response?.data?.message || error.message}`, 'error');\n }\n}\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassification(\n journey: SingleTreeExportInterface\n): JourneyClassificationType[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return it['brightGreen'];\n\n case 'cloud':\n return it['brightMagenta'];\n\n case 'custom':\n return it['brightRed'];\n\n case 'premium':\n return it['brightYellow'];\n }\n });\n}\n\n/**\n * Get journey classification in markdown\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassificationMd(\n journey: SingleTreeExportInterface\n): string[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return `:green_circle: \\`${it}\\``;\n\n case 'cloud':\n return `:purple_circle: \\`${it}\\``;\n\n case 'custom':\n return `:red_circle: \\`${it}\\``;\n\n case 'premium':\n return `:yellow_circle: \\`${it}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the tree object\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(treeObj: TreeSkeleton): string {\n const description = `[${treeObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get a one-line description of the tree object in markdown\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescriptionMd(treeObj: TreeSkeleton): string {\n const description = `${treeObj._id}`;\n return description;\n}\n\n/**\n * Helper function to render a nested list of dependent trees\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendents(\n descendents: TreeDependencyMapInterface,\n depth = 0\n) {\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n printMessage(\n `\\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,\n 'data'\n );\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n printMessage(`${indent}- ${tree['brightCyan']}`, 'data');\n for (const descendent of descendents[tree]) {\n describeTreeDescendents(descendent, depth + 1);\n }\n }\n}\n\n/**\n * Helper function to render a nested list of dependent trees in markdown\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendentsMd(\n descendents: TreeDependencyMapInterface,\n depth = 0\n): string {\n let markdown = '';\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n markdown += `## Inner Tree Dependencies (${\n Object.values(descendents)[0].length\n })\\n`;\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n markdown += `${indent}- ${tree}\\n`;\n for (const descendent of descendents[tree]) {\n markdown += describeTreeDescendentsMd(descendent, depth + 1);\n }\n return markdown;\n }\n return markdown;\n}\n\n/**\n * Describe a journey:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourney(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n): Promise<void> {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');\n printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Status\n printMessage(\n `\\nStatus\\n${\n journeyData.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen']\n }`\n );\n\n // Classification\n if (state.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`,\n 'data'\n );\n }\n\n // Dependency Tree\n try {\n const descendents = await getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n describeTreeDescendents(descendents);\n } catch (error) {\n printMessage(`Error resolving inner tree dependencies:`, 'error');\n printMessage(error.stack, 'error');\n }\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `\\nNode Types (${Object.entries(nodeTypeMap).length}):`,\n 'data'\n );\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `- ${String(count)} [${\n nodeType['brightCyan']\n }] (${Node.getNodeClassification(nodeType).join(', ')})`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`\\nNodes (${Object.entries(allNodes).length}):`, 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `- ${Node.getOneLineDescription(\n nodeObj,\n getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`\\nThemes (${journeyData.themes.length}):`, 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `\\nScripts (${Object.entries(journeyData.scripts).length}):`,\n 'data'\n );\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `\\nEmail Templates (${\n Object.entries(journeyData.emailTemplates).length\n }):`,\n 'data'\n );\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(\n `- ${EmailTemplate.getOneLineDescription(templateData)}`,\n 'data'\n );\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `\\nSocial Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n }):`,\n 'data'\n );\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `\\nSAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n }):`,\n 'data'\n );\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(\n `- ${Saml2.getOneLineDescription(entityProviderData)}`,\n 'data'\n );\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `\\nSAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n }):`,\n 'data'\n );\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(\n `- ${CirclesOfTrust.getOneLineDescription(cotData)}`,\n 'data'\n );\n }\n }\n}\n\n/**\n * Describe a journey in markdown:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourneyMd(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n) {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(\n `# ${getOneLineDescriptionMd(journeyData.tree)} - ${\n journeyData.tree.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n }, ${getJourneyClassificationMd(journeyData).join(', ')}`,\n 'data'\n );\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage(\n `\\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\\``,\n 'data'\n );\n }\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Journey image\n printMessage(`\\n[![](./${journeyData.tree._id}.png)]()\\n`, 'data');\n\n // Dependency Tree\n const descendents = await getTreeDescendents(journeyData, resolveTreeExport);\n printMessage(describeTreeDescendentsMd(descendents), 'data');\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `## Node Types (${Object.entries(nodeTypeMap).length})`,\n 'data'\n );\n printMessage('| Count | Type | Classification |', 'data');\n printMessage('| -----:| ---- | -------------- |', 'data');\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(\n nodeType\n ).join('<br>')} |`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');\n printMessage(Node.getTableHeaderMd(), 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`## Themes (${journeyData.themes.length})`, 'data');\n printMessage(Theme.getTableHeaderMd(), 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `## Scripts (${Object.entries(journeyData.scripts).length})`,\n 'data'\n );\n printMessage(Script.getTableHeaderMd(), 'data');\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `## Email Templates (${\n Object.entries(journeyData.emailTemplates).length\n })`,\n 'data'\n );\n printMessage(EmailTemplate.getTableHeaderMd(), 'data');\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `## Social Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n })`,\n 'data'\n );\n printMessage(Idp.getTableHeaderMd(), 'data');\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `## SAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n })`,\n 'data'\n );\n printMessage(Saml2.getTableHeaderMd(), 'data');\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `## SAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n })`,\n 'data'\n );\n printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');\n }\n }\n}\n\nexport async function enableJourney(journeyId: string): Promise<boolean> {\n const indicatorId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Enabling journey ${journeyId}...`\n );\n if (_enableJourney(journeyId)) {\n stopProgressIndicator(\n indicatorId,\n `Enabled journey ${journeyId}.`,\n 'success'\n );\n return true;\n } else {\n stopProgressIndicator(\n indicatorId,\n `Error enabling journey ${journeyId}`,\n 'fail'\n );\n return false;\n }\n}\n\nexport async function disableJourney(journeyId: string): Promise<boolean> {\n const indicatorId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Disabling journey ${journeyId}...`\n );\n if (_disableJourney(journeyId)) {\n stopProgressIndicator(\n indicatorId,\n `Disabled journey ${journeyId}.`,\n 'success'\n );\n return true;\n } else {\n stopProgressIndicator(\n indicatorId,\n `Error disabling journey ${journeyId}`,\n 'fail'\n );\n return false;\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAYpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,uBAAuB,EACvBC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,qBAAqB,EACrBC,uBAAuB,QAClB,kBAAkB;AACzB,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AACnD,OAAO,KAAKC,GAAG,MAAM,UAAU;AAC/B,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,KAAK,MAAM,YAAY;AACnC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,QAAQ,MAAM,kBAAkB;AAEvC,MAAM;EACJC,gBAAgB;EAChBC,cAAc;EACdC,cAAc;EACdC,WAAW;EACXC;AACF,CAAC,GAAGtB,KAAK,CAACuB,KAAK;AACf,MAAM;EACJC,YAAY;EACZC,aAAa;EACbC,cAAc;EACdC,mBAAmB;EACnBC,cAAc;EACdC,aAAa;EACbC,kBAAkB;EAClBC,UAAU;EACVC,wBAAwB;EACxBC,wBAAwB,EAAEC,yBAAyB;EACnDC,cAAc,EAAEC,eAAe;EAC/BC,aAAa,EAAEC;AACjB,CAAC,GAAGtC,KAAK,CAAC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ACnBiF,WAAW,EACV,2BAA0BhB,SAAU,EAAC,EACtC,MACF,CAAC;IACD,OAAO,KAAK;EACd;AACF"}
1
+ {"version":3,"file":"JourneyOps.js","names":["frodo","state","fs","createProgressIndicator","createTable","debugMessage","printMessage","stopProgressIndicator","updateProgressIndicator","CirclesOfTrust","EmailTemplate","Idp","Node","Saml2","Script","Theme","cloneDeep","wordwrap","getTypedFilename","saveJsonToFile","getRealmString","getFilePath","getWorkingDirectory","utils","readJourneys","exportJourney","exportJourneys","resolveDependencies","importJourneys","importJourney","getTreeDescendents","getNodeRef","onlineTreeExportResolver","getJourneyClassification","_getJourneyClassification","disableJourney","_disableJourney","enableJourney","_enableJourney","authn","journey","listJourneys","long","analyze","journeys","journeyStub","table","_journeyStub$uiConfig","push","_id","enabled","uiConfig","categories","JSON","parse","join","toString","spinnerId","exportPromises","useStringArrays","deps","coords","journeyExports","Promise","all","journeyExport","_journeyExport$tree$u","tree","error","response","data","_error$response","exportJourneyToFile","journeyId","file","includeMeta","options","verbose","getVerbose","filePath","fileData","exportJourneysToFile","exportJourneysToFiles","journeysExport","trees","Object","entries","treeId","treeValue","indicatorId","meta","importJourneyFromFile","readFileSync","journeyData","installedJourneys","map","x","unresolvedJourneys","resolvedJourneys","indicatorId1","keys","length","indicatorId2","importError","indicatorId3","importFirstJourneyFromFile","hasOwnProperty","call","depSpinnerId","importSpinnerId","importJourneysFromFile","name","message","type","importJourneysFromFiles","names","readdirSync","jsonFiles","filter","toLowerCase","endsWith","allJourneysData","_error$response2","it","getJourneyClassificationMd","getOneLineDescription","treeObj","description","getOneLineDescriptionMd","describeTreeDescendents","descendents","depth","values","indent","Array","fill","descendent","describeTreeDescendentsMd","markdown","describeJourney","resolveTreeExport","_journeyData$meta","_journeyData$tree$uiC","_journeyData$themes","allNodes","nodes","innerNodes","nodeTypeMap","nodeData","_type","getAmVersion","originAmVersion","setAmVersion","stack","nodeType","count","String","getNodeClassification","nodeObj","themes","themeData","scripts","scriptData","emailTemplates","templateData","socialIdentityProviders","socialIdpData","saml2Entities","entityProviderData","circlesOfTrust","cotData","describeJourneyMd","_journeyData$meta2","_journeyData$tree$uiC2","_journeyData$themes2","getNodeClassificationMd","getTableHeaderMd","getTableRowMd"],"sources":["../../src/ops/JourneyOps.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { type NodeSkeleton } from '@rockcarver/frodo-lib/types/api/NodeApi';\nimport { type TreeSkeleton } from '@rockcarver/frodo-lib/types/api/TreeApi';\nimport {\n type JourneyClassificationType,\n type MultiTreeExportInterface,\n type SingleTreeExportInterface,\n type TreeDependencyMapInterface,\n type TreeExportOptions,\n type TreeExportResolverInterface,\n type TreeImportOptions,\n} from '@rockcarver/frodo-lib/types/ops/JourneyOps';\nimport fs from 'fs';\n\nimport {\n createProgressIndicator,\n createTable,\n debugMessage,\n printMessage,\n stopProgressIndicator,\n updateProgressIndicator,\n} from '../utils/Console';\nimport * as CirclesOfTrust from './CirclesOfTrustOps';\nimport * as EmailTemplate from './EmailTemplateOps';\nimport * as Idp from './IdpOps';\nimport * as Node from './NodeOps';\nimport * as Saml2 from './Saml2Ops';\nimport * as Script from './ScriptOps';\nimport * as Theme from './ThemeOps';\nimport { cloneDeep } from './utils/OpsUtils';\nimport wordwrap from './utils/Wordwrap';\n\nconst {\n getTypedFilename,\n saveJsonToFile,\n getRealmString,\n getFilePath,\n getWorkingDirectory,\n} = frodo.utils;\nconst {\n readJourneys,\n exportJourney,\n exportJourneys,\n resolveDependencies,\n importJourneys,\n importJourney,\n getTreeDescendents,\n getNodeRef,\n onlineTreeExportResolver,\n getJourneyClassification: _getJourneyClassification,\n disableJourney: _disableJourney,\n enableJourney: _enableJourney,\n} = frodo.authn.journey;\n\n/**\n * List all the journeys/trees\n * @param {boolean} long Long version, all the fields\n * @param {boolean} analyze Analyze journeys/trees for custom nodes (expensive)\n * @returns {Promise<TreeSkeleton[]>} a promise that resolves to an array journey objects\n */\nexport async function listJourneys(\n long = false,\n analyze = false\n): Promise<TreeSkeleton[]> {\n let journeys = [];\n try {\n journeys = await readJourneys();\n if (!long && !analyze) {\n for (const journeyStub of journeys) {\n printMessage(`${journeyStub['_id']}`, 'data');\n }\n } else {\n if (!analyze) {\n const table = createTable(['Name', 'Status', 'Tags']);\n for (const journeyStub of journeys) {\n table.push([\n `${journeyStub._id}`,\n journeyStub.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n journeyStub.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyStub.uiConfig.categories).join(', '),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } else {\n const spinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Retrieving details of all journeys...`\n );\n const exportPromises = [];\n try {\n for (const journeyStub of journeys) {\n exportPromises.push(\n exportJourney(journeyStub['_id'], {\n useStringArrays: false,\n deps: false,\n coords: true,\n })\n );\n }\n const journeyExports = await Promise.all(exportPromises);\n stopProgressIndicator(\n spinnerId,\n 'Retrieved details of all journeys.',\n 'success'\n );\n const table = createTable([\n 'Name',\n 'Status',\n 'Classification',\n 'Tags',\n ]);\n for (const journeyExport of journeyExports) {\n table.push([\n `${journeyExport.tree._id}`,\n journeyExport.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen'],\n getJourneyClassification(journeyExport).join(', '),\n journeyExport.tree.uiConfig?.categories\n ? wordwrap(\n JSON.parse(journeyExport.tree.uiConfig.categories).join(\n ', '\n ),\n 60\n )\n : '',\n ]);\n }\n printMessage(table.toString(), 'data');\n } catch (error) {\n stopProgressIndicator(\n spinnerId,\n 'Error retrieving details of all journeys.',\n 'fail'\n );\n printMessage(error.response.data, 'error');\n }\n }\n }\n } catch (error) {\n printMessage(error.response?.data, 'error');\n }\n return journeys;\n}\n\n/**\n * Export journey by id/name to file\n * @param {string} journeyId journey id/name\n * @param {string} file optional export file name\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneyToFile(\n journeyId: string,\n file: string,\n includeMeta = true,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n coords: true,\n }\n): Promise<void> {\n debugMessage(`exportJourneyToFile: start`);\n const verbose = state.getVerbose();\n if (!file) {\n file = getTypedFilename(journeyId, 'journey');\n }\n const filePath = getFilePath(file, true);\n let spinnerId: string;\n if (!verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n try {\n const fileData: SingleTreeExportInterface = await exportJourney(\n journeyId,\n options\n );\n if (verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n saveJsonToFile(fileData, filePath, includeMeta);\n stopProgressIndicator(\n spinnerId,\n `Exported ${journeyId['brightCyan']} to ${filePath['brightCyan']}.`,\n 'success'\n );\n } catch (error) {\n if (verbose)\n spinnerId = createProgressIndicator('indeterminate', 0, `${journeyId}`);\n stopProgressIndicator(\n spinnerId,\n `Error exporting journey ${journeyId}: ${error}`,\n 'fail'\n );\n }\n}\n\n/**\n * Export all journeys to file\n * @param {string} file optional export file name\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFile(\n file: string,\n includeMeta = true,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n coords: true,\n }\n): Promise<void> {\n if (!file) {\n file = getTypedFilename(`all${getRealmString()}Journeys`, 'journey');\n }\n const filePath = getFilePath(file, true);\n const fileData: MultiTreeExportInterface = await exportJourneys(options);\n saveJsonToFile(fileData, filePath, includeMeta);\n}\n\n/**\n * Export all journeys to separate files\n * @param {boolean} includeMeta true to include metadata, false otherwise. Default: true\n * @param {TreeExportOptions} options export options\n */\nexport async function exportJourneysToFiles(\n includeMeta = true,\n options: TreeExportOptions = {\n deps: false,\n useStringArrays: false,\n coords: true,\n }\n): Promise<void> {\n const journeysExport = await exportJourneys(options);\n const trees = Object.entries(journeysExport.trees);\n for (const [treeId, treeValue] of trees) {\n const indicatorId = createProgressIndicator(\n 'determinate',\n 1,\n `Saving ${treeId}...`\n );\n const file = getFilePath(getTypedFilename(`${treeId}`, 'journey'), true);\n treeValue['meta'] = journeysExport.meta;\n try {\n updateProgressIndicator(indicatorId, `Saving ${treeId} to ${file}`);\n saveJsonToFile(treeValue, file, includeMeta);\n stopProgressIndicator(indicatorId, `${treeId} saved to ${file}`);\n } catch (error) {\n stopProgressIndicator(indicatorId, `Error saving ${treeId} to ${file}`);\n }\n }\n}\n\n/**\n * Import a journey from file\n * @param {string} journeyId journey id/name\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneyFromFile(\n journeyId: string,\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n let journeyData = JSON.parse(data);\n // check if this is a file with multiple trees and get journey by id\n if (journeyData.trees && journeyData.trees[journeyId]) {\n journeyData = journeyData.trees[journeyId];\n } else if (journeyData.trees) {\n journeyData = null;\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId === journeyData.tree._id) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n const indicatorId1 = createProgressIndicator(\n 'indeterminate',\n 0,\n 'Resolving dependencies'\n );\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n stopProgressIndicator(\n indicatorId1,\n `Resolved all dependencies.`,\n 'success'\n );\n\n let indicatorId2: string;\n if (!verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n try {\n await importJourney(journeyData, options);\n if (verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(\n indicatorId2,\n `Imported ${journeyId}.`,\n 'success'\n );\n } catch (importError) {\n if (verbose)\n indicatorId2 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(indicatorId2, `${importError}`, 'fail');\n }\n } else {\n stopProgressIndicator(indicatorId1, `Unresolved dependencies:`, 'fail');\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n // end dependency resolution for single tree import\n } else {\n const indicatorId3 = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(indicatorId3, `${journeyId} not found!`, 'fail');\n }\n } catch (error) {\n printMessage(`Error importing journey ${journeyId}: ${error}`, 'error');\n }\n}\n\n/**\n * Import first journey from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importFirstJourneyFromFile(\n file: string,\n options: TreeImportOptions\n) {\n const verbose = state.getVerbose();\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n let journeyData = cloneDeep(JSON.parse(data));\n let journeyId = null;\n // single tree\n if (journeyData.tree) {\n journeyId = cloneDeep(journeyData.tree._id);\n }\n // multiple trees, so get the first tree\n else if (journeyData.trees) {\n for (const treeId in journeyData.trees) {\n if (Object.hasOwnProperty.call(journeyData.trees, treeId)) {\n journeyId = treeId;\n journeyData = journeyData.trees[treeId];\n break;\n }\n }\n }\n\n // if a journeyId was specified, only import the matching journey\n if (journeyData && journeyId) {\n // attempt dependency resolution for single tree import\n const installedJourneys = (await readJourneys()).map((x) => x._id);\n const unresolvedJourneys = {};\n const resolvedJourneys = [];\n const depSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n 'Resolving dependencies'\n );\n await resolveDependencies(\n installedJourneys,\n { [journeyId]: journeyData },\n unresolvedJourneys,\n resolvedJourneys\n );\n if (Object.keys(unresolvedJourneys).length === 0) {\n stopProgressIndicator(\n depSpinnerId,\n `Resolved all dependencies.`,\n 'success'\n );\n\n let importSpinnerId: string;\n if (!verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n try {\n await importJourney(journeyData, options);\n if (verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(\n importSpinnerId,\n `Imported ${journeyId}.`,\n 'success'\n );\n } catch (importError) {\n if (verbose)\n importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing ${journeyId}...`\n );\n stopProgressIndicator(importSpinnerId, `${importError}`, 'fail');\n }\n } else {\n stopProgressIndicator(depSpinnerId, `Unresolved dependencies:`, 'fail');\n for (const journey of Object.keys(unresolvedJourneys)) {\n printMessage(\n ` ${journey} requires ${unresolvedJourneys[journey]}`,\n 'error'\n );\n }\n }\n } else {\n const importSpinnerId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Importing...`\n );\n stopProgressIndicator(importSpinnerId, `No journeys found!`, 'fail');\n }\n // end dependency resolution for single tree import\n } catch (error) {\n printMessage(`Error importing first journey: ${error}`, 'error');\n }\n}\n\n/**\n * Import all journeys from file\n * @param {string} file import file name\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFile(\n file: string,\n options: TreeImportOptions\n) {\n try {\n const data = fs.readFileSync(getFilePath(file), 'utf8');\n try {\n const fileData = JSON.parse(data);\n await importJourneys(fileData, options);\n } catch (error) {\n if (error.name === 'UnresolvedDependenciesError') {\n for (const journey of Object.keys(error.unresolvedJourneys)) {\n printMessage({\n message: ` - ${journey} requires ${error.unresolvedJourneys[journey]}`,\n type: 'info',\n state,\n });\n }\n } else {\n printMessage(`${error.message}`, 'error');\n }\n }\n } catch (error) {\n printMessage(`Error importing journeys: ${error}`, 'error');\n }\n}\n\n/**\n * Import all journeys from separate files\n * @param {TreeImportOptions} options import options\n */\nexport async function importJourneysFromFiles(options: TreeImportOptions) {\n const names = fs.readdirSync(getWorkingDirectory());\n const jsonFiles = names\n .filter((name) => name.toLowerCase().endsWith('.journey.json'))\n .map((name) => getFilePath(name));\n const allJourneysData = { trees: {} };\n for (const file of jsonFiles) {\n const journeyData = JSON.parse(fs.readFileSync(file, 'utf8'));\n allJourneysData.trees[journeyData.tree._id] = journeyData;\n }\n try {\n await importJourneys(allJourneysData as MultiTreeExportInterface, options);\n } catch (error) {\n printMessage(`${error.response?.data?.message || error.message}`, 'error');\n }\n}\n\n/**\n * Get journey classification\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassification(\n journey: SingleTreeExportInterface\n): JourneyClassificationType[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return it['brightGreen'];\n\n case 'cloud':\n return it['brightMagenta'];\n\n case 'custom':\n return it['brightRed'];\n\n case 'premium':\n return it['brightYellow'];\n }\n });\n}\n\n/**\n * Get journey classification in markdown\n * @param {SingleTreeExportInterface} journey journey export\n * @returns {string[]} Colored string array of classifications\n */\nexport function getJourneyClassificationMd(\n journey: SingleTreeExportInterface\n): string[] {\n return _getJourneyClassification(journey).map((it) => {\n switch (it) {\n case 'standard':\n return `:green_circle: \\`${it}\\``;\n\n case 'cloud':\n return `:purple_circle: \\`${it}\\``;\n\n case 'custom':\n return `:red_circle: \\`${it}\\``;\n\n case 'premium':\n return `:yellow_circle: \\`${it}\\``;\n }\n });\n}\n\n/**\n * Get a one-line description of the tree object\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescription(treeObj: TreeSkeleton): string {\n const description = `[${treeObj._id['brightCyan']}]`;\n return description;\n}\n\n/**\n * Get a one-line description of the tree object in markdown\n * @param {TreeSkeleton} treeObj circle of trust object to describe\n * @returns {string} a one-line description\n */\nexport function getOneLineDescriptionMd(treeObj: TreeSkeleton): string {\n const description = `${treeObj._id}`;\n return description;\n}\n\n/**\n * Helper function to render a nested list of dependent trees\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendents(\n descendents: TreeDependencyMapInterface,\n depth = 0\n) {\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n printMessage(\n `\\nInner Tree Dependencies (${Object.values(descendents)[0].length}):`,\n 'data'\n );\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n printMessage(`${indent}- ${tree['brightCyan']}`, 'data');\n for (const descendent of descendents[tree]) {\n describeTreeDescendents(descendent, depth + 1);\n }\n }\n}\n\n/**\n * Helper function to render a nested list of dependent trees in markdown\n * @param {TreeDependencyMapInterface} descendents tree dependency map\n * @param {number} depth level of nesting\n */\nfunction describeTreeDescendentsMd(\n descendents: TreeDependencyMapInterface,\n depth = 0\n): string {\n let markdown = '';\n if (depth || Object.values(descendents)[0].length) {\n // heading\n if (depth === 0) {\n markdown += `## Inner Tree Dependencies (${\n Object.values(descendents)[0].length\n })\\n`;\n }\n const indent = Array(depth * 2)\n .fill(' ')\n .join('');\n const [tree] = Object.keys(descendents);\n markdown += `${indent}- ${tree}\\n`;\n for (const descendent of descendents[tree]) {\n markdown += describeTreeDescendentsMd(descendent, depth + 1);\n }\n return markdown;\n }\n return markdown;\n}\n\n/**\n * Describe a journey:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourney(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n): Promise<void> {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(`${getOneLineDescription(journeyData.tree)}`, 'data');\n printMessage(Array(`[${journeyData.tree._id}]`['length']).fill('=').join(''));\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Status\n printMessage(\n `\\nStatus\\n${\n journeyData.tree.enabled === false\n ? 'disabled'['brightRed']\n : 'enabled'['brightGreen']\n }`\n );\n\n // Classification\n if (state.getAmVersion()) {\n printMessage(\n `\\nClassification\\n${getJourneyClassification(journeyData).join(', ')}`,\n 'data'\n );\n }\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage('\\nCategories/Tags', 'data');\n printMessage(\n `${JSON.parse(journeyData.tree.uiConfig.categories).join(', ')}`,\n 'data'\n );\n }\n\n // Dependency Tree\n try {\n const descendents = await getTreeDescendents(\n journeyData,\n resolveTreeExport\n );\n describeTreeDescendents(descendents);\n } catch (error) {\n printMessage(`Error resolving inner tree dependencies:`, 'error');\n printMessage(error.stack, 'error');\n }\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `\\nNode Types (${Object.entries(nodeTypeMap).length}):`,\n 'data'\n );\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `- ${String(count)} [${\n nodeType['brightCyan']\n }] (${Node.getNodeClassification(nodeType).join(', ')})`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`\\nNodes (${Object.entries(allNodes).length}):`, 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `- ${Node.getOneLineDescription(\n nodeObj,\n getNodeRef(nodeObj, journeyData)\n )}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`\\nThemes (${journeyData.themes.length}):`, 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`- ${Theme.getOneLineDescription(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `\\nScripts (${Object.entries(journeyData.scripts).length}):`,\n 'data'\n );\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`- ${Script.getOneLineDescription(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `\\nEmail Templates (${\n Object.entries(journeyData.emailTemplates).length\n }):`,\n 'data'\n );\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(\n `- ${EmailTemplate.getOneLineDescription(templateData)}`,\n 'data'\n );\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `\\nSocial Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n }):`,\n 'data'\n );\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`- ${Idp.getOneLineDescription(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `\\nSAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n }):`,\n 'data'\n );\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(\n `- ${Saml2.getOneLineDescription(entityProviderData)}`,\n 'data'\n );\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `\\nSAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n }):`,\n 'data'\n );\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(\n `- ${CirclesOfTrust.getOneLineDescription(cotData)}`,\n 'data'\n );\n }\n }\n}\n\n/**\n * Describe a journey in markdown:\n * - Properties, tags, description, name, metadata\n * - Inner tree dependency tree\n * - Node type summary\n * - Nodes\n * - Themes\n * - Scripts\n * - Email templates\n * - Social identity providers\n * - SAML2 entity providers\n * - SAML2 circles of trust\n * @param {SingleTreeExportInterface} journeyData journey export object\n * @param {TreeExportResolverInterface} resolveTreeExport tree export resolver callback function\n */\nexport async function describeJourneyMd(\n journeyData: SingleTreeExportInterface,\n resolveTreeExport: TreeExportResolverInterface = onlineTreeExportResolver\n) {\n const allNodes = {\n ...journeyData.nodes,\n ...journeyData.innerNodes,\n };\n const nodeTypeMap = {};\n\n for (const nodeData of Object.values(allNodes)) {\n if (nodeTypeMap[nodeData._type._id]) {\n nodeTypeMap[nodeData._type._id] += 1;\n } else {\n nodeTypeMap[nodeData._type._id] = 1;\n }\n }\n\n // initialize AM version from file\n if (!state.getAmVersion() && journeyData.meta?.originAmVersion) {\n state.setAmVersion(journeyData.meta.originAmVersion);\n }\n\n // Journey Name\n printMessage(\n `# ${getOneLineDescriptionMd(journeyData.tree)} - ${\n journeyData.tree.enabled === false\n ? ':o: `disabled`'\n : ':white_check_mark: `enabled`'\n }, ${getJourneyClassificationMd(journeyData).join(', ')}`,\n 'data'\n );\n\n // Categories/Tags\n if (\n journeyData.tree.uiConfig?.categories &&\n journeyData.tree.uiConfig.categories != '[]'\n ) {\n printMessage(\n `\\`${JSON.parse(journeyData.tree.uiConfig.categories).join('`, `')}\\``,\n 'data'\n );\n }\n\n // Description\n if (journeyData.tree.description) {\n printMessage(`\\n${journeyData.tree.description}`, 'data');\n }\n\n // Journey image\n printMessage(`\\n[![](./${journeyData.tree._id}.png)]()\\n`, 'data');\n\n // Dependency Tree\n const descendents = await getTreeDescendents(journeyData, resolveTreeExport);\n printMessage(describeTreeDescendentsMd(descendents), 'data');\n\n // Node Types\n if (Object.entries(nodeTypeMap).length) {\n printMessage(\n `## Node Types (${Object.entries(nodeTypeMap).length})`,\n 'data'\n );\n printMessage('| Count | Type | Classification |', 'data');\n printMessage('| -----:| ---- | -------------- |', 'data');\n for (const [nodeType, count] of Object.entries(nodeTypeMap)) {\n printMessage(\n `| ${String(count)} | ${nodeType} | ${Node.getNodeClassificationMd(\n nodeType\n ).join('<br>')} |`,\n 'data'\n );\n }\n }\n\n // Nodes\n if (Object.entries(allNodes).length) {\n printMessage(`## Nodes (${Object.entries(allNodes).length})`, 'data');\n printMessage(Node.getTableHeaderMd(), 'data');\n for (const nodeObj of Object.values<NodeSkeleton>(allNodes)) {\n printMessage(\n `${Node.getTableRowMd(nodeObj, getNodeRef(nodeObj, journeyData))}`,\n 'data'\n );\n }\n }\n\n // Themes\n if (journeyData.themes?.length) {\n printMessage(`## Themes (${journeyData.themes.length})`, 'data');\n printMessage(Theme.getTableHeaderMd(), 'data');\n for (const themeData of journeyData.themes) {\n printMessage(`${Theme.getTableRowMd(themeData)}`, 'data');\n }\n }\n\n // Scripts\n if (Object.entries(journeyData.scripts).length) {\n printMessage(\n `## Scripts (${Object.entries(journeyData.scripts).length})`,\n 'data'\n );\n printMessage(Script.getTableHeaderMd(), 'data');\n for (const scriptData of Object.values(journeyData.scripts)) {\n printMessage(`${Script.getTableRowMd(scriptData)}`, 'data');\n }\n }\n\n // Email Templates\n if (Object.entries(journeyData.emailTemplates).length) {\n printMessage(\n `## Email Templates (${\n Object.entries(journeyData.emailTemplates).length\n })`,\n 'data'\n );\n printMessage(EmailTemplate.getTableHeaderMd(), 'data');\n for (const templateData of Object.values(journeyData.emailTemplates)) {\n printMessage(`${EmailTemplate.getTableRowMd(templateData)}`, 'data');\n }\n }\n\n // Social Identity Providers\n if (Object.entries(journeyData.socialIdentityProviders).length) {\n printMessage(\n `## Social Identity Providers (${\n Object.entries(journeyData.socialIdentityProviders).length\n })`,\n 'data'\n );\n printMessage(Idp.getTableHeaderMd(), 'data');\n for (const socialIdpData of Object.values(\n journeyData.socialIdentityProviders\n )) {\n printMessage(`${Idp.getTableRowMd(socialIdpData)}`, 'data');\n }\n }\n\n // SAML2 Entity Providers\n if (Object.entries(journeyData.saml2Entities).length) {\n printMessage(\n `## SAML2 Entity Providers (${\n Object.entries(journeyData.saml2Entities).length\n })`,\n 'data'\n );\n printMessage(Saml2.getTableHeaderMd(), 'data');\n for (const entityProviderData of Object.values(journeyData.saml2Entities)) {\n printMessage(`${Saml2.getTableRowMd(entityProviderData)}`, 'data');\n }\n }\n\n // SAML2 Circles Of Trust\n if (Object.entries(journeyData.circlesOfTrust).length) {\n printMessage(\n `## SAML2 Circles Of Trust (${\n Object.entries(journeyData.circlesOfTrust).length\n })`,\n 'data'\n );\n printMessage(CirclesOfTrust.getTableHeaderMd(), 'data');\n for (const cotData of Object.values(journeyData.circlesOfTrust)) {\n printMessage(`${CirclesOfTrust.getTableRowMd(cotData)}`, 'data');\n }\n }\n}\n\nexport async function enableJourney(journeyId: string): Promise<boolean> {\n const indicatorId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Enabling journey ${journeyId}...`\n );\n if (_enableJourney(journeyId)) {\n stopProgressIndicator(\n indicatorId,\n `Enabled journey ${journeyId}.`,\n 'success'\n );\n return true;\n } else {\n stopProgressIndicator(\n indicatorId,\n `Error enabling journey ${journeyId}`,\n 'fail'\n );\n return false;\n }\n}\n\nexport async function disableJourney(journeyId: string): Promise<boolean> {\n const indicatorId = createProgressIndicator(\n 'indeterminate',\n 0,\n `Disabling journey ${journeyId}...`\n );\n if (_disableJourney(journeyId)) {\n stopProgressIndicator(\n indicatorId,\n `Disabled journey ${journeyId}.`,\n 'success'\n );\n return true;\n } else {\n stopProgressIndicator(\n indicatorId,\n `Error disabling journey ${journeyId}`,\n 'fail'\n );\n return false;\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAYpD,OAAOC,EAAE,MAAM,IAAI;AAEnB,SACEC,uBAAuB,EACvBC,WAAW,EACXC,YAAY,EACZC,YAAY,EACZC,qBAAqB,EACrBC,uBAAuB,QAClB,kBAAkB;AACzB,OAAO,KAAKC,cAAc,MAAM,q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AAO,CAAE,EAAC,EAAE,MAAM,CAAC;IAClE;EACF;AACF;AAEA,OAAO,eAAerI,aAAaA,CAACoC,SAAiB,EAAoB;EACvE,MAAMgB,WAAW,GAAGtF,uBAAuB,CACzC,eAAe,EACf,CAAC,EACA,oBAAmBsE,SAAU,KAChC,CAAC;EACD,IAAInC,cAAc,CAACmC,SAAS,CAAC,EAAE;IAC7BlE,qBAAqB,CACnBkF,WAAW,EACV,mBAAkBhB,SAAU,GAAE,EAC/B,SACF,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM;IACLlE,qBAAqB,CACnBkF,WAAW,EACV,0BAAyBhB,SAAU,EAAC,EACrC,MACF,CAAC;IACD,OAAO,KAAK;EACd;AACF;AAEA,OAAO,eAAetC,cAAcA,CAACsC,SAAiB,EAAoB;EACxE,MAAMgB,WAAW,GAAGtF,uBAAuB,CACzC,eAAe,EACf,CAAC,EACA,qBAAoBsE,SAAU,KACjC,CAAC;EACD,IAAIrC,eAAe,CAACqC,SAAS,CAAC,EAAE;IAC9BlE,qBAAqB,CACnBkF,WAAW,EACV,oBAAmBhB,SAAU,GAAE,EAChC,SACF,CAAC;IACD,OAAO,IAAI;EACb,CAAC,MAAM;IACLlE,qBAAqB,CACnBkF,WAAW,EACV,2BAA0BhB,SAAU,EAAC,EACtC,MACF,CAAC;IACD,OAAO,KAAK;EACd;AACF"}
@@ -67,7 +67,8 @@ export async function getFullExportConfig(file = null) {
67
67
  if (!workingDirectory) {
68
68
  return await exportFullConfiguration({
69
69
  useStringArrays: true,
70
- noDecode: false
70
+ noDecode: false,
71
+ coords: true
71
72
  });
72
73
  }
73
74
  // Go through files in the working directory and reconstruct the full export
@@ -1 +1 @@
1
- {"version":3,"file":"Config.js","names":["frodo","state","fs","os","slugify","printMessage","getFilePath","readFiles","utils","exportFullConfiguration","config","getDefaultNoiseFilter","cloud","log","FRODO_CONFIG_PATH_KEY","FRODO_LOG_NOISEFILTER_FILENAME","getConfigPath","process","env","homedir","getCustomNoiseFilters","filename","noiseFilter","data","readFileSync","JSON","parse","e","message","getNoiseFilters","defaults","length","writeFileSync","stringify","getFullExportConfig","file","workingDirectory","getDirectory","useStringArrays","noDecode","getFullExportConfigFromDirectory","directory","fullExportConfig","meta","agents","application","authentication","emailTemplate","idp","managedApplication","policy","policyset","resourcetype","saml","hosted","remote","metadata","cot","script","secrets","service","theme","trees","variables","files","jsonFiles","filter","f","path","endsWith","idmConfigFiles","startsWith","samlFiles","otherFiles","scriptFiles","id","value","Object","entries","content","assign","_id","scriptExports","values","name","substring","lastIndexOf","indexOf","scriptLines","split","find","s","replace","remove","Error","isIdUsed","configuration","isEsv","isIdUsedRecurse","RegExp","replaceAll","regex","type","used","location","test"],"sources":["../../src/utils/Config.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { FullExportInterface } from '@rockcarver/frodo-lib/types/ops/ConfigOps';\nimport fs from 'fs';\nimport os from 'os';\nimport slugify from 'slugify';\n\nimport { printMessage } from './Console';\n\nconst { getFilePath, readFiles } = frodo.utils;\n\nconst { exportFullConfiguration } = frodo.config;\n\nconst { getDefaultNoiseFilter } = frodo.cloud.log;\n\nexport const FRODO_CONFIG_PATH_KEY = 'FRODO_CONFIG_PATH';\nexport const FRODO_LOG_NOISEFILTER_FILENAME = 'LoggingNoiseFilter.json';\n\nexport function getConfigPath(): string {\n return process.env[FRODO_CONFIG_PATH_KEY] || `${os.homedir()}/.frodo`;\n}\n\nfunction getCustomNoiseFilters(): Array<string> {\n const filename = `${getConfigPath()}/${FRODO_LOG_NOISEFILTER_FILENAME}`;\n let noiseFilter = [];\n try {\n const data = fs.readFileSync(filename, 'utf8');\n noiseFilter = JSON.parse(data);\n } catch (e) {\n printMessage(`Error reading ${filename} (${e.message})`, 'error');\n }\n return noiseFilter;\n}\n\nexport function getNoiseFilters(defaults: boolean): Array<string> {\n const filename = `${getConfigPath()}/${FRODO_LOG_NOISEFILTER_FILENAME}`;\n if (defaults) {\n printMessage(`Using default logging noise filters.`, 'info');\n return getDefaultNoiseFilter();\n }\n let noiseFilter = getCustomNoiseFilters();\n if (noiseFilter.length == 0) {\n printMessage(`No custom noise filters defined. Using defaults.`, 'info');\n noiseFilter = getDefaultNoiseFilter();\n try {\n fs.writeFileSync(filename, JSON.stringify(noiseFilter, null, 2));\n printMessage(\n `The default filters were saved in ${filename}. You can change the filters as needed.`,\n 'info'\n );\n } catch (e) {\n printMessage(\n `Error creating noise filter configuration with default values.`,\n 'error'\n );\n }\n }\n return noiseFilter;\n}\n\n/**\n * Gets the full export config from one of three locations:\n * 1. The file passed into the function if one is provided.\n * 2. The working directory if it exists (provided by the user)\n * 3. The cloud tenant if the exports are not locally provided\n * @param file The optional file path\n * @returns The full export config\n */\nexport async function getFullExportConfig(\n file: string | null = null\n): Promise<FullExportInterface> {\n // Get export from file if it exists\n if (file) {\n return JSON.parse(fs.readFileSync(getFilePath(file), 'utf8'));\n }\n // If working directory doesn't exist, export from the cloud\n const workingDirectory = state.getDirectory();\n if (!workingDirectory) {\n return await exportFullConfiguration({\n useStringArrays: true,\n noDecode: false,\n });\n }\n // Go through files in the working directory and reconstruct the full export\n return getFullExportConfigFromDirectory(workingDirectory);\n}\n\n/**\n * Reconstructs the full export config from files in the given directory\n * @param directory The directory\n * @return The full export config\n */\nexport async function getFullExportConfigFromDirectory(\n directory: string\n): Promise<FullExportInterface> {\n const fullExportConfig = {\n meta: {},\n agents: {},\n application: {},\n authentication: {},\n config: {},\n emailTemplate: {},\n idp: {},\n managedApplication: {},\n policy: {},\n policyset: {},\n resourcetype: {},\n saml: {\n hosted: {},\n remote: {},\n metadata: {},\n cot: {},\n },\n script: {},\n secrets: {},\n service: {},\n theme: {},\n trees: {},\n variables: {},\n } as FullExportInterface;\n const files = await readFiles(directory);\n const jsonFiles = files.filter((f) => f.path.endsWith('.json'));\n const idmConfigFiles = jsonFiles.filter((f) => f.path.startsWith('config/'));\n const samlFiles = jsonFiles.filter(\n (f) => f.path.startsWith('saml/') || f.path.startsWith('cot/')\n );\n const otherFiles = jsonFiles.filter(\n (f) =>\n !f.path.startsWith('config/') &&\n !f.path.startsWith('saml/') &&\n !f.path.startsWith('cot/')\n );\n const scriptFiles = files.filter(\n (f) => f.path.endsWith('.js') || f.path.endsWith('.groovy')\n );\n // Handle json files\n for (const f of otherFiles) {\n for (const [id, value] of Object.entries(JSON.parse(f.content))) {\n if (value == null || fullExportConfig[id] == null) {\n continue;\n }\n Object.assign(fullExportConfig[id], value);\n }\n }\n // Handle saml files\n for (const f of samlFiles) {\n let content = JSON.parse(f.content);\n content = content.saml;\n for (const [id, value] of Object.entries(content)) {\n Object.assign(fullExportConfig.saml[id], value);\n }\n }\n // Handle idm config files\n for (const f of idmConfigFiles) {\n const content = JSON.parse(f.content);\n fullExportConfig.config[content._id] = content;\n }\n // Handle extracted scripts, adding them to their corresponding script objects in the export\n if (scriptFiles.length > 0 && fullExportConfig.script != null) {\n const scriptExports = Object.values(fullExportConfig.script);\n for (const f of scriptFiles) {\n const name = f.path.substring(\n f.path.lastIndexOf('/') + 1,\n f.path.indexOf('.', f.path.lastIndexOf('/'))\n );\n const scriptLines = f.content.split('\\n');\n const script = scriptExports.find(\n (s) =>\n slugify(s.name.replace(/^http(s?):\\/\\//, ''), {\n remove: /[^\\w\\s$*_+~.()'\"!\\-@]+/g,\n }) === name\n );\n if (!script) {\n throw Error(\n `Can't find the script corresponding to the file '${f.path}' in the export files`\n );\n }\n script.script = scriptLines;\n }\n }\n return fullExportConfig;\n}\n\n/**\n * Determines if a string id is being used anywhere within the given configuration object\n * @param configuration The configuration object\n * @param id The id being search for\n * @param isEsv Whether the id corresponds to an ESV or not\n */\nexport function isIdUsed(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configuration: any,\n id: string,\n isEsv: boolean\n): {\n used: boolean;\n location: string;\n} {\n return isIdUsedRecurse(\n configuration,\n isEsv\n ? // For ESV ids, they contain either letters, numbers, dashes, or underscores. The dashes get replaced with periods (escaped with a \\ for the regex)\n // since anywhere they are being used they will be used with periods, not dashes. Note that the (?:[^a-z0-9._]|$) expressions at the beginning and\n // end are meant to ensure that the id found is not a substring of some other id (i.e. the id found must either be at the beginning or end of the\n // string, or if in the middle of a string, is not preceded or followed by a character that would be part of another id).\n new RegExp(\n `(?:[^a-z0-9._]|^)${id.replaceAll('-', '\\\\.')}(?:[^a-z0-9._]|$)`\n )\n : // For normal ids, they contain only letters, numbers, or dashes.\n new RegExp(`(?:[^a-z0-9-]|^)${id}(?:[^a-z0-9-]|$)`)\n );\n}\n\n/**\n * Recursive helper for isIdUsed that finds any strings contained in the configuration that pass the regex\n * @param configuration The configuration (could be anything)\n * @param regex The regex test\n */\nfunction isIdUsedRecurse(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configuration: any,\n regex: RegExp\n): {\n used: boolean;\n location: string;\n} {\n const type = typeof configuration;\n if (type === 'object' && configuration !== null) {\n for (const [id, value] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configuration as Record<string, any>\n )) {\n const isIdUsed = isIdUsedRecurse(value, regex);\n if (isIdUsed.used) {\n isIdUsed.location =\n id +\n (value.name ? `(name: '${value.name}')` : '') +\n (isIdUsed.location === '' ? '' : '.') +\n isIdUsed.location;\n return isIdUsed;\n }\n }\n }\n return {\n used: type === 'string' && regex.test(configuration),\n location: '',\n };\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,OAAO,MAAM,SAAS;AAE7B,SAASC,YAAY,QAAQ,WAAW;AAExC,MAAM;EAAEC,WAAW;EAAEC;AAAU,CAAC,GAAGP,KAAK,CAACQ,KAAK;AAE9C,MAAM;EAAEC;AAAwB,CAAC,GAAGT,KAAK,CAACU,MAAM;AAEhD,MAAM;EAAEC;AAAsB,CAAC,GAAGX,KAAK,CAACY,KAAK,CAACC,GAAG;AAEjD,OAAO,MAAM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AC9C,IAAIN,QAAQ,CAACQ,IAAI,EAAE;QACjBR,QAAQ,CAACS,QAAQ,GACf7B,EAAE,IACDC,KAAK,CAACQ,IAAI,GAAI,WAAUR,KAAK,CAACQ,IAAK,IAAG,GAAG,EAAE,CAAC,IAC5CW,QAAQ,CAACS,QAAQ,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,GACrCT,QAAQ,CAACS,QAAQ;QACnB,OAAOT,QAAQ;MACjB;IACF;EACF;EACA,OAAO;IACLQ,IAAI,EAAED,IAAI,KAAK,QAAQ,IAAID,KAAK,CAACI,IAAI,CAACT,aAAa,CAAC;IACpDQ,QAAQ,EAAE;EACZ,CAAC;AACH"}
1
+ {"version":3,"file":"Config.js","names":["frodo","state","fs","os","slugify","printMessage","getFilePath","readFiles","utils","exportFullConfiguration","config","getDefaultNoiseFilter","cloud","log","FRODO_CONFIG_PATH_KEY","FRODO_LOG_NOISEFILTER_FILENAME","getConfigPath","process","env","homedir","getCustomNoiseFilters","filename","noiseFilter","data","readFileSync","JSON","parse","e","message","getNoiseFilters","defaults","length","writeFileSync","stringify","getFullExportConfig","file","workingDirectory","getDirectory","useStringArrays","noDecode","coords","getFullExportConfigFromDirectory","directory","fullExportConfig","meta","agents","application","authentication","emailTemplate","idp","managedApplication","policy","policyset","resourcetype","saml","hosted","remote","metadata","cot","script","secrets","service","theme","trees","variables","files","jsonFiles","filter","f","path","endsWith","idmConfigFiles","startsWith","samlFiles","otherFiles","scriptFiles","id","value","Object","entries","content","assign","_id","scriptExports","values","name","substring","lastIndexOf","indexOf","scriptLines","split","find","s","replace","remove","Error","isIdUsed","configuration","isEsv","isIdUsedRecurse","RegExp","replaceAll","regex","type","used","location","test"],"sources":["../../src/utils/Config.ts"],"sourcesContent":["import { frodo, state } from '@rockcarver/frodo-lib';\nimport { FullExportInterface } from '@rockcarver/frodo-lib/types/ops/ConfigOps';\nimport fs from 'fs';\nimport os from 'os';\nimport slugify from 'slugify';\n\nimport { printMessage } from './Console';\n\nconst { getFilePath, readFiles } = frodo.utils;\n\nconst { exportFullConfiguration } = frodo.config;\n\nconst { getDefaultNoiseFilter } = frodo.cloud.log;\n\nexport const FRODO_CONFIG_PATH_KEY = 'FRODO_CONFIG_PATH';\nexport const FRODO_LOG_NOISEFILTER_FILENAME = 'LoggingNoiseFilter.json';\n\nexport function getConfigPath(): string {\n return process.env[FRODO_CONFIG_PATH_KEY] || `${os.homedir()}/.frodo`;\n}\n\nfunction getCustomNoiseFilters(): Array<string> {\n const filename = `${getConfigPath()}/${FRODO_LOG_NOISEFILTER_FILENAME}`;\n let noiseFilter = [];\n try {\n const data = fs.readFileSync(filename, 'utf8');\n noiseFilter = JSON.parse(data);\n } catch (e) {\n printMessage(`Error reading ${filename} (${e.message})`, 'error');\n }\n return noiseFilter;\n}\n\nexport function getNoiseFilters(defaults: boolean): Array<string> {\n const filename = `${getConfigPath()}/${FRODO_LOG_NOISEFILTER_FILENAME}`;\n if (defaults) {\n printMessage(`Using default logging noise filters.`, 'info');\n return getDefaultNoiseFilter();\n }\n let noiseFilter = getCustomNoiseFilters();\n if (noiseFilter.length == 0) {\n printMessage(`No custom noise filters defined. Using defaults.`, 'info');\n noiseFilter = getDefaultNoiseFilter();\n try {\n fs.writeFileSync(filename, JSON.stringify(noiseFilter, null, 2));\n printMessage(\n `The default filters were saved in ${filename}. You can change the filters as needed.`,\n 'info'\n );\n } catch (e) {\n printMessage(\n `Error creating noise filter configuration with default values.`,\n 'error'\n );\n }\n }\n return noiseFilter;\n}\n\n/**\n * Gets the full export config from one of three locations:\n * 1. The file passed into the function if one is provided.\n * 2. The working directory if it exists (provided by the user)\n * 3. The cloud tenant if the exports are not locally provided\n * @param file The optional file path\n * @returns The full export config\n */\nexport async function getFullExportConfig(\n file: string | null = null\n): Promise<FullExportInterface> {\n // Get export from file if it exists\n if (file) {\n return JSON.parse(fs.readFileSync(getFilePath(file), 'utf8'));\n }\n // If working directory doesn't exist, export from the cloud\n const workingDirectory = state.getDirectory();\n if (!workingDirectory) {\n return await exportFullConfiguration({\n useStringArrays: true,\n noDecode: false,\n coords: true,\n });\n }\n // Go through files in the working directory and reconstruct the full export\n return getFullExportConfigFromDirectory(workingDirectory);\n}\n\n/**\n * Reconstructs the full export config from files in the given directory\n * @param directory The directory\n * @return The full export config\n */\nexport async function getFullExportConfigFromDirectory(\n directory: string\n): Promise<FullExportInterface> {\n const fullExportConfig = {\n meta: {},\n agents: {},\n application: {},\n authentication: {},\n config: {},\n emailTemplate: {},\n idp: {},\n managedApplication: {},\n policy: {},\n policyset: {},\n resourcetype: {},\n saml: {\n hosted: {},\n remote: {},\n metadata: {},\n cot: {},\n },\n script: {},\n secrets: {},\n service: {},\n theme: {},\n trees: {},\n variables: {},\n } as FullExportInterface;\n const files = await readFiles(directory);\n const jsonFiles = files.filter((f) => f.path.endsWith('.json'));\n const idmConfigFiles = jsonFiles.filter((f) => f.path.startsWith('config/'));\n const samlFiles = jsonFiles.filter(\n (f) => f.path.startsWith('saml/') || f.path.startsWith('cot/')\n );\n const otherFiles = jsonFiles.filter(\n (f) =>\n !f.path.startsWith('config/') &&\n !f.path.startsWith('saml/') &&\n !f.path.startsWith('cot/')\n );\n const scriptFiles = files.filter(\n (f) => f.path.endsWith('.js') || f.path.endsWith('.groovy')\n );\n // Handle json files\n for (const f of otherFiles) {\n for (const [id, value] of Object.entries(JSON.parse(f.content))) {\n if (value == null || fullExportConfig[id] == null) {\n continue;\n }\n Object.assign(fullExportConfig[id], value);\n }\n }\n // Handle saml files\n for (const f of samlFiles) {\n let content = JSON.parse(f.content);\n content = content.saml;\n for (const [id, value] of Object.entries(content)) {\n Object.assign(fullExportConfig.saml[id], value);\n }\n }\n // Handle idm config files\n for (const f of idmConfigFiles) {\n const content = JSON.parse(f.content);\n fullExportConfig.config[content._id] = content;\n }\n // Handle extracted scripts, adding them to their corresponding script objects in the export\n if (scriptFiles.length > 0 && fullExportConfig.script != null) {\n const scriptExports = Object.values(fullExportConfig.script);\n for (const f of scriptFiles) {\n const name = f.path.substring(\n f.path.lastIndexOf('/') + 1,\n f.path.indexOf('.', f.path.lastIndexOf('/'))\n );\n const scriptLines = f.content.split('\\n');\n const script = scriptExports.find(\n (s) =>\n slugify(s.name.replace(/^http(s?):\\/\\//, ''), {\n remove: /[^\\w\\s$*_+~.()'\"!\\-@]+/g,\n }) === name\n );\n if (!script) {\n throw Error(\n `Can't find the script corresponding to the file '${f.path}' in the export files`\n );\n }\n script.script = scriptLines;\n }\n }\n return fullExportConfig;\n}\n\n/**\n * Determines if a string id is being used anywhere within the given configuration object\n * @param configuration The configuration object\n * @param id The id being search for\n * @param isEsv Whether the id corresponds to an ESV or not\n */\nexport function isIdUsed(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configuration: any,\n id: string,\n isEsv: boolean\n): {\n used: boolean;\n location: string;\n} {\n return isIdUsedRecurse(\n configuration,\n isEsv\n ? // For ESV ids, they contain either letters, numbers, dashes, or underscores. The dashes get replaced with periods (escaped with a \\ for the regex)\n // since anywhere they are being used they will be used with periods, not dashes. Note that the (?:[^a-z0-9._]|$) expressions at the beginning and\n // end are meant to ensure that the id found is not a substring of some other id (i.e. the id found must either be at the beginning or end of the\n // string, or if in the middle of a string, is not preceded or followed by a character that would be part of another id).\n new RegExp(\n `(?:[^a-z0-9._]|^)${id.replaceAll('-', '\\\\.')}(?:[^a-z0-9._]|$)`\n )\n : // For normal ids, they contain only letters, numbers, or dashes.\n new RegExp(`(?:[^a-z0-9-]|^)${id}(?:[^a-z0-9-]|$)`)\n );\n}\n\n/**\n * Recursive helper for isIdUsed that finds any strings contained in the configuration that pass the regex\n * @param configuration The configuration (could be anything)\n * @param regex The regex test\n */\nfunction isIdUsedRecurse(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configuration: any,\n regex: RegExp\n): {\n used: boolean;\n location: string;\n} {\n const type = typeof configuration;\n if (type === 'object' && configuration !== null) {\n for (const [id, value] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n configuration as Record<string, any>\n )) {\n const isIdUsed = isIdUsedRecurse(value, regex);\n if (isIdUsed.used) {\n isIdUsed.location =\n id +\n (value.name ? `(name: '${value.name}')` : '') +\n (isIdUsed.location === '' ? '' : '.') +\n isIdUsed.location;\n return isIdUsed;\n }\n }\n }\n return {\n used: type === 'string' && regex.test(configuration),\n location: '',\n };\n}\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAEpD,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,EAAE,MAAM,IAAI;AACnB,OAAOC,OAAO,MAAM,SAAS;AAE7B,SAASC,YAAY,QAAQ,WAAW;AAExC,MAAM;EAAEC,WAAW;EAAEC;AAAU,CAAC,GAAGP,KAAK,CAACQ,KAAK;AAE9C,MAAM;EAAEC;AAAwB,CAAC,GAAGT,KAAK,CAACU,MAAM;AAEhD,MAAM;EAAEC;AAAsB,CAAC,GAAGX,KAAK,CAACY,KAAK,CAACC,GAAG;AAEjD,OAAO,MAAMC,qBAAqB,GAAG,mBAAmB;AACxD,OAAO,MAAMC,8BAA8B,GAAG,yBAAyB;AAEvE,OAAO,SAASC,aAAaA,CAAA,EAAW;EACtC,OAAOC,OAAO,CAACC,GAAG,CAACJ,qBAAqB,CAAC,IAAK,GAAEX,EAAE,CAACgB,OAAO,CAAC,CAAE,SAAQ;AACvE;AAEA,SAASC,qBAAqBA,CAAA,EAAkB;EAC9C,MAAMC,QAAQ,GAAI,GAAEL,aAAa,CAAC,CAAE,IAAGD,8BAA+B,EAAC;EACvE,IAAIO,WAAW,GAAG,EAAE;EACpB,IAAI;IACF,MAAMC,IAAI,GAAGrB,EAAE,CAACsB,YAAY,CAACH,QAAQ,EAAE,MAAM,CAAC;IAC9CC,WAAW,GAAGG,IAAI,CAACC,KAAK,CAACH,IAAI,CAAC;EAChC,CAAC,CAAC,OAAOI,CAAC,EAAE;IACVtB,YAAY,CAAE,iBAAgBgB,QAAS,KAAIM,CAAC,CAACC,OAAQ,GA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ASqD,QAAQA;AACtB;AACAC,aAAkB,EAClBrB,EAAU,EACVsB,KAAc,EAId;EACA,OAAOC,eAAe,CACpBF,aAAa,EACbC,KAAK;EACD;EACA;EACA;EACA;EACA,IAAIE,MAAM,CACP,oBAAmBxB,EAAE,CAACyB,UAAU,CAAC,GAAG,EAAE,KAAK,CAAE,mBAChD,CAAC;EACD;EACA,IAAID,MAAM,CAAE,mBAAkBxB,EAAG,kBAAiB,CACxD,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASuB,eAAeA;AACtB;AACAF,aAAkB,EAClBK,KAAa,EAIb;EACA,MAAMC,IAAI,GAAG,OAAON,aAAa;EACjC,IAAIM,IAAI,KAAK,QAAQ,IAAIN,aAAa,KAAK,IAAI,EAAE;IAC/C,KAAK,MAAM,CAACrB,EAAE,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO;IACtC;IACAkB,aACF,CAAC,EAAE;MACD,MAAMD,QAAQ,GAAGG,eAAe,CAACtB,KAAK,EAAEyB,KAAK,CAAC;MAC9C,IAAIN,QAAQ,CAACQ,IAAI,EAAE;QACjBR,QAAQ,CAACS,QAAQ,GACf7B,EAAE,IACDC,KAAK,CAACQ,IAAI,GAAI,WAAUR,KAAK,CAACQ,IAAK,IAAG,GAAG,EAAE,CAAC,IAC5CW,QAAQ,CAACS,QAAQ,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,GACrCT,QAAQ,CAACS,QAAQ;QACnB,OAAOT,QAAQ;MACjB;IACF;EACF;EACA,OAAO;IACLQ,IAAI,EAAED,IAAI,KAAK,QAAQ,IAAID,KAAK,CAACI,IAAI,CAACT,aAAa,CAAC;IACpDQ,QAAQ,EAAE;EACZ,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-cli",
3
- "version": "2.0.0-41",
3
+ "version": "2.0.0-42",
4
4
  "type": "module",
5
5
  "description": "A command line interface to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.",
6
6
  "keywords": [
@@ -116,7 +116,7 @@
116
116
  ]
117
117
  },
118
118
  "dependencies": {
119
- "@rockcarver/frodo-lib": "2.0.0-57",
119
+ "@rockcarver/frodo-lib": "2.0.0-58",
120
120
  "chokidar": "^3.5.3",
121
121
  "cli-progress": "^3.11.2",
122
122
  "cli-table3": "^0.6.3",