node-opa
    Preparing search index...

    Type Alias PolicyAPI

    type PolicyAPI = {
        create(
            id: string,
            rego: string,
            pretty?: boolean,
            metrics?: boolean,
        ): Promise<Record<string, never>>;
        delete(
            id: string,
            pretty?: boolean,
            metrics?: boolean,
        ): Promise<Record<string, never>>;
        get(id: string, pretty: boolean): Promise<GetPolicyResponse>;
        list(): Promise<ListPoliciesResponse>;
        put(
            id: string,
            rego: string,
            pretty?: boolean,
            metrics?: boolean,
        ): Promise<Record<string, never>>;
        update(
            id: string,
            rego: string,
            pretty?: boolean,
            metrics?: boolean,
        ): Promise<Record<string, never>>;
    }
    Index

    Methods

    • Parameters

      • id: string
      • rego: string
      • Optionalpretty: boolean
      • Optionalmetrics: boolean

      Returns Promise<Record<string, never>>

      OPAClient.policy.put

      put

    • Deletes a policy module by ID.

      Parameters

      • id: string

        The policy module ID.

      • Optionalpretty: boolean

        Format response for humans.

      • Optionalmetrics: boolean

        Include compiler performance metrics.

      Returns Promise<Record<string, never>>

      Empty object on success.

    • Creates or updates a policy module.

      Parameters

      • id: string

        The policy module ID.

      • rego: string

        Rego policy as plain text.

      • Optionalpretty: boolean

        Format response for humans.

      • Optionalmetrics: boolean

        Include compiler performance metrics.

      Returns Promise<Record<string, never>>

      Empty object on success.

    • Parameters

      • id: string
      • rego: string
      • Optionalpretty: boolean
      • Optionalmetrics: boolean

      Returns Promise<Record<string, never>>

      OPAClient.policy.put

      put