@rockcarver/frodo-cli 5.0.0-26 → 5.0.0-27

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/dist/app.cjs CHANGED
@@ -8682,6 +8682,535 @@ function enableTemplateCatalogCache() {
8682
8682
  const configPath = process.env["FRODO_CONFIG_PATH"];
8683
8683
  if (configPath) require_dist$2.state.setTemplateCatalogCachePath(path.default.join(configPath, "AppTemplates"));
8684
8684
  }
8685
+ // src/utils/ApplicationTemplateView.ts
8686
+ /**
8687
+ * The object if the value is one (not null, not an array).
8688
+ * @param {unknown} value any value
8689
+ * @returns {Json | undefined} the object, if the value is one
8690
+ */
8691
+ function recordOf(value) {
8692
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
8693
+ }
8694
+ /**
8695
+ * The characters that are never printed: the C0 and C1 control characters (the
8696
+ * escape that starts a color or a cursor move, U+009B that starts the same in
8697
+ * 8 bits), the line and paragraph separators, the marks and the embeddings,
8698
+ * overrides and isolates that change the direction of the text (U+202E), the
8699
+ * zero-width characters and the byte order mark.
8700
+ */
8701
+ const UNSAFE_CHARACTERS = /[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028-\u202e\u2060-\u2069\ufeff]+/g;
8702
+ /**
8703
+ * The text of a value that is printed on one line: a string (the characters
8704
+ * that are not safe to print, line breaks included, become a space) or a finite
8705
+ * number.
8706
+ * @param {unknown} value any value
8707
+ * @returns {string | undefined} the text, if there is any
8708
+ */
8709
+ function textOf$1(value) {
8710
+ let text;
8711
+ if (typeof value === "string") text = value;
8712
+ else if (typeof value === "number" && Number.isFinite(value)) text = String(value);
8713
+ if (text === void 0) return void 0;
8714
+ return text.replace(UNSAFE_CHARACTERS, " ").trim() || void 0;
8715
+ }
8716
+ /**
8717
+ * The comparison key of a template id: the library's own key (dots and hyphens
8718
+ * are one) in lower case.
8719
+ * @param {string} name the id a user typed or a catalog lists
8720
+ * @returns {string} the key
8721
+ */
8722
+ function nameKey(name) {
8723
+ return String(name).trim().replace(/\./g, "-").toLowerCase();
8724
+ }
8725
+ const pad2 = (n) => String(n).padStart(2, "0");
8726
+ /**
8727
+ * A catalog date as `YYYY-MM-DD`. The catalog writes `MM-DD-YYYY` and `M-D-YYYY`
8728
+ * (`08-19-2026`, `10-5-2023`); the month comes first. A text that is not such a
8729
+ * date is returned as it is. Dates only decorate a listing: they are never used
8730
+ * to order versions (they do not follow the version order).
8731
+ * @param {unknown} value the `dateUpdated` of an entry
8732
+ * @returns {string} the date, or '' if there is none
8733
+ */
8734
+ function isoDate(value) {
8735
+ const raw = textOf$1(value);
8736
+ if (!raw) return "";
8737
+ const match = /^(\d{1,2})-(\d{1,2})-(\d{4})$/.exec(raw);
8738
+ if (match) {
8739
+ const [month, day, year] = [
8740
+ Number(match[1]),
8741
+ Number(match[2]),
8742
+ match[3]
8743
+ ];
8744
+ const check = new Date(Date.UTC(Number(year), month - 1, day));
8745
+ if (check.getUTCFullYear() === Number(year) && check.getUTCMonth() === month - 1 && check.getUTCDate() === day) return `${year}-${pad2(month)}-${pad2(day)}`;
8746
+ }
8747
+ return raw;
8748
+ }
8749
+ /**
8750
+ * The name of a template as the commands show and accept it with `-n`: the
8751
+ * display name, or the id of a template that has none.
8752
+ * @param {TemplateRow} item a version of the template
8753
+ * @returns {string} the name
8754
+ */
8755
+ function displayNameOf(item) {
8756
+ return item.displayName || item.name;
8757
+ }
8758
+ /**
8759
+ * A row of the list with every text made safe to print, once, so that no
8760
+ * command prints an escape sequence that an entry carries in its id, display
8761
+ * name, version, group, type or date. The library keeps asking for the row as
8762
+ * it listed it (`source`).
8763
+ * @param {TemplateRow} item the row as the library lists it
8764
+ * @returns {TemplateVersion} the row for the commands
8765
+ */
8766
+ function safeRow(item) {
8767
+ return {
8768
+ ...item,
8769
+ name: textOf$1(item.name) ?? "",
8770
+ group: textOf$1(item.group),
8771
+ templateVersion: textOf$1(item.templateVersion) ?? "",
8772
+ displayName: textOf$1(item.displayName),
8773
+ templateType: textOf$1(item.templateType),
8774
+ dateUpdated: textOf$1(item.dateUpdated),
8775
+ source: item
8776
+ };
8777
+ }
8778
+ /**
8779
+ * Compare two template versions (`3.3`, `2.10`) number by number, so that
8780
+ * `2.10` is newer than `2.9`. This is the rule of the library; a date never
8781
+ * decides which version is newer.
8782
+ * @param {string} a a version
8783
+ * @param {string} b another version
8784
+ * @returns {number} less than 0 if a is older, more than 0 if a is newer, else 0
8785
+ */
8786
+ function compareVersions$1(a, b) {
8787
+ const left = String(a).split(".");
8788
+ const right = String(b).split(".");
8789
+ for (let i = 0; i < Math.max(left.length, right.length); i++) {
8790
+ const l = left[i] ?? "0";
8791
+ const r = right[i] ?? "0";
8792
+ const ln = Number(l);
8793
+ const rn = Number(r);
8794
+ if (Number.isFinite(ln) && Number.isFinite(rn)) {
8795
+ if (ln !== rn) return ln < rn ? -1 : 1;
8796
+ } else if (l !== r) return l < r ? -1 : 1;
8797
+ }
8798
+ return 0;
8799
+ }
8800
+ /**
8801
+ * Group the versions of a list by template, in the order of the list; the
8802
+ * versions of a template come newest first. The text
8803
+ * of the rows is made safe to print (see `safeRow`).
8804
+ * @param {TemplateRow[]} items the versions as the library lists them
8805
+ * @returns {TemplateGroup[]} one group per template, its versions newest first
8806
+ */
8807
+ function groupTemplates(items) {
8808
+ const groups = /* @__PURE__ */ new Map();
8809
+ for (const original of items) {
8810
+ const item = safeRow(original);
8811
+ const key = nameKey(item.name);
8812
+ let group = groups.get(key);
8813
+ if (!group) {
8814
+ group = {
8815
+ key,
8816
+ name: item.name,
8817
+ versions: [],
8818
+ newest: item
8819
+ };
8820
+ groups.set(key, group);
8821
+ }
8822
+ group.versions.push(item);
8823
+ }
8824
+ for (const group of groups.values()) {
8825
+ group.versions.sort((a, b) => compareVersions$1(b.templateVersion, a.templateVersion));
8826
+ group.newest = group.versions.find((item) => item.newestInGroup) ?? group.versions[0];
8827
+ }
8828
+ return [...groups.values()];
8829
+ }
8830
+ /**
8831
+ * The marks that `list` and `describe` print directly behind a version, without
8832
+ * a space: `*` for the newest version of a template that has older versions
8833
+ * (the versions the merged list holds), `+` for a custom version, that is, one
8834
+ * that the tenant defines itself (a template of its own or a replacement of a
8835
+ * version of the catalog); both read `*+`.
8836
+ * @param {TemplateGroup} group the template
8837
+ * @param {TemplateVersion} item one of its versions
8838
+ * @returns {string} the marks, or '' for neither
8839
+ */
8840
+ function marksOf(group, item) {
8841
+ return `${item === group.newest && group.versions.length > 1 ? "*" : ""}${item.isOverride ? "+" : ""}`;
8842
+ }
8843
+ /**
8844
+ * What to say when an id that was not found looks like the id of a version (the
8845
+ * key the catalog keeps a version under, `3_4-azure-ad`): the id of a template
8846
+ * carries no version, `-v` names it. The key is not an id and is not accepted;
8847
+ * only this hint reads it.
8848
+ * @param {TemplateGroup[]} groups the templates of the list
8849
+ * @param {string} id what the user gave as `-i`
8850
+ * @returns {string} the sentence to add to the error, or '' if the id does not look like that
8851
+ */
8852
+ function versionIdHint(groups, id) {
8853
+ const match = /^(\d+)_(\d+)-(.+)$/.exec(id);
8854
+ if (!match) return "";
8855
+ const rest = match[3];
8856
+ return ` "${id}" looks like the id of a version, which is not an id: -i names the template and -v the version (for example -i ${groups.find((group) => group.key === nameKey(rest))?.name ?? rest} -v ${match[1]}.${match[2]}).`;
8857
+ }
8858
+ /**
8859
+ * Find the template and the version a user named.
8860
+ * @param {TemplateGroup[]} groups the templates of the list
8861
+ * @param {TemplateSelector} selector the id (`-i`) or display name (`-n`), and the version (`-v`)
8862
+ * @returns {TemplateSelection} the version, or an error to print
8863
+ */
8864
+ function selectTemplate(groups, selector) {
8865
+ const id = textOf$1(selector.id);
8866
+ const name = textOf$1(selector.name);
8867
+ const versionGiven = selector.version !== void 0 && selector.version !== null;
8868
+ const version = textOf$1(selector.version) ?? "";
8869
+ let byId;
8870
+ let byName;
8871
+ if (id) {
8872
+ byId = groups.find((group) => group.key === nameKey(id));
8873
+ if (!byId) return { error: `Application template "${id}" not found. "frodo app template list" prints the ids.${versionIdHint(groups, id)}` };
8874
+ }
8875
+ if (name) {
8876
+ const wanted = name.toLowerCase();
8877
+ const named = groups.filter((group) => displayNameOf(group.newest).toLowerCase() === wanted);
8878
+ if (named.length > 1) return { error: `More than one application template has the display name "${name}": ${named.map((group) => group.name).join(", ")}. Name one with -i.` };
8879
+ byName = named[0];
8880
+ if (!byName) return { error: `No application template has the display name "${name}". "frodo app template list --long" prints the display names.` };
8881
+ }
8882
+ if (byId && byName && byId !== byName) return { error: `-i "${id}" and -n "${name}" name different application templates (${byId.name} and ${byName.name}). Give only one.` };
8883
+ const group = byId ?? byName;
8884
+ if (!group) return { error: "Name the template with -i (id) or -n (display name)." };
8885
+ if (!versionGiven) return {
8886
+ group,
8887
+ item: group.newest
8888
+ };
8889
+ const wanted = version.toLowerCase();
8890
+ const item = group.versions.find((candidate) => candidate.templateVersion.toLowerCase() === wanted);
8891
+ if (!item) return { error: `Application template ${group.name} has no version ${version || "\"\""}. Versions: ${group.versions.map((candidate) => candidate.templateVersion).join(", ")}.` };
8892
+ return {
8893
+ group,
8894
+ item
8895
+ };
8896
+ }
8897
+ /**
8898
+ * The category the catalog gives the template (the first of `categories`).
8899
+ * @param {Json} template the entry
8900
+ * @returns {string} the category, or '' if there is none
8901
+ */
8902
+ function categoryOf(template) {
8903
+ const categories = template["categories"];
8904
+ if (Array.isArray(categories)) {
8905
+ for (const category of categories) {
8906
+ const text = textOf$1(category);
8907
+ if (text) return text;
8908
+ }
8909
+ return "";
8910
+ }
8911
+ return textOf$1(categories) ?? "";
8912
+ }
8913
+ /**
8914
+ * Whether the entry has a connector: a provisioning template.
8915
+ * @param {Json} template the entry
8916
+ * @returns {boolean} true if it has one
8917
+ */
8918
+ function hasConnector(template) {
8919
+ return recordOf(template["connectorTemplate"]) !== void 0 || textOf$1(template["connectorName"]) !== void 0;
8920
+ }
8921
+ /** A text that is a dotted class name (`org.forgerock.openicf.connectors.epic.ser.SerConnector`). */
8922
+ const CLASS_NAME = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)+$/;
8923
+ /**
8924
+ * The name of the connector for a list: its display name without the word
8925
+ * "Connector" (`MSGraphAPI Connector` is `MSGraphAPI`), else the class name
8926
+ * of the connector without its package and without the word "Connector"
8927
+ * (`org.example.epic.SerConnector` is `Ser`). A display name that is itself a
8928
+ * class name (one entry of the catalog has such a name) is shortened the same
8929
+ * way.
8930
+ * @param {Json} template the entry
8931
+ * @returns {string} the name, or '' if the entry has no connector
8932
+ */
8933
+ function connectorOf(template) {
8934
+ const display = textOf$1(template["connectorDisplayName"]);
8935
+ if (display && !CLASS_NAME.test(display)) return display.replace(/\s+connector$/i, "") || display;
8936
+ const className = display ?? textOf$1(template["connectorName"]);
8937
+ const last = className ? className.split(".").pop() ?? className : "";
8938
+ return last.replace(/(?<=.)Connector$/, "") || last;
8939
+ }
8940
+ /**
8941
+ * The SSO protocols the entry says it supports (`capabilities.sso`, the ones
8942
+ * that are true).
8943
+ * @param {Json} template the entry
8944
+ * @returns {string[]} the protocols, for example `SAML`, `OIDC`
8945
+ */
8946
+ function ssoProtocolsOf(template) {
8947
+ const sso = recordOf(recordOf(template["capabilities"])?.["sso"]);
8948
+ return sso ? Object.entries(sso).filter(([, supported]) => supported === true).map(([protocol]) => textOf$1(protocol) ?? "").filter(Boolean) : [];
8949
+ }
8950
+ /**
8951
+ * What the template provides, in a few words: `target+provisioning` (an AI
8952
+ * target with a connector), `provisioning` (a connector), `SSO: SAML/OIDC` (the
8953
+ * protocols of `capabilities.sso`), both of the last two joined by a comma, or
8954
+ * else the `templateType` (`Bookmark`).
8955
+ * @param {Json} template the entry
8956
+ * @returns {string} the words, or '' if the entry says nothing
8957
+ */
8958
+ function providesOf(template) {
8959
+ const parts = [];
8960
+ const target = template["target"] === true;
8961
+ if (hasConnector(template)) parts.push(target ? "target+provisioning" : "provisioning");
8962
+ else if (target) parts.push("target");
8963
+ const sso = ssoProtocolsOf(template);
8964
+ if (sso.length > 0) parts.push(`SSO: ${sso.join("/")}`);
8965
+ return parts.length > 0 ? parts.join(", ") : textOf$1(template["templateType"]) ?? "";
8966
+ }
8967
+ /** The letters of the `Prov` column of `list --long`, in the order they are printed. */
8968
+ const PROV_ORDER = "APSOFTB";
8969
+ /** The letter of each SSO protocol the entry can name (the protocols of `capabilities.sso`, in lower case). */
8970
+ const SSO_LETTERS = {
8971
+ saml: "S",
8972
+ oidc: "O",
8973
+ "ws-fed": "F",
8974
+ "ws-trust": "T"
8975
+ };
8976
+ /**
8977
+ * The `Prov` cell of `list --long`: one letter for each thing the template
8978
+ * provides, in the order A P S O F T B. `P` provisioning (a connector and the
8979
+ * provisioning capability), `A` an AI target (`target`), `S` SAML, `O` OIDC,
8980
+ * `F` WS-Fed and `T` WS-Trust (the protocols of `capabilities.sso`), `B` the
8981
+ * bookmark template. An entry that matches none of them gets `?`, never an
8982
+ * empty cell.
8983
+ * @param {Json} template the entry
8984
+ * @param {string} [templateType] the `templateType` of the list row, for an entry that does not say it
8985
+ * @returns {string} the letters, or `?`
8986
+ */
8987
+ function provOf(template, templateType) {
8988
+ const letters = /* @__PURE__ */ new Set();
8989
+ if (template["target"] === true) letters.add("A");
8990
+ const provisioning = recordOf(recordOf(template["capabilities"])?.["provisioning"]);
8991
+ if (hasConnector(template) && provisioning) letters.add("P");
8992
+ for (const protocol of ssoProtocolsOf(template)) {
8993
+ const letter = SSO_LETTERS[protocol.toLowerCase()];
8994
+ if (letter) letters.add(letter);
8995
+ }
8996
+ if ((textOf$1(template["templateType"]) ?? textOf$1(templateType) ?? "").toLowerCase() === "bookmark") letters.add("B");
8997
+ return [...PROV_ORDER].filter((letter) => letters.has(letter)).join("") || "?";
8998
+ }
8999
+ /** What the letters of the `Prov` column and the star mean, as `list` prints it below its table. */
9000
+ const PROV_KEY = "P provisioning A AI target S SAML O OIDC F WS-Fed T WS-Trust B bookmark * newest version, older ones exist";
9001
+ /** What `+` means, as `list` and `describe` print it below a table that has it. */
9002
+ const CUSTOM_KEY = "+ custom: defined in the tenant";
9003
+ /** What `?` means, as `list` prints it below a table that has it. */
9004
+ const UNKNOWN_KEY = "? not known";
9005
+ /**
9006
+ * The line below the table of `list`: what the abbreviations of the table
9007
+ * mean. The letters and the star are always explained; `+` only if a row has
9008
+ * it, and `?` only if a cell has it.
9009
+ * @param {{ custom: boolean; unknown: boolean }} printed what the table has
9010
+ * @param {boolean} printed.custom a version carries `+`
9011
+ * @param {boolean} printed.unknown a `Prov` cell says `?`
9012
+ * @returns {string} the line
9013
+ */
9014
+ function listKeyOf(printed) {
9015
+ return [
9016
+ PROV_KEY,
9017
+ ...printed.custom ? [CUSTOM_KEY] : [],
9018
+ ...printed.unknown ? [UNKNOWN_KEY] : []
9019
+ ].join(" ");
9020
+ }
9021
+ /**
9022
+ * The line below the table of the versions in `describe`: what the marks that
9023
+ * the table has mean (the star and the plus, as in `list`).
9024
+ * @param {{ newest: boolean; custom: boolean }} printed what the table has
9025
+ * @param {boolean} printed.newest a version carries `*`
9026
+ * @param {boolean} printed.custom a version carries `+`
9027
+ * @returns {string} the line, or '' if the table has no mark
9028
+ */
9029
+ function versionsKeyOf(printed) {
9030
+ return [...printed.newest ? ["* newest version, older ones exist"] : [], ...printed.custom ? [CUSTOM_KEY] : []].join(" ");
9031
+ }
9032
+ const OPERATIONS = [
9033
+ "create",
9034
+ "read",
9035
+ "update",
9036
+ "delete"
9037
+ ];
9038
+ /**
9039
+ * The operations of provisioning the entry allows (`capabilities.provisioning`,
9040
+ * the ones that are true), create, read, update, delete first.
9041
+ * @param {Json} template the entry
9042
+ * @returns {string[] | undefined} the operations; undefined if the entry says nothing about provisioning
9043
+ */
9044
+ function provisioningOperationsOf(template) {
9045
+ const provisioning = recordOf(recordOf(template["capabilities"])?.["provisioning"]);
9046
+ if (!provisioning) return void 0;
9047
+ const allowed = Object.entries(provisioning).filter(([, supported]) => supported === true).map(([operation]) => (textOf$1(operation) ?? "").toLowerCase()).filter(Boolean);
9048
+ return [...OPERATIONS.filter((operation) => allowed.includes(operation)), ...allowed.filter((operation) => !OPERATIONS.includes(operation))];
9049
+ }
9050
+ /**
9051
+ * The fields in a value that holds them as a list of lists (the way the Admin
9052
+ * UI lays out a form), as rows.
9053
+ * @param {unknown} value the list
9054
+ * @param {number} depth how deep the list is nested (guards a cycle of lists)
9055
+ * @returns {FieldRow[]} the fields
9056
+ */
9057
+ function fieldsIn(value, depth = 0) {
9058
+ if (Array.isArray(value)) return depth > 4 ? [] : value.flatMap((entry) => fieldsIn(entry, depth + 1));
9059
+ const field = recordOf(value);
9060
+ if (!field) return [];
9061
+ const property = textOf$1(field["model"]) ?? "";
9062
+ const label = textOf$1(field["label"]) ?? (property || (textOf$1(field["name"]) ?? ""));
9063
+ if (!label) return [];
9064
+ return [{
9065
+ label,
9066
+ property,
9067
+ type: textOf$1(field["type"]) ?? "",
9068
+ required: recordOf(field["validation"])?.["required"] === true
9069
+ }];
9070
+ }
9071
+ /**
9072
+ * The connector of the entry.
9073
+ * @param {Json} template the entry
9074
+ * @returns {ConnectorSummary | undefined} the connector; undefined if the entry has none
9075
+ */
9076
+ function connectorSummaryOf(template) {
9077
+ if (!hasConnector(template)) return void 0;
9078
+ const connector = recordOf(template["connectorTemplate"]) ?? {};
9079
+ return {
9080
+ name: textOf$1(template["connectorDisplayName"]) ?? connectorOf(template),
9081
+ className: textOf$1(template["connectorName"]) ?? "",
9082
+ bundleName: textOf$1(template["bundleName"]) ?? "",
9083
+ bundleRange: textOf$1(template["bundleVersion"]) ?? "",
9084
+ templateVersion: textOf$1(connector["version"]) ?? "",
9085
+ pagingType: textOf$1(connector["pagingType"]) ?? "",
9086
+ rcsOnly: connector["rcsOnly"] === true,
9087
+ connectorType: textOf$1(connector["connectorType"]) ?? "",
9088
+ basic: fieldsIn(connector["basic"]),
9089
+ advanced: fieldsIn(connector["advanced"]),
9090
+ prerequisites: textOf$1(connector["prerequisitesTitle"]) ?? ""
9091
+ };
9092
+ }
9093
+ const PROPERTY_FLAGS = [
9094
+ ["required", "required"],
9095
+ ["multiValued", "multi-valued"],
9096
+ ["notReadable", "not readable"],
9097
+ ["notCreatable", "not creatable"],
9098
+ ["notUpdateable", "not updateable"],
9099
+ ["notReturnedByDefault", "not returned by default"],
9100
+ ["isUsername", "username"],
9101
+ ["isDisplay", "display"],
9102
+ ["isMail", "mail"],
9103
+ ["nonAccountObject", "not an account"]
9104
+ ];
9105
+ /**
9106
+ * The words for what is special about a property. A property that can be
9107
+ * neither created nor updated is `read-only`.
9108
+ * @param {Json} property the property of an object type
9109
+ * @returns {string[]} the words
9110
+ */
9111
+ function flagsOf(property) {
9112
+ const flags = PROPERTY_FLAGS.filter(([key]) => property[key] === true).map(([, words]) => words);
9113
+ if (flags.includes("not creatable") && flags.includes("not updateable")) {
9114
+ const at = flags.indexOf("not creatable");
9115
+ return [
9116
+ ...flags.slice(0, at),
9117
+ "read-only",
9118
+ ...flags.slice(at + 1).filter((words) => words !== "not updateable")
9119
+ ];
9120
+ }
9121
+ return flags;
9122
+ }
9123
+ /**
9124
+ * The object types of the entry and their properties.
9125
+ * @param {Json} template the entry
9126
+ * @returns {ObjectTypeRow[]} the object types; none if the entry has none
9127
+ */
9128
+ function objectTypesOf(template) {
9129
+ const objectTypes = template["objectTypes"];
9130
+ if (!Array.isArray(objectTypes)) return [];
9131
+ const rows = [];
9132
+ for (const entry of objectTypes) {
9133
+ const objectType = recordOf(entry);
9134
+ if (!objectType) continue;
9135
+ const properties = [];
9136
+ const list = objectType["properties"];
9137
+ for (const item of Array.isArray(list) ? list : []) {
9138
+ const property = recordOf(item);
9139
+ if (!property) continue;
9140
+ const nativeName = textOf$1(property["nativeName"]) ?? "";
9141
+ properties.push({
9142
+ name: textOf$1(property["name"]) ?? nativeName,
9143
+ nativeName,
9144
+ type: textOf$1(property["type"]) ?? "",
9145
+ flags: flagsOf(property)
9146
+ });
9147
+ }
9148
+ rows.push({
9149
+ name: textOf$1(objectType["name"]) ?? textOf$1(objectType["id"]) ?? "",
9150
+ nativeType: textOf$1(objectType["nativeType"]) ?? "",
9151
+ managedResource: textOf$1(objectType["managedResource"]) ?? "",
9152
+ properties,
9153
+ required: properties.filter((property) => property.flags.includes("required")).length
9154
+ });
9155
+ }
9156
+ return rows;
9157
+ }
9158
+ /**
9159
+ * The sections of the application form (`schema`) of the entry.
9160
+ * @param {Json} template the entry
9161
+ * @returns {FormSection[]} the sections; none if the entry has none
9162
+ */
9163
+ function formSectionsOf(template) {
9164
+ const schema = recordOf(template["schema"]);
9165
+ if (!schema) return [];
9166
+ const sections = [];
9167
+ for (const [section, value] of Object.entries(schema)) {
9168
+ const name = textOf$1(section);
9169
+ if (!name) continue;
9170
+ const defaults = recordOf(recordOf(value)?.["defaultValues"]);
9171
+ const kind = defaults ? "defaults" : "fields";
9172
+ const names = defaults ? Object.keys(defaults).map((key) => textOf$1(key) ?? "").filter(Boolean) : fieldsIn(value).map((field) => field.label);
9173
+ if (names.length > 0) sections.push({
9174
+ section: name,
9175
+ kind,
9176
+ names
9177
+ });
9178
+ }
9179
+ return sections;
9180
+ }
9181
+ /**
9182
+ * The capabilities of the entry.
9183
+ * @param {Json} template the entry
9184
+ * @returns {CapabilitiesSummary} what the entry says
9185
+ */
9186
+ function capabilitiesOf(template) {
9187
+ const recon = recordOf(template["incrementalRecon"]);
9188
+ const reconProperty = textOf$1(recon?.["propertyName"]);
9189
+ const operator = textOf$1(recon?.["comparisonOperator"]);
9190
+ const clients = template["clients"];
9191
+ return {
9192
+ provisioning: provisioningOperationsOf(template),
9193
+ sso: ssoProtocolsOf(template),
9194
+ ssoSetup: Object.keys(recordOf(template["sso"]) ?? {}).map((key) => textOf$1(key) ?? "").filter(Boolean),
9195
+ incrementalRecon: reconProperty ? operator ? `${reconProperty} (${operator})` : reconProperty : "",
9196
+ target: template["target"] === true,
9197
+ requiresOauthFlow: template["requiresOauthFlow"] === true,
9198
+ clients: Array.isArray(clients) ? clients.map((client) => textOf$1(client) ?? "").filter(Boolean) : []
9199
+ };
9200
+ }
9201
+ /**
9202
+ * The numbers of object types and properties of an entry, for a table of the
9203
+ * versions.
9204
+ * @param {Json} template the entry
9205
+ * @returns {{ objectTypes: number; properties: number }} the counts
9206
+ */
9207
+ function countsOf(template) {
9208
+ const objectTypes = objectTypesOf(template);
9209
+ return {
9210
+ objectTypes: objectTypes.length,
9211
+ properties: objectTypes.reduce((total, objectType) => total + objectType.properties.length, 0)
9212
+ };
9213
+ }
8685
9214
  // src/utils/SavedProfiles.ts
8686
9215
  /**
8687
9216
  * The connection profiles saved on this machine (none when there is no file yet).
@@ -9218,23 +9747,35 @@ function registerEntityPickFamilies() {
9218
9747
  description: (application) => application.description
9219
9748
  })]
9220
9749
  });
9750
+ /** The newest version of every template of a list, in the order of the list. */
9751
+ const newestTemplates = (templates) => groupTemplates(templates).map((group) => group.newest);
9752
+ const templateDescription = (template) => [
9753
+ template.displayName,
9754
+ template.templateType,
9755
+ template.isOverride ? "defined by the tenant" : void 0
9756
+ ].filter(Boolean).join(" · ");
9757
+ const loadTemplates = async (command) => newestTemplates(await require_dist$2.frodo.app.template.listTemplates({
9758
+ ...command ? catalogOptionsOf(command.opts()) : {},
9759
+ includeOverrides: true
9760
+ }));
9221
9761
  registerEntityPickFamily({
9222
9762
  family: "app template",
9223
9763
  picks: [entityPick({
9224
9764
  name: "templateId",
9225
9765
  kind: "application template",
9226
- load: async () => require_dist$2.frodo.app.template.listTemplates({ includeOverrides: true }),
9227
- loadFor: async (command) => require_dist$2.frodo.app.template.listTemplates({
9228
- ...catalogOptionsOf(command.opts()),
9229
- includeOverrides: true
9230
- }),
9231
- label: (template) => template.templateId,
9232
- description: (template) => [
9233
- template.displayName,
9234
- template.templateType,
9235
- template.isOverride ? "defined by the tenant" : void 0
9236
- ].filter(Boolean).join(" · "),
9237
- search: (template, query) => `${template.templateId} ${template.displayName ?? ""} ${template.name}`.toLowerCase().includes(query.toLowerCase())
9766
+ load: async () => loadTemplates(),
9767
+ loadFor: async (command) => loadTemplates(command),
9768
+ label: (template) => template.name,
9769
+ description: templateDescription,
9770
+ search: (template, query) => `${template.name} ${template.displayName ?? ""}`.toLowerCase().includes(query.toLowerCase())
9771
+ }), entityPick({
9772
+ name: "templateName",
9773
+ kind: "application template",
9774
+ load: async () => loadTemplates(),
9775
+ loadFor: async (command) => loadTemplates(command),
9776
+ label: (template) => displayNameOf(template),
9777
+ description: (template) => template.name,
9778
+ search: (template, query) => `${template.name} ${template.displayName ?? ""}`.toLowerCase().includes(query.toLowerCase())
9238
9779
  })]
9239
9780
  });
9240
9781
  registerEntityPickFamily({
@@ -26682,13 +27223,13 @@ async function executeRfc7523AuthZGrantFlow(clientId, iss, jwk, sub, scope, json
26682
27223
  return true;
26683
27224
  }
26684
27225
  // src/cli/admin/admin-add-autoid-static-user-mapping.ts
26685
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$222 } = require_dist$2.frodo.utils.constants;
26686
- const deploymentTypes$224 = [CLOUD_DEPLOYMENT_TYPE_KEY$222];
26687
- function setup$483() {
26688
- const program = new FrodoCommand("frodo admin add-autoid-static-user-mapping", ["realm"], deploymentTypes$224);
27226
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$223 } = require_dist$2.frodo.utils.constants;
27227
+ const deploymentTypes$225 = [CLOUD_DEPLOYMENT_TYPE_KEY$223];
27228
+ function setup$484() {
27229
+ const program = new FrodoCommand("frodo admin add-autoid-static-user-mapping", ["realm"], deploymentTypes$225);
26689
27230
  program.description("Add AutoId static user mapping to enable dashboards and other AutoId-based functionality.").action(async (host, user, password, options, command) => {
26690
27231
  command.handleDefaultArgsAndOpts(host, user, password, options, command);
26691
- if (await getTokens(false, true, deploymentTypes$224)) {
27232
+ if (await getTokens(false, true, deploymentTypes$225)) {
26692
27233
  require_Console.printMessage(`Adding AutoId static user mapping...`);
26693
27234
  if (!await addAutoIdStaticUserMapping()) process.exitCode = 1;
26694
27235
  } else process.exitCode = 1;
@@ -26696,13 +27237,13 @@ function setup$483() {
26696
27237
  return program;
26697
27238
  }
26698
27239
  // src/cli/admin/admin-create-oauth2-client-with-admin-privileges.ts
26699
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$221, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$141 } = require_dist$2.frodo.utils.constants;
26700
- const deploymentTypes$223 = [CLOUD_DEPLOYMENT_TYPE_KEY$221, FORGEOPS_DEPLOYMENT_TYPE_KEY$141];
26701
- function setup$482() {
26702
- const program = new FrodoCommand("frodo admin create-oauth2-client-with-admin-privileges", [], deploymentTypes$223);
27240
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$222, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$141 } = require_dist$2.frodo.utils.constants;
27241
+ const deploymentTypes$224 = [CLOUD_DEPLOYMENT_TYPE_KEY$222, FORGEOPS_DEPLOYMENT_TYPE_KEY$141];
27242
+ function setup$483() {
27243
+ const program = new FrodoCommand("frodo admin create-oauth2-client-with-admin-privileges", [], deploymentTypes$224);
26703
27244
  program.description("Create an oauth2 client with admin privileges.").addOption(new Option("--client-id <id>", "Client id.")).addOption(new SecretOption("--client-secret [secret]", "Client secret.")).addOption(new Option("--llt", "Create a long-lived token and store it in a secret. The default secret name is esv-admin-token and the default token lifetime is 315,360,000 seconds (10 years). Both can be overwritten with the --llt-esv and --llt-ttl options.")).addOption(new Option("--llt-scope <scope>", "Request the following scope(s). This option only applies if used with the --llt option.").default("fr:idm:*", "fr:idm:*")).addOption(new Option("--llt-esv <esv>", "Name of the secret to store the token in. This option only applies if used with the --llt option.").default("esv-admin-token", "esv-admin-token")).addOption(new Option("--no-llt-esv", "Don't store the token in a secret and output to console instead. This option only applies if used with the --llt option.")).addOption(new Option("--llt-ttl <ttl>", "Token lifetime (seconds). This option only applies if used with the --llt option.").default(31536e4, "315,360,000 seconds (10 years)")).multiOp().action(async (host, realm, user, password, options, command) => {
26704
27245
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
26705
- if (await getTokens(false, true, deploymentTypes$223)) {
27246
+ if (await getTokens(false, true, deploymentTypes$224)) {
26706
27247
  require_Console.printMessage(`Creating oauth2 client with admin privileges in realm "${require_dist$2.state.getRealm()}"...`);
26707
27248
  let clientId = require_Console.v4();
26708
27249
  let clientSecret = require_Console.v4();
@@ -26773,10 +27314,11 @@ const aiAgentId = "oracle-assistant";
26773
27314
  const aiAgentFile = "oracle-assistant.ai.agent.json";
26774
27315
  const allAiAgentsFile = "allAlphaAIAgents.ai.agent.json";
26775
27316
  const logApiKeyId = "e4b1d9f2-6a3c-4d57-9b0e-2f8a6c1d7e35";
26776
- const appTemplateId = "1_2-saml";
27317
+ const appTemplateId = "azure.ad";
27318
+ const appTemplateName = "Microsoft Entra";
26777
27319
  const appTemplatesFile = "appTemplates.json";
26778
27320
  // src/cli/admin/admin-execute-rfc7523-authz-grant-flow.ts
26779
- function setup$481() {
27321
+ function setup$482() {
26780
27322
  const program = new FrodoCommand("frodo admin execute-rfc7523-authz-grant-flow");
26781
27323
  program.description("Execute RFC7523 authorization grant flow.").addOption(new Option("--client-id <id>", "Client id.").makeOptionMandatory()).addOption(new Option("--jwk-file <file>", "Path to JSON Web Key (JWK) file containing private key. Defaults to <client id>_private.jwk.json in the current directory, where generate-rfc7523-authz-grant-artefacts saves it.")).addOption(new Option("--sub <subject>", "ID of the user to get tokens for, typically a UUID. If omitted, the trusted issuer's only allowed subject is used. Name one when the issuer allows several users or any user.")).addOption(new Option("--iss <issuer>", "Trusted issuer, typically a URL. Defaults to the issuer of the trusted issuer named <client id>-issuer.")).addOption(new Option("--scope <scope>", "Space-delimited list of scopes.").default("openid fr:am:* fr:idm:*")).addOption(new Option("--json", "Output in JSON format.")).addHelpText("after", "Usage Examples:\n If you used frodo to create the RFC7523 configuration (see 'Related Commands' below), then you can test your configuration with minimal input: frodo locates the trusted issuer and the private key, and you name the user to get tokens for (on a terminal, leave --sub out to pick the user from a list). The command below returns access token and identity token:\n" + require_Console.theme.command(` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 --sub 146c2230-9448-4442-b86d-eb4a81a0121d ${amBaseUrl}\n`) + ` Same as above but output raw json:\n` + require_Console.theme.command(` $ frodo admin execute-rfc7523-authz-grant-flow --client-id rfc7523-client1 --sub 146c2230-9448-4442-b86d-eb4a81a0121d --json ${amBaseUrl}\n`) + ` Same as first command above but explicitly provide all parameters, which also works when the trusted issuer was not created by frodo:\n` + require_Console.theme.command(` $ 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 ${amBaseUrl}\n`) + `\nRelated Commands:\n Run ${require_Console.theme.command("frodo admin generate-rfc7523-authz-grant-artefacts --help")} to see how to create the required configuration artefacts for ${require_Console.theme.command("frodo admin execute-rfc7523-authz-grant-flow")}:\n`).action(async (host, realm, user, password, options, command) => {
26782
27324
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -27034,10 +27576,10 @@ async function importAdminFederationProvidersFromFiles(allowFailures = false) {
27034
27576
  return false;
27035
27577
  }
27036
27578
  // src/cli/admin/admin-federation-export.ts
27037
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$220 } = require_dist$2.frodo.utils.constants;
27038
- const deploymentTypes$222 = [CLOUD_DEPLOYMENT_TYPE_KEY$220];
27039
- function setup$480() {
27040
- const program = new FrodoCommand("frodo admin federation export", ["realm"], deploymentTypes$222);
27579
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$221 } = require_dist$2.frodo.utils.constants;
27580
+ const deploymentTypes$223 = [CLOUD_DEPLOYMENT_TYPE_KEY$221];
27581
+ function setup$481() {
27582
+ const program = new FrodoCommand("frodo admin federation export", ["realm"], deploymentTypes$223);
27041
27583
  program.description("Export admin federation providers.").addOption(new Option("-i, --idp-id <idp-id>", "Id/name of a provider. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file [file]", "Name of the file to write the exported provider(s) to. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all the providers to a single file. Cannot be used with -i or -A.").conflicts(["idpId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all the providers as separate files <provider name>.admin.federation.json. Cannot be used with -i, -f or -a.").conflicts([
27042
27584
  "idpId",
27043
27585
  "file",
@@ -27051,7 +27593,7 @@ function setup$480() {
27051
27593
  purpose: "what to export"
27052
27594
  }).multiOp().action(async (host, user, password, options, command) => {
27053
27595
  command.handleDefaultArgsAndOpts(host, user, password, options, command);
27054
- if (await getTokens(true, true, deploymentTypes$222)) {
27596
+ if (await getTokens(true, true, deploymentTypes$223)) {
27055
27597
  if (options.idpId) {
27056
27598
  require_Console.verboseMessage(`Exporting provider "${options.idpId}...`);
27057
27599
  if (!await exportAdminFederationProviderToFile(options.idpId, options.file, options.metadata)) process.exitCode = 1;
@@ -27067,10 +27609,10 @@ function setup$480() {
27067
27609
  return program;
27068
27610
  }
27069
27611
  // src/cli/admin/admin-federation-import.ts
27070
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$219 } = require_dist$2.frodo.utils.constants;
27071
- const deploymentTypes$221 = [CLOUD_DEPLOYMENT_TYPE_KEY$219];
27072
- function setup$479() {
27073
- const program = new FrodoCommand("frodo admin federation import", ["realm"], deploymentTypes$221);
27612
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$220 } = require_dist$2.frodo.utils.constants;
27613
+ const deploymentTypes$222 = [CLOUD_DEPLOYMENT_TYPE_KEY$220];
27614
+ function setup$480() {
27615
+ const program = new FrodoCommand("frodo admin federation import", ["realm"], deploymentTypes$222);
27074
27616
  program.description("Import admin federation providers.").addOption(new Option("-i, --idp-id <id>", "Provider id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import the provider(s) from. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all the providers from single file. Cannot be used with -i or -A.").conflicts(["idpId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all the providers from separate files (*.admin.federation.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
27075
27617
  "idpId",
27076
27618
  "file",
@@ -27094,7 +27636,7 @@ function setup$479() {
27094
27636
  program.help();
27095
27637
  return;
27096
27638
  }
27097
- if (!await getTokens(true, true, deploymentTypes$221)) {
27639
+ if (!await getTokens(true, true, deploymentTypes$222)) {
27098
27640
  process.exitCode = 1;
27099
27641
  return;
27100
27642
  }
@@ -27115,13 +27657,13 @@ function setup$479() {
27115
27657
  return program;
27116
27658
  }
27117
27659
  // src/cli/admin/admin-federation-list.ts
27118
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$218 } = require_dist$2.frodo.utils.constants;
27119
- const deploymentTypes$220 = [CLOUD_DEPLOYMENT_TYPE_KEY$218];
27120
- function setup$478() {
27121
- const program = new FrodoCommand("frodo admin federation list", ["realm"], deploymentTypes$220);
27660
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$219 } = require_dist$2.frodo.utils.constants;
27661
+ const deploymentTypes$221 = [CLOUD_DEPLOYMENT_TYPE_KEY$219];
27662
+ function setup$479() {
27663
+ const program = new FrodoCommand("frodo admin federation list", ["realm"], deploymentTypes$221);
27122
27664
  program.description("List admin federation providers.").action(async (host, user, password, options, command) => {
27123
27665
  command.handleDefaultArgsAndOpts(host, user, password, options, command);
27124
- if (await getTokens(true, true, deploymentTypes$220)) {
27666
+ if (await getTokens(true, true, deploymentTypes$221)) {
27125
27667
  require_Console.verboseMessage(`Listing admin federation providers...`);
27126
27668
  if (!await listAdminFederationProviders()) process.exitCode = 1;
27127
27669
  } else process.exitCode = 1;
@@ -27129,16 +27671,16 @@ function setup$478() {
27129
27671
  return program;
27130
27672
  }
27131
27673
  // src/cli/admin/admin-federation.ts
27132
- function setup$477() {
27674
+ function setup$478() {
27133
27675
  const program = new FrodoStubCommand("frodo admin federation");
27134
27676
  program.description("Manages admin federation configuration.");
27135
- program.addCommand(setup$480().name("export"));
27136
- program.addCommand(setup$479().name("import"));
27137
- program.addCommand(setup$478().name("list"));
27677
+ program.addCommand(setup$481().name("export"));
27678
+ program.addCommand(setup$480().name("import"));
27679
+ program.addCommand(setup$479().name("list"));
27138
27680
  return program;
27139
27681
  }
27140
27682
  // src/cli/admin/admin-generate-rfc7523-authz-grant-artefacts.ts
27141
- function setup$476() {
27683
+ function setup$477() {
27142
27684
  const program = new FrodoCommand("frodo admin generate-rfc7523-authz-grant-artefacts");
27143
27685
  program.description("Generate RFC7523 authorization grant artefacts.").addOption(new Option("--client-id <id>", "Client id.")).addOption(new Option("--jwk-file <file>", "Path to JSON Web Key (JWK) file containing private key.")).addOption(new Option("--sub <subject>", "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.")).addOption(new Option("--iss <issuer>", "Trusted issuer, typically a URL.").makeOptionMandatory()).addOption(new Option("--scope <scope>", "Space-delimited list of scopes.").default("openid fr:am:* fr:idm:*")).addOption(new Option("--no-save", "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.")).addOption(new Option("--json", "Output in JSON format.")).addHelpText("after", "Usage Examples:\n Generate, output to console, and save all the artefacts for an RFC7523 authorization grant flow configuration limited to one particular subject:\n - Fully configured OAuth2 client - named '<clientId>'\n - Fully configured OAuth2 trusted issuer - named '<clientId>-issuer'\n - Private Key as Json Web Key (JWK) - named '<clientId>_private.jwk.json'\n - Public Key as Json Web Key Set (JWKS) - named '<clientId>_public.jwks.json'\n" + require_Console.theme.command(` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d ${amBaseUrl}\n`) + ` Same as above but use an existing JWK file instead of creating one.\n` + require_Console.theme.command(` $ 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 ${amBaseUrl}\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` + require_Console.theme.command(` $ 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 ${amBaseUrl}\n`) + ` Generate and output in json format all the artefacts for an RFC7523 authorization grant flow configuration.\n` + require_Console.theme.command(` $ frodo admin generate-rfc7523-authz-grant-artefacts --client-id rfc7523-client1 --iss https://my-issuer.com/issuer --sub 146c2230-9448-4442-b86d-eb4a81a0121d --json ${amBaseUrl}\n`) + `\nRelated Commands:\n Run ${require_Console.theme.command("frodo admin execute-rfc7523-authz-grant-flow --help")} to see how to test your configuration created with ${require_Console.theme.command("frodo admin generate-rfc7523-authz-grant-artefacts")}:\n`).multiOp().action(async (host, realm, user, password, options, command) => {
27144
27686
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -27162,7 +27704,7 @@ function setup$476() {
27162
27704
  }
27163
27705
  // src/cli/admin/admin-get-access-token.ts
27164
27706
  const { clientCredentialsGrant } = require_dist$2.frodo.oauth2oidc.endpoint;
27165
- function setup$475() {
27707
+ function setup$476() {
27166
27708
  const program = new FrodoCommand("frodo admin get-access-token");
27167
27709
  program.description("Get an access token using client credentials grant type.").addOption(new Option("-i, --client-id <id>", "Client id.").makeOptionMandatory()).addOption(new SecretOption("-s, --client-secret [secret]", "Client secret.").makeOptionMandatory()).addOption(new Option("--scope <scope>", "Request the following scope(s).").default("fr:idm:*", "fr:idm:*")).action(async (host, realm, user, password, options, command) => {
27168
27710
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -27175,13 +27717,13 @@ function setup$475() {
27175
27717
  return program;
27176
27718
  }
27177
27719
  // src/cli/admin/admin-grant-oauth2-client-admin-privileges.ts
27178
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$217, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$140 } = require_dist$2.frodo.utils.constants;
27179
- const deploymentTypes$219 = [CLOUD_DEPLOYMENT_TYPE_KEY$217, FORGEOPS_DEPLOYMENT_TYPE_KEY$140];
27180
- function setup$474() {
27181
- const program = new FrodoCommand("frodo admin grant-oauth2-client-admin-privileges", [], deploymentTypes$219);
27720
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$218, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$140 } = require_dist$2.frodo.utils.constants;
27721
+ const deploymentTypes$220 = [CLOUD_DEPLOYMENT_TYPE_KEY$218, FORGEOPS_DEPLOYMENT_TYPE_KEY$140];
27722
+ function setup$475() {
27723
+ const program = new FrodoCommand("frodo admin grant-oauth2-client-admin-privileges", [], deploymentTypes$220);
27182
27724
  program.description("Grant an oauth2 client admin privileges.").addOption(new Option("-i, --client-id <id>", "OAuth2 client id.")).addOption(new Option("-t, --target <target name or id>", "Name of the oauth2 client.").hideHelp()).multiOp().action(async (host, realm, user, password, options, command) => {
27183
27725
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27184
- if (await getTokens(false, true, deploymentTypes$219)) {
27726
+ if (await getTokens(false, true, deploymentTypes$220)) {
27185
27727
  require_Console.printMessage(`Granting oauth2 client "${options.clientId || options.target}" in realm "${require_dist$2.state.getRealm()}" admin privileges...`);
27186
27728
  if (!await grantOAuth2ClientAdminPrivileges(options.clientId || options.target, options.allowFailures)) process.exitCode = 1;
27187
27729
  } else process.exitCode = 1;
@@ -27189,13 +27731,13 @@ function setup$474() {
27189
27731
  return program;
27190
27732
  }
27191
27733
  // src/cli/admin/admin-hide-generic-extension-attributes.ts
27192
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$216 } = require_dist$2.frodo.utils.constants;
27193
- const deploymentTypes$218 = [CLOUD_DEPLOYMENT_TYPE_KEY$216];
27194
- function setup$473() {
27195
- const program = new FrodoCommand("frodo admin hide-generic-extension-attributes", [], deploymentTypes$218);
27734
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$217 } = require_dist$2.frodo.utils.constants;
27735
+ const deploymentTypes$219 = [CLOUD_DEPLOYMENT_TYPE_KEY$217];
27736
+ function setup$474() {
27737
+ const program = new FrodoCommand("frodo admin hide-generic-extension-attributes", [], deploymentTypes$219);
27196
27738
  program.description("Hide generic extension attributes.").addOption(new Option("--include-customized", "Include customized attributes.")).addOption(new Option("--dry-run", "Dry-run only, do not perform changes.")).action(async (host, realm, user, password, options, command) => {
27197
27739
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27198
- if (await getTokens(false, true, deploymentTypes$218)) {
27740
+ if (await getTokens(false, true, deploymentTypes$219)) {
27199
27741
  require_Console.printMessage(`Hiding generic extension attributes in realm "${require_dist$2.state.getRealm()}"...`);
27200
27742
  if (!await hideGenericExtensionAttributes(options.includeCustomized, options.dryRun)) process.exitCode = 1;
27201
27743
  } else process.exitCode = 1;
@@ -27203,13 +27745,13 @@ function setup$473() {
27203
27745
  return program;
27204
27746
  }
27205
27747
  // src/cli/admin/admin-list-oauth2-clients-with-admin-privileges.ts
27206
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$215, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$139 } = require_dist$2.frodo.utils.constants;
27207
- const deploymentTypes$217 = [CLOUD_DEPLOYMENT_TYPE_KEY$215, FORGEOPS_DEPLOYMENT_TYPE_KEY$139];
27208
- function setup$472() {
27209
- const program = new FrodoCommand("frodo admin list-oauth2-clients-with-admin-privileges", [], deploymentTypes$217);
27748
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$216, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$139 } = require_dist$2.frodo.utils.constants;
27749
+ const deploymentTypes$218 = [CLOUD_DEPLOYMENT_TYPE_KEY$216, FORGEOPS_DEPLOYMENT_TYPE_KEY$139];
27750
+ function setup$473() {
27751
+ const program = new FrodoCommand("frodo admin list-oauth2-clients-with-admin-privileges", [], deploymentTypes$218);
27210
27752
  program.description("List oauth2 clients with admin privileges.").action(async (host, realm, user, password, options, command) => {
27211
27753
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27212
- if (await getTokens(false, true, deploymentTypes$217)) {
27754
+ if (await getTokens(false, true, deploymentTypes$218)) {
27213
27755
  require_Console.printMessage(`Listing oauth2 clients with admin privileges in realm "${require_dist$2.state.getRealm()}"...`);
27214
27756
  if (!await listOAuth2AdminClients()) process.exitCode = 1;
27215
27757
  } else process.exitCode = 1;
@@ -27217,13 +27759,13 @@ function setup$472() {
27217
27759
  return program;
27218
27760
  }
27219
27761
  // src/cli/admin/admin-list-oauth2-clients-with-custom-privileges.ts
27220
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$214, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$138 } = require_dist$2.frodo.utils.constants;
27221
- const deploymentTypes$216 = [CLOUD_DEPLOYMENT_TYPE_KEY$214, FORGEOPS_DEPLOYMENT_TYPE_KEY$138];
27222
- function setup$471() {
27223
- const program = new FrodoCommand("frodo admin list-oauth2-clients-with-custom-privileges", [], deploymentTypes$216);
27762
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$215, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$138 } = require_dist$2.frodo.utils.constants;
27763
+ const deploymentTypes$217 = [CLOUD_DEPLOYMENT_TYPE_KEY$215, FORGEOPS_DEPLOYMENT_TYPE_KEY$138];
27764
+ function setup$472() {
27765
+ const program = new FrodoCommand("frodo admin list-oauth2-clients-with-custom-privileges", [], deploymentTypes$217);
27224
27766
  program.description("List oauth2 clients with custom privileges.").action(async (host, realm, user, password, options, command) => {
27225
27767
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27226
- if (await getTokens(false, true, deploymentTypes$216)) {
27768
+ if (await getTokens(false, true, deploymentTypes$217)) {
27227
27769
  require_Console.printMessage(`Listing oauth2 clients with custom privileges in realm "${require_dist$2.state.getRealm()}"...`);
27228
27770
  if (!await listOAuth2CustomClients()) process.exitCode = 1;
27229
27771
  } else process.exitCode = 1;
@@ -27231,13 +27773,13 @@ function setup$471() {
27231
27773
  return program;
27232
27774
  }
27233
27775
  // src/cli/admin/admin-list-static-user-mappings.ts
27234
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$213, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$137 } = require_dist$2.frodo.utils.constants;
27235
- const deploymentTypes$215 = [CLOUD_DEPLOYMENT_TYPE_KEY$213, FORGEOPS_DEPLOYMENT_TYPE_KEY$137];
27236
- function setup$470() {
27237
- const program = new FrodoCommand("frodo admin list-static-user-mappings", [], deploymentTypes$215);
27776
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$214, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$137 } = require_dist$2.frodo.utils.constants;
27777
+ const deploymentTypes$216 = [CLOUD_DEPLOYMENT_TYPE_KEY$214, FORGEOPS_DEPLOYMENT_TYPE_KEY$137];
27778
+ function setup$471() {
27779
+ const program = new FrodoCommand("frodo admin list-static-user-mappings", [], deploymentTypes$216);
27238
27780
  program.description("List all subjects of static user mappings that are not oauth2 clients.").addOption(new Option("--show-protected", "Show protected (system) subjects.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
27239
27781
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27240
- if (await getTokens(false, true, deploymentTypes$215)) {
27782
+ if (await getTokens(false, true, deploymentTypes$216)) {
27241
27783
  require_Console.printMessage("Listing all non-oauth2 client subjects of static user mappings...");
27242
27784
  if (!await listNonOAuth2AdminStaticUserMappings(options.showProtected)) process.exitCode = 1;
27243
27785
  } else process.exitCode = 1;
@@ -27245,13 +27787,13 @@ function setup$470() {
27245
27787
  return program;
27246
27788
  }
27247
27789
  // src/cli/admin/admin-remove-static-user-mapping.ts
27248
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$212, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$136 } = require_dist$2.frodo.utils.constants;
27249
- const deploymentTypes$214 = [CLOUD_DEPLOYMENT_TYPE_KEY$212, FORGEOPS_DEPLOYMENT_TYPE_KEY$136];
27250
- function setup$469() {
27251
- const program = new FrodoCommand("frodo admin remove-static-user-mapping", [], deploymentTypes$214);
27790
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$213, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$136 } = require_dist$2.frodo.utils.constants;
27791
+ const deploymentTypes$215 = [CLOUD_DEPLOYMENT_TYPE_KEY$213, FORGEOPS_DEPLOYMENT_TYPE_KEY$136];
27792
+ function setup$470() {
27793
+ const program = new FrodoCommand("frodo admin remove-static-user-mapping", [], deploymentTypes$215);
27252
27794
  program.description("Remove a subject's static user mapping.").addOption(new Option("-i, --sub-id <id>", "Subject identifier.")).action(async (host, realm, user, password, options, command) => {
27253
27795
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27254
- if (await getTokens(false, true, deploymentTypes$214)) {
27796
+ if (await getTokens(false, true, deploymentTypes$215)) {
27255
27797
  require_Console.printMessage("Removing a subject's static user mapping...");
27256
27798
  if (!await removeStaticUserMapping(options.subId)) process.exitCode = 1;
27257
27799
  } else process.exitCode = 1;
@@ -27259,13 +27801,13 @@ function setup$469() {
27259
27801
  return program;
27260
27802
  }
27261
27803
  // src/cli/admin/admin-repair-org-model.ts
27262
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$211, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$135 } = require_dist$2.frodo.utils.constants;
27263
- const deploymentTypes$213 = [CLOUD_DEPLOYMENT_TYPE_KEY$211, FORGEOPS_DEPLOYMENT_TYPE_KEY$135];
27264
- function setup$468() {
27265
- const program = new FrodoCommand("frodo admin repair-org-model", [], deploymentTypes$213);
27804
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$212, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$135 } = require_dist$2.frodo.utils.constants;
27805
+ const deploymentTypes$214 = [CLOUD_DEPLOYMENT_TYPE_KEY$212, FORGEOPS_DEPLOYMENT_TYPE_KEY$135];
27806
+ function setup$469() {
27807
+ const program = new FrodoCommand("frodo admin repair-org-model", [], deploymentTypes$214);
27266
27808
  program.description("Repair org model.").addOption(new Option("--exclude-customized", "Exclude customized properties from repair.")).addOption(new Option("--extend-permissions", "Extend permissions to include custom attributes.")).addOption(new Option("--dry-run", "Dry-run only, do not perform changes.")).multiOp().action(async (host, realm, user, password, options, command) => {
27267
27809
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27268
- if (await getTokens(false, true, deploymentTypes$213)) {
27810
+ if (await getTokens(false, true, deploymentTypes$214)) {
27269
27811
  require_Console.printMessage(`Repairing org model in realm "${require_dist$2.state.getRealm()}"...`);
27270
27812
  if (!await repairOrgModel(options.excludeCustomized, options.extendPermissions, options.dryRun, options.allowFailures)) process.exitCode = 1;
27271
27813
  } else process.exitCode = 1;
@@ -27273,13 +27815,13 @@ function setup$468() {
27273
27815
  return program;
27274
27816
  }
27275
27817
  // src/cli/admin/admin-revoke-oauth2-client-admin-privileges.ts
27276
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$210, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$134 } = require_dist$2.frodo.utils.constants;
27277
- const deploymentTypes$212 = [CLOUD_DEPLOYMENT_TYPE_KEY$210, FORGEOPS_DEPLOYMENT_TYPE_KEY$134];
27278
- function setup$467() {
27279
- const program = new FrodoCommand("frodo admin revoke-oauth2-client-admin-privileges", [], deploymentTypes$212);
27818
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$211, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$134 } = require_dist$2.frodo.utils.constants;
27819
+ const deploymentTypes$213 = [CLOUD_DEPLOYMENT_TYPE_KEY$211, FORGEOPS_DEPLOYMENT_TYPE_KEY$134];
27820
+ function setup$468() {
27821
+ const program = new FrodoCommand("frodo admin revoke-oauth2-client-admin-privileges", [], deploymentTypes$213);
27280
27822
  program.description("Revoke admin privileges from an oauth2 client.").addOption(new Option("-i, --client-id <id>", "OAuth2 client id.")).addOption(new Option("-t, --target <target name or id>", "Name of the oauth2 client.").hideHelp()).multiOp().action(async (host, realm, user, password, options, command) => {
27281
27823
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27282
- if (await getTokens(false, true, deploymentTypes$212)) {
27824
+ if (await getTokens(false, true, deploymentTypes$213)) {
27283
27825
  require_Console.printMessage(`Revoking admin privileges from oauth2 client "${options.clientId || options.target}" in realm "${require_dist$2.state.getRealm()}"...`);
27284
27826
  if (!await revokeOAuth2ClientAdminPrivileges(options.clientId || options.target, options.allowFailures)) process.exitCode = 1;
27285
27827
  } else process.exitCode = 1;
@@ -27287,13 +27829,13 @@ function setup$467() {
27287
27829
  return program;
27288
27830
  }
27289
27831
  // src/cli/admin/admin-show-generic-extension-attributes.ts
27290
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$209 } = require_dist$2.frodo.utils.constants;
27291
- const deploymentTypes$211 = [CLOUD_DEPLOYMENT_TYPE_KEY$209];
27292
- function setup$466() {
27293
- const program = new FrodoCommand("frodo admin show-generic-extension-attributes", [], deploymentTypes$211);
27832
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$210 } = require_dist$2.frodo.utils.constants;
27833
+ const deploymentTypes$212 = [CLOUD_DEPLOYMENT_TYPE_KEY$210];
27834
+ function setup$467() {
27835
+ const program = new FrodoCommand("frodo admin show-generic-extension-attributes", [], deploymentTypes$212);
27294
27836
  program.description("Show generic extension attributes.").addOption(new Option("--include-customized", "Include customized attributes.").default(false, "false")).addOption(new Option("--dry-run", "Dry-run only, do not perform changes.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
27295
27837
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
27296
- if (await getTokens(false, true, deploymentTypes$211)) {
27838
+ if (await getTokens(false, true, deploymentTypes$212)) {
27297
27839
  require_Console.printMessage(`Showing generic extension attributes in realm "${require_dist$2.state.getRealm()}"...`);
27298
27840
  if (!await showGenericExtensionAttributes(options.includeCustomized, options.dryRun)) process.exitCode = 1;
27299
27841
  } else process.exitCode = 1;
@@ -27301,23 +27843,23 @@ function setup$466() {
27301
27843
  return program;
27302
27844
  }
27303
27845
  // src/cli/admin/admin.ts
27304
- function setup$465() {
27846
+ function setup$466() {
27305
27847
  const program = new FrodoStubCommand("admin").description("Platform admin tasks.");
27306
- program.addCommand(setup$477().name("federation"));
27307
- program.addCommand(setup$482().name("create-oauth2-client-with-admin-privileges"));
27308
- program.addCommand(setup$476().name("generate-rfc7523-authz-grant-artefacts"));
27309
- program.addCommand(setup$481().name("execute-rfc7523-authz-grant-flow"));
27310
- program.addCommand(setup$475().name("get-access-token"));
27311
- program.addCommand(setup$472().name("list-oauth2-clients-with-admin-privileges"));
27312
- program.addCommand(setup$474().name("grant-oauth2-client-admin-privileges"));
27313
- program.addCommand(setup$467().name("revoke-oauth2-client-admin-privileges"));
27314
- program.addCommand(setup$471().name("list-oauth2-clients-with-custom-privileges"));
27315
- program.addCommand(setup$470().name("list-static-user-mappings"));
27316
- program.addCommand(setup$469().name("remove-static-user-mapping"));
27317
- program.addCommand(setup$483().name("add-autoid-static-user-mapping"));
27318
- program.addCommand(setup$473().name("hide-generic-extension-attributes"));
27319
- program.addCommand(setup$466().name("show-generic-extension-attributes"));
27320
- program.addCommand(setup$468().name("repair-org-model"));
27848
+ program.addCommand(setup$478().name("federation"));
27849
+ program.addCommand(setup$483().name("create-oauth2-client-with-admin-privileges"));
27850
+ program.addCommand(setup$477().name("generate-rfc7523-authz-grant-artefacts"));
27851
+ program.addCommand(setup$482().name("execute-rfc7523-authz-grant-flow"));
27852
+ program.addCommand(setup$476().name("get-access-token"));
27853
+ program.addCommand(setup$473().name("list-oauth2-clients-with-admin-privileges"));
27854
+ program.addCommand(setup$475().name("grant-oauth2-client-admin-privileges"));
27855
+ program.addCommand(setup$468().name("revoke-oauth2-client-admin-privileges"));
27856
+ program.addCommand(setup$472().name("list-oauth2-clients-with-custom-privileges"));
27857
+ program.addCommand(setup$471().name("list-static-user-mappings"));
27858
+ program.addCommand(setup$470().name("remove-static-user-mapping"));
27859
+ program.addCommand(setup$484().name("add-autoid-static-user-mapping"));
27860
+ program.addCommand(setup$474().name("hide-generic-extension-attributes"));
27861
+ program.addCommand(setup$467().name("show-generic-extension-attributes"));
27862
+ program.addCommand(setup$469().name("repair-org-model"));
27321
27863
  return program;
27322
27864
  }
27323
27865
  // src/ops/AgentOps.ts
@@ -28835,7 +29377,7 @@ async function confirmProceed({ what, yes, dryRun, warning, showPlan }) {
28835
29377
  * @param legacy true for `frodo agent ai`, the deprecated path, which stays exactly as it was in 4.x
28836
29378
  * (cli#1271): no usage examples, and the original options of the commands
28837
29379
  */
28838
- function setup$464(legacy = false) {
29380
+ function setup$465(legacy = false) {
28839
29381
  const program = new FrodoCommand("frodo aiagent delete");
28840
29382
  program.description("Delete AI agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a.").conflicts(["all"])).addOption(new Option("-a, --all", "Delete all AI agents. Cannot be used with -i.").conflicts(["agentId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all AI agents. Required with -a when there is no terminal.")).requireOneOf({
28841
29383
  options: ["agentId", "all"],
@@ -28876,7 +29418,7 @@ function setup$464(legacy = false) {
28876
29418
  * @param legacy true for `frodo agent ai`, the deprecated path, which stays exactly as it was in 4.x
28877
29419
  * (cli#1271): no usage examples, and the original options of the commands
28878
29420
  */
28879
- function setup$463(legacy = false) {
29421
+ function setup$464(legacy = false) {
28880
29422
  const program = new FrodoCommand("frodo aiagent describe");
28881
29423
  program.description("Describe AI agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id.")).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
28882
29424
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -28892,7 +29434,7 @@ function setup$463(legacy = false) {
28892
29434
  * @param legacy true for `frodo agent ai`, the deprecated path, which stays exactly as it was in 4.x
28893
29435
  * (cli#1271): no usage examples, and the original options of the commands
28894
29436
  */
28895
- function setup$462(legacy = false) {
29437
+ function setup$463(legacy = false) {
28896
29438
  const program = new FrodoCommand("frodo aiagent export");
28897
29439
  program.description("Export AI agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the export file. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all AI agents to a single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all AI agents to separate files (*.aiagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
28898
29440
  "agentId",
@@ -28928,7 +29470,7 @@ function setup$462(legacy = false) {
28928
29470
  * @param legacy true for `frodo agent ai`, the deprecated path, which stays exactly as it was in 4.x
28929
29471
  * (cli#1271): no usage examples, and the original options of the commands
28930
29472
  */
28931
- function setup$461(legacy = false) {
29473
+ function setup$462(legacy = false) {
28932
29474
  const program = new FrodoCommand("frodo aiagent import");
28933
29475
  program.description("Import AI agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all agents from single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all agents from separate files (*.ai.agent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
28934
29476
  "agentId",
@@ -28972,7 +29514,7 @@ function setup$461(legacy = false) {
28972
29514
  * @param legacy true for `frodo agent ai`, the deprecated path, which stays exactly as it was in 4.x
28973
29515
  * (cli#1271): no usage examples, and the original options of the commands
28974
29516
  */
28975
- function setup$460(legacy = false) {
29517
+ function setup$461(legacy = false) {
28976
29518
  const program = new FrodoCommand("frodo aiagent list");
28977
29519
  program.description("List AI agents.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
28978
29520
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -28991,14 +29533,14 @@ function setup$460(legacy = false) {
28991
29533
  * @param legacy true when `frodo agent ai` registers the group: that path is
28992
29534
  * frozen and its commands stay exactly as they were in 4.x (cli#1271)
28993
29535
  */
28994
- function setup$459(legacy = false) {
29536
+ function setup$460(legacy = false) {
28995
29537
  const program = new FrodoStubCommand("aiagent");
28996
29538
  program.description("Manage AI agents.");
28997
- program.addCommand(setup$460(legacy).name("list"));
28998
- program.addCommand(setup$463(legacy).name("describe"));
28999
- program.addCommand(setup$462(legacy).name("export"));
29000
- program.addCommand(setup$461(legacy).name("import"));
29001
- program.addCommand(setup$464(legacy).name("delete"));
29539
+ program.addCommand(setup$461(legacy).name("list"));
29540
+ program.addCommand(setup$464(legacy).name("describe"));
29541
+ program.addCommand(setup$463(legacy).name("export"));
29542
+ program.addCommand(setup$462(legacy).name("import"));
29543
+ program.addCommand(setup$465(legacy).name("delete"));
29002
29544
  return program;
29003
29545
  }
29004
29546
  // src/cli/agent/agent-ai.ts
@@ -29011,11 +29553,11 @@ function setup$459(legacy = false) {
29011
29553
  * original rule of `import`). Removing the old path means deleting this file and
29012
29554
  * the line in agent.ts; a major release may do it (decision record 0048).
29013
29555
  */
29014
- function setup$458() {
29015
- return setup$459(true).name("ai").description("Deprecated: use frodo aiagent. Manage AI agents.").withStability("deprecated", void 0, "Use 'frodo aiagent' instead: the commands and options are the same. 'frodo agent ai' keeps working in 5.x and may be removed in a later major release.");
29556
+ function setup$459() {
29557
+ return setup$460(true).name("ai").description("Deprecated: use frodo aiagent. Manage AI agents.").withStability("deprecated", void 0, "Use 'frodo aiagent' instead: the commands and options are the same. 'frodo agent ai' keeps working in 5.x and may be removed in a later major release.");
29016
29558
  }
29017
29559
  // src/cli/agent/agent-delete.ts
29018
- function setup$457() {
29560
+ function setup$458() {
29019
29561
  const program = new FrodoCommand("frodo agent delete");
29020
29562
  program.description("Delete agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a.").conflicts(["all"])).addOption(new Option("-a, --all", "Delete all agents. Cannot be used with -i.").conflicts(["agentId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all agents. Required with -a when there is no terminal.")).requireOneOf({
29021
29563
  options: ["agentId", "all"],
@@ -29053,7 +29595,7 @@ function setup$457() {
29053
29595
  // src/cli/agent/agent-describe.ts
29054
29596
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$24, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$133 } = require_dist$2.frodo.utils.constants;
29055
29597
  const globalDeploymentTypes$17 = [CLASSIC_DEPLOYMENT_TYPE_KEY$24, FORGEOPS_DEPLOYMENT_TYPE_KEY$133];
29056
- function setup$456() {
29598
+ function setup$457() {
29057
29599
  const program = new FrodoCommand("frodo agent describe");
29058
29600
  program.description("Describe agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id.")).addOption(new Option("-g, --global", "Describe global agent.")).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
29059
29601
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29068,7 +29610,7 @@ function setup$456() {
29068
29610
  // src/cli/agent/agent-export.ts
29069
29611
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$23, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$132 } = require_dist$2.frodo.utils.constants;
29070
29612
  const globalDeploymentTypes$16 = [CLASSIC_DEPLOYMENT_TYPE_KEY$23, FORGEOPS_DEPLOYMENT_TYPE_KEY$132];
29071
- function setup$455() {
29613
+ function setup$456() {
29072
29614
  const program = new FrodoCommand("frodo agent export");
29073
29615
  program.description("Export agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the export file. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all agents to a single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all agents to separate files (*.<type>.agent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29074
29616
  "agentId",
@@ -29100,7 +29642,7 @@ function setup$455() {
29100
29642
  return program;
29101
29643
  }
29102
29644
  // src/cli/agent/agent-gateway-delete.ts
29103
- function setup$454() {
29645
+ function setup$455() {
29104
29646
  const program = new FrodoCommand("frodo agent gateway delete");
29105
29647
  program.description("Delete identity gateway agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a.").conflicts(["all"])).addOption(new Option("-a, --all", "Delete all identity gateway agents. Cannot be used with -i.").conflicts(["agentId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all identity gateway agents. Required with -a when there is no terminal.")).requireOneOf({
29106
29648
  options: ["agentId", "all"],
@@ -29136,7 +29678,7 @@ function setup$454() {
29136
29678
  return program;
29137
29679
  }
29138
29680
  // src/cli/agent/agent-gateway-describe.ts
29139
- function setup$453() {
29681
+ function setup$454() {
29140
29682
  const program = new FrodoCommand("frodo agent gateway describe");
29141
29683
  program.description("Describe gateway agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id.")).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
29142
29684
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29147,7 +29689,7 @@ function setup$453() {
29147
29689
  return program;
29148
29690
  }
29149
29691
  // src/cli/agent/agent-gateway-export.ts
29150
- function setup$452() {
29692
+ function setup$453() {
29151
29693
  const program = new FrodoCommand("frodo agent gateway export");
29152
29694
  program.description("Export gateway agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the export file. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all gateway agents to a single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all gateway agents to separate files (*.identitygatewayagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29153
29695
  "agentId",
@@ -29178,7 +29720,7 @@ function setup$452() {
29178
29720
  return program;
29179
29721
  }
29180
29722
  // src/cli/agent/agent-gateway-import.ts
29181
- function setup$451() {
29723
+ function setup$452() {
29182
29724
  const program = new FrodoCommand("frodo agent gateway import");
29183
29725
  program.description("Import gateway agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all agents from single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all agents from separate files (*.identitygatewayagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29184
29726
  "agentId",
@@ -29217,7 +29759,7 @@ function setup$451() {
29217
29759
  return program;
29218
29760
  }
29219
29761
  // src/cli/agent/agent-gateway-list.ts
29220
- function setup$450() {
29762
+ function setup$451() {
29221
29763
  const program = new FrodoCommand("frodo agent gateway list");
29222
29764
  program.description("List gateway agents.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
29223
29765
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29228,20 +29770,20 @@ function setup$450() {
29228
29770
  return program;
29229
29771
  }
29230
29772
  // src/cli/agent/agent-gateway.ts
29231
- function setup$449() {
29773
+ function setup$450() {
29232
29774
  const program = new FrodoStubCommand("frodo agent gateway");
29233
29775
  program.description("Manage gateway agents.");
29234
- program.addCommand(setup$450().name("list"));
29235
- program.addCommand(setup$453().name("describe"));
29236
- program.addCommand(setup$452().name("export"));
29237
- program.addCommand(setup$451().name("import"));
29238
- program.addCommand(setup$454().name("delete"));
29776
+ program.addCommand(setup$451().name("list"));
29777
+ program.addCommand(setup$454().name("describe"));
29778
+ program.addCommand(setup$453().name("export"));
29779
+ program.addCommand(setup$452().name("import"));
29780
+ program.addCommand(setup$455().name("delete"));
29239
29781
  return program;
29240
29782
  }
29241
29783
  // src/cli/agent/agent-import.ts
29242
29784
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$22, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$131 } = require_dist$2.frodo.utils.constants;
29243
29785
  const globalDeploymentTypes$15 = [CLASSIC_DEPLOYMENT_TYPE_KEY$22, FORGEOPS_DEPLOYMENT_TYPE_KEY$131];
29244
- function setup$448() {
29786
+ function setup$449() {
29245
29787
  const program = new FrodoCommand("frodo agent import");
29246
29788
  program.description("Import agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all agents from single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all agents from separate files (*.agent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29247
29789
  "agentId",
@@ -29281,7 +29823,7 @@ function setup$448() {
29281
29823
  return program;
29282
29824
  }
29283
29825
  // src/cli/agent/agent-java-delete.ts
29284
- function setup$447() {
29826
+ function setup$448() {
29285
29827
  const program = new FrodoCommand("frodo agent java delete");
29286
29828
  program.description("Delete java agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a.").conflicts(["all"])).addOption(new Option("-a, --all", "Delete all java agents. Cannot be used with -i.").conflicts(["agentId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all java agents. Required with -a when there is no terminal.")).requireOneOf({
29287
29829
  options: ["agentId", "all"],
@@ -29317,7 +29859,7 @@ function setup$447() {
29317
29859
  return program;
29318
29860
  }
29319
29861
  // src/cli/agent/agent-java-describe.ts
29320
- function setup$446() {
29862
+ function setup$447() {
29321
29863
  const program = new FrodoCommand("frodo agent java describe");
29322
29864
  program.description("Describe java agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id.")).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
29323
29865
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29328,7 +29870,7 @@ function setup$446() {
29328
29870
  return program;
29329
29871
  }
29330
29872
  // src/cli/agent/agent-java-export.ts
29331
- function setup$445() {
29873
+ function setup$446() {
29332
29874
  const program = new FrodoCommand("frodo agent java export");
29333
29875
  program.description("Export java agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the export file. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all java agents to a single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all java agents to separate files (*.javaagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29334
29876
  "agentId",
@@ -29359,7 +29901,7 @@ function setup$445() {
29359
29901
  return program;
29360
29902
  }
29361
29903
  // src/cli/agent/agent-java-import.ts
29362
- function setup$444() {
29904
+ function setup$445() {
29363
29905
  const program = new FrodoCommand("frodo agent java import");
29364
29906
  program.description("Import java agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all agents from single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all agents from separate files (*.javaagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29365
29907
  "agentId",
@@ -29398,7 +29940,7 @@ function setup$444() {
29398
29940
  return program;
29399
29941
  }
29400
29942
  // src/cli/agent/agent-java-list.ts
29401
- function setup$443() {
29943
+ function setup$444() {
29402
29944
  const program = new FrodoCommand("frodo agent java list");
29403
29945
  program.description("List java agents.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
29404
29946
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29409,20 +29951,20 @@ function setup$443() {
29409
29951
  return program;
29410
29952
  }
29411
29953
  // src/cli/agent/agent-java.ts
29412
- function setup$442() {
29954
+ function setup$443() {
29413
29955
  const program = new FrodoStubCommand("frodo agent java");
29414
29956
  program.description("Manage java agents.");
29415
- program.addCommand(setup$443().name("list"));
29416
- program.addCommand(setup$446().name("describe"));
29417
- program.addCommand(setup$445().name("export"));
29418
- program.addCommand(setup$444().name("import"));
29419
- program.addCommand(setup$447().name("delete"));
29957
+ program.addCommand(setup$444().name("list"));
29958
+ program.addCommand(setup$447().name("describe"));
29959
+ program.addCommand(setup$446().name("export"));
29960
+ program.addCommand(setup$445().name("import"));
29961
+ program.addCommand(setup$448().name("delete"));
29420
29962
  return program;
29421
29963
  }
29422
29964
  // src/cli/agent/agent-list.ts
29423
29965
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$21, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$130 } = require_dist$2.frodo.utils.constants;
29424
29966
  const globalDeploymentTypes$14 = [CLASSIC_DEPLOYMENT_TYPE_KEY$21, FORGEOPS_DEPLOYMENT_TYPE_KEY$130];
29425
- function setup$441() {
29967
+ function setup$442() {
29426
29968
  const program = new FrodoCommand("frodo agent list");
29427
29969
  program.description("List agents.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).addOption(new Option("-g, --global", "List global agents.")).action(async (host, realm, user, password, options, command) => {
29428
29970
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29433,7 +29975,7 @@ function setup$441() {
29433
29975
  return program;
29434
29976
  }
29435
29977
  // src/cli/agent/agent-web-delete.ts
29436
- function setup$440() {
29978
+ function setup$441() {
29437
29979
  const program = new FrodoCommand("frodo agent web delete");
29438
29980
  program.description("Delete web agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a.").conflicts(["all"])).addOption(new Option("-a, --all", "Delete all web agents. Cannot be used with -i.").conflicts(["agentId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all web agents. Required with -a when there is no terminal.")).requireOneOf({
29439
29981
  options: ["agentId", "all"],
@@ -29469,7 +30011,7 @@ function setup$440() {
29469
30011
  return program;
29470
30012
  }
29471
30013
  // src/cli/agent/agent-web-describe.ts
29472
- function setup$439() {
30014
+ function setup$440() {
29473
30015
  const program = new FrodoCommand("frodo agent web describe");
29474
30016
  program.description("Describe web agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id.")).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
29475
30017
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29480,7 +30022,7 @@ function setup$439() {
29480
30022
  return program;
29481
30023
  }
29482
30024
  // src/cli/agent/agent-web-export.ts
29483
- function setup$438() {
30025
+ function setup$439() {
29484
30026
  const program = new FrodoCommand("frodo agent web export");
29485
30027
  program.description("Export web agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the export file. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all web agents to a single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all web agents to separate files (*.webagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29486
30028
  "agentId",
@@ -29511,7 +30053,7 @@ function setup$438() {
29511
30053
  return program;
29512
30054
  }
29513
30055
  // src/cli/agent/agent-web-import.ts
29514
- function setup$437() {
30056
+ function setup$438() {
29515
30057
  const program = new FrodoCommand("frodo agent web import");
29516
30058
  program.description("Import web agents.").addOption(new Option("-i, --agent-id <agent-id>", "Agent id. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all agents from single file. Cannot be used with -i or -A.").conflicts(["agentId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all agents from separate files (*.webagent.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
29517
30059
  "agentId",
@@ -29550,7 +30092,7 @@ function setup$437() {
29550
30092
  return program;
29551
30093
  }
29552
30094
  // src/cli/agent/agent-web-list.ts
29553
- function setup$436() {
30095
+ function setup$437() {
29554
30096
  const program = new FrodoCommand("frodo agent web list");
29555
30097
  program.description("List web agents.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
29556
30098
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -29561,28 +30103,28 @@ function setup$436() {
29561
30103
  return program;
29562
30104
  }
29563
30105
  // src/cli/agent/agent-web.ts
29564
- function setup$435() {
30106
+ function setup$436() {
29565
30107
  const program = new FrodoStubCommand("frodo agent web");
29566
30108
  program.description("Manage web agents.");
29567
- program.addCommand(setup$436().name("list"));
29568
- program.addCommand(setup$439().name("describe"));
29569
- program.addCommand(setup$438().name("export"));
29570
- program.addCommand(setup$437().name("import"));
29571
- program.addCommand(setup$440().name("delete"));
30109
+ program.addCommand(setup$437().name("list"));
30110
+ program.addCommand(setup$440().name("describe"));
30111
+ program.addCommand(setup$439().name("export"));
30112
+ program.addCommand(setup$438().name("import"));
30113
+ program.addCommand(setup$441().name("delete"));
29572
30114
  return program;
29573
30115
  }
29574
30116
  // src/cli/agent/agent.ts
29575
- function setup$434() {
30117
+ function setup$435() {
29576
30118
  const program = new FrodoStubCommand("agent").description("Manage agents.");
29577
- program.addCommand(setup$458());
29578
- program.addCommand(setup$449().name("gateway"));
29579
- program.addCommand(setup$442().name("java"));
29580
- program.addCommand(setup$435().name("web"));
29581
- program.addCommand(setup$441().name("list"));
29582
- program.addCommand(setup$456().name("describe"));
29583
- program.addCommand(setup$455().name("export"));
29584
- program.addCommand(setup$448().name("import"));
29585
- program.addCommand(setup$457().name("delete"));
30119
+ program.addCommand(setup$459());
30120
+ program.addCommand(setup$450().name("gateway"));
30121
+ program.addCommand(setup$443().name("java"));
30122
+ program.addCommand(setup$436().name("web"));
30123
+ program.addCommand(setup$442().name("list"));
30124
+ program.addCommand(setup$457().name("describe"));
30125
+ program.addCommand(setup$456().name("export"));
30126
+ program.addCommand(setup$449().name("import"));
30127
+ program.addCommand(setup$458().name("delete"));
29586
30128
  return program;
29587
30129
  }
29588
30130
  // src/utils/SecondsOption.ts
@@ -30040,10 +30582,10 @@ async function importApplicationsFromFiles(options = { deps: true }, allowFailur
30040
30582
  return outcome;
30041
30583
  }
30042
30584
  // src/cli/app/app-delete.ts
30043
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$208, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$129 } = require_dist$2.frodo.utils.constants;
30044
- const deploymentTypes$210 = [CLOUD_DEPLOYMENT_TYPE_KEY$208, FORGEOPS_DEPLOYMENT_TYPE_KEY$129];
30045
- function setup$433() {
30046
- const program = new FrodoCommand("frodo app delete", [], deploymentTypes$210);
30585
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$209, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$129 } = require_dist$2.frodo.utils.constants;
30586
+ const deploymentTypes$211 = [CLOUD_DEPLOYMENT_TYPE_KEY$209, FORGEOPS_DEPLOYMENT_TYPE_KEY$129];
30587
+ function setup$434() {
30588
+ const program = new FrodoCommand("frodo app delete", [], deploymentTypes$211);
30047
30589
  program.description("Delete applications.").addOption(new Option("-i, --app-id <id>", "Application id. Cannot be used with -n or -a.").conflicts(["appName", "all"])).addOption(new Option("-n, --app-name <name>", "Application name. Cannot be used with -i or -a.").conflicts(["appId", "all"])).addOption(new Option("-a, --all", "Delete all applications. Cannot be used with -i or -n.").conflicts(["appId", "appName"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all applications. Required with -a when there is no terminal.")).addOption(new Option("--no-deep", "No deep delete. This leaves orphaned configuration artifacts behind.")).addHelpText("after", require_Console.theme.warning(`Important Note:\n`) + ` The ${require_Console.theme.command("frodo app")} command to manage OAuth2 clients in v1.x has been renamed to ${require_Console.theme.command("frodo oauth client")} in v2.x\n The ${require_Console.theme.command("frodo app")} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${require_Console.theme.command("frodo oauth client")} command.\n\nUsage Examples:\n Delete application 'myApp':\n` + require_Console.theme.command(` $ frodo app delete -i 'myApp' ${amBaseUrl}\n`) + ` Delete all applications:\n` + require_Console.theme.command(` $ frodo app delete -a -y ${connId}\n`)).requireOneOf({
30048
30590
  options: [
30049
30591
  "all",
@@ -30061,7 +30603,7 @@ function setup$433() {
30061
30603
  process.exitCode = 1;
30062
30604
  return;
30063
30605
  }
30064
- if (await getTokens(false, true, deploymentTypes$210)) {
30606
+ if (await getTokens(false, true, deploymentTypes$211)) {
30065
30607
  if (options.appId || options.appName) {
30066
30608
  require_Console.verboseMessage("Deleting application...");
30067
30609
  if (!await deleteApplication(options.appId, options.appName, options.deep)) process.exitCode = 1;
@@ -30082,16 +30624,16 @@ function setup$433() {
30082
30624
  return program;
30083
30625
  }
30084
30626
  // src/cli/app/app-disable.ts
30085
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$207, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$128 } = require_dist$2.frodo.utils.constants;
30086
- const deploymentTypes$209 = [CLOUD_DEPLOYMENT_TYPE_KEY$207, FORGEOPS_DEPLOYMENT_TYPE_KEY$128];
30087
- function setup$432() {
30088
- const program = new FrodoCommand("frodo app disable", [], deploymentTypes$209);
30627
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$208, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$128 } = require_dist$2.frodo.utils.constants;
30628
+ const deploymentTypes$210 = [CLOUD_DEPLOYMENT_TYPE_KEY$208, FORGEOPS_DEPLOYMENT_TYPE_KEY$128];
30629
+ function setup$433() {
30630
+ const program = new FrodoCommand("frodo app disable", [], deploymentTypes$210);
30089
30631
  program.description("Disable an application (switch it off).").addOption(new Option("-i, --app-id <id>", "Application id. Cannot be used with -n.").conflicts(["appName"])).addOption(new Option("-n, --app-name <name>", "Application name. Cannot be used with -i.").conflicts(["appId"])).addHelpText("after", `Only a provisioning application, one with a connector, can be disabled: its status is the state of its connector (see the Status column of ${require_Console.theme.command("frodo app list -l")}).\n\nUsage Examples:\n Disable the application '${applicationName}':\n` + require_Console.theme.command(` $ frodo app disable -n ${applicationName} ${amBaseUrl}\n`) + ` Disable it using a connection profile:\n` + require_Console.theme.command(` $ frodo app disable -n ${applicationName} ${connId}\n`)).requireOneOf({
30090
30632
  options: ["appId", "appName"],
30091
30633
  purpose: "which application to disable"
30092
30634
  }).action(async (host, realm, user, password, options, command) => {
30093
30635
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
30094
- if (await getTokens(false, true, deploymentTypes$209)) {
30636
+ if (await getTokens(false, true, deploymentTypes$210)) {
30095
30637
  require_Console.verboseMessage("Disabling application...");
30096
30638
  if (!await disableApplication(options.appId, options.appName)) process.exitCode = 1;
30097
30639
  } else process.exitCode = 1;
@@ -30099,16 +30641,16 @@ function setup$432() {
30099
30641
  return program;
30100
30642
  }
30101
30643
  // src/cli/app/app-enable.ts
30102
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$206, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$127 } = require_dist$2.frodo.utils.constants;
30103
- const deploymentTypes$208 = [CLOUD_DEPLOYMENT_TYPE_KEY$206, FORGEOPS_DEPLOYMENT_TYPE_KEY$127];
30104
- function setup$431() {
30105
- const program = new FrodoCommand("frodo app enable", [], deploymentTypes$208);
30644
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$207, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$127 } = require_dist$2.frodo.utils.constants;
30645
+ const deploymentTypes$209 = [CLOUD_DEPLOYMENT_TYPE_KEY$207, FORGEOPS_DEPLOYMENT_TYPE_KEY$127];
30646
+ function setup$432() {
30647
+ const program = new FrodoCommand("frodo app enable", [], deploymentTypes$209);
30106
30648
  program.description("Enable an application (switch it on).").addOption(new Option("-i, --app-id <id>", "Application id. Cannot be used with -n.").conflicts(["appName"])).addOption(new Option("-n, --app-name <name>", "Application name. Cannot be used with -i.").conflicts(["appId"])).addOption(new Option("--timeout <seconds>", "How long to wait, in seconds, for the connector to answer its connection test after it was switched on. 0 tests once. Without this option the library default applies (30 seconds).").argParser(parseSeconds)).addHelpText("after", `Only a provisioning application, one with a connector, can be enabled: its status is the state of its connector (see the Status column of ${require_Console.theme.command("frodo app list -l")}). Enabling waits until the connector answers its connection test.\n\nUsage Examples:\n Enable the application '${applicationName}':\n` + require_Console.theme.command(` $ frodo app enable -n ${applicationName} ${amBaseUrl}\n`) + ` Enable it and wait up to 60 seconds for its connector to answer:\n` + require_Console.theme.command(` $ frodo app enable -n ${applicationName} --timeout 60 ${connId}\n`)).requireOneOf({
30107
30649
  options: ["appId", "appName"],
30108
30650
  purpose: "which application to enable"
30109
30651
  }).action(async (host, realm, user, password, options, command) => {
30110
30652
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
30111
- if (await getTokens(false, true, deploymentTypes$208)) {
30653
+ if (await getTokens(false, true, deploymentTypes$209)) {
30112
30654
  require_Console.verboseMessage("Enabling application...");
30113
30655
  if (!await enableApplication(options.appId, options.appName, options.timeout)) process.exitCode = 1;
30114
30656
  } else process.exitCode = 1;
@@ -30116,10 +30658,10 @@ function setup$431() {
30116
30658
  return program;
30117
30659
  }
30118
30660
  // src/cli/app/app-export.ts
30119
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$205, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$126 } = require_dist$2.frodo.utils.constants;
30120
- const deploymentTypes$207 = [CLOUD_DEPLOYMENT_TYPE_KEY$205, FORGEOPS_DEPLOYMENT_TYPE_KEY$126];
30121
- function setup$430() {
30122
- const program = new FrodoCommand("frodo app export", [], deploymentTypes$207);
30661
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$206, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$126 } = require_dist$2.frodo.utils.constants;
30662
+ const deploymentTypes$208 = [CLOUD_DEPLOYMENT_TYPE_KEY$206, FORGEOPS_DEPLOYMENT_TYPE_KEY$126];
30663
+ function setup$431() {
30664
+ const program = new FrodoCommand("frodo app export", [], deploymentTypes$208);
30123
30665
  program.description("Export applications.").addOption(new Option("-i, --app-id <id>", "Application id. Cannot be used with -n, -a or -A.").conflicts([
30124
30666
  "appName",
30125
30667
  "all",
@@ -30147,7 +30689,7 @@ function setup$430() {
30147
30689
  purpose: "what to export"
30148
30690
  }).multiOp().action(async (host, realm, user, password, options, command) => {
30149
30691
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
30150
- if (await getTokens(false, true, deploymentTypes$207)) {
30692
+ if (await getTokens(false, true, deploymentTypes$208)) {
30151
30693
  if (options.appId || options.appName) {
30152
30694
  require_Console.verboseMessage("Exporting application...");
30153
30695
  if (!await exportApplicationToFile(options.appId, options.appName, options.file, options.metadata, {
@@ -30176,10 +30718,10 @@ function setup$430() {
30176
30718
  return program;
30177
30719
  }
30178
30720
  // src/cli/app/app-import.ts
30179
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$204, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$125 } = require_dist$2.frodo.utils.constants;
30180
- const deploymentTypes$206 = [CLOUD_DEPLOYMENT_TYPE_KEY$204, FORGEOPS_DEPLOYMENT_TYPE_KEY$125];
30181
- function setup$429() {
30182
- const program = new FrodoCommand("frodo app import", [], deploymentTypes$206);
30721
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$205, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$125 } = require_dist$2.frodo.utils.constants;
30722
+ const deploymentTypes$207 = [CLOUD_DEPLOYMENT_TYPE_KEY$205, FORGEOPS_DEPLOYMENT_TYPE_KEY$125];
30723
+ function setup$430() {
30724
+ const program = new FrodoCommand("frodo app import", [], deploymentTypes$207);
30183
30725
  program.description("Import applications.").addOption(new Option("-i, --app-id <id>", "Application id. Cannot be used with -n, -a or -A.").conflicts([
30184
30726
  "appName",
30185
30727
  "all",
@@ -30231,7 +30773,7 @@ function setup$429() {
30231
30773
  program.help();
30232
30774
  return;
30233
30775
  }
30234
- if (!await getTokens(false, true, deploymentTypes$206)) {
30776
+ if (!await getTokens(false, true, deploymentTypes$207)) {
30235
30777
  process.exitCode = 1;
30236
30778
  return;
30237
30779
  }
@@ -30241,13 +30783,13 @@ function setup$429() {
30241
30783
  return program;
30242
30784
  }
30243
30785
  // src/cli/app/app-list.ts
30244
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$203, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$124 } = require_dist$2.frodo.utils.constants;
30245
- const deploymentTypes$205 = [CLOUD_DEPLOYMENT_TYPE_KEY$203, FORGEOPS_DEPLOYMENT_TYPE_KEY$124];
30246
- function setup$428() {
30247
- const program = new FrodoCommand("frodo app list", [], deploymentTypes$205);
30786
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$204, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$124 } = require_dist$2.frodo.utils.constants;
30787
+ const deploymentTypes$206 = [CLOUD_DEPLOYMENT_TYPE_KEY$204, FORGEOPS_DEPLOYMENT_TYPE_KEY$124];
30788
+ function setup$429() {
30789
+ const program = new FrodoCommand("frodo app list", [], deploymentTypes$206);
30248
30790
  program.description("List applications.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).addHelpText("after", require_Console.theme.warning(`Important Note:\n`) + ` The ${require_Console.theme.command("frodo app")} command to manage OAuth2 clients in v1.x has been renamed to ${require_Console.theme.command("frodo oauth client")} in v2.x\n The ${require_Console.theme.command("frodo app")} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${require_Console.theme.command("frodo oauth client")} command.\n\nUsage Examples:\n List applications using AM base URL, username, and password (note the quotes around password to allow special characters):\n` + require_Console.theme.command(` $ frodo app list ${amBaseUrl} ${realm} ${username} '${password}'\n`) + ` List applications using a connection profile (identified by the full AM base URL):\n` + require_Console.theme.command(` $ frodo app list ${amBaseUrl}\n`) + ` List applications using a connection profile (identified by a unique substring of the AM base URL or a saved alias):\n` + require_Console.theme.command(` $ frodo app list ${connId}\n`)).action(async (host, realm, user, password, options, command) => {
30249
30791
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
30250
- if (await getTokens(false, true, deploymentTypes$205)) {
30792
+ if (await getTokens(false, true, deploymentTypes$206)) {
30251
30793
  require_Console.verboseMessage(`Listing applications...`);
30252
30794
  if (!await listApplications(options.long)) process.exitCode = 1;
30253
30795
  } else process.exitCode = 1;
@@ -30289,53 +30831,95 @@ function countCatalog(catalog) {
30289
30831
  };
30290
30832
  }
30291
30833
  /**
30292
- * List the application templates: the ids, or with `long` a table of the
30293
- * versions. The templates of the tenant are merged over the catalog when a
30294
- * connection to the tenant was made.
30295
- * @param {CatalogSource & { long?: boolean; includeOverrides?: boolean }} options which catalog to read, whether to list all fields, and whether the tenant's templates are merged in
30834
+ * The entries of the versions listed, by the key the catalog keeps them under.
30835
+ * The catalog is read once and the entries are taken from it; an entry the
30836
+ * tenant defines itself (it replaces the catalog's) is read through the library,
30837
+ * which also finds it if the catalog has no such entry.
30838
+ * @param {TemplateVersion[]} items the versions to read
30839
+ * @param {CatalogSource} source which catalog to read
30840
+ * @param {LibraryOptions} libraryOptions the options for the library
30841
+ * @returns {Promise<Map<string, Json>>} the entries by `templateId`; a version that could not be read is missing
30842
+ */
30843
+ async function readEntries(items, source, libraryOptions) {
30844
+ const entries = /* @__PURE__ */ new Map();
30845
+ const catalog = items.some((item) => !item.isOverride) ? (await readCatalog(catalogOptionsOf(source))).catalog : void 0;
30846
+ for (const version of items) {
30847
+ const item = version.source;
30848
+ let entry = item.isOverride ? void 0 : recordOf(catalog?.AppTemplates?.[item.tier]?.[item.group ?? ""]?.[item.templateId]);
30849
+ if (!entry) entry = recordOf((await readTemplateInLibrary({
30850
+ templateName: item.name,
30851
+ templateVersion: item.templateVersion
30852
+ }, libraryOptions)).template);
30853
+ if (entry) entries.set(item.templateId, entry);
30854
+ }
30855
+ return entries;
30856
+ }
30857
+ /**
30858
+ * A right-aligned cell of a table.
30859
+ * @param {string} text the text of the cell
30860
+ * @returns {{ hAlign: 'right'; content: string }} the cell
30861
+ */
30862
+ function right(text) {
30863
+ return {
30864
+ hAlign: "right",
30865
+ content: text
30866
+ };
30867
+ }
30868
+ /**
30869
+ * List the application templates: the id of the newest version of each
30870
+ * template, or with `long` or `allVersions` (which are the same) a table with a
30871
+ * row for each: the newest version of each template, or with `allVersions` every
30872
+ * version, newest first. The templates of the tenant are merged over the
30873
+ * catalog when a connection to the tenant was made.
30874
+ * @param {CatalogSource & { long?: boolean; allVersions?: boolean; includeOverrides?: boolean }} options which catalog to read, how much to print, and whether the tenant's templates are merged in
30296
30875
  * @returns {Promise<boolean>} true if successful, false otherwise
30297
30876
  */
30298
30877
  async function listApplicationTemplates(options) {
30299
30878
  try {
30300
- const items = await listTemplates({
30879
+ const libraryOptions = {
30301
30880
  ...catalogOptionsOf(options),
30302
30881
  includeOverrides: options.includeOverrides === true
30882
+ };
30883
+ const groups = groupTemplates(await listTemplates(libraryOptions));
30884
+ if (!options.long && !options.allVersions) {
30885
+ groups.forEach((group) => require_Console.printMessage(group.name, "data"));
30886
+ return true;
30887
+ }
30888
+ const shown = groups.flatMap((group) => (options.allVersions ? group.versions : [group.newest]).map((item) => ({
30889
+ group,
30890
+ item
30891
+ })));
30892
+ const entries = await readEntries(shown.map(({ item }) => item), options, libraryOptions);
30893
+ const table = require_Console.createTable([
30894
+ "Id",
30895
+ "Ver",
30896
+ "Updated",
30897
+ "Name",
30898
+ "Category",
30899
+ "Prov"
30900
+ ]);
30901
+ const cells = shown.map(({ item }) => {
30902
+ const entry = entries.get(item.templateId) ?? {};
30903
+ return {
30904
+ entry,
30905
+ prov: provOf(entry, item.templateType)
30906
+ };
30303
30907
  });
30304
- if (options.long) {
30305
- const table = require_Console.createTable([
30306
- "Id",
30307
- "Name",
30308
- "Group",
30309
- {
30310
- hAlign: "right",
30311
- content: "Version"
30312
- },
30313
- "Type",
30314
- "Override",
30315
- "Newest",
30316
- "Updated",
30317
- "Display name"
30908
+ shown.forEach(({ group, item }, index) => {
30909
+ table.push([
30910
+ item.name,
30911
+ `${item.templateVersion}${marksOf(group, item)}`,
30912
+ isoDate(item.dateUpdated),
30913
+ displayNameOf(item),
30914
+ categoryOf(cells[index].entry),
30915
+ cells[index].prov
30318
30916
  ]);
30319
- items.forEach((item) => {
30320
- table.push([
30321
- item.templateId,
30322
- item.name,
30323
- item.group ?? "",
30324
- {
30325
- hAlign: "right",
30326
- content: item.templateVersion
30327
- },
30328
- item.templateType ?? "",
30329
- item.isOverride ? "yes" : "",
30330
- item.newestInGroup ? "yes" : "",
30331
- (item.dateUpdated ?? "").slice(0, 10),
30332
- item.displayName ?? ""
30333
- ]);
30334
- });
30335
- require_Console.printMessage(table.toString(), "data");
30336
- } else items.forEach((item) => {
30337
- require_Console.printMessage(item.templateId, "data");
30338
30917
  });
30918
+ const key = listKeyOf({
30919
+ custom: shown.some(({ item }) => item.isOverride),
30920
+ unknown: cells.some(({ prov }) => prov === "?")
30921
+ });
30922
+ require_Console.printMessage(`${table.toString()}\n\n${key}`, "data");
30339
30923
  return true;
30340
30924
  } catch (error) {
30341
30925
  printCatalogFailure(error);
@@ -30343,63 +30927,247 @@ async function listApplicationTemplates(options) {
30343
30927
  return false;
30344
30928
  }
30345
30929
  /**
30346
- * Find the version of the list whose id is the one given. Ids are not
30347
- * case-sensitive.
30348
- * @param {TemplateListItem[]} items the merged list
30349
- * @param {string} templateId the id the user gave
30350
- * @returns {TemplateListItem | undefined} the version, if there is one
30930
+ * Print a section heading after an empty line.
30931
+ * @param {string} title the heading
30932
+ */
30933
+ function printSection(title) {
30934
+ require_Console.printMessage(`\n${require_Console.theme.heading(title)}`, "data");
30935
+ }
30936
+ /**
30937
+ * Print label and value lines, leaving out the lines that have no value.
30938
+ * @param {Line[]} lines the lines
30939
+ * @param {string} indent what each line starts with
30940
+ */
30941
+ function printLines(lines, indent = " ") {
30942
+ lines.filter(([, value]) => value).forEach(([label, value]) => {
30943
+ require_Console.printMessage(`${indent}${label}: ${value}`, "data");
30944
+ });
30945
+ }
30946
+ /**
30947
+ * The fields of a configuration or a form as one line: the labels, with a star
30948
+ * after the ones that are required.
30949
+ * @param {FieldRow[]} fields the fields
30950
+ * @returns {string} the labels
30951
+ */
30952
+ function fieldLabels(fields) {
30953
+ return fields.map((field) => `${field.label}${field.required ? "*" : ""}`).join(", ");
30954
+ }
30955
+ /**
30956
+ * Print the fields of a connector configuration: one line of labels, or with
30957
+ * `long` a table with the property, the type and whether it is required.
30958
+ * @param {string} title what the fields are
30959
+ * @param {FieldRow[]} fields the fields
30960
+ * @param {boolean} long whether to print a table
30351
30961
  */
30352
- function findTemplate(items, templateId) {
30353
- const wanted = templateId.toLowerCase();
30354
- return items.find((item) => item.templateId.toLowerCase() === wanted);
30962
+ function printConfiguration(title, fields, long) {
30963
+ if (fields.length === 0) return;
30964
+ if (!long) {
30965
+ require_Console.printMessage(` ${title} (${fields.length}, * required): ${fieldLabels(fields)}`, "data");
30966
+ return;
30967
+ }
30968
+ require_Console.printMessage(` ${title} (${fields.length}):`, "data");
30969
+ const table = require_Console.createTable([
30970
+ "Label",
30971
+ "Property",
30972
+ "Type",
30973
+ "Required"
30974
+ ]);
30975
+ fields.forEach((field) => {
30976
+ table.push([
30977
+ field.label,
30978
+ field.property,
30979
+ field.type,
30980
+ field.required ? "yes" : ""
30981
+ ]);
30982
+ });
30983
+ require_Console.printMessage(table.toString(), "data");
30984
+ }
30985
+ /**
30986
+ * Print the sections of a template that follow its header: the versions, the
30987
+ * connector, the capabilities, the object types and the application form.
30988
+ * Sections the entry has no data for are left out.
30989
+ * @param {TemplateGroup} group all versions of the template
30990
+ * @param {TemplateVersion} item the version that is described
30991
+ * @param {Json} entry the entry of that version
30992
+ * @param {Map<string, Json>} entries the entries of all versions
30993
+ * @param {boolean} long whether to print the properties of the object types and the fields of the forms
30994
+ */
30995
+ function printTemplateSections(group, item, entry, entries, long) {
30996
+ if (group.versions.length > 1) {
30997
+ printSection("Versions");
30998
+ const rows = group.versions.map((version) => {
30999
+ const versionEntry = version === item ? entry : entries.get(version.templateId) ?? {};
31000
+ return {
31001
+ version,
31002
+ bundle: textOf$1(versionEntry["bundleVersion"]) ?? "",
31003
+ counts: countsOf(versionEntry)
31004
+ };
31005
+ });
31006
+ const withBundle = rows.some((row) => row.bundle);
31007
+ const withObjectTypes = rows.some((row) => row.counts.objectTypes > 0);
31008
+ const table = require_Console.createTable([
31009
+ "Version",
31010
+ "Updated",
31011
+ ...withBundle ? ["Connector bundle"] : [],
31012
+ ...withObjectTypes ? [right("Object types"), right("Properties")] : [],
31013
+ "Note"
31014
+ ]);
31015
+ rows.forEach(({ version, bundle, counts }) => {
31016
+ table.push([
31017
+ `${version.templateVersion}${marksOf(group, version)}`,
31018
+ isoDate(version.dateUpdated),
31019
+ ...withBundle ? [bundle] : [],
31020
+ ...withObjectTypes ? [right(counts.objectTypes ? String(counts.objectTypes) : ""), right(counts.properties ? String(counts.properties) : "")] : [],
31021
+ version === item ? "shown" : ""
31022
+ ]);
31023
+ });
31024
+ const key = versionsKeyOf({
31025
+ newest: rows.some(({ version }) => marksOf(group, version).includes("*")),
31026
+ custom: rows.some(({ version }) => version.isOverride)
31027
+ });
31028
+ require_Console.printMessage(key ? `${table.toString()}\n\n${key}` : table.toString(), "data");
31029
+ }
31030
+ const connector = connectorSummaryOf(entry);
31031
+ if (connector) {
31032
+ printSection("Connector");
31033
+ printLines([
31034
+ ["Name", connector.name],
31035
+ ["Class", connector.className],
31036
+ ["Bundle", [connector.bundleName, connector.bundleRange].filter(Boolean).join(" ")],
31037
+ ["Template version", connector.templateVersion],
31038
+ ["Paging", connector.pagingType],
31039
+ ["Type", connector.connectorType],
31040
+ ["Needs a remote connector server (RCS)", connector.rcsOnly ? "yes" : ""],
31041
+ ["Prerequisites", connector.prerequisites]
31042
+ ]);
31043
+ printConfiguration("Basic configuration", connector.basic, long);
31044
+ printConfiguration("Advanced configuration", connector.advanced, long);
31045
+ }
31046
+ const capabilities = capabilitiesOf(entry);
31047
+ const capabilityLines = [
31048
+ ["Provisioning", capabilities.provisioning ? capabilities.provisioning.join(", ") || "none" : ""],
31049
+ ["SSO", capabilities.sso.join(", ")],
31050
+ ["SSO setup", capabilities.ssoSetup.join(", ")],
31051
+ ["Incremental reconciliation", capabilities.incrementalRecon],
31052
+ ["Target", capabilities.target ? "yes" : ""],
31053
+ ["Needs an OAuth flow", capabilities.requiresOauthFlow ? "yes" : ""],
31054
+ ["Client types", capabilities.clients.join(", ")]
31055
+ ];
31056
+ if (capabilityLines.some(([, value]) => value)) {
31057
+ printSection("Capabilities");
31058
+ printLines(capabilityLines);
31059
+ }
31060
+ const objectTypes = objectTypesOf(entry);
31061
+ if (objectTypes.length > 0) {
31062
+ printSection("Object types");
31063
+ const table = require_Console.createTable([
31064
+ "Name",
31065
+ "Native type",
31066
+ "Managed resource",
31067
+ right("Properties"),
31068
+ right("Required")
31069
+ ]);
31070
+ objectTypes.forEach((objectType) => {
31071
+ table.push([
31072
+ objectType.name,
31073
+ objectType.nativeType,
31074
+ objectType.managedResource,
31075
+ right(String(objectType.properties.length)),
31076
+ right(String(objectType.required))
31077
+ ]);
31078
+ });
31079
+ require_Console.printMessage(table.toString(), "data");
31080
+ if (long) objectTypes.forEach((objectType) => {
31081
+ if (objectType.properties.length === 0) return;
31082
+ printSection(`Properties of ${objectType.name || objectType.nativeType}`);
31083
+ const withNative = objectType.properties.some((property) => property.nativeName !== property.name);
31084
+ const properties = require_Console.createTable([
31085
+ "Name",
31086
+ ...withNative ? ["Native name"] : [],
31087
+ "Type",
31088
+ "Flags"
31089
+ ]);
31090
+ objectType.properties.forEach((property) => {
31091
+ properties.push([
31092
+ property.name,
31093
+ ...withNative ? [property.nativeName] : [],
31094
+ property.type,
31095
+ property.flags.join(", ")
31096
+ ]);
31097
+ });
31098
+ require_Console.printMessage(properties.toString(), "data");
31099
+ });
31100
+ }
31101
+ const sections = formSectionsOf(entry);
31102
+ if (sections.length > 0) {
31103
+ printSection("Application form");
31104
+ sections.forEach((section) => {
31105
+ const noun = section.kind === "fields" ? "field" : "default value";
31106
+ const count = `${section.names.length} ${noun}${section.names.length === 1 ? "" : "s"}`;
31107
+ require_Console.printMessage(` ${section.section}: ${count}${long && section.names.length > 0 ? `: ${section.names.join(", ")}` : ""}`, "data");
31108
+ });
31109
+ }
30355
31110
  }
30356
31111
  /**
30357
- * Describe an application template: a summary of the version, or with `json`
30358
- * the whole template (the form definition and the connector defaults).
30359
- * @param {string} templateId the id of the version, for example `3_3-azure-ad`
30360
- * @param {CatalogSource & { json?: boolean; includeOverrides?: boolean }} options which catalog to read, whether to print the whole template, and whether the tenant's templates are merged in
31112
+ * Whether the catalog (not the templates of the tenant) has a version under the
31113
+ * key of this one: a version that the tenant defines itself replaces the
31114
+ * catalog's version of the same id and version, or has no counterpart.
31115
+ * @param {TemplateVersion} item the version, a custom one
31116
+ * @param {CatalogSource} source which catalog to read
31117
+ * @returns {Promise<boolean>} true if the catalog has the version
31118
+ */
31119
+ async function catalogHasVersion(item, source) {
31120
+ const { catalog } = await readCatalog(catalogOptionsOf(source));
31121
+ return Object.values(catalog.AppTemplates ?? {}).some((tier) => Object.values(tier ?? {}).some((group) => recordOf(group) !== void 0 && Object.prototype.hasOwnProperty.call(group, item.source.templateId)));
31122
+ }
31123
+ /**
31124
+ * Describe an application template: a summary of the version (the newest
31125
+ * unless a version is named), its other versions, its connector, capabilities,
31126
+ * object types and application form, or with `json` the whole entry.
31127
+ * @param {TemplateSelector} selector the template (`-i` id or `-n` display name) and the version (`-v`)
31128
+ * @param {CatalogSource & { json?: boolean; long?: boolean; includeOverrides?: boolean }} options which catalog to read, how much to print, and whether the tenant's templates are merged in
30361
31129
  * @returns {Promise<boolean>} true if successful, false otherwise
30362
31130
  */
30363
- async function describeApplicationTemplate(templateId, options) {
31131
+ async function describeApplicationTemplate(selector, options) {
30364
31132
  try {
30365
31133
  const libraryOptions = {
30366
31134
  ...catalogOptionsOf(options),
30367
31135
  includeOverrides: options.includeOverrides === true
30368
31136
  };
30369
- const item = findTemplate(await listTemplates(libraryOptions), templateId);
30370
- if (!item) {
30371
- require_Console.printMessage(`Application template ${templateId} not found.`, "error");
31137
+ const selection = selectTemplate(groupTemplates(await listTemplates(libraryOptions)), selector);
31138
+ if ("error" in selection) {
31139
+ require_Console.printMessage(selection.error, "error");
30372
31140
  return false;
30373
31141
  }
31142
+ const { group, item } = selection;
30374
31143
  const template = (await readTemplateInLibrary({
30375
- templateName: item.name,
30376
- templateVersion: item.templateVersion
31144
+ templateName: item.source.name,
31145
+ templateVersion: item.source.templateVersion
30377
31146
  }, libraryOptions)).template;
30378
31147
  if (!template) {
30379
- require_Console.printMessage(`Application template ${item.templateId} could not be read.`, "error");
31148
+ require_Console.printMessage(`Application template ${item.name} ${item.templateVersion} could not be read.`, "error");
30380
31149
  return false;
30381
31150
  }
30382
31151
  if (options.json) {
30383
31152
  require_Console.printMessage(JSON.stringify(template, null, 2), "data");
30384
31153
  return true;
30385
31154
  }
30386
- const description = template["description"];
30387
- const supportUrl = template["supportUrl"];
30388
- [
30389
- ["Id", item.templateId],
30390
- ["Name", item.name],
30391
- ["Display name", item.displayName],
31155
+ const entry = recordOf(template) ?? {};
31156
+ const description = textOf$1(entry["description"]);
31157
+ const supportUrl = textOf$1(entry["supportUrl"]);
31158
+ printLines([
31159
+ ["Id", group.name],
31160
+ ["Display name", displayNameOf(item)],
30392
31161
  ["Group", item.group ? `${item.group} (${item.tier})` : `(none, ${item.tier})`],
30393
- ["Version", item.templateVersion],
30394
- ["Newest version", item.newestInGroup ? "yes" : "no"],
30395
- ["Type", item.templateType],
30396
- ["Updated", item.dateUpdated],
30397
- ["Defined by the tenant", item.isOverride ? "yes" : "no"],
30398
- ["Description", typeof description === "string" ? description : ""],
30399
- ["Support URL", typeof supportUrl === "string" ? supportUrl : ""]
30400
- ].filter(([, value]) => value).forEach(([label, value]) => {
30401
- require_Console.printMessage(`${label}: ${value}`, "data");
30402
- });
31162
+ ["Category", categoryOf(entry)],
31163
+ ["Provides", providesOf(entry)],
31164
+ ["Version", item.newestInGroup ? `${item.templateVersion} (newest)` : `${item.templateVersion} (the newest is ${group.newest.templateVersion})`],
31165
+ ["Updated", isoDate(item.dateUpdated)],
31166
+ ["Custom", item.isOverride ? `yes, ${await catalogHasVersion(item, options) ? `replaces the catalog version ${item.templateVersion}` : "no catalog counterpart"}` : ""],
31167
+ ["Description", description],
31168
+ ["Support URL", supportUrl]
31169
+ ], "");
31170
+ printTemplateSections(group, item, entry, await readEntries(group.versions.filter((version) => version !== item), options, libraryOptions), options.long === true);
30403
31171
  return true;
30404
31172
  } catch (error) {
30405
31173
  printCatalogFailure(error);
@@ -30482,36 +31250,39 @@ function channelOption() {
30482
31250
  return new Option("--channel <channel>", "Which catalog of the CDN to read: production or development (the development catalog holds a few more template versions). Default: production. Cannot be used with --templates.").choices(["production", "development"]).conflicts(["templates"]);
30483
31251
  }
30484
31252
  // src/cli/app/app-template-describe.ts
30485
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$202, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$123 } = require_dist$2.frodo.utils.constants;
30486
- const deploymentTypes$204 = [CLOUD_DEPLOYMENT_TYPE_KEY$202, FORGEOPS_DEPLOYMENT_TYPE_KEY$123];
30487
- function setup$427() {
30488
- const program = new FrodoCommand("frodo app template describe", [], deploymentTypes$204);
30489
- program.description("Describe an application template.").addOption(new Option("-i, --template-id <template-id>", "Template id: the id of one version of a template, as \"frodo app template list\" prints it (for example 1_2-saml). Ids are not case-sensitive.").makeOptionMandatory()).addOption(new Option("--json", "Output the whole template (the form definition and the connector defaults) in JSON format.")).addOption(templatesOption()).addOption(channelOption()).skipConnectionPromptsWhen((command) => !positionalValue(command, "host") && !require_dist$2.state.getHost()).addHelpText("after", `Without a tenant the command reads the catalog alone and needs no login. With a tenant it also finds the templates the tenant defines itself.
31253
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$203, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$123 } = require_dist$2.frodo.utils.constants;
31254
+ const deploymentTypes$205 = [CLOUD_DEPLOYMENT_TYPE_KEY$203, FORGEOPS_DEPLOYMENT_TYPE_KEY$123];
31255
+ function setup$428() {
31256
+ const program = new FrodoCommand("frodo app template describe", [], deploymentTypes$205);
31257
+ program.description("Describe an application template: what it provides, its versions, connector, capabilities, object types and application form. The newest version unless -v names another.").addOption(new Option("-i, --template-id <template-id>", "Template id: the id of the template, as \"frodo app template list\" prints it (for example azure.ad). Dots and hyphens are the same, and the case does not matter. Cannot be used with -n.").conflicts(["templateName"])).addOption(new Option("-n, --template-name <template-name>", "Display name of the template (for example \"Microsoft Entra\"), as \"frodo app template list --long\" prints it. The case does not matter. Cannot be used with -i.").conflicts(["templateId"])).addOption(new Option("-v, --template-version <version>", "The version to describe (for example 3.1). Default: the newest version. The versions of a template are listed in its description.")).addOption(new Option("-l, --long", "Long: also the properties of each object type and the fields of the connector configuration and of the application form.").default(false, "false")).addOption(new Option("--json", "Output the whole template (the form definition and the connector defaults) in JSON format.")).addOption(templatesOption()).addOption(channelOption()).requireOneOf({
31258
+ options: ["templateId", "templateName"],
31259
+ purpose: "which template to describe"
31260
+ }).skipConnectionPromptsWhen((command) => !positionalValue(command, "host") && !require_dist$2.state.getHost()).addHelpText("after", `Without a tenant the command reads the catalog alone and needs no login. With a tenant it also finds the templates the tenant defines itself. A template has several versions; the description of the newest lists the others, and -v describes one of them.
30490
31261
 
30491
31262
  Usage Examples:
30492
- Describe the template '${appTemplateId}' of the catalog, without a tenant:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId}\n`) + ` Print the whole template in JSON format:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} --json\n`) + ` Describe a template of a tenant, using AM base URL, realm, username and password:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} ${amBaseUrl} ${realm} ${username} '${password}'\n`) + ` Describe a template of a tenant using a connection profile:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} ${connId}\n`) + ` Describe it from a file that was saved on another machine:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} --templates ${appTemplatesFile}\n`)).action(async (host, realm, user, password, options, command) => {
31263
+ Describe the newest version of the template '${appTemplateId}' of the catalog, without a tenant:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId}\n`) + ` Describe another version of it:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} -v 3.1\n`) + ` Name the template by its display name:\n` + require_Console.theme.command(` $ frodo app template describe -n "${appTemplateName}"\n`) + ` Add the properties of the object types and the fields of the forms:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} --long\n`) + ` Print the whole template in JSON format:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} --json\n`) + ` Describe a template of a tenant, using AM base URL, realm, username and password:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} ${amBaseUrl} ${realm} ${username} '${password}'\n`) + ` Describe a template of a tenant using a connection profile:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} ${connId}\n`) + ` Describe it from a file that was saved on another machine:\n` + require_Console.theme.command(` $ frodo app template describe -i ${appTemplateId} --templates ${appTemplatesFile}\n`)).action(async (host, realm, user, password, options, command) => {
30493
31264
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
30494
31265
  const withTenant = !!require_dist$2.state.getHost();
30495
- if (withTenant && !await getTokens(false, true, deploymentTypes$204)) {
31266
+ if (withTenant && !await getTokens(false, true, deploymentTypes$205)) {
30496
31267
  process.exitCode = 1;
30497
31268
  return;
30498
31269
  }
30499
- if (!options.templateId) {
30500
- require_Console.printMessage(`Error: -i, --template-id is required. "frodo app template list" prints the ids.`, "error");
30501
- process.exitCode = 1;
30502
- return;
30503
- }
30504
- if (!await describeApplicationTemplate(options.templateId, {
31270
+ if (!await describeApplicationTemplate({
31271
+ id: options.templateId,
31272
+ name: options.templateName,
31273
+ version: options.templateVersion
31274
+ }, {
30505
31275
  templates: options.templates,
30506
31276
  channel: options.channel,
30507
31277
  json: options.json,
31278
+ long: options.long,
30508
31279
  includeOverrides: withTenant
30509
31280
  })) process.exitCode = 1;
30510
31281
  });
30511
31282
  return program;
30512
31283
  }
30513
31284
  // src/cli/app/app-template-download.ts
30514
- function setup$426() {
31285
+ function setup$427() {
30515
31286
  const program = new FrodoCommand("frodo app template download", [
30516
31287
  "host",
30517
31288
  "realm",
@@ -30530,14 +31301,14 @@ Usage Examples:
30530
31301
  return program;
30531
31302
  }
30532
31303
  // src/cli/app/app-template-list.ts
30533
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$201, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$122 } = require_dist$2.frodo.utils.constants;
30534
- const deploymentTypes$203 = [CLOUD_DEPLOYMENT_TYPE_KEY$201, FORGEOPS_DEPLOYMENT_TYPE_KEY$122];
30535
- function setup$425() {
30536
- const program = new FrodoCommand("frodo app template list", [], deploymentTypes$203);
30537
- program.description("List application templates: the catalog of the Admin UI, with the templates of the tenant merged over it when a tenant is given.").addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).addOption(templatesOption()).addOption(channelOption()).skipConnectionPromptsWhen((command) => !positionalValue(command, "host") && !require_dist$2.state.getHost()).addHelpText("after", "Without a tenant the command lists the catalog alone and needs no login. With a tenant (AM base URL, connection profile or alias) it logs in and merges the templates the tenant defines itself, marked as overrides.\n\nUsage Examples:\n List the ids of the templates of the catalog, without a tenant:\n" + require_Console.theme.command(` $ frodo app template list\n`) + ` List them with all fields:\n` + require_Console.theme.command(` $ frodo app template list --long\n`) + ` List the catalog and the templates of a tenant, using AM base URL, realm, username and password:\n` + require_Console.theme.command(` $ frodo app template list --long ${amBaseUrl} ${realm} ${username} '${password}'\n`) + ` List the catalog and the templates of a tenant using a connection profile:\n` + require_Console.theme.command(` $ frodo app template list --long ${connId}\n`) + ` List the catalog from a file that was saved on another machine:\n` + require_Console.theme.command(` $ frodo app template list --long --templates ${appTemplatesFile}\n`)).action(async (host, realm, user, password, options, command) => {
31304
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$202, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$122 } = require_dist$2.frodo.utils.constants;
31305
+ const deploymentTypes$204 = [CLOUD_DEPLOYMENT_TYPE_KEY$202, FORGEOPS_DEPLOYMENT_TYPE_KEY$122];
31306
+ function setup$426() {
31307
+ const program = new FrodoCommand("frodo app template list", [], deploymentTypes$204);
31308
+ program.description("List application templates, one per template with its newest version: the catalog of the Admin UI, with the templates of the tenant merged over it when a tenant is given.").addOption(new Option("-l, --long", "Long: a table instead of the ids, with a row for each template: the id, its newest version, the date of that version, the name, the category and what the template provides (letters that are explained below the table). A star behind a version means that it is the newest of a template that has older versions, a plus that it is a custom version, defined in the tenant.").default(false, "false")).addOption(new Option("--all-versions", "The table with a row for every version of every template, newest first, not only for the newest version of each (it implies --long, so --all-versions and --long --all-versions are the same).").default(false, "false")).addOption(templatesOption()).addOption(channelOption()).skipConnectionPromptsWhen((command) => !positionalValue(command, "host") && !require_dist$2.state.getHost()).addHelpText("after", "Without a tenant the command lists the catalog alone and needs no login. With a tenant (AM base URL, connection profile or alias) it logs in and merges the templates the tenant defines itself, marked with a plus (custom versions). \"frodo app template describe -i\" takes an id as printed here and describes the newest version of the template, or the one that -v names.\n\nUsage Examples:\n List the ids of the templates of the catalog, without a tenant:\n" + require_Console.theme.command(` $ frodo app template list\n`) + ` List them in a table, with the newest version, its date, the name, the category and what they provide:\n` + require_Console.theme.command(` $ frodo app template list --long\n`) + ` List every version of every template, newest first:\n` + require_Console.theme.command(` $ frodo app template list --all-versions\n`) + ` List the catalog and the templates of a tenant, using AM base URL, realm, username and password:\n` + require_Console.theme.command(` $ frodo app template list --long ${amBaseUrl} ${realm} ${username} '${password}'\n`) + ` List the catalog and the templates of a tenant using a connection profile:\n` + require_Console.theme.command(` $ frodo app template list --long ${connId}\n`) + ` List the catalog from a file that was saved on another machine:\n` + require_Console.theme.command(` $ frodo app template list --long --templates ${appTemplatesFile}\n`)).action(async (host, realm, user, password, options, command) => {
30538
31309
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
30539
31310
  const withTenant = !!require_dist$2.state.getHost();
30540
- if (withTenant && !await getTokens(false, true, deploymentTypes$203)) {
31311
+ if (withTenant && !await getTokens(false, true, deploymentTypes$204)) {
30541
31312
  process.exitCode = 1;
30542
31313
  return;
30543
31314
  }
@@ -30546,30 +31317,31 @@ function setup$425() {
30546
31317
  templates: options.templates,
30547
31318
  channel: options.channel,
30548
31319
  long: options.long,
31320
+ allVersions: options.allVersions,
30549
31321
  includeOverrides: withTenant
30550
31322
  })) process.exitCode = 1;
30551
31323
  });
30552
31324
  return program;
30553
31325
  }
30554
31326
  // src/cli/app/app-template.ts
30555
- function setup$424() {
31327
+ function setup$425() {
30556
31328
  const program = new FrodoStubCommand("frodo app template");
30557
31329
  program.description("List, describe and download the application templates that the Admin UI offers for new applications.");
30558
- program.addCommand(setup$425().name("list"));
30559
- program.addCommand(setup$427().name("describe"));
30560
- program.addCommand(setup$426().name("download"));
31330
+ program.addCommand(setup$426().name("list"));
31331
+ program.addCommand(setup$428().name("describe"));
31332
+ program.addCommand(setup$427().name("download"));
30561
31333
  return program;
30562
31334
  }
30563
31335
  // src/cli/app/app.ts
30564
- function setup$423() {
31336
+ function setup$424() {
30565
31337
  const program = new FrodoStubCommand("app").description("Manage applications.").addHelpText("after", require_Console.theme.warning(`\nImportant Note:\n`) + ` The ${require_Console.theme.command("frodo app")} command to manage OAuth2 clients in v1.x has been renamed to ${require_Console.theme.command("frodo oauth client")} in v2.x\n The ${require_Console.theme.command("frodo app")} command in v2.x manages the new applications created using the new application templates in ForgeRock Identity Cloud. To manage oauth clients, use the ${require_Console.theme.command("frodo oauth client")} command.\n\n`);
30566
- program.addCommand(setup$428().name("list"));
30567
- program.addCommand(setup$430().name("export"));
30568
- program.addCommand(setup$429().name("import"));
30569
- program.addCommand(setup$433().name("delete"));
30570
- program.addCommand(setup$431().name("enable"));
30571
- program.addCommand(setup$432().name("disable"));
30572
- program.addCommand(setup$424().name("template"));
31338
+ program.addCommand(setup$429().name("list"));
31339
+ program.addCommand(setup$431().name("export"));
31340
+ program.addCommand(setup$430().name("import"));
31341
+ program.addCommand(setup$434().name("delete"));
31342
+ program.addCommand(setup$432().name("enable"));
31343
+ program.addCommand(setup$433().name("disable"));
31344
+ program.addCommand(setup$425().name("template"));
30573
31345
  return program;
30574
31346
  }
30575
31347
  // src/ops/AuthenticationSettingsOps.ts
@@ -30650,7 +31422,7 @@ async function describeAuthenticationSettings(json = false, global = false) {
30650
31422
  // src/cli/authn/authn-describe.ts
30651
31423
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$20, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$121 } = require_dist$2.frodo.utils.constants;
30652
31424
  const globalDeploymentTypes$13 = [CLASSIC_DEPLOYMENT_TYPE_KEY$20, FORGEOPS_DEPLOYMENT_TYPE_KEY$121];
30653
- function setup$422() {
31425
+ function setup$423() {
30654
31426
  const program = new FrodoCommand("frodo authn describe");
30655
31427
  program.description("Describe authentication settings.").addOption(new Option("--json", "Output in JSON format.")).addOption(new Option("-g, --global", "Describe global authentication settings.")).action(async (host, realm, user, password, options, command) => {
30656
31428
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -30664,7 +31436,7 @@ function setup$422() {
30664
31436
  // src/cli/authn/authn-export.ts
30665
31437
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$19, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$120 } = require_dist$2.frodo.utils.constants;
30666
31438
  const globalDeploymentTypes$12 = [CLASSIC_DEPLOYMENT_TYPE_KEY$19, FORGEOPS_DEPLOYMENT_TYPE_KEY$120];
30667
- function setup$421() {
31439
+ function setup$422() {
30668
31440
  const program = new FrodoCommand("frodo authn export");
30669
31441
  program.description("Export authentication settings.").addOption(new Option("-f, --file <file>", "Name of the export file.")).addOption(new Option("-N, --no-metadata", "Does not include metadata in the export file.")).addOption(new Option("-g, --global", "Export global authentication settings.")).action(async (host, realm, user, password, options, command) => {
30670
31442
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -30678,7 +31450,7 @@ function setup$421() {
30678
31450
  // src/cli/authn/authn-import.ts
30679
31451
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$18, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$119 } = require_dist$2.frodo.utils.constants;
30680
31452
  const globalDeploymentTypes$11 = [CLASSIC_DEPLOYMENT_TYPE_KEY$18, FORGEOPS_DEPLOYMENT_TYPE_KEY$119];
30681
- function setup$420() {
31453
+ function setup$421() {
30682
31454
  const program = new FrodoCommand("frodo authn import");
30683
31455
  program.description("Import authentication settings.").addOption(new Option("-f, --file <file>", "Name of the file to import.")).addOption(new Option("-g, --global", "Export global authentication settings.")).action(async (host, realm, user, password, options, command) => {
30684
31456
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -30690,11 +31462,11 @@ function setup$420() {
30690
31462
  return program;
30691
31463
  }
30692
31464
  // src/cli/authn/authn.ts
30693
- function setup$419() {
31465
+ function setup$420() {
30694
31466
  const program = new FrodoStubCommand("authn").description("Manage authentication settings.");
30695
- program.addCommand(setup$422().name("describe"));
30696
- program.addCommand(setup$421().name("export"));
30697
- program.addCommand(setup$420().name("import"));
31467
+ program.addCommand(setup$423().name("describe"));
31468
+ program.addCommand(setup$422().name("export"));
31469
+ program.addCommand(setup$421().name("import"));
30698
31470
  return program;
30699
31471
  }
30700
31472
  // src/ops/PolicyOps.ts
@@ -31234,7 +32006,7 @@ async function importPoliciesFromFiles(options = {
31234
32006
  return false;
31235
32007
  }
31236
32008
  // src/cli/authz/authz-policy-delete.ts
31237
- function setup$418() {
32009
+ function setup$419() {
31238
32010
  const program = new FrodoCommand("frodo authz policy delete");
31239
32011
  program.description("Delete authorization policies.").addOption(new Option("-i, --policy-id <policy-id>", "Policy id/name. Cannot be used with --set-id or -a.").conflicts(["setId", "all"])).addOption(new Option("-a, --all", "Delete all policies in a realm, or with --set-id all policies in a policy set. Cannot be used with -i.").conflicts(["policyId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all policies (of a policy set). Required with -a when there is no terminal.")).addOption(new Option("--set-id <set-id>", "Policy set id/name: delete only the policies of this policy set. Only with -a. Cannot be used with -i.").conflicts(["policyId"])).requireOneOf({
31240
32012
  options: ["all", "policyId"],
@@ -31280,7 +32052,7 @@ function setup$418() {
31280
32052
  return program;
31281
32053
  }
31282
32054
  // src/cli/authz/authz-policy-describe.ts
31283
- function setup$417() {
32055
+ function setup$418() {
31284
32056
  const program = new FrodoCommand("frodo authz policy describe");
31285
32057
  program.description("Describe authorization policies.").addOption(new Option("-i, --policy-id <policy-id>", "Policy id/name.").makeOptionMandatory()).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
31286
32058
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -31292,7 +32064,7 @@ function setup$417() {
31292
32064
  return program;
31293
32065
  }
31294
32066
  // src/cli/authz/authz-policy-export.ts
31295
- function setup$416() {
32067
+ function setup$417() {
31296
32068
  const program = new FrodoCommand("frodo authz policy export");
31297
32069
  program.description("Export authorization policies.").addOption(new Option("-i, --policy-id <policy-id>", "Policy id. Cannot be used with --set-id, -a or -A.").conflicts([
31298
32070
  "setId",
@@ -31356,7 +32128,7 @@ function setup$416() {
31356
32128
  return program;
31357
32129
  }
31358
32130
  // src/cli/authz/authz-policy-import.ts
31359
- function setup$415() {
32131
+ function setup$416() {
31360
32132
  const program = new FrodoCommand("frodo authz policy import");
31361
32133
  program.description("Import authorization policies.").addOption(new Option("-i, --policy-id <policy-id>", "Policy id. If specified, only one policy is imported. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("--set-id <set-id>", "Import policies into this policy set.")).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all policies from single file. Cannot be used with -i or -A.").conflicts(["policyId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all policies from separate files (*.policy.authz.json or *.policy.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
31362
32134
  "policyId",
@@ -31405,7 +32177,7 @@ function setup$415() {
31405
32177
  return program;
31406
32178
  }
31407
32179
  // src/cli/authz/authz-policy-list.ts
31408
- function setup$414() {
32180
+ function setup$415() {
31409
32181
  const program = new FrodoCommand("frodo authz policy list");
31410
32182
  program.description("List authorization policies.").addOption(new Option("--set-id <set-id>", "Policy set id/name.")).addOption(new Option("-l, --long", "Long with all fields.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
31411
32183
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -31420,14 +32192,14 @@ function setup$414() {
31420
32192
  return program;
31421
32193
  }
31422
32194
  // src/cli/authz/authz-policy.ts
31423
- function setup$413() {
32195
+ function setup$414() {
31424
32196
  const program = new FrodoStubCommand("frodo authz policy");
31425
32197
  program.description("Manages authorization policies.");
31426
- program.addCommand(setup$418().name("delete"));
31427
- program.addCommand(setup$417().name("describe"));
31428
- program.addCommand(setup$416().name("export"));
31429
- program.addCommand(setup$415().name("import"));
31430
- program.addCommand(setup$414().name("list"));
32198
+ program.addCommand(setup$419().name("delete"));
32199
+ program.addCommand(setup$418().name("describe"));
32200
+ program.addCommand(setup$417().name("export"));
32201
+ program.addCommand(setup$416().name("import"));
32202
+ program.addCommand(setup$415().name("list"));
31431
32203
  return program;
31432
32204
  }
31433
32205
  // src/ops/PolicySetOps.ts
@@ -31833,7 +32605,7 @@ async function importPolicySetsFromFiles(options = {
31833
32605
  return false;
31834
32606
  }
31835
32607
  // src/cli/authz/authz-set-delete.ts
31836
- function setup$412() {
32608
+ function setup$413() {
31837
32609
  const program = new FrodoCommand("frodo authz set delete");
31838
32610
  program.description("Delete authorization policy sets.").addOption(new Option("-i, --set-id <set-id>", "Policy set id/name. Cannot be used with -a.").conflicts(["all"])).addOption(new Option("-a, --all", "Delete all policy sets in a realm. Cannot be used with -i.").conflicts(["setId"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all policy sets. Required with -a when there is no terminal.")).requireOneOf({
31839
32611
  options: ["all", "setId"],
@@ -31868,7 +32640,7 @@ function setup$412() {
31868
32640
  return program;
31869
32641
  }
31870
32642
  // src/cli/authz/authz-set-describe.ts
31871
- function setup$411() {
32643
+ function setup$412() {
31872
32644
  const program = new FrodoCommand("frodo authz set describe");
31873
32645
  program.description("Describe authorization policy sets.").addOption(new Option("-i, --set-id <set-id>", "Policy set id/name.").makeOptionMandatory()).addOption(new Option("--json", "Output in JSON format.")).action(async (host, realm, user, password, options, command) => {
31874
32646
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -31880,7 +32652,7 @@ function setup$411() {
31880
32652
  return program;
31881
32653
  }
31882
32654
  // src/cli/authz/authz-set-export.ts
31883
- function setup$410() {
32655
+ function setup$411() {
31884
32656
  const program = new FrodoCommand("frodo authz set export");
31885
32657
  program.description("Export authorization policy sets.").addOption(new Option("-i, --set-id <set-id>", "Policy set id/name. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the export file. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Export all applications/policy sets to a single file. Cannot be used with -i or -A.").conflicts(["setId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Export all applications/policy sets to separate files (*.authz.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
31886
32658
  "setId",
@@ -31922,7 +32694,7 @@ function setup$410() {
31922
32694
  return program;
31923
32695
  }
31924
32696
  // src/cli/authz/authz-set-import.ts
31925
- function setup$409() {
32697
+ function setup$410() {
31926
32698
  const program = new FrodoCommand("frodo authz set import");
31927
32699
  program.description("Import authorization policy sets.").addOption(new Option("-i, --set-id <set-id>", "Policy set id/name. Cannot be used with -a or -A.").conflicts(["all", "allSeparate"])).addOption(new Option("-f, --file <file>", "Name of the file to import. Cannot be used with -A.").conflicts(["allSeparate"])).addOption(new Option("-a, --all", "Import all policy sets from single file. Cannot be used with -i or -A.").conflicts(["setId", "allSeparate"])).addOption(new Option("-A, --all-separate", "Import all policy sets from separate files (*.policyset.authz.json or *.policyset.json) in the current directory. Cannot be used with -i, -f or -a.").conflicts([
31928
32700
  "setId",
@@ -31967,7 +32739,7 @@ function setup$409() {
31967
32739
  return program;
31968
32740
  }
31969
32741
  // src/cli/authz/authz-set-list.ts
31970
- function setup$408() {
32742
+ function setup$409() {
31971
32743
  const program = new FrodoCommand("frodo authz set list");
31972
32744
  program.description("List authorization policy sets.").action(async (host, realm, user, password, options, command) => {
31973
32745
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -31979,14 +32751,14 @@ function setup$408() {
31979
32751
  return program;
31980
32752
  }
31981
32753
  // src/cli/authz/authz-set.ts
31982
- function setup$407() {
32754
+ function setup$408() {
31983
32755
  const program = new FrodoStubCommand("frodo authz set");
31984
32756
  program.description("Manage authorization policy sets.");
31985
- program.addCommand(setup$412().name("delete"));
31986
- program.addCommand(setup$411().name("describe"));
31987
- program.addCommand(setup$410().name("export"));
31988
- program.addCommand(setup$409().name("import"));
31989
- program.addCommand(setup$408().name("list"));
32757
+ program.addCommand(setup$413().name("delete"));
32758
+ program.addCommand(setup$412().name("describe"));
32759
+ program.addCommand(setup$411().name("export"));
32760
+ program.addCommand(setup$410().name("import"));
32761
+ program.addCommand(setup$409().name("list"));
31990
32762
  return program;
31991
32763
  }
31992
32764
  // src/ops/ResourceTypeOps.ts
@@ -32433,7 +33205,7 @@ async function importResourceTypesFromFiles(allowFailures = false) {
32433
33205
  return false;
32434
33206
  }
32435
33207
  // src/cli/authz/authz-type-delete.ts
32436
- function setup$406() {
33208
+ function setup$407() {
32437
33209
  const program = new FrodoCommand("frodo authz type delete");
32438
33210
  program.description("Delete authorization resource types.").addOption(new Option("-i, --type-id <type-id>", "Variable id. Cannot be used with -n or -a.").conflicts(["typeName", "all"])).addOption(new Option("-n, --type-name <type-name>", "Resource type name. Cannot be used with -i or -a.").conflicts(["typeId", "all"])).addOption(new Option("-a, --all", "Delete all resource types in a realm. Cannot be used with -i or -n.").conflicts(["typeId", "typeName"])).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting all resource types. Required with -a when there is no terminal.")).requireOneOf({
32439
33211
  options: [
@@ -32475,7 +33247,7 @@ function setup$406() {
32475
33247
  return program;
32476
33248
  }
32477
33249
  // src/cli/authz/authz-type-describe.ts
32478
- function setup$405() {
33250
+ function setup$406() {
32479
33251
  const program = new FrodoCommand("frodo authz type describe");
32480
33252
  program.description("Describe authorization resource types.").addOption(new Option("-i, --type-id <type-uuid>", "Resource type uuid. Cannot be used with -n.").conflicts(["typeName"])).addOption(new Option("-n, --type-name <type-name>", "Resource type name. Cannot be used with -i.").conflicts(["typeId"])).addOption(new Option("--json", "Output in JSON format.")).requireOneOf({
32481
33253
  options: ["typeId", "typeName"],
@@ -32494,7 +33266,7 @@ function setup$405() {
32494
33266
  return program;
32495
33267
  }
32496
33268
  // src/cli/authz/authz-type-export.ts
32497
- function setup$404() {
33269
+ function setup$405() {
32498
33270
  const program = new FrodoCommand("frodo authz type export");
32499
33271
  program.description("Export authorization resource types.").addOption(new Option("-i, --type-id <type-uuid>", "Resource type uuid. Cannot be used with -n, -a or -A.").conflicts([
32500
33272
  "typeName",
@@ -32541,7 +33313,7 @@ function setup$404() {
32541
33313
  return program;
32542
33314
  }
32543
33315
  // src/cli/authz/authz-type-import.ts
32544
- function setup$403() {
33316
+ function setup$404() {
32545
33317
  const program = new FrodoCommand("frodo authz type import");
32546
33318
  program.description("Import authorization resource types.").addOption(new Option("-i, --type-id <type-uuid>", "Resource type uuid. Cannot be used with -n, -a or -A.").conflicts([
32547
33319
  "typeName",
@@ -32591,7 +33363,7 @@ function setup$403() {
32591
33363
  return program;
32592
33364
  }
32593
33365
  // src/cli/authz/authz-type-list.ts
32594
- function setup$402() {
33366
+ function setup$403() {
32595
33367
  const program = new FrodoCommand("frodo authz type list");
32596
33368
  program.description("List authorization resource types.").addOption(new Option("-l, --long", "Long with more fields.").default(false, "false")).action(async (host, realm, user, password, options, command) => {
32597
33369
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -32603,26 +33375,26 @@ function setup$402() {
32603
33375
  return program;
32604
33376
  }
32605
33377
  // src/cli/authz/authz-type.ts
32606
- function setup$401() {
33378
+ function setup$402() {
32607
33379
  const program = new FrodoStubCommand("frodo authz type");
32608
33380
  program.description("Manage authorization resource types.");
32609
- program.addCommand(setup$406().name("delete"));
32610
- program.addCommand(setup$405().name("describe"));
32611
- program.addCommand(setup$404().name("export"));
32612
- program.addCommand(setup$403().name("import"));
32613
- program.addCommand(setup$402().name("list"));
33381
+ program.addCommand(setup$407().name("delete"));
33382
+ program.addCommand(setup$406().name("describe"));
33383
+ program.addCommand(setup$405().name("export"));
33384
+ program.addCommand(setup$404().name("import"));
33385
+ program.addCommand(setup$403().name("list"));
32614
33386
  return program;
32615
33387
  }
32616
33388
  // src/cli/authz/authz.ts
32617
- function setup$400() {
33389
+ function setup$401() {
32618
33390
  const program = new FrodoStubCommand("authz").description("Manage authorization policies, policy sets, and resource types.");
32619
- program.addCommand(setup$407().name("set"));
32620
- program.addCommand(setup$413().name("policy"));
32621
- program.addCommand(setup$401().name("type"));
33391
+ program.addCommand(setup$408().name("set"));
33392
+ program.addCommand(setup$414().name("policy"));
33393
+ program.addCommand(setup$402().name("type"));
32622
33394
  return program;
32623
33395
  }
32624
33396
  // src/cli/conn/conn-test.ts
32625
- function setup$399() {
33397
+ function setup$400() {
32626
33398
  const program = new FrodoCommand("frodo conn test");
32627
33399
  program.description("Test connection and authentication.").action(async (host, realm, user, password, options, command) => {
32628
33400
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -32838,7 +33610,7 @@ function isPlainObject$8(value) {
32838
33610
  return typeof value === "object" && value !== null && !Array.isArray(value);
32839
33611
  }
32840
33612
  // src/ops/ApplicationConfigDeleteOps.ts
32841
- const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$14, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$200 } = require_dist$2.frodo.utils.constants;
33613
+ const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$14, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$201 } = require_dist$2.frodo.utils.constants;
32842
33614
  /** The order in which the library deletes the owned objects: the objects an application names, the connector last. */
32843
33615
  const OWNED_KIND_ORDER = [
32844
33616
  "oauth2Client",
@@ -32940,7 +33712,7 @@ async function realmsOf(realm) {
32940
33712
  * @returns {boolean} true if the realm is skipped
32941
33713
  */
32942
33714
  function skippedRealm(realm) {
32943
- return realm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$200;
33715
+ return realm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$201;
32944
33716
  }
32945
33717
  /**
32946
33718
  * Print what a delete would do to the applications of the current realm: for
@@ -33136,10 +33908,10 @@ async function configManagerDeleteApplications(name, realm, dryRun = false, allo
33136
33908
  }
33137
33909
  }
33138
33910
  // src/cli/config-manager/config-manager-delete/config-manager-delete-applications.ts
33139
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$199, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$118 } = require_dist$2.frodo.utils.constants;
33140
- const deploymentTypes$202 = [CLOUD_DEPLOYMENT_TYPE_KEY$199, FORGEOPS_DEPLOYMENT_TYPE_KEY$118];
33141
- function setup$398() {
33142
- const program = new FrodoCommand("frodo config-manager delete applications", [], deploymentTypes$202);
33911
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$200, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$118 } = require_dist$2.frodo.utils.constants;
33912
+ const deploymentTypes$203 = [CLOUD_DEPLOYMENT_TYPE_KEY$200, FORGEOPS_DEPLOYMENT_TYPE_KEY$118];
33913
+ function setup$399() {
33914
+ const program = new FrodoCommand("frodo config-manager delete applications", [], deploymentTypes$203);
33143
33915
  program.summary("Delete applications together with the objects they own.").description("Delete applications: the application record first, then the objects it owns (the OAuth2 client, the SAML providers, the connector and its mappings). An owned object that another application still names is kept. The scripts and circles of trust that an application uses are never deleted. An application whose connector is active is not deleted: switch it off first with \"frodo app disable\". The glossary values and request forms of Identity Governance tenants are not handled by this command.").addOption(new Option("-n, --name <name>", "Application name. If specified, deletes only the application with the given name, without asking. Needs a single realm.")).addOption(new Option("-d, --dry-run", "Show which applications and objects would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one application (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Preview the deletion of all applications of a realm and the objects they own:\n" + require_Console.theme.command(` $ frodo config-manager delete applications -d ${connId} ${realm}\n`) + ` Delete all applications of a realm without asking, which is required without a terminal (without -y a terminal is asked first):\n` + require_Console.theme.command(` $ frodo config-manager delete applications -y ${connId} ${realm}\n`) + ` Delete one application and the objects it owns:\n` + require_Console.theme.command(` $ frodo config-manager delete applications -n "${pullApplicationName}" ${connId} ${realm}\n`) + ` Preview the deletion of one application:\n` + require_Console.theme.command(` $ frodo config-manager delete applications -n "${pullApplicationName}" -d ${connId} ${realm}\n`)).multiOp().usesRealm().action(async (host, realm, user, password, options, command) => {
33144
33916
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
33145
33917
  const what = "all applications and the objects they own";
@@ -33151,7 +33923,7 @@ function setup$398() {
33151
33923
  process.exitCode = 1;
33152
33924
  return;
33153
33925
  }
33154
- if (!await getTokens(false, true, deploymentTypes$202)) {
33926
+ if (!await getTokens(false, true, deploymentTypes$203)) {
33155
33927
  process.exitCode = 1;
33156
33928
  return;
33157
33929
  }
@@ -33330,10 +34102,10 @@ async function configManagerDeleteEmailTemplates(name, dryRun = false, allowFail
33330
34102
  }
33331
34103
  }
33332
34104
  // src/cli/config-manager/config-manager-delete/config-manager-delete-email-templates.ts
33333
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$198, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$117 } = require_dist$2.frodo.utils.constants;
33334
- const deploymentTypes$201 = [CLOUD_DEPLOYMENT_TYPE_KEY$198, FORGEOPS_DEPLOYMENT_TYPE_KEY$117];
33335
- function setup$397() {
33336
- const program = new FrodoCommand("frodo config-manager delete email-templates", [], deploymentTypes$201);
34105
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$199, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$117 } = require_dist$2.frodo.utils.constants;
34106
+ const deploymentTypes$202 = [CLOUD_DEPLOYMENT_TYPE_KEY$199, FORGEOPS_DEPLOYMENT_TYPE_KEY$117];
34107
+ function setup$398() {
34108
+ const program = new FrodoCommand("frodo config-manager delete email-templates", [], deploymentTypes$202);
33337
34109
  program.description("Delete email template objects.").addOption(new Option("-n, --name <name>", "Email template name; deletes only the email template with the specified name.")).addOption(new Option("-d, --dry-run", "Show which email templates would be deleted.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one email template (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all email templates without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete email-templates -y ${connId}\n`) + ` Preview the deletion of all email templates:\n` + require_Console.theme.command(` $ frodo config-manager delete email-templates -d ${connId}\n`) + ` Delete an email template by name:\n` + require_Console.theme.command(` $ frodo config-manager delete email-templates -n 'Example Template' ${connId}\n`) + ` Preview deletion of an email template by name:\n` + require_Console.theme.command(` $ frodo config-manager delete email-templates -n 'Example Template' -d ${connId}\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
33338
34110
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
33339
34111
  const what = "all email templates";
@@ -33345,7 +34117,7 @@ function setup$397() {
33345
34117
  process.exitCode = 1;
33346
34118
  return;
33347
34119
  }
33348
- if (!await getTokens(false, true, deploymentTypes$201)) {
34120
+ if (!await getTokens(false, true, deploymentTypes$202)) {
33349
34121
  process.exitCode = 1;
33350
34122
  return;
33351
34123
  }
@@ -33523,10 +34295,10 @@ async function configManagerDeleteEndpoints(endpointName, dryRun = false, allowF
33523
34295
  return false;
33524
34296
  }
33525
34297
  // src/cli/config-manager/config-manager-delete/config-manager-delete-endpoints.ts
33526
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$197, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$116 } = require_dist$2.frodo.utils.constants;
33527
- const deploymentTypes$200 = [CLOUD_DEPLOYMENT_TYPE_KEY$197, FORGEOPS_DEPLOYMENT_TYPE_KEY$116];
33528
- function setup$396() {
33529
- const program = new FrodoCommand("frodo config-manager delete endpoints", [], deploymentTypes$200);
34298
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$198, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$116 } = require_dist$2.frodo.utils.constants;
34299
+ const deploymentTypes$201 = [CLOUD_DEPLOYMENT_TYPE_KEY$198, FORGEOPS_DEPLOYMENT_TYPE_KEY$116];
34300
+ function setup$397() {
34301
+ const program = new FrodoCommand("frodo config-manager delete endpoints", [], deploymentTypes$201);
33530
34302
  program.description("Delete custom endpoint objects.").addOption(new Option("-n, --name <name>", "Endpoint name. If omitted, deletes all eligible endpoints.")).addOption(new Option("-d, --dry-run", "Show which custom endpoints would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one custom endpoint. Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all eligible custom endpoints without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete endpoints -y ${connId}\n`) + ` Preview the deletion of all eligible custom endpoints:\n` + require_Console.theme.command(` $ frodo config-manager delete endpoints -d ${connId}\n`) + ` Delete a custom endpoint by name:\n` + require_Console.theme.command(` $ frodo config-manager delete endpoints -n Javascript ${connId}\n`) + ` Preview deletion of a custom endpoint without deleting it:\n` + require_Console.theme.command(` $ frodo config-manager delete endpoints -n Javascript -d ${connId}\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
33531
34303
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
33532
34304
  if (!options.name && !checkBulkDelete({
@@ -33537,7 +34309,7 @@ function setup$396() {
33537
34309
  process.exitCode = 1;
33538
34310
  return;
33539
34311
  }
33540
- if (!await getTokens(false, true, deploymentTypes$200)) {
34312
+ if (!await getTokens(false, true, deploymentTypes$201)) {
33541
34313
  process.exitCode = 1;
33542
34314
  return;
33543
34315
  }
@@ -33703,10 +34475,10 @@ async function configManagerDeleteLocales(localeName, dryRun = false, allowFailu
33703
34475
  }
33704
34476
  }
33705
34477
  // src/cli/config-manager/config-manager-delete/config-manager-delete-locales.ts
33706
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$196, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$115 } = require_dist$2.frodo.utils.constants;
33707
- const deploymentTypes$199 = [CLOUD_DEPLOYMENT_TYPE_KEY$196, FORGEOPS_DEPLOYMENT_TYPE_KEY$115];
33708
- function setup$395() {
33709
- const program = new FrodoCommand("frodo config-manager delete locales", [], deploymentTypes$199);
34478
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$197, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$115 } = require_dist$2.frodo.utils.constants;
34479
+ const deploymentTypes$200 = [CLOUD_DEPLOYMENT_TYPE_KEY$197, FORGEOPS_DEPLOYMENT_TYPE_KEY$115];
34480
+ function setup$396() {
34481
+ const program = new FrodoCommand("frodo config-manager delete locales", [], deploymentTypes$200);
33710
34482
  program.description("Delete locale objects.").addOption(new Option("-n, --name <name>", "Locale name (for example en), matched exactly; delete only the specified locale. If omitted, all locales are deleted, after a confirmation or with -y.")).addOption(new Option("-d, --dry-run", "Show which locales would be deleted.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one locale (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all locales without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete locales -y ${connId}\n`) + ` Preview the deletion of all locales:\n` + require_Console.theme.command(` $ frodo config-manager delete locales -d ${connId}\n`) + ` Delete a locale by name:\n` + require_Console.theme.command(` $ frodo config-manager delete locales -n en ${connId}\n`) + ` Preview deletion of a locale by name:\n` + require_Console.theme.command(` $ frodo config-manager delete locales -n en -d ${connId}\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
33711
34483
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
33712
34484
  const named = options.name !== void 0;
@@ -33724,7 +34496,7 @@ function setup$395() {
33724
34496
  process.exitCode = 1;
33725
34497
  return;
33726
34498
  }
33727
- if (!await getTokens(false, true, deploymentTypes$199)) {
34499
+ if (!await getTokens(false, true, deploymentTypes$200)) {
33728
34500
  process.exitCode = 1;
33729
34501
  return;
33730
34502
  }
@@ -33757,7 +34529,7 @@ function setup$395() {
33757
34529
  * - every object is one operation of an {@link OperationRun} (decision record 0040), and what the
33758
34530
  * command line names must exist whatever `--allow-failures` says (decision record 0041).
33759
34531
  */
33760
- const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$13, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$195 } = require_dist$2.frodo.utils.constants;
34532
+ const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$13, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$196 } = require_dist$2.frodo.utils.constants;
33761
34533
  const { readJsonFile: readJsonFile$36, escapePlaceholders: escapePlaceholders$3, getFilePath: getFilePath$53, getWorkingDirectory: getWorkingDirectory$35, saveJsonToFile: saveJsonToFile$52 } = require_dist$2.frodo.utils;
33762
34534
  const { mergeDeep: mergeDeep$1 } = require_dist$2.frodo.utils.json;
33763
34535
  /**
@@ -33801,7 +34573,7 @@ const singleRealmMessage = (kind) => `Error: for a named ${kind.label}, specify
33801
34573
  * @returns {boolean} true for `/` on Cloud
33802
34574
  */
33803
34575
  function isCloudRootRealm(realm) {
33804
- return realm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$195;
34576
+ return realm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$196;
33805
34577
  }
33806
34578
  /**
33807
34579
  * The realms a command visits: the realm that was given, or every realm of the deployment. The
@@ -33812,7 +34584,7 @@ function isCloudRootRealm(realm) {
33812
34584
  */
33813
34585
  async function realmsToVisit(realm) {
33814
34586
  const realms = realm && realm !== DEFAULT_REALM_KEY$13 ? [realm] : await realmList();
33815
- return require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$195 ? realms.filter((r) => r !== "/") : realms;
34587
+ return require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$196 ? realms.filter((r) => r !== "/") : realms;
33816
34588
  }
33817
34589
  /** The longest file name, 255 bytes on the usual file systems, less the extension `.json`. */
33818
34590
  const MAX_FILE_NAME_BYTES = 250;
@@ -34118,7 +34890,7 @@ async function pushAgentKind(kind, hooks, { name, realm, allowFailures = false }
34118
34890
  return false;
34119
34891
  }
34120
34892
  const realmsInTree = realm && realm !== DEFAULT_REALM_KEY$13 ? [realm] : fs.default.readdirSync(realmsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => realmOfDir(entry.name)).sort();
34121
- const realms = require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$195 ? realmsInTree.filter((r) => r !== "/") : realmsInTree;
34893
+ const realms = require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$196 ? realmsInTree.filter((r) => r !== "/") : realmsInTree;
34122
34894
  if (name && realms.length !== 1) {
34123
34895
  require_Console.printMessage(singleRealmMessage(kind), "error");
34124
34896
  return false;
@@ -34541,7 +35313,7 @@ async function showCIMDProfileDeletePlan(name, realm) {
34541
35313
  return showAgentKindDeletePlan(CIMD_PROFILE_KIND, deleteHooks$1, name, realm);
34542
35314
  }
34543
35315
  // src/cli/config-manager/config-manager-delete/config-manager-delete-oauth-cimd-profiles.ts
34544
- function setup$394() {
35316
+ function setup$395() {
34545
35317
  const program = new FrodoCommand("frodo config-manager delete oauth-cimd-profiles");
34546
35318
  program.summary("Delete CIMD profiles.").description("Delete the CIMD profiles (the allow-list of client ID URL patterns) from the tenant, by name or all of the selected realms. A client that identifies itself with a Client ID Metadata Document that only a deleted profile allowed is rejected until a profile for it exists again. A realm or a deployment that does not offer CIMD profiles has nothing to delete.").addOption(new Option("-n, --name <name>", "CIMD profile name. If specified, deletes only the profile with the given name, without asking. Needs a single realm.")).addOption(new Option("--dry-run", "Show which CIMD profiles would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one CIMD profile (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Preview the deletion of all CIMD profiles of a realm:\n" + require_Console.theme.command(` $ frodo config-manager delete oauth-cimd-profiles --dry-run ${connId} ${realm}\n`) + ` Delete all CIMD profiles of a realm without asking, which is required without a terminal (without -y a terminal is asked first). Clients that only these profiles allowed are rejected afterwards:\n` + require_Console.theme.command(` $ frodo config-manager delete oauth-cimd-profiles -y ${connId} ${realm}\n`) + ` Delete one CIMD profile of a realm:\n` + require_Console.theme.command(` $ frodo config-manager delete oauth-cimd-profiles -n ${cimdProfileId} ${connId} ${realm}\n`) + ` Preview the deletion of one CIMD profile:\n` + require_Console.theme.command(` $ frodo config-manager delete oauth-cimd-profiles -n ${cimdProfileId} --dry-run ${connId} ${realm}\n`)).multiOp().usesRealm().action(async (host, realm, user, password, options, command) => {
34547
35319
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -34579,7 +35351,7 @@ function setup$394() {
34579
35351
  return program;
34580
35352
  }
34581
35353
  // src/configManagerOps/FrConfigThemeOps.ts
34582
- const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$12, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$194 } = require_dist$2.frodo.utils.constants;
35354
+ const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$12, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$195 } = require_dist$2.frodo.utils.constants;
34583
35355
  const { saveJsonToFile: saveJsonToFile$51, getFilePath: getFilePath$52, readJsonFile: readJsonFile$35, saveTextToFile: saveTextToFile$5, getWorkingDirectory: getWorkingDirectory$34 } = require_dist$2.frodo.utils;
34584
35356
  const { readThemes, readThemeByName, deleteThemeByName, importThemes, deleteThemes } = require_dist$2.frodo.theme;
34585
35357
  const THEME_HTML_FIELDS = [
@@ -34659,7 +35431,7 @@ async function configManagerExportThemes(realm, allowFailures = false) {
34659
35431
  allowFailures
34660
35432
  });
34661
35433
  for (const currentRealm of realmNames) {
34662
- if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$194) continue;
35434
+ if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$195) continue;
34663
35435
  try {
34664
35436
  await exportThemesOfRealm(currentRealm);
34665
35437
  run.recordSuccess();
@@ -34724,7 +35496,7 @@ async function configManagerImportThemes(realm, allowFailures = false) {
34724
35496
  allowFailures
34725
35497
  });
34726
35498
  for (const realmDir of realms) {
34727
- if (realmDir === "root" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$194) continue;
35499
+ if (realmDir === "root" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$195) continue;
34728
35500
  const realmName = realmDir === "root" ? "/" : realmDir;
34729
35501
  const importDir = `${realmsDir}/${realmDir}/themes`;
34730
35502
  if (!fs.default.existsSync(importDir)) {
@@ -34783,7 +35555,7 @@ async function configManagerDeleteThemes(name, realm, dryRun = false, allowFailu
34783
35555
  allowFailures
34784
35556
  });
34785
35557
  for (const currentRealm of realms) {
34786
- if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$194) continue;
35558
+ if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$195) continue;
34787
35559
  require_dist$2.state.setRealm(currentRealm);
34788
35560
  try {
34789
35561
  const themes = dryRun ? name ? [await readThemeByName(name)] : await readThemes() : name ? [await deleteThemeByName(name)] : await deleteThemes(currentRealm);
@@ -34811,10 +35583,10 @@ async function configManagerDeleteThemes(name, realm, dryRun = false, allowFailu
34811
35583
  }
34812
35584
  }
34813
35585
  // src/cli/config-manager/config-manager-delete/config-manager-delete-themes.ts
34814
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$193, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$114 } = require_dist$2.frodo.utils.constants;
34815
- const deploymentTypes$198 = [CLOUD_DEPLOYMENT_TYPE_KEY$193, FORGEOPS_DEPLOYMENT_TYPE_KEY$114];
34816
- function setup$393() {
34817
- const program = new FrodoCommand("frodo config-manager delete themes", [], deploymentTypes$198);
35586
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$194, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$114 } = require_dist$2.frodo.utils.constants;
35587
+ const deploymentTypes$199 = [CLOUD_DEPLOYMENT_TYPE_KEY$194, FORGEOPS_DEPLOYMENT_TYPE_KEY$114];
35588
+ function setup$394() {
35589
+ const program = new FrodoCommand("frodo config-manager delete themes", [], deploymentTypes$199);
34818
35590
  program.description("Delete themes by name or delete all themes in the selected realms.").option("-n, --name <name>", "Name of the theme to delete.").option("-d, --dry-run", "Show which themes would be deleted.").option("-y, --yes", "Do not ask for confirmation before deleting more than one theme (no -n). Required without a terminal.").addHelpText("after", "Usage Examples:\n Delete all themes in the selected realms without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete themes -y ${connId}\n`) + ` Preview the deletion of all themes in the selected realms:\n` + require_Console.theme.command(` $ frodo config-manager delete themes -d ${connId}\n`) + ` Delete a theme by name:\n` + require_Console.theme.command(` $ frodo config-manager delete themes -n 'Example Theme' ${connId}\n`) + ` Preview deletion of a theme by name:\n` + require_Console.theme.command(` $ frodo config-manager delete themes -n 'Example Theme' -d ${connId}\n`)).multiOp().usesRealm().action(async (host, realm, user, password, options, command) => {
34819
35591
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
34820
35592
  const what = "all themes in the selected realms";
@@ -34826,7 +35598,7 @@ function setup$393() {
34826
35598
  process.exitCode = 1;
34827
35599
  return;
34828
35600
  }
34829
- if (!await getTokens(false, true, deploymentTypes$198)) {
35601
+ if (!await getTokens(false, true, deploymentTypes$199)) {
34830
35602
  process.exitCode = 1;
34831
35603
  return;
34832
35604
  }
@@ -34992,7 +35764,7 @@ async function configManagerDeleteCustomNodes(name, dryRun = false, allowFailure
34992
35764
  }
34993
35765
  }
34994
35766
  // src/cli/config-manager/config-manager-delete/config-manager-delete-custom-nodes.ts
34995
- function setup$392() {
35767
+ function setup$393() {
34996
35768
  const program = new FrodoCommand("frodo config-manager delete custom-nodes");
34997
35769
  program.description("Delete custom nodes.").addOption(new Option("-n, --name <name>", "Custom node display name. If name is not specified, all custom nodes are deleted.")).addOption(new Option("-d, --dry-run", "Show which custom nodes would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one custom node. Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all custom nodes without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete custom-nodes -y ${connId} /\n`) + ` Preview the deletion of all custom nodes:\n` + require_Console.theme.command(` $ frodo config-manager delete custom-nodes -d ${connId} /\n`) + ` Delete a custom node by display name:\n` + require_Console.theme.command(` $ frodo config-manager delete custom-nodes -n 'Example Node' ${connId} /\n`) + ` Preview deletion of a custom node by display name:\n` + require_Console.theme.command(` $ frodo config-manager delete custom-nodes -n 'Example Node' -d ${connId} /\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
34998
35770
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -35223,7 +35995,7 @@ async function showTrustedJwtIssuerDeletePlan(name, realm) {
35223
35995
  return showAgentKindDeletePlan(TRUSTED_JWT_ISSUER_KIND, deleteHooks, name, realm);
35224
35996
  }
35225
35997
  // src/cli/config-manager/config-manager-delete/config-manager-delete-oauth-issuers.ts
35226
- function setup$391() {
35998
+ function setup$392() {
35227
35999
  const program = new FrodoCommand("frodo config-manager delete oauth-issuers");
35228
36000
  program.summary("Delete trusted JWT issuers.").description("Delete OAuth2 trusted JWT issuers from the tenant, by name or all of the selected realms. A trusted JWT issuer is a trust anchor: a JWT signed by it is accepted as a grant, and once it is deleted that JWT is rejected until an issuer for it exists again. There is no undo; a tree in version control holds the files to push back.").addOption(new Option("-n, --name <name>", "Trusted JWT issuer name (the name of the object, not its iss URL). If specified, deletes only that issuer, without asking. Needs a single realm.")).addOption(new Option("--dry-run", "Show which trusted JWT issuers would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one trusted JWT issuer (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Preview the deletion of all trusted JWT issuers of a realm:\n" + require_Console.theme.command(` $ frodo config-manager delete oauth-issuers --dry-run ${connId} ${realm}\n`) + ` Delete all trusted JWT issuers of a realm without asking, which is required without a terminal (without -y a terminal is asked first). Grants signed by these issuers are rejected afterwards:\n` + require_Console.theme.command(` $ frodo config-manager delete oauth-issuers -y ${connId} ${realm}\n`) + ` Delete one trusted JWT issuer of a realm:\n` + require_Console.theme.command(` $ frodo config-manager delete oauth-issuers -n ${trustedJwtIssuerId} ${connId} ${realm}\n`) + ` Preview the deletion of one trusted JWT issuer:\n` + require_Console.theme.command(` $ frodo config-manager delete oauth-issuers -n ${trustedJwtIssuerId} --dry-run ${connId} ${realm}\n`)).multiOp().usesRealm().action(async (host, realm, user, password, options, command) => {
35229
36001
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -35439,10 +36211,10 @@ async function configManagerDeleteSchedules(name, dryRun = false, allowFailures
35439
36211
  return run.finish();
35440
36212
  }
35441
36213
  // src/cli/config-manager/config-manager-delete/config-manager-delete-schedules.ts
35442
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$192, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$113 } = require_dist$2.frodo.utils.constants;
35443
- const deploymentTypes$197 = [CLOUD_DEPLOYMENT_TYPE_KEY$192, FORGEOPS_DEPLOYMENT_TYPE_KEY$113];
35444
- function setup$390() {
35445
- const program = new FrodoCommand("frodo config-manager delete schedules", [], deploymentTypes$197);
36214
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$193, FORGEOPS_DEPLOYMENT_TYPE_KEY: FORGEOPS_DEPLOYMENT_TYPE_KEY$113 } = require_dist$2.frodo.utils.constants;
36215
+ const deploymentTypes$198 = [CLOUD_DEPLOYMENT_TYPE_KEY$193, FORGEOPS_DEPLOYMENT_TYPE_KEY$113];
36216
+ function setup$391() {
36217
+ const program = new FrodoCommand("frodo config-manager delete schedules", [], deploymentTypes$198);
35446
36218
  program.description("Delete schedules.").addOption(new Option("-n, --name <name>", "Schedule name, the part of its id after schedule/ (for example taskscan_activate), matched exactly; delete only the specified schedule. If omitted, all schedules are deleted, after a confirmation or with -y.")).addOption(new Option("--dry-run", "Show which schedules would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one schedule (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all schedules without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete schedules -y ${connId}\n`) + ` Preview the deletion of all schedules:\n` + require_Console.theme.command(` $ frodo config-manager delete schedules --dry-run ${connId}\n`) + ` Delete a schedule by name:\n` + require_Console.theme.command(` $ frodo config-manager delete schedules -n taskscan_activate ${connId}\n`) + ` Preview deletion of a schedule by name:\n` + require_Console.theme.command(` $ frodo config-manager delete schedules -n taskscan_activate --dry-run ${connId}\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
35447
36219
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
35448
36220
  const named = options.name !== void 0;
@@ -35460,7 +36232,7 @@ function setup$390() {
35460
36232
  process.exitCode = 1;
35461
36233
  return;
35462
36234
  }
35463
- if (!await getTokens(false, true, deploymentTypes$197)) {
36235
+ if (!await getTokens(false, true, deploymentTypes$198)) {
35464
36236
  process.exitCode = 1;
35465
36237
  return;
35466
36238
  }
@@ -35480,7 +36252,7 @@ function setup$390() {
35480
36252
  }
35481
36253
  // src/configManagerOps/FrConfigScriptOps.ts
35482
36254
  const { getFilePath: getFilePath$49, saveJsonToFile: saveJsonToFile$48, decodeBase64: decodeBase64$2, saveTextToFile: saveTextToFile$3, readJsonFile: readJsonFile$32, getWorkingDirectory: getWorkingDirectory$32 } = require_dist$2.frodo.utils;
35483
- const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$11, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$191 } = require_dist$2.frodo.utils.constants;
36255
+ const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$11, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$192 } = require_dist$2.frodo.utils.constants;
35484
36256
  const { readScripts, readScriptByName, updateScript: updateScript$1, deleteScript } = require_dist$2.frodo.script;
35485
36257
  /**
35486
36258
  * Write one script in config-manager format: the configuration as
@@ -35526,7 +36298,7 @@ async function configManagerExportScripts(prefixes = [], realm, name, allowFailu
35526
36298
  });
35527
36299
  let cannotExportNamed = false;
35528
36300
  for (const currentRealm of realms) {
35529
- if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$191) continue;
36301
+ if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$192) continue;
35530
36302
  require_dist$2.state.setRealm(currentRealm);
35531
36303
  let scripts;
35532
36304
  try {
@@ -35619,7 +36391,7 @@ async function configManagerImportScripts(realm, name, filenameFilter, allowFail
35619
36391
  let missingNamedConfig = false;
35620
36392
  for (const currentRealm of realms) {
35621
36393
  const realmName = currentRealm === "root" ? "/" : currentRealm;
35622
- if (realmName === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$191) continue;
36394
+ if (realmName === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$192) continue;
35623
36395
  require_dist$2.state.setRealm(realmName);
35624
36396
  const configDir = `${getWorkingDirectory$32()}/realms/${currentRealm}/scripts/scripts-config`;
35625
36397
  if (!fs.default.existsSync(configDir)) {
@@ -35691,7 +36463,7 @@ async function configManagerDeleteScripts(prefixes = [], realm, name, dryRun = f
35691
36463
  const scriptCountsByContext = /* @__PURE__ */ new Map();
35692
36464
  let eligible = 0;
35693
36465
  for (const currentRealm of realms) {
35694
- if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$191) continue;
36466
+ if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$192) continue;
35695
36467
  require_dist$2.state.setRealm(currentRealm);
35696
36468
  const matching = (await readScripts()).filter((script) => name ? script.name === name : script.language === "JAVASCRIPT" && (prefixes.length === 0 || prefixes.some((prefix) => script.name.startsWith(prefix))));
35697
36469
  if (name && matching.length !== 1) {
@@ -35736,7 +36508,7 @@ async function configManagerDeleteScripts(prefixes = [], realm, name, dryRun = f
35736
36508
  }
35737
36509
  }
35738
36510
  // src/cli/config-manager/config-manager-delete/config-manager-delete-scripts.ts
35739
- function setup$389() {
36511
+ function setup$390() {
35740
36512
  const program = new FrodoCommand("frodo config-manager delete scripts");
35741
36513
  program.description("Delete AM scripts. Default scripts are never deleted.").addOption(new Option("-n, --name <name>", "Delete a specific script by name.")).addOption(new ListOption("-p, --prefix <prefix>", "Delete all eligible scripts that start with a prefix. Repetition of this flag is allowed. Ignored with -n")).addOption(new Option("-d, --dry-run", "Show which scripts would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one script (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all eligible scripts without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete scripts -y ${connId}\n`) + ` Delete the scripts whose names start with a prefix:\n` + require_Console.theme.command(` $ frodo config-manager delete scripts -p 'Example' -y ${connId}\n`) + ` Preview the deletion of all eligible scripts:\n` + require_Console.theme.command(` $ frodo config-manager delete scripts -d ${connId}\n`) + ` Delete a script by name:\n` + require_Console.theme.command(` $ frodo config-manager delete scripts -n 'Example Script' ${connId}\n`) + ` Preview deletion of a script without deleting it:\n` + require_Console.theme.command(` $ frodo config-manager delete scripts -n 'Example Script' -d ${connId}\n`)).multiOp().usesRealm().action(async (host, realm, user, password, options, command) => {
35742
36514
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
@@ -35956,10 +36728,10 @@ async function configManagerDeleteSecretMappings(name, realm, dryRun = false, al
35956
36728
  }
35957
36729
  }
35958
36730
  // src/cli/config-manager/config-manager-delete/config-manager-delete-secret-mappings.ts
35959
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$190, DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$9 } = require_dist$2.frodo.utils.constants;
35960
- const deploymentTypes$196 = [CLOUD_DEPLOYMENT_TYPE_KEY$190];
35961
- function setup$388() {
35962
- const program = new FrodoCommand("frodo config-manager delete secret-mappings", [], deploymentTypes$196);
36731
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$191, DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$9 } = require_dist$2.frodo.utils.constants;
36732
+ const deploymentTypes$197 = [CLOUD_DEPLOYMENT_TYPE_KEY$191];
36733
+ function setup$389() {
36734
+ const program = new FrodoCommand("frodo config-manager delete secret-mappings", [], deploymentTypes$197);
35963
36735
  program.description("Delete secret mappings.").addOption(new Option("-n, --name <name>", "Secret mapping ID (the secret id of the mapping, for example am.example.secret.id), matched exactly; delete only the specified mapping. Needs a single realm. If omitted, all secret mappings of the selected realms are deleted, after a confirmation or with -y.")).addOption(new Option("--dry-run", "Show which secret mappings would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one secret mapping (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all secret mappings of all realms except the root realm without asking, which is required without a terminal (without -y a terminal is asked first):\n" + require_Console.theme.command(` $ frodo config-manager delete secret-mappings -y ${connId}\n`) + ` Preview the deletion of all secret mappings of all realms except the root realm:\n` + require_Console.theme.command(` $ frodo config-manager delete secret-mappings --dry-run ${connId}\n`) + ` Delete a secret mapping by ID in the alpha realm:\n` + require_Console.theme.command(` $ frodo config-manager delete secret-mappings -n example.secret.id ${connId} alpha\n`) + ` Preview the deletion of a secret mapping by ID in the alpha realm:\n` + require_Console.theme.command(` $ frodo config-manager delete secret-mappings -n example.secret.id --dry-run ${connId} alpha\n`)).multiOp().usesRealm().action(async (host, realm, user, password, options, command) => {
35964
36736
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
35965
36737
  const named = options.name !== void 0;
@@ -35987,7 +36759,7 @@ function setup$388() {
35987
36759
  process.exitCode = 1;
35988
36760
  return;
35989
36761
  }
35990
- if (!await getTokens(false, true, deploymentTypes$196)) {
36762
+ if (!await getTokens(false, true, deploymentTypes$197)) {
35991
36763
  process.exitCode = 1;
35992
36764
  return;
35993
36765
  }
@@ -36233,10 +37005,10 @@ async function configManagerDeleteSecrets(name, dryRun = false, allowFailures =
36233
37005
  return run.finish();
36234
37006
  }
36235
37007
  // src/cli/config-manager/config-manager-delete/config-manager-delete-secrets.ts
36236
- const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$189 } = require_dist$2.frodo.utils.constants;
36237
- const deploymentTypes$195 = [CLOUD_DEPLOYMENT_TYPE_KEY$189];
36238
- function setup$387() {
36239
- const program = new FrodoCommand("frodo config-manager delete secrets", [], deploymentTypes$195);
37008
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$190 } = require_dist$2.frodo.utils.constants;
37009
+ const deploymentTypes$196 = [CLOUD_DEPLOYMENT_TYPE_KEY$190];
37010
+ function setup$388() {
37011
+ const program = new FrodoCommand("frodo config-manager delete secrets", [], deploymentTypes$196);
36240
37012
  program.description("Delete secrets.").addOption(new Option("-n, --name <name>", "Secret name, which is its id (for example esv-example) and is matched exactly; delete only the specified secret. If omitted, all secrets are deleted.")).addOption(new Option("-d, --dry-run", "Show which secrets would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Do not ask for confirmation before deleting more than one secret (no -n). Required without a terminal.")).addHelpText("after", "Usage Examples:\n Delete a secret by name, which is its id:\n" + require_Console.theme.command(` $ frodo config-manager delete secrets -n esv-example ${connId}\n`) + ` Preview deletion of a secret by name:\n` + require_Console.theme.command(` $ frodo config-manager delete secrets -n esv-example -d ${connId}\n`) + ` Preview the deletion of all secrets:\n` + require_Console.theme.command(` $ frodo config-manager delete secrets -d ${connId}\n`) + ` Delete all secrets without asking, which is required without a terminal (without -y a terminal is asked first). The values of a deleted secret cannot be recovered:\n` + require_Console.theme.command(` $ frodo config-manager delete secrets -y ${connId}\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
36241
37013
  command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
36242
37014
  const named = options.name !== void 0;
@@ -36254,7 +37026,7 @@ function setup$387() {
36254
37026
  process.exitCode = 1;
36255
37027
  return;
36256
37028
  }
36257
- if (!await getTokens(false, true, deploymentTypes$195)) {
37029
+ if (!await getTokens(false, true, deploymentTypes$196)) {
36258
37030
  process.exitCode = 1;
36259
37031
  return;
36260
37032
  }
@@ -36272,8 +37044,241 @@ function setup$387() {
36272
37044
  });
36273
37045
  return program;
36274
37046
  }
36275
- // src/configManagerOps/FrConfigTermsAndConditionsOps.ts
37047
+ // src/configManagerOps/FrConfigTelemetryOps.ts
36276
37048
  const { saveJsonToFile: saveJsonToFile$45, getFilePath: getFilePath$46, readJsonFile: readJsonFile$29 } = require_dist$2.frodo.utils;
37049
+ const { exportTelemetry, importTelemetry, readTelemetry, deleteTelemetry } = require_dist$2.frodo.cloud.telemetry;
37050
+ /**
37051
+ * Exports telemetry configuration in config manager format
37052
+ * @param {TelemetryExporterCategory} category optional parameter to export telemetry by category.
37053
+ * @param {string} name optional parameter to export telemetry config by name.
37054
+ * @param {boolean} allowFailures true to succeed although some exporters could not be exported (the failures are still summarised)
37055
+ * @returns { Promise<boolean> } returns false if a named exporter does not exist, the telemetry cannot be read, or an exporter cannot be exported (unless failures are allowed). No exporters when none was named is a success.
37056
+ */
37057
+ async function configManagerExportTelemetry(category, name, allowFailures = false) {
37058
+ try {
37059
+ const exporters = await exportTelemetry(name, category);
37060
+ const items = Object.entries(exporters.telemetry).flatMap(([cat, providers]) => providers.map((provider) => ({
37061
+ cat,
37062
+ provider
37063
+ })));
37064
+ if (name && items.length === 0) {
37065
+ require_Console.printMessage(`Telemetry exporter '${name}' not found.`, "error");
37066
+ return false;
37067
+ }
37068
+ if (items.length === 0) {
37069
+ require_Console.printMessage("No telemetry exporters found to export.");
37070
+ return true;
37071
+ }
37072
+ const run = new OperationRun({
37073
+ unit: "telemetry exporter",
37074
+ allowFailures
37075
+ });
37076
+ for (const { cat, provider } of items) try {
37077
+ const exportProvider = provider;
37078
+ if (exportProvider.headers) {
37079
+ const placeholders = {};
37080
+ Object.keys(exportProvider.headers).forEach((headerName) => {
37081
+ placeholders[headerName] = `\${TELEMETRY_HEADER_${cat}_${provider.id}_${headerName}}`.replaceAll("-", "_").toUpperCase();
37082
+ });
37083
+ exportProvider.headers = placeholders;
37084
+ }
37085
+ saveJsonToFile$45(exportProvider, getFilePath$46(`telemetry/${cat}/${provider.id}.json`, true), false);
37086
+ run.recordSuccess();
37087
+ } catch (error) {
37088
+ require_Console.printError(error, `Error exporting telemetry exporter ${provider.id}`);
37089
+ run.recordFailure(`${cat}/${provider.id}`, causeOf(error));
37090
+ }
37091
+ return run.finish();
37092
+ } catch (e) {
37093
+ require_Console.printError(e);
37094
+ }
37095
+ return false;
37096
+ }
37097
+ /**
37098
+ * Imports telemetry configuration in config manager format
37099
+ * @param {TelemetryExporterCategory} category optional parameter to import telemetry by category.
37100
+ * @param {string} name optional parameter to import telemetry config by name.
37101
+ * @param {boolean} allowFailures true to succeed although some exporters could not be imported (the failures are still summarised)
37102
+ * @returns { Promise<boolean> } returns false if the telemetry folder or a named exporter does not exist, or an exporter cannot be read or imported (unless failures are allowed). No exporters when none was named is a success.
37103
+ */
37104
+ async function configManagerImportTelemetry(category, name, allowFailures = false) {
37105
+ let indicatorId = require_Console.createProgressIndicator("indeterminate", 0, `Reading telemetry exporters...`);
37106
+ try {
37107
+ const telemetryDir = getFilePath$46("telemetry");
37108
+ if (!fs.default.existsSync(telemetryDir)) {
37109
+ require_Console.stopProgressIndicator(indicatorId, `Telemetry folder not found: ${telemetryDir}`, "fail");
37110
+ return false;
37111
+ }
37112
+ const categories = fs.default.readdirSync(telemetryDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((cat) => !category || cat === category);
37113
+ const run = new OperationRun({
37114
+ unit: "telemetry exporter",
37115
+ allowFailures
37116
+ });
37117
+ const exporters = [];
37118
+ for (const cat of categories) {
37119
+ const catDir = getFilePath$46(`telemetry/${cat}`);
37120
+ if (!fs.default.existsSync(catDir)) continue;
37121
+ const files = fs.default.readdirSync(catDir).filter((f) => f.toLowerCase().endsWith(".json")).filter((f) => !name || f === `${name}.json`);
37122
+ for (const file of files) {
37123
+ const filePath = `${catDir}/${file}`;
37124
+ try {
37125
+ const provider = readJsonFile$29(filePath);
37126
+ exporters.push({
37127
+ cat,
37128
+ id: `${cat}/${provider.id ?? file}`,
37129
+ provider
37130
+ });
37131
+ } catch (error) {
37132
+ require_Console.printError(error, `Error reading telemetry exporter ${cat}/${file}`);
37133
+ run.recordFailure(`${cat}/${file}`, causeOf(error));
37134
+ }
37135
+ }
37136
+ }
37137
+ if (exporters.length === 0 && !run.hasFailures) {
37138
+ if (name) {
37139
+ require_Console.stopProgressIndicator(indicatorId, `No matching telemetry exporter found for ${name}`, "fail");
37140
+ return false;
37141
+ }
37142
+ require_Console.stopProgressIndicator(indicatorId, "No telemetry exporters found to import", "success");
37143
+ return true;
37144
+ }
37145
+ require_Console.stopProgressIndicator(indicatorId, `Successfully read ${exporters.length} telemetry exporter(s).`, "success");
37146
+ indicatorId = require_Console.createProgressIndicator("indeterminate", 0, "Importing telemetry exporters...");
37147
+ for (const { cat, id, provider } of exporters) try {
37148
+ await importTelemetry({ telemetry: { [cat]: [provider] } });
37149
+ run.recordSuccess();
37150
+ } catch (error) {
37151
+ require_Console.printError(error, `Error importing telemetry exporter ${id}`);
37152
+ run.recordFailure(id, causeOf(error));
37153
+ }
37154
+ require_Console.stopProgressIndicator(indicatorId, run.hasFailures ? "Telemetry import completed with failures." : `Successfully imported ${exporters.length} telemetry exporter(s).`, run.hasFailures ? "fail" : "success");
37155
+ return run.finish();
37156
+ } catch (error) {
37157
+ require_Console.stopProgressIndicator(indicatorId, `Failed to import Telemetry.`, "fail");
37158
+ require_Console.printError(error, "Error importing telemetry configuration");
37159
+ return false;
37160
+ }
37161
+ }
37162
+ /**
37163
+ * Deletes telemetry exporters: the ones of a category, one exporter by its id,
37164
+ * or all of them. The exporters are read once and deleted one by one, so that
37165
+ * an exporter that cannot be deleted is reported and does not hide the others.
37166
+ * An exporter without an id is never handed to the library, which takes a
37167
+ * missing id for "every exporter of the category".
37168
+ * @param {TelemetryExporterCategory} category optional exporter category (`otlp` or `splunk`). If omitted (undefined), the exporters of every category are targeted.
37169
+ * @param {string} name optional exact exporter id. If omitted (undefined), every exporter of the category is targeted; an empty name names no exporter: it is not found, and it never means "all".
37170
+ * @param {boolean} dryRun show which exporters would be deleted without deleting them
37171
+ * @param {boolean} allowFailures true to succeed although some exporters could not be deleted (the failures are still summarised)
37172
+ * @returns {Promise<boolean>} false if a named exporter does not exist, the exporters cannot be read, or an exporter cannot be deleted (unless failures are allowed for a deletion). Nothing to delete is a success when no exporter was named.
37173
+ */
37174
+ async function configManagerDeleteTelemetry(category, name, dryRun = false, allowFailures = false) {
37175
+ const run = new OperationRun({
37176
+ unit: "telemetry exporter",
37177
+ allowFailures
37178
+ });
37179
+ let telemetry;
37180
+ try {
37181
+ telemetry = await readTelemetry();
37182
+ } catch (error) {
37183
+ require_Console.printError(error);
37184
+ return false;
37185
+ }
37186
+ const selected = [];
37187
+ const seen = /* @__PURE__ */ new Set();
37188
+ for (const [exporterCategory, exporters] of Object.entries(telemetry ?? {})) {
37189
+ if (category !== void 0 && exporterCategory !== category) continue;
37190
+ if (!Array.isArray(exporters)) continue;
37191
+ for (const exporter of exporters) {
37192
+ if (name !== void 0 && exporter?.id !== name) continue;
37193
+ const key = `${exporterCategory}/${exporter?.id}`;
37194
+ if (typeof exporter?.id === "string" && seen.has(key)) continue;
37195
+ seen.add(key);
37196
+ selected.push({
37197
+ category: exporterCategory,
37198
+ exporter
37199
+ });
37200
+ }
37201
+ }
37202
+ if (selected.length === 0) {
37203
+ if (name !== void 0) {
37204
+ require_Console.printMessage(`Telemetry exporter '${name}' not found${category ? ` in category '${category}'` : ""}.`, "error");
37205
+ return false;
37206
+ }
37207
+ require_Console.printMessage(`No telemetry exporters found to delete${category ? ` in category '${category}'` : ""}.`, "warn");
37208
+ return true;
37209
+ }
37210
+ for (const { category: exporterCategory, exporter } of selected) {
37211
+ const id = exporter?.id;
37212
+ if (typeof id !== "string" || id.trim() === "") {
37213
+ const label = `${exporterCategory}/(no id)`;
37214
+ require_Console.printMessage(`Cannot delete a telemetry exporter without an id: ${label}`, "error");
37215
+ run.recordFailure(label, "the exporter has no id");
37216
+ continue;
37217
+ }
37218
+ const label = `${exporterCategory}/${id}`;
37219
+ if (dryRun) {
37220
+ require_Console.printMessage(`Dry run: Deleting telemetry exporter: ${label}`);
37221
+ continue;
37222
+ }
37223
+ try {
37224
+ const deleted = await deleteTelemetry(id, exporterCategory);
37225
+ if (Array.isArray(deleted) && deleted.length === 0) require_Console.printMessage(`Telemetry exporter ${label} was already gone, nothing to delete.`, "warn");
37226
+ else require_Console.printMessage(`Deleted telemetry exporter: ${label}`);
37227
+ run.recordSuccess();
37228
+ } catch (error) {
37229
+ require_Console.printError(error, `Error deleting telemetry exporter ${label}`);
37230
+ run.recordFailure(label, causeOf(error));
37231
+ }
37232
+ }
37233
+ return run.finish();
37234
+ }
37235
+ // src/cli/config-manager/config-manager-delete/config-manager-delete-telemetry.ts
37236
+ const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$189 } = require_dist$2.frodo.utils.constants;
37237
+ const deploymentTypes$195 = [CLOUD_DEPLOYMENT_TYPE_KEY$189];
37238
+ function setup$387() {
37239
+ const program = new FrodoCommand("frodo config-manager delete telemetry", [], deploymentTypes$195);
37240
+ program.description("Delete telemetry exporters.").addOption(new Option("-c, --category <category>", "Telemetry category to delete. If omitted, the exporters of every category are deleted, after a confirmation or with -y.").choices(["otlp", "splunk"])).addOption(new Option("-n, --name <name>", "Name (id) of a single exporter to delete, matched exactly. Requires --category.")).addOption(new Option("-d, --dry-run", "Preview telemetry exporters that would be deleted without deleting them.")).addOption(new Option("-y, --yes", "Skip confirmation for bulk deletion. Required for bulk deletion without a terminal.")).addHelpText("after", "Usage Examples:\n Delete all telemetry exporters without prompting:\n" + require_Console.theme.command(` $ frodo config-manager delete telemetry -y ${connId}\n`) + ` Preview deletion of all telemetry exporters:\n` + require_Console.theme.command(` $ frodo config-manager delete telemetry -d ${connId}\n`) + ` Delete all OTLP exporters without prompting:\n` + require_Console.theme.command(` $ frodo config-manager delete telemetry -c otlp -y ${connId}\n`) + ` Delete a specific OTLP exporter by name:\n` + require_Console.theme.command(` $ frodo config-manager delete telemetry -c otlp -n test-otlp ${connId}\n`)).multiOp().action(async (host, realm, user, password, options, command) => {
37241
+ command.handleDefaultArgsAndOpts(host, realm, user, password, options, command);
37242
+ if (options.name !== void 0 && options.name.trim() === "") {
37243
+ require_Console.printMessage("The telemetry exporter name (-n) must not be empty.", "error");
37244
+ process.exitCode = 1;
37245
+ return;
37246
+ }
37247
+ if (options.name !== void 0 && !options.category) {
37248
+ require_Console.printMessage("Named telemetry config requires category (e.g. --category otlp)", "error");
37249
+ process.exitCode = 1;
37250
+ return;
37251
+ }
37252
+ const bulk = options.name === void 0;
37253
+ const what = options.category ? `all telemetry exporters in category '${options.category}'` : "all telemetry exporters";
37254
+ if (bulk && !checkBulkDelete({
37255
+ what,
37256
+ yes: options.yes,
37257
+ dryRun: options.dryRun
37258
+ })) {
37259
+ process.exitCode = 1;
37260
+ return;
37261
+ }
37262
+ if (!await getTokens(false, true, deploymentTypes$195)) {
37263
+ process.exitCode = 1;
37264
+ return;
37265
+ }
37266
+ if (bulk && !await confirmBulkDelete({
37267
+ what,
37268
+ yes: options.yes,
37269
+ dryRun: options.dryRun,
37270
+ showPlan: () => configManagerDeleteTelemetry(options.category, void 0, true)
37271
+ })) {
37272
+ process.exitCode = 1;
37273
+ return;
37274
+ }
37275
+ require_Console.verboseMessage("Deleting telemetry.");
37276
+ if (!await configManagerDeleteTelemetry(options.category, options.name, options.dryRun, options.allowFailures)) process.exitCode = 1;
37277
+ });
37278
+ return program;
37279
+ }
37280
+ // src/configManagerOps/FrConfigTermsAndConditionsOps.ts
37281
+ const { saveJsonToFile: saveJsonToFile$44, getFilePath: getFilePath$45, readJsonFile: readJsonFile$28 } = require_dist$2.frodo.utils;
36277
37282
  const { readConfigEntity: readConfigEntity$13, importConfigEntities: importConfigEntities$12, updateConfigEntity: updateConfigEntity$1 } = require_dist$2.frodo.idm.config;
36278
37283
  /**
36279
37284
  * Export terms and conditions to file in fr-config-manager format
@@ -36287,7 +37292,7 @@ async function configManagerExportTermsAndConditions() {
36287
37292
  const directoryName = `terms-conditions`;
36288
37293
  version.termsTranslations[language] = extractFrConfigDataToFile(text, languageFileName, directoryName);
36289
37294
  }
36290
- saveJsonToFile$45(exportData, getFilePath$46("terms-conditions/terms-conditions.json", true), false);
37295
+ saveJsonToFile$44(exportData, getFilePath$45("terms-conditions/terms-conditions.json", true), false);
36291
37296
  return true;
36292
37297
  } catch (error) {
36293
37298
  require_Console.printError(error);
@@ -36300,10 +37305,10 @@ async function configManagerExportTermsAndConditions() {
36300
37305
  */
36301
37306
  async function configManagerImportTermsAndConditions() {
36302
37307
  try {
36303
- const termsAndConditions = readJsonFile$29(getFilePath$46("terms-conditions/terms-conditions.json"));
37308
+ const termsAndConditions = readJsonFile$28(getFilePath$45("terms-conditions/terms-conditions.json"));
36304
37309
  for (const version of termsAndConditions.versions) for (const [language] of Object.entries(version.termsTranslations)) {
36305
37310
  const languageFileName = `${version.version}/${language}.html`;
36306
- const fileDir = getFilePath$46(`terms-conditions/${languageFileName}`);
37311
+ const fileDir = getFilePath$45(`terms-conditions/${languageFileName}`);
36307
37312
  version.termsTranslations[language] = fs.default.readFileSync(fileDir, "utf8");
36308
37313
  }
36309
37314
  await importConfigEntities$12({ idm: { [termsAndConditions._id]: termsAndConditions } });
@@ -36424,7 +37429,7 @@ function setup$386() {
36424
37429
  return program;
36425
37430
  }
36426
37431
  // src/configManagerOps/FrConfigVariableOps.ts
36427
- const { getFilePath: getFilePath$45, saveJsonToFile: saveJsonToFile$44, readJsonFile: readJsonFile$28 } = require_dist$2.frodo.utils;
37432
+ const { getFilePath: getFilePath$44, saveJsonToFile: saveJsonToFile$43, readJsonFile: readJsonFile$27 } = require_dist$2.frodo.utils;
36428
37433
  const { readVariables: readVariables$1, importVariables: importVariables$1, deleteVariable: deleteVariable$1 } = require_dist$2.frodo.cloud.variable;
36429
37434
  /**
36430
37435
  * Format a variable as a shell assignment, `NAME='value'`, that can be sourced.
@@ -36488,7 +37493,7 @@ async function configManagerExportVariables(report, dump, allowFailures = false)
36488
37493
  description: escapePlaceholders$4(variable.description),
36489
37494
  valueBase64: "${" + envVariable + "}"
36490
37495
  };
36491
- saveJsonToFile$44(variableObject, getFilePath$45(`esvs/variables/${variable._id}.json`, true), false);
37496
+ saveJsonToFile$43(variableObject, getFilePath$44(`esvs/variables/${variable._id}.json`, true), false);
36492
37497
  if (dump) require_Console.printMessage(formatEnvAssignment(envVariable, variable.value), "data");
36493
37498
  });
36494
37499
  require_Console.updateProgressIndicator(indicatorId, `Writing variable ${variable._id}`);
@@ -36521,7 +37526,7 @@ async function configManagerImportVariables(variableName, allowFailures = false)
36521
37526
  let indicatorId;
36522
37527
  const spinnerId = require_Console.createProgressIndicator("indeterminate", 0, `Reading variables...`);
36523
37528
  try {
36524
- const variablesDir = getFilePath$45(`esvs/variables`);
37529
+ const variablesDir = getFilePath$44(`esvs/variables`);
36525
37530
  if (!fs.default.existsSync(variablesDir)) {
36526
37531
  require_Console.stopProgressIndicator(spinnerId, `No variables directory found`, "fail");
36527
37532
  return false;
@@ -36535,7 +37540,7 @@ async function configManagerImportVariables(variableName, allowFailures = false)
36535
37540
  indicatorId = require_Console.createProgressIndicator("determinate", fileNames.length, "Importing variables");
36536
37541
  const importData = { variable: {} };
36537
37542
  for (const fileName of fileNames) try {
36538
- const variable = readJsonFile$28(`${variablesDir}/${fileName}`);
37543
+ const variable = readJsonFile$27(`${variablesDir}/${fileName}`);
36539
37544
  variable.value = variable.valueBase64;
36540
37545
  importData.variable[variable._id] = variable;
36541
37546
  } catch (error) {
@@ -36670,21 +37675,22 @@ function setup$385() {
36670
37675
  // src/cli/config-manager/config-manager-delete/config-manager-delete.ts
36671
37676
  function setup$384() {
36672
37677
  const program = new FrodoStubCommand("delete").description("Delete configuration optimized for CI/CD pipelines (format compatible with fr-config-manager).");
36673
- program.addCommand(setup$399().name("test"));
36674
- program.addCommand(setup$398().name("applications"));
36675
- program.addCommand(setup$392().name("custom-nodes"));
36676
- program.addCommand(setup$396().name("endpoints"));
36677
- program.addCommand(setup$389().name("scripts"));
36678
- program.addCommand(setup$393().name("themes"));
36679
- program.addCommand(setup$397().name("email-templates"));
36680
- program.addCommand(setup$387().name("secrets"));
37678
+ program.addCommand(setup$400().name("test"));
37679
+ program.addCommand(setup$399().name("applications"));
37680
+ program.addCommand(setup$393().name("custom-nodes"));
37681
+ program.addCommand(setup$397().name("endpoints"));
37682
+ program.addCommand(setup$390().name("scripts"));
37683
+ program.addCommand(setup$394().name("themes"));
37684
+ program.addCommand(setup$398().name("email-templates"));
37685
+ program.addCommand(setup$388().name("secrets"));
36681
37686
  program.addCommand(setup$386().name("terms-and-conditions"));
36682
37687
  program.addCommand(setup$385().name("variables"));
36683
- program.addCommand(setup$395().name("locales"));
36684
- program.addCommand(setup$394().name("oauth-cimd-profiles"));
36685
- program.addCommand(setup$391().name("oauth-issuers"));
36686
- program.addCommand(setup$390().name("schedules"));
36687
- program.addCommand(setup$388().name("secret-mappings"));
37688
+ program.addCommand(setup$396().name("locales"));
37689
+ program.addCommand(setup$395().name("oauth-cimd-profiles"));
37690
+ program.addCommand(setup$392().name("oauth-issuers"));
37691
+ program.addCommand(setup$391().name("schedules"));
37692
+ program.addCommand(setup$389().name("secret-mappings"));
37693
+ program.addCommand(setup$387().name("telemetry"));
36688
37694
  return program;
36689
37695
  }
36690
37696
  // src/configManagerOps/ConfigFileStep.ts
@@ -37149,7 +38155,7 @@ function ownedObjectMessage(kind, id, owners, withRealm = false, direction = "pu
37149
38155
  return `${KIND_LABEL$1[kind]} ${id} is owned by ${who} and is ${direction} by "${command} applications".`;
37150
38156
  }
37151
38157
  // src/configManagerOps/FrConfigConnectorMappingOps.ts
37152
- const { getFilePath: getFilePath$44, saveJsonToFile: saveJsonToFile$43, readJsonFile: readJsonFile$27, getWorkingDirectory: getWorkingDirectory$30 } = require_dist$2.frodo.utils;
38158
+ const { getFilePath: getFilePath$43, saveJsonToFile: saveJsonToFile$42, readJsonFile: readJsonFile$26, getWorkingDirectory: getWorkingDirectory$30 } = require_dist$2.frodo.utils;
37153
38159
  const { readConfigEntity: readConfigEntity$12, importConfigEntities: importConfigEntities$11, importSubConfigEntity: importSubConfigEntity$1 } = require_dist$2.frodo.idm.config;
37154
38160
  /**
37155
38161
  * Write one mapping in fr-config-manager format: the script sources of the mapping
@@ -37172,7 +38178,7 @@ function exportMappingToDirectory(mapping, mappingPath) {
37172
38178
  }
37173
38179
  });
37174
38180
  const fileName = `${mappingPath}/${mapping.name}.json`;
37175
- saveJsonToFile$43(mapping, getFilePath$44(fileName, true), false, true);
38181
+ saveJsonToFile$42(mapping, getFilePath$43(fileName, true), false, true);
37176
38182
  }
37177
38183
  /**
37178
38184
  * Read the sync configuration, which holds the mappings. A tenant that never had a mapping has no
@@ -37265,7 +38271,7 @@ function getExtractedFiles$1(obj, connectorMappingDirectory) {
37265
38271
  * @returns {object} The connector mapping data from the file, including data from any extracted files
37266
38272
  */
37267
38273
  function getConnectorMappingImportData(file) {
37268
- const importData = readJsonFile$27(file);
38274
+ const importData = readJsonFile$26(file);
37269
38275
  getExtractedFiles$1(importData, path.default.dirname(file));
37270
38276
  return importData;
37271
38277
  }
@@ -37295,24 +38301,24 @@ async function configManagerImportMappings(name) {
37295
38301
  return true;
37296
38302
  };
37297
38303
  if (name) {
37298
- const jsonFilePath = getFilePath$44(`sync/mappings/${name}/${name}.json`);
38304
+ const jsonFilePath = getFilePath$43(`sync/mappings/${name}/${name}.json`);
37299
38305
  if (skipIfOwned(name, jsonFilePath)) return true;
37300
38306
  const importData = getConnectorMappingImportData(jsonFilePath);
37301
38307
  await importSubConfigEntity$1("sync", importData);
37302
38308
  return true;
37303
38309
  } else {
37304
- const mappingDir = getFilePath$44("sync/mappings");
38310
+ const mappingDir = getFilePath$43("sync/mappings");
37305
38311
  const mappingFiles = fs.default.readdirSync(mappingDir);
37306
38312
  const importMappingData = { idm: { sync: {
37307
38313
  _id: "sync",
37308
38314
  mappings: []
37309
38315
  } } };
37310
38316
  for (const mappingFile of mappingFiles) {
37311
- const jsonFilePath = getFilePath$44(`sync/mappings/${mappingFile}/${mappingFile}.json`);
38317
+ const jsonFilePath = getFilePath$43(`sync/mappings/${mappingFile}/${mappingFile}.json`);
37312
38318
  if (skipIfOwned(mappingFile, jsonFilePath)) continue;
37313
38319
  const importData = getConnectorMappingImportData(jsonFilePath);
37314
38320
  if (importData.file) {
37315
- const scriptPath = getFilePath$44(`sync/mappings/${mappingFile}/${importData.file}`);
38321
+ const scriptPath = getFilePath$43(`sync/mappings/${mappingFile}/${importData.file}`);
37316
38322
  importData.source = fs.default.readFileSync(scriptPath, "utf8");
37317
38323
  delete importData.file;
37318
38324
  }
@@ -37338,10 +38344,10 @@ async function configManagerImportMappings(name) {
37338
38344
  * @throws {FrodoError} if a file cannot be read
37339
38345
  */
37340
38346
  function readMappingFromDirectory(mappingPath, name) {
37341
- return getConnectorMappingImportData(getFilePath$44(`${mappingPath}/${name}.json`));
38347
+ return getConnectorMappingImportData(getFilePath$43(`${mappingPath}/${name}.json`));
37342
38348
  }
37343
38349
  // src/configManagerOps/FrConfigSamlOps.ts
37344
- const { getFilePath: getFilePath$43, saveJsonToFile: saveJsonToFile$42, readJsonFile: readJsonFile$26, getWorkingDirectory: getWorkingDirectory$29 } = require_dist$2.frodo.utils;
38350
+ const { getFilePath: getFilePath$42, saveJsonToFile: saveJsonToFile$41, readJsonFile: readJsonFile$25, getWorkingDirectory: getWorkingDirectory$29 } = require_dist$2.frodo.utils;
37345
38351
  const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$185, DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$8 } = require_dist$2.frodo.utils.constants;
37346
38352
  const { exportSaml2Provider: exportSaml2Provider$1, importSaml2Providers: importSaml2Providers$1 } = require_dist$2.frodo.saml2.entityProvider;
37347
38353
  const { exportCircleOfTrust: exportCircleOfTrust$1, importCirclesOfTrust: importCirclesOfTrust$1 } = require_dist$2.frodo.saml2.circlesOfTrust;
@@ -37356,7 +38362,7 @@ const { exportCircleOfTrust: exportCircleOfTrust$1, importCirclesOfTrust: import
37356
38362
  async function exportCircleOfTrustToFile$1(cotId, realm) {
37357
38363
  const cotResult = await exportCircleOfTrust$1(cotId);
37358
38364
  const fileDirectory = `realms/${realm === "/" ? "root" : realm}/realm-config/saml/COT`;
37359
- saveJsonToFile$42(cotResult.saml.cot[cotId], getFilePath$43(`${fileDirectory}/${cotId}.json`, true), false, true);
38365
+ saveJsonToFile$41(cotResult.saml.cot[cotId], getFilePath$42(`${fileDirectory}/${cotId}.json`, true), false, true);
37360
38366
  }
37361
38367
  /**
37362
38368
  * Read one SAML provider in the shape of the files of config-manager: the
@@ -37440,7 +38446,7 @@ async function configManagerExportSaml(file, allowFailures = false, layout) {
37440
38446
  let fileName;
37441
38447
  if (samlProvider.fileName) fileName = samlProvider.fileName;
37442
38448
  else fileName = safeFileNameUnderscore(samlProvider.entityId);
37443
- saveJsonToFile$42(saveObject, getFilePath$43(`${fileDirectory}/${fileName}.json`, true), false, true);
38449
+ saveJsonToFile$41(saveObject, getFilePath$42(`${fileDirectory}/${fileName}.json`, true), false, true);
37444
38450
  run.recordSuccess();
37445
38451
  } catch (error) {
37446
38452
  require_Console.printError(error, `Error exporting SAML provider '${samlProvider.entityId}' of realm '${realm}'`);
@@ -37498,7 +38504,7 @@ function findCirclesOfTrustOfProviders(realm, entityIds) {
37498
38504
  const found = [];
37499
38505
  for (const file of fs.default.readdirSync(cotDir).sort()) {
37500
38506
  if (!file.endsWith(".json")) continue;
37501
- const cot = readJsonFile$26(`${cotDir}/${file}`);
38507
+ const cot = readJsonFile$25(`${cotDir}/${file}`);
37502
38508
  if ((cot.trustedProviders ?? []).some((member) => members.has(String(member).toLowerCase()))) found.push(cot._id);
37503
38509
  }
37504
38510
  return found;
@@ -37514,7 +38520,7 @@ function findCirclesOfTrustOfProviders(realm, entityIds) {
37514
38520
  */
37515
38521
  async function importCircleOfTrustFromFile$1(cotId, realm) {
37516
38522
  const realmDir = realm === "/" ? "root" : realm;
37517
- const cot = readJsonFile$26(`${getWorkingDirectory$29()}/realms/${realmDir}/realm-config/saml/COT/${cotId}.json`);
38523
+ const cot = readJsonFile$25(`${getWorkingDirectory$29()}/realms/${realmDir}/realm-config/saml/COT/${cotId}.json`);
37518
38524
  await importCirclesOfTrust$1({
37519
38525
  script: {},
37520
38526
  saml: {
@@ -37606,7 +38612,7 @@ async function configManagerImportSaml(realm, entityName, allowFailures = false)
37606
38612
  continue;
37607
38613
  }
37608
38614
  }
37609
- const providerData = readJsonFile$26(`${dir}/${file}`);
38615
+ const providerData = readJsonFile$25(`${dir}/${file}`);
37610
38616
  const entityId = providerData.config.entityId;
37611
38617
  label = entityId;
37612
38618
  const samlConfig = {
@@ -37630,7 +38636,7 @@ async function configManagerImportSaml(realm, entityName, allowFailures = false)
37630
38636
  if (fs.default.existsSync(cotDir)) for (const file of fs.default.readdirSync(cotDir)) {
37631
38637
  if (!file.endsWith(".json")) continue;
37632
38638
  try {
37633
- const cotData = readJsonFile$26(`${cotDir}/${file}`);
38639
+ const cotData = readJsonFile$25(`${cotDir}/${file}`);
37634
38640
  cots[cotData._id] = cotData;
37635
38641
  } catch (error) {
37636
38642
  require_Console.printError(error, `Error reading circle of trust file '${file}' of realm '${currentRealm}'`);
@@ -37672,7 +38678,7 @@ async function configManagerImportSaml(realm, entityName, allowFailures = false)
37672
38678
  return false;
37673
38679
  }
37674
38680
  // src/ops/ApplicationConfigOps.ts
37675
- const { getFilePath: getFilePath$42, saveJsonToFile: saveJsonToFile$41, getWorkingDirectory: getWorkingDirectory$28, escapePlaceholders: escapePlaceholders$2, readJsonFile: readJsonFile$25 } = require_dist$2.frodo.utils;
38681
+ const { getFilePath: getFilePath$41, saveJsonToFile: saveJsonToFile$40, getWorkingDirectory: getWorkingDirectory$28, escapePlaceholders: escapePlaceholders$2, readJsonFile: readJsonFile$24 } = require_dist$2.frodo.utils;
37676
38682
  const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$7, CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$184 } = require_dist$2.frodo.utils.constants;
37677
38683
  /** What is not written into `application.json`: runtime and access data of the tenant, and the glossary (cli#1132). */
37678
38684
  const RECORD_FIELDS_NOT_PULLED = [
@@ -37875,25 +38881,25 @@ async function pullApplication(application, realm, folder, readMappings) {
37875
38881
  const references = await require_dist$2.frodo.app.readApplicationReferences(application._id);
37876
38882
  const record = { ...application };
37877
38883
  for (const field of RECORD_FIELDS_NOT_PULLED) delete record[field];
37878
- await piece("the application record", () => saveJsonToFile$41(escapePlaceholders$2(record), getFilePath$42(`${folder}/application.json`, true), false, false));
38884
+ await piece("the application record", () => saveJsonToFile$40(escapePlaceholders$2(record), getFilePath$41(`${folder}/application.json`, true), false, false));
37879
38885
  const owned = (kind) => references.references.filter((reference) => reference.ownership === "owned" && reference.kind === kind);
37880
38886
  const shared = (kind) => references.references.filter((reference) => reference.ownership === "shared" && reference.kind === kind);
37881
38887
  for (const client of owned("oauth2Client")) await piece(`OAuth2 client ${client.id}`, async () => {
37882
38888
  const agent = await require_dist$2.frodo.agent.readAgentByTypeAndId("OAuth2Client", client.id);
37883
38889
  if (isConfidentialClient(agent)) require_Console.verboseMessage(`The secret of the OAuth2 client of application '${application.name}' is written as \${${clientSecretVariable(application.name)}}; set that variable when you push.`);
37884
- saveJsonToFile$41(clientFile(agent, application.name), getFilePath$42(`${folder}/oauth2-client.json`, true), false, false, true);
38890
+ saveJsonToFile$40(clientFile(agent, application.name), getFilePath$41(`${folder}/oauth2-client.json`, true), false, false, true);
37885
38891
  });
37886
38892
  for (const provider of owned("saml2Provider")) await piece(`SAML provider ${provider.id}`, async () => {
37887
38893
  const { config, metadata } = await readSamlProviderForFile(provider.id);
37888
38894
  const role = provider.from === "ssoEntities.idpPrivateId" ? "idp" : "sp";
37889
- saveJsonToFile$41({
38895
+ saveJsonToFile$40({
37890
38896
  config,
37891
38897
  metadata
37892
- }, getFilePath$42(`${folder}/saml/${role}.json`, true), false, true);
38898
+ }, getFilePath$41(`${folder}/saml/${role}.json`, true), false, true);
37893
38899
  });
37894
38900
  for (const connector of owned("connector")) await piece(`connector ${connector.id}`, async () => {
37895
38901
  const definition = await require_dist$2.frodo.idm.connector.readConnector(connector.id);
37896
- saveJsonToFile$41(escapePlaceholders$2(definition), getFilePath$42(`${folder}/connector.json`, true), false, true);
38902
+ saveJsonToFile$40(escapePlaceholders$2(definition), getFilePath$41(`${folder}/connector.json`, true), false, true);
37897
38903
  });
37898
38904
  const mappingNames = owned("mapping").map((mapping) => mapping.id);
37899
38905
  if (mappingNames.length > 0) await piece("the mappings", async () => {
@@ -37943,7 +38949,7 @@ const DEFAULT_PROVIDER_LOCATION = {
37943
38949
  */
37944
38950
  function readApplicationFolder(folder, relativeFolder) {
37945
38951
  if (!fs.default.existsSync(`${folder}/application.json`)) throw new Error(`the folder has no application.json`);
37946
- const record = readJsonFile$25(`${folder}/application.json`);
38952
+ const record = readJsonFile$24(`${folder}/application.json`);
37947
38953
  if (!record?.name) throw new Error(`application.json has no name`);
37948
38954
  const owned = require_dist$2.frodo.app.getApplicationRecordReferences(record).filter((reference) => reference.ownership === "owned");
37949
38955
  const files = {
@@ -37959,7 +38965,7 @@ function readApplicationFolder(folder, relativeFolder) {
37959
38965
  };
37960
38966
  if (owned.some((reference) => reference.kind === "oauth2Client")) {
37961
38967
  if (need("oauth2-client.json")) {
37962
- files.client = readJsonFile$25(`${folder}/oauth2-client.json`);
38968
+ files.client = readJsonFile$24(`${folder}/oauth2-client.json`);
37963
38969
  if (!files.client?._id) throw new Error(`oauth2-client.json has no _id`);
37964
38970
  }
37965
38971
  }
@@ -37967,7 +38973,7 @@ function readApplicationFolder(folder, relativeFolder) {
37967
38973
  const role = reference.from === "ssoEntities.idpPrivateId" ? "idp" : "sp";
37968
38974
  const file = `saml/${role}.json`;
37969
38975
  if (!need(file)) continue;
37970
- const content = readJsonFile$25(`${folder}/${file}`);
38976
+ const content = readJsonFile$24(`${folder}/${file}`);
37971
38977
  if (!content?.config?.entityId) throw new Error(`${file} has no config with an entityId`);
37972
38978
  const stated = record.ssoEntities?.[`${role}Location`];
37973
38979
  files.providers.push({
@@ -37977,7 +38983,7 @@ function readApplicationFolder(folder, relativeFolder) {
37977
38983
  });
37978
38984
  }
37979
38985
  if (owned.some((reference) => reference.kind === "connector")) {
37980
- if (need("connector.json")) files.connector = readJsonFile$25(`${folder}/connector.json`);
38986
+ if (need("connector.json")) files.connector = readJsonFile$24(`${folder}/connector.json`);
37981
38987
  }
37982
38988
  for (const reference of owned.filter((r) => r.kind === "mapping")) {
37983
38989
  if (!need(`mappings/${reference.id}/${reference.id}.json`)) continue;
@@ -39024,7 +40030,7 @@ function setup$373() {
39024
40030
  }
39025
40031
  // src/configManagerOps/FrConfigAccessConfigOps.ts
39026
40032
  const { readConfigEntity: readConfigEntity$11, importConfigEntities: importConfigEntities$10 } = require_dist$2.frodo.idm.config;
39027
- const { getFilePath: getFilePath$41, saveJsonToFile: saveJsonToFile$40, readJsonFile: readJsonFile$24 } = require_dist$2.frodo.utils;
40033
+ const { getFilePath: getFilePath$40, saveJsonToFile: saveJsonToFile$39, readJsonFile: readJsonFile$23 } = require_dist$2.frodo.utils;
39028
40034
  /**
39029
40035
  * Export IDM access configuration object in the fr-config-manager format.
39030
40036
  * @return {Promise<boolean>} a promise that resolves to true if successful, false otherwise
@@ -39032,7 +40038,7 @@ const { getFilePath: getFilePath$41, saveJsonToFile: saveJsonToFile$40, readJson
39032
40038
  async function configManagerExportAccessConfig() {
39033
40039
  try {
39034
40040
  const exportData = await readConfigEntity$11("access");
39035
- saveJsonToFile$40(exportData, getFilePath$41("access-config/access.json", true), false);
40041
+ saveJsonToFile$39(exportData, getFilePath$40("access-config/access.json", true), false);
39036
40042
  return true;
39037
40043
  } catch (error) {
39038
40044
  require_Console.printError(error, `Error exporting IDM access configuration`);
@@ -39045,7 +40051,7 @@ async function configManagerExportAccessConfig() {
39045
40051
  */
39046
40052
  async function configManagerImportAccessConfig() {
39047
40053
  try {
39048
- const importData = readJsonFile$24(getFilePath$41("access-config/access.json"));
40054
+ const importData = readJsonFile$23(getFilePath$40("access-config/access.json"));
39049
40055
  await importConfigEntities$10({ idm: { [importData._id]: importData } });
39050
40056
  return true;
39051
40057
  } catch (error) {
@@ -39068,7 +40074,7 @@ function setup$372() {
39068
40074
  return program;
39069
40075
  }
39070
40076
  // src/ops/RemoteProxyOps.ts
39071
- const { getTypedFilename: getTypedFilename$16, saveJsonToFile: saveJsonToFile$39, getFilePath: getFilePath$40, getWorkingDirectory: getWorkingDirectory$26, readJsonFile: readJsonFile$23 } = require_dist$2.frodo.utils;
40077
+ const { getTypedFilename: getTypedFilename$16, saveJsonToFile: saveJsonToFile$38, getFilePath: getFilePath$39, getWorkingDirectory: getWorkingDirectory$26, readJsonFile: readJsonFile$22 } = require_dist$2.frodo.utils;
39072
40078
  const { remoteProxy: remoteProxy$1 } = require_dist$2.frodo.idm;
39073
40079
  /** Where `config-manager` keeps the remote proxies: one file per proxy, named after it. */
39074
40080
  const CONFIG_MANAGER_DIRECTORY = "remote-proxies";
@@ -39309,11 +40315,11 @@ async function exportRemoteProxyToFile(proxyId, file, includeMeta = true) {
39309
40315
  let indicatorId;
39310
40316
  try {
39311
40317
  const fileName = file || getTypedFilename$16(proxyId, REMOTE_PROXY_FILE_TYPE);
39312
- const filePath = getFilePath$40(fileName, true);
40318
+ const filePath = getFilePath$39(fileName, true);
39313
40319
  indicatorId = require_Console.createProgressIndicator("determinate", 1, `Exporting ${proxyId}`);
39314
40320
  const exportData = await remoteProxy$1.exportRemoteProxy(proxyId);
39315
40321
  require_Console.updateProgressIndicator(indicatorId, `Writing file ${filePath}`);
39316
- saveJsonToFile$39(exportData, filePath, includeMeta);
40322
+ saveJsonToFile$38(exportData, filePath, includeMeta);
39317
40323
  require_Console.stopProgressIndicator(indicatorId, `Exported ${require_Console.theme.heading(proxyId)} to ${require_Console.theme.heading(filePath)}.`);
39318
40324
  warnTenantBoundSecrets(exportData.remoteProxy);
39319
40325
  return true;
@@ -39332,10 +40338,10 @@ async function exportRemoteProxyToFile(proxyId, file, includeMeta = true) {
39332
40338
  async function exportRemoteProxiesToFile(file, includeMeta = true) {
39333
40339
  try {
39334
40340
  const fileName = file || getTypedFilename$16("allRemoteProxies", REMOTE_PROXY_FILE_TYPE);
39335
- const filePath = getFilePath$40(fileName, true);
40341
+ const filePath = getFilePath$39(fileName, true);
39336
40342
  const exportData = await remoteProxy$1.exportRemoteProxies();
39337
40343
  keepAddressableInExport(exportData);
39338
- saveJsonToFile$39(exportData, filePath, includeMeta);
40344
+ saveJsonToFile$38(exportData, filePath, includeMeta);
39339
40345
  require_Console.printMessage(`Exported ${countProxies(Object.keys(exportData.remoteProxy).length)} to ${filePath}.`, "info");
39340
40346
  warnTenantBoundSecrets(exportData.remoteProxy);
39341
40347
  return true;
@@ -39368,7 +40374,7 @@ async function exportRemoteProxiesToFiles(includeMeta = true, allowFailures = fa
39368
40374
  const fileData = remoteProxy$1.createRemoteProxyExportTemplate();
39369
40375
  fileData.remoteProxy[name] = proxy;
39370
40376
  require_Console.updateProgressIndicator(indicatorId, `Exporting ${name}`);
39371
- saveJsonToFile$39(fileData, getFilePath$40(getTypedFilename$16(name, REMOTE_PROXY_FILE_TYPE), true), includeMeta);
40377
+ saveJsonToFile$38(fileData, getFilePath$39(getTypedFilename$16(name, REMOTE_PROXY_FILE_TYPE), true), includeMeta);
39372
40378
  });
39373
40379
  require_Console.stopProgressIndicator(indicatorId, run.hasFailures ? "Some remote proxies could not be written." : `${countProxies(entries.length)} written.`, run.hasFailures ? "fail" : "success");
39374
40380
  warnTenantBoundSecrets(exportData.remoteProxy);
@@ -39452,7 +40458,7 @@ async function runImportInto(run, importData, source) {
39452
40458
  }
39453
40459
  }
39454
40460
  function readImportFile$3(file) {
39455
- return JSON.parse(fs.default.readFileSync(getFilePath$40(file), "utf8"));
40461
+ return JSON.parse(fs.default.readFileSync(getFilePath$39(file), "utf8"));
39456
40462
  }
39457
40463
  /**
39458
40464
  * Import one remote proxy from a file
@@ -39464,7 +40470,7 @@ async function importRemoteProxyFromFile(proxyId, file) {
39464
40470
  try {
39465
40471
  const fileData = readImportFile$3(file);
39466
40472
  if (!fileData.remoteProxy?.[proxyId]) {
39467
- require_Console.printMessage(`Remote proxy ${proxyId} not found in ${getFilePath$40(file)}!`, "error");
40473
+ require_Console.printMessage(`Remote proxy ${proxyId} not found in ${getFilePath$39(file)}!`, "error");
39468
40474
  return false;
39469
40475
  }
39470
40476
  return await runImport({
@@ -39486,7 +40492,7 @@ async function importFirstRemoteProxyFromFile(file) {
39486
40492
  const fileData = readImportFile$3(file);
39487
40493
  const [first] = Object.keys(fileData.remoteProxy ?? {});
39488
40494
  if (!first) {
39489
- require_Console.printMessage(`No remote proxy found in ${getFilePath$40(file)}!`, "error");
40495
+ require_Console.printMessage(`No remote proxy found in ${getFilePath$39(file)}!`, "error");
39490
40496
  return false;
39491
40497
  }
39492
40498
  return await importRemoteProxyFromFile(first, file);
@@ -39748,7 +40754,7 @@ async function configManagerExportRemoteProxies(name, quiet = false, allowFailur
39748
40754
  for (const proxy of proxies) {
39749
40755
  const proxyName = getName$1(proxy);
39750
40756
  await run.run(proxyName, () => {
39751
- saveJsonToFile$39(proxy, getFilePath$40(`${CONFIG_MANAGER_DIRECTORY}/${proxyName}.json`, true), false, true);
40757
+ saveJsonToFile$38(proxy, getFilePath$39(`${CONFIG_MANAGER_DIRECTORY}/${proxyName}.json`, true), false, true);
39752
40758
  written[proxyName] = proxy;
39753
40759
  });
39754
40760
  }
@@ -39781,15 +40787,15 @@ async function configManagerImportRemoteProxies(name, allowFailures = false) {
39781
40787
  allowFailures
39782
40788
  });
39783
40789
  try {
39784
- const directory = getFilePath$40(CONFIG_MANAGER_DIRECTORY);
40790
+ const directory = getFilePath$39(CONFIG_MANAGER_DIRECTORY);
39785
40791
  const files = name ? [`${name}.json`] : fs.default.existsSync(directory) ? fs.default.readdirSync(directory).filter((file) => file.endsWith(".json")).sort() : [];
39786
- if (files.length === 0 || name && !fs.default.existsSync(getFilePath$40(`${CONFIG_MANAGER_DIRECTORY}/${files[0]}`))) {
40792
+ if (files.length === 0 || name && !fs.default.existsSync(getFilePath$39(`${CONFIG_MANAGER_DIRECTORY}/${files[0]}`))) {
39787
40793
  require_Console.printMessage(name ? `Remote proxy file ${files[0]} not found in ${directory}.` : `No remote proxy files found in ${directory}.`, "error");
39788
40794
  return false;
39789
40795
  }
39790
40796
  const importData = { remoteProxy: {} };
39791
40797
  for (const file of files) try {
39792
- importData.remoteProxy[file.replace(/\.json$/, "")] = readJsonFile$23(getFilePath$40(`${CONFIG_MANAGER_DIRECTORY}/${file}`));
40798
+ importData.remoteProxy[file.replace(/\.json$/, "")] = readJsonFile$22(getFilePath$39(`${CONFIG_MANAGER_DIRECTORY}/${file}`));
39793
40799
  } catch (error) {
39794
40800
  require_Console.printError(error);
39795
40801
  if (name) return false;
@@ -39816,7 +40822,7 @@ async function configManagerImportRemoteProxies(name, allowFailures = false) {
39816
40822
  }
39817
40823
  // src/configManagerOps/FrConfigAuditOps.ts
39818
40824
  const { readConfigEntity: readConfigEntity$10, importConfigEntities: importConfigEntities$9 } = require_dist$2.frodo.idm.config;
39819
- const { getFilePath: getFilePath$39, saveJsonToFile: saveJsonToFile$38, readJsonFile: readJsonFile$22 } = require_dist$2.frodo.utils;
40825
+ const { getFilePath: getFilePath$38, saveJsonToFile: saveJsonToFile$37, readJsonFile: readJsonFile$21 } = require_dist$2.frodo.utils;
39820
40826
  /**
39821
40827
  * Export IDM audit configuration object in the fr-config-manager format.
39822
40828
  * @return {Promise<boolean>} a promise that resolves to true if successful, false otherwise
@@ -39824,7 +40830,7 @@ const { getFilePath: getFilePath$39, saveJsonToFile: saveJsonToFile$38, readJson
39824
40830
  async function configManagerExportAudit() {
39825
40831
  try {
39826
40832
  const exportData = await readConfigEntity$10("audit");
39827
- saveJsonToFile$38(exportData, getFilePath$39("audit/audit.json", true), false);
40833
+ saveJsonToFile$37(exportData, getFilePath$38("audit/audit.json", true), false);
39828
40834
  return true;
39829
40835
  } catch (error) {
39830
40836
  require_Console.printError(error, `Error exporting IDM audit configuration`);
@@ -39837,7 +40843,7 @@ async function configManagerExportAudit() {
39837
40843
  */
39838
40844
  async function configManagerImportAudit() {
39839
40845
  try {
39840
- const importData = readJsonFile$22(getFilePath$39("audit/audit.json"));
40846
+ const importData = readJsonFile$21(getFilePath$38("audit/audit.json"));
39841
40847
  await importConfigEntities$9({ idm: { [importData._id]: importData } });
39842
40848
  return true;
39843
40849
  } catch (error) {
@@ -39847,7 +40853,7 @@ async function configManagerImportAudit() {
39847
40853
  }
39848
40854
  // src/configManagerOps/FrConfigAuthenticationOps.ts
39849
40855
  const { readAuthenticationSettings: _readAuthenticationSettings, importAuthenticationSettings } = require_dist$2.frodo.authn.settings;
39850
- const { getFilePath: getFilePath$38, saveJsonToFile: saveJsonToFile$37, readJsonFile: readJsonFile$21, getWorkingDirectory: getWorkingDirectory$25 } = require_dist$2.frodo.utils;
40856
+ const { getFilePath: getFilePath$37, saveJsonToFile: saveJsonToFile$36, readJsonFile: readJsonFile$20, getWorkingDirectory: getWorkingDirectory$25 } = require_dist$2.frodo.utils;
39851
40857
  const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$5 } = require_dist$2.frodo.utils.constants;
39852
40858
  /**
39853
40859
  * Export authentication settings in the fr-config-manager format.
@@ -39867,7 +40873,7 @@ async function configManagerExportAuthentication(realm, allowFailures = false) {
39867
40873
  await run.run(realm, async () => {
39868
40874
  require_dist$2.state.setRealm(realm);
39869
40875
  const exportData = await _readAuthenticationSettings(false);
39870
- saveJsonToFile$37(exportData, getFilePath$38(`realms/${realm === "/" ? "root" : realm}/realm-config/authentication.json`, true), false, true);
40876
+ saveJsonToFile$36(exportData, getFilePath$37(`realms/${realm === "/" ? "root" : realm}/realm-config/authentication.json`, true), false, true);
39871
40877
  });
39872
40878
  }
39873
40879
  return run.finish();
@@ -39898,7 +40904,7 @@ async function configManagerImportAuthentication(realm, allowFailures = false) {
39898
40904
  for (const realmDir of realmDirs) {
39899
40905
  const realmName = realmDir === "root" ? "/" : realmDir;
39900
40906
  if (realmName === "/" && require_dist$2.state.getDeploymentType() === require_dist$2.frodo.utils.constants.CLOUD_DEPLOYMENT_TYPE_KEY) continue;
39901
- const filePath = getFilePath$38(`realms/${realmDir}/realm-config/authentication.json`);
40907
+ const filePath = getFilePath$37(`realms/${realmDir}/realm-config/authentication.json`);
39902
40908
  if (!fs.default.existsSync(filePath)) {
39903
40909
  if (!singleRealm) continue;
39904
40910
  require_Console.printMessage("No authentication file found to import.");
@@ -39906,7 +40912,7 @@ async function configManagerImportAuthentication(realm, allowFailures = false) {
39906
40912
  }
39907
40913
  await run.run(realmName, async () => {
39908
40914
  await require_dist$2.state.setRealm(realmName);
39909
- const authData = readJsonFile$21(filePath);
40915
+ const authData = readJsonFile$20(filePath);
39910
40916
  delete authData._rev;
39911
40917
  await importAuthenticationSettings({ authentication: authData }, false);
39912
40918
  });
@@ -39918,7 +40924,7 @@ async function configManagerImportAuthentication(realm, allowFailures = false) {
39918
40924
  return false;
39919
40925
  }
39920
40926
  // src/configManagerOps/FrConfigAuthzPoliciesOps.ts
39921
- const { getFilePath: getFilePath$37, saveJsonToFile: saveJsonToFile$36, getWorkingDirectory: getWorkingDirectory$24, readJsonFile: readJsonFile$20 } = require_dist$2.frodo.utils;
40927
+ const { getFilePath: getFilePath$36, saveJsonToFile: saveJsonToFile$35, getWorkingDirectory: getWorkingDirectory$24, readJsonFile: readJsonFile$19 } = require_dist$2.frodo.utils;
39922
40928
  const { importPolicySets, readPolicySet } = require_dist$2.frodo.authz.policySet;
39923
40929
  const { readPoliciesByPolicySet, importPolicies } = require_dist$2.frodo.authz.policy;
39924
40930
  const { readResourceType, importResourceTypes } = require_dist$2.frodo.authz.resourceType;
@@ -39931,7 +40937,7 @@ const { readResourceType, importResourceTypes } = require_dist$2.frodo.authz.res
39931
40937
  async function configManagerExportAuthzPolicySets(configFile, allowFailures = false) {
39932
40938
  let indicatorId;
39933
40939
  try {
39934
- const policySets = readJsonFile$20(configFile, false);
40940
+ const policySets = readJsonFile$19(configFile, false);
39935
40941
  indicatorId = require_Console.createProgressIndicator("determinate", Object.values(policySets).reduce((total, arr) => total + arr.length, 0), "Exporting policy sets...");
39936
40942
  const run = new OperationRun({
39937
40943
  unit: "policy set",
@@ -39942,13 +40948,13 @@ async function configManagerExportAuthzPolicySets(configFile, allowFailures = fa
39942
40948
  const policySet = await readPolicySet(setName);
39943
40949
  policySet._id = policySet.name;
39944
40950
  const authzDir = `realms/${realm === "/" ? "root" : realm}/authorization`;
39945
- saveJsonToFile$36(policySet, getFilePath$37(`${authzDir}/policy-sets/${policySet.name}/${policySet.name}.json`, true), false, true, true);
40951
+ saveJsonToFile$35(policySet, getFilePath$36(`${authzDir}/policy-sets/${policySet.name}/${policySet.name}.json`, true), false, true, true);
39946
40952
  const policies = await readPoliciesByPolicySet(policySet.name);
39947
40953
  for (const policy of policies) {
39948
- saveJsonToFile$36(policy, getFilePath$37(`${authzDir}/policy-sets/${policySet.name}/policies/${policy.name}.json`, true), false, true, true);
40954
+ saveJsonToFile$35(policy, getFilePath$36(`${authzDir}/policy-sets/${policySet.name}/policies/${policy.name}.json`, true), false, true, true);
39949
40955
  const resourceType = await readResourceType(policy.resourceTypeUuid);
39950
40956
  resourceType._id = resourceType.uuid;
39951
- saveJsonToFile$36(resourceType, getFilePath$37(`${authzDir}/resource-types/${resourceType.name}.json`, true), false, true, true);
40957
+ saveJsonToFile$35(resourceType, getFilePath$36(`${authzDir}/resource-types/${resourceType.name}.json`, true), false, true, true);
39952
40958
  }
39953
40959
  require_Console.updateProgressIndicator(indicatorId, `Exported policy set ${setName}`);
39954
40960
  });
@@ -39995,21 +41001,21 @@ async function configManagerImportAuthzPolicies(allowFailures = false) {
39995
41001
  const rtDir = fs.default.existsSync(resourceTypesDir) ? fs.default.readdirSync(resourceTypesDir) : [];
39996
41002
  for (const file of rtDir) {
39997
41003
  if (!file.endsWith(".json")) continue;
39998
- const rtData = readJsonFile$20(`${resourceTypesDir}/${file}`);
41004
+ const rtData = readJsonFile$19(`${resourceTypesDir}/${file}`);
39999
41005
  clearOperationalAttributes(rtData);
40000
41006
  importData.resourcetype[rtData.uuid] = rtData;
40001
41007
  }
40002
41008
  const policySetsDir = `${authzDir}/policy-sets`;
40003
41009
  const psDirs = fs.default.existsSync(policySetsDir) ? fs.default.readdirSync(policySetsDir) : [];
40004
41010
  for (const psDir of psDirs) {
40005
- const psData = readJsonFile$20(`${policySetsDir}/${psDir}/${psDir}.json`);
41011
+ const psData = readJsonFile$19(`${policySetsDir}/${psDir}/${psDir}.json`);
40006
41012
  clearOperationalAttributes(psData);
40007
41013
  importData.policyset[psData.name] = psData;
40008
41014
  const policiesDir = `${policySetsDir}/${psDir}/policies`;
40009
41015
  const pDir = fs.default.existsSync(policiesDir) ? fs.default.readdirSync(policiesDir) : [];
40010
41016
  for (const file of pDir) {
40011
41017
  if (!file.endsWith(".json")) continue;
40012
- const pData = readJsonFile$20(`${policiesDir}/${file}`);
41018
+ const pData = readJsonFile$19(`${policiesDir}/${file}`);
40013
41019
  clearOperationalAttributes(pData);
40014
41020
  pData._id = pData.name;
40015
41021
  importData.policy[pData.name] = pData;
@@ -40037,7 +41043,7 @@ async function configManagerImportAuthzPolicies(allowFailures = false) {
40037
41043
  }
40038
41044
  }
40039
41045
  // src/configManagerOps/FrConfigConnectorDefinitionsOps.ts
40040
- const { getFilePath: getFilePath$36, readJsonFile: readJsonFile$19, saveJsonToFile: saveJsonToFile$35, getWorkingDirectory: getWorkingDirectory$23 } = require_dist$2.frodo.utils;
41046
+ const { getFilePath: getFilePath$35, readJsonFile: readJsonFile$18, saveJsonToFile: saveJsonToFile$34, getWorkingDirectory: getWorkingDirectory$23 } = require_dist$2.frodo.utils;
40041
41047
  const { readConnector, readConnectors, importConnectors } = require_dist$2.frodo.idm.connector;
40042
41048
  /**
40043
41049
  * Export connector in fr-config manager format
@@ -40077,7 +41083,7 @@ async function configManagerExportConnectorDefinitions(name, allowFailures = fal
40077
41083
  }
40078
41084
  exportable++;
40079
41085
  await run.run(connectorName, () => {
40080
- saveJsonToFile$35(connector, getFilePath$36(`sync/connectors/${connectorName}.json`, true), false, true);
41086
+ saveJsonToFile$34(connector, getFilePath$35(`sync/connectors/${connectorName}.json`, true), false, true);
40081
41087
  });
40082
41088
  }
40083
41089
  if (exportable === 0 && skipped === 0) require_Console.printMessage("No connector definitions found to export.", "info");
@@ -40135,7 +41141,7 @@ async function configManagerImportConnectors(name, allowFailures = false) {
40135
41141
  continue;
40136
41142
  }
40137
41143
  try {
40138
- const connector = readJsonFile$19(`${connectorDir}/${connMappingFile}`);
41144
+ const connector = readJsonFile$18(`${connectorDir}/${connMappingFile}`);
40139
41145
  const connectorId = connector._id.split("/")[1];
40140
41146
  importData.connector[connectorId] = connector;
40141
41147
  } catch (error) {
@@ -40157,7 +41163,7 @@ async function configManagerImportConnectors(name, allowFailures = false) {
40157
41163
  return false;
40158
41164
  }
40159
41165
  // src/configManagerOps/FrConfigCookieDomainsOps.ts
40160
- const { getFilePath: getFilePath$35, saveJsonToFile: saveJsonToFile$34, readJsonFile: readJsonFile$18 } = require_dist$2.frodo.utils;
41166
+ const { getFilePath: getFilePath$34, saveJsonToFile: saveJsonToFile$33, readJsonFile: readJsonFile$17 } = require_dist$2.frodo.utils;
40161
41167
  const { readCookieDomains, updateCookieDomains } = require_dist$2.frodo.cloud.env;
40162
41168
  /**
40163
41169
  * Export cookie domains in the fr-config-manager format.
@@ -40166,7 +41172,7 @@ const { readCookieDomains, updateCookieDomains } = require_dist$2.frodo.cloud.en
40166
41172
  async function configManagerExportCookieDomains() {
40167
41173
  try {
40168
41174
  const exportData = await readCookieDomains();
40169
- saveJsonToFile$34(exportData, getFilePath$35("cookie-domains/cookie-domains.json", true), false);
41175
+ saveJsonToFile$33(exportData, getFilePath$34("cookie-domains/cookie-domains.json", true), false);
40170
41176
  return true;
40171
41177
  } catch (error) {
40172
41178
  require_Console.printError(error, `Error exporting cookie domains`);
@@ -40179,7 +41185,7 @@ async function configManagerExportCookieDomains() {
40179
41185
  */
40180
41186
  async function configManagerImportCookieDomains() {
40181
41187
  try {
40182
- const importData = readJsonFile$18(getFilePath$35("cookie-domains/cookie-domains.json"));
41188
+ const importData = readJsonFile$17(getFilePath$34("cookie-domains/cookie-domains.json"));
40183
41189
  await updateCookieDomains(importData);
40184
41190
  return true;
40185
41191
  } catch (error) {
@@ -40188,7 +41194,7 @@ async function configManagerImportCookieDomains() {
40188
41194
  return false;
40189
41195
  }
40190
41196
  // src/configManagerOps/FrConfigCorsOps.ts
40191
- const { getFilePath: getFilePath$34, saveJsonToFile: saveJsonToFile$33, readJsonFile: readJsonFile$17 } = require_dist$2.frodo.utils;
41197
+ const { getFilePath: getFilePath$33, saveJsonToFile: saveJsonToFile$32, readJsonFile: readJsonFile$16 } = require_dist$2.frodo.utils;
40192
41198
  const { readConfigEntity: readConfigEntity$9, importConfigEntities: importConfigEntities$8 } = require_dist$2.frodo.idm.config;
40193
41199
  const { getFullServices: getFullServices$2, importServices: importServices$2 } = require_dist$2.frodo.service;
40194
41200
  const { CLASSIC_DEPLOYMENT_TYPE_KEY: CLASSIC_DEPLOYMENT_TYPE_KEY$17 } = require_dist$2.frodo.utils.constants;
@@ -40210,7 +41216,7 @@ async function configManagerExportCors() {
40210
41216
  corsServices,
40211
41217
  corsServiceGlobal
40212
41218
  };
40213
- saveJsonToFile$33(newCorsObject, getFilePath$34("cors/cors-config.json", true), false, true);
41219
+ saveJsonToFile$32(newCorsObject, getFilePath$33("cors/cors-config.json", true), false, true);
40214
41220
  return true;
40215
41221
  } catch (error) {
40216
41222
  require_Console.printError(error);
@@ -40223,7 +41229,7 @@ async function configManagerExportCors() {
40223
41229
  */
40224
41230
  async function configManagerImportCors() {
40225
41231
  try {
40226
- const importData = readJsonFile$17(getFilePath$34("cors/cors-config.json"));
41232
+ const importData = readJsonFile$16(getFilePath$33("cors/cors-config.json"));
40227
41233
  if (require_dist$2.state.getDeploymentType() !== CLASSIC_DEPLOYMENT_TYPE_KEY$17) {
40228
41234
  const corsImport = { idm: { [importData.idmCorsConfig._id]: importData.idmCorsConfig } };
40229
41235
  await importConfigEntities$8(corsImport);
@@ -40247,7 +41253,7 @@ async function configManagerImportCors() {
40247
41253
  // src/configManagerOps/FrConfigCspOps.ts
40248
41254
  const { env } = require_dist$2.frodo.cloud;
40249
41255
  const { updateEnforcedContentSecurityPolicy, updateReportOnlyContentSecurityPolicy } = require_dist$2.frodo.cloud.env;
40250
- const { getFilePath: getFilePath$33, saveJsonToFile: saveJsonToFile$32, readJsonFile: readJsonFile$16 } = require_dist$2.frodo.utils;
41256
+ const { getFilePath: getFilePath$32, saveJsonToFile: saveJsonToFile$31, readJsonFile: readJsonFile$15 } = require_dist$2.frodo.utils;
40251
41257
  /**
40252
41258
  * Export the content security policy in fr-config manager format
40253
41259
  * @param {string} file optional file to be exported
@@ -40260,7 +41266,7 @@ async function configManagerExportCsp(file = null) {
40260
41266
  "report-only": await env.readReportOnlyContentSecurityPolicy()
40261
41267
  };
40262
41268
  if (file) lodashMerge(csp, JSON.parse(await (0, fs_promises.readFile)(file, { encoding: "utf8" })));
40263
- saveJsonToFile$32(csp, getFilePath$33("csp/csp.json", true), false, true);
41269
+ saveJsonToFile$31(csp, getFilePath$32("csp/csp.json", true), false, true);
40264
41270
  return true;
40265
41271
  } catch (error) {
40266
41272
  require_Console.printError(error);
@@ -40280,12 +41286,12 @@ async function configManagerExportCsp(file = null) {
40280
41286
  async function configManagerImportCsp(name, allowFailures = false) {
40281
41287
  try {
40282
41288
  if (name && name !== "enforced" && name !== "report-only") throw new Error(`Invalid CSP name '${name}'. Valid values are 'enforced' or 'report-only'.`);
40283
- const cspFile = getFilePath$33("csp/csp.json");
41289
+ const cspFile = getFilePath$32("csp/csp.json");
40284
41290
  if (!fs.default.existsSync(cspFile)) {
40285
41291
  require_Console.printMessage(`No CSP file found: ${cspFile} does not exist.`, "error");
40286
41292
  return false;
40287
41293
  }
40288
- const importData = readJsonFile$16(cspFile);
41294
+ const importData = readJsonFile$15(cspFile);
40289
41295
  const run = new OperationRun({
40290
41296
  unit: "policy",
40291
41297
  allowFailures
@@ -40304,7 +41310,7 @@ async function configManagerImportCsp(name, allowFailures = false) {
40304
41310
  }
40305
41311
  // src/configManagerOps/FrConfigEmailProviderOps.ts
40306
41312
  const { readConfigEntity: readConfigEntity$8, importConfigEntities: importConfigEntities$7 } = require_dist$2.frodo.idm.config;
40307
- const { getFilePath: getFilePath$32, saveJsonToFile: saveJsonToFile$31, readJsonFile: readJsonFile$15 } = require_dist$2.frodo.utils;
41313
+ const { getFilePath: getFilePath$31, saveJsonToFile: saveJsonToFile$30, readJsonFile: readJsonFile$14 } = require_dist$2.frodo.utils;
40308
41314
  /**
40309
41315
  * Export the email provider configuration json in fr-config manager format
40310
41316
  * @returns {Promise<boolean>} True if file was successfully saved
@@ -40312,7 +41318,7 @@ const { getFilePath: getFilePath$32, saveJsonToFile: saveJsonToFile$31, readJson
40312
41318
  async function configManagerExportEmailProviderConfiguration() {
40313
41319
  try {
40314
41320
  const emailProvider = await readConfigEntity$8("external.email");
40315
- saveJsonToFile$31(emailProvider, getFilePath$32("email-provider/external.email.json", true), false, true);
41321
+ saveJsonToFile$30(emailProvider, getFilePath$31("email-provider/external.email.json", true), false, true);
40316
41322
  return true;
40317
41323
  } catch (error) {
40318
41324
  require_Console.printError(error);
@@ -40325,7 +41331,7 @@ async function configManagerExportEmailProviderConfiguration() {
40325
41331
  */
40326
41332
  async function configManagerImportEmailProvider() {
40327
41333
  try {
40328
- const importData = readJsonFile$15(getFilePath$32("email-provider/external.email.json"));
41334
+ const importData = readJsonFile$14(getFilePath$31("email-provider/external.email.json"));
40329
41335
  await importConfigEntities$7({ idm: { [importData._id]: importData } });
40330
41336
  return true;
40331
41337
  } catch (error) {
@@ -40335,7 +41341,7 @@ async function configManagerImportEmailProvider() {
40335
41341
  }
40336
41342
  // src/configManagerOps/FrConfigIdmAuthenticationOpts.ts
40337
41343
  const { readConfigEntity: readConfigEntity$7, updateConfigEntity } = require_dist$2.frodo.idm.config;
40338
- const { getFilePath: getFilePath$31, saveJsonToFile: saveJsonToFile$30, readJsonFile: readJsonFile$14 } = require_dist$2.frodo.utils;
41344
+ const { getFilePath: getFilePath$30, saveJsonToFile: saveJsonToFile$29, readJsonFile: readJsonFile$13 } = require_dist$2.frodo.utils;
40339
41345
  /**
40340
41346
  * Export Idm authentication configuration in fr-config-manager format.
40341
41347
  * @return {Promise<boolean>} a promise that resolves to true if successful, false otherwise
@@ -40343,7 +41349,7 @@ const { getFilePath: getFilePath$31, saveJsonToFile: saveJsonToFile$30, readJson
40343
41349
  async function configManagerExportIdmAuthentication() {
40344
41350
  try {
40345
41351
  const exportData = await readConfigEntity$7("authentication");
40346
- saveJsonToFile$30(exportData, getFilePath$31("idm-authentication-config/authentication.json", true), false);
41352
+ saveJsonToFile$29(exportData, getFilePath$30("idm-authentication-config/authentication.json", true), false);
40347
41353
  return true;
40348
41354
  } catch (error) {
40349
41355
  require_Console.printError(error, `Error exporting config entity selfservice.kba`);
@@ -40356,8 +41362,8 @@ async function configManagerExportIdmAuthentication() {
40356
41362
  */
40357
41363
  async function configManagerImportIdmAuthentication() {
40358
41364
  try {
40359
- const filePath = getFilePath$31("idm-authentication-config/authentication.json");
40360
- const config = readJsonFile$14(filePath);
41365
+ const filePath = getFilePath$30("idm-authentication-config/authentication.json");
41366
+ const config = readJsonFile$13(filePath);
40361
41367
  await updateConfigEntity(config._id, config);
40362
41368
  return true;
40363
41369
  } catch (error) {
@@ -40366,7 +41372,7 @@ async function configManagerImportIdmAuthentication() {
40366
41372
  return false;
40367
41373
  }
40368
41374
  // src/configManagerOps/FrConfigInternalRolesOps.ts
40369
- const { getFilePath: getFilePath$30, saveJsonToFile: saveJsonToFile$29, readJsonFile: readJsonFile$13, getWorkingDirectory: getWorkingDirectory$22 } = require_dist$2.frodo.utils;
41375
+ const { getFilePath: getFilePath$29, saveJsonToFile: saveJsonToFile$28, readJsonFile: readJsonFile$12, getWorkingDirectory: getWorkingDirectory$22 } = require_dist$2.frodo.utils;
40370
41376
  const { readInternalRoleByName, importInternalRoles: importInternalRoles$1, readInternalRoles: readInternalRoles$1 } = require_dist$2.frodo.role;
40371
41377
  /**
40372
41378
  * Export internal roles in fr-config-manager format.
@@ -40386,7 +41392,7 @@ async function configManagerExportInternalRoles(name, allowFailures = false) {
40386
41392
  try {
40387
41393
  const withPrivileges = (name ? [await readInternalRoleByName(name)] : await readInternalRoles$1()).filter((role) => role.privileges && role.privileges.length > 0);
40388
41394
  for (const role of withPrivileges) await run.run(role.name, () => {
40389
- saveJsonToFile$29(role, getFilePath$30(`internal-roles/${role.name}.json`, true), false, true);
41395
+ saveJsonToFile$28(role, getFilePath$29(`internal-roles/${role.name}.json`, true), false, true);
40390
41396
  });
40391
41397
  if (withPrivileges.length === 0) require_Console.printMessage(name ? `Internal role ${name} has no privileges and is not exported.` : "No internal roles with privileges found to export.", "info");
40392
41398
  return run.finish();
@@ -40424,7 +41430,7 @@ async function configManagerImportInternalRoles(internalRoleName, allowFailures
40424
41430
  }
40425
41431
  const importData = { internalRole: {} };
40426
41432
  for (const internalRolesFile of internalRolesFiles) try {
40427
- const roleData = readJsonFile$13(getFilePath$30(`internal-roles/${internalRolesFile}`));
41433
+ const roleData = readJsonFile$12(getFilePath$29(`internal-roles/${internalRolesFile}`));
40428
41434
  if (internalRoleName && roleData.name !== internalRoleName) continue;
40429
41435
  importData.internalRole[roleData._id] = roleData;
40430
41436
  } catch (error) {
@@ -40479,7 +41485,7 @@ function printJourneyFindingsHint() {
40479
41485
  require_Console.printMessage(JOURNEY_FINDINGS_HINT, "info");
40480
41486
  }
40481
41487
  // src/configManagerOps/FrConfigJourneysOps.ts
40482
- const { saveJsonToFile: saveJsonToFile$28, getFilePath: getFilePath$29, readJsonFile: readJsonFile$12 } = require_dist$2.frodo.utils;
41488
+ const { saveJsonToFile: saveJsonToFile$27, getFilePath: getFilePath$28, readJsonFile: readJsonFile$11 } = require_dist$2.frodo.utils;
40483
41489
  const { exportScript } = require_dist$2.frodo.script;
40484
41490
  const { exportJourneys: exportJourneys$1, importJourneys: importJourneys$1, createSingleTreeExportTemplate } = require_dist$2.frodo.authn.journey;
40485
41491
  const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$4 } = require_dist$2.frodo.utils.constants;
@@ -40558,9 +41564,9 @@ async function processNodeExport(node, displayName, nodeDir, realmDir, pullDepen
40558
41564
  })).script[node.script];
40559
41565
  const scriptsDir = `realms/${realmDir}/scripts/`;
40560
41566
  script.script = extractFrConfigDataToFile(script.script, `scripts-content/${script.context}/${script.name}.js`, scriptsDir);
40561
- saveJsonToFile$28(script, getFilePath$29(`${scriptsDir}scripts-config/${script._id}.json`, true), false, true, true);
41567
+ saveJsonToFile$27(script, getFilePath$28(`${scriptsDir}scripts-config/${script._id}.json`, true), false, true, true);
40562
41568
  }
40563
- saveJsonToFile$28(node, getFilePath$29(`${nodeFileDir}.json`, true), false, true, true);
41569
+ saveJsonToFile$27(node, getFilePath$28(`${nodeFileDir}.json`, true), false, true, true);
40564
41570
  }
40565
41571
  /**
40566
41572
  * Helper that processes journeys for export
@@ -40585,7 +41591,7 @@ async function processJourneysExport(journeys, name, pullDependencies = false, c
40585
41591
  if (name && pullDependencies && node._type._id === "InnerTreeEvaluatorNode") await processJourneysExport(journeys, node.tree, pullDependencies, clean);
40586
41592
  await processNodeExport(node, journey.tree.nodes[node._id].displayName, nodeDir, realmDir, pullDependencies, journey);
40587
41593
  }
40588
- saveJsonToFile$28(journey.tree, getFilePath$29(`${journeyDir}/${journey.tree._id}.json`, true), false, true, true);
41594
+ saveJsonToFile$27(journey.tree, getFilePath$28(`${journeyDir}/${journey.tree._id}.json`, true), false, true, true);
40589
41595
  };
40590
41596
  if (run) await run.run(`${realmDir}/${treeId}`, exportJourney);
40591
41597
  else await exportJourney();
@@ -40603,13 +41609,13 @@ function journeyNodeNeedsScript(node) {
40603
41609
  */
40604
41610
  function readNodeScript(node, pushScripts, scripts, realmDir) {
40605
41611
  if (!pushScripts || !journeyNodeNeedsScript(node) || scripts[node.script]) return;
40606
- const baseDir = getFilePath$29(`realms/${realmDir}/scripts`);
41612
+ const baseDir = getFilePath$28(`realms/${realmDir}/scripts`);
40607
41613
  const scriptConfigFile = `${baseDir}/scripts-config/${node.script}.json`;
40608
41614
  if (!fs.default.existsSync(scriptConfigFile)) {
40609
41615
  require_Console.printMessage(`Script config not found: ${scriptConfigFile}`, "error");
40610
41616
  return;
40611
41617
  }
40612
- const script = readJsonFile$12(scriptConfigFile);
41618
+ const script = readJsonFile$11(scriptConfigFile);
40613
41619
  if (script.script?.file) {
40614
41620
  const contentFile = `${baseDir}/${script.script.file}`;
40615
41621
  if (!fs.default.existsSync(contentFile)) {
@@ -40633,7 +41639,7 @@ function readNodeScript(node, pushScripts, scripts, realmDir) {
40633
41639
  function processJourneyImport(journeyName, pushInnerJourneys, pushScripts, journeysBaseDir, realmDir, processedJourneys = /* @__PURE__ */ new Set()) {
40634
41640
  if (processedJourneys.has(journeyName)) return {};
40635
41641
  processedJourneys.add(journeyName);
40636
- const tree = readJsonFile$12(`${journeysBaseDir}/${journeyName}/${journeyName}.json`);
41642
+ const tree = readJsonFile$11(`${journeysBaseDir}/${journeyName}/${journeyName}.json`);
40637
41643
  const journeyData = createSingleTreeExportTemplate();
40638
41644
  journeyData.tree = tree;
40639
41645
  const innerTreeNames = [];
@@ -40642,7 +41648,7 @@ function processJourneyImport(journeyName, pushInnerJourneys, pushScripts, journ
40642
41648
  const entries = fs.default.readdirSync(nodesDir, { withFileTypes: true });
40643
41649
  for (const entry of entries) {
40644
41650
  if (entry.isFile() && entry.name.endsWith(".json")) {
40645
- const node = readJsonFile$12(`${nodesDir}/${entry.name}`);
41651
+ const node = readJsonFile$11(`${nodesDir}/${entry.name}`);
40646
41652
  journeyData.nodes[node._id] = node;
40647
41653
  if (pushInnerJourneys && node._type?._id === "InnerTreeEvaluatorNode") innerTreeNames.push(node.tree);
40648
41654
  else readNodeScript(node, pushScripts, journeyData.scripts, realmDir);
@@ -40652,7 +41658,7 @@ function processJourneyImport(journeyName, pushInnerJourneys, pushScripts, journ
40652
41658
  const innerFiles = fs.default.readdirSync(pageNodeDir);
40653
41659
  for (const innerFile of innerFiles) {
40654
41660
  if (!innerFile.endsWith(".json")) continue;
40655
- const innerNode = readJsonFile$12(`${pageNodeDir}/${innerFile}`);
41661
+ const innerNode = readJsonFile$11(`${pageNodeDir}/${innerFile}`);
40656
41662
  journeyData.innerNodes[innerNode._id] = innerNode;
40657
41663
  readNodeScript(innerNode, pushScripts, journeyData.scripts, realmDir);
40658
41664
  }
@@ -40692,7 +41698,7 @@ async function configManagerImportJourneys(name, realm, dependencies = false, va
40692
41698
  reUuid: false,
40693
41699
  validate
40694
41700
  };
40695
- const realmsDir = getFilePath$29("realms");
41701
+ const realmsDir = getFilePath$28("realms");
40696
41702
  if (!fs.default.existsSync(realmsDir)) {
40697
41703
  require_Console.printMessage("No journey files found to import.", "error");
40698
41704
  return false;
@@ -40738,7 +41744,7 @@ async function configManagerImportJourneys(name, realm, dependencies = false, va
40738
41744
  }
40739
41745
  // src/configManagerOps/FrConfigKbaOps.ts
40740
41746
  const { readConfigEntity: readConfigEntity$6, importConfigEntities: importConfigEntities$6 } = require_dist$2.frodo.idm.config;
40741
- const { getFilePath: getFilePath$28, saveJsonToFile: saveJsonToFile$27, readJsonFile: readJsonFile$11 } = require_dist$2.frodo.utils;
41747
+ const { getFilePath: getFilePath$27, saveJsonToFile: saveJsonToFile$26, readJsonFile: readJsonFile$10 } = require_dist$2.frodo.utils;
40742
41748
  /**
40743
41749
  * Export IDM KBA configuration in fr-config-manager format.
40744
41750
  * @return {Promise<boolean>} a promise that resolves to true if successful, false otherwise
@@ -40746,7 +41752,7 @@ const { getFilePath: getFilePath$28, saveJsonToFile: saveJsonToFile$27, readJson
40746
41752
  async function configManagerExportKbaConfig() {
40747
41753
  try {
40748
41754
  const exportData = await readConfigEntity$6("selfservice.kba");
40749
- saveJsonToFile$27(exportData, getFilePath$28("kba/selfservice.kba.json", true), false);
41755
+ saveJsonToFile$26(exportData, getFilePath$27("kba/selfservice.kba.json", true), false);
40750
41756
  return true;
40751
41757
  } catch (error) {
40752
41758
  require_Console.printError(error, `Error exporting KBA`);
@@ -40759,7 +41765,7 @@ async function configManagerExportKbaConfig() {
40759
41765
  */
40760
41766
  async function configManagerImportKbaConfig() {
40761
41767
  try {
40762
- const kba = readJsonFile$11(getFilePath$28(`kba/selfservice.kba.json`));
41768
+ const kba = readJsonFile$10(getFilePath$27(`kba/selfservice.kba.json`));
40763
41769
  await importConfigEntities$6({ idm: { [kba._id]: kba } });
40764
41770
  return true;
40765
41771
  } catch (error) {
@@ -40770,7 +41776,7 @@ async function configManagerImportKbaConfig() {
40770
41776
  // src/configManagerOps/FrConfigManagedObjectsOps.ts
40771
41777
  const { readConfigEntity: readConfigEntity$5, importConfigEntities: importConfigEntities$5, importSubConfigEntity } = require_dist$2.frodo.idm.config;
40772
41778
  const { readManagedObjectSchemaProperty } = require_dist$2.frodo.idm.managed.schema;
40773
- const { getFilePath: getFilePath$27, saveJsonToFile: saveJsonToFile$26, readJsonFile: readJsonFile$10 } = require_dist$2.frodo.utils;
41779
+ const { getFilePath: getFilePath$26, saveJsonToFile: saveJsonToFile$25, readJsonFile: readJsonFile$9 } = require_dist$2.frodo.utils;
40774
41780
  const SCRIPT_HOOKS = [
40775
41781
  "onStore",
40776
41782
  "onRetrieve",
@@ -40834,10 +41840,10 @@ async function configManagerExportManagedObjects(name, pullCustomRelationships =
40834
41840
  for (const customRelationship of customRelationships) {
40835
41841
  const schemaData = await readManagedObjectSchemaProperty(managedObject.name, customRelationship);
40836
41842
  const schemaFileName = `${objectPath}/schema/${managedObject.name}.schema.${customRelationship}.json`;
40837
- saveJsonToFile$26(schemaData, getFilePath$27(schemaFileName, true), false);
41843
+ saveJsonToFile$25(schemaData, getFilePath$26(schemaFileName, true), false);
40838
41844
  }
40839
41845
  }
40840
- saveJsonToFile$26(managedObject, getFilePath$27(`${objectPath}/${managedObject.name}.json`, true), false);
41846
+ saveJsonToFile$25(managedObject, getFilePath$26(`${objectPath}/${managedObject.name}.json`, true), false);
40841
41847
  });
40842
41848
  return run.finish();
40843
41849
  } catch (error) {
@@ -40870,7 +41876,7 @@ function getExtractedFiles(obj, managedObjectDirectory) {
40870
41876
  * @returns {object} The managed object data from the file, including data from any extracted files
40871
41877
  */
40872
41878
  function getManagedObjectImportData(file) {
40873
- const importData = readJsonFile$10(file);
41879
+ const importData = readJsonFile$9(file);
40874
41880
  getExtractedFiles(importData, path.default.dirname(file));
40875
41881
  return importData;
40876
41882
  }
@@ -40882,17 +41888,17 @@ function getManagedObjectImportData(file) {
40882
41888
  async function configManagerImportManagedObjects(objectName) {
40883
41889
  try {
40884
41890
  if (objectName) {
40885
- const importData = getManagedObjectImportData(getFilePath$27(`managed-objects/${objectName}/${objectName}.json`));
41891
+ const importData = getManagedObjectImportData(getFilePath$26(`managed-objects/${objectName}/${objectName}.json`));
40886
41892
  await importSubConfigEntity("managed", importData);
40887
41893
  } else {
40888
- const managedObjectsPath = getFilePath$27("managed-objects");
41894
+ const managedObjectsPath = getFilePath$26("managed-objects");
40889
41895
  const managedObjectsFiles = fs.default.readdirSync(managedObjectsPath, "utf-8");
40890
41896
  const importManagedObjectData = { idm: { managed: {
40891
41897
  _id: "managed",
40892
41898
  objects: []
40893
41899
  } } };
40894
41900
  for (const managedObjectsFile of managedObjectsFiles) {
40895
- const importData = getManagedObjectImportData(getFilePath$27(`managed-objects/${managedObjectsFile}/${managedObjectsFile}.json`));
41901
+ const importData = getManagedObjectImportData(getFilePath$26(`managed-objects/${managedObjectsFile}/${managedObjectsFile}.json`));
40896
41902
  importManagedObjectData.idm.managed.objects.push(importData);
40897
41903
  }
40898
41904
  await importConfigEntities$5(importManagedObjectData);
@@ -40905,7 +41911,7 @@ async function configManagerImportManagedObjects(objectName) {
40905
41911
  }
40906
41912
  // src/configManagerOps/FrConfigOauth2AgentOps.ts
40907
41913
  const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$172 } = require_dist$2.frodo.utils.constants;
40908
- const { getFilePath: getFilePath$26, saveJsonToFile: saveJsonToFile$25, getWorkingDirectory: getWorkingDirectory$21, readJsonFile: readJsonFile$9, escapePlaceholders: escapePlaceholders$1 } = require_dist$2.frodo.utils;
41914
+ const { getFilePath: getFilePath$25, saveJsonToFile: saveJsonToFile$24, getWorkingDirectory: getWorkingDirectory$21, readJsonFile: readJsonFile$8, escapePlaceholders: escapePlaceholders$1 } = require_dist$2.frodo.utils;
40909
41915
  const { mergeDeep } = require_dist$2.frodo.utils.json;
40910
41916
  const { readAgentByTypeAndId, importAgent } = require_dist$2.frodo.agent;
40911
41917
  /**
@@ -40922,7 +41928,7 @@ const { readAgentByTypeAndId, importAgent } = require_dist$2.frodo.agent;
40922
41928
  */
40923
41929
  async function configManagerExportOAuth2Agents(configFile, allowFailures = false, layout) {
40924
41930
  try {
40925
- const configFileData = readJsonFile$9(configFile, false);
41931
+ const configFileData = readJsonFile$8(configFile, false);
40926
41932
  const run = new OperationRun({
40927
41933
  unit: "agent",
40928
41934
  allowFailures
@@ -40951,7 +41957,7 @@ async function configManagerExportOAuth2Agents(configFile, allowFailures = false
40951
41957
  const agentResponse = await readAgentByTypeAndId(agentType, agent.id);
40952
41958
  let config = escapePlaceholders$1(agentResponse);
40953
41959
  if (agent.overrides) config = mergeDeep(config, agent.overrides);
40954
- saveJsonToFile$25(config, getFilePath$26(`realms/${realm === "/" ? "root" : realm}/realm-config/agents/${agentType}/${agent.id}.json`, true), false, false, true);
41960
+ saveJsonToFile$24(config, getFilePath$25(`realms/${realm === "/" ? "root" : realm}/realm-config/agents/${agentType}/${agent.id}.json`, true), false, false, true);
40955
41961
  });
40956
41962
  }
40957
41963
  }
@@ -40992,7 +41998,7 @@ async function configManagerImportAgents(allowFailures = false) {
40992
41998
  const realm = realmDir === "root" ? "/" : realmDir;
40993
41999
  if (realm === "/" && require_dist$2.state.getDeploymentType() === CLOUD_DEPLOYMENT_TYPE_KEY$172) continue;
40994
42000
  require_dist$2.state.setRealm(realm);
40995
- const agentDir = getFilePath$26(`realms/${realmDir}/realm-config/agents`);
42001
+ const agentDir = getFilePath$25(`realms/${realmDir}/realm-config/agents`);
40996
42002
  if (!fs.default.existsSync(agentDir)) continue;
40997
42003
  let ownershipKnown = true;
40998
42004
  if (owned) try {
@@ -41014,7 +42020,7 @@ async function configManagerImportAgents(allowFailures = false) {
41014
42020
  continue;
41015
42021
  }
41016
42022
  await run.run(`${realmDir}/${agentType}/${file}`, async () => {
41017
- const agent = readJsonFile$9(path.default.join(agentTypeDir, file));
42023
+ const agent = readJsonFile$8(path.default.join(agentTypeDir, file));
41018
42024
  const agentId = agent._id;
41019
42025
  clearOperationalAttributes(agent);
41020
42026
  await importAgent(agentId, { agent: { [agentId]: agent } }, false);
@@ -41031,7 +42037,7 @@ async function configManagerImportAgents(allowFailures = false) {
41031
42037
  }
41032
42038
  }
41033
42039
  // src/configManagerOps/FrConfigOrgPrivilegesOps.ts
41034
- const { getFilePath: getFilePath$25, saveJsonToFile: saveJsonToFile$24, readJsonFile: readJsonFile$8 } = require_dist$2.frodo.utils;
42040
+ const { getFilePath: getFilePath$24, saveJsonToFile: saveJsonToFile$23, readJsonFile: readJsonFile$7 } = require_dist$2.frodo.utils;
41035
42041
  const { readConfigEntity: readConfigEntity$4, importConfigEntities: importConfigEntities$4 } = require_dist$2.frodo.idm.config;
41036
42042
  const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$171, DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$3 } = require_dist$2.frodo.utils.constants;
41037
42043
  const PRIVILEGE_ASSIGNMENTS = "privilegeAssignments";
@@ -41063,7 +42069,7 @@ async function orgPrivilegesIds(realm) {
41063
42069
  async function exportOrgPrivileges(id, ignoreMissing) {
41064
42070
  try {
41065
42071
  const orgPrivileges = await readConfigEntity$4(id);
41066
- saveJsonToFile$24(orgPrivileges, getFilePath$25(`org-privileges/${id}.json`, true), false, id !== PRIVILEGE_ASSIGNMENTS);
42072
+ saveJsonToFile$23(orgPrivileges, getFilePath$24(`org-privileges/${id}.json`, true), false, id !== PRIVILEGE_ASSIGNMENTS);
41067
42073
  } catch (error) {
41068
42074
  if (ignoreMissing && error.httpStatus === 404) {
41069
42075
  require_Console.verboseMessage(`No organization privileges config "${id}", nothing to export.`);
@@ -41107,7 +42113,7 @@ async function configManagerExportOrgPrivileges(name, allowFailures = false, rea
41107
42113
  * @param id The id of the configuration entity that the file has to hold
41108
42114
  */
41109
42115
  async function importOrgPrivilegesFromFile(file, id) {
41110
- const orgPrivileges = readJsonFile$8(file);
42116
+ const orgPrivileges = readJsonFile$7(file);
41111
42117
  if (orgPrivileges._id !== id) throw new Error(`The file ${file} holds the _id '${orgPrivileges._id}' but the organization privileges configuration is '${id}'.`);
41112
42118
  await importConfigEntities$4({ idm: { [id]: orgPrivileges } });
41113
42119
  }
@@ -41128,7 +42134,7 @@ async function configManagerImportOrgPrivileges(name, allowFailures = false) {
41128
42134
  allowFailures
41129
42135
  });
41130
42136
  if (name !== void 0) {
41131
- const file = getFilePath$25(`org-privileges/${name}.json`);
42137
+ const file = getFilePath$24(`org-privileges/${name}.json`);
41132
42138
  if (!fs.default.existsSync(file)) {
41133
42139
  require_Console.printMessage(`Organization privileges file not found: ${file}`, "error");
41134
42140
  return false;
@@ -41136,13 +42142,13 @@ async function configManagerImportOrgPrivileges(name, allowFailures = false) {
41136
42142
  await run.run(name, () => importOrgPrivilegesFromFile(file, name));
41137
42143
  return run.finish();
41138
42144
  }
41139
- const folder = getFilePath$25("org-privileges");
42145
+ const folder = getFilePath$24("org-privileges");
41140
42146
  if (!fs.default.existsSync(folder)) {
41141
42147
  require_Console.printMessage(`No org-privileges folder found to import from: ${folder}`, "error");
41142
42148
  return false;
41143
42149
  }
41144
42150
  for (const id of await orgPrivilegesIds()) {
41145
- const file = getFilePath$25(`org-privileges/${id}.json`);
42151
+ const file = getFilePath$24(`org-privileges/${id}.json`);
41146
42152
  if (!fs.default.existsSync(file)) {
41147
42153
  if (id === PRIVILEGE_ASSIGNMENTS) require_Console.printMessage(`Skipping privilegeAssignments: no privilegeAssignments.json in '${folder}'.`, "warn");
41148
42154
  else require_Console.verboseMessage(`No organization privileges file for "${id}", nothing to import.`);
@@ -41158,7 +42164,7 @@ async function configManagerImportOrgPrivileges(name, allowFailures = false) {
41158
42164
  }
41159
42165
  // src/configManagerOps/FrConfigPasswordPolicyOps.ts
41160
42166
  const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$2 } = require_dist$2.frodo.utils.constants;
41161
- const { getFilePath: getFilePath$24, saveJsonToFile: saveJsonToFile$23, getWorkingDirectory: getWorkingDirectory$20, readJsonFile: readJsonFile$7 } = require_dist$2.frodo.utils;
42167
+ const { getFilePath: getFilePath$23, saveJsonToFile: saveJsonToFile$22, getWorkingDirectory: getWorkingDirectory$20, readJsonFile: readJsonFile$6 } = require_dist$2.frodo.utils;
41162
42168
  const { readConfigEntity: readConfigEntity$3, importConfigEntities: importConfigEntities$3 } = require_dist$2.frodo.idm.config;
41163
42169
  /**
41164
42170
  * Export IDM password policy configuration object in the fr-config-manager format.
@@ -41179,7 +42185,7 @@ async function configManagerExportPasswordPolicy(realm, allowFailures = false) {
41179
42185
  const objectName = `${currentRealm === "/" ? "" : `${currentRealm}_`}user`;
41180
42186
  const passwordPolicy = await readConfigEntity$3(`fieldPolicy/${objectName}`);
41181
42187
  const fileName = `realms/${currentRealm === "/" ? "root" : currentRealm}/password-policy/${objectName}-password-policy.json`;
41182
- saveJsonToFile$23(passwordPolicy, getFilePath$24(fileName, true), false, true);
42188
+ saveJsonToFile$22(passwordPolicy, getFilePath$23(fileName, true), false, true);
41183
42189
  run.recordSuccess();
41184
42190
  } catch (error) {
41185
42191
  require_Console.printError(error, `Error exporting the password policy of realm '${currentRealm}'`);
@@ -41220,7 +42226,7 @@ async function configManagerImportPasswordPolicy(realm, allowFailures = false) {
41220
42226
  for (const currentRealm of realms) {
41221
42227
  if (currentRealm === "/" && require_dist$2.state.getDeploymentType() === require_dist$2.frodo.utils.constants.CLOUD_DEPLOYMENT_TYPE_KEY) continue;
41222
42228
  const objectName = `${currentRealm === "/" ? "" : `${currentRealm}_`}user`;
41223
- const filePath = getFilePath$24(`realms/${currentRealm === "/" ? "root" : currentRealm}/password-policy/${objectName}-password-policy.json`);
42229
+ const filePath = getFilePath$23(`realms/${currentRealm === "/" ? "root" : currentRealm}/password-policy/${objectName}-password-policy.json`);
41224
42230
  if (!fs.default.existsSync(filePath)) {
41225
42231
  if (named) {
41226
42232
  require_Console.printMessage(`There is no password policy file for realm '${currentRealm}': expected '${filePath}'.`, "error");
@@ -41229,7 +42235,7 @@ async function configManagerImportPasswordPolicy(realm, allowFailures = false) {
41229
42235
  continue;
41230
42236
  }
41231
42237
  try {
41232
- const parsedData = readJsonFile$7(filePath);
42238
+ const parsedData = readJsonFile$6(filePath);
41233
42239
  if (parsedData?.idm && typeof parsedData.idm === "object" && Object.keys(parsedData.idm).length > 0) await importConfigEntities$3({ idm: parsedData.idm });
41234
42240
  else {
41235
42241
  if (!parsedData?._id) throw new Error(`Invalid password policy payload in '${filePath}': expected either an 'idm' map or top-level '_id'.`);
@@ -41248,7 +42254,7 @@ async function configManagerImportPasswordPolicy(realm, allowFailures = false) {
41248
42254
  return false;
41249
42255
  }
41250
42256
  // src/configManagerOps/FrConfigRawOps.ts
41251
- const { getFilePath: getFilePath$23, saveJsonToFile: saveJsonToFile$22, readJsonFile: readJsonFile$6, getWorkingDirectory: getWorkingDirectory$19 } = require_dist$2.frodo.utils;
42257
+ const { getFilePath: getFilePath$22, saveJsonToFile: saveJsonToFile$21, readJsonFile: readJsonFile$5, getWorkingDirectory: getWorkingDirectory$19 } = require_dist$2.frodo.utils;
41252
42258
  const { exportRawConfig, importRawConfig } = require_dist$2.frodo.rawConfig;
41253
42259
  /**
41254
42260
  * Export every item from the list in the provided json file
@@ -41276,7 +42282,7 @@ async function configManagerExportRaw(file, allowFailures = false) {
41276
42282
  try {
41277
42283
  const response = await exportRawConfig(config);
41278
42284
  require_Console.verboseMessage(`Saving ${response._id} at ${config.path}.json.`);
41279
- saveJsonToFile$22(response, getFilePath$23(`raw/${config.path}.json`, true), false, true);
42285
+ saveJsonToFile$21(response, getFilePath$22(`raw/${config.path}.json`, true), false, true);
41280
42286
  run.recordSuccess();
41281
42287
  } catch (error) {
41282
42288
  require_Console.printError(error, `Error exporting raw config '${name}'`);
@@ -41305,7 +42311,7 @@ function readRawConfigFromStdin() {
41305
42311
  try {
41306
42312
  const file = path.default.join(dir, "stdin.json");
41307
42313
  fs.default.writeFileSync(file, text, { mode: 384 });
41308
- return readJsonFile$6(file);
42314
+ return readJsonFile$5(file);
41309
42315
  } catch (error) {
41310
42316
  throw new require_dist$2.FrodoError("Error reading JSON from stdin", error);
41311
42317
  } finally {
@@ -41348,7 +42354,7 @@ async function configManagerImportRaw(path, stdin = false, allowFailures = false
41348
42354
  if (path && !rawPath.startsWith(path)) continue;
41349
42355
  matched = true;
41350
42356
  try {
41351
- const data = readJsonFile$6(filePath);
42357
+ const data = readJsonFile$5(filePath);
41352
42358
  clearOperationalAttributes(data);
41353
42359
  await importRawConfig({ path: rawPath }, data);
41354
42360
  run.recordSuccess();
@@ -41384,7 +42390,7 @@ function getJsonFiles(dir) {
41384
42390
  }
41385
42391
  // src/configManagerOps/FrConfigRemoteServersOps.ts
41386
42392
  const { readConfigEntity: readConfigEntity$2, importConfigEntities: importConfigEntities$2 } = require_dist$2.frodo.idm.config;
41387
- const { getFilePath: getFilePath$22, saveJsonToFile: saveJsonToFile$21, readJsonFile: readJsonFile$5 } = require_dist$2.frodo.utils;
42393
+ const { getFilePath: getFilePath$21, saveJsonToFile: saveJsonToFile$20, readJsonFile: readJsonFile$4 } = require_dist$2.frodo.utils;
41388
42394
  /**
41389
42395
  * Export the remote connector server (RCS) provisioner config in fr-config-manager format.
41390
42396
  * @return {Promise<boolean>} a promise that resolves to true if successful, false otherwise
@@ -41392,7 +42398,7 @@ const { getFilePath: getFilePath$22, saveJsonToFile: saveJsonToFile$21, readJson
41392
42398
  async function configManagerExportRemoteServers() {
41393
42399
  try {
41394
42400
  const exportData = await readConfigEntity$2("provisioner.openicf.connectorinfoprovider");
41395
- saveJsonToFile$21(exportData, getFilePath$22("sync/rcs/provisioner.openicf.connectorinfoprovider.json", true), false);
42401
+ saveJsonToFile$20(exportData, getFilePath$21("sync/rcs/provisioner.openicf.connectorinfoprovider.json", true), false);
41396
42402
  return true;
41397
42403
  } catch (error) {
41398
42404
  require_Console.printError(error, `Error exporting RCS configuration: provisioner.openicf.connectorinfoprovider`);
@@ -41405,8 +42411,8 @@ async function configManagerExportRemoteServers() {
41405
42411
  */
41406
42412
  async function configManagerImportRemoteServers() {
41407
42413
  try {
41408
- const fileData = getFilePath$22("sync/rcs/provisioner.openicf.connectorinfoprovider.json");
41409
- const importData = readJsonFile$5(fileData);
42414
+ const fileData = getFilePath$21("sync/rcs/provisioner.openicf.connectorinfoprovider.json");
42415
+ const importData = readJsonFile$4(fileData);
41410
42416
  await importConfigEntities$2({ idm: { [importData._id]: importData } });
41411
42417
  return true;
41412
42418
  } catch (error) {
@@ -41415,7 +42421,7 @@ async function configManagerImportRemoteServers() {
41415
42421
  return false;
41416
42422
  }
41417
42423
  // src/configManagerOps/FrConfigServiceObjectsOps.ts
41418
- const { getFilePath: getFilePath$21, saveJsonToFile: saveJsonToFile$20, readJsonFile: readJsonFile$4, escapePlaceholders } = require_dist$2.frodo.utils;
42424
+ const { getFilePath: getFilePath$20, saveJsonToFile: saveJsonToFile$19, readJsonFile: readJsonFile$3, escapePlaceholders } = require_dist$2.frodo.utils;
41419
42425
  const { queryManagedObjects: queryManagedObjects$1, updateManagedObject } = require_dist$2.frodo.idm.managed;
41420
42426
  /**
41421
42427
  * Export service objects in fr-config-manager format. Every service object of
@@ -41428,7 +42434,7 @@ const { queryManagedObjects: queryManagedObjects$1, updateManagedObject } = requ
41428
42434
  */
41429
42435
  async function configManagerExportServiceObjectsFromFile(file, allowFailures = false) {
41430
42436
  try {
41431
- const objects = readJsonFile$4(file, false);
42437
+ const objects = readJsonFile$3(file, false);
41432
42438
  const run = new OperationRun({
41433
42439
  unit: "service object",
41434
42440
  allowFailures
@@ -41444,7 +42450,7 @@ async function configManagerExportServiceObjectsFromFile(file, allowFailures = f
41444
42450
  continue;
41445
42451
  }
41446
42452
  const mergedAttributes = lodashMerge(escapePlaceholders(queryResult[0]), object.overrides);
41447
- saveJsonToFile$20(mergedAttributes, getFilePath$21(`service-objects/${objectType}/${object.searchValue}.json`, true), false, true);
42453
+ saveJsonToFile$19(mergedAttributes, getFilePath$20(`service-objects/${objectType}/${object.searchValue}.json`, true), false, true);
41448
42454
  run.recordSuccess();
41449
42455
  } catch (err) {
41450
42456
  require_Console.printError(err, `Error exporting service object ${name}`);
@@ -41468,7 +42474,7 @@ async function configManagerExportServiceObjectsFromFile(file, allowFailures = f
41468
42474
  */
41469
42475
  async function configManagerImportServiceObjects(allowFailures = false) {
41470
42476
  try {
41471
- const objectsDir = getFilePath$21("service-objects/");
42477
+ const objectsDir = getFilePath$20("service-objects/");
41472
42478
  if (!fs.default.existsSync(objectsDir)) {
41473
42479
  require_Console.printMessage(`No service objects to import: the folder '${objectsDir}' does not exist.`, "error");
41474
42480
  return false;
@@ -41492,7 +42498,7 @@ async function configManagerImportServiceObjects(allowFailures = false) {
41492
42498
  const name = `${objectType}/${objectFile}`;
41493
42499
  try {
41494
42500
  const fullPath = `${objectPath}/${objectFile}`;
41495
- const importData = readJsonFile$4(fullPath);
42501
+ const importData = readJsonFile$3(fullPath);
41496
42502
  delete importData._rev;
41497
42503
  delete importData._refProperties;
41498
42504
  await updateManagedObject(objectType, importData._id, importData);
@@ -41510,7 +42516,7 @@ async function configManagerImportServiceObjects(allowFailures = false) {
41510
42516
  return false;
41511
42517
  }
41512
42518
  // src/ops/ServiceOps.ts
41513
- const { getRealmName: getRealmName$5, getTypedFilename: getTypedFilename$15, titleCase: titleCase$5, saveJsonToFile: saveJsonToFile$19, getFilePath: getFilePath$20, getWorkingDirectory: getWorkingDirectory$18 } = require_dist$2.frodo.utils;
42519
+ const { getRealmName: getRealmName$5, getTypedFilename: getTypedFilename$15, titleCase: titleCase$5, saveJsonToFile: saveJsonToFile$18, getFilePath: getFilePath$19, getWorkingDirectory: getWorkingDirectory$18 } = require_dist$2.frodo.utils;
41514
42520
  const { getListOfServices, exportServices, exportService, getFullServices: getFullServices$1, createServiceExportTemplate, importService, importServices: importServices$1, deleteFullService, deleteFullServices } = require_dist$2.frodo.service;
41515
42521
  /**
41516
42522
  * List services
@@ -41544,7 +42550,7 @@ async function exportServicesToFile(file, globalConfig = false, includeMeta = tr
41544
42550
  const exportData = await exportServices(globalConfig);
41545
42551
  let fileName = getTypedFilename$15(`all${globalConfig ? "Global" : titleCase$5(getRealmName$5(require_dist$2.state.getRealm()))}Services`, `service`);
41546
42552
  if (file) fileName = file;
41547
- saveJsonToFile$19(exportData, getFilePath$20(fileName, true), includeMeta);
42553
+ saveJsonToFile$18(exportData, getFilePath$19(fileName, true), includeMeta);
41548
42554
  return true;
41549
42555
  } catch (error) {
41550
42556
  require_Console.printError(error);
@@ -41563,7 +42569,7 @@ async function exportServiceToFile(serviceId, file, globalConfig = false, includ
41563
42569
  const exportData = await exportService(serviceId, globalConfig);
41564
42570
  let fileName = getTypedFilename$15(serviceId, `service`);
41565
42571
  if (file) fileName = file;
41566
- saveJsonToFile$19(exportData, getFilePath$20(fileName, true), includeMeta);
42572
+ saveJsonToFile$18(exportData, getFilePath$19(fileName, true), includeMeta);
41567
42573
  return true;
41568
42574
  } catch (error) {
41569
42575
  require_Console.printError(error);
@@ -41589,11 +42595,11 @@ async function exportServicesToFiles(globalConfig = false, includeMeta = true, a
41589
42595
  const services = await getFullServices$1(globalConfig);
41590
42596
  for (const service of services) await run.run(service._type._id, () => {
41591
42597
  const fileName = getTypedFilename$15(service._type._id, `service`);
41592
- const filePath = getFilePath$20(fileName, true);
42598
+ const filePath = getFilePath$19(fileName, true);
41593
42599
  const exportData = createServiceExportTemplate();
41594
42600
  exportData.service[service._type._id] = service;
41595
42601
  require_Console.debugMessage(`cli.ServiceOps.exportServicesToFiles: exporting ${service._type._id} to ${filePath}`);
41596
- saveJsonToFile$19(exportData, filePath, includeMeta);
42602
+ saveJsonToFile$18(exportData, filePath, includeMeta);
41597
42603
  });
41598
42604
  require_Console.debugMessage(`cli.ServiceOps.exportServicesToFiles: end.`);
41599
42605
  return run.finish();
@@ -41618,7 +42624,7 @@ async function importServiceFromFile(serviceId, file, options = {
41618
42624
  let indicatorId;
41619
42625
  try {
41620
42626
  require_Console.debugMessage(`cli.ServiceOps.importServiceFromFile: start`);
41621
- const filePath = getFilePath$20(file);
42627
+ const filePath = getFilePath$19(file);
41622
42628
  indicatorId = require_Console.createProgressIndicator("indeterminate", 0, `Importing ${serviceId} from ${filePath}...`);
41623
42629
  const data = fs.default.readFileSync(filePath, "utf8");
41624
42630
  const importData = JSON.parse(data);
@@ -41651,7 +42657,7 @@ async function importFirstServiceFromFile(file, options = {
41651
42657
  let indicatorId;
41652
42658
  try {
41653
42659
  require_Console.debugMessage(`cli.ServiceOps.importFirstServiceFromFile: start`);
41654
- const filePath = getFilePath$20(file);
42660
+ const filePath = getFilePath$19(file);
41655
42661
  indicatorId = require_Console.createProgressIndicator("indeterminate", 0, `Importing ${filePath}...`);
41656
42662
  const data = fs.default.readFileSync(filePath, "utf8");
41657
42663
  const importData = JSON.parse(data);
@@ -41713,7 +42719,7 @@ async function importServicesFromFile(file, options = {
41713
42719
  let filePath;
41714
42720
  let importData;
41715
42721
  try {
41716
- filePath = getFilePath$20(file);
42722
+ filePath = getFilePath$19(file);
41717
42723
  require_Console.debugMessage(`cli.ServiceOps.importServiceFromFile: start [file=${filePath}]`);
41718
42724
  const data = fs.default.readFileSync(filePath, "utf8");
41719
42725
  require_Console.debugMessage(`cli.ServiceOps.importServiceFromFile: importing ${filePath}`);
@@ -41761,7 +42767,7 @@ async function importServicesFromFiles(options = {
41761
42767
  for (const file of serviceFiles) {
41762
42768
  let importData;
41763
42769
  try {
41764
- importData = JSON.parse(fs.default.readFileSync(getFilePath$20(file), "utf8"));
42770
+ importData = JSON.parse(fs.default.readFileSync(getFilePath$19(file), "utf8"));
41765
42771
  } catch (error) {
41766
42772
  require_Console.printError(error, `Error reading ${file}`);
41767
42773
  run.recordFailure(file, error);
@@ -41847,7 +42853,7 @@ async function deleteServices(globalConfig = false, allowFailures = false) {
41847
42853
  }
41848
42854
  // src/configManagerOps/FrConfigServiceOps.ts
41849
42855
  const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$170 } = require_dist$2.frodo.utils.constants;
41850
- const { getFilePath: getFilePath$19, saveJsonToFile: saveJsonToFile$18, getWorkingDirectory: getWorkingDirectory$17, readJsonFile: readJsonFile$3 } = require_dist$2.frodo.utils;
42856
+ const { getFilePath: getFilePath$18, saveJsonToFile: saveJsonToFile$17, getWorkingDirectory: getWorkingDirectory$17, readJsonFile: readJsonFile$2 } = require_dist$2.frodo.utils;
41851
42857
  const { getFullServices, importServices } = require_dist$2.frodo.service;
41852
42858
  const { DEFAULT_REALM_KEY: DEFAULT_REALM_KEY$1 } = require_dist$2.frodo.utils.constants;
41853
42859
  const EXCLUDE_SERVICES = ["DataStoreService"];
@@ -41900,9 +42906,9 @@ async function configManagerExportServices(realm, name, allowFailures = false) {
41900
42906
  const serviceName = `${realmDir}/${service._type._id}`;
41901
42907
  exported++;
41902
42908
  try {
41903
- if (service.nextDescendents?.length > 0) for (const descendent of service.nextDescendents) saveJsonToFile$18(descendent, getFilePath$19(`${fileDir}/${service._type._id}/${descendent._id}.json`, true), false, true);
42909
+ if (service.nextDescendents?.length > 0) for (const descendent of service.nextDescendents) saveJsonToFile$17(descendent, getFilePath$18(`${fileDir}/${service._type._id}/${descendent._id}.json`, true), false, true);
41904
42910
  delete service.nextDescendents;
41905
- saveJsonToFile$18(service, getFilePath$19(`${fileDir}/${service._type._id}.json`, true), false, true);
42911
+ saveJsonToFile$17(service, getFilePath$18(`${fileDir}/${service._type._id}.json`, true), false, true);
41906
42912
  run.recordSuccess();
41907
42913
  } catch (error) {
41908
42914
  require_Console.printError(error, `Error exporting service ${serviceName}`);
@@ -41940,12 +42946,12 @@ async function processImportServices(realmDir, run) {
41940
42946
  if (!entry.name.endsWith(".json")) continue;
41941
42947
  const baseName = entry.name.replace(".json", "");
41942
42948
  try {
41943
- const service = readJsonFile$3(`${realmsDir}/${entry.name}`);
42949
+ const service = readJsonFile$2(`${realmsDir}/${entry.name}`);
41944
42950
  const subDirPath = `${realmsDir}/${baseName}`;
41945
42951
  const descendants = [];
41946
42952
  if (fs.default.existsSync(subDirPath) && fs.default.statSync(subDirPath).isDirectory()) for (const subEntry of fs.default.readdirSync(subDirPath, { withFileTypes: true })) {
41947
42953
  if (!subEntry.name.endsWith(".json")) continue;
41948
- descendants.push(readJsonFile$3(`${subDirPath}/${subEntry.name}`));
42954
+ descendants.push(readJsonFile$2(`${subDirPath}/${subEntry.name}`));
41949
42955
  }
41950
42956
  service.nextDescendents = descendants;
41951
42957
  results.push(service);
@@ -42025,7 +43031,7 @@ async function configManagerImportServices(name, realm, allowFailures = false) {
42025
43031
  }
42026
43032
  // src/configManagerOps/FrConfigUiConfigOps.ts
42027
43033
  const { readConfigEntity: readConfigEntity$1, importConfigEntities: importConfigEntities$1 } = require_dist$2.frodo.idm.config;
42028
- const { getFilePath: getFilePath$18, saveJsonToFile: saveJsonToFile$17, readJsonFile: readJsonFile$2 } = require_dist$2.frodo.utils;
43034
+ const { getFilePath: getFilePath$17, saveJsonToFile: saveJsonToFile$16, readJsonFile: readJsonFile$1 } = require_dist$2.frodo.utils;
42029
43035
  /**
42030
43036
  * Export IDM UI configuration in fr-config-manager format.
42031
43037
  * @return {Promise<boolean>} a promise that resolves to true if successful, false otherwise
@@ -42033,7 +43039,7 @@ const { getFilePath: getFilePath$18, saveJsonToFile: saveJsonToFile$17, readJson
42033
43039
  async function configManagerExportUiConfig() {
42034
43040
  try {
42035
43041
  const exportData = await readConfigEntity$1("ui/configuration");
42036
- saveJsonToFile$17(exportData, getFilePath$18("ui/ui-configuration.json", true), false);
43042
+ saveJsonToFile$16(exportData, getFilePath$17("ui/ui-configuration.json", true), false);
42037
43043
  return true;
42038
43044
  } catch (error) {
42039
43045
  require_Console.printError(error, `Error exporting config entity ui-configuration`);
@@ -42046,7 +43052,7 @@ async function configManagerExportUiConfig() {
42046
43052
  */
42047
43053
  async function configManagerImportUiConfig() {
42048
43054
  try {
42049
- const config = readJsonFile$2(getFilePath$18(`ui/ui-configuration.json`));
43055
+ const config = readJsonFile$1(getFilePath$17(`ui/ui-configuration.json`));
42050
43056
  await importConfigEntities$1({ idm: { [config._id]: config } });
42051
43057
  return true;
42052
43058
  } catch (error) {
@@ -42621,7 +43627,7 @@ function setup$355() {
42621
43627
  return program;
42622
43628
  }
42623
43629
  // src/configManagerOps/FrConfigIgaWorkflowsOps.ts
42624
- const { saveJsonToFile: saveJsonToFile$16, getFilePath: getFilePath$17, readJsonFile: readJsonFile$1, getWorkingDirectory: getWorkingDirectory$15 } = require_dist$2.frodo.utils;
43630
+ const { saveJsonToFile: saveJsonToFile$15, getFilePath: getFilePath$16, readJsonFile, getWorkingDirectory: getWorkingDirectory$15 } = require_dist$2.frodo.utils;
42625
43631
  const { readWorkflows, updateWorkflow } = require_dist$2.frodo.cloud.iga.workflow;
42626
43632
  /**
42627
43633
  * Export IGA workflows in fr-config-manager format.
@@ -42658,10 +43664,10 @@ async function configManagerExportIgaWorkflows(name, includeImmutable = false, a
42658
43664
  extractFrConfigDataToFile(step.scriptTask.script, scriptFilename, stepPath);
42659
43665
  step.scriptTask.script = { file: scriptFilename };
42660
43666
  }
42661
- saveJsonToFile$16(step, getFilePath$17(`${stepPath}/${uniqueId}.json`, true), false, true);
43667
+ saveJsonToFile$15(step, getFilePath$16(`${stepPath}/${uniqueId}.json`, true), false, true);
42662
43668
  });
42663
43669
  delete workflow.steps;
42664
- saveJsonToFile$16(workflow, getFilePath$17(`${workflowPath}/${workflowName}.json`, true), false, true);
43670
+ saveJsonToFile$15(workflow, getFilePath$16(`${workflowPath}/${workflowName}.json`, true), false, true);
42665
43671
  run.recordSuccess();
42666
43672
  } catch (error) {
42667
43673
  require_Console.printError(error, `Error exporting workflow ${workflow.name}`);
@@ -42699,7 +43705,7 @@ async function configManagerImportIgaWorkflows(name, draft = false, allowFailure
42699
43705
  const workflowName = path.default.parse(workflowDir).base;
42700
43706
  try {
42701
43707
  const workflowFile = path.default.join(workflowDir, `${workflowName}.json`);
42702
- const workflow = readJsonFile$1(workflowFile);
43708
+ const workflow = readJsonFile(workflowFile);
42703
43709
  if (name && name !== workflow.name) continue;
42704
43710
  workflowFound = true;
42705
43711
  if (!workflow.mutable) {
@@ -42713,7 +43719,7 @@ async function configManagerImportIgaWorkflows(name, draft = false, allowFailure
42713
43719
  for (const stepDir of stepDirs) {
42714
43720
  const stepName = path.default.parse(stepDir).base;
42715
43721
  const stepFile = path.default.join(stepDir, `${stepName}.json`);
42716
- const step = readJsonFile$1(stepFile);
43722
+ const step = readJsonFile(stepFile);
42717
43723
  if (step.type === "scriptTask" && step.scriptTask && step.scriptTask.script && step.scriptTask.script.file) {
42718
43724
  const filePath = path.default.join(stepDir, step.scriptTask.script.file);
42719
43725
  if (fs.default.existsSync(filePath)) step.scriptTask.script = fs.default.readFileSync(filePath, "utf8");
@@ -43200,121 +44206,6 @@ function setup$334() {
43200
44206
  });
43201
44207
  return program;
43202
44208
  }
43203
- // src/configManagerOps/FrConfigTelemetryOps.ts
43204
- const { saveJsonToFile: saveJsonToFile$15, getFilePath: getFilePath$16, readJsonFile } = require_dist$2.frodo.utils;
43205
- const { exportTelemetry, importTelemetry } = require_dist$2.frodo.cloud.telemetry;
43206
- /**
43207
- * Exports telemetry configuration in config manager format
43208
- * @param {TelemetryExporterCategory} category optional parameter to export telemetry by category.
43209
- * @param {string} name optional parameter to export telemetry config by name.
43210
- * @param {boolean} allowFailures true to succeed although some exporters could not be exported (the failures are still summarised)
43211
- * @returns { Promise<boolean> } returns false if a named exporter does not exist, the telemetry cannot be read, or an exporter cannot be exported (unless failures are allowed). No exporters when none was named is a success.
43212
- */
43213
- async function configManagerExportTelemetry(category, name, allowFailures = false) {
43214
- try {
43215
- const exporters = await exportTelemetry(name, category);
43216
- const items = Object.entries(exporters.telemetry).flatMap(([cat, providers]) => providers.map((provider) => ({
43217
- cat,
43218
- provider
43219
- })));
43220
- if (name && items.length === 0) {
43221
- require_Console.printMessage(`Telemetry exporter '${name}' not found.`, "error");
43222
- return false;
43223
- }
43224
- if (items.length === 0) {
43225
- require_Console.printMessage("No telemetry exporters found to export.");
43226
- return true;
43227
- }
43228
- const run = new OperationRun({
43229
- unit: "telemetry exporter",
43230
- allowFailures
43231
- });
43232
- for (const { cat, provider } of items) try {
43233
- const exportProvider = provider;
43234
- if (exportProvider.headers) {
43235
- const placeholders = {};
43236
- Object.keys(exportProvider.headers).forEach((headerName) => {
43237
- placeholders[headerName] = `\${TELEMETRY_HEADER_${cat}_${provider.id}_${headerName}}`.replaceAll("-", "_").toUpperCase();
43238
- });
43239
- exportProvider.headers = placeholders;
43240
- }
43241
- saveJsonToFile$15(exportProvider, getFilePath$16(`telemetry/${cat}/${provider.id}.json`, true), false);
43242
- run.recordSuccess();
43243
- } catch (error) {
43244
- require_Console.printError(error, `Error exporting telemetry exporter ${provider.id}`);
43245
- run.recordFailure(`${cat}/${provider.id}`, causeOf(error));
43246
- }
43247
- return run.finish();
43248
- } catch (e) {
43249
- require_Console.printError(e);
43250
- }
43251
- return false;
43252
- }
43253
- /**
43254
- * Imports telemetry configuration in config manager format
43255
- * @param {TelemetryExporterCategory} category optional parameter to import telemetry by category.
43256
- * @param {string} name optional parameter to import telemetry config by name.
43257
- * @param {boolean} allowFailures true to succeed although some exporters could not be imported (the failures are still summarised)
43258
- * @returns { Promise<boolean> } returns false if the telemetry folder or a named exporter does not exist, or an exporter cannot be read or imported (unless failures are allowed). No exporters when none was named is a success.
43259
- */
43260
- async function configManagerImportTelemetry(category, name, allowFailures = false) {
43261
- let indicatorId = require_Console.createProgressIndicator("indeterminate", 0, `Reading telemetry exporters...`);
43262
- try {
43263
- const telemetryDir = getFilePath$16("telemetry");
43264
- if (!fs.default.existsSync(telemetryDir)) {
43265
- require_Console.stopProgressIndicator(indicatorId, `Telemetry folder not found: ${telemetryDir}`, "fail");
43266
- return false;
43267
- }
43268
- const categories = fs.default.readdirSync(telemetryDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter((cat) => !category || cat === category);
43269
- const run = new OperationRun({
43270
- unit: "telemetry exporter",
43271
- allowFailures
43272
- });
43273
- const exporters = [];
43274
- for (const cat of categories) {
43275
- const catDir = getFilePath$16(`telemetry/${cat}`);
43276
- if (!fs.default.existsSync(catDir)) continue;
43277
- const files = fs.default.readdirSync(catDir).filter((f) => f.toLowerCase().endsWith(".json")).filter((f) => !name || f === `${name}.json`);
43278
- for (const file of files) {
43279
- const filePath = `${catDir}/${file}`;
43280
- try {
43281
- const provider = readJsonFile(filePath);
43282
- exporters.push({
43283
- cat,
43284
- id: `${cat}/${provider.id ?? file}`,
43285
- provider
43286
- });
43287
- } catch (error) {
43288
- require_Console.printError(error, `Error reading telemetry exporter ${cat}/${file}`);
43289
- run.recordFailure(`${cat}/${file}`, causeOf(error));
43290
- }
43291
- }
43292
- }
43293
- if (exporters.length === 0 && !run.hasFailures) {
43294
- if (name) {
43295
- require_Console.stopProgressIndicator(indicatorId, `No matching telemetry exporter found for ${name}`, "fail");
43296
- return false;
43297
- }
43298
- require_Console.stopProgressIndicator(indicatorId, "No telemetry exporters found to import", "success");
43299
- return true;
43300
- }
43301
- require_Console.stopProgressIndicator(indicatorId, `Successfully read ${exporters.length} telemetry exporter(s).`, "success");
43302
- indicatorId = require_Console.createProgressIndicator("indeterminate", 0, "Importing telemetry exporters...");
43303
- for (const { cat, id, provider } of exporters) try {
43304
- await importTelemetry({ telemetry: { [cat]: [provider] } });
43305
- run.recordSuccess();
43306
- } catch (error) {
43307
- require_Console.printError(error, `Error importing telemetry exporter ${id}`);
43308
- run.recordFailure(id, causeOf(error));
43309
- }
43310
- require_Console.stopProgressIndicator(indicatorId, run.hasFailures ? "Telemetry import completed with failures." : `Successfully imported ${exporters.length} telemetry exporter(s).`, run.hasFailures ? "fail" : "success");
43311
- return run.finish();
43312
- } catch (error) {
43313
- require_Console.stopProgressIndicator(indicatorId, `Failed to import Telemetry.`, "fail");
43314
- require_Console.printError(error, "Error importing telemetry configuration");
43315
- return false;
43316
- }
43317
- }
43318
44209
  // src/cli/config-manager/config-manager-pull/config-manager-pull-telemetry.ts
43319
44210
  const { CLOUD_DEPLOYMENT_TYPE_KEY: CLOUD_DEPLOYMENT_TYPE_KEY$144 } = require_dist$2.frodo.utils.constants;
43320
44211
  const deploymentTypes$158 = [CLOUD_DEPLOYMENT_TYPE_KEY$144];
@@ -43430,7 +44321,7 @@ function setup$328() {
43430
44321
  program.addCommand(setup$331().name("themes"));
43431
44322
  program.addCommand(setup$333().name("telemetry"));
43432
44323
  program.addCommand(setup$332().name("terms-and-conditions"));
43433
- program.addCommand(setup$399().name("test"));
44324
+ program.addCommand(setup$400().name("test"));
43434
44325
  program.addCommand(setup$347().name("oauth-issuers"));
43435
44326
  program.addCommand(setup$330().name("ui-config"));
43436
44327
  program.addCommand(setup$329().name("variables"));
@@ -44290,7 +45181,7 @@ function setup$280() {
44290
45181
  program.addCommand(setup$316().name("custom-nodes"));
44291
45182
  program.addCommand(setup$317().name("csp"));
44292
45183
  program.addCommand(setup$293().name("restart"));
44293
- program.addCommand(setup$399().name("test"));
45184
+ program.addCommand(setup$400().name("test"));
44294
45185
  program.addCommand(setup$305().name("journeys"));
44295
45186
  program.addCommand(setup$281().name("variables"));
44296
45187
  program.addCommand(setup$296().name("raw"));
@@ -45834,7 +46725,7 @@ function setup$262() {
45834
46725
  program.addCommand(setup$271().name("describe"));
45835
46726
  program.addCommand(setup$270().name("list"));
45836
46727
  program.addCommand(setup$264().name("service-account"));
45837
- program.addCommand(setup$399().name("test"));
46728
+ program.addCommand(setup$400().name("test"));
45838
46729
  return program;
45839
46730
  }
45840
46731
  // src/ops/ConnectorOps.ts
@@ -55665,7 +56556,7 @@ function setup$122() {
55665
56556
  return program;
55666
56557
  }
55667
56558
  // package.json
55668
- var version$1 = "5.0.0-26";
56559
+ var version$1 = "5.0.0-27";
55669
56560
  // node_modules/@modelcontextprotocol/server/dist/chunk-vYduTEsO.mjs
55670
56561
  var __create = Object.create;
55671
56562
  var __defProp = Object.defineProperty;
@@ -81444,7 +82335,7 @@ const { getVersion, getBuildTimestamp, getAllVersions } = require_dist$2.frodo.u
81444
82335
  * rather than a tsup build, since no bundler ever substitutes the
81445
82336
  * identifier there.
81446
82337
  */
81447
- const getCliBuildTimestamp = () => "2026-11-13T16:13:04.451Z";
82338
+ const getCliBuildTimestamp = () => "2026-11-14T06:09:42.118Z";
81448
82339
  const VERSION_CACHE_FILE = `${os.default.homedir()}/.frodo/Versions.json`;
81449
82340
  const VERSION_CHECK_INTERVAL = 86400;
81450
82341
  const ENDPOINTS = [{
@@ -105142,12 +106033,12 @@ process.argv = normalizeExpandedHelpArgv(process.argv);
105142
106033
  require_Console.printMessage(await getVersions(true), "text", false);
105143
106034
  await initConnectionProfiles();
105144
106035
  await initTokenCache();
105145
- program.addCommand(setup$465().helpGroup(utilitiesCommandsHeading));
105146
- program.addCommand(setup$434());
105147
- program.addCommand(setup$459());
105148
- program.addCommand(setup$419());
105149
- program.addCommand(setup$400());
105150
- program.addCommand(setup$423());
106036
+ program.addCommand(setup$466().helpGroup(utilitiesCommandsHeading));
106037
+ program.addCommand(setup$435());
106038
+ program.addCommand(setup$460());
106039
+ program.addCommand(setup$420());
106040
+ program.addCommand(setup$401());
106041
+ program.addCommand(setup$424());
105151
106042
  program.addCommand(setup$276());
105152
106043
  program.addCommand(setup$279().helpGroup(ciCommandsHeading));
105153
106044
  program.addCommand(setup$262().helpGroup(utilitiesCommandsHeading));