@camox/cli 0.25.0 → 0.26.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/index.mjs +46 -6
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -372,6 +372,7 @@ async function dispatch(opts) {
|
|
|
372
372
|
const projectFlag$3 = optional(option("--project", string({ metavar: "SLUG" })));
|
|
373
373
|
const jsonFlag$3 = option("--json");
|
|
374
374
|
const productionFlag$2 = option("--production");
|
|
375
|
+
const liveFlag$1 = option("--live");
|
|
375
376
|
const parser$7 = command("blocks", or(command("types", object({
|
|
376
377
|
command: constant("blocks.types"),
|
|
377
378
|
project: projectFlag$3,
|
|
@@ -386,6 +387,7 @@ const parser$7 = command("blocks", or(command("types", object({
|
|
|
386
387
|
})), command("get", object({
|
|
387
388
|
command: constant("blocks.get"),
|
|
388
389
|
id: option("--id", integer({ metavar: "ID" })),
|
|
390
|
+
live: liveFlag$1,
|
|
389
391
|
project: projectFlag$3,
|
|
390
392
|
production: productionFlag$2,
|
|
391
393
|
json: jsonFlag$3
|
|
@@ -477,7 +479,10 @@ async function handler$7(args) {
|
|
|
477
479
|
});
|
|
478
480
|
case "blocks.get": return dispatch({
|
|
479
481
|
toolName: "getBlock",
|
|
480
|
-
args: {
|
|
482
|
+
args: {
|
|
483
|
+
id: args.id,
|
|
484
|
+
source: args.live ? "live" : "draft"
|
|
485
|
+
},
|
|
481
486
|
projectFlag,
|
|
482
487
|
production,
|
|
483
488
|
outputMode
|
|
@@ -919,19 +924,32 @@ function logout() {
|
|
|
919
924
|
const projectFlag = optional(option("--project", string({ metavar: "SLUG" })));
|
|
920
925
|
const jsonFlag = option("--json");
|
|
921
926
|
const productionFlag = option("--production");
|
|
922
|
-
const
|
|
927
|
+
const liveFlag = option("--live");
|
|
928
|
+
const list = command("list", object({
|
|
923
929
|
command: constant("pages.list"),
|
|
924
930
|
project: projectFlag,
|
|
925
931
|
production: productionFlag,
|
|
926
932
|
json: jsonFlag
|
|
927
|
-
}))
|
|
933
|
+
}));
|
|
934
|
+
const get = command("get", object({
|
|
928
935
|
command: constant("pages.get"),
|
|
929
936
|
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
930
937
|
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
938
|
+
live: liveFlag,
|
|
931
939
|
project: projectFlag,
|
|
932
940
|
production: productionFlag,
|
|
933
941
|
json: jsonFlag
|
|
934
|
-
}))
|
|
942
|
+
}));
|
|
943
|
+
const publish = command("publish", object({
|
|
944
|
+
command: constant("pages.publish"),
|
|
945
|
+
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
946
|
+
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
947
|
+
noLayout: option("--no-layout"),
|
|
948
|
+
project: projectFlag,
|
|
949
|
+
production: productionFlag,
|
|
950
|
+
json: jsonFlag
|
|
951
|
+
}));
|
|
952
|
+
const parser$1 = command("pages", or(list, get, command("create", object({
|
|
935
953
|
command: constant("pages.create"),
|
|
936
954
|
pathSegment: option("--path-segment", string({ metavar: "SEGMENT" })),
|
|
937
955
|
layoutId: option("--layout-id", integer({ metavar: "ID" })),
|
|
@@ -961,7 +979,7 @@ const parser$1 = command("pages", or(command("list", object({
|
|
|
961
979
|
project: projectFlag,
|
|
962
980
|
production: productionFlag,
|
|
963
981
|
json: jsonFlag
|
|
964
|
-
}))));
|
|
982
|
+
})), publish));
|
|
965
983
|
async function handler$1(args) {
|
|
966
984
|
const outputMode = args.json ? "json" : "auto";
|
|
967
985
|
const projectFlag = args.project;
|
|
@@ -984,7 +1002,10 @@ async function handler$1(args) {
|
|
|
984
1002
|
}
|
|
985
1003
|
return dispatch({
|
|
986
1004
|
toolName: "getPage",
|
|
987
|
-
args:
|
|
1005
|
+
args: {
|
|
1006
|
+
...args.id != null ? { id: args.id } : { path: args.path },
|
|
1007
|
+
source: args.live ? "live" : "draft"
|
|
1008
|
+
},
|
|
988
1009
|
projectFlag,
|
|
989
1010
|
production,
|
|
990
1011
|
outputMode
|
|
@@ -1029,6 +1050,24 @@ async function handler$1(args) {
|
|
|
1029
1050
|
production,
|
|
1030
1051
|
outputMode
|
|
1031
1052
|
});
|
|
1053
|
+
case "pages.publish":
|
|
1054
|
+
if (args.id == null === (args.path == null)) {
|
|
1055
|
+
printError({
|
|
1056
|
+
code: "INVALID_ARGS",
|
|
1057
|
+
message: "Pass exactly one of --id or --path."
|
|
1058
|
+
});
|
|
1059
|
+
process.exit(2);
|
|
1060
|
+
}
|
|
1061
|
+
return dispatch({
|
|
1062
|
+
toolName: "publishPage",
|
|
1063
|
+
args: {
|
|
1064
|
+
...args.id != null ? { id: args.id } : { path: args.path },
|
|
1065
|
+
alsoPublishLayout: !args.noLayout
|
|
1066
|
+
},
|
|
1067
|
+
projectFlag,
|
|
1068
|
+
production,
|
|
1069
|
+
outputMode
|
|
1070
|
+
});
|
|
1032
1071
|
}
|
|
1033
1072
|
}
|
|
1034
1073
|
//#endregion
|
|
@@ -1107,6 +1146,7 @@ switch (result.command) {
|
|
|
1107
1146
|
case "pages.update":
|
|
1108
1147
|
case "pages.set-layout":
|
|
1109
1148
|
case "pages.delete":
|
|
1149
|
+
case "pages.publish":
|
|
1110
1150
|
await handler$1(result);
|
|
1111
1151
|
break;
|
|
1112
1152
|
case "blocks.types":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camox/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"camox": "./dist/index.mjs"
|
|
6
6
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@types/node": "^24.12.2",
|
|
27
27
|
"@typescript/native-preview": "7.0.0-dev.20260412.1",
|
|
28
28
|
"vite-plus": "latest",
|
|
29
|
-
"@camox/api-contract": "0.
|
|
29
|
+
"@camox/api-contract": "0.26.0"
|
|
30
30
|
},
|
|
31
31
|
"nx": {
|
|
32
32
|
"tags": [
|