mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-04 00:56:01 +00:00
updated schemas, fixed tests, skipping flow tests for now
This commit is contained in:
@@ -23,46 +23,28 @@ export function buildMediaSchema() {
|
||||
);
|
||||
});
|
||||
|
||||
return s
|
||||
.strictObject(
|
||||
{
|
||||
enabled: s.boolean({ default: false }),
|
||||
basepath: s.string({ default: "/api/media" }),
|
||||
entity_name: s.string({ default: "media" }),
|
||||
storage: s
|
||||
.strictObject({
|
||||
body_max_size: s.number({
|
||||
return s.strictObject(
|
||||
{
|
||||
enabled: s.boolean({ default: false }),
|
||||
basepath: s.string({ default: "/api/media" }),
|
||||
entity_name: s.string({ default: "media" }),
|
||||
storage: s.strictObject(
|
||||
{
|
||||
body_max_size: s
|
||||
.number({
|
||||
description: "Max size of the body in bytes. Leave blank for unlimited.",
|
||||
}),
|
||||
})
|
||||
.partial(),
|
||||
adapter: s.anyOf(Object.values(adapterSchemaObject)),
|
||||
},
|
||||
{
|
||||
default: {},
|
||||
},
|
||||
)
|
||||
.partial();
|
||||
})
|
||||
.optional(),
|
||||
},
|
||||
{ default: {} },
|
||||
),
|
||||
adapter: s.anyOf(Object.values(adapterSchemaObject)).optional(),
|
||||
},
|
||||
{
|
||||
default: {},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const mediaConfigSchema = buildMediaSchema();
|
||||
export type TAppMediaConfig = s.Static<typeof mediaConfigSchema>;
|
||||
export type TAppMediaConfig2 = s.ObjectDefaults<(typeof mediaConfigSchema)["properties"]>;
|
||||
|
||||
const schema = s.strictObject(
|
||||
{
|
||||
enabled: s.boolean({ default: false }),
|
||||
basepath: s.string({ default: "/api/media" }),
|
||||
entity_name: s.string({ default: "media" }),
|
||||
storage: s
|
||||
.strictObject({
|
||||
body_max_size: s.number({
|
||||
description: "Max size of the body in bytes. Leave blank for unlimited.",
|
||||
}),
|
||||
})
|
||||
.partial(),
|
||||
},
|
||||
{
|
||||
default: {},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -37,7 +37,8 @@ export class Storage implements EmitsEvents {
|
||||
this.#adapter = adapter;
|
||||
this.config = {
|
||||
...config,
|
||||
body_max_size: config.body_max_size,
|
||||
body_max_size:
|
||||
config.body_max_size && config.body_max_size > 0 ? config.body_max_size : undefined,
|
||||
};
|
||||
|
||||
this.emgr = emgr ?? new EventManager();
|
||||
|
||||
Reference in New Issue
Block a user