bknd
Version:
Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.
152 lines (151 loc) • 5.51 kB
TypeScript
import { s } from "bknd/utils";
export declare const ADAPTERS: {
readonly s3: {
readonly cls: typeof import("..").StorageS3Adapter;
readonly schema: s.ObjectSchema<{
readonly access_key: import("bknd/utils").SecretSchema<s.IStringOptions> & s.IStringOptions;
readonly secret_access_key: import("bknd/utils").SecretSchema<s.IStringOptions> & s.IStringOptions;
readonly url: s.StringSchema<s.IStringOptions> & s.IStringOptions;
}, {
readonly title: "AWS S3";
readonly description: "AWS S3 or compatible storage";
}> & {
readonly title: "AWS S3";
readonly description: "AWS S3 or compatible storage";
};
};
readonly cloudinary: {
readonly cls: typeof import("..").StorageCloudinaryAdapter;
readonly schema: s.ObjectSchema<{
readonly cloud_name: s.StringSchema<s.IStringOptions> & s.IStringOptions;
readonly api_key: import("bknd/utils").SecretSchema<s.IStringOptions> & s.IStringOptions;
readonly api_secret: import("bknd/utils").SecretSchema<s.IStringOptions> & s.IStringOptions;
readonly upload_preset: {
default?: any;
maxLength?: number | undefined;
minLength?: number | undefined;
pattern?: (string | RegExp) | undefined;
format?: string | undefined;
enum?: (readonly any[] | any[]) | undefined;
const?: any;
} & s.Schema<s.ISchemaOptions, string | undefined, string | undefined>;
}, {
readonly title: "Cloudinary";
readonly description: "Cloudinary media storage";
}> & {
readonly title: "Cloudinary";
readonly description: "Cloudinary media storage";
};
};
};
export declare const registry: import("../core/registry/Registry").Registry<{
cls: import("../core/registry/Registry").Constructor<import("..").StorageAdapter> & {
prototype: import("..").StorageAdapter;
};
schema: s.Schema;
}, Record<string, {
cls: import("../core/registry/Registry").Constructor<import("..").StorageAdapter> & {
prototype: import("..").StorageAdapter;
};
schema: s.Schema;
}>, import("../core/registry/Registry").RegisterFn<{
cls: import("../core/registry/Registry").Constructor<import("..").StorageAdapter> & {
prototype: import("..").StorageAdapter;
};
schema: s.Schema;
}>>;
export declare function buildMediaSchema(): s.ObjectSchema<{
readonly enabled: s.Schema<{
readonly default: false;
}, boolean, boolean> & {
readonly default: false;
};
readonly basepath: s.StringSchema<{
readonly default: "/api/media";
}> & {
readonly default: "/api/media";
};
readonly entity_name: s.StringSchema<{
readonly default: "media";
}> & {
readonly default: "media";
};
readonly storage: s.ObjectSchema<{
readonly body_max_size: {} & s.Schema<s.ISchemaOptions, number | undefined, number | undefined>;
}, s.Merge<{
readonly default: {};
} & {
additionalProperties: false;
}>>;
readonly adapter: {
default?: any;
enum?: (readonly any[] | any[]) | undefined;
const?: any;
anyOf: s.ObjectSchema<{
readonly type: s.Schema<s.ILiteralOptions, string, string> & s.Merge<s.ILiteralOptions & {
const: string;
}>;
readonly config: s.Schema<s.ISchemaOptions, unknown, unknown>;
}, s.Merge<{
readonly title: string;
readonly description: string | undefined;
} & {
additionalProperties: false;
}>>[];
} & s.Schema<s.ISchemaOptions, {
config?: unknown;
type: string;
} | undefined, never>;
}, s.Merge<{
readonly default: {};
} & {
additionalProperties: false;
}>>;
export declare const mediaConfigSchema: s.ObjectSchema<{
readonly enabled: s.Schema<{
readonly default: false;
}, boolean, boolean> & {
readonly default: false;
};
readonly basepath: s.StringSchema<{
readonly default: "/api/media";
}> & {
readonly default: "/api/media";
};
readonly entity_name: s.StringSchema<{
readonly default: "media";
}> & {
readonly default: "media";
};
readonly storage: s.ObjectSchema<{
readonly body_max_size: {} & s.Schema<s.ISchemaOptions, number | undefined, number | undefined>;
}, s.Merge<{
readonly default: {};
} & {
additionalProperties: false;
}>>;
readonly adapter: {
default?: any;
enum?: (readonly any[] | any[]) | undefined;
const?: any;
anyOf: s.ObjectSchema<{
readonly type: s.Schema<s.ILiteralOptions, string, string> & s.Merge<s.ILiteralOptions & {
const: string;
}>;
readonly config: s.Schema<s.ISchemaOptions, unknown, unknown>;
}, s.Merge<{
readonly title: string;
readonly description: string | undefined;
} & {
additionalProperties: false;
}>>[];
} & s.Schema<s.ISchemaOptions, {
config?: unknown;
type: string;
} | undefined, never>;
}, s.Merge<{
readonly default: {};
} & {
additionalProperties: false;
}>>;
export type TAppMediaConfig = s.Static<typeof mediaConfigSchema>;