mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
refactor auth/media entities to separate files, suppress node:sqlite warning
This commit is contained in:
@@ -3,18 +3,10 @@ import { $console } from "core/utils";
|
||||
import type { Entity, EntityManager } from "data";
|
||||
import { type FileUploadedEventData, Storage, type StorageAdapter, MediaPermissions } from "media";
|
||||
import { Module } from "modules/Module";
|
||||
import {
|
||||
type FieldSchema,
|
||||
boolean,
|
||||
datetime,
|
||||
em,
|
||||
entity,
|
||||
json,
|
||||
number,
|
||||
text,
|
||||
} from "../data/prototype";
|
||||
import { type FieldSchema, em, entity } from "../data/prototype";
|
||||
import { MediaController } from "./api/MediaController";
|
||||
import { buildMediaSchema, type mediaConfigSchema, registry } from "./media-schema";
|
||||
import { mediaFields } from "./media-entities";
|
||||
|
||||
export type MediaFieldSchema = FieldSchema<typeof AppMedia.mediaFields>;
|
||||
declare module "core" {
|
||||
@@ -95,18 +87,7 @@ export class AppMedia extends Module<typeof mediaConfigSchema> {
|
||||
};
|
||||
}
|
||||
|
||||
static mediaFields = {
|
||||
path: text().required(),
|
||||
folder: boolean({ default_value: false, hidden: true, fillable: ["create"] }),
|
||||
mime_type: text(),
|
||||
size: number(),
|
||||
scope: text({ hidden: true, fillable: ["create"] }),
|
||||
etag: text(),
|
||||
modified_at: datetime(),
|
||||
reference: text(),
|
||||
entity_id: number(),
|
||||
metadata: json(),
|
||||
};
|
||||
static mediaFields = mediaFields;
|
||||
|
||||
getMediaEntity(forceCreate?: boolean): Entity<"media", typeof AppMedia.mediaFields> {
|
||||
const entity_name = this.config.entity_name;
|
||||
|
||||
Reference in New Issue
Block a user