UNPKG

@statezero/core

Version:

The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate

40 lines (39 loc) 1.66 kB
/** * Serializes an action payload based on the action's input schema. * Automatically handles model instances (extracts PK), files, dates, etc. * * @param {Object} payload - The raw payload with potentially model instances * @param {Object} inputProperties - The action's input_properties schema * @returns {Object} Serialized payload ready for API transmission */ export function serializeActionPayload(payload: Object, inputProperties: Object): Object; export namespace fileFieldSerializer { function toInternal(value: any, context?: {}): any; function toLive(value: any, context?: {}): any; } export namespace dateFieldSerializer { export function toInternal_1(value: any, context?: {}): any; export { toInternal_1 as toInternal }; export function toLive_1(value: any, context?: {}): any; export { toLive_1 as toLive }; } export namespace relationshipFieldSerializer { export function toInternal_2(value: any, context?: {}): string | number | null | undefined; export { toInternal_2 as toInternal }; export function toLive_2(value: any, context?: {}): any; export { toLive_2 as toLive }; } export namespace m2mFieldSerializer { export function toInternal_3(value: any, context?: {}): any; export { toInternal_3 as toInternal }; export function toLive_3(value: any, context?: {}): any; export { toLive_3 as toLive }; } export class ModelSerializer { constructor(modelClass: any); modelClass: any; toInternalField(field: any, value: any, context?: {}): any; toInternal(data: any): {}; toLiveField(field: any, value: any, context?: {}): any; toLive(data: any): {}; }