mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
Release 0.16 (#196)
* initial refactor * fixes * test secrets extraction * updated lock * fix secret schema * updated schemas, fixed tests, skipping flow tests for now * added validator for rjsf, hook form via standard schema * removed @sinclair/typebox * remove unneeded vite dep * fix jsonv literal on Field.tsx * fix schema import path * fix schema modals * fix schema modals * fix json field form, replaced auth form * initial waku * finalize waku example * fix jsonv-ts version * fix schema updates with falsy values * fix media api to respect options' init, improve types * checking media controller test * checking media controller test * checking media controller test * clean up mediacontroller test * added cookie option `partitioned`, as well as cors `origin` to be array, option to enable `credentials` (#214) * added cookie option `partitioned`, as well as cors `origin` to be array, option to enable `credentials` * fix server test * fix data api (updated jsonv-ts) * enhance cloudflare image optimization plugin with new options and explain endpoint (#215) * feat: add ability to serve static by using dynamic imports (#197) * feat: add ability to serve static by using dynamic imports * serveStaticViaImport: make manifest optional * serveStaticViaImport: add error log * refactor/imports (#217) * refactored core and core/utils imports * refactored core and core/utils imports * refactored media imports * refactored auth imports * refactored data imports * updated package json exports, fixed mm config * fix tests * feat/deno (#219) * update bun version * fix module manager's em reference * add basic deno example * finalize * docs: fumadocs migration (#185) * feat(docs): initialize documentation structure with Fumadocs * feat(docs): remove home route and move /docs route to /route * feat(docs): add redirect to /start page * feat(docs): migrate Getting Started chapters * feat(docs): migrate Usage and Extending chapters * feat(callout): add CalloutCaution, CalloutDanger, CalloutInfo, and CalloutPositive * feat(layout): add Discord and GitHub links to documentation layout * feat(docs): add integration chapters draft * feat(docs): add modules chapters draft * refactor(mdx-components): remove unused Icon import * refactor(StackBlitz): enhance type safety by using unknown instead of any * refactor(layout): update navigation mode to 'top' in layout configuration * feat(docs): add @iconify/react package * docs(mdx-components): add Icon component to MDX components list * feat(docs): update Next.js integration guide * feat(docs): update React Router integration guide * feat(docs): update Astro integration guide * feat(docs): update Vite integration guide * fix(docs): update package manager initialization commands * feat(docs): migrate Modules chapters * chore(docs): update package.json with new devDependencies * feat(docs): migrate Integration Runtimes chapters * feat(docs): update Database usage chapter * feat(docs): restructure documentation paths * chore(docs): clean up unused imports and files in documentation * style(layout): revert navigation mode to previous state * fix(docs): routing for documentation structure * feat(openapi): add API documentation generation from OpenAPI schema * feat(docs): add icons to documentation pages * chore(dependencies): remove unused content-collections packages * fix(types): fix type error for attachFile in source.ts * feat(redirects): update root redirect destination to '/start' * feat(search): add static search functionality * chore(dependencies): update fumadocs-core and fumadocs-ui to latest versions * feat(search): add Powered by Orama link * feat(generate-openapi): add error handling for missing OpenAPI schema * feat(scripts): add OpenAPI generation to build process * feat(config): enable dynamic redirects and rewrites in development mode * feat(layout): add GitHub token support for improved API rate limits * feat(redirects): add 301 redirects for cloudflare pages * feat(docs): add Vercel redirects configuration * feat(config): enable standalone output for development environment * chore(layout): adjust layout settings * refactor(package): clean up ajv dependency versions * feat(docs): add twoslash support * refactor(layout): update DocsLayout import and navigation configuration * chore(layout): clean up layout.tsx by commenting out GithubInfo * fix(Search): add locale to search initialization * chore(package): update fumadocs and orama to latest versions * docs: add menu items descriptions * feat(layout): add GitHub URL to the layout component * feat(docs): add AutoTypeTable component to MDX components * feat(app): implement AutoTypeTable rendering for AppEvents type * docs(layout): switch callouts back to default components * fix(config): use __filename and __dirname for module paths * docs: add note about node.js 22 requirement * feat(styles): add custom color variables for light and dark themes * docs: add S3 setup instructions for media module * docs: fix typos and indentation in media module docs * docs: add local media adapter example for Node.js * docs(media): add S3/R2 URL format examples and fix typo * docs: add cross-links to initial config and seeding sections * indent numbered lists content, clarified media serve locations * fix mediacontroller tests * feat(layout): add AnimatedGridPattern component for dynamic background * style(layout): configure fancy ToC style ('clerk') * fix(AnimatedGridPattern): correct strokeDasharray type * docs: actualize docs * feat: add favicon * style(cloudflare): format code examples * feat(layout): add Github and Discord footer icons * feat(footer): add SVG social media icons for GitHub and Discord * docs: adjusted auto type table, added llm functions * added static deployment to cloudflare workers * docs: change cf redirects to proxy *.mdx instead of redirecting --------- Co-authored-by: dswbx <dennis.senn@gmx.ch> Co-authored-by: cameronapak <cameronandrewpak@gmail.com> * build: improve build script * add missing exports, fix EntityTypescript imports * media: Dropzone: add programmatic upload, additional events, loading state * schema object: disable extended defaults to allow empty config values * Feat/new docs deploy (#224) * test * try fixing pm * try fixing pm * fix docs on imports, export events correctly --------- Co-authored-by: Tim Seriakov <59409712+timseriakov@users.noreply.github.com> Co-authored-by: cameronapak <cameronandrewpak@gmail.com>
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
import type { AppEntity } from "core";
|
||||
import type { AppEntity, FileUploadedEventData, StorageAdapter } from "bknd";
|
||||
import { $console } from "core/utils";
|
||||
import type { Entity, EntityManager } from "data";
|
||||
import { type FileUploadedEventData, Storage, type StorageAdapter, MediaPermissions } from "media";
|
||||
import type { Entity, EntityManager } from "data/entities";
|
||||
import { Storage } from "media/storage/Storage";
|
||||
import { Module } from "modules/Module";
|
||||
import { type FieldSchema, em, entity } from "../data/prototype";
|
||||
import { MediaController } from "./api/MediaController";
|
||||
import { buildMediaSchema, type mediaConfigSchema, registry } from "./media-schema";
|
||||
import { buildMediaSchema, registry, type TAppMediaConfig } from "./media-schema";
|
||||
import { mediaFields } from "./media-entities";
|
||||
import * as MediaPermissions from "media/media-permissions";
|
||||
|
||||
export type MediaFieldSchema = FieldSchema<typeof AppMedia.mediaFields>;
|
||||
declare module "core" {
|
||||
declare module "bknd" {
|
||||
interface Media extends AppEntity, MediaFieldSchema {}
|
||||
interface DB {
|
||||
media: Media;
|
||||
}
|
||||
}
|
||||
|
||||
export class AppMedia extends Module<typeof mediaConfigSchema> {
|
||||
// @todo: current workaround to make it all required
|
||||
export class AppMedia extends Module<Required<TAppMediaConfig>> {
|
||||
private _storage?: Storage;
|
||||
|
||||
override async build() {
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import type { Static } from "core/utils";
|
||||
import { Field, baseFieldConfigSchema } from "data/fields";
|
||||
import * as tbbox from "@sinclair/typebox";
|
||||
const { Type } = tbbox;
|
||||
import { s } from "bknd/utils";
|
||||
|
||||
export const mediaFieldConfigSchema = Type.Composite([
|
||||
Type.Object({
|
||||
entity: Type.String(), // @todo: is this really required?
|
||||
min_items: Type.Optional(Type.Number()),
|
||||
max_items: Type.Optional(Type.Number()),
|
||||
mime_types: Type.Optional(Type.Array(Type.String())),
|
||||
}),
|
||||
baseFieldConfigSchema,
|
||||
]);
|
||||
export const mediaFieldConfigSchema = s
|
||||
.strictObject({
|
||||
entity: s.string(), // @todo: is this really required?
|
||||
min_items: s.number(),
|
||||
max_items: s.number(),
|
||||
mime_types: s.array(s.string()),
|
||||
...baseFieldConfigSchema.properties,
|
||||
})
|
||||
.partial();
|
||||
|
||||
export type MediaFieldConfig = Static<typeof mediaFieldConfigSchema>;
|
||||
export type MediaFieldConfig = s.Static<typeof mediaFieldConfigSchema>;
|
||||
|
||||
export type MediaItem = {
|
||||
id: number;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import type { FileListObject } from "media";
|
||||
import type { FileListObject } from "media/storage/Storage";
|
||||
import {
|
||||
type BaseModuleApiOptions,
|
||||
ModuleApi,
|
||||
type PrimaryFieldType,
|
||||
type TInput,
|
||||
} from "modules/ModuleApi";
|
||||
import type { FileWithPath } from "ui/elements/media/file-selector";
|
||||
import type { ApiFetcher } from "Api";
|
||||
|
||||
export type MediaApiOptions = BaseModuleApiOptions & {
|
||||
upload_fetcher: ApiFetcher;
|
||||
init?: RequestInit;
|
||||
};
|
||||
|
||||
export class MediaApi extends ModuleApi<MediaApiOptions> {
|
||||
@@ -17,6 +17,7 @@ export class MediaApi extends ModuleApi<MediaApiOptions> {
|
||||
return {
|
||||
basepath: "/api/media",
|
||||
upload_fetcher: fetch,
|
||||
init: {},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ export class MediaApi extends ModuleApi<MediaApiOptions> {
|
||||
}
|
||||
|
||||
protected uploadFile(
|
||||
body: File | ReadableStream,
|
||||
body: File | Blob | ReadableStream,
|
||||
opts?: {
|
||||
filename?: string;
|
||||
path?: TInput;
|
||||
@@ -93,6 +94,7 @@ export class MediaApi extends ModuleApi<MediaApiOptions> {
|
||||
}
|
||||
|
||||
const init = {
|
||||
...this.options.init,
|
||||
...(opts?._init || {}),
|
||||
headers,
|
||||
};
|
||||
@@ -108,7 +110,7 @@ export class MediaApi extends ModuleApi<MediaApiOptions> {
|
||||
}
|
||||
|
||||
async upload(
|
||||
item: Request | Response | string | File | ReadableStream,
|
||||
item: Request | Response | string | File | Blob | ReadableStream,
|
||||
opts: {
|
||||
filename?: string;
|
||||
_init?: Omit<RequestInit, "body">;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { isDebug, tbValidator as tb } from "core";
|
||||
import { HttpStatus, getFileFromContext } from "core/utils";
|
||||
import type { StorageAdapter } from "media";
|
||||
import { StorageEvents, getRandomizedFilename, MediaPermissions } from "media";
|
||||
import { DataPermissions } from "data";
|
||||
import { isDebug } from "core/env";
|
||||
import type { StorageAdapter } from "media/storage/StorageAdapter";
|
||||
import * as DataPermissions from "data/permissions";
|
||||
import { Controller } from "modules/Controller";
|
||||
import type { AppMedia } from "../AppMedia";
|
||||
import { MediaField } from "../MediaField";
|
||||
import { jsc, s, describeRoute } from "core/object/schema";
|
||||
import * as MediaPermissions from "media/media-permissions";
|
||||
import * as StorageEvents from "media/storage/events";
|
||||
import { jsc, s, describeRoute, HttpStatus, getFileFromContext } from "bknd/utils";
|
||||
import { getRandomizedFilename } from "media/utils";
|
||||
|
||||
export class MediaController extends Controller {
|
||||
constructor(private readonly media: AppMedia) {
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
import type { TObject } from "@sinclair/typebox";
|
||||
import { type Constructor, Registry } from "core";
|
||||
|
||||
export { guess as guessMimeType } from "./storage/mime-types-tiny";
|
||||
export {
|
||||
Storage,
|
||||
type FileMeta,
|
||||
type FileListObject,
|
||||
type StorageConfig,
|
||||
type FileBody,
|
||||
type FileUploadPayload,
|
||||
} from "./storage/Storage";
|
||||
import { StorageAdapter } from "./storage/StorageAdapter";
|
||||
import {
|
||||
type CloudinaryConfig,
|
||||
StorageCloudinaryAdapter,
|
||||
} from "./storage/adapters/cloudinary/StorageCloudinaryAdapter";
|
||||
import { type S3AdapterConfig, StorageS3Adapter } from "./storage/adapters/s3/StorageS3Adapter";
|
||||
|
||||
export { StorageAdapter };
|
||||
export { StorageS3Adapter, type S3AdapterConfig, StorageCloudinaryAdapter, type CloudinaryConfig };
|
||||
|
||||
export * as StorageEvents from "./storage/events";
|
||||
export * as MediaPermissions from "./media-permissions";
|
||||
export type { FileUploadedEventData } from "./storage/events";
|
||||
export * from "./utils";
|
||||
|
||||
type ClassThatImplements<T> = Constructor<T> & { prototype: T };
|
||||
|
||||
export const MediaAdapterRegistry = new Registry<{
|
||||
cls: ClassThatImplements<StorageAdapter>;
|
||||
schema: TObject;
|
||||
}>((cls: ClassThatImplements<StorageAdapter>) => ({
|
||||
cls,
|
||||
schema: cls.prototype.getSchema() as TObject,
|
||||
}))
|
||||
.register("s3", StorageS3Adapter)
|
||||
.register("cloudinary", StorageCloudinaryAdapter);
|
||||
|
||||
export const Adapters = {
|
||||
s3: {
|
||||
cls: StorageS3Adapter,
|
||||
schema: StorageS3Adapter.prototype.getSchema(),
|
||||
},
|
||||
cloudinary: {
|
||||
cls: StorageCloudinaryAdapter,
|
||||
schema: StorageCloudinaryAdapter.prototype.getSchema(),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export { adapterTestSuite } from "./storage/adapters/adapter-test-suite";
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Permission } from "core";
|
||||
import { Permission } from "core/security/Permission";
|
||||
|
||||
export const readFile = new Permission("media.file.read");
|
||||
export const listFiles = new Permission("media.file.list");
|
||||
|
||||
28
app/src/media/media-registry.ts
Normal file
28
app/src/media/media-registry.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { type Constructor, Registry } from "core/registry/Registry";
|
||||
import type { StorageAdapter } from "./storage/StorageAdapter";
|
||||
import type { s } from "bknd/utils";
|
||||
import { StorageS3Adapter } from "./storage/adapters/s3/StorageS3Adapter";
|
||||
import { StorageCloudinaryAdapter } from "./storage/adapters/cloudinary/StorageCloudinaryAdapter";
|
||||
|
||||
type ClassThatImplements<T> = Constructor<T> & { prototype: T };
|
||||
|
||||
export const MediaAdapterRegistry = new Registry<{
|
||||
cls: ClassThatImplements<StorageAdapter>;
|
||||
schema: s.Schema;
|
||||
}>((cls: ClassThatImplements<StorageAdapter>) => ({
|
||||
cls,
|
||||
schema: cls.prototype.getSchema() as s.Schema,
|
||||
}))
|
||||
.register("s3", StorageS3Adapter)
|
||||
.register("cloudinary", StorageCloudinaryAdapter);
|
||||
|
||||
export const MediaAdapters = {
|
||||
s3: {
|
||||
cls: StorageS3Adapter,
|
||||
schema: StorageS3Adapter.prototype.getSchema(),
|
||||
},
|
||||
cloudinary: {
|
||||
cls: StorageCloudinaryAdapter,
|
||||
schema: StorageCloudinaryAdapter.prototype.getSchema(),
|
||||
},
|
||||
} as const;
|
||||
@@ -1,53 +1,49 @@
|
||||
import { Const, type Static, objectTransform } from "core/utils";
|
||||
import { Adapters } from "media";
|
||||
import { MediaAdapters } from "media/media-registry";
|
||||
import { registries } from "modules/registries";
|
||||
import * as tbbox from "@sinclair/typebox";
|
||||
const { Type } = tbbox;
|
||||
import { s, objectTransform } from "bknd/utils";
|
||||
|
||||
export const ADAPTERS = {
|
||||
...Adapters,
|
||||
...MediaAdapters,
|
||||
} as const;
|
||||
|
||||
export const registry = registries.media;
|
||||
|
||||
export function buildMediaSchema() {
|
||||
const adapterSchemaObject = objectTransform(registry.all(), (adapter, name) => {
|
||||
return Type.Object(
|
||||
return s.strictObject(
|
||||
{
|
||||
type: Const(name),
|
||||
type: s.literal(name),
|
||||
config: adapter.schema,
|
||||
},
|
||||
{
|
||||
title: adapter.schema?.title ?? name,
|
||||
description: adapter.schema?.description,
|
||||
additionalProperties: false,
|
||||
},
|
||||
);
|
||||
});
|
||||
const adapterSchema = Type.Union(Object.values(adapterSchemaObject));
|
||||
|
||||
return Type.Object(
|
||||
return s.strictObject(
|
||||
{
|
||||
enabled: Type.Boolean({ default: false }),
|
||||
basepath: Type.String({ default: "/api/media" }),
|
||||
entity_name: Type.String({ default: "media" }),
|
||||
storage: Type.Object(
|
||||
enabled: s.boolean({ default: false }),
|
||||
basepath: s.string({ default: "/api/media" }),
|
||||
entity_name: s.string({ default: "media" }),
|
||||
storage: s.strictObject(
|
||||
{
|
||||
body_max_size: Type.Optional(
|
||||
Type.Number({
|
||||
body_max_size: s
|
||||
.number({
|
||||
description: "Max size of the body in bytes. Leave blank for unlimited.",
|
||||
}),
|
||||
),
|
||||
})
|
||||
.optional(),
|
||||
},
|
||||
{ default: {} },
|
||||
),
|
||||
adapter: Type.Optional(adapterSchema),
|
||||
adapter: s.anyOf(Object.values(adapterSchemaObject)).optional(),
|
||||
},
|
||||
{
|
||||
additionalProperties: false,
|
||||
default: {},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export const mediaConfigSchema = buildMediaSchema();
|
||||
export type TAppMediaConfig = Static<typeof mediaConfigSchema>;
|
||||
export type TAppMediaConfig = s.Static<typeof mediaConfigSchema>;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { FileListObject, FileMeta } from "media";
|
||||
import type { FileBody, FileUploadPayload } from "media/storage/Storage";
|
||||
import type { TSchema } from "@sinclair/typebox";
|
||||
import type { FileListObject, FileMeta, FileBody, FileUploadPayload } from "media/storage/Storage";
|
||||
import type { s } from "bknd/utils";
|
||||
|
||||
const SYMBOL = Symbol.for("bknd:storage");
|
||||
|
||||
@@ -32,6 +31,6 @@ export abstract class StorageAdapter {
|
||||
abstract getObject(key: string, headers: Headers): Promise<Response>;
|
||||
abstract getObjectUrl(key: string): string;
|
||||
abstract getObjectMeta(key: string): Promise<FileMeta>;
|
||||
abstract getSchema(): TSchema | undefined;
|
||||
abstract getSchema(): s.Schema | undefined;
|
||||
abstract toJSON(secrets?: boolean): any;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { retry, type TestRunner } from "core/test";
|
||||
import type { StorageAdapter } from "media";
|
||||
import { randomString } from "core/utils";
|
||||
import type { StorageAdapter } from "media/storage/StorageAdapter";
|
||||
import { randomString } from "bknd/utils";
|
||||
import type { BunFile } from "bun";
|
||||
|
||||
export async function adapterTestSuite(
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
import { hash, pickHeaders } from "core/utils";
|
||||
import { type Static, parse } from "core/utils";
|
||||
import type { FileBody, FileListObject, FileMeta } from "../../Storage";
|
||||
import { StorageAdapter } from "../../StorageAdapter";
|
||||
import * as tbbox from "@sinclair/typebox";
|
||||
const { Type } = tbbox;
|
||||
import { s, parse } from "bknd/utils";
|
||||
|
||||
export const cloudinaryAdapterConfig = Type.Object(
|
||||
export const cloudinaryAdapterConfig = s.object(
|
||||
{
|
||||
cloud_name: Type.String(),
|
||||
api_key: Type.String(),
|
||||
api_secret: Type.String(),
|
||||
upload_preset: Type.Optional(Type.String()),
|
||||
cloud_name: s.string(),
|
||||
api_key: s.string(),
|
||||
api_secret: s.string(),
|
||||
upload_preset: s.string().optional(),
|
||||
},
|
||||
{ title: "Cloudinary", description: "Cloudinary media storage" },
|
||||
);
|
||||
|
||||
export type CloudinaryConfig = Static<typeof cloudinaryAdapterConfig>;
|
||||
export type CloudinaryConfig = s.Static<typeof cloudinaryAdapterConfig>;
|
||||
|
||||
type CloudinaryObject = {
|
||||
asset_id: string;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
||||
import { StorageS3Adapter } from "./StorageS3Adapter";
|
||||
|
||||
import { config } from "dotenv";
|
||||
import { adapterTestSuite } from "media";
|
||||
import { adapterTestSuite } from "media/storage/adapters/adapter-test-suite";
|
||||
import { assetsPath } from "../../../../../__test__/helper";
|
||||
import { bunTestRunner } from "adapter/bun/test";
|
||||
//import { enableFetchLogging } from "../../helper";
|
||||
|
||||
@@ -6,19 +6,18 @@ import type {
|
||||
ListObjectsV2Request,
|
||||
PutObjectRequest,
|
||||
} from "@aws-sdk/client-s3";
|
||||
import { AwsClient, isDebug } from "core";
|
||||
import { type Static, isFile, parse, pickHeaders2 } from "core/utils";
|
||||
import { AwsClient } from "core/clients/aws/AwsClient";
|
||||
import { isDebug } from "core/env";
|
||||
import { isFile, pickHeaders2, parse, s } from "bknd/utils";
|
||||
import { transform } from "lodash-es";
|
||||
import type { FileBody, FileListObject } from "../../Storage";
|
||||
import { StorageAdapter } from "../../StorageAdapter";
|
||||
import * as tbbox from "@sinclair/typebox";
|
||||
const { Type } = tbbox;
|
||||
|
||||
export const s3AdapterConfig = Type.Object(
|
||||
export const s3AdapterConfig = s.object(
|
||||
{
|
||||
access_key: Type.String(),
|
||||
secret_access_key: Type.String(),
|
||||
url: Type.String({
|
||||
access_key: s.string(),
|
||||
secret_access_key: s.string(),
|
||||
url: s.string({
|
||||
pattern: "^https?://(?:.*)?[^/.]+$",
|
||||
description: "URL to S3 compatible endpoint without trailing slash",
|
||||
examples: [
|
||||
@@ -33,7 +32,7 @@ export const s3AdapterConfig = Type.Object(
|
||||
},
|
||||
);
|
||||
|
||||
export type S3AdapterConfig = Static<typeof s3AdapterConfig>;
|
||||
export type S3AdapterConfig = s.Static<typeof s3AdapterConfig>;
|
||||
|
||||
export class StorageS3Adapter extends StorageAdapter {
|
||||
readonly #config: S3AdapterConfig;
|
||||
|
||||
@@ -26,9 +26,11 @@ export const M = new Map<string, string>([
|
||||
["eps", c.a("postscript")],
|
||||
["epub", c.a("epub+zip")],
|
||||
["ini", c.t()],
|
||||
["ico", c.i("vnd.microsoft.icon")],
|
||||
["jar", c.a("java-archive")],
|
||||
["jsonld", c.a("ld+json")],
|
||||
["jpg", c.i("jpeg")],
|
||||
["js", c.t("javascript")],
|
||||
["log", c.t()],
|
||||
["m3u", c.t()],
|
||||
["m3u8", c.a("vnd.apple.mpegurl")],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isFile, randomString } from "core/utils";
|
||||
import { isFile, randomString } from "bknd/utils";
|
||||
import { extension } from "media/storage/mime-types-tiny";
|
||||
|
||||
export function getExtensionFromName(filename: string): string | undefined {
|
||||
|
||||
Reference in New Issue
Block a user