@atelier201/cli 0.12.0 → 0.13.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/AGENTS.md
CHANGED
|
@@ -182,6 +182,7 @@ atelier201 content list blog
|
|
|
182
182
|
atelier201 history list
|
|
183
183
|
atelier201 builds list
|
|
184
184
|
atelier201 analytics --period 7d # visitor numbers (today, 7d, 30d, 90d, 12m)
|
|
185
|
+
atelier201 analytics --from 2026-10-01 --to 2026-10-31 # or any range of UTC days, up to 366
|
|
185
186
|
```
|
|
186
187
|
|
|
187
188
|
### Changing the draft (free, invisible to visitors)
|
|
@@ -11,15 +11,26 @@ export function registerAnalytics(program) {
|
|
|
11
11
|
addSite(program
|
|
12
12
|
.command("analytics")
|
|
13
13
|
.description("A site's visitor numbers: page views by people, pages, sources, countries and devices. Costs no credits; changes nothing. Visitor figures are null when the owner turned counting off")
|
|
14
|
-
.option("--period <period>", `One of ${PERIODS.join(", ")} (default 30d)`)
|
|
14
|
+
.option("--period <period>", `One of ${PERIODS.join(", ")}, ending today (default 30d)`)
|
|
15
|
+
.option("--from <day>", "First UTC day of a range of your own, YYYY-MM-DD, with --to (at most 366 days)")
|
|
16
|
+
.option("--to <day>", "Last UTC day of the range, YYYY-MM-DD, today at the latest")).action(async (options, command) => {
|
|
15
17
|
await run(command, async (session) => {
|
|
16
18
|
const { siteId } = siteOf(options);
|
|
17
19
|
if (options.period !== undefined && !PERIODS.includes(String(options.period))) {
|
|
18
20
|
throw new CliError(`--period must be one of ${PERIODS.join(", ")}.`, { exitCode: EXIT.USAGE, code: "invalid_parameter", hint: "For example --period 7d." });
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
22
|
+
if ((options.from === undefined) !== (options.to === undefined)) {
|
|
23
|
+
throw new CliError("--from and --to go together.", { exitCode: EXIT.USAGE, code: "invalid_parameter", hint: "For example --from 2026-10-01 --to 2026-10-31." });
|
|
24
|
+
}
|
|
25
|
+
if (options.from !== undefined && options.period !== undefined) {
|
|
26
|
+
throw new CliError("Give either --period, or --from and --to.", { exitCode: EXIT.USAGE, code: "invalid_parameter" });
|
|
27
|
+
}
|
|
28
|
+
const query = {};
|
|
29
|
+
if (options.period !== undefined)
|
|
30
|
+
query.period = String(options.period);
|
|
31
|
+
if (options.from !== undefined)
|
|
32
|
+
Object.assign(query, { from: String(options.from), to: String(options.to) });
|
|
33
|
+
const response = await session.client.request("GET", sitePath(siteId, "/analytics"), { query });
|
|
23
34
|
const result = unwrap(response.body);
|
|
24
35
|
session.printer.data(result, {
|
|
25
36
|
fields: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/commands/analytics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAErD,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO,CACL,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CACV,uLAAuL,CACxL;SACA,MAAM,CAAC,mBAAmB,EAAE,UAAU,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/commands/analytics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO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E,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;oBAC9G,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,UAAU,EAAE;oBAChE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,UAAU,EAAE;iBACrE;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7220,7 +7220,7 @@ export const API_OPERATIONS = [
|
|
|
7220
7220
|
"method": "GET",
|
|
7221
7221
|
"path": "/v1/sites/{site_id}/analytics",
|
|
7222
7222
|
"summary": "Read a site's visitor numbers",
|
|
7223
|
-
"description": "Page views of the live site by people, with pages, sources, countries and devices, over a period. No credits. Visitor figures are null when the owner turned visitor counting off, which only the owner can change, in the dashboard.",
|
|
7223
|
+
"description": "Page views of the live site by people, with pages, sources, countries and devices, over a period (a preset, or from and to). No credits. Visitor figures are null when the owner turned visitor counting off, which only the owner can change, in the dashboard.",
|
|
7224
7224
|
"authentication_required": true,
|
|
7225
7225
|
"scope": "sites:read",
|
|
7226
7226
|
"surfaces": {
|
|
@@ -7242,7 +7242,7 @@ export const API_OPERATIONS = [
|
|
|
7242
7242
|
"in": "query",
|
|
7243
7243
|
"required": false,
|
|
7244
7244
|
"schema": {
|
|
7245
|
-
"description": "today, 7d, 30d, 90d or 12m. Default 30d.",
|
|
7245
|
+
"description": "today, 7d, 30d, 90d or 12m, ending today. Default 30d. Leave it out when you give from and to.",
|
|
7246
7246
|
"type": "string",
|
|
7247
7247
|
"enum": [
|
|
7248
7248
|
"today",
|
|
@@ -7252,6 +7252,26 @@ export const API_OPERATIONS = [
|
|
|
7252
7252
|
"12m"
|
|
7253
7253
|
]
|
|
7254
7254
|
}
|
|
7255
|
+
},
|
|
7256
|
+
{
|
|
7257
|
+
"name": "from",
|
|
7258
|
+
"in": "query",
|
|
7259
|
+
"required": false,
|
|
7260
|
+
"schema": {
|
|
7261
|
+
"description": "First UTC day of a range of your own, YYYY-MM-DD, with to. At most 366 days.",
|
|
7262
|
+
"type": "string",
|
|
7263
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
|
|
7264
|
+
}
|
|
7265
|
+
},
|
|
7266
|
+
{
|
|
7267
|
+
"name": "to",
|
|
7268
|
+
"in": "query",
|
|
7269
|
+
"required": false,
|
|
7270
|
+
"schema": {
|
|
7271
|
+
"description": "Last UTC day of the range, YYYY-MM-DD, today at the latest.",
|
|
7272
|
+
"type": "string",
|
|
7273
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
|
|
7274
|
+
}
|
|
7255
7275
|
}
|
|
7256
7276
|
],
|
|
7257
7277
|
"request_body": null,
|
|
@@ -7274,8 +7294,10 @@ export const API_OPERATIONS = [
|
|
|
7274
7294
|
"7d",
|
|
7275
7295
|
"30d",
|
|
7276
7296
|
"90d",
|
|
7277
|
-
"12m"
|
|
7278
|
-
|
|
7297
|
+
"12m",
|
|
7298
|
+
"custom"
|
|
7299
|
+
],
|
|
7300
|
+
"description": "The preset asked, or custom for a range given by from and to."
|
|
7279
7301
|
},
|
|
7280
7302
|
"from": {
|
|
7281
7303
|
"type": "string",
|