@plume-canvas/plugin-node-video 0.0.0-stage → 0.1.1
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/plugin-node-video.js +3 -0
- package/dist/plugin-node-video.js.map +1 -0
- package/dist/server.js +368 -0
- package/package.json +48 -4
- package/README.md +0 -3
package/dist/server.js
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
// server/plugin-video-crop.js
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { promises as fs, mkdtempSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
var name = "video-crop";
|
|
7
|
+
var CANVAS_ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
8
|
+
var NODE_ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
9
|
+
var HASH_NAME_RE = /^[0-9a-f]{16}(\.[a-z0-9]+)?$/i;
|
|
10
|
+
var SLOT_NAME_RE = /^slot-[A-Za-z0-9_-]{1,64}(\.[a-z0-9]+)?$/;
|
|
11
|
+
function isSafeResourceName(name2) {
|
|
12
|
+
return HASH_NAME_RE.test(name2) || SLOT_NAME_RE.test(name2);
|
|
13
|
+
}
|
|
14
|
+
function parseResourceRef(url, canvasId) {
|
|
15
|
+
if (typeof url !== "string") return void 0;
|
|
16
|
+
const candidates = [canvasId];
|
|
17
|
+
const m = /\/api\/canvases\/([A-Za-z0-9_-]{1,64})\/resources\//.exec(url) || /\/canvases\/([A-Za-z0-9_-]{1,64})\/resources\//.exec(url);
|
|
18
|
+
if (m && m[1] !== canvasId) candidates.push(m[1]);
|
|
19
|
+
for (const id of candidates) {
|
|
20
|
+
if (typeof id !== "string" || !CANVAS_ID_RE.test(id)) continue;
|
|
21
|
+
for (const marker of ["/api/canvases/" + id + "/resources/", "/canvases/" + id + "/resources/"]) {
|
|
22
|
+
const i = url.indexOf(marker);
|
|
23
|
+
if (i < 0) continue;
|
|
24
|
+
const name2 = url.slice(i + marker.length).split("?")[0].split("#")[0];
|
|
25
|
+
if (isSafeResourceName(name2)) return { canvasId: id, name: name2 };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
function parseResourceName(url, canvasId) {
|
|
31
|
+
return parseResourceRef(url, canvasId)?.name;
|
|
32
|
+
}
|
|
33
|
+
function even(n) {
|
|
34
|
+
const v = Math.max(0, Math.floor(Number(n) || 0));
|
|
35
|
+
return v - v % 2;
|
|
36
|
+
}
|
|
37
|
+
function round3(v) {
|
|
38
|
+
return Math.round(Number(v) * 1e3) / 1e3;
|
|
39
|
+
}
|
|
40
|
+
var running = /* @__PURE__ */ new Map();
|
|
41
|
+
function apply(ctx) {
|
|
42
|
+
const resources = ctx.get("canvasResources");
|
|
43
|
+
ctx.routes.post("/api/video-crop", async (c) => {
|
|
44
|
+
const body = await c.req.json().catch(() => null);
|
|
45
|
+
if (!body || typeof body !== "object") return c.json({ ok: false, error: "body \u4E0D\u662F JSON" }, 400);
|
|
46
|
+
const { canvasId, nodeId, srcUrl, rect } = body;
|
|
47
|
+
if (typeof canvasId !== "string" || !CANVAS_ID_RE.test(canvasId)) return c.json({ ok: false, error: "\u975E\u6CD5\u753B\u5E03 id" }, 400);
|
|
48
|
+
if (typeof nodeId !== "string" || !NODE_ID_RE.test(nodeId)) return c.json({ ok: false, error: "\u975E\u6CD5\u8282\u70B9 id" }, 400);
|
|
49
|
+
if (running.has(nodeId)) return c.json({ ok: false, error: "busy", message: "\u8BE5\u8282\u70B9\u5DF2\u6709\u88C1\u526A\u4EFB\u52A1\u5728\u8DD1" }, 409);
|
|
50
|
+
const ref = parseResourceRef(srcUrl, canvasId);
|
|
51
|
+
if (!ref) return c.json({ ok: false, error: "\u6E90\u89C6\u9891\u4E0D\u662F\u753B\u5E03\u8D44\u6E90\uFF08\u672C\u5730/\u5916\u94FE\u5730\u5740\u6682\u4E0D\u652F\u6301\u771F\u88C1\u526A\uFF09" }, 400);
|
|
52
|
+
const name2 = ref.name;
|
|
53
|
+
const r = rect && typeof rect === "object" ? rect : {};
|
|
54
|
+
const x = even(r.x);
|
|
55
|
+
const y = even(r.y);
|
|
56
|
+
const width = even(r.width);
|
|
57
|
+
const height = even(r.height);
|
|
58
|
+
if (width <= 0 || height <= 0) return c.json({ ok: false, error: "\u88C1\u526A\u6846\u65E0\u6548" }, 400);
|
|
59
|
+
const src = await resources.read(ref.canvasId, name2);
|
|
60
|
+
if (!src) return c.json({ ok: false, error: "\u6E90\u89C6\u9891\u4E0D\u5B58\u5728" }, 404);
|
|
61
|
+
const promise = runFfmpegCrop(Buffer.from(src), { x, y, width, height }).then(async (out) => {
|
|
62
|
+
const saved = await resources.save(canvasId, out, ".mp4");
|
|
63
|
+
return { ok: true, url: saved.url, resourceId: canvasId + "/" + saved.hashName, width, height, fileName: "crop-" + name2 };
|
|
64
|
+
}).finally(() => running.delete(nodeId));
|
|
65
|
+
running.set(nodeId, promise);
|
|
66
|
+
try {
|
|
67
|
+
const result = await promise;
|
|
68
|
+
return c.json(result, result.ok ? 200 : 500);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
return c.json({ ok: false, error: err instanceof Error ? err.message : String(err) }, 500);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
ctx.routes.get("/api/video-crop/ping", (c) => c.json({ ok: true, plugin: "video-crop" }));
|
|
74
|
+
ctx.routes.post("/api/video-audio", async (c) => {
|
|
75
|
+
const body = await c.req.json().catch(() => null);
|
|
76
|
+
if (!body || typeof body !== "object") return c.json({ ok: false, error: "body \u4E0D\u662F JSON" }, 400);
|
|
77
|
+
const { canvasId, nodeId, srcUrl } = body;
|
|
78
|
+
if (typeof canvasId !== "string" || !CANVAS_ID_RE.test(canvasId)) return c.json({ ok: false, error: "\u975E\u6CD5\u753B\u5E03 id" }, 400);
|
|
79
|
+
if (typeof nodeId !== "string" || !NODE_ID_RE.test(nodeId)) return c.json({ ok: false, error: "\u975E\u6CD5\u8282\u70B9 id" }, 400);
|
|
80
|
+
if (running.has(nodeId)) return c.json({ ok: false, error: "busy", message: "\u8BE5\u8282\u70B9\u5DF2\u6709\u89C6\u9891\u4EFB\u52A1\u5728\u8DD1" }, 409);
|
|
81
|
+
const ref = parseResourceRef(srcUrl, canvasId);
|
|
82
|
+
if (!ref) return c.json({ ok: false, error: "\u6E90\u89C6\u9891\u4E0D\u662F\u753B\u5E03\u8D44\u6E90\uFF08\u672C\u5730/\u5916\u94FE\u5730\u5740\u6682\u4E0D\u652F\u6301\u8F6C\u97F3\u9891\uFF09" }, 400);
|
|
83
|
+
const name2 = ref.name;
|
|
84
|
+
const src = await resources.read(ref.canvasId, name2);
|
|
85
|
+
if (!src) return c.json({ ok: false, error: "\u6E90\u89C6\u9891\u4E0D\u5B58\u5728" }, 404);
|
|
86
|
+
const promise = runFfmpegAudio(Buffer.from(src)).then(async (out) => {
|
|
87
|
+
const saved = await resources.save(canvasId, out, ".mp3");
|
|
88
|
+
const real = await probeDuration(out).catch(() => void 0);
|
|
89
|
+
return {
|
|
90
|
+
ok: true,
|
|
91
|
+
url: saved.url,
|
|
92
|
+
resourceId: canvasId + "/" + saved.hashName,
|
|
93
|
+
duration: round3(real && real > 0 ? real : 0),
|
|
94
|
+
fileName: "audio-" + name2
|
|
95
|
+
};
|
|
96
|
+
}).finally(() => running.delete(nodeId));
|
|
97
|
+
running.set(nodeId, promise);
|
|
98
|
+
try {
|
|
99
|
+
const result = await promise;
|
|
100
|
+
return c.json(result, result.ok ? 200 : 500);
|
|
101
|
+
} catch (err) {
|
|
102
|
+
return c.json({ ok: false, error: err instanceof Error ? err.message : String(err) }, 500);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
ctx.routes.post("/api/video-cut", async (c) => {
|
|
106
|
+
const body = await c.req.json().catch(() => null);
|
|
107
|
+
if (!body || typeof body !== "object") return c.json({ ok: false, error: "body \u4E0D\u662F JSON" }, 400);
|
|
108
|
+
const { canvasId, nodeId, srcUrl } = body;
|
|
109
|
+
if (typeof canvasId !== "string" || !CANVAS_ID_RE.test(canvasId)) return c.json({ ok: false, error: "\u975E\u6CD5\u753B\u5E03 id" }, 400);
|
|
110
|
+
if (typeof nodeId !== "string" || !NODE_ID_RE.test(nodeId)) return c.json({ ok: false, error: "\u975E\u6CD5\u8282\u70B9 id" }, 400);
|
|
111
|
+
const start = Number(body.start);
|
|
112
|
+
const end = Number(body.end);
|
|
113
|
+
if (!Number.isFinite(start) || !Number.isFinite(end)) return c.json({ ok: false, error: "\u526A\u8F91\u8303\u56F4\u4E0D\u662F\u6570\u5B57" }, 400);
|
|
114
|
+
if (start < 0) return c.json({ ok: false, error: "\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5C0F\u4E8E 0" }, 400);
|
|
115
|
+
const length = end - start;
|
|
116
|
+
if (length < 0.1) return c.json({ ok: false, error: "\u526A\u8F91\u8303\u56F4\u592A\u77ED\uFF08\u81F3\u5C11 0.1 \u79D2\uFF09" }, 400);
|
|
117
|
+
if (running.has(nodeId)) return c.json({ ok: false, error: "busy", message: "\u8BE5\u8282\u70B9\u5DF2\u6709\u89C6\u9891\u4EFB\u52A1\u5728\u8DD1" }, 409);
|
|
118
|
+
const ref = parseResourceRef(srcUrl, canvasId);
|
|
119
|
+
if (!ref) return c.json({ ok: false, error: "\u6E90\u89C6\u9891\u4E0D\u662F\u753B\u5E03\u8D44\u6E90\uFF08\u672C\u5730/\u5916\u94FE\u5730\u5740\u6682\u4E0D\u652F\u6301\u771F\u526A\u8F91\uFF09" }, 400);
|
|
120
|
+
const name2 = ref.name;
|
|
121
|
+
const src = await resources.read(ref.canvasId, name2);
|
|
122
|
+
if (!src) return c.json({ ok: false, error: "\u6E90\u89C6\u9891\u4E0D\u5B58\u5728" }, 404);
|
|
123
|
+
const promise = runFfmpegCut(Buffer.from(src), start, length).then(async (out) => {
|
|
124
|
+
const saved = await resources.save(canvasId, out, ".mp4");
|
|
125
|
+
const real = await probeDuration(out).catch(() => void 0);
|
|
126
|
+
return {
|
|
127
|
+
ok: true,
|
|
128
|
+
url: saved.url,
|
|
129
|
+
resourceId: canvasId + "/" + saved.hashName,
|
|
130
|
+
duration: round3(real && real > 0 ? real : length),
|
|
131
|
+
fileName: "cut-" + name2
|
|
132
|
+
};
|
|
133
|
+
}).finally(() => running.delete(nodeId));
|
|
134
|
+
running.set(nodeId, promise);
|
|
135
|
+
try {
|
|
136
|
+
const result = await promise;
|
|
137
|
+
return c.json(result, result.ok ? 200 : 500);
|
|
138
|
+
} catch (err) {
|
|
139
|
+
return c.json({ ok: false, error: err instanceof Error ? err.message : String(err) }, 500);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function runFfmpegCrop(bytes, rect) {
|
|
144
|
+
return new Promise((resolve, reject) => {
|
|
145
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plume-crop-"));
|
|
146
|
+
const src = path.join(dir, "src" + guessExt(bytes));
|
|
147
|
+
const dst = path.join(dir, "out.mp4");
|
|
148
|
+
const cleanup = () => {
|
|
149
|
+
void fs.rm(dir, { recursive: true, force: true }).catch(() => void 0);
|
|
150
|
+
};
|
|
151
|
+
fs.writeFile(src, bytes).then(() => {
|
|
152
|
+
const ff = spawn("ffmpeg", [
|
|
153
|
+
"-y",
|
|
154
|
+
"-hide_banner",
|
|
155
|
+
"-loglevel",
|
|
156
|
+
"error",
|
|
157
|
+
"-i",
|
|
158
|
+
src,
|
|
159
|
+
"-vf",
|
|
160
|
+
"crop=" + rect.width + ":" + rect.height + ":" + rect.x + ":" + rect.y,
|
|
161
|
+
"-c:v",
|
|
162
|
+
"libx264",
|
|
163
|
+
"-preset",
|
|
164
|
+
"veryfast",
|
|
165
|
+
"-crf",
|
|
166
|
+
"20",
|
|
167
|
+
"-pix_fmt",
|
|
168
|
+
"yuv420p",
|
|
169
|
+
"-c:a",
|
|
170
|
+
"copy",
|
|
171
|
+
"-movflags",
|
|
172
|
+
"+faststart",
|
|
173
|
+
dst
|
|
174
|
+
], { windowsHide: true });
|
|
175
|
+
let stderr = "";
|
|
176
|
+
ff.stderr.on("data", (d) => {
|
|
177
|
+
stderr += String(d);
|
|
178
|
+
});
|
|
179
|
+
ff.on("error", (err) => {
|
|
180
|
+
cleanup();
|
|
181
|
+
reject(new Error("ffmpeg \u542F\u52A8\u5931\u8D25\uFF08\u540E\u53F0\u6CA1\u88C5 ffmpeg\uFF1F\uFF09: " + err.message));
|
|
182
|
+
});
|
|
183
|
+
ff.on("close", async (code) => {
|
|
184
|
+
if (code !== 0) {
|
|
185
|
+
cleanup();
|
|
186
|
+
reject(new Error("ffmpeg \u9000\u51FA\u7801 " + code + ": " + stderr.slice(-400)));
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
const out = await fs.readFile(dst);
|
|
191
|
+
cleanup();
|
|
192
|
+
resolve(out);
|
|
193
|
+
} catch (err) {
|
|
194
|
+
cleanup();
|
|
195
|
+
reject(err);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}).catch(reject);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function runFfmpegCut(bytes, start, length) {
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plume-cut-"));
|
|
204
|
+
const src = path.join(dir, "src" + guessExt(bytes));
|
|
205
|
+
const dst = path.join(dir, "out.mp4");
|
|
206
|
+
const cleanup = () => {
|
|
207
|
+
void fs.rm(dir, { recursive: true, force: true }).catch(() => void 0);
|
|
208
|
+
};
|
|
209
|
+
fs.writeFile(src, bytes).then(() => {
|
|
210
|
+
const ff = spawn("ffmpeg", [
|
|
211
|
+
"-y",
|
|
212
|
+
"-hide_banner",
|
|
213
|
+
"-loglevel",
|
|
214
|
+
"error",
|
|
215
|
+
"-ss",
|
|
216
|
+
String(start),
|
|
217
|
+
"-i",
|
|
218
|
+
src,
|
|
219
|
+
"-t",
|
|
220
|
+
String(length),
|
|
221
|
+
"-map",
|
|
222
|
+
"0:v:0",
|
|
223
|
+
"-map",
|
|
224
|
+
"0:a:0?",
|
|
225
|
+
"-c:v",
|
|
226
|
+
"libx264",
|
|
227
|
+
"-preset",
|
|
228
|
+
"veryfast",
|
|
229
|
+
"-crf",
|
|
230
|
+
"20",
|
|
231
|
+
"-pix_fmt",
|
|
232
|
+
"yuv420p",
|
|
233
|
+
"-c:a",
|
|
234
|
+
"aac",
|
|
235
|
+
"-b:a",
|
|
236
|
+
"128k",
|
|
237
|
+
"-avoid_negative_ts",
|
|
238
|
+
"make_zero",
|
|
239
|
+
"-movflags",
|
|
240
|
+
"+faststart",
|
|
241
|
+
dst
|
|
242
|
+
], { windowsHide: true });
|
|
243
|
+
let stderr = "";
|
|
244
|
+
ff.stderr.on("data", (d) => {
|
|
245
|
+
stderr += String(d);
|
|
246
|
+
});
|
|
247
|
+
ff.on("error", (err) => {
|
|
248
|
+
cleanup();
|
|
249
|
+
reject(new Error("ffmpeg \u542F\u52A8\u5931\u8D25\uFF08\u540E\u53F0\u6CA1\u88C5 ffmpeg\uFF1F\uFF09: " + err.message));
|
|
250
|
+
});
|
|
251
|
+
ff.on("close", async (code) => {
|
|
252
|
+
if (code !== 0) {
|
|
253
|
+
cleanup();
|
|
254
|
+
reject(new Error("ffmpeg \u9000\u51FA\u7801 " + code + ": " + stderr.slice(-400)));
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const out = await fs.readFile(dst);
|
|
259
|
+
cleanup();
|
|
260
|
+
resolve(out);
|
|
261
|
+
} catch (err) {
|
|
262
|
+
cleanup();
|
|
263
|
+
reject(err);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}).catch(reject);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function runFfmpegAudio(bytes) {
|
|
270
|
+
return new Promise((resolve, reject) => {
|
|
271
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plume-audio-"));
|
|
272
|
+
const src = path.join(dir, "src" + guessExt(bytes));
|
|
273
|
+
const dst = path.join(dir, "out.mp3");
|
|
274
|
+
const cleanup = () => {
|
|
275
|
+
void fs.rm(dir, { recursive: true, force: true }).catch(() => void 0);
|
|
276
|
+
};
|
|
277
|
+
fs.writeFile(src, bytes).then(() => {
|
|
278
|
+
const ff = spawn("ffmpeg", [
|
|
279
|
+
"-y",
|
|
280
|
+
"-hide_banner",
|
|
281
|
+
"-loglevel",
|
|
282
|
+
"error",
|
|
283
|
+
"-i",
|
|
284
|
+
src,
|
|
285
|
+
"-vn",
|
|
286
|
+
"-map",
|
|
287
|
+
"0:a:0?",
|
|
288
|
+
"-c:a",
|
|
289
|
+
"libmp3lame",
|
|
290
|
+
"-q:a",
|
|
291
|
+
"2",
|
|
292
|
+
dst
|
|
293
|
+
], { windowsHide: true });
|
|
294
|
+
let stderr = "";
|
|
295
|
+
ff.stderr.on("data", (d) => {
|
|
296
|
+
stderr += String(d);
|
|
297
|
+
});
|
|
298
|
+
ff.on("error", (err) => {
|
|
299
|
+
cleanup();
|
|
300
|
+
reject(new Error("ffmpeg \u542F\u52A8\u5931\u8D25\uFF08\u540E\u53F0\u6CA1\u88C5 ffmpeg\uFF1F\uFF09: " + err.message));
|
|
301
|
+
});
|
|
302
|
+
ff.on("close", async (code) => {
|
|
303
|
+
if (code !== 0) {
|
|
304
|
+
cleanup();
|
|
305
|
+
const noAudio = /does not contain any stream|matches no streams/i.test(stderr);
|
|
306
|
+
reject(new Error(noAudio ? "\u8FD9\u6BB5\u89C6\u9891\u6CA1\u6709\u97F3\u8F68\uFF0C\u8F6C\u4E0D\u51FA\u97F3\u9891" : "ffmpeg \u9000\u51FA\u7801 " + code + ": " + stderr.slice(-400)));
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
try {
|
|
310
|
+
const out = await fs.readFile(dst);
|
|
311
|
+
cleanup();
|
|
312
|
+
resolve(out);
|
|
313
|
+
} catch (err) {
|
|
314
|
+
cleanup();
|
|
315
|
+
reject(err);
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
}).catch(reject);
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function probeDuration(bytes) {
|
|
322
|
+
return new Promise((resolve) => {
|
|
323
|
+
const dir = mkdtempSync(path.join(tmpdir(), "plume-probe-"));
|
|
324
|
+
const src = path.join(dir, "probe.mp4");
|
|
325
|
+
const cleanup = () => {
|
|
326
|
+
void fs.rm(dir, { recursive: true, force: true }).catch(() => void 0);
|
|
327
|
+
};
|
|
328
|
+
fs.writeFile(src, bytes).then(() => {
|
|
329
|
+
const ff = spawn("ffprobe", [
|
|
330
|
+
"-v",
|
|
331
|
+
"error",
|
|
332
|
+
"-show_entries",
|
|
333
|
+
"format=duration",
|
|
334
|
+
"-of",
|
|
335
|
+
"default=noprint_wrappers=1:nokey=1",
|
|
336
|
+
src
|
|
337
|
+
], { windowsHide: true });
|
|
338
|
+
let stdout = "";
|
|
339
|
+
ff.stdout.on("data", (d) => {
|
|
340
|
+
stdout += String(d);
|
|
341
|
+
});
|
|
342
|
+
ff.on("error", () => {
|
|
343
|
+
cleanup();
|
|
344
|
+
resolve(void 0);
|
|
345
|
+
});
|
|
346
|
+
ff.on("close", (code) => {
|
|
347
|
+
cleanup();
|
|
348
|
+
const v = Number(stdout.trim());
|
|
349
|
+
resolve(code === 0 && Number.isFinite(v) && v > 0 ? v : void 0);
|
|
350
|
+
});
|
|
351
|
+
}).catch(() => {
|
|
352
|
+
cleanup();
|
|
353
|
+
resolve(void 0);
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
function guessExt(bytes) {
|
|
358
|
+
if (bytes.length > 11 && bytes[4] === 102 && bytes[5] === 116 && bytes[6] === 121 && bytes[7] === 112) return ".mp4";
|
|
359
|
+
if (bytes.length > 4 && bytes[0] === 26 && bytes[1] === 69 && bytes[2] === 223 && bytes[3] === 163) return ".webm";
|
|
360
|
+
return ".bin";
|
|
361
|
+
}
|
|
362
|
+
export {
|
|
363
|
+
apply,
|
|
364
|
+
isSafeResourceName,
|
|
365
|
+
name,
|
|
366
|
+
parseResourceName,
|
|
367
|
+
parseResourceRef
|
|
368
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plume-canvas/plugin-node-video",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"plume": {
|
|
6
|
+
"title": "视频节点",
|
|
7
|
+
"description": "视频节点:播放 / 裁剪 / 剪辑 / 截图 / 下载",
|
|
8
|
+
"pluginName": "video",
|
|
9
|
+
"builtin": true,
|
|
10
|
+
"serverPermissions": [],
|
|
11
|
+
"web": {
|
|
12
|
+
"entry": "dist/web.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"main": "./dist/web.js",
|
|
16
|
+
"types": "./src/index.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./dist/web.js"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "vite build && node scripts/build-server.mjs",
|
|
22
|
+
"build:web": "vite build",
|
|
23
|
+
"build:server": "node scripts/build-server.mjs",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"typecheck": "tsc --noEmit"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"lucide-vue-next": "^1.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"vue": "^3.5.34"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"esbuild": "^0.28.2",
|
|
35
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
36
|
+
"@vue/server-renderer": "3.5.38",
|
|
37
|
+
"typescript": "~6.0.2",
|
|
38
|
+
"vite": "^8.0.12",
|
|
39
|
+
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
40
|
+
"vitest": "^3.0.0",
|
|
41
|
+
"vue": "^3.5.34"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md"
|
|
49
|
+
]
|
|
50
|
+
}
|
package/README.md
DELETED