private getCurrentDurableEntityContext()

in src/entities/Entity.ts [78:100]


    private getCurrentDurableEntityContext(
        bindingInfo: DurableEntityBindingInfo,
        batchState: EntityState,
        requestIndex: number,
        startTime: Date
    ): DurableEntityContext<T> {
        const currentRequest = bindingInfo.batch[requestIndex];
        return {
            entityName: bindingInfo.self.name,
            entityKey: bindingInfo.self.key,
            entityId: bindingInfo.self,
            operationName: currentRequest.name,
            isNewlyConstructed: !batchState.entityExists,
            getState: this.getState.bind(this, batchState),
            setState: this.setState.bind(this, batchState),
            getInput: this.getInput.bind(this, currentRequest) as <TInput>() => TInput | undefined,
            return: this.return.bind(this, batchState, startTime) as <TResult = T>(
                value: TResult
            ) => void,
            destructOnExit: this.destructOnExit.bind(this, batchState),
            signalEntity: this.signalEntity.bind(this, batchState),
        };
    }