@fluid-app/fluid-cli-assets 0.1.782 → 0.1.784
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/index.mjs +7 -10
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createDomainCommand, declareInputs, findProjectConfig, getAuthToken, uploadToDam } from "@fluid-app/fluid-cli";
|
|
2
2
|
import "commander";
|
|
3
3
|
import { basename } from "node:path";
|
|
4
|
-
|
|
4
|
+
// src/commands/upload.ts
|
|
5
5
|
function registerUpload(parent, ctx) {
|
|
6
|
-
|
|
6
|
+
const upload = parent.command("upload [file]").description("Upload a file or URL to the Fluid DAM (via upload.fluid.app)").option("--url <url>", "Fetch from an external URL instead of attaching a local file").option("--name <name>", "Display name for the DAM asset").option("--description <description>", "Asset description").option("--tags <tags>", "Comma-separated tags").option("--folder <folder>", "ImageKit folder override").option("--no-unique-filename", "Disable ImageKit's useUniqueFileName (default: enabled)").option("--create-media", "Also create a Fluid Media resource (active, share, publish-now)").action(async function(filePath, opts) {
|
|
7
7
|
const token = resolveToken(this.parent?.opts() ?? {});
|
|
8
8
|
if (!token) throw new Error("No API token found. Run `fluid login` or provide --token <token>.");
|
|
9
9
|
if (!filePath && !opts.url) throw new Error("Provide a file path or --url <url>. Run `fluid dam upload --help` for usage.");
|
|
@@ -23,7 +23,8 @@ function registerUpload(parent, ctx) {
|
|
|
23
23
|
onRequest: ctx.verbose ? (line) => process.stderr.write(`${line}\n`) : void 0
|
|
24
24
|
});
|
|
25
25
|
ctx.output(body);
|
|
26
|
-
})
|
|
26
|
+
});
|
|
27
|
+
declareInputs(upload, (_opts, args) => args[0] ? [{
|
|
27
28
|
kind: "file",
|
|
28
29
|
path: args[0]
|
|
29
30
|
}] : []);
|
|
@@ -47,8 +48,7 @@ function resolveToken(opts) {
|
|
|
47
48
|
}
|
|
48
49
|
return getAuthToken();
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
//#region src/generated/primary.ts
|
|
51
|
+
// src/generated/primary.ts
|
|
52
52
|
function registerPrimary(parent, ctx) {
|
|
53
53
|
declareInputs(parent.command("get-asset-paths <code>").description("Lists asset paths for an existing asset").action(async (code) => {
|
|
54
54
|
const client = await ctx.getClient();
|
|
@@ -208,13 +208,11 @@ function registerPrimary(parent, ctx) {
|
|
|
208
208
|
ctx.output(result);
|
|
209
209
|
}), () => []);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
//#region src/generated/index.ts
|
|
211
|
+
// src/generated/index.ts
|
|
213
212
|
function registerAllCommands(parent, ctx) {
|
|
214
213
|
registerPrimary(parent, ctx);
|
|
215
214
|
}
|
|
216
|
-
|
|
217
|
-
//#region src/index.ts
|
|
215
|
+
// src/index.ts
|
|
218
216
|
const plugin = {
|
|
219
217
|
name: "@fluid-app/fluid-cli-assets",
|
|
220
218
|
version: "0.1.0",
|
|
@@ -227,7 +225,6 @@ const plugin = {
|
|
|
227
225
|
ctx.program.addCommand(assets);
|
|
228
226
|
}
|
|
229
227
|
};
|
|
230
|
-
//#endregion
|
|
231
228
|
export { plugin as default };
|
|
232
229
|
|
|
233
230
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-app/fluid-cli-assets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.784",
|
|
4
4
|
"description": "Fluid CLI commands for digital asset management (DAM)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fluid-app/fluid-cli": "0.1.
|
|
21
|
-
"commander": "^12.
|
|
20
|
+
"@fluid-app/fluid-cli": "0.1.810",
|
|
21
|
+
"commander": "^12.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@fluid-app/api-client-scripts": "0.0.0",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@types/jest": "^29.5.14",
|
|
29
29
|
"@types/node": "24.10.12",
|
|
30
30
|
"jest": "^29.7.0",
|
|
31
|
-
"tsdown": "
|
|
31
|
+
"tsdown": "0.23.7",
|
|
32
32
|
"tsx": "^4.21.0",
|
|
33
|
-
"typescript": "
|
|
33
|
+
"typescript": "7.0.2"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=24.0.0"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"generate": "tsx scripts/generate.ts",
|
|
80
80
|
"lint": "oxlint",
|
|
81
81
|
"lint:fix": "oxlint --fix",
|
|
82
|
-
"typecheck": "
|
|
82
|
+
"typecheck": "tsc --noEmit",
|
|
83
83
|
"test": "jest"
|
|
84
84
|
}
|
|
85
85
|
}
|