@statezero/core
Version:
The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate
24 lines (23 loc) • 1.45 kB
TypeScript
/**
* Process included entities from a response and register them in the model store.
* Uses the model registry to find the appropriate model class for each entity type.
*
* @param {ModelStoreRegistry} modelStoreRegistry - The model store registry to use
* @param {Object} included - The included entities object from the response
* @param {Function} ModelClass - The base model class to get the configKey from
* @param {QuerySet} [queryset] - Optional queryset to track which PKs came from this fetch
*/
export function processIncludedEntities(modelStoreRegistry: ModelStoreRegistry, included: Object, ModelClass: Function, queryset?: QuerySet): void;
/**
* Makes an API call to the backend with the given QuerySet.
* Automatically handles FileObject replacement with file paths for write operations.
*
* @param {QuerySet} querySet - The QuerySet to execute.
* @param {string} operationType - The type of operation to perform.
* @param {Object} args - Additional arguments for the operation.
* @param {string} operationId - A unique id for the operation
* @param {Function} beforeExit - Optional callback before returning
* @param {string} canonicalId - Optional canonical_id for cache sharing
* @returns {Promise<Object>} The API response.
*/
export function makeApiCall(querySet: QuerySet, operationType: string, args: Object | undefined, operationId: string, beforeExit?: Function, canonicalId?: string): Promise<Object>;