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

    Type Alias Policy

    type Policy = {
        createPolicy(
            policyId: string,
            policyData: PolicySkeleton,
        ): Promise<PolicySkeleton>;
        createPolicyExportTemplate(): PolicyExportInterface;
        deletePolicy(policyId: string): Promise<any>;
        exportPolicies(
            options?: PolicyExportOptions,
            resultCallback?: ResultCallback<PolicySkeleton>,
        ): Promise<PolicyExportInterface>;
        exportPoliciesByPolicySet(
            policySetName: string,
            options?: PolicyExportOptions,
            resultCallback?: ResultCallback<PolicySkeleton>,
        ): Promise<PolicyExportInterface>;
        exportPolicy(
            policyId: string,
            options?: PolicyExportOptions,
        ): Promise<PolicyExportInterface>;
        importFirstPolicy(
            importData: PolicyExportInterface,
            options?: PolicyImportOptions,
        ): Promise<PolicySkeleton>;
        importPolicies(
            importData: PolicyExportInterface,
            options?: PolicyImportOptions,
            resultCallback?: ResultCallback<PolicySkeleton>,
        ): Promise<PolicySkeleton[]>;
        importPolicy(
            policyId: string,
            importData: PolicyExportInterface,
            options?: PolicyImportOptions,
        ): Promise<PolicySkeleton>;
        readPolicies(): Promise<PolicySkeleton[]>;
        readPoliciesByPolicySet(policySetId: string): Promise<PolicySkeleton[]>;
        readPolicy(policyId: string): Promise<PolicySkeleton>;
        updatePolicy(
            policyId: string,
            policyData: PolicySkeleton,
        ): Promise<PolicySkeleton>;
    }
    Index
    • Delete policy

      Parameters

      • policyId: string

        policy id/name

      Returns Promise<any>

      promise resolving to a policy object

    • Export policies

      Parameters

      • Optionaloptions: PolicyExportOptions

        export options

      • OptionalresultCallback: ResultCallback<PolicySkeleton>

        Optional callback to process individual results. When given, the outcome of every policy is passed to it as it happens: a policy that was exported completely as the policy, a policy whose prerequisites or dependencies could not be exported as an error that names the policy and carries the causes. Such a policy is left out of the export and does not stop the others, and the function does not throw for it. Without it, the failures are collected and thrown as one error after every policy was tried. Failing to read the policies always throws.

      Returns Promise<PolicyExportInterface>

      a promise that resolves to an PolicyExportInterface object

    • Export policies by policy set

      Parameters

      • policySetName: string

        policy set id/name

      • Optionaloptions: PolicyExportOptions

        export options

      • OptionalresultCallback: ResultCallback<PolicySkeleton>

        Optional callback to process individual results. When given, the outcome of every policy is passed to it as it happens: a policy that was exported completely as the policy, a policy whose prerequisites or dependencies could not be exported as an error that names the policy and carries the causes. Such a policy is left out of the export and does not stop the others, and the function does not throw for it. Without it, the failures are collected and thrown as one error after every policy was tried. Failing to read the policies of the policy set always throws.

      Returns Promise<PolicyExportInterface>

      a promise that resolves to an PolicyExportInterface object

    • Import policies

      Parameters

      • importData: PolicyExportInterface

        import data

      • Optionaloptions: PolicyImportOptions

        import options

      • OptionalresultCallback: ResultCallback<PolicySkeleton>

        Optional callback to process individual results. When given, the outcome of every policy is passed to it once, as it happens: a policy that was imported completely as the policy (a policy that needed no update as it is in the import data), a policy that could not be imported, or whose prerequisites or dependencies could not be imported, as one error that names the policy and carries the causes. Such a policy is not part of the result and does not stop the others, and the function does not throw for it. Without it, the failures are collected and thrown as one error after every policy was tried.

      Returns Promise<PolicySkeleton[]>

      array of imported policy objects

    • Get policies by policy set

      Parameters

      • policySetId: string

        policy set id/name

      Returns Promise<PolicySkeleton[]>

      a promise resolving to an array of policy objects