update schema gen

+ support for PocketBase v0.22.23
+ support for Deno 2
+ now depends on pocketbase npm package
This commit is contained in:
michal-kapala
2024-11-06 16:17:06 +01:00
parent 8692f25e71
commit ce03fd9991
9 changed files with 130 additions and 86 deletions

View File

@ -33,3 +33,33 @@ export const POCKETBASE_SYSFIELD = [
"created",
"updated",
];
export type Options = {
[key: string]: any;
};
export type SchemaField = {
id?: string;
name: string;
type: PocketbaseType;
required: boolean;
system: boolean;
presentable: boolean;
unique: boolean;
options: Options;
};
export type Collection = {
id?: string;
name: string;
type: string;
system: boolean;
schema: SchemaField[];
indexes: string[];
listRule: string | null;
viewRule: string |null;
createRule: string |null;
updateRule: string |null;
deleteRule: string |null;
options: Options;
};