@cueframe/kernel 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_members/account-model/testing/conversationStoreContract.d.ts +1 -1
- package/dist/_members/authoring/providers/resourceApi.d.ts +1 -1
- package/dist/_members/authoring/transpileComponent.d.ts +1 -1
- package/dist/_members/cloud-import/CloudImportService.d.ts +35 -0
- package/dist/_members/cloud-import/ImportProvider.d.ts +73 -0
- package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +27 -0
- package/dist/_members/cloud-import/chunk-XKO6ZSWI.js +162 -0
- package/dist/_members/cloud-import/chunk-XKO6ZSWI.js.map +1 -0
- package/dist/_members/cloud-import/cloudConfig.d.ts +23 -0
- package/dist/_members/cloud-import/index.d.ts +9 -0
- package/dist/_members/cloud-import/index.js +241 -0
- package/dist/_members/cloud-import/index.js.map +1 -0
- package/dist/_members/cloud-import/multipartUpload.d.ts +12 -0
- package/dist/_members/cloud-import/multipartUpload.js +7 -0
- package/dist/_members/cloud-import/multipartUpload.js.map +1 -0
- package/dist/_members/composition/ops/compositionOps.d.ts +1 -1
- package/dist/_members/composition/ops/types.d.ts +1 -1
- package/dist/_members/composition/timeline/placement.d.ts +1 -1
- package/dist/_members/composition/validators/composition.d.ts +1 -1
- package/dist/_members/composition-ops/index.d.ts +1 -1
- package/dist/_members/composition-ops/opRecorder.d.ts +1 -1
- package/dist/_members/convex-api/api.d.ts +5 -0
- package/dist/_members/convex-api/dataModel.d.ts +6 -0
- package/dist/_members/core/render/exportSettings.d.ts +1 -1
- package/dist/_members/mcp/curation.d.ts +1 -1
- package/dist/_members/plane/conformance.d.ts +1 -1
- package/dist/_members/render-harness/localRender.d.ts +1 -1
- package/dist/animate.js +828 -79187
- package/dist/authoring/build-tools.js +8 -11
- package/dist/authoring/context.js +5 -5
- package/dist/authoring/models.js +1 -2
- package/dist/authoring/prompts.js +1 -1
- package/dist/authoring/tools.js +7 -7
- package/dist/authoring/transpileComponent.js +3 -2220
- package/dist/authoring.js +27 -29
- package/dist/brand-derivation.js +1 -1
- package/dist/chunk-6IU2UQI5.js +107 -0
- package/dist/{chunk-N67PDTKQ.js → chunk-ABL557OT.js} +1 -1
- package/dist/{chunk-DSNG6WLU.js → chunk-AYVJXDLB.js} +1 -4
- package/dist/{chunk-G3PBH53P.js → chunk-COYMZ76S.js} +1 -1
- package/dist/chunk-DSMLHYJ4.js +82 -0
- package/dist/{chunk-BRKJKB33.js → chunk-FYZVH3MC.js} +1 -1
- package/dist/{chunk-MVEE6HEC.js → chunk-GA23TRNR.js} +5 -7
- package/dist/{chunk-OIRUO5P7.js → chunk-GEA7E2FL.js} +1 -1
- package/dist/chunk-HCCBDJLW.js +68 -0
- package/dist/{chunk-QLAQHR3L.js → chunk-IBYQG46O.js} +1 -1
- package/dist/chunk-JQMPHKLU.js +126 -0
- package/dist/{chunk-ELLSET2N.js → chunk-LM4WDUQJ.js} +3 -6
- package/dist/{chunk-UEI3NLNK.js → chunk-MHOQTPOB.js} +1 -4
- package/dist/{chunk-ATAF24QG.js → chunk-MXFAADCQ.js} +1 -1
- package/dist/{chunk-TULRCY6U.js → chunk-NFEGPWGS.js} +1 -1
- package/dist/{chunk-MC5DLSEV.js → chunk-ODL7GQJG.js} +14 -14
- package/dist/{chunk-WZTTZHNR.js → chunk-OLFOPQCA.js} +12 -9
- package/dist/{chunk-P43IE4WB.js → chunk-P727GZVO.js} +2 -4
- package/dist/{chunk-S3P5BFFL.js → chunk-PMY24FUD.js} +2 -4
- package/dist/chunk-RF7U3SCL.js +606 -0
- package/dist/{chunk-JD77Y2WM.js → chunk-SW336CJP.js} +1 -4
- package/dist/{chunk-M3I5LMAB.js → chunk-UY4SWJVE.js} +1 -1
- package/dist/{chunk-52AHXNKM.js → chunk-VOO5FQSS.js} +5 -5
- package/dist/{chunk-NV4I6GJV.js → chunk-XWKZB5U5.js} +4 -4
- package/dist/{chunk-6QJ3V3VS.js → chunk-YX2GSJK7.js} +1 -1
- package/dist/{chunk-5I7VDCAC.js → chunk-ZB3C3HM7.js} +1 -1
- package/dist/chunk-ZT7MHRQU.js +104 -0
- package/dist/cloud-import/multipart.d.ts +1 -0
- package/dist/cloud-import/multipart.js +8 -0
- package/dist/cloud-import.d.ts +1 -0
- package/dist/cloud-import.js +234 -0
- package/dist/compose/renderer.js +18 -21
- package/dist/compose.js +18 -21
- package/dist/composition/graphics-plan.js +3 -3
- package/dist/composition/ops.js +4 -4
- package/dist/composition/primitive-catalog.js +1 -1
- package/dist/composition/projection.js +3 -3
- package/dist/composition/validators.js +2 -2
- package/dist/composition-ops.js +12 -12
- package/dist/composition.js +5 -5
- package/dist/{context-CEAKQ5T7.js → context-OKX3HHFS.js} +5 -5
- package/dist/convex-api/dataModel.d.ts +1 -0
- package/dist/convex-api/dataModel.js +0 -0
- package/dist/convex-api.d.ts +1 -0
- package/dist/convex-api.js +8 -0
- package/dist/core/render.js +2 -2
- package/dist/core.js +2 -2
- package/dist/mcp/adapter.js +1 -5
- package/dist/mcp/server.js +1 -2
- package/dist/mcp.js +2 -95
- package/dist/media-model/media-kind.js +9 -98
- package/dist/nle-export/xml.js +5 -22799
- package/dist/nle-export.js +18 -21
- package/dist/primitives/backgrounds.js +2 -3
- package/dist/primitives/captions.js +4 -243
- package/dist/primitives/effects.js +2 -3
- package/dist/primitives/hero-text.js +2 -3
- package/dist/primitives/layouts.js +2 -3
- package/dist/primitives/lib/index.js +8 -10
- package/dist/primitives/lib/preview.js +1 -2
- package/dist/primitives/lib/schema.js +1 -2
- package/dist/primitives/lib/text/fitText.js +1 -2
- package/dist/primitives/lib.js +8 -10
- package/dist/primitives/scenes.js +1 -2
- package/dist/primitives/text.js +2 -3
- package/dist/primitives/ui-blocks.js +4 -5
- package/dist/primitives.js +19 -21
- package/package.json +123 -13
- package/dist/TextureLoader-UQOFUSAP.js +0 -422
- package/dist/VideoTexture-AQWSPIJG.js +0 -62
- package/dist/chunk-7GISRVON.js +0 -14176
- package/dist/chunk-DIBOJJMU.js +0 -16838
- package/dist/chunk-EAUSEGB7.js +0 -420
- package/dist/chunk-FUWJOVVK.js +0 -3633
- package/dist/chunk-G75E7YA4.js +0 -11883
- package/dist/chunk-JCZQT7K3.js +0 -3266
- package/dist/chunk-KF5ETMKB.js +0 -544
- package/dist/chunk-NDKERSXY.js +0 -1296
- package/dist/chunk-V43Y7IE4.js +0 -3621
- package/dist/chunk-VIVQHIGZ.js +0 -4319
- package/dist/chunk-YA3OR2KK.js +0 -249
- package/dist/hls-HD4C5G6W.js +0 -33000
- package/dist/token-RGFIT24D.js +0 -69
- package/dist/token-util-GPLSGYVO.js +0 -5
- package/dist/vision_bundle-5Y376MAR.js +0 -4084
- package/dist/{chunk-6CMVBTTP.js → chunk-YIOY2XEO.js} +4 -4
package/dist/composition.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
resolveSegmentAt,
|
|
33
33
|
silhouetteKeepOutForWindow,
|
|
34
34
|
sourceRectToOutput
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-GEA7E2FL.js";
|
|
36
36
|
import {
|
|
37
37
|
BRAND_TOKEN_REFS,
|
|
38
38
|
BRAND_TOKEN_ROOT_KEYS,
|
|
@@ -68,10 +68,10 @@ import {
|
|
|
68
68
|
resolveLayoutIntent,
|
|
69
69
|
resolveOverlayRegion,
|
|
70
70
|
unionFaceKeepOutSeries
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-FYZVH3MC.js";
|
|
72
72
|
import {
|
|
73
73
|
apcaLc
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-DSMLHYJ4.js";
|
|
75
75
|
import "./chunk-JF4JJAFP.js";
|
|
76
76
|
import {
|
|
77
77
|
AudioPaletteRef,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
WebhookDeliveryStatus,
|
|
124
124
|
WebhookDestination,
|
|
125
125
|
YoutubeDestination
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-NFEGPWGS.js";
|
|
127
127
|
import {
|
|
128
128
|
ANIMATABLE_PARAMS,
|
|
129
129
|
AlphaLayerClipSource,
|
|
@@ -155,7 +155,7 @@ import {
|
|
|
155
155
|
TrackContent,
|
|
156
156
|
Transition,
|
|
157
157
|
captionWords
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-MXFAADCQ.js";
|
|
159
159
|
import {
|
|
160
160
|
AUTHORED_GRAPHIC_KINDS
|
|
161
161
|
} from "./chunk-W35ZMOXB.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildDirectorContext
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-IBYQG46O.js";
|
|
4
|
+
import "./chunk-XWKZB5U5.js";
|
|
5
|
+
import "./chunk-KYRDKK2D.js";
|
|
6
|
+
import "./chunk-NFEGPWGS.js";
|
|
7
|
+
import "./chunk-MXFAADCQ.js";
|
|
7
8
|
import "./chunk-W35ZMOXB.js";
|
|
8
9
|
import "./chunk-EA6MYCYW.js";
|
|
9
|
-
import "./chunk-KYRDKK2D.js";
|
|
10
10
|
import "./chunk-WREYUH2E.js";
|
|
11
11
|
import "./chunk-2ESYSVXG.js";
|
|
12
12
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../_members/convex-api/dataModel.js";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./_members/convex-api/api.js";
|
package/dist/core/render.js
CHANGED
|
@@ -41,14 +41,14 @@ import {
|
|
|
41
41
|
sliceTranscriptWords,
|
|
42
42
|
splitIntoSentences,
|
|
43
43
|
validateComposition
|
|
44
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-YIOY2XEO.js";
|
|
45
45
|
import {
|
|
46
46
|
buildEasedZooms,
|
|
47
47
|
buildPannedCenters,
|
|
48
48
|
easeOutCubic
|
|
49
49
|
} from "../chunk-QH3YI3ND.js";
|
|
50
|
-
import "../chunk-TWQOKKAF.js";
|
|
51
50
|
import "../chunk-JRQVPFLF.js";
|
|
51
|
+
import "../chunk-TWQOKKAF.js";
|
|
52
52
|
import "../chunk-JMURQODM.js";
|
|
53
53
|
import "../chunk-7PA7FGLD.js";
|
|
54
54
|
import "../chunk-KYRDKK2D.js";
|
package/dist/core.js
CHANGED
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
ensureEven,
|
|
12
12
|
extractCaptionWordsFromDoc,
|
|
13
13
|
isEmphasized
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YIOY2XEO.js";
|
|
15
15
|
import "./chunk-QH3YI3ND.js";
|
|
16
|
-
import "./chunk-TWQOKKAF.js";
|
|
17
16
|
import "./chunk-JRQVPFLF.js";
|
|
17
|
+
import "./chunk-TWQOKKAF.js";
|
|
18
18
|
import "./chunk-JMURQODM.js";
|
|
19
19
|
import "./chunk-7PA7FGLD.js";
|
|
20
20
|
import "./chunk-KYRDKK2D.js";
|
package/dist/mcp/adapter.js
CHANGED
|
@@ -15,15 +15,11 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
CURATED_TOOLS
|
|
17
17
|
} from "../chunk-HI4UTTPS.js";
|
|
18
|
-
import "../chunk-7GISRVON.js";
|
|
19
|
-
import "../chunk-KF5ETMKB.js";
|
|
20
|
-
import {
|
|
21
|
-
tool
|
|
22
|
-
} from "../chunk-VIVQHIGZ.js";
|
|
23
18
|
import "../chunk-2ESYSVXG.js";
|
|
24
19
|
|
|
25
20
|
// ../mcp/src/adapter.ts
|
|
26
21
|
import { z } from "zod";
|
|
22
|
+
import { tool } from "ai";
|
|
27
23
|
|
|
28
24
|
// ../mcp/src/internalLoopTools.ts
|
|
29
25
|
var INTERNAL_LOOP_TOOLS = [
|
package/dist/mcp/server.js
CHANGED
|
@@ -8,11 +8,10 @@ import {
|
|
|
8
8
|
registerRawTools,
|
|
9
9
|
registerSkillPrompts,
|
|
10
10
|
titleCase
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-RF7U3SCL.js";
|
|
12
12
|
import "../chunk-MMEJ3Y7E.js";
|
|
13
13
|
import "../chunk-SIGGQRY2.js";
|
|
14
14
|
import "../chunk-HI4UTTPS.js";
|
|
15
|
-
import "../chunk-NDKERSXY.js";
|
|
16
15
|
import "../chunk-2ESYSVXG.js";
|
|
17
16
|
export {
|
|
18
17
|
RAW_EXCLUDED_OPERATION_IDS,
|
package/dist/mcp.js
CHANGED
|
@@ -4,112 +4,19 @@ import {
|
|
|
4
4
|
makePlatformExecutor
|
|
5
5
|
} from "./chunk-GH27OS5S.js";
|
|
6
6
|
import {
|
|
7
|
-
JSONRPCMessageSchema,
|
|
8
7
|
SERVER_INSTRUCTIONS,
|
|
9
8
|
buildServer,
|
|
10
9
|
registerCuratedTools,
|
|
11
10
|
registerRawTools,
|
|
12
11
|
registerSkillPrompts
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RF7U3SCL.js";
|
|
14
13
|
import "./chunk-MMEJ3Y7E.js";
|
|
15
14
|
import "./chunk-SIGGQRY2.js";
|
|
16
15
|
import "./chunk-HI4UTTPS.js";
|
|
17
|
-
import "./chunk-NDKERSXY.js";
|
|
18
16
|
import "./chunk-2ESYSVXG.js";
|
|
19
17
|
|
|
20
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
21
|
-
import process2 from "process";
|
|
22
|
-
|
|
23
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
24
|
-
var ReadBuffer = class {
|
|
25
|
-
append(chunk) {
|
|
26
|
-
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
27
|
-
}
|
|
28
|
-
readMessage() {
|
|
29
|
-
if (!this._buffer) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const index = this._buffer.indexOf("\n");
|
|
33
|
-
if (index === -1) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const line = this._buffer.toString("utf8", 0, index).replace(/\r$/, "");
|
|
37
|
-
this._buffer = this._buffer.subarray(index + 1);
|
|
38
|
-
return deserializeMessage(line);
|
|
39
|
-
}
|
|
40
|
-
clear() {
|
|
41
|
-
this._buffer = void 0;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
function deserializeMessage(line) {
|
|
45
|
-
return JSONRPCMessageSchema.parse(JSON.parse(line));
|
|
46
|
-
}
|
|
47
|
-
function serializeMessage(message) {
|
|
48
|
-
return JSON.stringify(message) + "\n";
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
52
|
-
var StdioServerTransport = class {
|
|
53
|
-
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
54
|
-
this._stdin = _stdin;
|
|
55
|
-
this._stdout = _stdout;
|
|
56
|
-
this._readBuffer = new ReadBuffer();
|
|
57
|
-
this._started = false;
|
|
58
|
-
this._ondata = (chunk) => {
|
|
59
|
-
this._readBuffer.append(chunk);
|
|
60
|
-
this.processReadBuffer();
|
|
61
|
-
};
|
|
62
|
-
this._onerror = (error) => {
|
|
63
|
-
this.onerror?.(error);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Starts listening for messages on stdin.
|
|
68
|
-
*/
|
|
69
|
-
async start() {
|
|
70
|
-
if (this._started) {
|
|
71
|
-
throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");
|
|
72
|
-
}
|
|
73
|
-
this._started = true;
|
|
74
|
-
this._stdin.on("data", this._ondata);
|
|
75
|
-
this._stdin.on("error", this._onerror);
|
|
76
|
-
}
|
|
77
|
-
processReadBuffer() {
|
|
78
|
-
while (true) {
|
|
79
|
-
try {
|
|
80
|
-
const message = this._readBuffer.readMessage();
|
|
81
|
-
if (message === null) {
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
this.onmessage?.(message);
|
|
85
|
-
} catch (error) {
|
|
86
|
-
this.onerror?.(error);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
async close() {
|
|
91
|
-
this._stdin.off("data", this._ondata);
|
|
92
|
-
this._stdin.off("error", this._onerror);
|
|
93
|
-
const remainingDataListeners = this._stdin.listenerCount("data");
|
|
94
|
-
if (remainingDataListeners === 0) {
|
|
95
|
-
this._stdin.pause();
|
|
96
|
-
}
|
|
97
|
-
this._readBuffer.clear();
|
|
98
|
-
this.onclose?.();
|
|
99
|
-
}
|
|
100
|
-
send(message) {
|
|
101
|
-
return new Promise((resolve) => {
|
|
102
|
-
const json = serializeMessage(message);
|
|
103
|
-
if (this._stdout.write(json)) {
|
|
104
|
-
resolve();
|
|
105
|
-
} else {
|
|
106
|
-
this._stdout.once("drain", resolve);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
18
|
// ../mcp/src/index.ts
|
|
19
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
113
20
|
async function main() {
|
|
114
21
|
const apiKey = process.env.CUEFRAME_API_KEY;
|
|
115
22
|
if (!apiKey) throw new Error("CUEFRAME_API_KEY environment variable is required");
|
|
@@ -1,102 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ALLOWED_CONTENT_TYPES,
|
|
3
|
+
IMAGE_CONTENT_TYPES,
|
|
4
|
+
POOL_EXTENSIONS,
|
|
5
|
+
contentTypeForUpload,
|
|
6
|
+
extensionForContentType,
|
|
7
|
+
mediaKind,
|
|
8
|
+
mediaKindForFilename
|
|
9
|
+
} from "../chunk-6IU2UQI5.js";
|
|
1
10
|
import "../chunk-2ESYSVXG.js";
|
|
2
|
-
|
|
3
|
-
// ../data-models/media-model/src/media-kind.ts
|
|
4
|
-
var IMAGE_CONTENT_TYPES = ["image/png", "image/jpeg", "image/webp"];
|
|
5
|
-
var ALLOWED_CONTENT_TYPES = [
|
|
6
|
-
"video/mp4",
|
|
7
|
-
"video/quicktime",
|
|
8
|
-
"video/x-matroska",
|
|
9
|
-
"video/webm",
|
|
10
|
-
"audio/mpeg",
|
|
11
|
-
"audio/wav",
|
|
12
|
-
"audio/x-wav",
|
|
13
|
-
"audio/mp4",
|
|
14
|
-
"audio/aac",
|
|
15
|
-
"image/png",
|
|
16
|
-
"image/jpeg",
|
|
17
|
-
"image/webp",
|
|
18
|
-
"image/gif",
|
|
19
|
-
"image/svg+xml",
|
|
20
|
-
"application/json",
|
|
21
|
-
"font/ttf",
|
|
22
|
-
"font/otf",
|
|
23
|
-
"font/woff",
|
|
24
|
-
"font/woff2"
|
|
25
|
-
];
|
|
26
|
-
function mediaKind(contentType) {
|
|
27
|
-
const ct = (contentType || "").toLowerCase();
|
|
28
|
-
if (ct.startsWith("video/")) return "video";
|
|
29
|
-
if (ct.startsWith("audio/")) return "audio";
|
|
30
|
-
if (IMAGE_CONTENT_TYPES.includes(ct)) return "image";
|
|
31
|
-
return "opaque";
|
|
32
|
-
}
|
|
33
|
-
var EXT = {
|
|
34
|
-
"video/mp4": "mp4",
|
|
35
|
-
"audio/mp4": "mp4",
|
|
36
|
-
"video/quicktime": "mov",
|
|
37
|
-
"video/x-matroska": "mkv",
|
|
38
|
-
"video/webm": "webm",
|
|
39
|
-
"video/x-msvideo": "avi",
|
|
40
|
-
"audio/mpeg": "mp3",
|
|
41
|
-
"audio/wav": "wav",
|
|
42
|
-
"audio/x-wav": "wav",
|
|
43
|
-
"audio/aac": "aac",
|
|
44
|
-
"audio/ogg": "ogg",
|
|
45
|
-
"audio/flac": "flac",
|
|
46
|
-
"image/png": "png",
|
|
47
|
-
"image/jpeg": "jpg",
|
|
48
|
-
"image/webp": "webp",
|
|
49
|
-
"font/ttf": "ttf",
|
|
50
|
-
"font/otf": "otf",
|
|
51
|
-
"font/woff": "woff",
|
|
52
|
-
"font/woff2": "woff2",
|
|
53
|
-
"application/json": "json",
|
|
54
|
-
"image/svg+xml": "svg",
|
|
55
|
-
"image/gif": "gif"
|
|
56
|
-
};
|
|
57
|
-
function extensionForContentType(contentType) {
|
|
58
|
-
return EXT[(contentType || "").toLowerCase()] ?? "bin";
|
|
59
|
-
}
|
|
60
|
-
var CONTENT_TYPE_ALIASES = {
|
|
61
|
-
"audio/mp3": "audio/mpeg",
|
|
62
|
-
"audio/x-mp3": "audio/mpeg",
|
|
63
|
-
"audio/x-mpeg": "audio/mpeg",
|
|
64
|
-
"audio/mpeg3": "audio/mpeg",
|
|
65
|
-
"audio/x-mpeg-3": "audio/mpeg",
|
|
66
|
-
"audio/x-m4a": "audio/mp4",
|
|
67
|
-
"audio/m4a": "audio/mp4",
|
|
68
|
-
"audio/wave": "audio/wav",
|
|
69
|
-
"audio/vnd.wave": "audio/wav",
|
|
70
|
-
"audio/x-aac": "audio/aac",
|
|
71
|
-
"image/jpg": "image/jpeg",
|
|
72
|
-
"video/x-quicktime": "video/quicktime",
|
|
73
|
-
"video/mov": "video/quicktime",
|
|
74
|
-
"video/x-m4v": "video/mp4",
|
|
75
|
-
"video/mkv": "video/x-matroska"
|
|
76
|
-
};
|
|
77
|
-
var TYPE_BY_EXTENSION = Object.entries(EXT).reduce(
|
|
78
|
-
(acc, [contentType, ext]) => {
|
|
79
|
-
if (!(ext in acc)) acc[ext] = contentType;
|
|
80
|
-
return acc;
|
|
81
|
-
},
|
|
82
|
-
{}
|
|
83
|
-
);
|
|
84
|
-
TYPE_BY_EXTENSION["jpeg"] = "image/jpeg";
|
|
85
|
-
TYPE_BY_EXTENSION["m4a"] = "audio/mp4";
|
|
86
|
-
function mediaKindForFilename(filename) {
|
|
87
|
-
return mediaKind(contentTypeForUpload(filename, null));
|
|
88
|
-
}
|
|
89
|
-
var POOL_EXTENSIONS = Object.entries(TYPE_BY_EXTENSION).filter(([, contentType]) => mediaKind(contentType) !== "opaque").map(([ext]) => ext);
|
|
90
|
-
function contentTypeForUpload(filename, claimed) {
|
|
91
|
-
const ct = (claimed ?? "").trim().toLowerCase();
|
|
92
|
-
const allowed = ALLOWED_CONTENT_TYPES;
|
|
93
|
-
if (ct && allowed.includes(ct)) return ct;
|
|
94
|
-
if (ct && CONTENT_TYPE_ALIASES[ct]) return CONTENT_TYPE_ALIASES[ct];
|
|
95
|
-
const ext = filename.toLowerCase().split(".").pop() ?? "";
|
|
96
|
-
const byExt = TYPE_BY_EXTENSION[ext];
|
|
97
|
-
if (byExt) return byExt;
|
|
98
|
-
return ct;
|
|
99
|
-
}
|
|
100
11
|
export {
|
|
101
12
|
ALLOWED_CONTENT_TYPES,
|
|
102
13
|
IMAGE_CONTENT_TYPES,
|