@camox/cli 0.26.0 → 0.27.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 +53 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -949,8 +949,25 @@ const publish = command("publish", object({
|
|
|
949
949
|
production: productionFlag,
|
|
950
950
|
json: jsonFlag
|
|
951
951
|
}));
|
|
952
|
+
const unpublish = command("unpublish", object({
|
|
953
|
+
command: constant("pages.unpublish"),
|
|
954
|
+
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
955
|
+
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
956
|
+
project: projectFlag,
|
|
957
|
+
production: productionFlag,
|
|
958
|
+
json: jsonFlag
|
|
959
|
+
}));
|
|
960
|
+
const discardChanges = command("discard-changes", object({
|
|
961
|
+
command: constant("pages.discard-changes"),
|
|
962
|
+
id: optional(option("--id", integer({ metavar: "ID" }))),
|
|
963
|
+
path: optional(option("--path", string({ metavar: "PATH" }))),
|
|
964
|
+
project: projectFlag,
|
|
965
|
+
production: productionFlag,
|
|
966
|
+
json: jsonFlag
|
|
967
|
+
}));
|
|
952
968
|
const parser$1 = command("pages", or(list, get, command("create", object({
|
|
953
969
|
command: constant("pages.create"),
|
|
970
|
+
nickname: optional(option("--nickname", string({ metavar: "TEXT" }))),
|
|
954
971
|
pathSegment: option("--path-segment", string({ metavar: "SEGMENT" })),
|
|
955
972
|
layoutId: option("--layout-id", integer({ metavar: "ID" })),
|
|
956
973
|
parentPageId: optional(option("--parent-page-id", integer({ metavar: "ID" }))),
|
|
@@ -961,6 +978,7 @@ const parser$1 = command("pages", or(list, get, command("create", object({
|
|
|
961
978
|
})), command("update", object({
|
|
962
979
|
command: constant("pages.update"),
|
|
963
980
|
id: option("--id", integer({ metavar: "ID" })),
|
|
981
|
+
nickname: optional(option("--nickname", string({ metavar: "TEXT" }))),
|
|
964
982
|
pathSegment: optional(option("--path-segment", string({ metavar: "SEGMENT" }))),
|
|
965
983
|
parentPageId: optional(option("--parent-page-id", integer({ metavar: "ID" }))),
|
|
966
984
|
project: projectFlag,
|
|
@@ -979,7 +997,7 @@ const parser$1 = command("pages", or(list, get, command("create", object({
|
|
|
979
997
|
project: projectFlag,
|
|
980
998
|
production: productionFlag,
|
|
981
999
|
json: jsonFlag
|
|
982
|
-
})), publish));
|
|
1000
|
+
})), publish, unpublish, discardChanges));
|
|
983
1001
|
async function handler$1(args) {
|
|
984
1002
|
const outputMode = args.json ? "json" : "auto";
|
|
985
1003
|
const projectFlag = args.project;
|
|
@@ -1013,6 +1031,7 @@ async function handler$1(args) {
|
|
|
1013
1031
|
case "pages.create": return dispatch({
|
|
1014
1032
|
toolName: "createPage",
|
|
1015
1033
|
args: {
|
|
1034
|
+
nickname: args.nickname,
|
|
1016
1035
|
pathSegment: args.pathSegment,
|
|
1017
1036
|
layoutId: args.layoutId,
|
|
1018
1037
|
parentPageId: args.parentPageId,
|
|
@@ -1026,6 +1045,7 @@ async function handler$1(args) {
|
|
|
1026
1045
|
toolName: "updatePage",
|
|
1027
1046
|
args: {
|
|
1028
1047
|
id: args.id,
|
|
1048
|
+
nickname: args.nickname,
|
|
1029
1049
|
pathSegment: args.pathSegment,
|
|
1030
1050
|
parentPageId: args.parentPageId
|
|
1031
1051
|
},
|
|
@@ -1068,6 +1088,36 @@ async function handler$1(args) {
|
|
|
1068
1088
|
production,
|
|
1069
1089
|
outputMode
|
|
1070
1090
|
});
|
|
1091
|
+
case "pages.unpublish":
|
|
1092
|
+
if (args.id == null === (args.path == null)) {
|
|
1093
|
+
printError({
|
|
1094
|
+
code: "INVALID_ARGS",
|
|
1095
|
+
message: "Pass exactly one of --id or --path."
|
|
1096
|
+
});
|
|
1097
|
+
process.exit(2);
|
|
1098
|
+
}
|
|
1099
|
+
return dispatch({
|
|
1100
|
+
toolName: "unpublishPage",
|
|
1101
|
+
args: args.id != null ? { id: args.id } : { path: args.path },
|
|
1102
|
+
projectFlag,
|
|
1103
|
+
production,
|
|
1104
|
+
outputMode
|
|
1105
|
+
});
|
|
1106
|
+
case "pages.discard-changes":
|
|
1107
|
+
if (args.id == null === (args.path == null)) {
|
|
1108
|
+
printError({
|
|
1109
|
+
code: "INVALID_ARGS",
|
|
1110
|
+
message: "Pass exactly one of --id or --path."
|
|
1111
|
+
});
|
|
1112
|
+
process.exit(2);
|
|
1113
|
+
}
|
|
1114
|
+
return dispatch({
|
|
1115
|
+
toolName: "discardPageChanges",
|
|
1116
|
+
args: args.id != null ? { id: args.id } : { path: args.path },
|
|
1117
|
+
projectFlag,
|
|
1118
|
+
production,
|
|
1119
|
+
outputMode
|
|
1120
|
+
});
|
|
1071
1121
|
}
|
|
1072
1122
|
}
|
|
1073
1123
|
//#endregion
|
|
@@ -1147,6 +1197,8 @@ switch (result.command) {
|
|
|
1147
1197
|
case "pages.set-layout":
|
|
1148
1198
|
case "pages.delete":
|
|
1149
1199
|
case "pages.publish":
|
|
1200
|
+
case "pages.unpublish":
|
|
1201
|
+
case "pages.discard-changes":
|
|
1150
1202
|
await handler$1(result);
|
|
1151
1203
|
break;
|
|
1152
1204
|
case "blocks.types":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camox/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.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.27.0"
|
|
30
30
|
},
|
|
31
31
|
"nx": {
|
|
32
32
|
"tags": [
|