Frodo Library - v5.0.0-65
    Preparing search index...

    Type Alias IdmFeature

    IDM tenant-configuration feature management (GET/POST /openidm/feature).

    This is a distinct resource from cloud.feature (FeatureOps.ts), despite the overlapping "feature" terminology and shared installedVersion field name -- confirmed live against a real tenant that they return entirely different, unrelated lists. cloud.feature.readFeatures/hasFeature read environment-level entitlement/licensing flags (e.g. identity-cloud, workforce, service-accounts) via a bare {host}/feature path already used internally by ServiceAccountOps.ts -- left untouched here. This module is for IDM's own tenant-configuration features (groups, aiagent, am/2fa/profiles, indexed/strings/6thru20, password/timestamps, etc.) that install new managed-object types/properties or repository indexes into the tenant, documented at https://docs.pingidentity.com/pingoneaic/idm-rest-api/endpoints/rest-feature.md.

    Installing a feature is irreversible: per that same documentation, uninstalling or disabling a feature once installed requires contacting Ping support and rolling back the tenant. There is no self-service undo.

    type IdmFeature = {
        canDiagnoseIdmFeature(featureId: string): boolean;
        diagnoseIdmFeature(featureId: string): Promise<IdmFeatureDiagnosis>;
        hasIdmFeature(featureId: string): Promise<boolean>;
        installIdmFeature(featureId: string): Promise<IdmFeatureActionResult>;
        listDiagnosableIdmFeatures(): string[];
        planIdmFeatureRepair(
            featureId: string,
            options?: IdmFeatureRepairOptions,
        ): Promise<IdmFeatureRepairPlan>;
        readIdmFeature(featureId: string): Promise<IdmFeatureInterface>;
        readIdmFeatures(): Promise<IdmFeatureInterface[]>;
        repairIdmFeature(
            plan: IdmFeatureRepairPlan,
            options?: IdmFeatureRepairExecutionOptions,
        ): Promise<IdmFeatureRepairResult>;
        validateIdmFeature(featureId: string): Promise<IdmFeatureActionResult>;
    }
    Index
    • Find out whether the library can diagnose (and repair) an IDM tenant-configuration feature, that is whether diagnoseIdmFeature judges it or only reports its registry entry (supported: false). The answer comes from the library's own list of features it knows (see listDiagnosableIdmFeatures): it is synchronous, sends no request and needs no login, so a caller can ask before it asks the tenant anything. It says what the library knows, not what a tenant has: a feature the library can diagnose may be absent from a tenant, and a feature the tenant has may be one the library cannot diagnose.

      Parameters

      • featureId: string

        feature id, e.g. 'aiagent'

      Returns boolean

      true if the library can diagnose the feature, false for any other id (an empty or unknown one included)

    • Find out why an IDM tenant-configuration feature reads as not installed or does not work. Read-only: it changes nothing in the tenant. The library has a diagnosis for the feature aiagent; for any other feature the result has supported: false and no findings, and only the registry entry is reported (canDiagnoseIdmFeature and listDiagnosableIdmFeatures say which features have a diagnosis, without a request).

      The result is { featureId, supported, installedVersion, availableVersions, findings }. A finding has an id that names the condition (definitions-cosmetic-drift, provider-auth-service-not-set, gate-closed, secret-mappings-dangling and so on), a severity (error: the feature does not work, warning: advisory, info: a healthy part), a message, whether the condition is repairable and its details. A condition that exists per realm is reported once per realm, with details.realm. A check that cannot be made (for example a request that is refused) is a finding check-failed, not an error; only a failing read of the registry throws.

      For aiagent the checks are: the registry and the result of validate; the definitions the feature writes (managed object definitions and repo.ds mappings) compared with the original of version 1, each difference classed cosmetic (white space, which is noise, or a title or an extra mapping property, which are customizations) or structural; per realm that has the AI agent managed objects, the OAuth 2.0 provider (it exists, has a password grant authentication service, has AI agents enabled with the expected object names), whether AM accepts AI agents (the agent type is listed and listing them answers 200, not 501), the mappings of the realm's ESV secret store that point to ESV secrets that do not exist, and IDM AI agent objects that AM does not list. A feature version other than the one the library knows the definitions of is reported as version-unsupported.

      Parameters

      • featureId: string

        feature id, e.g. 'aiagent'

      Returns Promise<IdmFeatureDiagnosis>

      a promise that resolves to the diagnosis

    • Check if an IDM tenant-configuration feature is installed.

      Parameters

      • featureId: string

        feature id, e.g. 'aiagent'

      Returns Promise<boolean>

      a promise that resolves to true if the feature is installed

    • Install an IDM tenant-configuration feature. Irreversible -- see the module-level remarks. The result always has four fields: status (from the response body), success, message (the response message, unchanged, for example "Install complete.") and failures (empty unless the response lists failures). success is true when the request succeeded and the response does not say success: false and lists no failures; the install response documented by Ping has no success field, so a successful install is success: true without one. success: false means the endpoint reported a failure, with its failures and message kept. A request that fails (HTTP error, network error) throws a FrodoError. This makes no second request: a caller that wants confirmation reads the feature again (readIdmFeature or hasIdmFeature) and checks installedVersion.

      Parameters

      • featureId: string

        feature id, e.g. 'aiagent'

      Returns Promise<IdmFeatureActionResult>

      a promise that resolves to the install result: status, success, message and failures

    • List the ids of the IDM tenant-configuration features that the library can diagnose (and repair): today aiagent. Synchronous, sends no request and needs no login. The list is the library's own registry, so a feature that gets a diagnosis is in it without a second edit, and canDiagnoseIdmFeature is true for exactly the ids in it. Every call returns a new array that the caller may change.

      Returns string[]

      the feature ids

    • Plan the repair of what diagnoseIdmFeature finds wrong with a feature, without writing anything. The library can repair the feature aiagent; for any other feature this throws (canDiagnoseIdmFeature says whether a feature can be repaired, without a request).

      The result is a plan: { featureId, options, diagnosis, repairable, blockers, steps, backup, normalised, customizations }. steps are the writes, itemised and in the order they run (delete secret store mappings that point to no ESV secret; create an OAuth 2.0 provider from the server's template or give one the password grant authentication service it lacks; align definitions that differ only cosmetically from the original when the enable action has to run, or when white space alone makes the registry read "not installed"; run the enable action; wait for the AM gate; put the customizations back, only with restoreCustomizations; diagnose again). normalised lists the white space the plan aligns with the original and never puts back; customizations lists the titles and extra mapping properties it replaces by the original, each with its outcome (replaced, or put-back with restoreCustomizations) and the tenantValue a person may want to restore. backup holds what the steps would overwrite or delete, as the tenant returns it: managed and repo.ds configuration, the OAuth 2.0 providers, the IDM AI agent and privilege objects and the mappings to be deleted. The plan therefore holds the raw backup of the tenant configuration, including the settings of the OAuth 2.0 providers that are not meant to be shared: handle it like the configuration itself (do not log or share it). The library writes no file: keep the backup before you call repairIdmFeature. repairable is false, with blockers, if something the library does not repair is wrong (structural drift, a feature version it does not know, an authentication service the realm lacks); the plan then has no steps. repairable with no steps means there is nothing to repair. Only errors are repaired, and one warning: white space that makes the registry read "not installed" while nothing else is wrong. Any other warning (for example a customized title while AI agents work) is left alone.

      The enable action installs the IDM feature internally, which would add definitions that are present but not equal to the original a second time. The plan therefore aligns them first. It leaves them aligned, so that the registry reads the feature installed; a customization (a title, an extra mapping property) is replaced by the original and is put back at the end only with restoreCustomizations, after which the registry reads "not installed" again, because it compares the definitions byte for byte. White space is never put back.

      Parameters

      • featureId: string

        feature id, e.g. 'aiagent'

      • Optionaloptions: IdmFeatureRepairOptions

        restoreCustomizations (default false) and authService (default Login)

      Returns Promise<IdmFeatureRepairPlan>

      a promise that resolves to the plan

    • Run a plan of planIdmFeatureRepair. Mutating: it writes configuration to the tenant. Every write is read back and compared with what was written, and a difference stops the run with a FrodoError; so does a tenant that no longer looks as it did when the plan was made. The enable action is run only if the registry reads the feature installed (after aligning the definitions if the plan says so). If a step fails after definitions were aligned, the customizations are put back before the error is thrown when the plan asks for that (restoreCustomizations), and the definitions stay aligned otherwise; that is decided by what this run aligned, not by the steps the plan still has. A plan carries no binding to a tenant; that is safe because every step reads the tenant again and recomputes against the shipped original definitions, so a plan made for one tenant can only align the same cosmetic differences, delete a mapping that still points to no ESV secret, create a provider that is still missing, or set the authentication service of a provider that still has none, and anything else in it is refused. The option restoreCustomizations of the plan is data too: editing it only leaves the customizations replaced, and the result says so. The result has normalised (the white space this run aligned) and customizations (the ones it replaced, each with its outcome replaced or put-back), so that a caller can tell a person what was replaced and where the previous value is.

      With wait the repair polls until AM accepts AI agents in the realms it enabled and returns as soon as it does, for at most timeout milliseconds (default 1,200,000, 20 minutes): the effect of the enable action can need minutes. Without it the repair returns after the enable action answered. A gate that is still closed when the time is up is a step with status failed and completed: false, not an error. resultCallback is called with the result of each step as soon as it is known. The result has the diagnosis after the repair.

      Parameters

      Returns Promise<IdmFeatureRepairResult>

      a promise that resolves to what was done

    • Validate whether an IDM tenant-configuration feature is installable, without installing it. The result always has four fields: status (from the response body), success (true when the feature can be installed), message (the response message, unchanged, for example "Validate complete. 24 failure(s).") and failures (one entry per reason the feature cannot be installed, for example "config/managed: /objects/-: value already present at /objects/14"; an empty array when there are none). success is what the response says; when the response has no success field, it is true exactly when failures is empty. A validation that finds failures is a result with success: false, not an error; a request that fails (HTTP error, network error) throws a FrodoError.

      Parameters

      • featureId: string

        feature id, e.g. 'aiagent'

      Returns Promise<IdmFeatureActionResult>

      a promise that resolves to the validation result: status, success, message and failures