mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
added additional permissions, implemented mcp authentication
This commit is contained in:
@@ -78,9 +78,7 @@ export class DataController extends Controller {
|
||||
),
|
||||
async (c) => {
|
||||
const { force, drop } = c.req.valid("query");
|
||||
//console.log("force", force);
|
||||
const tables = await this.em.schema().introspect();
|
||||
//console.log("tables", tables);
|
||||
const changes = await this.em.schema().sync({
|
||||
force,
|
||||
drop,
|
||||
|
||||
@@ -29,15 +29,15 @@ export const fieldsSchemaObject = objectTransform(FIELDS, (field, name) => {
|
||||
);
|
||||
});
|
||||
export const fieldsSchema = s.anyOf(Object.values(fieldsSchemaObject));
|
||||
export const entityFields = s.record(fieldsSchema);
|
||||
export const entityFields = s.record(fieldsSchema, { default: {} });
|
||||
export type TAppDataField = s.Static<typeof fieldsSchema>;
|
||||
export type TAppDataEntityFields = s.Static<typeof entityFields>;
|
||||
|
||||
export const entitiesSchema = s.strictObject({
|
||||
name: s.string().optional(), // @todo: verify, old schema wasn't strict (req in UI)
|
||||
type: s.string({ enum: entityTypes, default: "regular" }),
|
||||
config: entityConfigSchema,
|
||||
fields: entityFields,
|
||||
type: s.string({ enum: entityTypes, default: "regular" }).optional(),
|
||||
config: entityConfigSchema.optional(),
|
||||
fields: entityFields.optional(),
|
||||
});
|
||||
export type TAppDataEntity = s.Static<typeof entitiesSchema>;
|
||||
|
||||
|
||||
@@ -10,14 +10,17 @@ import {
|
||||
|
||||
// @todo: entity must be migrated to typebox
|
||||
export const entityConfigSchema = s
|
||||
.strictObject({
|
||||
name: s.string(),
|
||||
name_singular: s.string(),
|
||||
description: s.string(),
|
||||
sort_field: s.string({ default: config.data.default_primary_field }),
|
||||
sort_dir: s.string({ enum: ["asc", "desc"], default: "asc" }),
|
||||
primary_format: s.string({ enum: primaryFieldTypes }),
|
||||
})
|
||||
.strictObject(
|
||||
{
|
||||
name: s.string(),
|
||||
name_singular: s.string(),
|
||||
description: s.string(),
|
||||
sort_field: s.string({ default: config.data.default_primary_field }),
|
||||
sort_dir: s.string({ enum: ["asc", "desc"], default: "asc" }),
|
||||
primary_format: s.string({ enum: primaryFieldTypes }),
|
||||
},
|
||||
{ default: {} },
|
||||
)
|
||||
.partial();
|
||||
|
||||
export type EntityConfig = s.Static<typeof entityConfigSchema>;
|
||||
|
||||
Reference in New Issue
Block a user