ISPO SDK
    Preparing search index...

    Interface EntityApi

    Markdown
    interface EntityApi {
        content: EntityPrivateContentApi;
        create<T = unknown>(
            type: string,
            data: T,
            options?: EntityCreateOptions,
        ): Promise<EntityRecord<T>>;
        delete<T = unknown>(
            type: string,
            id: string,
            options?: EntityDeleteOptions,
        ): Promise<EntityRecord<T>>;
        get<T = unknown>(type: string, id: string): Promise<EntityRecord<T>>;
        grant(input: EntityGrantInput): Promise<EntityGrant>;
        listTypes(): Promise<EntityTypeDefinition[]>;
        query<T = unknown>(
            type: string,
            query?: EntityQuery,
        ): Promise<EntityQueryResult<T>>;
        requestAccess(
            type: string,
            operations: EntityAccessOperation[],
        ): Promise<EntityAccessRequestResult>;
        revoke(grantId: string): Promise<EntityGrant>;
        subscribe(
            input: EntityWatchInput,
            onChange: EntitySubscriptionChange,
        ): EntitySubscription;
        subscribeQuery<T = unknown>(
            type: string,
            query: EntityQuery,
            onChange: EntityQuerySubscriptionChange<T>,
            options?: { recoveryCursor?: string },
        ): EntityQuerySubscription<T>;
        update<T = unknown>(
            type: string,
            id: string,
            patch: EntityPatch<NoInfer<T>>,
            options?: EntityUpdateOptions,
        ): Promise<EntityRecord<T>>;
        watch(input?: EntityWatchInput): Promise<EntityWatchResult>;
    }
    Index
    • Type Parameters

      • T = unknown

      Parameters

      • type: string
      • id: string

      Returns Promise<EntityRecord<T>>

    • Ask the user to grant this app access to an entity type for which it lacks the requested live authority. Read/query/watch may target one type or '*'; additive create may target one exact type only. Wildcard create and update/delete/grant are rejected. The host files and holds a durable approval card; an Allow resolves only after the exact host writer acknowledges and live authority rechecks. A caller deadline returns pending while the durable ask remains open, a lapsed ask returns expired, a trust/declaration veto returns blocked, and a post-Allow host write failure returns decision: 'error' with reason: 'apply-failed' — never deny, which only ever means a human refused.

      Parameters

      Returns Promise<EntityAccessRequestResult>