@koda-sl/baker-cli 0.852.0-dev.65f932cdf → 0.852.0-dev.d40dfecc3
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 +5 -1
- package/dist/{accounts-FGWJDM52.js → accounts-5ZMP7KU7.js} +1 -1
- package/dist/{analytics-KA3THH3F.js → analytics-RIZ4RJ6O.js} +4 -4
- package/dist/changes-6UGDHAZW.js +539 -0
- package/dist/changes-6UGDHAZW.js.map +1 -0
- package/dist/{chunk-YL7XIJ43.js → chunk-A6B45KSH.js} +2 -1
- package/dist/{chunk-YL7XIJ43.js.map → chunk-A6B45KSH.js.map} +1 -1
- package/dist/{chunk-EHDZONE6.js → chunk-QSZRATGC.js} +2 -2
- package/dist/{chunk-H3CYVM4E.js → chunk-TWSIY2FS.js} +3 -7
- package/dist/chunk-TWSIY2FS.js.map +1 -0
- package/dist/{chunk-ZWANN4QQ.js → chunk-WYBX53EI.js} +2 -1
- package/dist/cli.js +10 -10
- package/dist/{create-KGRQQ7WA.js → create-NR4WX6PS.js} +3 -3
- package/dist/{delete-XAVEVESN.js → delete-5P6K4EOJ.js} +3 -3
- package/dist/{draft-BO5QGZBG.js → draft-4DFLYVL6.js} +2 -2
- package/dist/{get-H5CUQP7G.js → get-I77O6MRD.js} +3 -3
- package/dist/{history-AGCS2TKY.js → history-DD3UWZZ4.js} +3 -3
- package/dist/{hubspot-NG2KTQDY.js → hubspot-W5LYFWTH.js} +2 -2
- package/dist/{list-DBZ3AGW2.js → list-VQNYW5R4.js} +3 -3
- package/dist/{media-sources-NI6U2YWV.js → media-sources-ZY7S74U2.js} +1 -1
- package/dist/{plan-LVTD6FZI.js → plan-YP5D6JXM.js} +2 -2
- package/dist/{posts-GX6MUVUG.js → posts-B5DGAKAC.js} +1 -1
- package/dist/{read-T7HYDHSS.js → read-OMNUPQ77.js} +2 -2
- package/dist/{run-HCYK5ZAX.js → run-TPAZDCY2.js} +3 -3
- package/dist/{scheduled-agents-YHZUPS2I.js → scheduled-agents-NODIHKKM.js} +11 -11
- package/dist/{schema-NIYT4JHM.js → schema-JCAV2D44.js} +2 -2
- package/dist/{sources-DVNWHBF5.js → sources-G7QWYL2J.js} +4 -10
- package/dist/sources-G7QWYL2J.js.map +1 -0
- package/dist/{tag-manager-SL6FDPER.js → tag-manager-YUUNKP7Q.js} +11 -9
- package/dist/tag-manager-YUUNKP7Q.js.map +1 -0
- package/dist/{targets-5A5SOQJM.js → targets-BVAFNU4K.js} +3 -3
- package/dist/{triggers-PH33IQLK.js → triggers-AALSXPLW.js} +3 -3
- package/dist/{unstage-52VGCJWF.js → unstage-BVNREABR.js} +3 -3
- package/dist/{update-RD27CPMN.js → update-HYZXKLZ7.js} +3 -3
- package/dist/{winning-ads-274QKPKB.js → winning-ads-QRBI3TLN.js} +1 -1
- package/dist/{write-commands-M2CV6P4R.js → write-commands-YECHEWMG.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-H3CYVM4E.js.map +0 -1
- package/dist/sources-DVNWHBF5.js.map +0 -1
- package/dist/tag-manager-SL6FDPER.js.map +0 -1
- /package/dist/{accounts-FGWJDM52.js.map → accounts-5ZMP7KU7.js.map} +0 -0
- /package/dist/{analytics-KA3THH3F.js.map → analytics-RIZ4RJ6O.js.map} +0 -0
- /package/dist/{chunk-EHDZONE6.js.map → chunk-QSZRATGC.js.map} +0 -0
- /package/dist/{chunk-ZWANN4QQ.js.map → chunk-WYBX53EI.js.map} +0 -0
- /package/dist/{create-KGRQQ7WA.js.map → create-NR4WX6PS.js.map} +0 -0
- /package/dist/{delete-XAVEVESN.js.map → delete-5P6K4EOJ.js.map} +0 -0
- /package/dist/{draft-BO5QGZBG.js.map → draft-4DFLYVL6.js.map} +0 -0
- /package/dist/{get-H5CUQP7G.js.map → get-I77O6MRD.js.map} +0 -0
- /package/dist/{history-AGCS2TKY.js.map → history-DD3UWZZ4.js.map} +0 -0
- /package/dist/{hubspot-NG2KTQDY.js.map → hubspot-W5LYFWTH.js.map} +0 -0
- /package/dist/{list-DBZ3AGW2.js.map → list-VQNYW5R4.js.map} +0 -0
- /package/dist/{media-sources-NI6U2YWV.js.map → media-sources-ZY7S74U2.js.map} +0 -0
- /package/dist/{plan-LVTD6FZI.js.map → plan-YP5D6JXM.js.map} +0 -0
- /package/dist/{posts-GX6MUVUG.js.map → posts-B5DGAKAC.js.map} +0 -0
- /package/dist/{read-T7HYDHSS.js.map → read-OMNUPQ77.js.map} +0 -0
- /package/dist/{run-HCYK5ZAX.js.map → run-TPAZDCY2.js.map} +0 -0
- /package/dist/{scheduled-agents-YHZUPS2I.js.map → scheduled-agents-NODIHKKM.js.map} +0 -0
- /package/dist/{schema-NIYT4JHM.js.map → schema-JCAV2D44.js.map} +0 -0
- /package/dist/{targets-5A5SOQJM.js.map → targets-BVAFNU4K.js.map} +0 -0
- /package/dist/{triggers-PH33IQLK.js.map → triggers-AALSXPLW.js.map} +0 -0
- /package/dist/{unstage-52VGCJWF.js.map → unstage-BVNREABR.js.map} +0 -0
- /package/dist/{update-RD27CPMN.js.map → update-HYZXKLZ7.js.map} +0 -0
- /package/dist/{winning-ads-274QKPKB.js.map → winning-ads-QRBI3TLN.js.map} +0 -0
- /package/dist/{write-commands-M2CV6P4R.js.map → write-commands-YECHEWMG.js.map} +0 -0
package/README.md
CHANGED
|
@@ -2158,7 +2158,7 @@ baker analytics sources --create-activecampaign --events subscribe,deal_update
|
|
|
2158
2158
|
|
|
2159
2159
|
**Sources: where events reach Baker from a server.** Measure → Sources is three built-in doors — the Baker landings, the website tag, and **the client's own server** — plus the connections Baker reads (HubSpot today). `--server` prints the server's one address: made once, the same for ever, `counting` at once, Baker's own format (`sending-events` is the contract; `X-Baker-Mode: test` rehearses). A HubSpot event is a trigger in HubSpot's own words, kept by HubSpot's journal each time the property changes and counted within a minute. `--create --name <tool>` still makes an address for a tool that cannot be told what to send — its first send is a masked sample counted as nothing until `--map` confirms the rows — but the dashboard no longer offers those; a tool worth reading is a connection, requested from the Sources page. Each `--field` is a **template**: text with `{{path}}` mentions, one thing per mention (`--field currency=EUR` types a value, `--field first_name="{{who.first}} {{who.last}}"` joins two; there is no `{{a|b}}` fallback); a bare path is read as its mention when the sample has it. From then on every arrival is an ordinary event carrying `baker_source: <name>`, listed by `feed --source <name>`, and `--pause`, `--resume` and `--remove` are by `--source <id>`.
|
|
2160
2160
|
|
|
2161
|
-
**`--preview` then `--create-hubspot --property <name> [--operator <op>] --value <value>… [--name <name>] [--field <field>=<template>…] [--amount-property <n> --currency <c>]`: a HubSpot event.** HubSpot keeps each change to the property for Baker, filtered to the condition — on any plan, nothing to set up in HubSpot, an account of any size — and every contact whose new value satisfies the condition is one event, within a minute, named after the source (default: the trigger's words). The condition is any a Form's filter can say, by the property's kind: `is` / `isNot` (a dropdown, `--value` repeated for several), `contains` / `startsWith` / `endsWith` (text), `greaterThan` / `lessThanOrEqual` … (numbers), `isAfter` / `isBetween` (dates, `YYYY-MM-DD`), `isEmpty` / `isNotEmpty` (any); `--operator` is `is` when unsaid. Names, kinds and operators come from `baker hubspot contacts properties` and row properties from `baker hubspot contacts fields`; `--preview --property … [--operator …] --value … [--
|
|
2161
|
+
**`--preview` then `--create-hubspot --property <name> [--operator <op>] --value <value>… [--name <name>] [--field <field>=<template>…] [--amount-property <n> --currency <c>]`: a HubSpot event.** HubSpot keeps each change to the property for Baker, filtered to the condition — on any plan, nothing to set up in HubSpot, an account of any size — and every contact whose new value satisfies the condition is one event, within a minute, named after the source (default: the trigger's words). The condition is any a Form's filter can say, by the property's kind: `is` / `isNot` (a dropdown, `--value` repeated for several), `contains` / `startsWith` / `endsWith` (text), `greaterThan` / `lessThanOrEqual` … (numbers), `isAfter` / `isBetween` (dates, `YYYY-MM-DD`), `isEmpty` / `isNotEmpty` (any); `--operator` is `is` when unsaid. Names, kinds and operators come from `baker hubspot contacts properties` and row properties from `baker hubspot contacts fields`; `--preview --property … [--operator …] --value … [--field …] [--contact <id or email>]` says how many contacts satisfy it today (NOT counted — only contacts that come to satisfy it from now on are) and returns `preview.record`, the one most recently there or the one asked for, to check every row against before making anything. `--set-trigger --source <id> --property … [--operator …] --value …` changes what an event watches later: the rows stay and `countingSince` moves to now. The connection must be allowed to read contacts, and a refusal names the reconnect. `counting` at once, no URL; the source carries `hubspot { property, propertyLabel, kind, operator, values, valueLabels }`, `countingSince`, `listening` (whether HubSpot has been told to keep its changes: `listening`, `not_configured` or `failed`, with a `detail`), `lastError` and `mapping` — the same field → template table as an address, over the contact's properties plus `{{id}}`, defaulting to HubSpot's standard ones (email, phone, the contact id, name, address, `hs_google_click_id`, `hs_facebook_click_id`); a `--field` row at creation replaces the default it names, `--map --field` replaces the whole set later, and `--amount-property … --currency …` is the short spelling for the `value` and `currency` rows. `--field properties.<name>=<template>` adds an extra property of the event (`--field properties.plan={{plan_tier}}`): it breaks the event down on Measure → Events and a send reads it back as `{{properties.<name>}}`. A deal is watched the same way with `--object deal`, and a lead with `--object lead` (`baker hubspot leads properties|fields`) — where HubSpot records qualification and disqualification as the lead's stage. A deal's or a lead's event is about its contacts (`--contacts every|first`), read as `{{contact.<name>}}`; a lead has no amount. Leads need Sales Hub Professional or Enterprise. Where the event is sent on (Meta, Google Ads…) is `sends`, edited on the event's own card on the Sources page.
|
|
2162
2162
|
|
|
2163
2163
|
Shared flags: `--days <n>` (default 30) or `--start-date` / `--end-date` (`YYYY-MM-DD`, end inclusive); `--full`; `--compare` to also return the preceding window of the same length; `--timezone <IANA>` and `--granularity hour|day|week|month` to shape a series. Every call reads live — there is no cache layer, so there is nothing to bypass.
|
|
2164
2164
|
|
|
@@ -5534,6 +5534,10 @@ Lists the company's selected Tag Manager containers that the connected Google ac
|
|
|
5534
5534
|
|
|
5535
5535
|
Reads a container's tags, triggers, variables, folders and built-ins. Compact tags name the triggers they fire on (`firesOn`, `blockedBy`, built-ins such as All Pages included), and `measures` maps each vendor id the tags send to (`meta:<pixel id>`, `googleAnalytics:G-…`, `googleAds:AW-…`, `hubspot:<id>`) to the tag ids sending there; trigger ids, `path` and `fingerprint` come only with `--full`. `--search` keeps the entities that mention the text in their name, type, parameters (Custom HTML included) or trigger conditions; `--id 24,126` keeps those ids. A narrowed read also gives each Custom HTML tag its script URLs (`src`). Both are applied by Baker before `--full` expands what is left.
|
|
5536
5536
|
|
|
5537
|
+
### `baker tag-manager changes [--since YYYY-MM-DD | --days N] [--container <id>]`
|
|
5538
|
+
|
|
5539
|
+
What changed in a container since a date (default the last 7 days): every tag, trigger, variable, folder and template created, modified or deleted and every built-in variable switched on or off, with when it was saved and the container version that carried it, plus changes saved in any workspace and not yet in a version (`pending`, with its `workspace`). Built from the container's versions, archived ones included, compared newest first — at most 8 per read; when the window holds more, `completeSince` says how far back the answer is complete, and `unreadVersions` names archived versions Tag Manager would not return. A version's date moves when it is renamed, so each carries `cutAfter` and `savedAt`, and `mayPredateSince` marks one that may be older than the window.
|
|
5540
|
+
|
|
5537
5541
|
### `baker knowledge search "<question>" [-c <collection>] [-n 5] [--full]`
|
|
5538
5542
|
|
|
5539
5543
|
Answers a question from the Knowledge vault: qmd (installed in the sandbox) finds up to 40 candidate passages without its CPU reranker, and Baker ranks them with the same hosted reranker as the media library searches (`POST /api/knowledge/rank`). Returns `file`, `title`, `line`, `score` (0-1) and a 300-character `snippet` per hit, best first; `--full` adds the passage text. When the ranking model does not answer, the hits come back in qmd's own order with `meta.rankedBy: "qmd"` and a hint. Needs `qmd` on `PATH`; about 10 seconds.
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-HORX3JLB.js";
|
|
39
39
|
import {
|
|
40
40
|
TAG_MANAGER_TIMEOUT_MS
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WYBX53EI.js";
|
|
42
42
|
import {
|
|
43
43
|
analyticsErrorEnvelope
|
|
44
44
|
} from "./chunk-STWMK24H.js";
|
|
@@ -2769,11 +2769,11 @@ Full guide: __tooling__/docs/tools/baker/analytics.md`
|
|
|
2769
2769
|
tracking: trackingCommand,
|
|
2770
2770
|
arrivals: arrivalsCommand,
|
|
2771
2771
|
"sending-events": sendingEventsCommand,
|
|
2772
|
-
sources: () => import("./sources-
|
|
2772
|
+
sources: () => import("./sources-G7QWYL2J.js").then((m) => m.sourcesCommand),
|
|
2773
2773
|
"website-tag": websiteTagCommand,
|
|
2774
2774
|
debug: debugCommand,
|
|
2775
2775
|
sites: sitesCommand,
|
|
2776
|
-
plan: () => import("./plan-
|
|
2776
|
+
plan: () => import("./plan-YP5D6JXM.js").then((m) => m.planCommand),
|
|
2777
2777
|
questionnaire: () => import("./questionnaire-7Y4QYVC6.js").then((m) => m.questionnaireCommand),
|
|
2778
2778
|
presets: presetsCommand
|
|
2779
2779
|
}
|
|
@@ -2788,4 +2788,4 @@ export {
|
|
|
2788
2788
|
requestBody,
|
|
2789
2789
|
sendingEventsAddress
|
|
2790
2790
|
};
|
|
2791
|
-
//# sourceMappingURL=analytics-
|
|
2791
|
+
//# sourceMappingURL=analytics-RIZ4RJ6O.js.map
|
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TAG_MANAGER_TIMEOUT_MS,
|
|
3
|
+
failValidation,
|
|
4
|
+
handleError
|
|
5
|
+
} from "./chunk-WYBX53EI.js";
|
|
6
|
+
import "./chunk-QB72UFAO.js";
|
|
7
|
+
import "./chunk-D5FY4FAK.js";
|
|
8
|
+
import {
|
|
9
|
+
writeJsonEnvelope
|
|
10
|
+
} from "./chunk-65QWF5C5.js";
|
|
11
|
+
import {
|
|
12
|
+
apiPost
|
|
13
|
+
} from "./chunk-SZCEKDLE.js";
|
|
14
|
+
import "./chunk-2UFHCU7A.js";
|
|
15
|
+
import "./chunk-XQIAWIO5.js";
|
|
16
|
+
import {
|
|
17
|
+
registerSchema
|
|
18
|
+
} from "./chunk-2TEZDAAR.js";
|
|
19
|
+
import "./chunk-YQSBHWOI.js";
|
|
20
|
+
|
|
21
|
+
// ../api/src/tag-manager/ops.ts
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
var tagManagerEntitySchema = z.enum([
|
|
24
|
+
"tag",
|
|
25
|
+
"trigger",
|
|
26
|
+
"variable",
|
|
27
|
+
"folder",
|
|
28
|
+
"builtInVariable",
|
|
29
|
+
"containerSettings"
|
|
30
|
+
]);
|
|
31
|
+
var tagManagerDraftOpKindSchema = z.enum([
|
|
32
|
+
"tagManager.tag.create",
|
|
33
|
+
"tagManager.tag.update",
|
|
34
|
+
"tagManager.tag.delete",
|
|
35
|
+
"tagManager.trigger.create",
|
|
36
|
+
"tagManager.trigger.update",
|
|
37
|
+
"tagManager.trigger.delete",
|
|
38
|
+
"tagManager.variable.create",
|
|
39
|
+
"tagManager.variable.update",
|
|
40
|
+
"tagManager.variable.delete",
|
|
41
|
+
"tagManager.folder.create",
|
|
42
|
+
"tagManager.folder.update",
|
|
43
|
+
"tagManager.folder.delete",
|
|
44
|
+
"tagManager.builtInVariable.enable",
|
|
45
|
+
"tagManager.builtInVariable.disable",
|
|
46
|
+
"tagManager.containerSettings.update"
|
|
47
|
+
]);
|
|
48
|
+
var tagManagerParameterSchema = z.lazy(
|
|
49
|
+
() => z.object({
|
|
50
|
+
key: z.string().optional(),
|
|
51
|
+
type: z.enum(["template", "boolean", "integer", "list", "map", "triggerReference", "tagReference"]),
|
|
52
|
+
value: z.string().optional(),
|
|
53
|
+
list: z.array(tagManagerParameterSchema).optional(),
|
|
54
|
+
map: z.array(tagManagerParameterSchema).optional()
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
var conditionSchema = z.object({
|
|
58
|
+
type: z.string(),
|
|
59
|
+
parameter: z.array(tagManagerParameterSchema).optional()
|
|
60
|
+
});
|
|
61
|
+
var tagSequencingSchema = z.object({
|
|
62
|
+
tagName: z.string().min(1),
|
|
63
|
+
tagId: z.string().optional(),
|
|
64
|
+
stopOnSetupFailure: z.boolean().optional(),
|
|
65
|
+
stopTeardownOnFailure: z.boolean().optional()
|
|
66
|
+
});
|
|
67
|
+
var tagPayloadSchema = z.object({
|
|
68
|
+
name: z.string().min(1),
|
|
69
|
+
type: z.string().min(1),
|
|
70
|
+
parameter: z.array(tagManagerParameterSchema).optional(),
|
|
71
|
+
/** Staged trigger refs or live numeric trigger ids. */
|
|
72
|
+
firingTriggerId: z.array(z.string()).optional(),
|
|
73
|
+
blockingTriggerId: z.array(z.string()).optional(),
|
|
74
|
+
parentFolderId: z.string().optional(),
|
|
75
|
+
notes: z.string().optional(),
|
|
76
|
+
paused: z.boolean().optional(),
|
|
77
|
+
// Declared because the one value that reads naturally, "oncePerPage", is not one of them.
|
|
78
|
+
tagFiringOption: z.enum(["tagFiringOptionUnspecified", "unlimited", "oncePerEvent", "oncePerLoad"], {
|
|
79
|
+
error: "tagFiringOption is one of unlimited, oncePerEvent or oncePerLoad (once per page)."
|
|
80
|
+
}).optional(),
|
|
81
|
+
// GTM stores priority as a Parameter (`{type:"integer",key:"priority",value:"5"}`),
|
|
82
|
+
// not a bare number. Typing it `z.number()` rejected the correct shape at stage
|
|
83
|
+
// time and let the wrong one through to fail at publish.
|
|
84
|
+
priority: tagManagerParameterSchema.optional(),
|
|
85
|
+
monitoringMetadata: z.record(z.string(), z.unknown()).optional(),
|
|
86
|
+
consentSettings: z.record(z.string(), z.unknown()).optional(),
|
|
87
|
+
setupTag: z.array(tagSequencingSchema).optional(),
|
|
88
|
+
teardownTag: z.array(tagSequencingSchema).optional(),
|
|
89
|
+
scheduleStartMs: z.number().optional(),
|
|
90
|
+
scheduleEndMs: z.number().optional(),
|
|
91
|
+
firingRuleId: z.array(z.string()).optional(),
|
|
92
|
+
blockingRuleId: z.array(z.string()).optional()
|
|
93
|
+
}).passthrough();
|
|
94
|
+
var triggerPayloadSchema = z.object({
|
|
95
|
+
name: z.string().min(1),
|
|
96
|
+
type: z.string().min(1),
|
|
97
|
+
parameter: z.array(tagManagerParameterSchema).optional(),
|
|
98
|
+
filter: z.array(conditionSchema).optional(),
|
|
99
|
+
customEventFilter: z.array(conditionSchema).optional(),
|
|
100
|
+
autoEventFilter: z.array(conditionSchema).optional(),
|
|
101
|
+
waitForTags: tagManagerParameterSchema.optional(),
|
|
102
|
+
checkValidation: tagManagerParameterSchema.optional(),
|
|
103
|
+
waitForTagsTimeout: tagManagerParameterSchema.optional(),
|
|
104
|
+
eventName: tagManagerParameterSchema.optional(),
|
|
105
|
+
// A trigger's own configuration lives in top-level Parameter fields, not in
|
|
106
|
+
// `parameter[]` — a scroll trigger without these is a trigger with no threshold.
|
|
107
|
+
verticalScrollPercentageList: tagManagerParameterSchema.optional(),
|
|
108
|
+
horizontalScrollPercentageList: tagManagerParameterSchema.optional(),
|
|
109
|
+
visibilitySelector: tagManagerParameterSchema.optional(),
|
|
110
|
+
visiblePercentageMin: tagManagerParameterSchema.optional(),
|
|
111
|
+
visiblePercentageMax: tagManagerParameterSchema.optional(),
|
|
112
|
+
continuousTimeMinMilliseconds: tagManagerParameterSchema.optional(),
|
|
113
|
+
totalVisibleTimeMinMilliseconds: tagManagerParameterSchema.optional(),
|
|
114
|
+
interval: tagManagerParameterSchema.optional(),
|
|
115
|
+
intervalSeconds: tagManagerParameterSchema.optional(),
|
|
116
|
+
limit: tagManagerParameterSchema.optional(),
|
|
117
|
+
maxTimerLengthSeconds: tagManagerParameterSchema.optional(),
|
|
118
|
+
selector: tagManagerParameterSchema.optional(),
|
|
119
|
+
parentFolderId: z.string().optional(),
|
|
120
|
+
notes: z.string().optional()
|
|
121
|
+
}).passthrough();
|
|
122
|
+
var variablePayloadSchema = z.object({
|
|
123
|
+
name: z.string().min(1),
|
|
124
|
+
type: z.string().min(1),
|
|
125
|
+
parameter: z.array(tagManagerParameterSchema).optional(),
|
|
126
|
+
parentFolderId: z.string().optional(),
|
|
127
|
+
notes: z.string().optional(),
|
|
128
|
+
formatValue: z.record(z.string(), z.unknown()).optional(),
|
|
129
|
+
disablingTriggerId: z.array(z.string()).optional(),
|
|
130
|
+
enablingTriggerId: z.array(z.string()).optional()
|
|
131
|
+
}).passthrough();
|
|
132
|
+
var folderPayloadSchema = z.object({
|
|
133
|
+
name: z.string().min(1),
|
|
134
|
+
notes: z.string().optional()
|
|
135
|
+
}).passthrough();
|
|
136
|
+
var builtInVariablePayloadSchema = z.object({
|
|
137
|
+
type: z.array(z.string().min(1)).min(1)
|
|
138
|
+
});
|
|
139
|
+
var containerSettingsPayloadSchema = z.object({
|
|
140
|
+
name: z.string().min(1).optional(),
|
|
141
|
+
notes: z.string().optional(),
|
|
142
|
+
domainName: z.array(z.string()).optional(),
|
|
143
|
+
usageContext: z.array(z.string()).optional()
|
|
144
|
+
}).passthrough();
|
|
145
|
+
var baseOpFields = {
|
|
146
|
+
/**
|
|
147
|
+
* Numeric GTM container id. Optional only when the company connected exactly
|
|
148
|
+
* one container; with several, omitting it is refused rather than guessed.
|
|
149
|
+
*/
|
|
150
|
+
containerId: z.string().optional(),
|
|
151
|
+
/** Stable ref for this op. Creates default to a generated `gtm_temp_*`. */
|
|
152
|
+
ref: z.string().optional(),
|
|
153
|
+
/** Staged refs this op consumes. Validated against the refs found in the payload. */
|
|
154
|
+
dependsOn: z.array(z.string()).optional(),
|
|
155
|
+
notes: z.string().optional()
|
|
156
|
+
};
|
|
157
|
+
var tagManagerDraftOpInputSchema = z.discriminatedUnion("kind", [
|
|
158
|
+
z.object({ kind: z.literal("tagManager.tag.create"), payload: tagPayloadSchema, ...baseOpFields }),
|
|
159
|
+
z.object({
|
|
160
|
+
kind: z.literal("tagManager.tag.update"),
|
|
161
|
+
target: z.string().min(1),
|
|
162
|
+
payload: tagPayloadSchema.partial(),
|
|
163
|
+
...baseOpFields
|
|
164
|
+
}),
|
|
165
|
+
z.object({ kind: z.literal("tagManager.tag.delete"), target: z.string().min(1), ...baseOpFields }),
|
|
166
|
+
z.object({ kind: z.literal("tagManager.trigger.create"), payload: triggerPayloadSchema, ...baseOpFields }),
|
|
167
|
+
z.object({
|
|
168
|
+
kind: z.literal("tagManager.trigger.update"),
|
|
169
|
+
target: z.string().min(1),
|
|
170
|
+
payload: triggerPayloadSchema.partial(),
|
|
171
|
+
...baseOpFields
|
|
172
|
+
}),
|
|
173
|
+
z.object({ kind: z.literal("tagManager.trigger.delete"), target: z.string().min(1), ...baseOpFields }),
|
|
174
|
+
z.object({ kind: z.literal("tagManager.variable.create"), payload: variablePayloadSchema, ...baseOpFields }),
|
|
175
|
+
z.object({
|
|
176
|
+
kind: z.literal("tagManager.variable.update"),
|
|
177
|
+
target: z.string().min(1),
|
|
178
|
+
payload: variablePayloadSchema.partial(),
|
|
179
|
+
...baseOpFields
|
|
180
|
+
}),
|
|
181
|
+
z.object({ kind: z.literal("tagManager.variable.delete"), target: z.string().min(1), ...baseOpFields }),
|
|
182
|
+
z.object({ kind: z.literal("tagManager.folder.create"), payload: folderPayloadSchema, ...baseOpFields }),
|
|
183
|
+
z.object({
|
|
184
|
+
kind: z.literal("tagManager.folder.update"),
|
|
185
|
+
target: z.string().min(1),
|
|
186
|
+
payload: folderPayloadSchema.partial(),
|
|
187
|
+
...baseOpFields
|
|
188
|
+
}),
|
|
189
|
+
z.object({ kind: z.literal("tagManager.folder.delete"), target: z.string().min(1), ...baseOpFields }),
|
|
190
|
+
z.object({
|
|
191
|
+
kind: z.literal("tagManager.builtInVariable.enable"),
|
|
192
|
+
payload: builtInVariablePayloadSchema,
|
|
193
|
+
...baseOpFields
|
|
194
|
+
}),
|
|
195
|
+
z.object({
|
|
196
|
+
kind: z.literal("tagManager.builtInVariable.disable"),
|
|
197
|
+
payload: builtInVariablePayloadSchema,
|
|
198
|
+
...baseOpFields
|
|
199
|
+
}),
|
|
200
|
+
z.object({
|
|
201
|
+
kind: z.literal("tagManager.containerSettings.update"),
|
|
202
|
+
payload: containerSettingsPayloadSchema,
|
|
203
|
+
...baseOpFields
|
|
204
|
+
})
|
|
205
|
+
]);
|
|
206
|
+
|
|
207
|
+
// ../api/src/tag-manager/wire.ts
|
|
208
|
+
import { z as z2 } from "zod";
|
|
209
|
+
var tagManagerDraftOpResultSchema = z2.object({
|
|
210
|
+
status: z2.enum(["applied", "failed", "skipped"]),
|
|
211
|
+
path: z2.string().optional(),
|
|
212
|
+
entityId: z2.string().optional(),
|
|
213
|
+
name: z2.string().optional(),
|
|
214
|
+
fingerprint: z2.string().optional(),
|
|
215
|
+
error: z2.string().optional(),
|
|
216
|
+
skippedBecause: z2.string().optional(),
|
|
217
|
+
executedAt: z2.number().optional()
|
|
218
|
+
});
|
|
219
|
+
var tagManagerContainerSchema = z2.object({
|
|
220
|
+
accountId: z2.string(),
|
|
221
|
+
containerId: z2.string(),
|
|
222
|
+
/** The `GTM-XXXXXX` id used by the on-page snippet. */
|
|
223
|
+
publicId: z2.string(),
|
|
224
|
+
name: z2.string(),
|
|
225
|
+
path: z2.string(),
|
|
226
|
+
usageContext: z2.array(z2.string()).optional(),
|
|
227
|
+
/** True when this container is one of those selected on the company's connection. */
|
|
228
|
+
connected: z2.boolean().optional()
|
|
229
|
+
});
|
|
230
|
+
var tagManagerContainersResponseSchema = z2.object({
|
|
231
|
+
containers: z2.array(tagManagerContainerSchema),
|
|
232
|
+
unavailableContainers: z2.array(z2.object({ containerId: z2.string(), publicId: z2.string(), name: z2.string() })).optional()
|
|
233
|
+
});
|
|
234
|
+
var tagManagerEntitySummarySchema = z2.object({
|
|
235
|
+
/** Present only with `--full`: in a compact read the collection already says what it is. */
|
|
236
|
+
entity: tagManagerEntitySchema.optional(),
|
|
237
|
+
entityId: z2.string(),
|
|
238
|
+
name: z2.string(),
|
|
239
|
+
type: z2.string().optional(),
|
|
240
|
+
/** Present only with `--full`, like `fingerprint`: where the entity lives, not what it does. */
|
|
241
|
+
path: z2.string().optional(),
|
|
242
|
+
parentFolderId: z2.string().optional(),
|
|
243
|
+
/** Tags only, `--full` only: the numeric trigger ids that fire and block this tag. */
|
|
244
|
+
firingTriggerId: z2.array(z2.string()).optional(),
|
|
245
|
+
/**
|
|
246
|
+
* Tags only: the names of the triggers that fire it, built-ins named ("All Pages").
|
|
247
|
+
* Absent when the read did not include the container's triggers (`--full` without `trigger`).
|
|
248
|
+
*/
|
|
249
|
+
firesOn: z2.array(z2.string()).optional(),
|
|
250
|
+
blockingTriggerId: z2.array(z2.string()).optional(),
|
|
251
|
+
blockedBy: z2.array(z2.string()).optional(),
|
|
252
|
+
/** Custom HTML tags, in a read narrowed by `--search` or `--id`: the script URLs it loads (at most 3). */
|
|
253
|
+
src: z2.array(z2.string()).optional(),
|
|
254
|
+
paused: z2.boolean().optional(),
|
|
255
|
+
/** Triggers only: what the trigger fires on, one readable line per condition. */
|
|
256
|
+
conditions: z2.array(z2.string()).optional(),
|
|
257
|
+
notes: z2.string().optional(),
|
|
258
|
+
fingerprint: z2.string().optional(),
|
|
259
|
+
/** Present only with `--full`: the raw GTM entity. */
|
|
260
|
+
raw: z2.unknown().optional()
|
|
261
|
+
});
|
|
262
|
+
var tagManagerReadRequestSchema = z2.object({
|
|
263
|
+
containerId: z2.string().optional(),
|
|
264
|
+
workspaceId: z2.string().optional(),
|
|
265
|
+
entities: z2.array(tagManagerEntitySchema).optional(),
|
|
266
|
+
full: z2.boolean().optional(),
|
|
267
|
+
/** Only the entities with these ids. */
|
|
268
|
+
ids: z2.array(z2.string().min(1)).min(1).optional(),
|
|
269
|
+
/** Only the entities that mention this text: name, type, parameters (Custom HTML included), trigger conditions. */
|
|
270
|
+
search: z2.string().min(1).optional(),
|
|
271
|
+
skipCache: z2.boolean().optional()
|
|
272
|
+
});
|
|
273
|
+
var tagManagerReadResponseSchema = z2.object({
|
|
274
|
+
container: tagManagerContainerSchema,
|
|
275
|
+
workspaceId: z2.string(),
|
|
276
|
+
workspaceName: z2.string().optional(),
|
|
277
|
+
tags: z2.array(tagManagerEntitySummarySchema),
|
|
278
|
+
triggers: z2.array(tagManagerEntitySummarySchema),
|
|
279
|
+
variables: z2.array(tagManagerEntitySummarySchema),
|
|
280
|
+
folders: z2.array(tagManagerEntitySummarySchema),
|
|
281
|
+
builtInVariables: z2.array(tagManagerEntitySummarySchema),
|
|
282
|
+
/**
|
|
283
|
+
* Where the tags read send, and which tags send there: `{ "meta:<pixel id>": ["30"], "googleAnalytics:G-…": […] }`.
|
|
284
|
+
* Constant variables resolved. Absent when no tag sends anywhere, or the variables were not read (`--full` without `variable`).
|
|
285
|
+
*/
|
|
286
|
+
measures: z2.record(z2.string(), z2.array(z2.string())).optional(),
|
|
287
|
+
/** Set when the connected container differs from the GTM tag installed on the site. */
|
|
288
|
+
installedContainerMismatch: z2.string().optional(),
|
|
289
|
+
/** Full reads also check pending edits before preparing a publication. */
|
|
290
|
+
publicationWarning: z2.string().optional()
|
|
291
|
+
});
|
|
292
|
+
var TAG_MANAGER_CHANGES_DEFAULT_DAYS = 7;
|
|
293
|
+
var TAG_MANAGER_CHANGES_MAX_DAYS = 365;
|
|
294
|
+
var tagManagerChangesRequestSchema = z2.object({
|
|
295
|
+
containerId: z2.string().optional(),
|
|
296
|
+
/** First day of the window, `YYYY-MM-DD`, read in UTC. Wins over `days`. */
|
|
297
|
+
since: z2.iso.date("since must be a real date like 2026-09-21").optional(),
|
|
298
|
+
days: z2.number().int().min(1).max(TAG_MANAGER_CHANGES_MAX_DAYS).optional()
|
|
299
|
+
});
|
|
300
|
+
var tagManagerChangeSchema = z2.object({
|
|
301
|
+
entity: z2.enum(["tag", "trigger", "variable", "builtInVariable", "folder", "template"]),
|
|
302
|
+
/** A built-in variable's id is its type (`clickUrl`): it is switched on (`created`) or off (`deleted`), never edited. */
|
|
303
|
+
entityId: z2.string(),
|
|
304
|
+
name: z2.string(),
|
|
305
|
+
type: z2.string().optional(),
|
|
306
|
+
change: z2.enum(["created", "modified", "deleted"]),
|
|
307
|
+
/** When the entity was last saved, from its Tag Manager fingerprint. Absent on a deletion, which Tag Manager does not date. */
|
|
308
|
+
at: z2.string().optional(),
|
|
309
|
+
/** The container version that first carried the change. Absent on a pending change. */
|
|
310
|
+
versionId: z2.string().optional(),
|
|
311
|
+
/** Saved in a workspace and not yet in any version: waiting to go live. */
|
|
312
|
+
pending: z2.literal(true).optional(),
|
|
313
|
+
/** The workspace a pending change is saved in. */
|
|
314
|
+
workspace: z2.string().optional(),
|
|
315
|
+
/** Carried by a version that may have been cut before `since` (see `versions[].mayPredateSince`). */
|
|
316
|
+
mayPredateSince: z2.literal(true).optional()
|
|
317
|
+
});
|
|
318
|
+
var tagManagerChangesResponseSchema = z2.object({
|
|
319
|
+
container: tagManagerContainerSchema,
|
|
320
|
+
/** The window's start, ISO. */
|
|
321
|
+
since: z2.string(),
|
|
322
|
+
/**
|
|
323
|
+
* Versions saved inside the window, newest first; `live` marks the one the site runs. Tag Manager dates a
|
|
324
|
+
* version only by its last save, which moves when it is renamed or its notes are edited, so it was cut
|
|
325
|
+
* between `cutAfter` (the newest save of anything in it, or of an earlier version) and `savedAt`.
|
|
326
|
+
* `mayPredateSince` marks one that may have been cut before `since` and only edited since.
|
|
327
|
+
* `archived` marks one deleted from the Versions list in Tag Manager.
|
|
328
|
+
*/
|
|
329
|
+
versions: z2.array(
|
|
330
|
+
z2.object({
|
|
331
|
+
versionId: z2.string(),
|
|
332
|
+
name: z2.string(),
|
|
333
|
+
savedAt: z2.string(),
|
|
334
|
+
cutAfter: z2.string().optional(),
|
|
335
|
+
live: z2.literal(true).optional(),
|
|
336
|
+
archived: z2.literal(true).optional(),
|
|
337
|
+
mayPredateSince: z2.literal(true).optional()
|
|
338
|
+
})
|
|
339
|
+
),
|
|
340
|
+
/** Newest first; pending workspace changes lead. */
|
|
341
|
+
changes: z2.array(tagManagerChangeSchema),
|
|
342
|
+
/**
|
|
343
|
+
* Set when more versions were cut in the window than one read compares: changes are complete back to
|
|
344
|
+
* this time (ISO) only, and older ones in the window are not shown.
|
|
345
|
+
*/
|
|
346
|
+
completeSince: z2.string().optional(),
|
|
347
|
+
/**
|
|
348
|
+
* Archived versions in the window Tag Manager would not return: what was changed and undone across them
|
|
349
|
+
* is not shown, so the changes are incomplete.
|
|
350
|
+
*/
|
|
351
|
+
unreadVersions: z2.array(z2.string()).optional()
|
|
352
|
+
});
|
|
353
|
+
var tagManagerDraftStageRequestSchema = z2.object({
|
|
354
|
+
chatId: z2.string(),
|
|
355
|
+
op: tagManagerDraftOpInputSchema
|
|
356
|
+
});
|
|
357
|
+
var tagManagerDraftStageResponseSchema = z2.object({
|
|
358
|
+
staged: z2.literal(true),
|
|
359
|
+
ref: z2.string(),
|
|
360
|
+
kind: tagManagerDraftOpKindSchema,
|
|
361
|
+
dependsOn: z2.array(z2.string()),
|
|
362
|
+
summary: z2.string(),
|
|
363
|
+
warnings: z2.array(z2.string()),
|
|
364
|
+
amended: z2.boolean().optional(),
|
|
365
|
+
/** Other chats whose staged or since-published changes touch the same entities. Advisory. */
|
|
366
|
+
hints: z2.array(z2.string()).optional()
|
|
367
|
+
});
|
|
368
|
+
var TAG_MANAGER_DRAFT_BATCH_MAX = 200;
|
|
369
|
+
var tagManagerDraftStageBatchRequestSchema = z2.object({
|
|
370
|
+
chatId: z2.string(),
|
|
371
|
+
ops: z2.array(tagManagerDraftOpInputSchema).min(1).max(TAG_MANAGER_DRAFT_BATCH_MAX)
|
|
372
|
+
});
|
|
373
|
+
var tagManagerDraftStageBatchResponseSchema = z2.object({
|
|
374
|
+
staged: z2.literal(true),
|
|
375
|
+
count: z2.number(),
|
|
376
|
+
ops: z2.array(
|
|
377
|
+
z2.object({
|
|
378
|
+
ref: z2.string(),
|
|
379
|
+
kind: tagManagerDraftOpKindSchema,
|
|
380
|
+
dependsOn: z2.array(z2.string()),
|
|
381
|
+
summary: z2.string(),
|
|
382
|
+
warnings: z2.array(z2.string())
|
|
383
|
+
})
|
|
384
|
+
),
|
|
385
|
+
/** Other chats whose staged or since-published changes touch the same entities. Advisory. */
|
|
386
|
+
hints: z2.array(z2.string()).optional()
|
|
387
|
+
});
|
|
388
|
+
var tagManagerDraftOpViewSchema = z2.object({
|
|
389
|
+
ref: z2.string(),
|
|
390
|
+
kind: tagManagerDraftOpKindSchema,
|
|
391
|
+
entity: tagManagerEntitySchema,
|
|
392
|
+
containerId: z2.string(),
|
|
393
|
+
target: z2.string().optional(),
|
|
394
|
+
dependsOn: z2.array(z2.string()),
|
|
395
|
+
summary: z2.string(),
|
|
396
|
+
warnings: z2.array(z2.string()).optional(),
|
|
397
|
+
stagedAt: z2.number(),
|
|
398
|
+
result: tagManagerDraftOpResultSchema.optional()
|
|
399
|
+
});
|
|
400
|
+
var tagManagerDraftOpDetailSchema = tagManagerDraftOpViewSchema.extend({
|
|
401
|
+
payload: z2.unknown().optional(),
|
|
402
|
+
annotations: z2.unknown().optional()
|
|
403
|
+
});
|
|
404
|
+
var tagManagerDraftListRequestSchema = z2.object({
|
|
405
|
+
chatId: z2.string(),
|
|
406
|
+
/** Every op as `draft show` prints it, payload included — one call instead of a show per op. */
|
|
407
|
+
full: z2.boolean().optional()
|
|
408
|
+
});
|
|
409
|
+
var tagManagerDraftListResponseSchema = z2.object({
|
|
410
|
+
status: z2.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
411
|
+
count: z2.number(),
|
|
412
|
+
/** Payload and annotations only when the request asked for `full`. */
|
|
413
|
+
ops: z2.array(tagManagerDraftOpDetailSchema),
|
|
414
|
+
/** Set once a publish has run: the container version the ops were cut into. */
|
|
415
|
+
versionId: z2.string().optional(),
|
|
416
|
+
/** Whether that version was published to the live container, or is waiting for a human. */
|
|
417
|
+
published: z2.boolean().optional(),
|
|
418
|
+
compilerError: z2.string().optional(),
|
|
419
|
+
/** Other chats whose staged or since-published changes touch the same entities. Advisory. */
|
|
420
|
+
hints: z2.array(z2.string()).optional()
|
|
421
|
+
});
|
|
422
|
+
var tagManagerDraftShowRequestSchema = z2.object({ chatId: z2.string(), ref: z2.string() });
|
|
423
|
+
var tagManagerDraftShowResponseSchema = z2.object({
|
|
424
|
+
hints: z2.array(z2.string()).optional(),
|
|
425
|
+
op: tagManagerDraftOpDetailSchema
|
|
426
|
+
});
|
|
427
|
+
var tagManagerDraftAmendRequestSchema = z2.object({
|
|
428
|
+
chatId: z2.string(),
|
|
429
|
+
ref: z2.string(),
|
|
430
|
+
patch: z2.record(z2.string(), z2.unknown())
|
|
431
|
+
});
|
|
432
|
+
var tagManagerDraftRemoveRequestSchema = z2.object({ chatId: z2.string(), ref: z2.string() });
|
|
433
|
+
var tagManagerDraftRemoveResponseSchema = z2.object({
|
|
434
|
+
/** The requested ref plus any dependents removed by cascade. */
|
|
435
|
+
removed: z2.array(z2.string())
|
|
436
|
+
});
|
|
437
|
+
var tagManagerDraftClearRequestSchema = z2.object({ chatId: z2.string() });
|
|
438
|
+
var tagManagerDraftClearResponseSchema = z2.object({ cleared: z2.number() });
|
|
439
|
+
|
|
440
|
+
// src/commands/tag-manager/changes.ts
|
|
441
|
+
import { defineCommand } from "citty";
|
|
442
|
+
var ARGS = {
|
|
443
|
+
container: {
|
|
444
|
+
type: "string",
|
|
445
|
+
description: "Numeric container id (optional only when one container is connected)",
|
|
446
|
+
required: false
|
|
447
|
+
},
|
|
448
|
+
since: {
|
|
449
|
+
type: "string",
|
|
450
|
+
description: "First day to include, YYYY-MM-DD (UTC), e.g. the date of the last review. Wins over --days.",
|
|
451
|
+
required: false
|
|
452
|
+
},
|
|
453
|
+
days: {
|
|
454
|
+
type: "string",
|
|
455
|
+
description: `Look back this many days instead (default ${TAG_MANAGER_CHANGES_DEFAULT_DAYS}, max ${TAG_MANAGER_CHANGES_MAX_DAYS})`,
|
|
456
|
+
required: false
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
registerSchema({
|
|
460
|
+
command: "tagManager.changes",
|
|
461
|
+
routes: ["POST /api/tag-manager/changes"],
|
|
462
|
+
effect: "read_live",
|
|
463
|
+
description: "What changed in a Tag Manager container since a date: every tag, trigger, variable, folder and template created, modified or deleted and every built-in variable switched on or off, with when it was saved and the container version that carried it (live marks the version the site runs, archived one deleted from the Versions list), plus changes saved in any workspace and still waiting to go live (pending, with the workspace). Start here for 'what changed since last week' or 'someone changed GTM' \u2014 never diff two `read --full` dumps. Then `read --id <ids>` for what a changed entity holds now.",
|
|
464
|
+
args: ARGS
|
|
465
|
+
});
|
|
466
|
+
function changesHints(data) {
|
|
467
|
+
const hints = [];
|
|
468
|
+
if (data.completeSince) {
|
|
469
|
+
hints.push(
|
|
470
|
+
`More versions were cut since ${data.since.slice(0, 10)} than one read compares (the newest ones): changes are complete back to ${data.completeSince} only, and older ones are NOT shown. Do not conclude nothing changed before then; if they matter, say so and point the user to Versions in Tag Manager.`
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
if (data.unreadVersions?.length) {
|
|
474
|
+
hints.push(
|
|
475
|
+
`Archived version(s) ${data.unreadVersions.join(", ")} could not be read: anything changed in them and undone in a later version is NOT shown. Do not conclude nothing changed; point the user to Versions in Tag Manager.`
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
const uncertain = data.versions.filter((v) => v.mayPredateSince).map((v) => v.versionId);
|
|
479
|
+
if (uncertain.length > 0) {
|
|
480
|
+
hints.push(
|
|
481
|
+
`Version(s) ${uncertain.join(", ")} were saved since ${data.since.slice(0, 10)}, but nothing in them was: Tag Manager re-dates a version when it is renamed or its notes are edited, so each may be an older version edited since, not a new one. Their changes (mayPredateSince) may predate the window \u2014 say so rather than reporting them as recent.`
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
const gone = new Set(data.changes.filter((c) => c.change === "deleted").map((c) => `${c.entity}:${c.entityId}`));
|
|
485
|
+
const ids = [
|
|
486
|
+
...new Set(
|
|
487
|
+
data.changes.filter(
|
|
488
|
+
(c) => c.entity !== "template" && c.entity !== "builtInVariable" && !gone.has(`${c.entity}:${c.entityId}`)
|
|
489
|
+
).map((c) => c.entityId)
|
|
490
|
+
)
|
|
491
|
+
];
|
|
492
|
+
if (ids.length > 0) {
|
|
493
|
+
hints.push(
|
|
494
|
+
`What a changed entity holds now: baker tag-manager read --container ${data.container.containerId} --id ${ids.slice(0, 10).join(",")}`
|
|
495
|
+
);
|
|
496
|
+
} else if (data.changes.length === 0 && !data.completeSince && !data.unreadVersions?.length) {
|
|
497
|
+
hints.push(
|
|
498
|
+
data.versions.length > 0 ? `Version(s) ${data.versions.map((v) => v.versionId).join(", ")} were saved since ${data.since.slice(0, 10)} but changed no tag, trigger, variable, built-in variable, folder or template \u2014 only their name, notes or settings this read does not compare. Nothing is pending in any workspace.` : `Nothing in this container changed since ${data.since.slice(0, 10)}, published or pending in any workspace.`
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
return hints;
|
|
502
|
+
}
|
|
503
|
+
var changesCommand = defineCommand({
|
|
504
|
+
meta: {
|
|
505
|
+
name: "changes",
|
|
506
|
+
description: `What changed in the Tag Manager container since a date \u2014 created, modified and deleted tags, triggers, variables, folders and templates, and built-in variables switched on or off, each dated and tied to the version that carried it.
|
|
507
|
+
|
|
508
|
+
Start here:
|
|
509
|
+
baker tag-manager changes # the last ${TAG_MANAGER_CHANGES_DEFAULT_DAYS} days
|
|
510
|
+
baker tag-manager changes --since 2026-09-21 # since the last review
|
|
511
|
+
baker tag-manager changes --days 30 --container 89198951
|
|
512
|
+
|
|
513
|
+
Rows marked pending are saved in a workspace (named) but not yet in a version, so not live.
|
|
514
|
+
A deletion carries no time of its own: it went live with its version, cut between that version's cutAfter and savedAt (in data.versions).`
|
|
515
|
+
},
|
|
516
|
+
args: ARGS,
|
|
517
|
+
run: async ({ args }) => {
|
|
518
|
+
const days = typeof args.days === "string" && args.days.length > 0 ? Number(args.days) : void 0;
|
|
519
|
+
if (days !== void 0 && (!Number.isInteger(days) || days < 1 || days > TAG_MANAGER_CHANGES_MAX_DAYS)) {
|
|
520
|
+
failValidation(`--days must be a whole number from 1 to ${TAG_MANAGER_CHANGES_MAX_DAYS}`);
|
|
521
|
+
}
|
|
522
|
+
const since = typeof args.since === "string" && args.since.length > 0 ? args.since : void 0;
|
|
523
|
+
try {
|
|
524
|
+
const data = await apiPost(
|
|
525
|
+
"/api/tag-manager/changes",
|
|
526
|
+
{ containerId: args.container, since, days },
|
|
527
|
+
{ timeoutMs: TAG_MANAGER_TIMEOUT_MS }
|
|
528
|
+
);
|
|
529
|
+
writeJsonEnvelope({ ok: true, data, hints: changesHints(data) });
|
|
530
|
+
} catch (err) {
|
|
531
|
+
handleError(err);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
export {
|
|
536
|
+
changesCommand,
|
|
537
|
+
changesHints
|
|
538
|
+
};
|
|
539
|
+
//# sourceMappingURL=changes-6UGDHAZW.js.map
|