40 lines
960 B
TypeScript
40 lines
960 B
TypeScript
/**
|
|
* Interface of the server (auto-generated code)
|
|
*/
|
|
import { z as zod } from "zod";
|
|
|
|
import {ZodLong} from "./long";
|
|
import {ZodGenericDataSoftDelete, ZodGenericDataSoftDeleteUpdate , ZodGenericDataSoftDeleteCreate } from "./generic-data-soft-delete";
|
|
|
|
export const ZodRightDescription = ZodGenericDataSoftDelete.extend({
|
|
/**
|
|
* Application id that have the reference of the right
|
|
*/
|
|
applicationId: ZodLong,
|
|
/**
|
|
* Key of the property
|
|
*/
|
|
key: zod.string().min(1).max(64),
|
|
/**
|
|
* Title of the right
|
|
*/
|
|
title: zod.string().min(1).max(1024),
|
|
/**
|
|
* Description of the right
|
|
*/
|
|
description: zod.string().max(1024),
|
|
|
|
});
|
|
|
|
export type RightDescription = zod.infer<typeof ZodRightDescription>;
|
|
|
|
export function isRightDescription(data: any): data is RightDescription {
|
|
try {
|
|
ZodRightDescription.parse(data);
|
|
return true;
|
|
} catch (e: any) {
|
|
console.log(`Fail to parse data type='ZodRightDescription' error=${e}`);
|
|
return false;
|
|
}
|
|
}
|