// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { resourceIdentifier, resourceIdentifierRequest, resourceIdentifierResponse } from './resource-identifier'; import { actionPostAction, actionPostActionRequest, actionPostActionResponse } from './action-post-action'; /** * The shape of the model inside the application code - what the users use */ export const actionPost = z.object({ target: resourceIdentifier, action: actionPostAction, }); /** * * @typedef {ActionPost} actionPost * @property {ResourceIdentifier} * @property {ActionPostAction} - The action to be executed on recall */ export type ActionPost = z.infer; /** * The shape of the model mapping from the api schema into the application shape. * Is equal to application shape if all property names match the api schema */ export const actionPostResponse = z .object({ target: resourceIdentifierResponse, action: actionPostActionResponse, }) .transform((data) => ({ target: data['target'], action: data['action'], })); /** * The shape of the model mapping from the application shape into the api schema. * Is equal to application shape if all property names match the api schema */ export const actionPostRequest = z .object({ target: resourceIdentifierRequest.nullish(), action: actionPostActionRequest.nullish() }) .transform((data) => ({ target: data['target'], action: data['action'], }));