@camox/cli 0.26.0 → 0.28.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 +71 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -391,6 +391,13 @@ const parser$7 = command("blocks", or(command("types", object({
|
|
|
391
391
|
project: projectFlag$3,
|
|
392
392
|
production: productionFlag$2,
|
|
393
393
|
json: jsonFlag$3
|
|
394
|
+
})), command("get-many", object({
|
|
395
|
+
command: constant("blocks.get-many"),
|
|
396
|
+
id: multiple(option("--id", integer({ metavar: "ID" })), { min: 1 }),
|
|
397
|
+
live: liveFlag$1,
|
|
398
|
+
project: projectFlag$3,
|
|
399
|
+
production: productionFlag$2,
|
|
400
|
+
json: jsonFlag$3
|
|
394
401
|
})), command("create", object({
|
|
395
402
|
command: constant("blocks.create"),
|
|
396
403
|
pageId: option("--page-id", integer({ metavar: "ID" })),
|
|
@@ -487,6 +494,16 @@ async function handler$7(args) {
|
|
|
487
494
|
production,
|
|
488
495
|
outputMode
|
|
489
496
|
});
|
|
497
|
+
case "blocks.get-many": return dispatch({
|
|
498
|
+
toolName: "getBlocks",
|
|
499
|
+
args: {
|
|
500
|
+
ids: [...args.id],
|
|
501
|
+
source: args.live ? "live" : "draft"
|
|
502
|
+
},
|
|
503
|
+
projectFlag,
|
|
504
|
+
production,
|
|
505
|
+
outputMode
|
|
506
|
+
});
|
|
490
507
|
case "blocks.create": {
|
|
491
508
|
const content = parseJsonFlag("--content", args.content);
|
|
492
509
|
const settings = args.settings !== void 0 ? parseJsonFlag("--settings", args.settings) : void 0;
|
|
@@ -949,8 +966,25 @@ const publish = command("publish", object({
|
|
|
949
966
|
production: productionFlag,
|
|
950
967
|
json: jsonFlag
|
|
951
968
|
}));
|
|
969
|
+
const unpublish = command("unpublish", object({
|
|
970
|
+
command: constant("pages.unpublish"),
|
|
971
|
+
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
972
|
+
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
973
|
+
project: projectFlag,
|
|
974
|
+
production: productionFlag,
|
|
975
|
+
json: jsonFlag
|
|
976
|
+
}));
|
|
977
|
+
const discardChanges = command("discard-changes", object({
|
|
978
|
+
command: constant("pages.discard-changes"),
|
|
979
|
+
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
980
|
+
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
981
|
+
project: projectFlag,
|
|
982
|
+
production: productionFlag,
|
|
983
|
+
json: jsonFlag
|
|
984
|
+
}));
|
|
952
985
|
const parser$1 = command("pages", or(list, get, command("create", object({
|
|
953
986
|
command: constant("pages.create"),
|
|
987
|
+
nickname: optional(option("--nickname", string({ metavar: "TEXT" }))),
|
|
954
988
|
pathSegment: option("--path-segment", string({ metavar: "SEGMENT" })),
|
|
955
989
|
layoutId: option("--layout-id", integer({ metavar: "ID" })),
|
|
956
990
|
parentPageId: optional(option("--parent-page-id", integer({ metavar: "ID" }))),
|
|
@@ -961,6 +995,7 @@ const parser$1 = command("pages", or(list, get, command("create", object({
|
|
|
961
995
|
})), command("update", object({
|
|
962
996
|
command: constant("pages.update"),
|
|
963
997
|
id: option("--id", integer({ metavar: "ID" })),
|
|
998
|
+
nickname: optional(option("--nickname", string({ metavar: "TEXT" }))),
|
|
964
999
|
pathSegment: optional(option("--path-segment", string({ metavar: "SEGMENT" }))),
|
|
965
1000
|
parentPageId: optional(option("--parent-page-id", integer({ metavar: "ID" }))),
|
|
966
1001
|
project: projectFlag,
|
|
@@ -979,7 +1014,7 @@ const parser$1 = command("pages", or(list, get, command("create", object({
|
|
|
979
1014
|
project: projectFlag,
|
|
980
1015
|
production: productionFlag,
|
|
981
1016
|
json: jsonFlag
|
|
982
|
-
})), publish));
|
|
1017
|
+
})), publish, unpublish, discardChanges));
|
|
983
1018
|
async function handler$1(args) {
|
|
984
1019
|
const outputMode = args.json ? "json" : "auto";
|
|
985
1020
|
const projectFlag = args.project;
|
|
@@ -1013,6 +1048,7 @@ async function handler$1(args) {
|
|
|
1013
1048
|
case "pages.create": return dispatch({
|
|
1014
1049
|
toolName: "createPage",
|
|
1015
1050
|
args: {
|
|
1051
|
+
nickname: args.nickname,
|
|
1016
1052
|
pathSegment: args.pathSegment,
|
|
1017
1053
|
layoutId: args.layoutId,
|
|
1018
1054
|
parentPageId: args.parentPageId,
|
|
@@ -1026,6 +1062,7 @@ async function handler$1(args) {
|
|
|
1026
1062
|
toolName: "updatePage",
|
|
1027
1063
|
args: {
|
|
1028
1064
|
id: args.id,
|
|
1065
|
+
nickname: args.nickname,
|
|
1029
1066
|
pathSegment: args.pathSegment,
|
|
1030
1067
|
parentPageId: args.parentPageId
|
|
1031
1068
|
},
|
|
@@ -1068,6 +1105,36 @@ async function handler$1(args) {
|
|
|
1068
1105
|
production,
|
|
1069
1106
|
outputMode
|
|
1070
1107
|
});
|
|
1108
|
+
case "pages.unpublish":
|
|
1109
|
+
if (args.id == null === (args.path == null)) {
|
|
1110
|
+
printError({
|
|
1111
|
+
code: "INVALID_ARGS",
|
|
1112
|
+
message: "Pass exactly one of --id or --path."
|
|
1113
|
+
});
|
|
1114
|
+
process.exit(2);
|
|
1115
|
+
}
|
|
1116
|
+
return dispatch({
|
|
1117
|
+
toolName: "unpublishPage",
|
|
1118
|
+
args: args.id != null ? { id: args.id } : { path: args.path },
|
|
1119
|
+
projectFlag,
|
|
1120
|
+
production,
|
|
1121
|
+
outputMode
|
|
1122
|
+
});
|
|
1123
|
+
case "pages.discard-changes":
|
|
1124
|
+
if (args.id == null === (args.path == null)) {
|
|
1125
|
+
printError({
|
|
1126
|
+
code: "INVALID_ARGS",
|
|
1127
|
+
message: "Pass exactly one of --id or --path."
|
|
1128
|
+
});
|
|
1129
|
+
process.exit(2);
|
|
1130
|
+
}
|
|
1131
|
+
return dispatch({
|
|
1132
|
+
toolName: "discardPageChanges",
|
|
1133
|
+
args: args.id != null ? { id: args.id } : { path: args.path },
|
|
1134
|
+
projectFlag,
|
|
1135
|
+
production,
|
|
1136
|
+
outputMode
|
|
1137
|
+
});
|
|
1071
1138
|
}
|
|
1072
1139
|
}
|
|
1073
1140
|
//#endregion
|
|
@@ -1147,11 +1214,14 @@ switch (result.command) {
|
|
|
1147
1214
|
case "pages.set-layout":
|
|
1148
1215
|
case "pages.delete":
|
|
1149
1216
|
case "pages.publish":
|
|
1217
|
+
case "pages.unpublish":
|
|
1218
|
+
case "pages.discard-changes":
|
|
1150
1219
|
await handler$1(result);
|
|
1151
1220
|
break;
|
|
1152
1221
|
case "blocks.types":
|
|
1153
1222
|
case "blocks.describe":
|
|
1154
1223
|
case "blocks.get":
|
|
1224
|
+
case "blocks.get-many":
|
|
1155
1225
|
case "blocks.create":
|
|
1156
1226
|
case "blocks.edit":
|
|
1157
1227
|
case "blocks.move":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camox/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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.28.0"
|
|
30
30
|
},
|
|
31
31
|
"nx": {
|
|
32
32
|
"tags": [
|