@koda-sl/baker-cli 0.883.0 → 0.884.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 +3 -1
- package/dist/{account-reads-TSDWJ3A2.js → account-reads-7DPRPWBK.js} +3 -2
- package/dist/{account-reads-TSDWJ3A2.js.map → account-reads-7DPRPWBK.js.map} +1 -1
- package/dist/{ads-ZSHBQHNK.js → ads-Z2YUBDUF.js} +2 -2
- package/dist/{analytics-6TNLZ4LA.js → analytics-E5OPCERI.js} +6 -5
- package/dist/{analytics-6TNLZ4LA.js.map → analytics-E5OPCERI.js.map} +1 -1
- package/dist/{changes-7WLOTKVE.js → changes-FQ2NWBJQ.js} +3 -2
- package/dist/{changes-7WLOTKVE.js.map → changes-FQ2NWBJQ.js.map} +1 -1
- package/dist/{chunk-Z65I6WS6.js → chunk-DX4SRYED.js} +13 -5
- package/dist/chunk-DX4SRYED.js.map +1 -0
- package/dist/{chunk-J464JWY7.js → chunk-ENTB4ILS.js} +8 -4
- package/dist/chunk-ENTB4ILS.js.map +1 -0
- package/dist/{chunk-JOQBRK4E.js → chunk-FRWCTFTP.js} +9 -4
- package/dist/chunk-FRWCTFTP.js.map +1 -0
- package/dist/{chunk-BX5AAH7T.js → chunk-IDLSLJIM.js} +4 -2
- package/dist/{chunk-BX5AAH7T.js.map → chunk-IDLSLJIM.js.map} +1 -1
- package/dist/chunk-LVLAFUXQ.js +37 -0
- package/dist/chunk-LVLAFUXQ.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/{config-UR3ZKS25.js → config-Z52BRC3M.js} +3 -2
- package/dist/{config-UR3ZKS25.js.map → config-Z52BRC3M.js.map} +1 -1
- package/dist/{conversion-upload-command-CWMZEFCT.js → conversion-upload-command-ZZ5JYMBL.js} +7 -4
- package/dist/conversion-upload-command-ZZ5JYMBL.js.map +1 -0
- package/dist/{draft-KMRFGWIO.js → draft-3L5UZ3JP.js} +7 -4
- package/dist/draft-3L5UZ3JP.js.map +1 -0
- package/dist/{draft-XWJF772C.js → draft-CZEMQHTX.js} +3 -2
- package/dist/{draft-XWJF772C.js.map → draft-CZEMQHTX.js.map} +1 -1
- package/dist/{draft-5H6MKAKW.js → draft-FOHLBTWV.js} +3 -2
- package/dist/{draft-5H6MKAKW.js.map → draft-FOHLBTWV.js.map} +1 -1
- package/dist/{forecast-WTVRSFFA.js → forecast-SXZBIHFB.js} +3 -2
- package/dist/{forecast-WTVRSFFA.js.map → forecast-SXZBIHFB.js.map} +1 -1
- package/dist/{ga4-K6ARTEPX.js → ga4-6J3IMDSU.js} +12 -12
- package/dist/{google-N3GW4MDV.js → google-F77XV4ZC.js} +59 -40
- package/dist/google-F77XV4ZC.js.map +1 -0
- package/dist/{hubspot-BG4BI3RU.js → hubspot-24MLH5N7.js} +2 -2
- package/dist/{plan-C5U4U55M.js → plan-JVD6BMEO.js} +3 -2
- package/dist/{plan-C5U4U55M.js.map → plan-JVD6BMEO.js.map} +1 -1
- package/dist/{read-UXFNPEQ5.js → read-VI63RNL6.js} +3 -2
- package/dist/{read-UXFNPEQ5.js.map → read-VI63RNL6.js.map} +1 -1
- package/dist/{search-terms-WKE47TW5.js → search-terms-SWRRTKBV.js} +3 -2
- package/dist/{search-terms-WKE47TW5.js.map → search-terms-SWRRTKBV.js.map} +1 -1
- package/dist/{sends-5UCPQZ7F.js → sends-PEQJOPRM.js} +19 -4
- package/dist/sends-PEQJOPRM.js.map +1 -0
- package/dist/{shopify-NJFARTN3.js → shopify-IRHELCGF.js} +3 -2
- package/dist/{shopify-NJFARTN3.js.map → shopify-IRHELCGF.js.map} +1 -1
- package/dist/{sources-XYKENWZF.js → sources-CACBM65R.js} +38 -17
- package/dist/sources-CACBM65R.js.map +1 -0
- package/dist/{tag-manager-5Q5MHQPL.js → tag-manager-QO6VW57E.js} +10 -10
- package/dist/{themes-LWG3LX7O.js → themes-GMZOWC3X.js} +3 -2
- package/dist/{themes-LWG3LX7O.js.map → themes-GMZOWC3X.js.map} +1 -1
- package/dist/{write-commands-IAMIUSK4.js → write-commands-GRBE5V34.js} +3 -2
- package/dist/{write-commands-IAMIUSK4.js.map → write-commands-GRBE5V34.js.map} +1 -1
- package/dist/{write-commands-JXP2NHRY.js → write-commands-MZUVJBGO.js} +3 -2
- package/dist/{write-commands-JXP2NHRY.js.map → write-commands-MZUVJBGO.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-J464JWY7.js.map +0 -1
- package/dist/chunk-JOQBRK4E.js.map +0 -1
- package/dist/chunk-Z65I6WS6.js.map +0 -1
- package/dist/conversion-upload-command-CWMZEFCT.js.map +0 -1
- package/dist/draft-KMRFGWIO.js.map +0 -1
- package/dist/google-N3GW4MDV.js.map +0 -1
- package/dist/sends-5UCPQZ7F.js.map +0 -1
- package/dist/sources-XYKENWZF.js.map +0 -1
- /package/dist/{ads-ZSHBQHNK.js.map → ads-Z2YUBDUF.js.map} +0 -0
- /package/dist/{ga4-K6ARTEPX.js.map → ga4-6J3IMDSU.js.map} +0 -0
- /package/dist/{hubspot-BG4BI3RU.js.map → hubspot-24MLH5N7.js.map} +0 -0
- /package/dist/{tag-manager-5Q5MHQPL.js.map → tag-manager-QO6VW57E.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1007,6 +1007,8 @@ Write commands **never touch the Google Ads API at stage time**. Each command st
|
|
|
1007
1007
|
|
|
1008
1008
|
Reference not-yet-created resources with `g_temp_*` refs returned by earlier `create` commands (they map to Google's temporary negative-ID resource names inside one atomic batch).
|
|
1009
1009
|
|
|
1010
|
+
**A command's standing advice prints once per chat per 30 minutes.** The fixed paragraphs a stage command returns in `hints[]` — the next step after `draft stage`, the original-order-id rule on `conversions upload`, how to name the target of a removal or detach — appear on the first such stage in a chat and are left out of repeats within half an hour. Warnings and hints about the op just staged (a NOT STAGED no-op, a LOOP or TREE nudge, a warning on a staged op, an AI copy tell) print on every call. `baker ga4` and `baker tag-manager` stages treat their "staged only" reminder the same way.
|
|
1011
|
+
|
|
1010
1012
|
**Staged ad copy is scanned for AI writing tells** (Google, Meta, and LinkedIn alike), in whatever language the ad is written. When a headline, description, or primary text carries a construction that reads as machine-written — a negation pivot, a fake-candid opener, a participle hung off a comma, a vague attribution — the stage response carries an `AI COPY TELL` entry in `hints[]`. A headline set where several headlines are one claim with a swapped verb is reported as `synonym-cycling`: an AI tell *and* a real auction defect. Each sentence and each pair of headlines is read by the decision model (Jev, a fraction of a cent, billed with the workspace's next run; answers are kept in `canvas/.cache/`, so the same copy reads the same); when it cannot answer, no tell is reported rather than a guess. These are advisory and can never fail a staged write, deliberately — refusing an ad over a fallible prose heuristic costs more than a tell that ships. One occurrence is enough (a 30-character headline has no room for a cluster), and conventions that are legitimate in ad copy are excluded outright: Title Case headlines, staccato ad rhythm, emoji, and curly quotes.
|
|
1011
1013
|
|
|
1012
1014
|
```bash
|
|
@@ -2149,7 +2151,7 @@ baker analytics sends --platform meta # only what goes to Meta: its sends, t
|
|
|
2149
2151
|
baker analytics sends --set --source-event page:deal_won --platform meta --tag <tagId> --event Purchase # staged; spends budget once published
|
|
2150
2152
|
baker analytics sends --set --source-event page:deal_won --platform meta --tag <tagId> --event Purchase --parameter content_name={{properties.plan}} # with an extra Meta custom_data parameter
|
|
2151
2153
|
baker analytics sends --uploads s1 --failed # the uploads Meta refused, each with the event and Meta's own words
|
|
2152
|
-
baker analytics sends --remove s1 # stop one, when the chat is published
|
|
2154
|
+
baker analytics sends --remove s1 # stop one, when the chat is published; a write answers with what it staged and the total (--full: the whole listing)
|
|
2153
2155
|
baker analytics delivery --flow contact # how many of one Form's submissions failed or are pending, and which
|
|
2154
2156
|
baker analytics delivery --page 2 # the next page of a long list
|
|
2155
2157
|
baker analytics submissions --flow contact # every attempt at a Form, delivered or not
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
failWriteValidation,
|
|
6
6
|
listFlag,
|
|
7
7
|
requireCustomerId
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FRWCTFTP.js";
|
|
9
|
+
import "./chunk-LVLAFUXQ.js";
|
|
9
10
|
import "./chunk-MTMWOUKN.js";
|
|
10
11
|
import "./chunk-S7J2JP3U.js";
|
|
11
12
|
import "./chunk-UKENQSZ2.js";
|
|
@@ -227,4 +228,4 @@ export {
|
|
|
227
228
|
invoicesCommand,
|
|
228
229
|
previewsCommand
|
|
229
230
|
};
|
|
230
|
-
//# sourceMappingURL=account-reads-
|
|
231
|
+
//# sourceMappingURL=account-reads-7DPRPWBK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/ads/google/account-reads.ts"],"sourcesContent":["/**\n * `baker ads google invoices | identity-verification | previews` — read-only service calls that\n * are not GAQL. A refusal that is the account's situation degrades with an `error.fix` (see\n * `service-read-errors.ts`) instead of failing the job.\n */\nimport type {\n GoogleBrandSuggestionsResponse,\n GoogleIdentityVerificationResponse,\n GoogleInvoicesResponse,\n GoogleShareablePreviewsResponse,\n} from \"@baker/api/ads-google\";\nimport type { CommandRoute } from \"@baker/api/cli-catalog/entry\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../../client.ts\";\nimport { registerSchema } from \"../../../schemas.ts\";\nimport { getManagerIdForCustomer } from \"../cache.ts\";\nimport { writeJsonEnvelope } from \"../output.ts\";\nimport { exitWithServiceReadError } from \"./service-read-errors.ts\";\nimport { failWriteValidation, listFlag, requireCustomerId } from \"./write-shared.ts\";\n\ntype ArgDefs = Record<string, { type: \"string\" | \"boolean\"; description: string }>;\n\n/** Each one reads the account live through its own route. */\nfunction register(command: string, route: CommandRoute, description: string, args: ArgDefs): void {\n registerSchema({\n command,\n routes: [route],\n effect: \"read_live\",\n description,\n args: Object.fromEntries(\n Object.entries(args).map(([name, arg]) => [\n name,\n { type: arg.type, description: arg.description, required: false },\n ]),\n ),\n });\n}\n\nasync function serviceRead<T>(path: string, customerId: string, body: Record<string, unknown>): Promise<T> {\n const managerId = getManagerIdForCustomer(customerId);\n const { data } = await apiPost<{ ok: true; data: T }>(path, {\n customerId,\n ...(managerId ? { managerId } : {}),\n ...body,\n });\n return data;\n}\n\nconst CUSTOMER_ARG = {\n \"customer-id\": { type: \"string\", description: \"Google Ads customer ID (10 digits; dashes are fine)\" },\n} as const;\n\nconst INVOICE_ARGS = {\n ...CUSTOMER_ARG,\n month: { type: \"string\", description: \"Issue month, YYYY-MM (default: last month)\" },\n} as const;\n\nregister(\n \"ads.google.invoices\",\n \"POST /api/ads/google/invoices\",\n \"List the invoices Google issued in one month (accounts on monthly invoicing only): id, dates, service period, subtotal/tax/total in micros, PDF link. Start here: `baker ads google invoices --customer-id 1234567890 --month 2026-09`. An account that pays automatically has no invoices — the error's fix says where its receipts are; carry on.\",\n INVOICE_ARGS,\n);\n\nexport const invoicesCommand = defineCommand({\n meta: {\n name: \"invoices\",\n description: `List one month's invoices (monthly-invoicing accounts only). Read-only.\n\nExample:\n baker ads google invoices --customer-id 1234567890 --month 2026-09`,\n },\n args: INVOICE_ARGS,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n try {\n const data = await serviceRead<GoogleInvoicesResponse>(\"/api/ads/google/invoices\", customerId, {\n ...(args.month ? { month: args.month } : {}),\n });\n const hints =\n data.invoices.length === 0\n ? [`No invoice was issued in ${data.month}. Try the month before with --month.`]\n : [\n \"Amounts are micros in each invoice's currency_code (divide by 1,000,000). pdf_url needs the user's Google sign-in.\",\n ];\n writeJsonEnvelope({ ok: true, data, hints });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n\nregister(\n \"ads.google.identity-verification\",\n \"POST /api/ads/google/identity-verification\",\n \"Advertiser identity verification status: each program's status (PENDING_USER_ACTION, PENDING_REVIEW, SUCCESS, FAILURE), deadlines and the link where the user completes it. Start here: `baker ads google identity-verification --customer-id 1234567890`. Google only answers for accounts on monthly invoicing — otherwise the error's fix says where the user reads it; carry on.\",\n CUSTOMER_ARG,\n);\n\nexport const identityVerificationCommand = defineCommand({\n meta: {\n name: \"identity-verification\",\n description: `Advertiser identity verification status and deadlines. Read-only.\n\nExample:\n baker ads google identity-verification --customer-id 1234567890`,\n },\n args: CUSTOMER_ARG,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n try {\n const data = await serviceRead<GoogleIdentityVerificationResponse>(\n \"/api/ads/google/identity-verification\",\n customerId,\n {},\n );\n const pending = data.programs.filter((program) => program.status === \"PENDING_USER_ACTION\");\n const hints =\n pending.length > 0\n ? [\n `Verification is waiting on the advertiser${pending[0]?.completion_deadline ? ` (deadline ${pending[0].completion_deadline})` : \"\"}: give the user the action_url — ads stop serving if it lapses.`,\n ]\n : [];\n writeJsonEnvelope(hints.length > 0 ? { ok: true, data, hints } : { ok: true, data });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n\nconst PREVIEW_ARGS = {\n ...CUSTOMER_ARG,\n ads: {\n type: \"string\",\n description:\n \"Comma-separated video ads of Video campaigns as {adGroupId}~{adId} (from `ads list`) — previewed live on YouTube\",\n },\n \"asset-groups\": {\n type: \"string\",\n description:\n \"Comma-separated Performance Max asset group ids (from `asset-groups list`) — previewed on Google's preview page\",\n },\n} as const;\n\nregister(\n \"ads.google.previews\",\n \"POST /api/ads/google/previews\",\n \"Shareable preview links for Performance Max asset groups (Google's preview page) and video ads (live on YouTube) that already exist in the account — a link the user can open or forward. Start here: `baker ads google previews --customer-id 1234567890 --asset-groups 6743268912`. Returns { previews: [{ target, url, youtube_tv_url, expires_at }] }. Only video ads of Video campaigns can be previewed by ad (search, display and Demand Gen ads have no shareable preview); staged (unpublished) changes cannot be previewed.\",\n PREVIEW_ARGS,\n);\n\nexport const previewsCommand = defineCommand({\n meta: {\n name: \"previews\",\n description: `Shareable preview links for existing Performance Max asset groups and video ads. Read-only.\n\nExamples:\n baker ads google previews --customer-id 1234567890 --asset-groups 6743268912\n baker ads google previews --customer-id 1234567890 --ads 195752489650~826812181091 # a video ad, live on YouTube`,\n },\n args: PREVIEW_ARGS,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n const ads = listFlag(args.ads);\n const assetGroups = listFlag(args[\"asset-groups\"]);\n if (!ads?.length && !assetGroups?.length) failWriteValidation(\"pass --ads and/or --asset-groups\");\n try {\n const data = await serviceRead<GoogleShareablePreviewsResponse>(\"/api/ads/google/previews\", customerId, {\n ...(ads ? { ads } : {}),\n ...(assetGroups ? { assetGroups } : {}),\n });\n writeJsonEnvelope({\n ok: true,\n data,\n hints: [\n \"Each link expires (expires_at). It shows what is live in the account now, not anything staged in this chat.\",\n ],\n });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n\nconst BRAND_ARGS = {\n ...CUSTOMER_ARG,\n prefix: { type: \"string\", description: \"The start of the brand's name (at least 2 letters)\" },\n} as const;\n\nregister(\n \"ads.google.brands\",\n \"POST /api/ads/google/brands\",\n \"Find a brand's Google entity id — what a BRANDS list member names (`keyword-lists add --brand /g/…`). Start here: `baker ads google brands --customer-id 1234567890 --prefix nike`. Several brands can share a name: pick by the URL. Read-only.\",\n BRAND_ARGS,\n);\n\nexport const brandsCommand = defineCommand({\n meta: {\n name: \"brands\",\n description: `Find brand entity ids for a brand list (BRANDS). Read-only.\n\nExample:\n baker ads google brands --customer-id 1234567890 --prefix nike`,\n },\n args: BRAND_ARGS,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n if (typeof args.prefix !== \"string\" || args.prefix.trim().length < 2) {\n failWriteValidation(\"--prefix needs at least the first 2 letters of the brand\");\n }\n try {\n const data = await serviceRead<GoogleBrandSuggestionsResponse>(\"/api/ads/google/brands\", customerId, {\n prefix: args.prefix,\n });\n const hints =\n data.brands.length > 0\n ? [\n \"Several brands can share a name — pick the one whose URL is the brand you mean, then `keyword-lists add --list-ref <BRANDS list> --brand <entity_id>`.\",\n ]\n : [\"No brand starts with that — try a shorter or different prefix.\"];\n writeJsonEnvelope({ ok: true, data, hints });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qEAAgE;AACvE,wBAAkB,EAAE,IAAI,MAAM,MAAM,MAAM,CAAC;AAAA,IAC7C,SAAS,KAAK;AACZ,+BAAyB,GAAG;AAAA,IAC9B;AAAA,EACF;AACF,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/ads/google/account-reads.ts"],"sourcesContent":["/**\n * `baker ads google invoices | identity-verification | previews` — read-only service calls that\n * are not GAQL. A refusal that is the account's situation degrades with an `error.fix` (see\n * `service-read-errors.ts`) instead of failing the job.\n */\nimport type {\n GoogleBrandSuggestionsResponse,\n GoogleIdentityVerificationResponse,\n GoogleInvoicesResponse,\n GoogleShareablePreviewsResponse,\n} from \"@baker/api/ads-google\";\nimport type { CommandRoute } from \"@baker/api/cli-catalog/entry\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../../client.ts\";\nimport { registerSchema } from \"../../../schemas.ts\";\nimport { getManagerIdForCustomer } from \"../cache.ts\";\nimport { writeJsonEnvelope } from \"../output.ts\";\nimport { exitWithServiceReadError } from \"./service-read-errors.ts\";\nimport { failWriteValidation, listFlag, requireCustomerId } from \"./write-shared.ts\";\n\ntype ArgDefs = Record<string, { type: \"string\" | \"boolean\"; description: string }>;\n\n/** Each one reads the account live through its own route. */\nfunction register(command: string, route: CommandRoute, description: string, args: ArgDefs): void {\n registerSchema({\n command,\n routes: [route],\n effect: \"read_live\",\n description,\n args: Object.fromEntries(\n Object.entries(args).map(([name, arg]) => [\n name,\n { type: arg.type, description: arg.description, required: false },\n ]),\n ),\n });\n}\n\nasync function serviceRead<T>(path: string, customerId: string, body: Record<string, unknown>): Promise<T> {\n const managerId = getManagerIdForCustomer(customerId);\n const { data } = await apiPost<{ ok: true; data: T }>(path, {\n customerId,\n ...(managerId ? { managerId } : {}),\n ...body,\n });\n return data;\n}\n\nconst CUSTOMER_ARG = {\n \"customer-id\": { type: \"string\", description: \"Google Ads customer ID (10 digits; dashes are fine)\" },\n} as const;\n\nconst INVOICE_ARGS = {\n ...CUSTOMER_ARG,\n month: { type: \"string\", description: \"Issue month, YYYY-MM (default: last month)\" },\n} as const;\n\nregister(\n \"ads.google.invoices\",\n \"POST /api/ads/google/invoices\",\n \"List the invoices Google issued in one month (accounts on monthly invoicing only): id, dates, service period, subtotal/tax/total in micros, PDF link. Start here: `baker ads google invoices --customer-id 1234567890 --month 2026-09`. An account that pays automatically has no invoices — the error's fix says where its receipts are; carry on.\",\n INVOICE_ARGS,\n);\n\nexport const invoicesCommand = defineCommand({\n meta: {\n name: \"invoices\",\n description: `List one month's invoices (monthly-invoicing accounts only). Read-only.\n\nExample:\n baker ads google invoices --customer-id 1234567890 --month 2026-09`,\n },\n args: INVOICE_ARGS,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n try {\n const data = await serviceRead<GoogleInvoicesResponse>(\"/api/ads/google/invoices\", customerId, {\n ...(args.month ? { month: args.month } : {}),\n });\n const hints =\n data.invoices.length === 0\n ? [`No invoice was issued in ${data.month}. Try the month before with --month.`]\n : [\n \"Amounts are micros in each invoice's currency_code (divide by 1,000,000). pdf_url needs the user's Google sign-in.\",\n ];\n writeJsonEnvelope({ ok: true, data, hints });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n\nregister(\n \"ads.google.identity-verification\",\n \"POST /api/ads/google/identity-verification\",\n \"Advertiser identity verification status: each program's status (PENDING_USER_ACTION, PENDING_REVIEW, SUCCESS, FAILURE), deadlines and the link where the user completes it. Start here: `baker ads google identity-verification --customer-id 1234567890`. Google only answers for accounts on monthly invoicing — otherwise the error's fix says where the user reads it; carry on.\",\n CUSTOMER_ARG,\n);\n\nexport const identityVerificationCommand = defineCommand({\n meta: {\n name: \"identity-verification\",\n description: `Advertiser identity verification status and deadlines. Read-only.\n\nExample:\n baker ads google identity-verification --customer-id 1234567890`,\n },\n args: CUSTOMER_ARG,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n try {\n const data = await serviceRead<GoogleIdentityVerificationResponse>(\n \"/api/ads/google/identity-verification\",\n customerId,\n {},\n );\n const pending = data.programs.filter((program) => program.status === \"PENDING_USER_ACTION\");\n const hints =\n pending.length > 0\n ? [\n `Verification is waiting on the advertiser${pending[0]?.completion_deadline ? ` (deadline ${pending[0].completion_deadline})` : \"\"}: give the user the action_url — ads stop serving if it lapses.`,\n ]\n : [];\n writeJsonEnvelope(hints.length > 0 ? { ok: true, data, hints } : { ok: true, data });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n\nconst PREVIEW_ARGS = {\n ...CUSTOMER_ARG,\n ads: {\n type: \"string\",\n description:\n \"Comma-separated video ads of Video campaigns as {adGroupId}~{adId} (from `ads list`) — previewed live on YouTube\",\n },\n \"asset-groups\": {\n type: \"string\",\n description:\n \"Comma-separated Performance Max asset group ids (from `asset-groups list`) — previewed on Google's preview page\",\n },\n} as const;\n\nregister(\n \"ads.google.previews\",\n \"POST /api/ads/google/previews\",\n \"Shareable preview links for Performance Max asset groups (Google's preview page) and video ads (live on YouTube) that already exist in the account — a link the user can open or forward. Start here: `baker ads google previews --customer-id 1234567890 --asset-groups 6743268912`. Returns { previews: [{ target, url, youtube_tv_url, expires_at }] }. Only video ads of Video campaigns can be previewed by ad (search, display and Demand Gen ads have no shareable preview); staged (unpublished) changes cannot be previewed.\",\n PREVIEW_ARGS,\n);\n\nexport const previewsCommand = defineCommand({\n meta: {\n name: \"previews\",\n description: `Shareable preview links for existing Performance Max asset groups and video ads. Read-only.\n\nExamples:\n baker ads google previews --customer-id 1234567890 --asset-groups 6743268912\n baker ads google previews --customer-id 1234567890 --ads 195752489650~826812181091 # a video ad, live on YouTube`,\n },\n args: PREVIEW_ARGS,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n const ads = listFlag(args.ads);\n const assetGroups = listFlag(args[\"asset-groups\"]);\n if (!ads?.length && !assetGroups?.length) failWriteValidation(\"pass --ads and/or --asset-groups\");\n try {\n const data = await serviceRead<GoogleShareablePreviewsResponse>(\"/api/ads/google/previews\", customerId, {\n ...(ads ? { ads } : {}),\n ...(assetGroups ? { assetGroups } : {}),\n });\n writeJsonEnvelope({\n ok: true,\n data,\n hints: [\n \"Each link expires (expires_at). It shows what is live in the account now, not anything staged in this chat.\",\n ],\n });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n\nconst BRAND_ARGS = {\n ...CUSTOMER_ARG,\n prefix: { type: \"string\", description: \"The start of the brand's name (at least 2 letters)\" },\n} as const;\n\nregister(\n \"ads.google.brands\",\n \"POST /api/ads/google/brands\",\n \"Find a brand's Google entity id — what a BRANDS list member names (`keyword-lists add --brand /g/…`). Start here: `baker ads google brands --customer-id 1234567890 --prefix nike`. Several brands can share a name: pick by the URL. Read-only.\",\n BRAND_ARGS,\n);\n\nexport const brandsCommand = defineCommand({\n meta: {\n name: \"brands\",\n description: `Find brand entity ids for a brand list (BRANDS). Read-only.\n\nExample:\n baker ads google brands --customer-id 1234567890 --prefix nike`,\n },\n args: BRAND_ARGS,\n run: async ({ args }) => {\n const customerId = requireCustomerId(args);\n if (typeof args.prefix !== \"string\" || args.prefix.trim().length < 2) {\n failWriteValidation(\"--prefix needs at least the first 2 letters of the brand\");\n }\n try {\n const data = await serviceRead<GoogleBrandSuggestionsResponse>(\"/api/ads/google/brands\", customerId, {\n prefix: args.prefix,\n });\n const hints =\n data.brands.length > 0\n ? [\n \"Several brands can share a name — pick the one whose URL is the brand you mean, then `keyword-lists add --list-ref <BRANDS list> --brand <entity_id>`.\",\n ]\n : [\"No brand starts with that — try a shorter or different prefix.\"];\n writeJsonEnvelope({ ok: true, data, hints });\n } catch (err) {\n exitWithServiceReadError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,qBAAqB;AAW9B,SAAS,SAAS,SAAiB,OAAqB,aAAqB,MAAqB;AAChG,iBAAe;AAAA,IACb;AAAA,IACA,QAAQ,CAAC,KAAK;AAAA,IACd,QAAQ;AAAA,IACR;AAAA,IACA,MAAM,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
|
|
33
33
|
Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedin|x|chatgpt|performance|terms)`
|
|
34
34
|
},
|
|
35
35
|
subCommands: {
|
|
36
|
-
google: () => import("./google-
|
|
36
|
+
google: () => import("./google-F77XV4ZC.js").then((m) => m.googleCommand),
|
|
37
37
|
meta: () => import("./meta-RJH5COPE.js").then((m) => m.metaCommand),
|
|
38
38
|
linkedin: () => import("./linkedin-26LGDFRU.js").then((m) => m.linkedinCommand),
|
|
39
39
|
x: () => import("./x-2QTZBTVK.js").then((m) => m.xCommand),
|
|
@@ -45,4 +45,4 @@ Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedi
|
|
|
45
45
|
export {
|
|
46
46
|
adsCommand
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=ads-
|
|
48
|
+
//# sourceMappingURL=ads-Z2YUBDUF.js.map
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-KFFAH3TX.js";
|
|
39
39
|
import {
|
|
40
40
|
TAG_MANAGER_TIMEOUT_MS
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-ENTB4ILS.js";
|
|
42
42
|
import {
|
|
43
43
|
analyticsErrorEnvelope
|
|
44
44
|
} from "./chunk-SPLOBKTE.js";
|
|
@@ -69,6 +69,7 @@ import "./chunk-5TURKO4J.js";
|
|
|
69
69
|
import {
|
|
70
70
|
withWindowSpellings
|
|
71
71
|
} from "./chunk-74QGFUZL.js";
|
|
72
|
+
import "./chunk-LVLAFUXQ.js";
|
|
72
73
|
import "./chunk-MTMWOUKN.js";
|
|
73
74
|
import "./chunk-D5FY4FAK.js";
|
|
74
75
|
import {
|
|
@@ -2776,17 +2777,17 @@ Full guide: __tooling__/docs/tools/baker/analytics.md`
|
|
|
2776
2777
|
devices: devicesCommand,
|
|
2777
2778
|
ads: adsCommand,
|
|
2778
2779
|
conversions: conversionsCommand,
|
|
2779
|
-
sends: () => import("./sends-
|
|
2780
|
+
sends: () => import("./sends-PEQJOPRM.js").then((m) => m.sendsCommand),
|
|
2780
2781
|
map: mapCommand,
|
|
2781
2782
|
unstage: () => import("./unstage-J4BMJ5F2.js").then((m) => m.unstageCommand),
|
|
2782
2783
|
tracking: trackingCommand,
|
|
2783
2784
|
arrivals: arrivalsCommand,
|
|
2784
2785
|
"sending-events": sendingEventsCommand,
|
|
2785
|
-
sources: () => import("./sources-
|
|
2786
|
+
sources: () => import("./sources-CACBM65R.js").then((m) => m.sourcesCommand),
|
|
2786
2787
|
"website-tag": websiteTagCommand,
|
|
2787
2788
|
debug: debugCommand,
|
|
2788
2789
|
sites: sitesCommand,
|
|
2789
|
-
plan: () => import("./plan-
|
|
2790
|
+
plan: () => import("./plan-JVD6BMEO.js").then((m) => m.planCommand),
|
|
2790
2791
|
questionnaire: () => import("./questionnaire-D7SCFJZH.js").then((m) => m.questionnaireCommand),
|
|
2791
2792
|
presets: presetsCommand
|
|
2792
2793
|
}
|
|
@@ -2801,4 +2802,4 @@ export {
|
|
|
2801
2802
|
requestBody,
|
|
2802
2803
|
sendingEventsAddress
|
|
2803
2804
|
};
|
|
2804
|
-
//# sourceMappingURL=analytics-
|
|
2805
|
+
//# sourceMappingURL=analytics-E5OPCERI.js.map
|