Class EnforcingEntityLoader<TFields, TID, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>

Enforcing view on an entity loader. All loads through this loader will throw if the loads are not successful.

Type Parameters

  • TFields extends object

  • TID extends NonNullable<TFields[TSelectedFields]>

  • TViewerContext extends ViewerContext

  • TEntity extends ReadonlyEntity<TFields, TID, TViewerContext, TSelectedFields>

  • TPrivacyPolicy extends EntityPrivacyPolicy<TFields, TID, TViewerContext, TEntity, TSelectedFields>

  • TSelectedFields extends keyof TFields

Hierarchy

  • EnforcingEntityLoader

Constructors

  • Type Parameters

    • TFields extends object

    • TID extends {}

    • TViewerContext extends ViewerContext<TViewerContext>

    • TEntity extends ReadonlyEntity<TFields, TID, TViewerContext, TSelectedFields, TEntity>

    • TPrivacyPolicy extends EntityPrivacyPolicy<TFields, TID, TViewerContext, TEntity, TSelectedFields, TPrivacyPolicy>

    • TSelectedFields extends string | number | symbol

    Parameters

    • entityLoader: EntityLoader<TFields, TID, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>

    Returns EnforcingEntityLoader<TFields, TID, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>

Properties

entityLoader: EntityLoader<TFields, TID, TViewerContext, TEntity, TPrivacyPolicy, TSelectedFields>

Methods

  • Enforcing version of entity loader method by the same name.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • uniqueFieldName: N
    • fieldValue: NonNullable<TFields[N]>

    Returns Promise<null | TEntity>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view the returned entity

    Throws

    when multiple entities are found matching the condition

  • Enforcing version of entity loader method by the same name.

    Parameters

    • id: TID

    Returns Promise<TEntity>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view the returned entity

  • Enforcing version of entity loader method by the same name.

    Parameters

    • id: TID

    Returns Promise<null | TEntity>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view the returned entity

    Throws

    when multiple entities are found matching the condition

  • Enforcing version of entity loader method by the same name.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    Returns Promise<null | TEntity>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

  • Enforcing version of entity loader method by the same name.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • fieldName: N
    • fieldValue: NonNullable<TFields[N]>

    Returns Promise<readonly TEntity[]>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

  • Enforcing version of entity loader method by the same name.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • fieldName: N
    • fieldValues: readonly NonNullable<TFields[N]>[]

    Returns Promise<ReadonlyMap<NonNullable<TFields[N]>, readonly TEntity[]>>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

  • Enforcing version of entity loader method by the same name.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    Returns Promise<readonly TEntity[]>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

  • Enforcing version of entity loader method by the same name.

    Parameters

    • ids: readonly TID[]

    Returns Promise<ReadonlyMap<TID, TEntity>>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

  • Enforcing version of entity loader method by the same name.

    Parameters

    • ids: readonly TID[]

    Returns Promise<ReadonlyMap<TID, null | TEntity>>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

  • Enforcing version of entity loader method by the same name.

    Parameters

    Returns Promise<readonly TEntity[]>

    Throws

    EntityNotAuthorizedError when viewer is not authorized to view one or more of the returned entities

Generated using TypeDoc