@siteoshq/cli 1.8.0 → 1.9.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/README.md +7 -2
- package/dist/cli.js +22 -3
- package/dist/cli.js.map +1 -1
- package/package.json +23 -22
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# SiteOS CLI
|
|
2
2
|
|
|
3
3
|
`@siteoshq/cli` exposes one `siteos` binary for Auth, common Projects, Pulse, Cookie, Forms,
|
|
4
|
-
Search, Trace, SEO and Integrations. This source prepares version 1.
|
|
4
|
+
Search, Trace, SEO and Integrations. This source prepares version 1.9.0; publishing is a separate release.
|
|
5
5
|
Node.js 22 or newer is required.
|
|
6
6
|
|
|
7
7
|
## Install and authenticate
|
|
@@ -231,6 +231,12 @@ pnpm --dir packages/cli pack:check
|
|
|
231
231
|
|
|
232
232
|
## Cookie verification
|
|
233
233
|
|
|
234
|
+
Before a new Cookie connection, `cookie terms show --json` returns the current service terms and
|
|
235
|
+
the selected Organization's acceptance. After the owner or admin explicitly agrees to that
|
|
236
|
+
document, use `cookie terms accept --version <reviewed-version> --confirm --json`, then read the
|
|
237
|
+
status again. Setup and publication requests alone do not constitute agreement. These commands
|
|
238
|
+
are available in CLI 1.9.0 and require the matching application release.
|
|
239
|
+
|
|
234
240
|
CLI 1.2.0 adds `cookie schema`, `cookie validate --input draft.json`,
|
|
235
241
|
`cookie regions resolve --country GB --source published` and `cookie restore --input restore.json`.
|
|
236
242
|
Restore changes the draft only. Validation makes no write and reports a stale draft version.
|
|
@@ -298,7 +304,6 @@ A changed field requires a normal build/release, not a second hand-edited valida
|
|
|
298
304
|
`forms deployment-key list|revoke` manages release keys; submission keys cannot publish.
|
|
299
305
|
See the SiteOS Forms skill for the portable generator and version serialization contract.
|
|
300
306
|
|
|
301
|
-
|
|
302
307
|
## Website Analytics
|
|
303
308
|
|
|
304
309
|
The source CLI includes `siteos analytics` for an explicitly connected Project environment. Check
|
package/dist/cli.js
CHANGED
|
@@ -9588,6 +9588,8 @@ var SERVICE_HELP = {
|
|
|
9588
9588
|
cookie: `Manage Cookie for the selected SiteOS Project.
|
|
9589
9589
|
|
|
9590
9590
|
Usage:
|
|
9591
|
+
siteos cookie terms show [--json]
|
|
9592
|
+
siteos cookie terms accept --version <reviewed-version> --confirm [--json]
|
|
9591
9593
|
siteos cookie status [--json]
|
|
9592
9594
|
siteos cookie installation [--json]
|
|
9593
9595
|
siteos cookie schema [--json]
|
|
@@ -9600,7 +9602,8 @@ Usage:
|
|
|
9600
9602
|
siteos cookie publish --input <publication.json> [--json]
|
|
9601
9603
|
siteos cookie analytics [--range-days <7|30|90>] [--json]
|
|
9602
9604
|
|
|
9603
|
-
Start with siteos project use, then siteos project connect cookie.
|
|
9605
|
+
Start with siteos project use, then read and explicitly accept Cookie service terms before siteos project connect cookie.
|
|
9606
|
+
Accept only after an organization owner or admin has reviewed and authorized that exact version.
|
|
9604
9607
|
Draft get returns the complete save payload including expectedDraftVersion.
|
|
9605
9608
|
Publish input: {"expectedDraftVersion":1,"idempotencyKey":"a-unique-request-key"}.
|
|
9606
9609
|
Saving a draft has no public effect. Publish activates the reviewed banner at Cookie Edge.`,
|
|
@@ -9653,6 +9656,8 @@ async function runServiceCommand(service, options) {
|
|
|
9653
9656
|
strict: true,
|
|
9654
9657
|
options: {
|
|
9655
9658
|
json: { type: "boolean" },
|
|
9659
|
+
confirm: { type: "boolean" },
|
|
9660
|
+
version: { type: "string" },
|
|
9656
9661
|
input: { type: "string" },
|
|
9657
9662
|
environment: { type: "string" },
|
|
9658
9663
|
"range-days": { type: "string" },
|
|
@@ -9683,6 +9688,8 @@ async function runServiceCommand(service, options) {
|
|
|
9683
9688
|
const route = positionals.join(" ");
|
|
9684
9689
|
const allowed = {
|
|
9685
9690
|
cookie: {
|
|
9691
|
+
"terms show": [],
|
|
9692
|
+
"terms accept": ["version", "confirm"],
|
|
9686
9693
|
status: [],
|
|
9687
9694
|
installation: [],
|
|
9688
9695
|
schema: [],
|
|
@@ -9736,8 +9743,15 @@ async function runServiceCommand(service, options) {
|
|
|
9736
9743
|
const expectedDraftVersion = tracePublicationVersion(
|
|
9737
9744
|
values["expected-draft-version"]
|
|
9738
9745
|
);
|
|
9746
|
+
const isCookieTerms = service === "cookie" && action === "terms";
|
|
9747
|
+
if (isCookieTerms && subaction === "accept" && (!values.version || !values.confirm))
|
|
9748
|
+
throw new Error(
|
|
9749
|
+
"Read siteos cookie terms show, then explicitly pass --version <reviewed-version> --confirm."
|
|
9750
|
+
);
|
|
9739
9751
|
const runtime = commonProjectRuntime(options);
|
|
9740
|
-
const common = service === "integrations" ? null : await
|
|
9752
|
+
const common = service === "integrations" ? null : isCookieTerms ? await readCommonProject(options).then(
|
|
9753
|
+
(context) => context ? { ...context, resourceId: "" } : null
|
|
9754
|
+
) : await commonServiceContext(
|
|
9741
9755
|
options,
|
|
9742
9756
|
service,
|
|
9743
9757
|
values.environment
|
|
@@ -9798,7 +9812,12 @@ async function runServiceCommand(service, options) {
|
|
|
9798
9812
|
const site = common ? `/sites/${encodeURIComponent(common.resourceId)}` : "";
|
|
9799
9813
|
let result;
|
|
9800
9814
|
if (service === "cookie") {
|
|
9801
|
-
if (
|
|
9815
|
+
if (isCookieTerms)
|
|
9816
|
+
result = subaction === "show" ? await request("/terms") : await request("/terms", "POST", {
|
|
9817
|
+
version: values.version,
|
|
9818
|
+
accepted: true
|
|
9819
|
+
});
|
|
9820
|
+
else if (action === "status" && positionals.length === 1)
|
|
9802
9821
|
result = await request(site);
|
|
9803
9822
|
else if (action === "schema") result = await request(`${site}/schema`);
|
|
9804
9823
|
else if (action === "validate") {
|