Class DeprecatedApiClient

Contains all the deprecated permit.api. methods in one place. The SDK now replaced all permit.api.createRole() with permit.api.roles.create() due to the large number of API endpoints, trying to allow more user-friendly code autocomplete behavior.

Hierarchy

Implements

Constructors

Methods

  • Deletes a condition set.

    Parameters

    • conditionSetId: string

      The ID or key of the condition set to delete.

    Returns Promise<AxiosResponse<void, any>>

    A promise that resolves when the condition set is deleted.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.conditionSets.delete()

  • Deletes a resource.

    Parameters

    • resourceId: string

      The ID or key of the resource to delete.

    Returns Promise<AxiosResponse<void, any>>

    A promise that resolves when the resource is deleted.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.resources.delete()

  • Deletes a role.

    Parameters

    • roleId: string

      The ID or key of the role to delete.

    Returns Promise<AxiosResponse<void, any>>

    A promise that resolves when the role is deleted.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.roles.delete()

  • Deletes a tenant.

    Parameters

    • tenantId: string

      The ID or key of the tenant to delete.

    Returns Promise<AxiosResponse<void, any>>

    A promise that resolves when the tenant is deleted.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.tenants.delete()

  • Deletes a user.

    Parameters

    • userId: string

      The ID or key of the user to delete.

    Returns Promise<AxiosResponse<void, any>>

    A promise that resolves when the user is deleted.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.users.delete()

  • Ensure that the API Key has the necessary permissions to successfully call the API endpoint. Note that this check is not foolproof, and the API may still throw 401.

    Parameters

    • requiredAccessLevel: ApiKeyLevel

      The required API Key Access level for the endpoint.

    Returns Promise<void>

    Throws

    PermitContextError If the currently set API key access level does not match the required access level.

  • Ensure that the API context matches the required endpoint context.

    Parameters

    • requiredContext: ApiContextLevel

      The required API context level for the endpoint.

    Returns Promise<void>

    Throws

    PermitContextError If the currently set API context level does not match the required context level.

  • Retrieves the assigned roles for a user (either in a single tenant or in all tenants).

    Parameters

    • user: string

      The ID or key of the user.

    • Optional tenant: string

      The ID or key of the tenant, optional. If provided, only roles assigned within this tenant will be returned.

    Returns Promise<RoleAssignmentRead[]>

    A promise that resolves to an array of RoleAssignmentRead objects representing the assigned roles.

    Throws

    PermitApiError If the API returns an error HTTP status code.

    Throws

    PermitContextError If the configured ApiContext does not match the required endpoint context.

    Deprecated

    replaced with permit.api.users.getAssignedRoles()

Generated using TypeDoc