@koda-sl/baker-cli 0.164.0 → 0.165.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 +1 -1
- package/dist/cli.js +1468 -1409
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2328,9 +2328,51 @@ var linkedinDraftErrorResponseSchema = z4.object({
|
|
|
2328
2328
|
fields: z4.array(linkedinFieldErrorSchema).optional()
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
|
-
// ../api/src/
|
|
2331
|
+
// ../api/src/brand.ts
|
|
2332
2332
|
import { z as z5 } from "zod";
|
|
2333
|
-
var
|
|
2333
|
+
var BRAND_TOKENS_VERSION = 1;
|
|
2334
|
+
var BRAND_COLOR_ROLES = ["background", "surface", "cta", "accent", "foreground", "other"];
|
|
2335
|
+
var BRAND_FONT_ROLES = ["heading", "body", "mono"];
|
|
2336
|
+
var BRAND_LOGO_VARIANTS = ["logo", "symbol", "icon"];
|
|
2337
|
+
var hexColorSchema = z5.string().regex(/^#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, "expected #RRGGBB or #RRGGBBAA").transform((value) => value.toUpperCase());
|
|
2338
|
+
var brandColorSchema = z5.strictObject({
|
|
2339
|
+
name: z5.string().min(1),
|
|
2340
|
+
value: hexColorSchema,
|
|
2341
|
+
role: z5.enum(BRAND_COLOR_ROLES),
|
|
2342
|
+
palette: z5.string().min(1).default("primary")
|
|
2343
|
+
});
|
|
2344
|
+
var brandFontSchema = z5.strictObject({
|
|
2345
|
+
family: z5.string().min(1),
|
|
2346
|
+
role: z5.enum(BRAND_FONT_ROLES),
|
|
2347
|
+
weights: z5.array(z5.number().int().min(1).max(1e3)).min(1),
|
|
2348
|
+
source: z5.enum(["local", "google"]),
|
|
2349
|
+
files: z5.array(z5.string().startsWith("src/brand/fonts/")).optional()
|
|
2350
|
+
}).refine((font) => font.source !== "local" || (font.files?.length ?? 0) > 0, {
|
|
2351
|
+
message: "a local font must list its files under src/brand/fonts/",
|
|
2352
|
+
path: ["files"]
|
|
2353
|
+
});
|
|
2354
|
+
var brandLogoSchema = z5.strictObject({
|
|
2355
|
+
variant: z5.enum(BRAND_LOGO_VARIANTS),
|
|
2356
|
+
/** The background the mark is designed to sit on; null = works on any. */
|
|
2357
|
+
background: z5.enum(["light", "dark"]).nullable().default(null),
|
|
2358
|
+
path: z5.string().startsWith("src/brand/logos/")
|
|
2359
|
+
});
|
|
2360
|
+
var brandTokensSchema = z5.strictObject({
|
|
2361
|
+
version: z5.literal(BRAND_TOKENS_VERSION),
|
|
2362
|
+
colors: z5.array(brandColorSchema).default([]),
|
|
2363
|
+
fonts: z5.array(brandFontSchema).default([]),
|
|
2364
|
+
logos: z5.array(brandLogoSchema).default([]),
|
|
2365
|
+
radius: z5.record(z5.string().min(1), z5.string().min(1)).optional()
|
|
2366
|
+
});
|
|
2367
|
+
var putBrandRequestSchema = z5.object({
|
|
2368
|
+
content: z5.string(),
|
|
2369
|
+
tokens: brandTokensSchema.optional(),
|
|
2370
|
+
chatId: z5.string().optional()
|
|
2371
|
+
});
|
|
2372
|
+
|
|
2373
|
+
// ../api/src/chats.ts
|
|
2374
|
+
import { z as z6 } from "zod";
|
|
2375
|
+
var chatInspectStatusSchema = z6.enum([
|
|
2334
2376
|
"draft",
|
|
2335
2377
|
"in_progress",
|
|
2336
2378
|
"publishing",
|
|
@@ -2338,8 +2380,8 @@ var chatInspectStatusSchema = z5.enum([
|
|
|
2338
2380
|
"completed",
|
|
2339
2381
|
"discarded"
|
|
2340
2382
|
]);
|
|
2341
|
-
var chatStatusGroupSchema =
|
|
2342
|
-
var chatChangeTypeSchema =
|
|
2383
|
+
var chatStatusGroupSchema = z6.enum(["active", "archived", "all"]);
|
|
2384
|
+
var chatChangeTypeSchema = z6.enum([
|
|
2343
2385
|
"landing",
|
|
2344
2386
|
"document",
|
|
2345
2387
|
"knowledge",
|
|
@@ -2360,197 +2402,197 @@ var chatChangeTypeSchema = z5.enum([
|
|
|
2360
2402
|
"followed-advertiser",
|
|
2361
2403
|
"briefs"
|
|
2362
2404
|
]);
|
|
2363
|
-
var chatChangeActionSchema =
|
|
2364
|
-
var chatChangeSummarySchema =
|
|
2405
|
+
var chatChangeActionSchema = z6.enum(["created", "updated", "deleted"]);
|
|
2406
|
+
var chatChangeSummarySchema = z6.object({
|
|
2365
2407
|
type: chatChangeTypeSchema,
|
|
2366
|
-
slug:
|
|
2408
|
+
slug: z6.string(),
|
|
2367
2409
|
action: chatChangeActionSchema,
|
|
2368
|
-
title:
|
|
2410
|
+
title: z6.string().optional()
|
|
2369
2411
|
});
|
|
2370
|
-
var repoSurfaceSchema =
|
|
2371
|
-
var chatsListRequestSchema =
|
|
2412
|
+
var repoSurfaceSchema = z6.enum(["knowledge", "company", "brand", "landings", "flows", "creatives"]);
|
|
2413
|
+
var chatsListRequestSchema = z6.object({
|
|
2372
2414
|
status: chatStatusGroupSchema.optional(),
|
|
2373
|
-
limit:
|
|
2415
|
+
limit: z6.number().int().min(1).max(100).optional(),
|
|
2374
2416
|
/** Include each Session's full `changes[]` list (compact returns counts only). */
|
|
2375
|
-
full:
|
|
2417
|
+
full: z6.boolean().optional(),
|
|
2376
2418
|
/**
|
|
2377
2419
|
* The caller's OWN Session id — excluded from results so an agent never sees
|
|
2378
2420
|
* its own in-flight chat listed as a separate "other Session" to reuse.
|
|
2379
2421
|
*/
|
|
2380
|
-
excludeChatId:
|
|
2422
|
+
excludeChatId: z6.string().optional()
|
|
2381
2423
|
});
|
|
2382
|
-
var chatSummarySchema =
|
|
2383
|
-
id:
|
|
2384
|
-
title:
|
|
2424
|
+
var chatSummarySchema = z6.object({
|
|
2425
|
+
id: z6.string(),
|
|
2426
|
+
title: z6.string(),
|
|
2385
2427
|
status: chatInspectStatusSchema,
|
|
2386
|
-
createdAt:
|
|
2387
|
-
updatedAt:
|
|
2428
|
+
createdAt: z6.number(),
|
|
2429
|
+
updatedAt: z6.number(),
|
|
2388
2430
|
/** Counts of produced outputs keyed by change type. */
|
|
2389
|
-
outputs:
|
|
2390
|
-
outputTotal:
|
|
2391
|
-
changes:
|
|
2392
|
-
});
|
|
2393
|
-
var chatsListResponseSchema =
|
|
2394
|
-
ok:
|
|
2395
|
-
data:
|
|
2396
|
-
});
|
|
2397
|
-
var chatsViewRequestSchema =
|
|
2398
|
-
chatId:
|
|
2399
|
-
full:
|
|
2400
|
-
});
|
|
2401
|
-
var chatThreadSummarySchema =
|
|
2402
|
-
id:
|
|
2403
|
-
title:
|
|
2404
|
-
status:
|
|
2405
|
-
createdAt:
|
|
2406
|
-
});
|
|
2407
|
-
var chatCommitSummarySchema =
|
|
2408
|
-
sha:
|
|
2409
|
-
message:
|
|
2410
|
-
surfaces:
|
|
2411
|
-
createdAt:
|
|
2412
|
-
});
|
|
2413
|
-
var effectOpSchema =
|
|
2414
|
-
var contentEffectSchema =
|
|
2431
|
+
outputs: z6.record(z6.string(), z6.number()),
|
|
2432
|
+
outputTotal: z6.number(),
|
|
2433
|
+
changes: z6.array(chatChangeSummarySchema).optional()
|
|
2434
|
+
});
|
|
2435
|
+
var chatsListResponseSchema = z6.object({
|
|
2436
|
+
ok: z6.literal(true),
|
|
2437
|
+
data: z6.object({ chats: z6.array(chatSummarySchema) })
|
|
2438
|
+
});
|
|
2439
|
+
var chatsViewRequestSchema = z6.object({
|
|
2440
|
+
chatId: z6.string(),
|
|
2441
|
+
full: z6.boolean().optional()
|
|
2442
|
+
});
|
|
2443
|
+
var chatThreadSummarySchema = z6.object({
|
|
2444
|
+
id: z6.string(),
|
|
2445
|
+
title: z6.string().nullable(),
|
|
2446
|
+
status: z6.string(),
|
|
2447
|
+
createdAt: z6.number()
|
|
2448
|
+
});
|
|
2449
|
+
var chatCommitSummarySchema = z6.object({
|
|
2450
|
+
sha: z6.string(),
|
|
2451
|
+
message: z6.string().nullable(),
|
|
2452
|
+
surfaces: z6.array(z6.string()),
|
|
2453
|
+
createdAt: z6.number()
|
|
2454
|
+
});
|
|
2455
|
+
var effectOpSchema = z6.enum(["created", "updated", "completed", "discarded", "deleted", "linked", "unlinked"]);
|
|
2456
|
+
var contentEffectSchema = z6.object({
|
|
2415
2457
|
surface: chatChangeTypeSchema,
|
|
2416
|
-
slug:
|
|
2458
|
+
slug: z6.string(),
|
|
2417
2459
|
op: effectOpSchema,
|
|
2418
|
-
staged:
|
|
2460
|
+
staged: z6.boolean()
|
|
2419
2461
|
});
|
|
2420
|
-
var actionEffectSchema =
|
|
2462
|
+
var actionEffectSchema = z6.object({
|
|
2421
2463
|
op: effectOpSchema,
|
|
2422
|
-
staged:
|
|
2423
|
-
name:
|
|
2424
|
-
description:
|
|
2425
|
-
priority:
|
|
2426
|
-
tags:
|
|
2427
|
-
status:
|
|
2428
|
-
note:
|
|
2429
|
-
reason:
|
|
2430
|
-
});
|
|
2431
|
-
var scheduledEffectSchema =
|
|
2464
|
+
staged: z6.boolean(),
|
|
2465
|
+
name: z6.string(),
|
|
2466
|
+
description: z6.string().nullable(),
|
|
2467
|
+
priority: z6.string().nullable(),
|
|
2468
|
+
tags: z6.array(z6.string()),
|
|
2469
|
+
status: z6.string().nullable(),
|
|
2470
|
+
note: z6.string().nullable(),
|
|
2471
|
+
reason: z6.string().nullable()
|
|
2472
|
+
});
|
|
2473
|
+
var scheduledEffectSchema = z6.object({
|
|
2432
2474
|
op: effectOpSchema,
|
|
2433
|
-
staged:
|
|
2434
|
-
name:
|
|
2435
|
-
summary:
|
|
2475
|
+
staged: z6.boolean(),
|
|
2476
|
+
name: z6.string(),
|
|
2477
|
+
summary: z6.string().nullable()
|
|
2436
2478
|
});
|
|
2437
|
-
var tagEffectSchema =
|
|
2479
|
+
var tagEffectSchema = z6.object({
|
|
2438
2480
|
op: effectOpSchema,
|
|
2439
|
-
staged:
|
|
2440
|
-
tagType:
|
|
2441
|
-
title:
|
|
2442
|
-
summary:
|
|
2443
|
-
configKeys:
|
|
2444
|
-
hasSecrets:
|
|
2445
|
-
});
|
|
2446
|
-
var adEffectSchema =
|
|
2447
|
-
platform:
|
|
2481
|
+
staged: z6.boolean(),
|
|
2482
|
+
tagType: z6.string(),
|
|
2483
|
+
title: z6.string().nullable(),
|
|
2484
|
+
summary: z6.string().nullable(),
|
|
2485
|
+
configKeys: z6.array(z6.string()),
|
|
2486
|
+
hasSecrets: z6.boolean()
|
|
2487
|
+
});
|
|
2488
|
+
var adEffectSchema = z6.object({
|
|
2489
|
+
platform: z6.enum(["google", "meta", "linkedin"]),
|
|
2448
2490
|
op: effectOpSchema,
|
|
2449
|
-
staged:
|
|
2450
|
-
entity:
|
|
2451
|
-
operation:
|
|
2452
|
-
summary:
|
|
2491
|
+
staged: z6.boolean(),
|
|
2492
|
+
entity: z6.string().nullable(),
|
|
2493
|
+
operation: z6.string().nullable(),
|
|
2494
|
+
summary: z6.string().nullable()
|
|
2453
2495
|
});
|
|
2454
|
-
var creativeEffectSchema =
|
|
2496
|
+
var creativeEffectSchema = z6.object({
|
|
2455
2497
|
op: effectOpSchema,
|
|
2456
|
-
staged:
|
|
2457
|
-
slug:
|
|
2458
|
-
title:
|
|
2459
|
-
status:
|
|
2460
|
-
});
|
|
2461
|
-
var chatEffectsSchema =
|
|
2462
|
-
content:
|
|
2463
|
-
actions:
|
|
2464
|
-
scheduledActions:
|
|
2465
|
-
tags:
|
|
2466
|
-
ads:
|
|
2467
|
-
google:
|
|
2468
|
-
meta:
|
|
2469
|
-
linkedin:
|
|
2498
|
+
staged: z6.boolean(),
|
|
2499
|
+
slug: z6.string(),
|
|
2500
|
+
title: z6.string().nullable(),
|
|
2501
|
+
status: z6.string().nullable()
|
|
2502
|
+
});
|
|
2503
|
+
var chatEffectsSchema = z6.object({
|
|
2504
|
+
content: z6.array(contentEffectSchema),
|
|
2505
|
+
actions: z6.array(actionEffectSchema),
|
|
2506
|
+
scheduledActions: z6.array(scheduledEffectSchema),
|
|
2507
|
+
tags: z6.array(tagEffectSchema),
|
|
2508
|
+
ads: z6.object({
|
|
2509
|
+
google: z6.array(adEffectSchema),
|
|
2510
|
+
meta: z6.array(adEffectSchema),
|
|
2511
|
+
linkedin: z6.array(adEffectSchema)
|
|
2470
2512
|
}),
|
|
2471
|
-
creatives:
|
|
2513
|
+
creatives: z6.array(creativeEffectSchema)
|
|
2472
2514
|
});
|
|
2473
|
-
var chatDetailSchema =
|
|
2474
|
-
id:
|
|
2475
|
-
title:
|
|
2515
|
+
var chatDetailSchema = z6.object({
|
|
2516
|
+
id: z6.string(),
|
|
2517
|
+
title: z6.string(),
|
|
2476
2518
|
status: chatInspectStatusSchema,
|
|
2477
|
-
createdAt:
|
|
2478
|
-
updatedAt:
|
|
2479
|
-
completedBySource:
|
|
2480
|
-
publishedAt:
|
|
2519
|
+
createdAt: z6.number(),
|
|
2520
|
+
updatedAt: z6.number(),
|
|
2521
|
+
completedBySource: z6.enum(["user", "bridge"]).nullable(),
|
|
2522
|
+
publishedAt: z6.number().nullable(),
|
|
2481
2523
|
/** The first user message — how this Session was originally asked. */
|
|
2482
|
-
kickoff:
|
|
2483
|
-
outputs:
|
|
2484
|
-
outputTotal:
|
|
2524
|
+
kickoff: z6.string().nullable(),
|
|
2525
|
+
outputs: z6.record(z6.string(), z6.number()),
|
|
2526
|
+
outputTotal: z6.number(),
|
|
2485
2527
|
/** The unified picture of everything this Session changed — git + DB. */
|
|
2486
2528
|
effects: chatEffectsSchema,
|
|
2487
|
-
threads:
|
|
2488
|
-
commits:
|
|
2529
|
+
threads: z6.array(chatThreadSummarySchema),
|
|
2530
|
+
commits: z6.array(chatCommitSummarySchema),
|
|
2489
2531
|
/** True when a real file-level diff is available via `baker chats diff`. */
|
|
2490
|
-
diffAvailable:
|
|
2532
|
+
diffAvailable: z6.boolean()
|
|
2491
2533
|
});
|
|
2492
|
-
var chatsViewResponseSchema =
|
|
2493
|
-
ok:
|
|
2534
|
+
var chatsViewResponseSchema = z6.object({
|
|
2535
|
+
ok: z6.literal(true),
|
|
2494
2536
|
data: chatDetailSchema
|
|
2495
2537
|
});
|
|
2496
|
-
var chatsTranscriptRequestSchema =
|
|
2497
|
-
chatId:
|
|
2498
|
-
limit:
|
|
2538
|
+
var chatsTranscriptRequestSchema = z6.object({
|
|
2539
|
+
chatId: z6.string(),
|
|
2540
|
+
limit: z6.number().int().min(1).max(1e3).optional(),
|
|
2499
2541
|
/** Return untruncated message text (compact truncates each entry). */
|
|
2500
|
-
full:
|
|
2542
|
+
full: z6.boolean().optional()
|
|
2501
2543
|
});
|
|
2502
|
-
var transcriptEntrySchema =
|
|
2503
|
-
role:
|
|
2504
|
-
text:
|
|
2544
|
+
var transcriptEntrySchema = z6.object({
|
|
2545
|
+
role: z6.string(),
|
|
2546
|
+
text: z6.string()
|
|
2505
2547
|
});
|
|
2506
|
-
var chatsTranscriptResponseSchema =
|
|
2507
|
-
ok:
|
|
2508
|
-
data:
|
|
2509
|
-
chatId:
|
|
2510
|
-
entries:
|
|
2548
|
+
var chatsTranscriptResponseSchema = z6.object({
|
|
2549
|
+
ok: z6.literal(true),
|
|
2550
|
+
data: z6.object({
|
|
2551
|
+
chatId: z6.string(),
|
|
2552
|
+
entries: z6.array(transcriptEntrySchema),
|
|
2511
2553
|
/** True when older entries were dropped to fit `limit`. */
|
|
2512
|
-
truncated:
|
|
2554
|
+
truncated: z6.boolean()
|
|
2513
2555
|
})
|
|
2514
2556
|
});
|
|
2515
|
-
var chatsDiffRequestSchema =
|
|
2516
|
-
chatId:
|
|
2557
|
+
var chatsDiffRequestSchema = z6.object({
|
|
2558
|
+
chatId: z6.string(),
|
|
2517
2559
|
surface: repoSurfaceSchema.optional(),
|
|
2518
2560
|
/** Include the unified-diff `patch` text per file (compact omits it). */
|
|
2519
|
-
full:
|
|
2561
|
+
full: z6.boolean().optional(),
|
|
2520
2562
|
/**
|
|
2521
2563
|
* Opt in to reading an in-progress (unpublished) Session's changes straight
|
|
2522
2564
|
* from its live Runtime — resumes the paused sandbox and runs a read-only git
|
|
2523
2565
|
* diff. Slower and only works while the sandbox still exists (not discarded).
|
|
2524
2566
|
* Ignored for published Sessions, which always read from git.
|
|
2525
2567
|
*/
|
|
2526
|
-
live:
|
|
2568
|
+
live: z6.boolean().optional()
|
|
2527
2569
|
});
|
|
2528
|
-
var diffFileSchema =
|
|
2529
|
-
path:
|
|
2570
|
+
var diffFileSchema = z6.object({
|
|
2571
|
+
path: z6.string(),
|
|
2530
2572
|
surface: repoSurfaceSchema.nullable(),
|
|
2531
|
-
status:
|
|
2532
|
-
additions:
|
|
2533
|
-
deletions:
|
|
2534
|
-
patch:
|
|
2535
|
-
});
|
|
2536
|
-
var diffSourceSchema =
|
|
2537
|
-
var chatsDiffResponseSchema =
|
|
2538
|
-
ok:
|
|
2539
|
-
data:
|
|
2540
|
-
chatId:
|
|
2573
|
+
status: z6.string(),
|
|
2574
|
+
additions: z6.number(),
|
|
2575
|
+
deletions: z6.number(),
|
|
2576
|
+
patch: z6.string().optional()
|
|
2577
|
+
});
|
|
2578
|
+
var diffSourceSchema = z6.enum(["published", "live"]);
|
|
2579
|
+
var chatsDiffResponseSchema = z6.object({
|
|
2580
|
+
ok: z6.literal(true),
|
|
2581
|
+
data: z6.object({
|
|
2582
|
+
chatId: z6.string(),
|
|
2541
2583
|
/** False when no published git diff exists (in-progress Session or unlinked repo). */
|
|
2542
|
-
available:
|
|
2543
|
-
reason:
|
|
2584
|
+
available: z6.boolean(),
|
|
2585
|
+
reason: z6.string().optional(),
|
|
2544
2586
|
/** Present when available — how the diff was obtained. */
|
|
2545
2587
|
source: diffSourceSchema.optional(),
|
|
2546
2588
|
/** True when the live diff was capped (very large in-progress change set). */
|
|
2547
|
-
truncated:
|
|
2548
|
-
files:
|
|
2589
|
+
truncated: z6.boolean().optional(),
|
|
2590
|
+
files: z6.array(diffFileSchema)
|
|
2549
2591
|
})
|
|
2550
2592
|
});
|
|
2551
2593
|
|
|
2552
2594
|
// ../api/src/flows.ts
|
|
2553
|
-
import { z as
|
|
2595
|
+
import { z as z7 } from "zod";
|
|
2554
2596
|
var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
2555
2597
|
"email",
|
|
2556
2598
|
"zapier",
|
|
@@ -2561,7 +2603,7 @@ var FLOW_SECRET_SIDE_EFFECT_TYPES = [
|
|
|
2561
2603
|
"crmble",
|
|
2562
2604
|
"goHighlevelContact"
|
|
2563
2605
|
];
|
|
2564
|
-
var flowSideEffectTypeSchema =
|
|
2606
|
+
var flowSideEffectTypeSchema = z7.enum(FLOW_SECRET_SIDE_EFFECT_TYPES);
|
|
2565
2607
|
var FLOW_SECRET_FIELDS = {
|
|
2566
2608
|
email: [],
|
|
2567
2609
|
zapier: ["zapUrl"],
|
|
@@ -2589,94 +2631,94 @@ var FLOW_RESOURCE_NODE_TYPES = [
|
|
|
2589
2631
|
"highlevel",
|
|
2590
2632
|
"highlevelForm"
|
|
2591
2633
|
];
|
|
2592
|
-
var flowResourceNodeTypeSchema =
|
|
2593
|
-
var flowInputRequestSchema =
|
|
2594
|
-
|
|
2634
|
+
var flowResourceNodeTypeSchema = z7.enum(FLOW_RESOURCE_NODE_TYPES);
|
|
2635
|
+
var flowInputRequestSchema = z7.discriminatedUnion("target", [
|
|
2636
|
+
z7.object({
|
|
2595
2637
|
/** Configure a side effect's `encryptedConfig` (+ `oauthProviderId` for OAuth types). */
|
|
2596
|
-
target:
|
|
2597
|
-
flowSlug:
|
|
2638
|
+
target: z7.literal("sideEffect"),
|
|
2639
|
+
flowSlug: z7.string(),
|
|
2598
2640
|
/** `id` of the FlowNode holding the side effect. */
|
|
2599
|
-
nodeId:
|
|
2641
|
+
nodeId: z7.string(),
|
|
2600
2642
|
/** `id` of the side effect within that node's `sideEffects[]`. */
|
|
2601
|
-
sideEffectId:
|
|
2643
|
+
sideEffectId: z7.string(),
|
|
2602
2644
|
sideEffectType: flowSideEffectTypeSchema,
|
|
2603
2645
|
/** Non-secret `encryptedConfig` values the agent proposes (e.g. webhook apiUrl, auth type). Secret keys are stripped at every boundary. */
|
|
2604
|
-
prefilledConfig:
|
|
2646
|
+
prefilledConfig: z7.record(z7.string(), z7.string()).optional(),
|
|
2605
2647
|
/** Secret credential field names the agent asks the user to provide. */
|
|
2606
|
-
requestedSecretFields:
|
|
2607
|
-
message:
|
|
2648
|
+
requestedSecretFields: z7.array(z7.string()).optional(),
|
|
2649
|
+
message: z7.string().optional()
|
|
2608
2650
|
}),
|
|
2609
|
-
|
|
2651
|
+
z7.object({
|
|
2610
2652
|
/** Configure a widget node's third-party `form.external` (+ `providerId`). */
|
|
2611
|
-
target:
|
|
2612
|
-
flowSlug:
|
|
2653
|
+
target: z7.literal("node"),
|
|
2654
|
+
flowSlug: z7.string(),
|
|
2613
2655
|
/** `id` of the widget FlowNode. */
|
|
2614
|
-
nodeId:
|
|
2656
|
+
nodeId: z7.string(),
|
|
2615
2657
|
nodeType: flowResourceNodeTypeSchema,
|
|
2616
|
-
message:
|
|
2658
|
+
message: z7.string().optional()
|
|
2617
2659
|
})
|
|
2618
2660
|
]);
|
|
2619
|
-
var flowInputToolInputSchema =
|
|
2620
|
-
requests:
|
|
2661
|
+
var flowInputToolInputSchema = z7.object({
|
|
2662
|
+
requests: z7.array(flowInputRequestSchema).min(1).max(8)
|
|
2621
2663
|
});
|
|
2622
|
-
var flowInputResultSchema =
|
|
2623
|
-
|
|
2624
|
-
status:
|
|
2664
|
+
var flowInputResultSchema = z7.discriminatedUnion("status", [
|
|
2665
|
+
z7.object({
|
|
2666
|
+
status: z7.literal("submitted"),
|
|
2625
2667
|
/** Echoes which piece this result resolves. */
|
|
2626
|
-
nodeId:
|
|
2627
|
-
sideEffectId:
|
|
2668
|
+
nodeId: z7.string(),
|
|
2669
|
+
sideEffectId: z7.string().optional(),
|
|
2628
2670
|
/** Names of secret fields the user provided. Never values. */
|
|
2629
|
-
secretFieldsSet:
|
|
2671
|
+
secretFieldsSet: z7.array(z7.string()),
|
|
2630
2672
|
/** Non-secret human summary of what was configured (e.g. "HubSpot form 'Contact us' — 7 fields"). */
|
|
2631
|
-
note:
|
|
2673
|
+
note: z7.string().optional()
|
|
2632
2674
|
}),
|
|
2633
|
-
|
|
2634
|
-
status:
|
|
2635
|
-
nodeId:
|
|
2636
|
-
sideEffectId:
|
|
2637
|
-
reason:
|
|
2675
|
+
z7.object({
|
|
2676
|
+
status: z7.literal("declined"),
|
|
2677
|
+
nodeId: z7.string(),
|
|
2678
|
+
sideEffectId: z7.string().optional(),
|
|
2679
|
+
reason: z7.string().optional()
|
|
2638
2680
|
})
|
|
2639
2681
|
]);
|
|
2640
|
-
var flowInputToolResultSchema =
|
|
2641
|
-
results:
|
|
2682
|
+
var flowInputToolResultSchema = z7.object({
|
|
2683
|
+
results: z7.array(flowInputResultSchema)
|
|
2642
2684
|
});
|
|
2643
|
-
var flowsListRequestSchema =
|
|
2644
|
-
var flowSummarySchema =
|
|
2645
|
-
slug:
|
|
2646
|
-
name:
|
|
2685
|
+
var flowsListRequestSchema = z7.object({ chatId: z7.string() });
|
|
2686
|
+
var flowSummarySchema = z7.object({
|
|
2687
|
+
slug: z7.string(),
|
|
2688
|
+
name: z7.string(),
|
|
2647
2689
|
/** Count of nodes with an unconfigured confidential field (secret missing / resource not picked / connection needed). */
|
|
2648
|
-
needsConfig:
|
|
2690
|
+
needsConfig: z7.number()
|
|
2649
2691
|
});
|
|
2650
|
-
var flowsListResponseSchema =
|
|
2651
|
-
var flowsShowRequestSchema =
|
|
2652
|
-
chatId:
|
|
2653
|
-
slug:
|
|
2654
|
-
full:
|
|
2692
|
+
var flowsListResponseSchema = z7.object({ flows: z7.array(flowSummarySchema) });
|
|
2693
|
+
var flowsShowRequestSchema = z7.object({
|
|
2694
|
+
chatId: z7.string(),
|
|
2695
|
+
slug: z7.string(),
|
|
2696
|
+
full: z7.boolean().optional()
|
|
2655
2697
|
});
|
|
2656
|
-
var flowConfigStatusSchema =
|
|
2657
|
-
nodeId:
|
|
2658
|
-
nodeName:
|
|
2698
|
+
var flowConfigStatusSchema = z7.object({
|
|
2699
|
+
nodeId: z7.string(),
|
|
2700
|
+
nodeName: z7.string().optional(),
|
|
2659
2701
|
/** "sideEffect" credential/connection, or "node" widget resource. */
|
|
2660
|
-
target:
|
|
2661
|
-
sideEffectId:
|
|
2662
|
-
kind:
|
|
2702
|
+
target: z7.enum(["sideEffect", "node"]),
|
|
2703
|
+
sideEffectId: z7.string().optional(),
|
|
2704
|
+
kind: z7.string(),
|
|
2663
2705
|
/** Human status, e.g. "webhook — apiKeyValue [set], bearerToken [missing]" / "HubSpot form [not selected]" / "Pipedrive [needs connection]". */
|
|
2664
|
-
status:
|
|
2706
|
+
status: z7.string(),
|
|
2665
2707
|
/** True when a `request_flow_input` call is still needed for this piece. */
|
|
2666
|
-
needsInput:
|
|
2708
|
+
needsInput: z7.boolean()
|
|
2667
2709
|
});
|
|
2668
|
-
var flowsShowResponseSchema =
|
|
2669
|
-
slug:
|
|
2670
|
-
name:
|
|
2710
|
+
var flowsShowResponseSchema = z7.object({
|
|
2711
|
+
slug: z7.string(),
|
|
2712
|
+
name: z7.string(),
|
|
2671
2713
|
/** Confidential fields and whether each is configured. */
|
|
2672
|
-
config:
|
|
2714
|
+
config: z7.array(flowConfigStatusSchema),
|
|
2673
2715
|
/** Present only with `--full`: the whole flow tree, secret values redacted. */
|
|
2674
|
-
tree:
|
|
2716
|
+
tree: z7.unknown().optional()
|
|
2675
2717
|
});
|
|
2676
2718
|
|
|
2677
2719
|
// ../api/src/history.ts
|
|
2678
|
-
import { z as
|
|
2679
|
-
var historyCategorySchema =
|
|
2720
|
+
import { z as z8 } from "zod";
|
|
2721
|
+
var historyCategorySchema = z8.enum([
|
|
2680
2722
|
"publish",
|
|
2681
2723
|
"chat",
|
|
2682
2724
|
"action",
|
|
@@ -2694,184 +2736,184 @@ var historyCategorySchema = z7.enum([
|
|
|
2694
2736
|
"integration",
|
|
2695
2737
|
"tag_manager"
|
|
2696
2738
|
]);
|
|
2697
|
-
var historyListRequestSchema =
|
|
2698
|
-
limit:
|
|
2739
|
+
var historyListRequestSchema = z8.object({
|
|
2740
|
+
limit: z8.number().int().min(1).max(200).optional(),
|
|
2699
2741
|
category: historyCategorySchema.optional(),
|
|
2700
2742
|
/** Only entries from the last N days. */
|
|
2701
|
-
days:
|
|
2743
|
+
days: z8.number().int().min(1).max(365).optional(),
|
|
2702
2744
|
/** Include raw metadata on each entry (compact by default). */
|
|
2703
|
-
full:
|
|
2745
|
+
full: z8.boolean().optional()
|
|
2704
2746
|
});
|
|
2705
|
-
var historyEntrySchema =
|
|
2706
|
-
id:
|
|
2747
|
+
var historyEntrySchema = z8.object({
|
|
2748
|
+
id: z8.string(),
|
|
2707
2749
|
/** Epoch ms. */
|
|
2708
|
-
at:
|
|
2750
|
+
at: z8.number(),
|
|
2709
2751
|
category: historyCategorySchema,
|
|
2710
2752
|
/** Dotted action id, e.g. "publish.commit", "member.invite_create". */
|
|
2711
|
-
action:
|
|
2712
|
-
actorType:
|
|
2753
|
+
action: z8.string(),
|
|
2754
|
+
actorType: z8.enum(["user", "agent", "system"]),
|
|
2713
2755
|
/** Display name of the acting user, when the actor is a user. */
|
|
2714
|
-
actor:
|
|
2756
|
+
actor: z8.string().nullable(),
|
|
2715
2757
|
/** What the change touched — commit subject, chat title, member email, tag type, … */
|
|
2716
|
-
target:
|
|
2717
|
-
metadata:
|
|
2758
|
+
target: z8.string().nullable(),
|
|
2759
|
+
metadata: z8.record(z8.string(), z8.unknown()).optional()
|
|
2718
2760
|
});
|
|
2719
|
-
var historyListResponseSchema =
|
|
2720
|
-
ok:
|
|
2721
|
-
data:
|
|
2761
|
+
var historyListResponseSchema = z8.object({
|
|
2762
|
+
ok: z8.literal(true),
|
|
2763
|
+
data: z8.object({ entries: z8.array(historyEntrySchema) })
|
|
2722
2764
|
});
|
|
2723
2765
|
|
|
2724
2766
|
// ../api/src/hubspot.ts
|
|
2725
|
-
import { z as
|
|
2726
|
-
var hubspotEmbedTypeSchema =
|
|
2727
|
-
var hubspotPostSubmitActionSchema =
|
|
2728
|
-
type:
|
|
2729
|
-
value:
|
|
2730
|
-
});
|
|
2731
|
-
var hubspotFormFieldSchema =
|
|
2732
|
-
name:
|
|
2733
|
-
label:
|
|
2734
|
-
fieldType:
|
|
2735
|
-
objectTypeId:
|
|
2736
|
-
required:
|
|
2737
|
-
hidden:
|
|
2738
|
-
placeholder:
|
|
2739
|
-
description:
|
|
2740
|
-
options:
|
|
2741
|
-
});
|
|
2742
|
-
var hubspotFormSummarySchema =
|
|
2743
|
-
id:
|
|
2744
|
-
name:
|
|
2767
|
+
import { z as z9 } from "zod";
|
|
2768
|
+
var hubspotEmbedTypeSchema = z9.enum(["legacy", "v4", "unknown"]);
|
|
2769
|
+
var hubspotPostSubmitActionSchema = z9.object({
|
|
2770
|
+
type: z9.enum(["redirect_url", "thank_you"]),
|
|
2771
|
+
value: z9.string()
|
|
2772
|
+
});
|
|
2773
|
+
var hubspotFormFieldSchema = z9.object({
|
|
2774
|
+
name: z9.string(),
|
|
2775
|
+
label: z9.string(),
|
|
2776
|
+
fieldType: z9.string(),
|
|
2777
|
+
objectTypeId: z9.string().optional(),
|
|
2778
|
+
required: z9.boolean().optional(),
|
|
2779
|
+
hidden: z9.boolean().optional(),
|
|
2780
|
+
placeholder: z9.string().optional(),
|
|
2781
|
+
description: z9.string().optional(),
|
|
2782
|
+
options: z9.array(z9.object({ label: z9.string(), value: z9.string() })).optional()
|
|
2783
|
+
});
|
|
2784
|
+
var hubspotFormSummarySchema = z9.object({
|
|
2785
|
+
id: z9.string(),
|
|
2786
|
+
name: z9.string(),
|
|
2745
2787
|
embedType: hubspotEmbedTypeSchema,
|
|
2746
2788
|
/** Total visible + hidden fields across every field group. */
|
|
2747
|
-
fieldCount:
|
|
2789
|
+
fieldCount: z9.number().int(),
|
|
2748
2790
|
postSubmitAction: hubspotPostSubmitActionSchema.nullable()
|
|
2749
2791
|
});
|
|
2750
|
-
var hubspotFormsListRequestSchema =
|
|
2792
|
+
var hubspotFormsListRequestSchema = z9.object({
|
|
2751
2793
|
/** Case-insensitive substring match on the form name. */
|
|
2752
|
-
search:
|
|
2794
|
+
search: z9.string().min(1).max(200).optional(),
|
|
2753
2795
|
/** Only forms whose post-submit action redirects away. */
|
|
2754
|
-
redirectingOnly:
|
|
2796
|
+
redirectingOnly: z9.boolean().optional(),
|
|
2755
2797
|
embedType: hubspotEmbedTypeSchema.optional()
|
|
2756
2798
|
});
|
|
2757
|
-
var hubspotFormsListResponseSchema =
|
|
2758
|
-
ok:
|
|
2759
|
-
data:
|
|
2799
|
+
var hubspotFormsListResponseSchema = z9.object({
|
|
2800
|
+
ok: z9.literal(true),
|
|
2801
|
+
data: z9.object({
|
|
2760
2802
|
/** Same for every form on the account — sent once, not per row. */
|
|
2761
|
-
portalId:
|
|
2762
|
-
forms:
|
|
2803
|
+
portalId: z9.number().nullable(),
|
|
2804
|
+
forms: z9.array(hubspotFormSummarySchema)
|
|
2763
2805
|
})
|
|
2764
2806
|
});
|
|
2765
|
-
var hubspotFormsViewRequestSchema =
|
|
2766
|
-
formId:
|
|
2807
|
+
var hubspotFormsViewRequestSchema = z9.object({
|
|
2808
|
+
formId: z9.string().min(1),
|
|
2767
2809
|
/** Include the untouched HubSpot payload alongside the summarized view. */
|
|
2768
|
-
full:
|
|
2810
|
+
full: z9.boolean().optional(),
|
|
2769
2811
|
/**
|
|
2770
2812
|
* Return the resource blob to write into a flow node's `form.external`
|
|
2771
2813
|
* instead of the human-readable view.
|
|
2772
2814
|
*/
|
|
2773
|
-
asNode:
|
|
2815
|
+
asNode: z9.boolean().optional()
|
|
2774
2816
|
});
|
|
2775
2817
|
var hubspotFormDetailSchema = hubspotFormSummarySchema.extend({
|
|
2776
|
-
portalId:
|
|
2777
|
-
captchaEnabled:
|
|
2778
|
-
language:
|
|
2779
|
-
fields:
|
|
2818
|
+
portalId: z9.number().nullable(),
|
|
2819
|
+
captchaEnabled: z9.boolean(),
|
|
2820
|
+
language: z9.string().nullable(),
|
|
2821
|
+
fields: z9.array(hubspotFormFieldSchema),
|
|
2780
2822
|
/** HubSpot's "Data privacy and consent options"; `null` when not configured. */
|
|
2781
|
-
legalConsentType:
|
|
2782
|
-
raw:
|
|
2823
|
+
legalConsentType: z9.string().nullable(),
|
|
2824
|
+
raw: z9.record(z9.string(), z9.unknown()).optional()
|
|
2783
2825
|
});
|
|
2784
|
-
var hubspotFormNodeExternalSchema =
|
|
2785
|
-
id:
|
|
2786
|
-
name:
|
|
2787
|
-
providerId:
|
|
2788
|
-
portalId:
|
|
2789
|
-
embedType:
|
|
2790
|
-
region:
|
|
2791
|
-
captchaEnabled:
|
|
2792
|
-
fieldGroups:
|
|
2793
|
-
configuration:
|
|
2794
|
-
legalConsentOptions:
|
|
2795
|
-
});
|
|
2796
|
-
var hubspotFormsViewResponseSchema =
|
|
2797
|
-
ok:
|
|
2798
|
-
data:
|
|
2826
|
+
var hubspotFormNodeExternalSchema = z9.object({
|
|
2827
|
+
id: z9.string(),
|
|
2828
|
+
name: z9.string(),
|
|
2829
|
+
providerId: z9.string(),
|
|
2830
|
+
portalId: z9.number(),
|
|
2831
|
+
embedType: z9.enum(["legacy", "v4"]).optional(),
|
|
2832
|
+
region: z9.string().optional(),
|
|
2833
|
+
captchaEnabled: z9.boolean(),
|
|
2834
|
+
fieldGroups: z9.array(z9.object({ fields: z9.array(hubspotFormFieldSchema) })),
|
|
2835
|
+
configuration: z9.object({ postSubmitAction: hubspotPostSubmitActionSchema }).optional(),
|
|
2836
|
+
legalConsentOptions: z9.record(z9.string(), z9.unknown()).optional()
|
|
2837
|
+
});
|
|
2838
|
+
var hubspotFormsViewResponseSchema = z9.object({
|
|
2839
|
+
ok: z9.literal(true),
|
|
2840
|
+
data: z9.object({
|
|
2799
2841
|
form: hubspotFormDetailSchema.optional(),
|
|
2800
2842
|
/** Present instead of `form` when `asNode` was requested. */
|
|
2801
2843
|
external: hubspotFormNodeExternalSchema.optional()
|
|
2802
2844
|
})
|
|
2803
2845
|
});
|
|
2804
|
-
var hubspotMeetingFieldSchema =
|
|
2805
|
-
name:
|
|
2806
|
-
label:
|
|
2807
|
-
fieldType:
|
|
2808
|
-
isRequired:
|
|
2809
|
-
isCustom:
|
|
2810
|
-
options:
|
|
2811
|
-
});
|
|
2812
|
-
var hubspotMeetingSummarySchema =
|
|
2813
|
-
id:
|
|
2814
|
-
name:
|
|
2815
|
-
slug:
|
|
2816
|
-
linkType:
|
|
2846
|
+
var hubspotMeetingFieldSchema = z9.object({
|
|
2847
|
+
name: z9.string(),
|
|
2848
|
+
label: z9.string(),
|
|
2849
|
+
fieldType: z9.string(),
|
|
2850
|
+
isRequired: z9.boolean(),
|
|
2851
|
+
isCustom: z9.boolean(),
|
|
2852
|
+
options: z9.array(z9.object({ label: z9.string(), value: z9.string() })).optional()
|
|
2853
|
+
});
|
|
2854
|
+
var hubspotMeetingSummarySchema = z9.object({
|
|
2855
|
+
id: z9.string(),
|
|
2856
|
+
name: z9.string(),
|
|
2857
|
+
slug: z9.string(),
|
|
2858
|
+
linkType: z9.string(),
|
|
2817
2859
|
/**
|
|
2818
2860
|
* Where HubSpot sends the visitor after booking. `null` means either "no
|
|
2819
2861
|
* redirect" or "not known" — read `redirectKnown` before concluding.
|
|
2820
2862
|
*/
|
|
2821
|
-
redirectUrl:
|
|
2863
|
+
redirectUrl: z9.string().nullable(),
|
|
2822
2864
|
/**
|
|
2823
2865
|
* False when the list endpoint omitted `customParams` entirely, in which case
|
|
2824
2866
|
* `redirectUrl: null` is an absence of information, not a confirmed absence
|
|
2825
2867
|
* of a redirect. `meetings view <slug>` resolves it.
|
|
2826
2868
|
*/
|
|
2827
|
-
redirectKnown:
|
|
2869
|
+
redirectKnown: z9.boolean(),
|
|
2828
2870
|
/**
|
|
2829
2871
|
* Booking-form field count, or `null` when the list endpoint did not carry
|
|
2830
2872
|
* `customParams` — HubSpot only populates those reliably on the per-slug
|
|
2831
2873
|
* booking endpoint, so `meetings view <slug>` is the source of truth.
|
|
2832
2874
|
*/
|
|
2833
|
-
fieldCount:
|
|
2875
|
+
fieldCount: z9.number().int().nullable()
|
|
2834
2876
|
});
|
|
2835
|
-
var hubspotMeetingsListRequestSchema =
|
|
2836
|
-
search:
|
|
2877
|
+
var hubspotMeetingsListRequestSchema = z9.object({
|
|
2878
|
+
search: z9.string().min(1).max(200).optional(),
|
|
2837
2879
|
/** Only meeting links that redirect after booking. */
|
|
2838
|
-
redirectingOnly:
|
|
2880
|
+
redirectingOnly: z9.boolean().optional()
|
|
2839
2881
|
});
|
|
2840
|
-
var hubspotMeetingsListResponseSchema =
|
|
2841
|
-
ok:
|
|
2842
|
-
data:
|
|
2882
|
+
var hubspotMeetingsListResponseSchema = z9.object({
|
|
2883
|
+
ok: z9.literal(true),
|
|
2884
|
+
data: z9.object({ meetings: z9.array(hubspotMeetingSummarySchema) })
|
|
2843
2885
|
});
|
|
2844
|
-
var hubspotMeetingsViewRequestSchema =
|
|
2845
|
-
slug:
|
|
2886
|
+
var hubspotMeetingsViewRequestSchema = z9.object({
|
|
2887
|
+
slug: z9.string().min(1),
|
|
2846
2888
|
/**
|
|
2847
2889
|
* Return the resource blob to write into a flow node's `form.external`
|
|
2848
2890
|
* instead of the human-readable view.
|
|
2849
2891
|
*/
|
|
2850
|
-
asNode:
|
|
2851
|
-
});
|
|
2852
|
-
var hubspotMeetingDetailSchema =
|
|
2853
|
-
name:
|
|
2854
|
-
slug:
|
|
2855
|
-
link:
|
|
2856
|
-
linkType:
|
|
2857
|
-
redirectUrl:
|
|
2858
|
-
fields:
|
|
2859
|
-
});
|
|
2860
|
-
var hubspotMeetingNodeExternalSchema =
|
|
2861
|
-
name:
|
|
2862
|
-
slug:
|
|
2892
|
+
asNode: z9.boolean().optional()
|
|
2893
|
+
});
|
|
2894
|
+
var hubspotMeetingDetailSchema = z9.object({
|
|
2895
|
+
name: z9.string(),
|
|
2896
|
+
slug: z9.string(),
|
|
2897
|
+
link: z9.string(),
|
|
2898
|
+
linkType: z9.string(),
|
|
2899
|
+
redirectUrl: z9.string().nullable(),
|
|
2900
|
+
fields: z9.array(hubspotMeetingFieldSchema)
|
|
2901
|
+
});
|
|
2902
|
+
var hubspotMeetingNodeExternalSchema = z9.object({
|
|
2903
|
+
name: z9.string(),
|
|
2904
|
+
slug: z9.string(),
|
|
2863
2905
|
/** Non-empty: an empty booking link renders an iframe pointed at nothing. */
|
|
2864
|
-
link:
|
|
2865
|
-
linkType:
|
|
2866
|
-
providerId:
|
|
2867
|
-
customParams:
|
|
2868
|
-
formFields:
|
|
2869
|
-
redirectUrl:
|
|
2906
|
+
link: z9.string().min(1),
|
|
2907
|
+
linkType: z9.enum(["PERSONAL_LINK", "GROUP_CALENDAR", "ROUND_ROBIN_CALENDAR"]),
|
|
2908
|
+
providerId: z9.string(),
|
|
2909
|
+
customParams: z9.object({
|
|
2910
|
+
formFields: z9.array(hubspotMeetingFieldSchema),
|
|
2911
|
+
redirectUrl: z9.string().nullable()
|
|
2870
2912
|
})
|
|
2871
2913
|
});
|
|
2872
|
-
var hubspotMeetingsViewResponseSchema =
|
|
2873
|
-
ok:
|
|
2874
|
-
data:
|
|
2914
|
+
var hubspotMeetingsViewResponseSchema = z9.object({
|
|
2915
|
+
ok: z9.literal(true),
|
|
2916
|
+
data: z9.object({
|
|
2875
2917
|
meeting: hubspotMeetingDetailSchema.optional(),
|
|
2876
2918
|
/** Present instead of `meeting` when `asNode` was requested. */
|
|
2877
2919
|
external: hubspotMeetingNodeExternalSchema.optional()
|
|
@@ -2879,8 +2921,8 @@ var hubspotMeetingsViewResponseSchema = z8.object({
|
|
|
2879
2921
|
});
|
|
2880
2922
|
|
|
2881
2923
|
// ../api/src/images.ts
|
|
2882
|
-
import { z as
|
|
2883
|
-
var imageSourceSchema =
|
|
2924
|
+
import { z as z10 } from "zod";
|
|
2925
|
+
var imageSourceSchema = z10.enum([
|
|
2884
2926
|
"uploaded",
|
|
2885
2927
|
"website",
|
|
2886
2928
|
"google_testimonial",
|
|
@@ -2896,49 +2938,49 @@ var imageSourceSchema = z9.enum([
|
|
|
2896
2938
|
"pinterest",
|
|
2897
2939
|
"ai_generated"
|
|
2898
2940
|
]);
|
|
2899
|
-
var imageStatusSchema =
|
|
2900
|
-
var upscaleConfigSchema =
|
|
2901
|
-
model:
|
|
2902
|
-
input:
|
|
2903
|
-
scale_factor:
|
|
2904
|
-
creativity:
|
|
2905
|
-
output_format:
|
|
2941
|
+
var imageStatusSchema = z10.enum(["uploading", "processing", "ready", "error"]);
|
|
2942
|
+
var upscaleConfigSchema = z10.object({
|
|
2943
|
+
model: z10.literal("philz1337x/crystal-upscaler"),
|
|
2944
|
+
input: z10.object({
|
|
2945
|
+
scale_factor: z10.number(),
|
|
2946
|
+
creativity: z10.number(),
|
|
2947
|
+
output_format: z10.string()
|
|
2906
2948
|
}),
|
|
2907
|
-
status:
|
|
2949
|
+
status: z10.enum(["pending", "completed"])
|
|
2908
2950
|
});
|
|
2909
|
-
var imageDocSchema =
|
|
2910
|
-
_id:
|
|
2911
|
-
_creationTime:
|
|
2912
|
-
companyId:
|
|
2913
|
-
storageKey:
|
|
2951
|
+
var imageDocSchema = z10.object({
|
|
2952
|
+
_id: z10.string(),
|
|
2953
|
+
_creationTime: z10.number(),
|
|
2954
|
+
companyId: z10.string(),
|
|
2955
|
+
storageKey: z10.string(),
|
|
2914
2956
|
upscaleConfig: upscaleConfigSchema.optional(),
|
|
2915
|
-
upscaledStorageKey:
|
|
2916
|
-
name:
|
|
2917
|
-
description:
|
|
2918
|
-
tags:
|
|
2919
|
-
source:
|
|
2920
|
-
externalId:
|
|
2921
|
-
externalUrl:
|
|
2922
|
-
contentHash:
|
|
2923
|
-
sourceId:
|
|
2924
|
-
descriptionContext:
|
|
2925
|
-
width:
|
|
2926
|
-
height:
|
|
2927
|
-
aspectRatio:
|
|
2928
|
-
dominantColor:
|
|
2929
|
-
imagePalette:
|
|
2930
|
-
thumbhashDataUri:
|
|
2931
|
-
isLightImage:
|
|
2932
|
-
descriptionEmbedding:
|
|
2933
|
-
imageEmbedding:
|
|
2934
|
-
searchText:
|
|
2957
|
+
upscaledStorageKey: z10.string().optional(),
|
|
2958
|
+
name: z10.string(),
|
|
2959
|
+
description: z10.string(),
|
|
2960
|
+
tags: z10.array(z10.string()),
|
|
2961
|
+
source: z10.string(),
|
|
2962
|
+
externalId: z10.string().optional(),
|
|
2963
|
+
externalUrl: z10.string().optional(),
|
|
2964
|
+
contentHash: z10.string().optional(),
|
|
2965
|
+
sourceId: z10.string().optional(),
|
|
2966
|
+
descriptionContext: z10.string().optional(),
|
|
2967
|
+
width: z10.number().optional(),
|
|
2968
|
+
height: z10.number().optional(),
|
|
2969
|
+
aspectRatio: z10.number().optional(),
|
|
2970
|
+
dominantColor: z10.string().optional(),
|
|
2971
|
+
imagePalette: z10.array(z10.string()).optional(),
|
|
2972
|
+
thumbhashDataUri: z10.string().optional(),
|
|
2973
|
+
isLightImage: z10.boolean().optional(),
|
|
2974
|
+
descriptionEmbedding: z10.array(z10.number()).optional(),
|
|
2975
|
+
imageEmbedding: z10.array(z10.number()).optional(),
|
|
2976
|
+
searchText: z10.string().optional(),
|
|
2935
2977
|
status: imageStatusSchema,
|
|
2936
|
-
errorMessage:
|
|
2937
|
-
createdAt:
|
|
2938
|
-
updatedAt:
|
|
2939
|
-
imageUrl:
|
|
2978
|
+
errorMessage: z10.string().optional(),
|
|
2979
|
+
createdAt: z10.number(),
|
|
2980
|
+
updatedAt: z10.number(),
|
|
2981
|
+
imageUrl: z10.string()
|
|
2940
2982
|
});
|
|
2941
|
-
var imageHitSourceSchema =
|
|
2983
|
+
var imageHitSourceSchema = z10.enum([
|
|
2942
2984
|
"library",
|
|
2943
2985
|
"magnific",
|
|
2944
2986
|
"google_images",
|
|
@@ -2949,145 +2991,145 @@ var imageHitSourceSchema = z9.enum([
|
|
|
2949
2991
|
"giphy",
|
|
2950
2992
|
"pinterest"
|
|
2951
2993
|
]);
|
|
2952
|
-
var imageHitSchema =
|
|
2994
|
+
var imageHitSchema = z10.object({
|
|
2953
2995
|
source: imageHitSourceSchema,
|
|
2954
|
-
url:
|
|
2955
|
-
thumbnailUrl:
|
|
2956
|
-
width:
|
|
2957
|
-
height:
|
|
2958
|
-
aspectRatio:
|
|
2959
|
-
dominantColor:
|
|
2960
|
-
externalId:
|
|
2961
|
-
externalUrl:
|
|
2962
|
-
providerMeta:
|
|
2963
|
-
descriptionContext:
|
|
2964
|
-
_id:
|
|
2965
|
-
name:
|
|
2966
|
-
description:
|
|
2967
|
-
tags:
|
|
2968
|
-
score:
|
|
2969
|
-
alsoInLibrary:
|
|
2970
|
-
prefetchedBytes:
|
|
2971
|
-
prefetchedContentType:
|
|
2996
|
+
url: z10.string(),
|
|
2997
|
+
thumbnailUrl: z10.string().optional(),
|
|
2998
|
+
width: z10.number().optional(),
|
|
2999
|
+
height: z10.number().optional(),
|
|
3000
|
+
aspectRatio: z10.number().optional(),
|
|
3001
|
+
dominantColor: z10.string().optional(),
|
|
3002
|
+
externalId: z10.string().optional(),
|
|
3003
|
+
externalUrl: z10.string().optional(),
|
|
3004
|
+
providerMeta: z10.record(z10.string(), z10.unknown()).optional(),
|
|
3005
|
+
descriptionContext: z10.string().optional(),
|
|
3006
|
+
_id: z10.string().optional(),
|
|
3007
|
+
name: z10.string().optional(),
|
|
3008
|
+
description: z10.string().optional(),
|
|
3009
|
+
tags: z10.array(z10.string()).optional(),
|
|
3010
|
+
score: z10.number().optional(),
|
|
3011
|
+
alsoInLibrary: z10.string().optional(),
|
|
3012
|
+
prefetchedBytes: z10.string().optional(),
|
|
3013
|
+
prefetchedContentType: z10.string().optional()
|
|
2972
3014
|
});
|
|
2973
3015
|
var ingestedImageHitSchema = imageHitSchema.extend({
|
|
2974
|
-
imageId:
|
|
2975
|
-
imageUrl:
|
|
2976
|
-
deduped:
|
|
2977
|
-
sourceUrl:
|
|
2978
|
-
});
|
|
2979
|
-
var autoIngestItemSchema =
|
|
2980
|
-
imageId:
|
|
2981
|
-
deduped:
|
|
2982
|
-
imageUrl:
|
|
2983
|
-
sourceUrl:
|
|
2984
|
-
externalUrl:
|
|
3016
|
+
imageId: z10.string().optional(),
|
|
3017
|
+
imageUrl: z10.string().optional(),
|
|
3018
|
+
deduped: z10.boolean().optional(),
|
|
3019
|
+
sourceUrl: z10.string().optional()
|
|
3020
|
+
});
|
|
3021
|
+
var autoIngestItemSchema = z10.object({
|
|
3022
|
+
imageId: z10.string(),
|
|
3023
|
+
deduped: z10.boolean(),
|
|
3024
|
+
imageUrl: z10.string(),
|
|
3025
|
+
sourceUrl: z10.string(),
|
|
3026
|
+
externalUrl: z10.string().optional()
|
|
2985
3027
|
});
|
|
2986
3028
|
function providerHitsResponseSchema() {
|
|
2987
|
-
return
|
|
2988
|
-
hits:
|
|
2989
|
-
ingested:
|
|
3029
|
+
return z10.object({
|
|
3030
|
+
hits: z10.array(ingestedImageHitSchema),
|
|
3031
|
+
ingested: z10.array(autoIngestItemSchema)
|
|
2990
3032
|
});
|
|
2991
3033
|
}
|
|
2992
|
-
var imagesGetRequestSchema =
|
|
2993
|
-
var imagesSearchRequestSchema =
|
|
2994
|
-
query:
|
|
2995
|
-
limit:
|
|
2996
|
-
aspectRatio:
|
|
2997
|
-
tags:
|
|
2998
|
-
source:
|
|
2999
|
-
externalUrlHost:
|
|
3000
|
-
});
|
|
3001
|
-
var imageSearchResultSchema =
|
|
3002
|
-
_id:
|
|
3003
|
-
imageUrl:
|
|
3004
|
-
name:
|
|
3005
|
-
description:
|
|
3006
|
-
tags:
|
|
3007
|
-
width:
|
|
3008
|
-
height:
|
|
3009
|
-
aspectRatio:
|
|
3010
|
-
dominantColor:
|
|
3011
|
-
imagePalette:
|
|
3012
|
-
source:
|
|
3013
|
-
externalUrl:
|
|
3014
|
-
score:
|
|
3015
|
-
});
|
|
3016
|
-
var imagesSearchResponseSchema =
|
|
3017
|
-
var imagesUploadRequestSchema =
|
|
3018
|
-
base64:
|
|
3019
|
-
contentType:
|
|
3020
|
-
source:
|
|
3021
|
-
descriptionContext:
|
|
3022
|
-
});
|
|
3023
|
-
var imagesUploadResponseSchema =
|
|
3024
|
-
var imagesDeleteRequestSchema =
|
|
3025
|
-
var imagesDeleteResponseSchema =
|
|
3026
|
-
var imagesUpscaleRequestSchema =
|
|
3027
|
-
var imagesUpscaleResponseSchema =
|
|
3028
|
-
imageId:
|
|
3029
|
-
status:
|
|
3034
|
+
var imagesGetRequestSchema = z10.object({ id: z10.string().min(1, "Missing id parameter") });
|
|
3035
|
+
var imagesSearchRequestSchema = z10.object({
|
|
3036
|
+
query: z10.string().min(1),
|
|
3037
|
+
limit: z10.coerce.number().int().positive().max(100).optional(),
|
|
3038
|
+
aspectRatio: z10.string().optional(),
|
|
3039
|
+
tags: z10.array(z10.string()).optional(),
|
|
3040
|
+
source: z10.string().optional(),
|
|
3041
|
+
externalUrlHost: z10.string().optional()
|
|
3042
|
+
});
|
|
3043
|
+
var imageSearchResultSchema = z10.object({
|
|
3044
|
+
_id: z10.string(),
|
|
3045
|
+
imageUrl: z10.string(),
|
|
3046
|
+
name: z10.string(),
|
|
3047
|
+
description: z10.string(),
|
|
3048
|
+
tags: z10.array(z10.string()),
|
|
3049
|
+
width: z10.number().optional(),
|
|
3050
|
+
height: z10.number().optional(),
|
|
3051
|
+
aspectRatio: z10.number().optional(),
|
|
3052
|
+
dominantColor: z10.string().optional(),
|
|
3053
|
+
imagePalette: z10.array(z10.string()).optional(),
|
|
3054
|
+
source: z10.string(),
|
|
3055
|
+
externalUrl: z10.string().optional(),
|
|
3056
|
+
score: z10.number()
|
|
3057
|
+
});
|
|
3058
|
+
var imagesSearchResponseSchema = z10.array(imageSearchResultSchema);
|
|
3059
|
+
var imagesUploadRequestSchema = z10.object({
|
|
3060
|
+
base64: z10.string().min(1),
|
|
3061
|
+
contentType: z10.string().min(1),
|
|
3062
|
+
source: z10.string().optional(),
|
|
3063
|
+
descriptionContext: z10.string().optional()
|
|
3064
|
+
});
|
|
3065
|
+
var imagesUploadResponseSchema = z10.object({ imageId: z10.string() });
|
|
3066
|
+
var imagesDeleteRequestSchema = z10.object({ id: z10.string().min(1, "Missing image ID") });
|
|
3067
|
+
var imagesDeleteResponseSchema = z10.object({ ok: z10.literal(true) });
|
|
3068
|
+
var imagesUpscaleRequestSchema = z10.object({ imageId: z10.string().min(1, "Missing image ID") });
|
|
3069
|
+
var imagesUpscaleResponseSchema = z10.object({
|
|
3070
|
+
imageId: z10.string(),
|
|
3071
|
+
status: z10.literal("processing")
|
|
3030
3072
|
});
|
|
3031
3073
|
var IMAGES_FIND_SOURCES = ["library", "magnific", "google", "iconify", "giphy", "pinterest"];
|
|
3032
|
-
var imagesFindRequestSchema =
|
|
3033
|
-
query:
|
|
3034
|
-
sources:
|
|
3035
|
-
limit:
|
|
3036
|
-
fallback:
|
|
3037
|
-
threshold:
|
|
3038
|
-
autoIngest:
|
|
3039
|
-
descriptionContext:
|
|
3040
|
-
});
|
|
3041
|
-
var imagesFindResponseSchema =
|
|
3042
|
-
groups:
|
|
3043
|
-
library:
|
|
3044
|
-
external:
|
|
3074
|
+
var imagesFindRequestSchema = z10.object({
|
|
3075
|
+
query: z10.string().min(1),
|
|
3076
|
+
sources: z10.array(z10.enum(IMAGES_FIND_SOURCES)).optional(),
|
|
3077
|
+
limit: z10.coerce.number().int().positive().max(50).optional(),
|
|
3078
|
+
fallback: z10.boolean().optional(),
|
|
3079
|
+
threshold: z10.number().min(0).max(1).optional(),
|
|
3080
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3081
|
+
descriptionContext: z10.string().optional()
|
|
3082
|
+
});
|
|
3083
|
+
var imagesFindResponseSchema = z10.object({
|
|
3084
|
+
groups: z10.object({
|
|
3085
|
+
library: z10.array(imageHitSchema),
|
|
3086
|
+
external: z10.array(ingestedImageHitSchema)
|
|
3045
3087
|
}),
|
|
3046
|
-
meta:
|
|
3047
|
-
counts:
|
|
3048
|
-
errors:
|
|
3088
|
+
meta: z10.object({
|
|
3089
|
+
counts: z10.record(z10.string(), z10.number()),
|
|
3090
|
+
errors: z10.array(z10.object({ source: imageHitSourceSchema, message: z10.string() }))
|
|
3049
3091
|
}),
|
|
3050
|
-
ingested:
|
|
3051
|
-
});
|
|
3052
|
-
var imagesStockRequestSchema =
|
|
3053
|
-
query:
|
|
3054
|
-
orientation:
|
|
3055
|
-
contentType:
|
|
3056
|
-
license:
|
|
3057
|
-
color:
|
|
3058
|
-
aiGenerated:
|
|
3059
|
-
people:
|
|
3060
|
-
order:
|
|
3061
|
-
limit:
|
|
3062
|
-
page:
|
|
3063
|
-
autoIngest:
|
|
3064
|
-
descriptionContext:
|
|
3092
|
+
ingested: z10.array(autoIngestItemSchema)
|
|
3093
|
+
});
|
|
3094
|
+
var imagesStockRequestSchema = z10.object({
|
|
3095
|
+
query: z10.string().min(1),
|
|
3096
|
+
orientation: z10.enum(["landscape", "portrait", "square", "panoramic"]).optional(),
|
|
3097
|
+
contentType: z10.enum(["photo", "vector", "psd"]).optional(),
|
|
3098
|
+
license: z10.enum(["freemium", "premium"]).optional(),
|
|
3099
|
+
color: z10.string().optional(),
|
|
3100
|
+
aiGenerated: z10.enum(["exclude", "only"]).optional(),
|
|
3101
|
+
people: z10.enum(["include", "exclude", "only"]).optional(),
|
|
3102
|
+
order: z10.enum(["relevance", "recent"]).optional(),
|
|
3103
|
+
limit: z10.coerce.number().int().positive().max(50).optional(),
|
|
3104
|
+
page: z10.coerce.number().int().positive().optional(),
|
|
3105
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3106
|
+
descriptionContext: z10.string().optional()
|
|
3065
3107
|
});
|
|
3066
3108
|
var imagesStockResponseSchema = providerHitsResponseSchema();
|
|
3067
|
-
var imagesGoogleRequestSchema =
|
|
3068
|
-
query:
|
|
3069
|
-
type:
|
|
3070
|
-
size:
|
|
3071
|
-
color:
|
|
3072
|
-
safe:
|
|
3073
|
-
limit:
|
|
3074
|
-
autoIngest:
|
|
3075
|
-
descriptionContext:
|
|
3109
|
+
var imagesGoogleRequestSchema = z10.object({
|
|
3110
|
+
query: z10.string().min(1),
|
|
3111
|
+
type: z10.string().optional(),
|
|
3112
|
+
size: z10.string().optional(),
|
|
3113
|
+
color: z10.string().optional(),
|
|
3114
|
+
safe: z10.enum(["off", "active"]).optional(),
|
|
3115
|
+
limit: z10.coerce.number().int().positive().max(50).optional(),
|
|
3116
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3117
|
+
descriptionContext: z10.string().optional()
|
|
3076
3118
|
});
|
|
3077
3119
|
var imagesGoogleResponseSchema = providerHitsResponseSchema();
|
|
3078
|
-
var imagesPinterestRequestSchema =
|
|
3079
|
-
query:
|
|
3080
|
-
limit:
|
|
3081
|
-
autoIngest:
|
|
3082
|
-
descriptionContext:
|
|
3120
|
+
var imagesPinterestRequestSchema = z10.object({
|
|
3121
|
+
query: z10.string().min(1),
|
|
3122
|
+
limit: z10.coerce.number().int().positive().max(20).optional(),
|
|
3123
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3124
|
+
descriptionContext: z10.string().optional()
|
|
3083
3125
|
});
|
|
3084
3126
|
var imagesPinterestResponseSchema = providerHitsResponseSchema();
|
|
3085
|
-
var rgbTriple =
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3127
|
+
var rgbTriple = z10.tuple([
|
|
3128
|
+
z10.number().int().min(0).max(255),
|
|
3129
|
+
z10.number().int().min(0).max(255),
|
|
3130
|
+
z10.number().int().min(0).max(255)
|
|
3089
3131
|
]);
|
|
3090
|
-
var imageGenerateModelSchema =
|
|
3132
|
+
var imageGenerateModelSchema = z10.enum([
|
|
3091
3133
|
"openai/gpt-image-2",
|
|
3092
3134
|
// Legacy — see the registry entry; kept so pre-switch canvases still run.
|
|
3093
3135
|
"openai/gpt-5.4-image-2",
|
|
@@ -3095,97 +3137,97 @@ var imageGenerateModelSchema = z9.enum([
|
|
|
3095
3137
|
"google/gemini-3-pro-image-preview",
|
|
3096
3138
|
"recraft/recraft-v4.1-pro-vector"
|
|
3097
3139
|
]);
|
|
3098
|
-
var imagesGenerateRequestSchema =
|
|
3099
|
-
prompt:
|
|
3140
|
+
var imagesGenerateRequestSchema = z10.object({
|
|
3141
|
+
prompt: z10.string().min(1),
|
|
3100
3142
|
model: imageGenerateModelSchema.optional(),
|
|
3101
3143
|
// Aspect ratio + size are validated loosely as strings; the per-model enum
|
|
3102
3144
|
// lives in canvas-contract and OpenRouter rejects unsupported combinations.
|
|
3103
|
-
aspectRatio:
|
|
3104
|
-
imageSize:
|
|
3145
|
+
aspectRatio: z10.string().optional(),
|
|
3146
|
+
imageSize: z10.string().optional(),
|
|
3105
3147
|
// Rendering quality (auto|low|medium|high) — honored by gpt-image / Gemini, ignored elsewhere.
|
|
3106
|
-
quality:
|
|
3148
|
+
quality: z10.enum(["auto", "low", "medium", "high"]).optional(),
|
|
3107
3149
|
// Recraft v4.1 Pro Vector levers (ignored by other models).
|
|
3108
|
-
strength:
|
|
3109
|
-
rgbColors:
|
|
3150
|
+
strength: z10.coerce.number().min(0).max(1).optional(),
|
|
3151
|
+
rgbColors: z10.array(rgbTriple).optional(),
|
|
3110
3152
|
backgroundRgbColor: rgbTriple.optional(),
|
|
3111
3153
|
// Public image URLs used as visual references (multi-reference, in order).
|
|
3112
|
-
referenceUrls:
|
|
3113
|
-
descriptionContext:
|
|
3114
|
-
});
|
|
3115
|
-
var generatedImageSchema =
|
|
3116
|
-
imageId:
|
|
3117
|
-
deduped:
|
|
3118
|
-
imageUrl:
|
|
3119
|
-
width:
|
|
3120
|
-
height:
|
|
3121
|
-
});
|
|
3122
|
-
var imagesGenerateResponseSchema =
|
|
3123
|
-
model:
|
|
3124
|
-
costUsd:
|
|
3125
|
-
images:
|
|
3126
|
-
});
|
|
3127
|
-
var imagesLogoRequestSchema =
|
|
3128
|
-
domain:
|
|
3129
|
-
variant:
|
|
3130
|
-
autoIngest:
|
|
3131
|
-
descriptionContext:
|
|
3154
|
+
referenceUrls: z10.array(z10.string().url()).optional(),
|
|
3155
|
+
descriptionContext: z10.string().optional()
|
|
3156
|
+
});
|
|
3157
|
+
var generatedImageSchema = z10.object({
|
|
3158
|
+
imageId: z10.string(),
|
|
3159
|
+
deduped: z10.boolean(),
|
|
3160
|
+
imageUrl: z10.string(),
|
|
3161
|
+
width: z10.number().optional(),
|
|
3162
|
+
height: z10.number().optional()
|
|
3163
|
+
});
|
|
3164
|
+
var imagesGenerateResponseSchema = z10.object({
|
|
3165
|
+
model: z10.string(),
|
|
3166
|
+
costUsd: z10.number(),
|
|
3167
|
+
images: z10.array(generatedImageSchema)
|
|
3168
|
+
});
|
|
3169
|
+
var imagesLogoRequestSchema = z10.object({
|
|
3170
|
+
domain: z10.string().min(1),
|
|
3171
|
+
variant: z10.enum(["icon", "logo", "symbol"]).optional(),
|
|
3172
|
+
autoIngest: z10.coerce.number().int().min(0).max(5).optional(),
|
|
3173
|
+
descriptionContext: z10.string().optional()
|
|
3132
3174
|
});
|
|
3133
3175
|
var imagesLogoResponseSchema = providerHitsResponseSchema();
|
|
3134
|
-
var imagesIconRequestSchema =
|
|
3135
|
-
name:
|
|
3136
|
-
set:
|
|
3137
|
-
color:
|
|
3138
|
-
width:
|
|
3139
|
-
autoIngest:
|
|
3140
|
-
descriptionContext:
|
|
3176
|
+
var imagesIconRequestSchema = z10.object({
|
|
3177
|
+
name: z10.string().min(1),
|
|
3178
|
+
set: z10.string().optional(),
|
|
3179
|
+
color: z10.string().optional(),
|
|
3180
|
+
width: z10.coerce.number().int().positive().optional(),
|
|
3181
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3182
|
+
descriptionContext: z10.string().optional()
|
|
3141
3183
|
});
|
|
3142
3184
|
var imagesIconResponseSchema = providerHitsResponseSchema();
|
|
3143
|
-
var imagesExtractRequestSchema =
|
|
3144
|
-
url:
|
|
3145
|
-
waitFor:
|
|
3146
|
-
limit:
|
|
3147
|
-
autoIngest:
|
|
3148
|
-
descriptionContext:
|
|
3185
|
+
var imagesExtractRequestSchema = z10.object({
|
|
3186
|
+
url: z10.string().url(),
|
|
3187
|
+
waitFor: z10.coerce.number().int().min(0).max(3e4).optional(),
|
|
3188
|
+
limit: z10.coerce.number().int().positive().max(50).optional(),
|
|
3189
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3190
|
+
descriptionContext: z10.string().optional()
|
|
3149
3191
|
});
|
|
3150
3192
|
var imagesExtractResponseSchema = providerHitsResponseSchema();
|
|
3151
|
-
var imagesScreenshotRequestSchema =
|
|
3152
|
-
url:
|
|
3153
|
-
fullPage:
|
|
3154
|
-
viewportWidth:
|
|
3155
|
-
viewportHeight:
|
|
3156
|
-
format:
|
|
3157
|
-
descriptionContext:
|
|
3193
|
+
var imagesScreenshotRequestSchema = z10.object({
|
|
3194
|
+
url: z10.string().url(),
|
|
3195
|
+
fullPage: z10.boolean().optional(),
|
|
3196
|
+
viewportWidth: z10.coerce.number().int().positive().max(3840).optional(),
|
|
3197
|
+
viewportHeight: z10.coerce.number().int().positive().max(2160).optional(),
|
|
3198
|
+
format: z10.enum(["webp", "png", "jpg"]).optional(),
|
|
3199
|
+
descriptionContext: z10.string().optional()
|
|
3158
3200
|
});
|
|
3159
3201
|
var imagesScreenshotResponseSchema = providerHitsResponseSchema();
|
|
3160
|
-
var imagesGiphyRequestSchema =
|
|
3161
|
-
query:
|
|
3162
|
-
trending:
|
|
3163
|
-
limit:
|
|
3164
|
-
rating:
|
|
3165
|
-
lang:
|
|
3166
|
-
autoIngest:
|
|
3167
|
-
descriptionContext:
|
|
3202
|
+
var imagesGiphyRequestSchema = z10.object({
|
|
3203
|
+
query: z10.string().min(1).optional(),
|
|
3204
|
+
trending: z10.coerce.boolean().optional(),
|
|
3205
|
+
limit: z10.coerce.number().int().positive().max(50).optional(),
|
|
3206
|
+
rating: z10.enum(["g", "pg", "pg-13", "r"]).optional(),
|
|
3207
|
+
lang: z10.string().optional(),
|
|
3208
|
+
autoIngest: z10.coerce.number().int().min(0).max(20).optional(),
|
|
3209
|
+
descriptionContext: z10.string().optional()
|
|
3168
3210
|
});
|
|
3169
3211
|
var imagesGifResponseSchema = providerHitsResponseSchema();
|
|
3170
3212
|
var imagesStickerResponseSchema = providerHitsResponseSchema();
|
|
3171
|
-
var imagesIngestRequestSchema =
|
|
3172
|
-
url:
|
|
3213
|
+
var imagesIngestRequestSchema = z10.object({
|
|
3214
|
+
url: z10.string().url(),
|
|
3173
3215
|
// Validate source at the HTTP boundary so unknown values produce the standard
|
|
3174
3216
|
// `{ code: "BAD_REQUEST", message }` shape instead of a plain Error from
|
|
3175
3217
|
// `assertImageSource` inside the action.
|
|
3176
3218
|
source: imageSourceSchema,
|
|
3177
|
-
externalId:
|
|
3178
|
-
externalUrl:
|
|
3179
|
-
descriptionContext:
|
|
3219
|
+
externalId: z10.string().optional(),
|
|
3220
|
+
externalUrl: z10.string().optional(),
|
|
3221
|
+
descriptionContext: z10.string().optional()
|
|
3180
3222
|
});
|
|
3181
|
-
var imagesIngestResponseSchema =
|
|
3182
|
-
imageId:
|
|
3183
|
-
deduped:
|
|
3184
|
-
contentHash:
|
|
3223
|
+
var imagesIngestResponseSchema = z10.object({
|
|
3224
|
+
imageId: z10.string(),
|
|
3225
|
+
deduped: z10.boolean(),
|
|
3226
|
+
contentHash: z10.string()
|
|
3185
3227
|
});
|
|
3186
3228
|
|
|
3187
3229
|
// ../api/src/tags.ts
|
|
3188
|
-
import { z as
|
|
3230
|
+
import { z as z11 } from "zod";
|
|
3189
3231
|
var TAG_TYPES = [
|
|
3190
3232
|
"meta",
|
|
3191
3233
|
"amplitude",
|
|
@@ -3206,7 +3248,7 @@ var TAG_TYPES = [
|
|
|
3206
3248
|
"recaptcha",
|
|
3207
3249
|
"twitterAds"
|
|
3208
3250
|
];
|
|
3209
|
-
var tagTypeSchema =
|
|
3251
|
+
var tagTypeSchema = z11.enum(TAG_TYPES);
|
|
3210
3252
|
var TAG_IDENTIFYING_FIELD = {
|
|
3211
3253
|
meta: "pixelId",
|
|
3212
3254
|
googleAds: "conversionID",
|
|
@@ -3227,218 +3269,218 @@ var TAG_IDENTIFYING_FIELD = {
|
|
|
3227
3269
|
recaptcha: "siteKey",
|
|
3228
3270
|
twitterAds: "pixelId"
|
|
3229
3271
|
};
|
|
3230
|
-
var tagDraftOpKindSchema =
|
|
3231
|
-
var tagDraftOpViewSchema =
|
|
3272
|
+
var tagDraftOpKindSchema = z11.enum(["create", "update", "delete"]);
|
|
3273
|
+
var tagDraftOpViewSchema = z11.object({
|
|
3232
3274
|
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
3233
|
-
ref:
|
|
3275
|
+
ref: z11.string(),
|
|
3234
3276
|
kind: tagDraftOpKindSchema,
|
|
3235
3277
|
type: tagTypeSchema,
|
|
3236
3278
|
/** Present on update/delete ops — the real tag this op targets. */
|
|
3237
|
-
tagId:
|
|
3279
|
+
tagId: z11.string().optional(),
|
|
3238
3280
|
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
3239
|
-
config:
|
|
3281
|
+
config: z11.record(z11.string(), z11.string()),
|
|
3240
3282
|
/** Update only — fields the op explicitly clears. */
|
|
3241
|
-
clearFields:
|
|
3283
|
+
clearFields: z11.array(z11.string()).optional(),
|
|
3242
3284
|
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
3243
|
-
secretsSet:
|
|
3285
|
+
secretsSet: z11.array(z11.string()),
|
|
3244
3286
|
/** Names of secret fields still awaiting user input. */
|
|
3245
|
-
secretsPending:
|
|
3246
|
-
summary:
|
|
3247
|
-
stagedAt:
|
|
3287
|
+
secretsPending: z11.array(z11.string()),
|
|
3288
|
+
summary: z11.string(),
|
|
3289
|
+
stagedAt: z11.number()
|
|
3248
3290
|
});
|
|
3249
|
-
var tagsEffectiveEntrySchema =
|
|
3291
|
+
var tagsEffectiveEntrySchema = z11.object({
|
|
3250
3292
|
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
3251
|
-
ref:
|
|
3252
|
-
tagId:
|
|
3293
|
+
ref: z11.string(),
|
|
3294
|
+
tagId: z11.string().optional(),
|
|
3253
3295
|
type: tagTypeSchema,
|
|
3254
3296
|
/** Value of the type's identifying field, when set. */
|
|
3255
|
-
identifier:
|
|
3297
|
+
identifier: z11.string().optional(),
|
|
3256
3298
|
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
3257
|
-
config:
|
|
3299
|
+
config: z11.record(z11.string(), z11.string()),
|
|
3258
3300
|
/** Absent = live production tag with no staged changes in this chat. */
|
|
3259
3301
|
staged: tagDraftOpKindSchema.optional(),
|
|
3260
|
-
secretsSet:
|
|
3261
|
-
secretsPending:
|
|
3302
|
+
secretsSet: z11.array(z11.string()),
|
|
3303
|
+
secretsPending: z11.array(z11.string())
|
|
3262
3304
|
});
|
|
3263
|
-
var tagsListRequestSchema =
|
|
3264
|
-
var tagsListResponseSchema =
|
|
3265
|
-
var tagsDraftListRequestSchema =
|
|
3266
|
-
var tagsDraftListResponseSchema =
|
|
3267
|
-
status:
|
|
3268
|
-
ops:
|
|
3305
|
+
var tagsListRequestSchema = z11.object({ chatId: z11.string() });
|
|
3306
|
+
var tagsListResponseSchema = z11.object({ tags: z11.array(tagsEffectiveEntrySchema) });
|
|
3307
|
+
var tagsDraftListRequestSchema = z11.object({ chatId: z11.string() });
|
|
3308
|
+
var tagsDraftListResponseSchema = z11.object({
|
|
3309
|
+
status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
3310
|
+
ops: z11.array(tagDraftOpViewSchema)
|
|
3269
3311
|
});
|
|
3270
|
-
var tagInputRequestSchema =
|
|
3312
|
+
var tagInputRequestSchema = z11.object({
|
|
3271
3313
|
// Every tag change is a tab in the approval form: create/edit show the full
|
|
3272
3314
|
// body; delete shows a confirm. No tag change bypasses this approval.
|
|
3273
|
-
mode:
|
|
3315
|
+
mode: z11.enum(["create", "edit", "delete"]),
|
|
3274
3316
|
tagType: tagTypeSchema,
|
|
3275
3317
|
/** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
|
|
3276
|
-
ref:
|
|
3318
|
+
ref: z11.string().optional(),
|
|
3277
3319
|
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
3278
|
-
prefilledConfig:
|
|
3320
|
+
prefilledConfig: z11.record(z11.string(), z11.string()).optional(),
|
|
3279
3321
|
/** Secret field names the agent asks the user to provide. */
|
|
3280
|
-
requestedSecretFields:
|
|
3322
|
+
requestedSecretFields: z11.array(z11.string()).optional(),
|
|
3281
3323
|
/** Short message shown above the form explaining why the input is needed. */
|
|
3282
|
-
message:
|
|
3324
|
+
message: z11.string().optional()
|
|
3283
3325
|
});
|
|
3284
|
-
var tagChangeToolInputSchema =
|
|
3285
|
-
changes:
|
|
3326
|
+
var tagChangeToolInputSchema = z11.object({
|
|
3327
|
+
changes: z11.array(tagInputRequestSchema).min(1).max(8)
|
|
3286
3328
|
});
|
|
3287
|
-
var tagInputResultSchema =
|
|
3288
|
-
|
|
3289
|
-
status:
|
|
3290
|
-
ref:
|
|
3329
|
+
var tagInputResultSchema = z11.discriminatedUnion("status", [
|
|
3330
|
+
z11.object({
|
|
3331
|
+
status: z11.literal("submitted"),
|
|
3332
|
+
ref: z11.string(),
|
|
3291
3333
|
type: tagTypeSchema,
|
|
3292
3334
|
/** Identifying field name → value (non-secret), when the type has one. */
|
|
3293
|
-
identifier:
|
|
3294
|
-
secretFieldsSet:
|
|
3295
|
-
note:
|
|
3335
|
+
identifier: z11.record(z11.string(), z11.string()).optional(),
|
|
3336
|
+
secretFieldsSet: z11.array(z11.string()),
|
|
3337
|
+
note: z11.string().optional()
|
|
3296
3338
|
}),
|
|
3297
|
-
|
|
3298
|
-
status:
|
|
3299
|
-
reason:
|
|
3339
|
+
z11.object({
|
|
3340
|
+
status: z11.literal("declined"),
|
|
3341
|
+
reason: z11.string().optional()
|
|
3300
3342
|
})
|
|
3301
3343
|
]);
|
|
3302
|
-
var tagChangeToolResultSchema =
|
|
3303
|
-
results:
|
|
3344
|
+
var tagChangeToolResultSchema = z11.object({
|
|
3345
|
+
results: z11.array(tagInputResultSchema)
|
|
3304
3346
|
});
|
|
3305
3347
|
|
|
3306
3348
|
// ../api/src/testimonials.ts
|
|
3307
|
-
import { z as
|
|
3308
|
-
var testimonialSourceTypeSchema =
|
|
3309
|
-
var testimonialStatusSchema =
|
|
3310
|
-
var testimonialSentimentSchema =
|
|
3311
|
-
var testimonialDocSchema =
|
|
3312
|
-
_id:
|
|
3313
|
-
_creationTime:
|
|
3314
|
-
companyId:
|
|
3315
|
-
sourceId:
|
|
3349
|
+
import { z as z12 } from "zod";
|
|
3350
|
+
var testimonialSourceTypeSchema = z12.enum(["google", "trustpilot"]);
|
|
3351
|
+
var testimonialStatusSchema = z12.enum(["pending", "processing", "ready", "error"]);
|
|
3352
|
+
var testimonialSentimentSchema = z12.enum(["positive", "neutral", "negative"]);
|
|
3353
|
+
var testimonialDocSchema = z12.object({
|
|
3354
|
+
_id: z12.string(),
|
|
3355
|
+
_creationTime: z12.number(),
|
|
3356
|
+
companyId: z12.string(),
|
|
3357
|
+
sourceId: z12.string(),
|
|
3316
3358
|
sourceType: testimonialSourceTypeSchema,
|
|
3317
|
-
reviewText:
|
|
3318
|
-
reviewTitle:
|
|
3319
|
-
searchText:
|
|
3320
|
-
reviewerName:
|
|
3321
|
-
reviewerImageUrl:
|
|
3322
|
-
reviewerImageId:
|
|
3323
|
-
reviewerLocation:
|
|
3324
|
-
rating:
|
|
3325
|
-
reviewDate:
|
|
3326
|
-
ownerAnswer:
|
|
3327
|
-
mediaUrls:
|
|
3328
|
-
imageIds:
|
|
3329
|
-
videoIds:
|
|
3330
|
-
sourceUrl:
|
|
3331
|
-
rawData:
|
|
3332
|
-
tags:
|
|
3333
|
-
highlight:
|
|
3334
|
-
language:
|
|
3335
|
-
summary:
|
|
3359
|
+
reviewText: z12.string(),
|
|
3360
|
+
reviewTitle: z12.string().optional(),
|
|
3361
|
+
searchText: z12.string().optional(),
|
|
3362
|
+
reviewerName: z12.string().optional(),
|
|
3363
|
+
reviewerImageUrl: z12.string().optional(),
|
|
3364
|
+
reviewerImageId: z12.string().optional(),
|
|
3365
|
+
reviewerLocation: z12.string().optional(),
|
|
3366
|
+
rating: z12.number().optional(),
|
|
3367
|
+
reviewDate: z12.number().optional(),
|
|
3368
|
+
ownerAnswer: z12.string().optional(),
|
|
3369
|
+
mediaUrls: z12.array(z12.string()).optional(),
|
|
3370
|
+
imageIds: z12.array(z12.string()).optional(),
|
|
3371
|
+
videoIds: z12.array(z12.string()).optional(),
|
|
3372
|
+
sourceUrl: z12.string().optional(),
|
|
3373
|
+
rawData: z12.unknown().optional(),
|
|
3374
|
+
tags: z12.array(z12.string()),
|
|
3375
|
+
highlight: z12.string().optional(),
|
|
3376
|
+
language: z12.string().optional(),
|
|
3377
|
+
summary: z12.string().optional(),
|
|
3336
3378
|
sentiment: testimonialSentimentSchema.optional(),
|
|
3337
|
-
textEmbedding:
|
|
3338
|
-
externalId:
|
|
3339
|
-
contentHash:
|
|
3379
|
+
textEmbedding: z12.array(z12.number()).optional(),
|
|
3380
|
+
externalId: z12.string().optional(),
|
|
3381
|
+
contentHash: z12.string().optional(),
|
|
3340
3382
|
status: testimonialStatusSchema,
|
|
3341
|
-
errorMessage:
|
|
3342
|
-
createdAt:
|
|
3343
|
-
updatedAt:
|
|
3383
|
+
errorMessage: z12.string().optional(),
|
|
3384
|
+
createdAt: z12.number(),
|
|
3385
|
+
updatedAt: z12.number()
|
|
3344
3386
|
});
|
|
3345
|
-
var testimonialsListRequestSchema =
|
|
3387
|
+
var testimonialsListRequestSchema = z12.object({
|
|
3346
3388
|
source: testimonialSourceTypeSchema.optional(),
|
|
3347
|
-
rating_min:
|
|
3348
|
-
rating_max:
|
|
3349
|
-
tags:
|
|
3389
|
+
rating_min: z12.coerce.number().int().min(1).max(5).optional(),
|
|
3390
|
+
rating_max: z12.coerce.number().int().min(1).max(5).optional(),
|
|
3391
|
+
tags: z12.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
3350
3392
|
status: testimonialStatusSchema.optional(),
|
|
3351
3393
|
sentiment: testimonialSentimentSchema.optional(),
|
|
3352
|
-
language:
|
|
3353
|
-
limit:
|
|
3354
|
-
});
|
|
3355
|
-
var testimonialsListResponseSchema =
|
|
3356
|
-
var testimonialsGetRequestSchema =
|
|
3357
|
-
var testimonialsSearchRequestSchema =
|
|
3358
|
-
query:
|
|
3359
|
-
limit:
|
|
3394
|
+
language: z12.string().min(2).max(5).optional(),
|
|
3395
|
+
limit: z12.coerce.number().int().positive().max(200).optional()
|
|
3396
|
+
});
|
|
3397
|
+
var testimonialsListResponseSchema = z12.array(testimonialDocSchema);
|
|
3398
|
+
var testimonialsGetRequestSchema = z12.object({ id: z12.string().min(1, "Missing id parameter") });
|
|
3399
|
+
var testimonialsSearchRequestSchema = z12.object({
|
|
3400
|
+
query: z12.string().min(1),
|
|
3401
|
+
limit: z12.coerce.number().int().positive().max(100).optional(),
|
|
3360
3402
|
source: testimonialSourceTypeSchema.optional(),
|
|
3361
|
-
rating_min:
|
|
3362
|
-
rating_max:
|
|
3363
|
-
tags:
|
|
3403
|
+
rating_min: z12.coerce.number().int().min(1).max(5).optional(),
|
|
3404
|
+
rating_max: z12.coerce.number().int().min(1).max(5).optional(),
|
|
3405
|
+
tags: z12.array(z12.string()).optional(),
|
|
3364
3406
|
status: testimonialStatusSchema.optional(),
|
|
3365
3407
|
sentiment: testimonialSentimentSchema.optional(),
|
|
3366
|
-
language:
|
|
3408
|
+
language: z12.string().min(2).max(5).optional()
|
|
3367
3409
|
}).refine(
|
|
3368
3410
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
3369
3411
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
3370
3412
|
);
|
|
3371
|
-
var testimonialsSearchResponseSchema =
|
|
3372
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
3373
|
-
ok:
|
|
3374
|
-
note:
|
|
3413
|
+
var testimonialsSearchResponseSchema = z12.array(testimonialDocSchema);
|
|
3414
|
+
var testimonialsOutscraperWebhookResponseSchema = z12.object({
|
|
3415
|
+
ok: z12.literal(true),
|
|
3416
|
+
note: z12.string().optional()
|
|
3375
3417
|
});
|
|
3376
3418
|
|
|
3377
3419
|
// ../api/src/videos.ts
|
|
3378
|
-
import { z as
|
|
3379
|
-
var videoStatusSchema =
|
|
3380
|
-
var videoTranscriptSegmentSchema =
|
|
3381
|
-
text:
|
|
3382
|
-
startSecond:
|
|
3383
|
-
endSecond:
|
|
3384
|
-
});
|
|
3385
|
-
var videoSceneSchema =
|
|
3386
|
-
title:
|
|
3387
|
-
description:
|
|
3388
|
-
startSecond:
|
|
3389
|
-
endSecond:
|
|
3390
|
-
thumbnailTime:
|
|
3391
|
-
});
|
|
3392
|
-
var videoDocSchema =
|
|
3393
|
-
_id:
|
|
3394
|
-
_creationTime:
|
|
3395
|
-
companyId:
|
|
3396
|
-
muxAssetId:
|
|
3397
|
-
muxPlaybackId:
|
|
3398
|
-
muxUploadId:
|
|
3399
|
-
name:
|
|
3400
|
-
description:
|
|
3401
|
-
tags:
|
|
3402
|
-
source:
|
|
3403
|
-
externalId:
|
|
3404
|
-
sourceId:
|
|
3405
|
-
width:
|
|
3406
|
-
height:
|
|
3407
|
-
aspectRatio:
|
|
3408
|
-
duration:
|
|
3409
|
-
transcript:
|
|
3410
|
-
transcriptSegments:
|
|
3411
|
-
scenes:
|
|
3412
|
-
descriptionEmbedding:
|
|
3413
|
-
searchText:
|
|
3420
|
+
import { z as z13 } from "zod";
|
|
3421
|
+
var videoStatusSchema = z13.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
3422
|
+
var videoTranscriptSegmentSchema = z13.object({
|
|
3423
|
+
text: z13.string(),
|
|
3424
|
+
startSecond: z13.number(),
|
|
3425
|
+
endSecond: z13.number()
|
|
3426
|
+
});
|
|
3427
|
+
var videoSceneSchema = z13.object({
|
|
3428
|
+
title: z13.string(),
|
|
3429
|
+
description: z13.string(),
|
|
3430
|
+
startSecond: z13.number(),
|
|
3431
|
+
endSecond: z13.number(),
|
|
3432
|
+
thumbnailTime: z13.number()
|
|
3433
|
+
});
|
|
3434
|
+
var videoDocSchema = z13.object({
|
|
3435
|
+
_id: z13.string(),
|
|
3436
|
+
_creationTime: z13.number(),
|
|
3437
|
+
companyId: z13.string(),
|
|
3438
|
+
muxAssetId: z13.string(),
|
|
3439
|
+
muxPlaybackId: z13.string(),
|
|
3440
|
+
muxUploadId: z13.string(),
|
|
3441
|
+
name: z13.string(),
|
|
3442
|
+
description: z13.string(),
|
|
3443
|
+
tags: z13.array(z13.string()),
|
|
3444
|
+
source: z13.string(),
|
|
3445
|
+
externalId: z13.string().optional(),
|
|
3446
|
+
sourceId: z13.string().optional(),
|
|
3447
|
+
width: z13.number().optional(),
|
|
3448
|
+
height: z13.number().optional(),
|
|
3449
|
+
aspectRatio: z13.number().optional(),
|
|
3450
|
+
duration: z13.number().optional(),
|
|
3451
|
+
transcript: z13.string().optional(),
|
|
3452
|
+
transcriptSegments: z13.array(videoTranscriptSegmentSchema).optional(),
|
|
3453
|
+
scenes: z13.array(videoSceneSchema).optional(),
|
|
3454
|
+
descriptionEmbedding: z13.array(z13.number()).optional(),
|
|
3455
|
+
searchText: z13.string().optional(),
|
|
3414
3456
|
status: videoStatusSchema,
|
|
3415
|
-
errorMessage:
|
|
3416
|
-
createdAt:
|
|
3417
|
-
updatedAt:
|
|
3418
|
-
thumbnailUrl:
|
|
3419
|
-
});
|
|
3420
|
-
var videosWebhookResponseSchema =
|
|
3421
|
-
var videosGetRequestSchema =
|
|
3422
|
-
var videosSearchRequestSchema =
|
|
3423
|
-
query:
|
|
3424
|
-
limit:
|
|
3425
|
-
tags:
|
|
3426
|
-
});
|
|
3427
|
-
var videoSearchResultSchema =
|
|
3428
|
-
_id:
|
|
3429
|
-
thumbnailUrl:
|
|
3430
|
-
name:
|
|
3431
|
-
description:
|
|
3432
|
-
tags:
|
|
3433
|
-
status:
|
|
3434
|
-
duration:
|
|
3435
|
-
muxPlaybackId:
|
|
3436
|
-
createdAt:
|
|
3437
|
-
});
|
|
3438
|
-
var videosSearchResponseSchema =
|
|
3439
|
-
var videosUploadResponseSchema =
|
|
3440
|
-
var videosDeleteRequestSchema =
|
|
3441
|
-
var videosDeleteResponseSchema =
|
|
3457
|
+
errorMessage: z13.string().optional(),
|
|
3458
|
+
createdAt: z13.number(),
|
|
3459
|
+
updatedAt: z13.number(),
|
|
3460
|
+
thumbnailUrl: z13.string()
|
|
3461
|
+
});
|
|
3462
|
+
var videosWebhookResponseSchema = z13.object({ ok: z13.literal(true) });
|
|
3463
|
+
var videosGetRequestSchema = z13.object({ id: z13.string().min(1, "Missing id parameter") });
|
|
3464
|
+
var videosSearchRequestSchema = z13.object({
|
|
3465
|
+
query: z13.string().min(1),
|
|
3466
|
+
limit: z13.coerce.number().int().positive().max(100).optional(),
|
|
3467
|
+
tags: z13.array(z13.string()).optional()
|
|
3468
|
+
});
|
|
3469
|
+
var videoSearchResultSchema = z13.object({
|
|
3470
|
+
_id: z13.string(),
|
|
3471
|
+
thumbnailUrl: z13.string(),
|
|
3472
|
+
name: z13.string(),
|
|
3473
|
+
description: z13.string(),
|
|
3474
|
+
tags: z13.array(z13.string()),
|
|
3475
|
+
status: z13.string(),
|
|
3476
|
+
duration: z13.number().optional(),
|
|
3477
|
+
muxPlaybackId: z13.string(),
|
|
3478
|
+
createdAt: z13.number()
|
|
3479
|
+
});
|
|
3480
|
+
var videosSearchResponseSchema = z13.array(videoSearchResultSchema);
|
|
3481
|
+
var videosUploadResponseSchema = z13.object({ uploadUrl: z13.string(), videoId: z13.string() });
|
|
3482
|
+
var videosDeleteRequestSchema = z13.object({ id: z13.string().min(1, "Missing video ID") });
|
|
3483
|
+
var videosDeleteResponseSchema = z13.object({ ok: z13.literal(true) });
|
|
3442
3484
|
|
|
3443
3485
|
// src/commands/actions/complete.ts
|
|
3444
3486
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -4698,55 +4740,55 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
4698
4740
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4699
4741
|
|
|
4700
4742
|
// ../api/src/ads-google/ops.ts
|
|
4701
|
-
import { z as
|
|
4702
|
-
var tempRefSchema2 =
|
|
4703
|
-
var refSchema =
|
|
4704
|
-
|
|
4705
|
-
|
|
4743
|
+
import { z as z14 } from "zod";
|
|
4744
|
+
var tempRefSchema2 = z14.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
4745
|
+
var refSchema = z14.union([
|
|
4746
|
+
z14.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
4747
|
+
z14.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4706
4748
|
tempRefSchema2
|
|
4707
4749
|
]);
|
|
4708
4750
|
var targetRefSchema = refSchema;
|
|
4709
|
-
var microsSchema =
|
|
4710
|
-
var httpsUrlSchema2 =
|
|
4711
|
-
var customerIdSchema =
|
|
4712
|
-
var stageableStatusSchema2 =
|
|
4713
|
-
var matchTypeSchema =
|
|
4714
|
-
var finalUrlSuffixSchema =
|
|
4751
|
+
var microsSchema = z14.number().int().positive("expected a positive micros amount");
|
|
4752
|
+
var httpsUrlSchema2 = z14.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
4753
|
+
var customerIdSchema = z14.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
4754
|
+
var stageableStatusSchema2 = z14.enum(STAGEABLE_CREATE_STATUSES2);
|
|
4755
|
+
var matchTypeSchema = z14.enum(KEYWORD_MATCH_TYPES);
|
|
4756
|
+
var finalUrlSuffixSchema = z14.string().max(GOOGLE_ADS_LIMITS.campaign.finalUrlSuffixMax).refine((s) => !/^[?&]/.test(s), "drop the leading ? or & \u2014 a final URL suffix is bare query parameters").refine((s) => !s.includes("{lpurl}"), "{lpurl} belongs in a tracking template, not in a final URL suffix").refine((s) => !/\s/.test(s), "a final URL suffix cannot contain whitespace").refine((s) => s === "" || s.includes("="), 'expected key=value pairs, e.g. "utm_source=google&utm_agency=baker"');
|
|
4715
4757
|
var LANDING_PAGE_TAGS = ["{lpurl}", "{unescapedlpurl}", "{escapedlpurl}", "{lpurl+2}", "{lpurl+3}"];
|
|
4716
|
-
var trackingUrlTemplateSchema =
|
|
4758
|
+
var trackingUrlTemplateSchema = z14.string().max(GOOGLE_ADS_LIMITS.campaign.trackingUrlTemplateMax).refine((t) => !/\s/.test(t), "a tracking template cannot contain whitespace").refine(
|
|
4717
4759
|
(t) => t === "" || LANDING_PAGE_TAGS.some((tag) => t.includes(tag)),
|
|
4718
4760
|
`a tracking template must carry the landing page through one of ${LANDING_PAGE_TAGS.join(", ")}, e.g. "https://tracker.example/?url={lpurl}"`
|
|
4719
4761
|
).refine(
|
|
4720
4762
|
(t) => t === "" || /^(https?:\/\/|\{)/.test(t),
|
|
4721
4763
|
"a tracking template must start with http://, https:// or a {lpurl} tag"
|
|
4722
4764
|
);
|
|
4723
|
-
var urlCustomParametersSchema =
|
|
4724
|
-
|
|
4725
|
-
key:
|
|
4726
|
-
value:
|
|
4765
|
+
var urlCustomParametersSchema = z14.array(
|
|
4766
|
+
z14.strictObject({
|
|
4767
|
+
key: z14.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterKeyMax).regex(/^[A-Za-z0-9_]+$/, "a custom parameter key is letters, digits and underscores only"),
|
|
4768
|
+
value: z14.string().max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterValueMax)
|
|
4727
4769
|
})
|
|
4728
4770
|
).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParametersMax).refine(
|
|
4729
4771
|
(params) => new Set(params.map((p) => p.key)).size === params.length,
|
|
4730
4772
|
"each custom parameter key can appear only once"
|
|
4731
4773
|
);
|
|
4732
|
-
var keywordTextSchema =
|
|
4733
|
-
var budgetCreateSchema =
|
|
4734
|
-
name:
|
|
4774
|
+
var keywordTextSchema = z14.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
|
|
4775
|
+
var budgetCreateSchema = z14.object({
|
|
4776
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4735
4777
|
amountMicros: microsSchema,
|
|
4736
|
-
deliveryMethod:
|
|
4737
|
-
explicitlyShared:
|
|
4778
|
+
deliveryMethod: z14.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
4779
|
+
explicitlyShared: z14.boolean().default(false)
|
|
4738
4780
|
});
|
|
4739
|
-
var budgetUpdateSchema =
|
|
4740
|
-
name:
|
|
4781
|
+
var budgetUpdateSchema = z14.object({
|
|
4782
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4741
4783
|
amountMicros: microsSchema.optional(),
|
|
4742
|
-
deliveryMethod:
|
|
4784
|
+
deliveryMethod: z14.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4743
4785
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4744
|
-
var biddingConfigSchema =
|
|
4745
|
-
type:
|
|
4786
|
+
var biddingConfigSchema = z14.object({
|
|
4787
|
+
type: z14.enum(BIDDING_STRATEGY_TYPES),
|
|
4746
4788
|
targetCpaMicros: microsSchema.optional(),
|
|
4747
|
-
targetRoas:
|
|
4789
|
+
targetRoas: z14.number().positive().optional(),
|
|
4748
4790
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4749
|
-
enhancedCpcEnabled:
|
|
4791
|
+
enhancedCpcEnabled: z14.boolean().optional()
|
|
4750
4792
|
}).superRefine((p, ctx) => {
|
|
4751
4793
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4752
4794
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -4755,24 +4797,24 @@ var biddingConfigSchema = z13.object({
|
|
|
4755
4797
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4756
4798
|
}
|
|
4757
4799
|
});
|
|
4758
|
-
var networkSettingsSchema =
|
|
4759
|
-
targetGoogleSearch:
|
|
4760
|
-
targetSearchNetwork:
|
|
4761
|
-
targetContentNetwork:
|
|
4762
|
-
targetPartnerSearchNetwork:
|
|
4800
|
+
var networkSettingsSchema = z14.object({
|
|
4801
|
+
targetGoogleSearch: z14.boolean().optional(),
|
|
4802
|
+
targetSearchNetwork: z14.boolean().optional(),
|
|
4803
|
+
targetContentNetwork: z14.boolean().optional(),
|
|
4804
|
+
targetPartnerSearchNetwork: z14.boolean().optional()
|
|
4763
4805
|
});
|
|
4764
|
-
var dateSchema =
|
|
4765
|
-
var geoTargetTypeSettingSchema =
|
|
4766
|
-
positiveGeoTargetType:
|
|
4767
|
-
negativeGeoTargetType:
|
|
4806
|
+
var dateSchema = z14.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4807
|
+
var geoTargetTypeSettingSchema = z14.strictObject({
|
|
4808
|
+
positiveGeoTargetType: z14.enum(POSITIVE_GEO_TARGET_TYPES).optional(),
|
|
4809
|
+
negativeGeoTargetType: z14.enum(NEGATIVE_GEO_TARGET_TYPES).optional()
|
|
4768
4810
|
}).refine(
|
|
4769
4811
|
(p) => p.positiveGeoTargetType !== void 0 || p.negativeGeoTargetType !== void 0,
|
|
4770
4812
|
"geoTargetTypeSetting needs positiveGeoTargetType and/or negativeGeoTargetType"
|
|
4771
4813
|
);
|
|
4772
|
-
var campaignCreateSchema2 =
|
|
4773
|
-
name:
|
|
4774
|
-
channelType:
|
|
4775
|
-
channelSubType:
|
|
4814
|
+
var campaignCreateSchema2 = z14.strictObject({
|
|
4815
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4816
|
+
channelType: z14.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4817
|
+
channelSubType: z14.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4776
4818
|
budget: refSchema,
|
|
4777
4819
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4778
4820
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -4792,12 +4834,12 @@ var campaignCreateSchema2 = z13.strictObject({
|
|
|
4792
4834
|
/** The `{_name}` parameters this campaign's tracking template and final URLs can reference. */
|
|
4793
4835
|
urlCustomParameters: urlCustomParametersSchema.optional(),
|
|
4794
4836
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4795
|
-
objective:
|
|
4837
|
+
objective: z14.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4796
4838
|
/**
|
|
4797
4839
|
* Whether the campaign contains EU political advertising. Google requires the declaration on
|
|
4798
4840
|
* every campaign create (FieldError.REQUIRED without it); omitted means it does not.
|
|
4799
4841
|
*/
|
|
4800
|
-
euPoliticalAds:
|
|
4842
|
+
euPoliticalAds: z14.boolean().optional(),
|
|
4801
4843
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4802
4844
|
}).superRefine((p, ctx) => {
|
|
4803
4845
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -4821,8 +4863,8 @@ var campaignCreateSchema2 = z13.strictObject({
|
|
|
4821
4863
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4822
4864
|
}
|
|
4823
4865
|
});
|
|
4824
|
-
var campaignUpdateSchema2 =
|
|
4825
|
-
name:
|
|
4866
|
+
var campaignUpdateSchema2 = z14.strictObject({
|
|
4867
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4826
4868
|
budget: refSchema.optional(),
|
|
4827
4869
|
bidding: biddingConfigSchema.optional(),
|
|
4828
4870
|
networkSettings: networkSettingsSchema.optional(),
|
|
@@ -4837,130 +4879,130 @@ var campaignUpdateSchema2 = z13.strictObject({
|
|
|
4837
4879
|
/** Replaces the campaign's custom parameters wholesale; `[]` removes them all. */
|
|
4838
4880
|
urlCustomParameters: urlCustomParametersSchema.optional(),
|
|
4839
4881
|
/** Corrects the campaign's EU political advertising declaration (true = contains, false = does not). */
|
|
4840
|
-
euPoliticalAds:
|
|
4841
|
-
status:
|
|
4882
|
+
euPoliticalAds: z14.boolean().optional(),
|
|
4883
|
+
status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4842
4884
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4843
|
-
var adGroupCreateSchema =
|
|
4844
|
-
name:
|
|
4885
|
+
var adGroupCreateSchema = z14.object({
|
|
4886
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4845
4887
|
campaign: refSchema,
|
|
4846
|
-
type:
|
|
4888
|
+
type: z14.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4847
4889
|
cpcBidMicros: microsSchema.optional(),
|
|
4848
4890
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4849
4891
|
});
|
|
4850
|
-
var adGroupUpdateSchema =
|
|
4851
|
-
name:
|
|
4892
|
+
var adGroupUpdateSchema = z14.object({
|
|
4893
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4852
4894
|
cpcBidMicros: microsSchema.optional(),
|
|
4853
|
-
status:
|
|
4895
|
+
status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4854
4896
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4855
|
-
var keywordAddSchema =
|
|
4897
|
+
var keywordAddSchema = z14.object({
|
|
4856
4898
|
adGroup: refSchema,
|
|
4857
4899
|
text: keywordTextSchema,
|
|
4858
4900
|
matchType: matchTypeSchema,
|
|
4859
4901
|
cpcBidMicros: microsSchema.optional(),
|
|
4860
|
-
finalUrls:
|
|
4902
|
+
finalUrls: z14.array(httpsUrlSchema2).optional(),
|
|
4861
4903
|
status: stageableStatusSchema2.default("ENABLED")
|
|
4862
4904
|
});
|
|
4863
|
-
var keywordUpdateSchema =
|
|
4905
|
+
var keywordUpdateSchema = z14.object({
|
|
4864
4906
|
cpcBidMicros: microsSchema.optional(),
|
|
4865
|
-
finalUrls:
|
|
4866
|
-
status:
|
|
4907
|
+
finalUrls: z14.array(httpsUrlSchema2).optional(),
|
|
4908
|
+
status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4867
4909
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4868
|
-
var negativeKeywordAddSchema =
|
|
4869
|
-
level:
|
|
4910
|
+
var negativeKeywordAddSchema = z14.object({
|
|
4911
|
+
level: z14.enum(["adGroup", "campaign"]),
|
|
4870
4912
|
parent: refSchema,
|
|
4871
4913
|
text: keywordTextSchema,
|
|
4872
4914
|
matchType: matchTypeSchema
|
|
4873
4915
|
});
|
|
4874
|
-
var sharedSetCreateSchema =
|
|
4875
|
-
name:
|
|
4876
|
-
type:
|
|
4916
|
+
var sharedSetCreateSchema = z14.object({
|
|
4917
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4918
|
+
type: z14.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4877
4919
|
});
|
|
4878
|
-
var sharedSetMemberAddSchema =
|
|
4920
|
+
var sharedSetMemberAddSchema = z14.object({
|
|
4879
4921
|
sharedSet: refSchema,
|
|
4880
4922
|
text: keywordTextSchema,
|
|
4881
4923
|
matchType: matchTypeSchema
|
|
4882
4924
|
});
|
|
4883
|
-
var campaignSharedSetAttachSchema =
|
|
4925
|
+
var campaignSharedSetAttachSchema = z14.object({
|
|
4884
4926
|
campaign: refSchema,
|
|
4885
4927
|
sharedSet: refSchema
|
|
4886
4928
|
});
|
|
4887
|
-
var adTextAssetSchema =
|
|
4888
|
-
text:
|
|
4889
|
-
pinnedField:
|
|
4929
|
+
var adTextAssetSchema = z14.object({
|
|
4930
|
+
text: z14.string().min(1),
|
|
4931
|
+
pinnedField: z14.enum(PINNED_FIELDS).optional()
|
|
4890
4932
|
});
|
|
4891
|
-
var responsiveSearchAdSchema =
|
|
4892
|
-
format:
|
|
4893
|
-
headlines:
|
|
4933
|
+
var responsiveSearchAdSchema = z14.strictObject({
|
|
4934
|
+
format: z14.literal("responsiveSearch"),
|
|
4935
|
+
headlines: z14.array(
|
|
4894
4936
|
adTextAssetSchema.refine(
|
|
4895
4937
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4896
4938
|
"headline exceeds 30 chars"
|
|
4897
4939
|
)
|
|
4898
4940
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4899
|
-
descriptions:
|
|
4941
|
+
descriptions: z14.array(
|
|
4900
4942
|
adTextAssetSchema.refine(
|
|
4901
4943
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4902
4944
|
"description exceeds 90 chars"
|
|
4903
4945
|
)
|
|
4904
4946
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4905
|
-
path1:
|
|
4906
|
-
path2:
|
|
4907
|
-
finalUrls:
|
|
4908
|
-
});
|
|
4909
|
-
var responsiveDisplayAdSchema =
|
|
4910
|
-
format:
|
|
4911
|
-
headlines:
|
|
4912
|
-
longHeadline:
|
|
4913
|
-
descriptions:
|
|
4914
|
-
businessName:
|
|
4947
|
+
path1: z14.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4948
|
+
path2: z14.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4949
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1)
|
|
4950
|
+
});
|
|
4951
|
+
var responsiveDisplayAdSchema = z14.strictObject({
|
|
4952
|
+
format: z14.literal("responsiveDisplay"),
|
|
4953
|
+
headlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4954
|
+
longHeadline: z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4955
|
+
descriptions: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4956
|
+
businessName: z14.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4915
4957
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
4916
4958
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
4917
4959
|
// image (1:1) to serve; the logo images are optional.
|
|
4918
|
-
marketingImageAssets:
|
|
4919
|
-
squareMarketingImageAssets:
|
|
4920
|
-
logoImageAssets:
|
|
4921
|
-
finalUrls:
|
|
4922
|
-
});
|
|
4923
|
-
var callAdSchema =
|
|
4924
|
-
format:
|
|
4925
|
-
countryCode:
|
|
4926
|
-
phoneNumber:
|
|
4927
|
-
headline1:
|
|
4928
|
-
headline2:
|
|
4929
|
-
description1:
|
|
4930
|
-
description2:
|
|
4931
|
-
businessName:
|
|
4932
|
-
finalUrls:
|
|
4933
|
-
});
|
|
4934
|
-
var appAdSchema =
|
|
4935
|
-
format:
|
|
4936
|
-
headlines:
|
|
4937
|
-
descriptions:
|
|
4960
|
+
marketingImageAssets: z14.array(refSchema).optional(),
|
|
4961
|
+
squareMarketingImageAssets: z14.array(refSchema).optional(),
|
|
4962
|
+
logoImageAssets: z14.array(refSchema).optional(),
|
|
4963
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1)
|
|
4964
|
+
});
|
|
4965
|
+
var callAdSchema = z14.strictObject({
|
|
4966
|
+
format: z14.literal("call"),
|
|
4967
|
+
countryCode: z14.string().length(2),
|
|
4968
|
+
phoneNumber: z14.string().min(3),
|
|
4969
|
+
headline1: z14.string().min(1).max(30),
|
|
4970
|
+
headline2: z14.string().min(1).max(30),
|
|
4971
|
+
description1: z14.string().min(1).max(90),
|
|
4972
|
+
description2: z14.string().min(1).max(90),
|
|
4973
|
+
businessName: z14.string().min(1).max(25),
|
|
4974
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1)
|
|
4975
|
+
});
|
|
4976
|
+
var appAdSchema = z14.strictObject({
|
|
4977
|
+
format: z14.literal("app"),
|
|
4978
|
+
headlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.headlinesMin).max(GOOGLE_ADS_LIMITS.appAd.headlinesMax),
|
|
4979
|
+
descriptions: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.appAd.descriptionsMax),
|
|
4938
4980
|
// An App campaign ad carries its images on its own content (`AppAdInfo.images`), not as
|
|
4939
4981
|
// campaign-level asset links — same shape as a responsive display ad's marketing images.
|
|
4940
|
-
images:
|
|
4982
|
+
images: z14.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.imagesMax).optional(),
|
|
4941
4983
|
// `AppAdInfo.youtube_videos` — an App ad's videos live on its content too. Without this field
|
|
4942
4984
|
// there is no way to express "keep these videos on the ad", so a content update that only
|
|
4943
4985
|
// restated headlines silently left the ad's videos to whatever the mask happened to omit.
|
|
4944
|
-
youtubeVideos:
|
|
4986
|
+
youtubeVideos: z14.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.youtubeVideosMax).optional()
|
|
4945
4987
|
});
|
|
4946
|
-
var videoAdSchema =
|
|
4947
|
-
format:
|
|
4988
|
+
var videoAdSchema = z14.strictObject({
|
|
4989
|
+
format: z14.literal("video"),
|
|
4948
4990
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
4949
4991
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
4950
|
-
videoAssets:
|
|
4951
|
-
finalUrls:
|
|
4952
|
-
});
|
|
4953
|
-
var demandGenAdSchema =
|
|
4954
|
-
format:
|
|
4955
|
-
headlines:
|
|
4956
|
-
descriptions:
|
|
4957
|
-
businessName:
|
|
4958
|
-
finalUrls:
|
|
4959
|
-
imageAssets:
|
|
4960
|
-
squareImageAssets:
|
|
4961
|
-
logoImageAssets:
|
|
4962
|
-
});
|
|
4963
|
-
var adContentSchema2 =
|
|
4992
|
+
videoAssets: z14.array(refSchema).min(1),
|
|
4993
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1)
|
|
4994
|
+
});
|
|
4995
|
+
var demandGenAdSchema = z14.strictObject({
|
|
4996
|
+
format: z14.literal("demandGen"),
|
|
4997
|
+
headlines: z14.array(z14.object({ text: z14.string().min(1).max(40) })).min(1).max(5),
|
|
4998
|
+
descriptions: z14.array(z14.object({ text: z14.string().min(1).max(90) })).min(1).max(5),
|
|
4999
|
+
businessName: z14.string().min(1).max(25),
|
|
5000
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1),
|
|
5001
|
+
imageAssets: z14.array(refSchema).optional(),
|
|
5002
|
+
squareImageAssets: z14.array(refSchema).optional(),
|
|
5003
|
+
logoImageAssets: z14.array(refSchema).optional()
|
|
5004
|
+
});
|
|
5005
|
+
var adContentSchema2 = z14.discriminatedUnion("format", [
|
|
4964
5006
|
responsiveSearchAdSchema,
|
|
4965
5007
|
responsiveDisplayAdSchema,
|
|
4966
5008
|
callAdSchema,
|
|
@@ -4968,45 +5010,45 @@ var adContentSchema2 = z13.discriminatedUnion("format", [
|
|
|
4968
5010
|
videoAdSchema,
|
|
4969
5011
|
demandGenAdSchema
|
|
4970
5012
|
]);
|
|
4971
|
-
var adCreateSchema =
|
|
5013
|
+
var adCreateSchema = z14.object({
|
|
4972
5014
|
adGroup: refSchema,
|
|
4973
5015
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
4974
5016
|
content: adContentSchema2
|
|
4975
5017
|
});
|
|
4976
|
-
var adUpdateSchema =
|
|
4977
|
-
status:
|
|
5018
|
+
var adUpdateSchema = z14.object({
|
|
5019
|
+
status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4978
5020
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4979
|
-
content:
|
|
5021
|
+
content: z14.record(z14.string(), z14.unknown()).optional()
|
|
4980
5022
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4981
|
-
var textAssetSchema =
|
|
4982
|
-
var imageAssetSchema =
|
|
4983
|
-
type:
|
|
4984
|
-
imageId:
|
|
4985
|
-
name:
|
|
4986
|
-
});
|
|
4987
|
-
var youtubeVideoAssetSchema =
|
|
4988
|
-
type:
|
|
4989
|
-
youtubeVideoId:
|
|
4990
|
-
name:
|
|
4991
|
-
});
|
|
4992
|
-
var sitelinkAssetSchema =
|
|
4993
|
-
type:
|
|
4994
|
-
linkText:
|
|
4995
|
-
description1:
|
|
4996
|
-
description2:
|
|
4997
|
-
finalUrls:
|
|
4998
|
-
});
|
|
4999
|
-
var calloutAssetSchema =
|
|
5000
|
-
type:
|
|
5001
|
-
calloutText:
|
|
5002
|
-
});
|
|
5003
|
-
var structuredSnippetAssetSchema =
|
|
5004
|
-
type:
|
|
5005
|
-
header:
|
|
5006
|
-
values:
|
|
5007
|
-
});
|
|
5008
|
-
var callToActionAssetSchema =
|
|
5009
|
-
var assetCreateSchema =
|
|
5023
|
+
var textAssetSchema = z14.object({ type: z14.literal("text"), text: z14.string().min(1) });
|
|
5024
|
+
var imageAssetSchema = z14.object({
|
|
5025
|
+
type: z14.literal("image"),
|
|
5026
|
+
imageId: z14.string().min(1),
|
|
5027
|
+
name: z14.string().optional()
|
|
5028
|
+
});
|
|
5029
|
+
var youtubeVideoAssetSchema = z14.object({
|
|
5030
|
+
type: z14.literal("youtubeVideo"),
|
|
5031
|
+
youtubeVideoId: z14.string().min(1),
|
|
5032
|
+
name: z14.string().optional()
|
|
5033
|
+
});
|
|
5034
|
+
var sitelinkAssetSchema = z14.object({
|
|
5035
|
+
type: z14.literal("sitelink"),
|
|
5036
|
+
linkText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
5037
|
+
description1: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
5038
|
+
description2: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
5039
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1)
|
|
5040
|
+
});
|
|
5041
|
+
var calloutAssetSchema = z14.object({
|
|
5042
|
+
type: z14.literal("callout"),
|
|
5043
|
+
calloutText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
5044
|
+
});
|
|
5045
|
+
var structuredSnippetAssetSchema = z14.object({
|
|
5046
|
+
type: z14.literal("structuredSnippet"),
|
|
5047
|
+
header: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
5048
|
+
values: z14.array(z14.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
5049
|
+
});
|
|
5050
|
+
var callToActionAssetSchema = z14.object({ type: z14.literal("callToAction"), callToAction: z14.string().min(1) });
|
|
5051
|
+
var assetCreateSchema = z14.discriminatedUnion("type", [
|
|
5010
5052
|
textAssetSchema,
|
|
5011
5053
|
imageAssetSchema,
|
|
5012
5054
|
youtubeVideoAssetSchema,
|
|
@@ -5015,136 +5057,136 @@ var assetCreateSchema = z13.discriminatedUnion("type", [
|
|
|
5015
5057
|
structuredSnippetAssetSchema,
|
|
5016
5058
|
callToActionAssetSchema
|
|
5017
5059
|
]);
|
|
5018
|
-
var assetUpdateSchema =
|
|
5019
|
-
name:
|
|
5020
|
-
linkText:
|
|
5021
|
-
description1:
|
|
5022
|
-
description2:
|
|
5023
|
-
finalUrls:
|
|
5024
|
-
calloutText:
|
|
5025
|
-
header:
|
|
5026
|
-
values:
|
|
5027
|
-
callToAction:
|
|
5028
|
-
text:
|
|
5060
|
+
var assetUpdateSchema = z14.object({
|
|
5061
|
+
name: z14.string().min(1).optional(),
|
|
5062
|
+
linkText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
5063
|
+
description1: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
5064
|
+
description2: z14.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
5065
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1).optional(),
|
|
5066
|
+
calloutText: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
5067
|
+
header: z14.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
|
|
5068
|
+
values: z14.array(z14.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
5069
|
+
callToAction: z14.string().min(1).optional(),
|
|
5070
|
+
text: z14.string().min(1).optional()
|
|
5029
5071
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5030
|
-
var assetLinkAttachSchema =
|
|
5031
|
-
level:
|
|
5072
|
+
var assetLinkAttachSchema = z14.object({
|
|
5073
|
+
level: z14.enum(["campaign", "adGroup", "customer"]),
|
|
5032
5074
|
parent: refSchema.optional(),
|
|
5033
5075
|
asset: refSchema,
|
|
5034
|
-
fieldType:
|
|
5076
|
+
fieldType: z14.enum(ASSET_FIELD_TYPES)
|
|
5035
5077
|
}).superRefine((value, ctx) => {
|
|
5036
5078
|
if (value.level !== "customer" && !value.parent) {
|
|
5037
5079
|
ctx.addIssue({
|
|
5038
|
-
code:
|
|
5080
|
+
code: z14.ZodIssueCode.custom,
|
|
5039
5081
|
path: ["parent"],
|
|
5040
5082
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
5041
5083
|
});
|
|
5042
5084
|
}
|
|
5043
5085
|
});
|
|
5044
|
-
var assetGroupCreateSchema =
|
|
5086
|
+
var assetGroupCreateSchema = z14.object({
|
|
5045
5087
|
campaign: refSchema,
|
|
5046
|
-
name:
|
|
5047
|
-
finalUrls:
|
|
5048
|
-
headlines:
|
|
5049
|
-
longHeadlines:
|
|
5050
|
-
descriptions:
|
|
5051
|
-
businessName:
|
|
5052
|
-
imageAssets:
|
|
5053
|
-
squareImageAssets:
|
|
5054
|
-
logoAssets:
|
|
5055
|
-
status:
|
|
5056
|
-
});
|
|
5057
|
-
var assetGroupUpdateSchema =
|
|
5058
|
-
name:
|
|
5059
|
-
finalUrls:
|
|
5060
|
-
status:
|
|
5088
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
5089
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1),
|
|
5090
|
+
headlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
5091
|
+
longHeadlines: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
5092
|
+
descriptions: z14.array(z14.object({ text: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
5093
|
+
businessName: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
5094
|
+
imageAssets: z14.array(refSchema).optional(),
|
|
5095
|
+
squareImageAssets: z14.array(refSchema).optional(),
|
|
5096
|
+
logoAssets: z14.array(refSchema).optional(),
|
|
5097
|
+
status: z14.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
5098
|
+
});
|
|
5099
|
+
var assetGroupUpdateSchema = z14.object({
|
|
5100
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
5101
|
+
finalUrls: z14.array(httpsUrlSchema2).min(1).optional(),
|
|
5102
|
+
status: z14.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
5061
5103
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5062
|
-
var audienceCreateSchema2 =
|
|
5063
|
-
name:
|
|
5064
|
-
type:
|
|
5065
|
-
description:
|
|
5104
|
+
var audienceCreateSchema2 = z14.object({
|
|
5105
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
5106
|
+
type: z14.enum(USER_LIST_TYPES).default("BASIC"),
|
|
5107
|
+
description: z14.string().optional(),
|
|
5066
5108
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
5067
|
-
members:
|
|
5068
|
-
sourceFileRef:
|
|
5109
|
+
members: z14.array(z14.record(z14.string(), z14.string())).optional(),
|
|
5110
|
+
sourceFileRef: z14.string().optional()
|
|
5069
5111
|
});
|
|
5070
|
-
var audienceCriterionAttachSchema =
|
|
5071
|
-
level:
|
|
5112
|
+
var audienceCriterionAttachSchema = z14.object({
|
|
5113
|
+
level: z14.enum(["campaign", "adGroup"]),
|
|
5072
5114
|
parent: refSchema,
|
|
5073
5115
|
userList: refSchema,
|
|
5074
|
-
negative:
|
|
5116
|
+
negative: z14.boolean().default(false)
|
|
5075
5117
|
});
|
|
5076
|
-
var conversionActionCreateSchema =
|
|
5077
|
-
name:
|
|
5078
|
-
type:
|
|
5079
|
-
category:
|
|
5080
|
-
countingType:
|
|
5118
|
+
var conversionActionCreateSchema = z14.object({
|
|
5119
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
5120
|
+
type: z14.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
5121
|
+
category: z14.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
5122
|
+
countingType: z14.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
5081
5123
|
defaultValueMicros: microsSchema.optional(),
|
|
5082
|
-
defaultCurrencyCode:
|
|
5083
|
-
clickThroughLookbackWindowDays:
|
|
5084
|
-
viewThroughLookbackWindowDays:
|
|
5085
|
-
status:
|
|
5086
|
-
});
|
|
5087
|
-
var conversionActionUpdateSchema =
|
|
5088
|
-
name:
|
|
5089
|
-
category:
|
|
5090
|
-
countingType:
|
|
5124
|
+
defaultCurrencyCode: z14.string().length(3).optional(),
|
|
5125
|
+
clickThroughLookbackWindowDays: z14.number().int().positive().optional(),
|
|
5126
|
+
viewThroughLookbackWindowDays: z14.number().int().positive().optional(),
|
|
5127
|
+
status: z14.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
5128
|
+
});
|
|
5129
|
+
var conversionActionUpdateSchema = z14.object({
|
|
5130
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
5131
|
+
category: z14.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
5132
|
+
countingType: z14.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
5091
5133
|
defaultValueMicros: microsSchema.optional(),
|
|
5092
|
-
defaultCurrencyCode:
|
|
5093
|
-
clickThroughLookbackWindowDays:
|
|
5094
|
-
viewThroughLookbackWindowDays:
|
|
5095
|
-
status:
|
|
5134
|
+
defaultCurrencyCode: z14.string().length(3).optional(),
|
|
5135
|
+
clickThroughLookbackWindowDays: z14.number().int().positive().optional(),
|
|
5136
|
+
viewThroughLookbackWindowDays: z14.number().int().positive().optional(),
|
|
5137
|
+
status: z14.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
5096
5138
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5097
|
-
var biddingStrategyCreateSchema =
|
|
5098
|
-
name:
|
|
5139
|
+
var biddingStrategyCreateSchema = z14.object({
|
|
5140
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
5099
5141
|
config: biddingConfigSchema
|
|
5100
5142
|
}).superRefine((p, ctx) => {
|
|
5101
5143
|
if (p.config.type === "MANUAL_CPC") {
|
|
5102
5144
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
5103
5145
|
}
|
|
5104
5146
|
});
|
|
5105
|
-
var biddingStrategyUpdateSchema =
|
|
5106
|
-
name:
|
|
5147
|
+
var biddingStrategyUpdateSchema = z14.object({
|
|
5148
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
5107
5149
|
config: biddingConfigSchema.optional()
|
|
5108
5150
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5109
|
-
var labelCreateSchema =
|
|
5110
|
-
name:
|
|
5111
|
-
backgroundColor:
|
|
5112
|
-
description:
|
|
5151
|
+
var labelCreateSchema = z14.object({
|
|
5152
|
+
name: z14.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
5153
|
+
backgroundColor: z14.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
5154
|
+
description: z14.string().optional()
|
|
5113
5155
|
});
|
|
5114
|
-
var labelAttachSchema =
|
|
5115
|
-
level:
|
|
5156
|
+
var labelAttachSchema = z14.object({
|
|
5157
|
+
level: z14.enum(["campaign", "adGroup", "ad"]),
|
|
5116
5158
|
parent: refSchema,
|
|
5117
5159
|
label: refSchema
|
|
5118
5160
|
});
|
|
5119
|
-
var locationCriterionSchema =
|
|
5120
|
-
criterionType:
|
|
5121
|
-
geoTargetConstant:
|
|
5122
|
-
});
|
|
5123
|
-
var languageCriterionSchema =
|
|
5124
|
-
criterionType:
|
|
5125
|
-
languageConstant:
|
|
5126
|
-
});
|
|
5127
|
-
var adScheduleCriterionSchema =
|
|
5128
|
-
criterionType:
|
|
5129
|
-
dayOfWeek:
|
|
5130
|
-
startHour:
|
|
5131
|
-
startMinute:
|
|
5132
|
-
endHour:
|
|
5133
|
-
endMinute:
|
|
5134
|
-
});
|
|
5135
|
-
var deviceCriterionSchema =
|
|
5136
|
-
criterionType:
|
|
5137
|
-
device:
|
|
5161
|
+
var locationCriterionSchema = z14.object({
|
|
5162
|
+
criterionType: z14.literal("location"),
|
|
5163
|
+
geoTargetConstant: z14.union([z14.string().regex(GEO_TARGET_CONSTANT_REGEX), z14.string().regex(NUMERIC_ID_REGEX2)])
|
|
5164
|
+
});
|
|
5165
|
+
var languageCriterionSchema = z14.object({
|
|
5166
|
+
criterionType: z14.literal("language"),
|
|
5167
|
+
languageConstant: z14.union([z14.string().regex(LANGUAGE_CONSTANT_REGEX), z14.string().regex(NUMERIC_ID_REGEX2)])
|
|
5168
|
+
});
|
|
5169
|
+
var adScheduleCriterionSchema = z14.object({
|
|
5170
|
+
criterionType: z14.literal("adSchedule"),
|
|
5171
|
+
dayOfWeek: z14.enum(DAYS_OF_WEEK),
|
|
5172
|
+
startHour: z14.number().int().min(0).max(23),
|
|
5173
|
+
startMinute: z14.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
5174
|
+
endHour: z14.number().int().min(0).max(24),
|
|
5175
|
+
endMinute: z14.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
5176
|
+
});
|
|
5177
|
+
var deviceCriterionSchema = z14.object({
|
|
5178
|
+
criterionType: z14.literal("device"),
|
|
5179
|
+
device: z14.enum(DEVICE_TYPES),
|
|
5138
5180
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
5139
5181
|
// to opt out of a Device type." So 0 (exclude the device) and 0.1–10.0 are valid; the (0, 0.1) gap is not.
|
|
5140
|
-
bidModifier:
|
|
5182
|
+
bidModifier: z14.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
5141
5183
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
5142
5184
|
})
|
|
5143
5185
|
});
|
|
5144
|
-
var campaignCriterionAddSchema =
|
|
5186
|
+
var campaignCriterionAddSchema = z14.object({
|
|
5145
5187
|
campaign: refSchema,
|
|
5146
|
-
negative:
|
|
5147
|
-
criterion:
|
|
5188
|
+
negative: z14.boolean().default(false),
|
|
5189
|
+
criterion: z14.discriminatedUnion("criterionType", [
|
|
5148
5190
|
locationCriterionSchema,
|
|
5149
5191
|
languageCriterionSchema,
|
|
5150
5192
|
adScheduleCriterionSchema,
|
|
@@ -5154,7 +5196,7 @@ var campaignCriterionAddSchema = z13.object({
|
|
|
5154
5196
|
const c = val.criterion;
|
|
5155
5197
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
5156
5198
|
ctx.addIssue({
|
|
5157
|
-
code:
|
|
5199
|
+
code: z14.ZodIssueCode.custom,
|
|
5158
5200
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
5159
5201
|
path: ["criterion", "endMinute"]
|
|
5160
5202
|
});
|
|
@@ -5206,17 +5248,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
5206
5248
|
"google.campaignCriterion.add",
|
|
5207
5249
|
"google.campaignCriterion.remove"
|
|
5208
5250
|
];
|
|
5209
|
-
var googleDraftOpKindSchema =
|
|
5251
|
+
var googleDraftOpKindSchema = z14.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
5210
5252
|
function createOp2(kind, payload) {
|
|
5211
|
-
return
|
|
5253
|
+
return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, payload });
|
|
5212
5254
|
}
|
|
5213
5255
|
function updateOp2(kind, payload) {
|
|
5214
|
-
return
|
|
5256
|
+
return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
5215
5257
|
}
|
|
5216
5258
|
function targetOp(kind) {
|
|
5217
|
-
return
|
|
5259
|
+
return z14.object({ kind: z14.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
5218
5260
|
}
|
|
5219
|
-
var googleDraftOpInputSchema =
|
|
5261
|
+
var googleDraftOpInputSchema = z14.discriminatedUnion("kind", [
|
|
5220
5262
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
5221
5263
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
5222
5264
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -5264,48 +5306,48 @@ var googleDraftOpInputSchema = z13.discriminatedUnion("kind", [
|
|
|
5264
5306
|
]);
|
|
5265
5307
|
|
|
5266
5308
|
// ../api/src/ads-google/url-options.ts
|
|
5267
|
-
import { z as
|
|
5309
|
+
import { z as z15 } from "zod";
|
|
5268
5310
|
var URL_OPTION_LEVELS = ["account", "campaign", "ad_group", "ad"];
|
|
5269
|
-
var googleUrlOptionValueSchema =
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5311
|
+
var googleUrlOptionValueSchema = z15.discriminatedUnion("state", [
|
|
5312
|
+
z15.object({ state: z15.literal("set"), value: z15.string() }),
|
|
5313
|
+
z15.object({ state: z15.literal("not_set") }),
|
|
5314
|
+
z15.object({ state: z15.literal("not_read"), reason: z15.string() })
|
|
5273
5315
|
]);
|
|
5274
|
-
var googleUrlOptionsRequestSchema =
|
|
5275
|
-
customerId:
|
|
5276
|
-
managerId:
|
|
5316
|
+
var googleUrlOptionsRequestSchema = z15.object({
|
|
5317
|
+
customerId: z15.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id"),
|
|
5318
|
+
managerId: z15.string().optional(),
|
|
5277
5319
|
/** Compact by default: only campaigns that actually override the account. `full` lists every campaign. */
|
|
5278
|
-
full:
|
|
5279
|
-
skipCache:
|
|
5320
|
+
full: z15.boolean().optional(),
|
|
5321
|
+
skipCache: z15.boolean().optional()
|
|
5280
5322
|
});
|
|
5281
|
-
var googleUrlOptionsCampaignSchema =
|
|
5282
|
-
id:
|
|
5283
|
-
name:
|
|
5284
|
-
status:
|
|
5323
|
+
var googleUrlOptionsCampaignSchema = z15.object({
|
|
5324
|
+
id: z15.string(),
|
|
5325
|
+
name: z15.string(),
|
|
5326
|
+
status: z15.string(),
|
|
5285
5327
|
final_url_suffix: googleUrlOptionValueSchema,
|
|
5286
5328
|
tracking_url_template: googleUrlOptionValueSchema
|
|
5287
5329
|
});
|
|
5288
|
-
var googleUrlOptionsResponseSchema =
|
|
5289
|
-
customer_id:
|
|
5290
|
-
account:
|
|
5291
|
-
level:
|
|
5292
|
-
read:
|
|
5330
|
+
var googleUrlOptionsResponseSchema = z15.object({
|
|
5331
|
+
customer_id: z15.string(),
|
|
5332
|
+
account: z15.object({
|
|
5333
|
+
level: z15.literal("account"),
|
|
5334
|
+
read: z15.boolean(),
|
|
5293
5335
|
final_url_suffix: googleUrlOptionValueSchema,
|
|
5294
5336
|
tracking_url_template: googleUrlOptionValueSchema
|
|
5295
5337
|
}),
|
|
5296
|
-
campaigns:
|
|
5297
|
-
level:
|
|
5298
|
-
read:
|
|
5338
|
+
campaigns: z15.object({
|
|
5339
|
+
level: z15.literal("campaign"),
|
|
5340
|
+
read: z15.boolean(),
|
|
5299
5341
|
/** Campaigns actually observed. 0 with `read: true` means the account has no non-removed campaigns. */
|
|
5300
|
-
campaigns_read:
|
|
5342
|
+
campaigns_read: z15.number().int().nonnegative(),
|
|
5301
5343
|
/** Campaigns observed to carry no override of their own — an explicit finding, not an omission. */
|
|
5302
|
-
campaigns_without_override:
|
|
5303
|
-
overrides:
|
|
5344
|
+
campaigns_without_override: z15.number().int().nonnegative(),
|
|
5345
|
+
overrides: z15.array(googleUrlOptionsCampaignSchema),
|
|
5304
5346
|
/** Compact mode only: campaigns read but not listed because they carry no override. */
|
|
5305
|
-
omitted:
|
|
5347
|
+
omitted: z15.number().int().nonnegative()
|
|
5306
5348
|
}),
|
|
5307
5349
|
/** Levels this command never queried. Nothing here may be reported as "not configured". */
|
|
5308
|
-
levels_not_read:
|
|
5350
|
+
levels_not_read: z15.array(z15.object({ level: z15.enum(URL_OPTION_LEVELS), reason: z15.string() }))
|
|
5309
5351
|
});
|
|
5310
5352
|
var ACCOUNT_URL_OPTIONS_LOCATION = "Google Ads UI \u2192 Admin \u2192 Account settings \u2192 Tracking (account-level tracking template and final URL suffix)";
|
|
5311
5353
|
var ACCOUNT_URL_OPTIONS_NOT_STAGEABLE = "Account-level URL options are written by a different Google service than the one Baker's staged changes apply through, so they can't be staged or published from here.";
|
|
@@ -5350,143 +5392,143 @@ function urlOptionsHints(report) {
|
|
|
5350
5392
|
}
|
|
5351
5393
|
|
|
5352
5394
|
// ../api/src/ads-google/wire.ts
|
|
5353
|
-
import { z as
|
|
5354
|
-
var googleWriteModeSchema =
|
|
5355
|
-
var googleDraftOpResultSchema =
|
|
5356
|
-
status:
|
|
5357
|
-
resourceName:
|
|
5358
|
-
error:
|
|
5359
|
-
skippedBecause:
|
|
5360
|
-
executedAt:
|
|
5361
|
-
});
|
|
5362
|
-
var googleDraftStageRequestSchema =
|
|
5363
|
-
chatId:
|
|
5395
|
+
import { z as z16 } from "zod";
|
|
5396
|
+
var googleWriteModeSchema = z16.enum(["live", "simulated"]);
|
|
5397
|
+
var googleDraftOpResultSchema = z16.object({
|
|
5398
|
+
status: z16.enum(["applied", "simulated", "failed", "skipped"]),
|
|
5399
|
+
resourceName: z16.string().optional(),
|
|
5400
|
+
error: z16.string().optional(),
|
|
5401
|
+
skippedBecause: z16.string().optional(),
|
|
5402
|
+
executedAt: z16.number().optional()
|
|
5403
|
+
});
|
|
5404
|
+
var googleDraftStageRequestSchema = z16.object({
|
|
5405
|
+
chatId: z16.string(),
|
|
5364
5406
|
op: googleDraftOpInputSchema
|
|
5365
5407
|
});
|
|
5366
|
-
var googleDraftStageResponseSchema =
|
|
5367
|
-
|
|
5368
|
-
staged:
|
|
5369
|
-
ref:
|
|
5408
|
+
var googleDraftStageResponseSchema = z16.discriminatedUnion("staged", [
|
|
5409
|
+
z16.object({
|
|
5410
|
+
staged: z16.literal(true),
|
|
5411
|
+
ref: z16.string(),
|
|
5370
5412
|
kind: googleDraftOpKindSchema,
|
|
5371
5413
|
mode: googleWriteModeSchema,
|
|
5372
|
-
dependsOn:
|
|
5373
|
-
summary:
|
|
5374
|
-
warnings:
|
|
5414
|
+
dependsOn: z16.array(z16.string()),
|
|
5415
|
+
summary: z16.string(),
|
|
5416
|
+
warnings: z16.array(z16.string()),
|
|
5375
5417
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
5376
|
-
amended:
|
|
5418
|
+
amended: z16.boolean().optional()
|
|
5377
5419
|
}),
|
|
5378
|
-
|
|
5379
|
-
staged:
|
|
5380
|
-
noop:
|
|
5420
|
+
z16.object({
|
|
5421
|
+
staged: z16.literal(false),
|
|
5422
|
+
noop: z16.literal(true),
|
|
5381
5423
|
kind: googleDraftOpKindSchema,
|
|
5382
5424
|
mode: googleWriteModeSchema,
|
|
5383
|
-
summary:
|
|
5384
|
-
reason:
|
|
5425
|
+
summary: z16.string(),
|
|
5426
|
+
reason: z16.string()
|
|
5385
5427
|
})
|
|
5386
5428
|
]);
|
|
5387
|
-
var googleDraftAmendRequestSchema =
|
|
5388
|
-
chatId:
|
|
5389
|
-
ref:
|
|
5390
|
-
patch:
|
|
5429
|
+
var googleDraftAmendRequestSchema = z16.object({
|
|
5430
|
+
chatId: z16.string(),
|
|
5431
|
+
ref: z16.string(),
|
|
5432
|
+
patch: z16.record(z16.string(), z16.unknown())
|
|
5391
5433
|
});
|
|
5392
|
-
var googleDraftShowRequestSchema =
|
|
5393
|
-
chatId:
|
|
5394
|
-
ref:
|
|
5434
|
+
var googleDraftShowRequestSchema = z16.object({
|
|
5435
|
+
chatId: z16.string(),
|
|
5436
|
+
ref: z16.string()
|
|
5395
5437
|
});
|
|
5396
5438
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
5397
|
-
var googleDraftStageBatchRequestSchema =
|
|
5398
|
-
chatId:
|
|
5399
|
-
ops:
|
|
5439
|
+
var googleDraftStageBatchRequestSchema = z16.object({
|
|
5440
|
+
chatId: z16.string(),
|
|
5441
|
+
ops: z16.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
5400
5442
|
});
|
|
5401
|
-
var googleDraftStageBatchResponseSchema =
|
|
5402
|
-
staged:
|
|
5443
|
+
var googleDraftStageBatchResponseSchema = z16.object({
|
|
5444
|
+
staged: z16.literal(true),
|
|
5403
5445
|
mode: googleWriteModeSchema,
|
|
5404
|
-
count:
|
|
5405
|
-
ops:
|
|
5406
|
-
|
|
5407
|
-
ref:
|
|
5446
|
+
count: z16.number(),
|
|
5447
|
+
ops: z16.array(
|
|
5448
|
+
z16.object({
|
|
5449
|
+
ref: z16.string(),
|
|
5408
5450
|
kind: googleDraftOpKindSchema,
|
|
5409
|
-
dependsOn:
|
|
5410
|
-
summary:
|
|
5411
|
-
warnings:
|
|
5451
|
+
dependsOn: z16.array(z16.string()),
|
|
5452
|
+
summary: z16.string(),
|
|
5453
|
+
warnings: z16.array(z16.string())
|
|
5412
5454
|
})
|
|
5413
5455
|
),
|
|
5414
|
-
skipped:
|
|
5456
|
+
skipped: z16.array(z16.object({ kind: googleDraftOpKindSchema, summary: z16.string(), reason: z16.string() })).optional()
|
|
5415
5457
|
});
|
|
5416
|
-
var googleDraftOpViewSchema =
|
|
5417
|
-
ref:
|
|
5458
|
+
var googleDraftOpViewSchema = z16.object({
|
|
5459
|
+
ref: z16.string(),
|
|
5418
5460
|
kind: googleDraftOpKindSchema,
|
|
5419
|
-
customerId:
|
|
5420
|
-
target:
|
|
5421
|
-
dependsOn:
|
|
5422
|
-
summary:
|
|
5423
|
-
stagedAt:
|
|
5461
|
+
customerId: z16.string(),
|
|
5462
|
+
target: z16.string().optional(),
|
|
5463
|
+
dependsOn: z16.array(z16.string()),
|
|
5464
|
+
summary: z16.string(),
|
|
5465
|
+
stagedAt: z16.number(),
|
|
5424
5466
|
result: googleDraftOpResultSchema.optional()
|
|
5425
5467
|
});
|
|
5426
|
-
var googleDraftShowResponseSchema =
|
|
5468
|
+
var googleDraftShowResponseSchema = z16.object({
|
|
5427
5469
|
op: googleDraftOpViewSchema.extend({
|
|
5428
|
-
payload:
|
|
5429
|
-
warnings:
|
|
5430
|
-
annotations:
|
|
5470
|
+
payload: z16.unknown().optional(),
|
|
5471
|
+
warnings: z16.array(z16.string()).optional(),
|
|
5472
|
+
annotations: z16.unknown().optional()
|
|
5431
5473
|
})
|
|
5432
5474
|
});
|
|
5433
|
-
var googleDraftListRequestSchema =
|
|
5434
|
-
chatId:
|
|
5475
|
+
var googleDraftListRequestSchema = z16.object({
|
|
5476
|
+
chatId: z16.string()
|
|
5435
5477
|
});
|
|
5436
|
-
var googleDraftAdvisorySchema =
|
|
5437
|
-
scope:
|
|
5438
|
-
message:
|
|
5478
|
+
var googleDraftAdvisorySchema = z16.object({
|
|
5479
|
+
scope: z16.enum(["campaign", "adGroup"]),
|
|
5480
|
+
message: z16.string()
|
|
5439
5481
|
});
|
|
5440
|
-
var googleDraftStatusCollectionSchema =
|
|
5441
|
-
label:
|
|
5442
|
-
added:
|
|
5443
|
-
removed:
|
|
5444
|
-
existing:
|
|
5482
|
+
var googleDraftStatusCollectionSchema = z16.object({
|
|
5483
|
+
label: z16.string(),
|
|
5484
|
+
added: z16.number(),
|
|
5485
|
+
removed: z16.number(),
|
|
5486
|
+
existing: z16.number()
|
|
5445
5487
|
});
|
|
5446
|
-
var googleDraftChangeOperationSchema =
|
|
5447
|
-
var googleDraftStatusNodeSchema =
|
|
5448
|
-
() =>
|
|
5449
|
-
entity:
|
|
5450
|
-
name:
|
|
5488
|
+
var googleDraftChangeOperationSchema = z16.enum(["create", "update", "pause", "resume", "remove"]);
|
|
5489
|
+
var googleDraftStatusNodeSchema = z16.lazy(
|
|
5490
|
+
() => z16.object({
|
|
5491
|
+
entity: z16.string(),
|
|
5492
|
+
name: z16.string(),
|
|
5451
5493
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
5452
|
-
existing:
|
|
5453
|
-
collections:
|
|
5454
|
-
children:
|
|
5455
|
-
warnings:
|
|
5494
|
+
existing: z16.boolean(),
|
|
5495
|
+
collections: z16.array(googleDraftStatusCollectionSchema),
|
|
5496
|
+
children: z16.array(googleDraftStatusNodeSchema),
|
|
5497
|
+
warnings: z16.array(z16.string()).optional()
|
|
5456
5498
|
})
|
|
5457
5499
|
);
|
|
5458
|
-
var googleDraftListResponseSchema =
|
|
5459
|
-
status:
|
|
5500
|
+
var googleDraftListResponseSchema = z16.object({
|
|
5501
|
+
status: z16.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
5460
5502
|
mode: googleWriteModeSchema,
|
|
5461
|
-
count:
|
|
5462
|
-
ops:
|
|
5503
|
+
count: z16.number(),
|
|
5504
|
+
ops: z16.array(googleDraftOpViewSchema),
|
|
5463
5505
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
5464
|
-
tree:
|
|
5506
|
+
tree: z16.array(googleDraftStatusNodeSchema).optional(),
|
|
5465
5507
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
5466
|
-
advisories:
|
|
5508
|
+
advisories: z16.array(googleDraftAdvisorySchema).optional()
|
|
5467
5509
|
});
|
|
5468
|
-
var googleDraftRemoveRequestSchema =
|
|
5469
|
-
chatId:
|
|
5470
|
-
ref:
|
|
5510
|
+
var googleDraftRemoveRequestSchema = z16.object({
|
|
5511
|
+
chatId: z16.string(),
|
|
5512
|
+
ref: z16.string()
|
|
5471
5513
|
});
|
|
5472
|
-
var googleDraftRemoveResponseSchema =
|
|
5514
|
+
var googleDraftRemoveResponseSchema = z16.object({
|
|
5473
5515
|
/** The requested ref plus any dependents removed by cascade. */
|
|
5474
|
-
removed:
|
|
5516
|
+
removed: z16.array(z16.string())
|
|
5475
5517
|
});
|
|
5476
|
-
var googleDraftClearRequestSchema =
|
|
5477
|
-
chatId:
|
|
5518
|
+
var googleDraftClearRequestSchema = z16.object({
|
|
5519
|
+
chatId: z16.string()
|
|
5478
5520
|
});
|
|
5479
|
-
var googleDraftClearResponseSchema =
|
|
5480
|
-
cleared:
|
|
5521
|
+
var googleDraftClearResponseSchema = z16.object({
|
|
5522
|
+
cleared: z16.number()
|
|
5481
5523
|
});
|
|
5482
|
-
var googleFieldErrorSchema =
|
|
5483
|
-
path:
|
|
5484
|
-
message:
|
|
5524
|
+
var googleFieldErrorSchema = z16.object({
|
|
5525
|
+
path: z16.string(),
|
|
5526
|
+
message: z16.string()
|
|
5485
5527
|
});
|
|
5486
|
-
var googleDraftErrorResponseSchema =
|
|
5487
|
-
code:
|
|
5488
|
-
error:
|
|
5489
|
-
fields:
|
|
5528
|
+
var googleDraftErrorResponseSchema = z16.object({
|
|
5529
|
+
code: z16.string(),
|
|
5530
|
+
error: z16.string(),
|
|
5531
|
+
fields: z16.array(googleFieldErrorSchema).optional()
|
|
5490
5532
|
});
|
|
5491
5533
|
|
|
5492
5534
|
// src/commands/ads/google/changes-window.ts
|
|
@@ -13618,17 +13660,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
13618
13660
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
13619
13661
|
|
|
13620
13662
|
// ../api/src/ads-meta/ops.ts
|
|
13621
|
-
import { z as
|
|
13622
|
-
var tempRefSchema3 =
|
|
13623
|
-
var parentRefSchema2 =
|
|
13624
|
-
var moneySchema2 =
|
|
13625
|
-
amount:
|
|
13626
|
-
currencyCode:
|
|
13627
|
-
});
|
|
13628
|
-
var httpsUrlSchema3 =
|
|
13629
|
-
var bakerMediaIdSchema2 =
|
|
13630
|
-
var stageableStatusSchema3 =
|
|
13631
|
-
var updateStatusSchema =
|
|
13663
|
+
import { z as z17 } from "zod";
|
|
13664
|
+
var tempRefSchema3 = z17.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
13665
|
+
var parentRefSchema2 = z17.union([z17.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
13666
|
+
var moneySchema2 = z17.object({
|
|
13667
|
+
amount: z17.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
|
|
13668
|
+
currencyCode: z17.string().length(3).optional()
|
|
13669
|
+
});
|
|
13670
|
+
var httpsUrlSchema3 = z17.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
13671
|
+
var bakerMediaIdSchema2 = z17.string().min(1);
|
|
13672
|
+
var stageableStatusSchema3 = z17.enum(STAGEABLE_CREATE_STATUSES3);
|
|
13673
|
+
var updateStatusSchema = z17.enum(UPDATE_STATUSES);
|
|
13632
13674
|
function currencyMinimums2(currencyCode) {
|
|
13633
13675
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
13634
13676
|
}
|
|
@@ -13640,35 +13682,35 @@ function validateDailyBudgetFloor(money, ctx, path28) {
|
|
|
13640
13682
|
}
|
|
13641
13683
|
}
|
|
13642
13684
|
}
|
|
13643
|
-
var geoLocationsSchema =
|
|
13644
|
-
countries:
|
|
13645
|
-
regions:
|
|
13646
|
-
cities:
|
|
13647
|
-
zips:
|
|
13648
|
-
location_types:
|
|
13649
|
-
}).catchall(
|
|
13650
|
-
var idNameSchema =
|
|
13651
|
-
var metaTargetingSchema =
|
|
13685
|
+
var geoLocationsSchema = z17.object({
|
|
13686
|
+
countries: z17.array(z17.string().length(2)).optional(),
|
|
13687
|
+
regions: z17.array(z17.object({ key: z17.string() })).optional(),
|
|
13688
|
+
cities: z17.array(z17.object({ key: z17.string(), radius: z17.number().optional(), distance_unit: z17.string().optional() })).optional(),
|
|
13689
|
+
zips: z17.array(z17.object({ key: z17.string() })).optional(),
|
|
13690
|
+
location_types: z17.array(z17.string()).optional()
|
|
13691
|
+
}).catchall(z17.unknown());
|
|
13692
|
+
var idNameSchema = z17.object({ id: z17.string(), name: z17.string().optional() });
|
|
13693
|
+
var metaTargetingSchema = z17.object({
|
|
13652
13694
|
geo_locations: geoLocationsSchema.optional(),
|
|
13653
13695
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
13654
|
-
age_min:
|
|
13655
|
-
age_max:
|
|
13656
|
-
genders:
|
|
13657
|
-
locales:
|
|
13658
|
-
interests:
|
|
13659
|
-
behaviors:
|
|
13660
|
-
custom_audiences:
|
|
13661
|
-
excluded_custom_audiences:
|
|
13662
|
-
flexible_spec:
|
|
13663
|
-
exclusions:
|
|
13664
|
-
publisher_platforms:
|
|
13665
|
-
facebook_positions:
|
|
13666
|
-
instagram_positions:
|
|
13667
|
-
audience_network_positions:
|
|
13668
|
-
messenger_positions:
|
|
13669
|
-
device_platforms:
|
|
13670
|
-
targeting_automation:
|
|
13671
|
-
}).catchall(
|
|
13696
|
+
age_min: z17.number().int().min(13).max(65).optional(),
|
|
13697
|
+
age_max: z17.number().int().min(13).max(65).optional(),
|
|
13698
|
+
genders: z17.array(z17.union([z17.literal(1), z17.literal(2)])).optional(),
|
|
13699
|
+
locales: z17.array(z17.number().int()).optional(),
|
|
13700
|
+
interests: z17.array(idNameSchema).optional(),
|
|
13701
|
+
behaviors: z17.array(idNameSchema).optional(),
|
|
13702
|
+
custom_audiences: z17.array(z17.object({ id: parentRefSchema2 })).optional(),
|
|
13703
|
+
excluded_custom_audiences: z17.array(z17.object({ id: parentRefSchema2 })).optional(),
|
|
13704
|
+
flexible_spec: z17.array(z17.record(z17.string(), z17.unknown())).optional(),
|
|
13705
|
+
exclusions: z17.record(z17.string(), z17.unknown()).optional(),
|
|
13706
|
+
publisher_platforms: z17.array(z17.string()).optional(),
|
|
13707
|
+
facebook_positions: z17.array(z17.string()).optional(),
|
|
13708
|
+
instagram_positions: z17.array(z17.string()).optional(),
|
|
13709
|
+
audience_network_positions: z17.array(z17.string()).optional(),
|
|
13710
|
+
messenger_positions: z17.array(z17.string()).optional(),
|
|
13711
|
+
device_platforms: z17.array(z17.string()).optional(),
|
|
13712
|
+
targeting_automation: z17.object({ advantage_audience: z17.union([z17.literal(0), z17.literal(1)]) }).partial().optional()
|
|
13713
|
+
}).catchall(z17.unknown());
|
|
13672
13714
|
var GEO_INCLUSION_KEYS = [
|
|
13673
13715
|
"countries",
|
|
13674
13716
|
"country_groups",
|
|
@@ -13707,21 +13749,21 @@ function targetingHardLimitsDemographics(t) {
|
|
|
13707
13749
|
const narrowsGender = Array.isArray(t.genders) && t.genders.length === 1;
|
|
13708
13750
|
return narrowsAgeMax || narrowsAgeMin || narrowsGender;
|
|
13709
13751
|
}
|
|
13710
|
-
var specialAdCategoriesSchema =
|
|
13711
|
-
var campaignCreateSchema3 =
|
|
13712
|
-
name:
|
|
13713
|
-
objective:
|
|
13752
|
+
var specialAdCategoriesSchema = z17.array(z17.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
13753
|
+
var campaignCreateSchema3 = z17.object({
|
|
13754
|
+
name: z17.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
13755
|
+
objective: z17.enum(OBJECTIVES),
|
|
13714
13756
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
13715
13757
|
special_ad_categories: specialAdCategoriesSchema,
|
|
13716
|
-
special_ad_category_country:
|
|
13717
|
-
buying_type:
|
|
13718
|
-
bid_strategy:
|
|
13758
|
+
special_ad_category_country: z17.array(z17.string().length(2)).optional(),
|
|
13759
|
+
buying_type: z17.enum(BUYING_TYPES).default("AUCTION"),
|
|
13760
|
+
bid_strategy: z17.enum(BID_STRATEGIES).optional(),
|
|
13719
13761
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
13720
13762
|
dailyBudget: moneySchema2.optional(),
|
|
13721
13763
|
lifetimeBudget: moneySchema2.optional(),
|
|
13722
13764
|
spendCap: moneySchema2.optional(),
|
|
13723
|
-
start_time:
|
|
13724
|
-
stop_time:
|
|
13765
|
+
start_time: z17.number().int().positive().optional(),
|
|
13766
|
+
stop_time: z17.number().int().positive().optional()
|
|
13725
13767
|
}).superRefine((p, ctx) => {
|
|
13726
13768
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
13727
13769
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -13739,15 +13781,15 @@ var campaignCreateSchema3 = z16.object({
|
|
|
13739
13781
|
});
|
|
13740
13782
|
}
|
|
13741
13783
|
});
|
|
13742
|
-
var campaignUpdateSchema3 =
|
|
13743
|
-
name:
|
|
13784
|
+
var campaignUpdateSchema3 = z17.object({
|
|
13785
|
+
name: z17.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
13744
13786
|
status: updateStatusSchema.optional(),
|
|
13745
|
-
bid_strategy:
|
|
13787
|
+
bid_strategy: z17.enum(BID_STRATEGIES).optional(),
|
|
13746
13788
|
dailyBudget: moneySchema2.optional(),
|
|
13747
13789
|
lifetimeBudget: moneySchema2.optional(),
|
|
13748
13790
|
spendCap: moneySchema2.optional(),
|
|
13749
|
-
start_time:
|
|
13750
|
-
stop_time:
|
|
13791
|
+
start_time: z17.number().int().positive().optional(),
|
|
13792
|
+
stop_time: z17.number().int().positive().optional()
|
|
13751
13793
|
}).superRefine((p, ctx) => {
|
|
13752
13794
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
13753
13795
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -13757,42 +13799,42 @@ var campaignUpdateSchema3 = z16.object({
|
|
|
13757
13799
|
}
|
|
13758
13800
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
13759
13801
|
});
|
|
13760
|
-
var promotedObjectSchema =
|
|
13802
|
+
var promotedObjectSchema = z17.object({
|
|
13761
13803
|
page_id: parentRefSchema2.optional(),
|
|
13762
|
-
pixel_id:
|
|
13763
|
-
custom_event_type:
|
|
13764
|
-
application_id:
|
|
13765
|
-
object_store_url:
|
|
13766
|
-
product_catalog_id:
|
|
13767
|
-
product_set_id:
|
|
13768
|
-
whatsapp_phone_number:
|
|
13769
|
-
offline_conversion_data_set_id:
|
|
13804
|
+
pixel_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
13805
|
+
custom_event_type: z17.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
13806
|
+
application_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
13807
|
+
object_store_url: z17.string().url().optional(),
|
|
13808
|
+
product_catalog_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
13809
|
+
product_set_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
13810
|
+
whatsapp_phone_number: z17.string().optional(),
|
|
13811
|
+
offline_conversion_data_set_id: z17.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
13770
13812
|
}).partial();
|
|
13771
|
-
var attributionSpecSchema =
|
|
13772
|
-
|
|
13773
|
-
event_type:
|
|
13774
|
-
window_days:
|
|
13813
|
+
var attributionSpecSchema = z17.array(
|
|
13814
|
+
z17.object({
|
|
13815
|
+
event_type: z17.enum(ATTRIBUTION_EVENT_TYPES),
|
|
13816
|
+
window_days: z17.union([z17.literal(1), z17.literal(7), z17.literal(28)])
|
|
13775
13817
|
})
|
|
13776
13818
|
);
|
|
13777
13819
|
var adSetFields = {
|
|
13778
|
-
name:
|
|
13820
|
+
name: z17.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
13779
13821
|
campaign_id: parentRefSchema2,
|
|
13780
13822
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
13781
13823
|
dailyBudget: moneySchema2.optional(),
|
|
13782
13824
|
lifetimeBudget: moneySchema2.optional(),
|
|
13783
13825
|
bidAmount: moneySchema2.optional(),
|
|
13784
|
-
bid_strategy:
|
|
13785
|
-
billing_event:
|
|
13786
|
-
optimization_goal:
|
|
13787
|
-
destination_type:
|
|
13826
|
+
bid_strategy: z17.enum(BID_STRATEGIES).optional(),
|
|
13827
|
+
billing_event: z17.enum(BILLING_EVENTS),
|
|
13828
|
+
optimization_goal: z17.enum(OPTIMIZATION_GOALS),
|
|
13829
|
+
destination_type: z17.enum(DESTINATION_TYPES).optional(),
|
|
13788
13830
|
promoted_object: promotedObjectSchema.optional(),
|
|
13789
13831
|
attribution_spec: attributionSpecSchema.optional(),
|
|
13790
|
-
start_time:
|
|
13791
|
-
end_time:
|
|
13832
|
+
start_time: z17.number().int().positive().optional(),
|
|
13833
|
+
end_time: z17.number().int().positive().optional(),
|
|
13792
13834
|
targeting: metaTargetingSchema,
|
|
13793
13835
|
/** EU Digital Services Act: who benefits from / pays for the ad. Auto-filled from the account for EU geo when omitted. */
|
|
13794
|
-
dsa_beneficiary:
|
|
13795
|
-
dsa_payor:
|
|
13836
|
+
dsa_beneficiary: z17.string().min(1).max(100).optional(),
|
|
13837
|
+
dsa_payor: z17.string().min(1).max(100).optional()
|
|
13796
13838
|
};
|
|
13797
13839
|
function validateBidStrategy(p, ctx) {
|
|
13798
13840
|
const strategy = p.bid_strategy;
|
|
@@ -13889,7 +13931,7 @@ function validateAdvantageAudience(p, ctx) {
|
|
|
13889
13931
|
});
|
|
13890
13932
|
}
|
|
13891
13933
|
}
|
|
13892
|
-
var adSetCreateSchema =
|
|
13934
|
+
var adSetCreateSchema = z17.object(adSetFields).superRefine((p, ctx) => {
|
|
13893
13935
|
validateAdSetBudgetAndBid(p, ctx);
|
|
13894
13936
|
validateAdSetPromotedObject(p, ctx);
|
|
13895
13937
|
validateAdvantageAudience(p, ctx);
|
|
@@ -13901,22 +13943,22 @@ var adSetCreateSchema = z16.object(adSetFields).superRefine((p, ctx) => {
|
|
|
13901
13943
|
});
|
|
13902
13944
|
}
|
|
13903
13945
|
});
|
|
13904
|
-
var adSetUpdateSchema =
|
|
13946
|
+
var adSetUpdateSchema = z17.object({
|
|
13905
13947
|
name: adSetFields.name.optional(),
|
|
13906
13948
|
status: updateStatusSchema.optional(),
|
|
13907
13949
|
dailyBudget: moneySchema2.optional(),
|
|
13908
13950
|
lifetimeBudget: moneySchema2.optional(),
|
|
13909
13951
|
bidAmount: moneySchema2.optional(),
|
|
13910
|
-
bid_strategy:
|
|
13911
|
-
optimization_goal:
|
|
13912
|
-
destination_type:
|
|
13952
|
+
bid_strategy: z17.enum(BID_STRATEGIES).optional(),
|
|
13953
|
+
optimization_goal: z17.enum(OPTIMIZATION_GOALS).optional(),
|
|
13954
|
+
destination_type: z17.enum(DESTINATION_TYPES).optional(),
|
|
13913
13955
|
promoted_object: promotedObjectSchema.optional(),
|
|
13914
13956
|
attribution_spec: attributionSpecSchema.optional(),
|
|
13915
|
-
start_time:
|
|
13916
|
-
end_time:
|
|
13957
|
+
start_time: z17.number().int().positive().optional(),
|
|
13958
|
+
end_time: z17.number().int().positive().optional(),
|
|
13917
13959
|
targeting: metaTargetingSchema.optional(),
|
|
13918
|
-
dsa_beneficiary:
|
|
13919
|
-
dsa_payor:
|
|
13960
|
+
dsa_beneficiary: z17.string().min(1).max(100).optional(),
|
|
13961
|
+
dsa_payor: z17.string().min(1).max(100).optional()
|
|
13920
13962
|
}).superRefine((p, ctx) => {
|
|
13921
13963
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
13922
13964
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -13927,38 +13969,38 @@ var adSetUpdateSchema = z16.object({
|
|
|
13927
13969
|
}
|
|
13928
13970
|
validateAdvantageAudience(p, ctx);
|
|
13929
13971
|
});
|
|
13930
|
-
var messageSchema =
|
|
13931
|
-
var headlineSchema2 =
|
|
13932
|
-
var descriptionSchema =
|
|
13933
|
-
var callToActionSchema =
|
|
13934
|
-
type:
|
|
13972
|
+
var messageSchema = z17.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
13973
|
+
var headlineSchema2 = z17.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
13974
|
+
var descriptionSchema = z17.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
13975
|
+
var callToActionSchema = z17.object({
|
|
13976
|
+
type: z17.enum(CTA_TYPES2),
|
|
13935
13977
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
13936
13978
|
link: httpsUrlSchema3.optional()
|
|
13937
13979
|
});
|
|
13938
|
-
var creativeEnhancementsSchema =
|
|
13939
|
-
standardEnhancements:
|
|
13940
|
-
features:
|
|
13980
|
+
var creativeEnhancementsSchema = z17.object({
|
|
13981
|
+
standardEnhancements: z17.enum(ENROLL_STATUSES).optional(),
|
|
13982
|
+
features: z17.record(z17.string(), z17.enum(ENROLL_STATUSES)).optional()
|
|
13941
13983
|
});
|
|
13942
13984
|
var creativeSharedFields = {
|
|
13943
|
-
name:
|
|
13985
|
+
name: z17.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
13944
13986
|
/** Facebook Page id backing the ad's identity. */
|
|
13945
13987
|
page_id: parentRefSchema2,
|
|
13946
13988
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
13947
|
-
instagram_user_id:
|
|
13989
|
+
instagram_user_id: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
13948
13990
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
13949
|
-
url_tags:
|
|
13991
|
+
url_tags: z17.string().max(1e3).optional(),
|
|
13950
13992
|
enhancements: creativeEnhancementsSchema.optional()
|
|
13951
13993
|
};
|
|
13952
13994
|
var imageMediaFields = {
|
|
13953
|
-
imageHash:
|
|
13995
|
+
imageHash: z17.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
13954
13996
|
imageRef: tempRefSchema3.optional()
|
|
13955
13997
|
};
|
|
13956
13998
|
var videoMediaFields = {
|
|
13957
|
-
videoId:
|
|
13999
|
+
videoId: z17.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
13958
14000
|
videoRef: tempRefSchema3.optional(),
|
|
13959
14001
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
13960
|
-
thumbnailHash:
|
|
13961
|
-
imageUrl:
|
|
14002
|
+
thumbnailHash: z17.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
14003
|
+
imageUrl: z17.string().url().optional()
|
|
13962
14004
|
};
|
|
13963
14005
|
function countImageRefs(p) {
|
|
13964
14006
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -13966,8 +14008,8 @@ function countImageRefs(p) {
|
|
|
13966
14008
|
function countVideoRefs(p) {
|
|
13967
14009
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
13968
14010
|
}
|
|
13969
|
-
var singleCreativeSchema =
|
|
13970
|
-
creativeType:
|
|
14011
|
+
var singleCreativeSchema = z17.object({
|
|
14012
|
+
creativeType: z17.literal("single"),
|
|
13971
14013
|
...creativeSharedFields,
|
|
13972
14014
|
/** Primary text. */
|
|
13973
14015
|
message: messageSchema,
|
|
@@ -13976,7 +14018,7 @@ var singleCreativeSchema = z16.object({
|
|
|
13976
14018
|
headline: headlineSchema2.optional(),
|
|
13977
14019
|
description: descriptionSchema.optional(),
|
|
13978
14020
|
/** Display URL / caption shown under the headline. */
|
|
13979
|
-
caption:
|
|
14021
|
+
caption: z17.string().max(255).optional(),
|
|
13980
14022
|
call_to_action: callToActionSchema.optional(),
|
|
13981
14023
|
...imageMediaFields,
|
|
13982
14024
|
...videoMediaFields
|
|
@@ -14000,10 +14042,10 @@ var singleCreativeSchema = z16.object({
|
|
|
14000
14042
|
});
|
|
14001
14043
|
}
|
|
14002
14044
|
});
|
|
14003
|
-
var carouselCardSchema =
|
|
14045
|
+
var carouselCardSchema = z17.object({
|
|
14004
14046
|
link: httpsUrlSchema3,
|
|
14005
|
-
headline:
|
|
14006
|
-
description:
|
|
14047
|
+
headline: z17.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
14048
|
+
description: z17.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
14007
14049
|
call_to_action: callToActionSchema.optional(),
|
|
14008
14050
|
...imageMediaFields,
|
|
14009
14051
|
...videoMediaFields
|
|
@@ -14023,35 +14065,35 @@ var carouselCardSchema = z16.object({
|
|
|
14023
14065
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
14024
14066
|
}
|
|
14025
14067
|
});
|
|
14026
|
-
var carouselCreativeSchema2 =
|
|
14027
|
-
creativeType:
|
|
14068
|
+
var carouselCreativeSchema2 = z17.object({
|
|
14069
|
+
creativeType: z17.literal("carousel"),
|
|
14028
14070
|
...creativeSharedFields,
|
|
14029
14071
|
message: messageSchema,
|
|
14030
14072
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
14031
14073
|
link: httpsUrlSchema3.optional(),
|
|
14032
14074
|
call_to_action: callToActionSchema.optional(),
|
|
14033
|
-
cards:
|
|
14075
|
+
cards: z17.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
14034
14076
|
});
|
|
14035
|
-
var dynamicImageSchema =
|
|
14036
|
-
var dynamicVideoSchema =
|
|
14077
|
+
var dynamicImageSchema = z17.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
14078
|
+
var dynamicVideoSchema = z17.object({
|
|
14037
14079
|
videoId: videoMediaFields.videoId,
|
|
14038
14080
|
videoRef: videoMediaFields.videoRef,
|
|
14039
14081
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
14040
14082
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
14041
14083
|
var DYN = META_LIMITS.creative;
|
|
14042
|
-
var dynamicCreativeSchema =
|
|
14043
|
-
creativeType:
|
|
14084
|
+
var dynamicCreativeSchema = z17.object({
|
|
14085
|
+
creativeType: z17.literal("dynamic"),
|
|
14044
14086
|
...creativeSharedFields,
|
|
14045
|
-
bodies:
|
|
14046
|
-
titles:
|
|
14047
|
-
descriptions:
|
|
14048
|
-
images:
|
|
14049
|
-
videos:
|
|
14050
|
-
ad_formats:
|
|
14051
|
-
call_to_action_types:
|
|
14052
|
-
link_urls:
|
|
14087
|
+
bodies: z17.array(z17.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
14088
|
+
titles: z17.array(z17.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
14089
|
+
descriptions: z17.array(z17.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
14090
|
+
images: z17.array(dynamicImageSchema).optional(),
|
|
14091
|
+
videos: z17.array(dynamicVideoSchema).optional(),
|
|
14092
|
+
ad_formats: z17.array(z17.enum(AD_FORMATS2)).min(1),
|
|
14093
|
+
call_to_action_types: z17.array(z17.enum(CTA_TYPES2)).optional(),
|
|
14094
|
+
link_urls: z17.array(z17.object({ website_url: httpsUrlSchema3, display_url: z17.string().optional() })).min(1),
|
|
14053
14095
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
14054
|
-
asset_customization_rules:
|
|
14096
|
+
asset_customization_rules: z17.array(z17.record(z17.string(), z17.unknown())).optional()
|
|
14055
14097
|
}).superRefine((p, ctx) => {
|
|
14056
14098
|
if (!(p.images?.length || p.videos?.length)) {
|
|
14057
14099
|
ctx.addIssue({
|
|
@@ -14061,57 +14103,57 @@ var dynamicCreativeSchema = z16.object({
|
|
|
14061
14103
|
});
|
|
14062
14104
|
}
|
|
14063
14105
|
});
|
|
14064
|
-
var existingPostCreativeSchema =
|
|
14065
|
-
creativeType:
|
|
14106
|
+
var existingPostCreativeSchema = z17.object({
|
|
14107
|
+
creativeType: z17.literal("existing_post"),
|
|
14066
14108
|
name: creativeSharedFields.name,
|
|
14067
14109
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
14068
|
-
object_story_id:
|
|
14110
|
+
object_story_id: z17.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
14069
14111
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
14070
14112
|
url_tags: creativeSharedFields.url_tags,
|
|
14071
14113
|
enhancements: creativeSharedFields.enhancements
|
|
14072
14114
|
});
|
|
14073
|
-
var creativeContentSchema2 =
|
|
14115
|
+
var creativeContentSchema2 = z17.discriminatedUnion("creativeType", [
|
|
14074
14116
|
singleCreativeSchema,
|
|
14075
14117
|
carouselCreativeSchema2,
|
|
14076
14118
|
dynamicCreativeSchema,
|
|
14077
14119
|
existingPostCreativeSchema
|
|
14078
14120
|
]);
|
|
14079
14121
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
14080
|
-
var adCreativeUpdateSchema =
|
|
14081
|
-
name:
|
|
14122
|
+
var adCreativeUpdateSchema = z17.object({
|
|
14123
|
+
name: z17.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
14082
14124
|
status: updateStatusSchema.optional(),
|
|
14083
14125
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
14084
|
-
content:
|
|
14126
|
+
content: z17.record(z17.string(), z17.unknown()).optional()
|
|
14085
14127
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
14086
|
-
var adCreateSchema2 =
|
|
14087
|
-
name:
|
|
14128
|
+
var adCreateSchema2 = z17.object({
|
|
14129
|
+
name: z17.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
14088
14130
|
adset_id: parentRefSchema2,
|
|
14089
14131
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
14090
|
-
creative:
|
|
14132
|
+
creative: z17.object({ creative_id: parentRefSchema2 }),
|
|
14091
14133
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
14092
|
-
tracking_specs:
|
|
14134
|
+
tracking_specs: z17.array(z17.record(z17.string(), z17.unknown())).optional()
|
|
14093
14135
|
});
|
|
14094
|
-
var adUpdateSchema2 =
|
|
14095
|
-
name:
|
|
14136
|
+
var adUpdateSchema2 = z17.object({
|
|
14137
|
+
name: z17.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
14096
14138
|
status: updateStatusSchema.optional(),
|
|
14097
14139
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
14098
|
-
creative:
|
|
14099
|
-
tracking_specs:
|
|
14140
|
+
creative: z17.object({ creative_id: parentRefSchema2 }).optional(),
|
|
14141
|
+
tracking_specs: z17.array(z17.record(z17.string(), z17.unknown())).optional()
|
|
14100
14142
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
14101
|
-
var lookalikeSpecSchema =
|
|
14102
|
-
origin:
|
|
14103
|
-
ratio:
|
|
14104
|
-
country:
|
|
14105
|
-
});
|
|
14106
|
-
var customAudienceCreateSchema =
|
|
14107
|
-
name:
|
|
14108
|
-
subtype:
|
|
14109
|
-
description:
|
|
14110
|
-
customer_file_source:
|
|
14111
|
-
retention_days:
|
|
14143
|
+
var lookalikeSpecSchema = z17.object({
|
|
14144
|
+
origin: z17.array(z17.object({ id: parentRefSchema2 })).min(1),
|
|
14145
|
+
ratio: z17.number().min(0.01).max(0.2).optional(),
|
|
14146
|
+
country: z17.string().length(2).optional()
|
|
14147
|
+
});
|
|
14148
|
+
var customAudienceCreateSchema = z17.object({
|
|
14149
|
+
name: z17.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
14150
|
+
subtype: z17.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
14151
|
+
description: z17.string().max(500).optional(),
|
|
14152
|
+
customer_file_source: z17.string().optional(),
|
|
14153
|
+
retention_days: z17.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
14112
14154
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
14113
14155
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
14114
|
-
rule:
|
|
14156
|
+
rule: z17.record(z17.string(), z17.unknown()).optional()
|
|
14115
14157
|
}).superRefine((p, ctx) => {
|
|
14116
14158
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
14117
14159
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -14120,16 +14162,16 @@ var customAudienceCreateSchema = z16.object({
|
|
|
14120
14162
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
14121
14163
|
}
|
|
14122
14164
|
});
|
|
14123
|
-
var customAudienceUpdateSchema =
|
|
14124
|
-
name:
|
|
14125
|
-
description:
|
|
14165
|
+
var customAudienceUpdateSchema = z17.object({
|
|
14166
|
+
name: z17.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
14167
|
+
description: z17.string().max(500).optional()
|
|
14126
14168
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
14127
|
-
var mediaUploadSchema =
|
|
14128
|
-
kind:
|
|
14169
|
+
var mediaUploadSchema = z17.object({
|
|
14170
|
+
kind: z17.enum(MEDIA_KINDS),
|
|
14129
14171
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
14130
14172
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
14131
14173
|
/** Optional display name / filename hint. */
|
|
14132
|
-
name:
|
|
14174
|
+
name: z17.string().max(255).optional()
|
|
14133
14175
|
}).superRefine((p, ctx) => {
|
|
14134
14176
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
14135
14177
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -14151,16 +14193,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
14151
14193
|
"customAudience.update",
|
|
14152
14194
|
"media.upload"
|
|
14153
14195
|
];
|
|
14154
|
-
var metaDraftOpKindSchema =
|
|
14155
|
-
var accountIdSchema2 =
|
|
14156
|
-
var updateTargetSchema2 =
|
|
14196
|
+
var metaDraftOpKindSchema = z17.enum(META_DRAFT_OP_KINDS);
|
|
14197
|
+
var accountIdSchema2 = z17.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
14198
|
+
var updateTargetSchema2 = z17.union([z17.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
14157
14199
|
function createOp3(kind, payload) {
|
|
14158
|
-
return
|
|
14200
|
+
return z17.object({ kind: z17.literal(kind), accountId: accountIdSchema2, payload });
|
|
14159
14201
|
}
|
|
14160
14202
|
function updateOp3(kind, payload) {
|
|
14161
|
-
return
|
|
14203
|
+
return z17.object({ kind: z17.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
14162
14204
|
}
|
|
14163
|
-
var metaDraftOpInputSchema =
|
|
14205
|
+
var metaDraftOpInputSchema = z17.discriminatedUnion("kind", [
|
|
14164
14206
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
14165
14207
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
14166
14208
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -14175,89 +14217,89 @@ var metaDraftOpInputSchema = z16.discriminatedUnion("kind", [
|
|
|
14175
14217
|
]);
|
|
14176
14218
|
|
|
14177
14219
|
// ../api/src/ads-meta/wire.ts
|
|
14178
|
-
import { z as
|
|
14179
|
-
var metaWriteModeSchema =
|
|
14180
|
-
var metaDraftOpResultSchema =
|
|
14181
|
-
status:
|
|
14220
|
+
import { z as z18 } from "zod";
|
|
14221
|
+
var metaWriteModeSchema = z18.enum(["live", "simulated"]);
|
|
14222
|
+
var metaDraftOpResultSchema = z18.object({
|
|
14223
|
+
status: z18.enum(["applied", "simulated", "failed", "skipped"]),
|
|
14182
14224
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
14183
|
-
id:
|
|
14225
|
+
id: z18.string().optional(),
|
|
14184
14226
|
/** For media.upload ops: the resulting image hash. */
|
|
14185
|
-
hash:
|
|
14186
|
-
error:
|
|
14187
|
-
skippedBecause:
|
|
14188
|
-
executedAt:
|
|
14227
|
+
hash: z18.string().optional(),
|
|
14228
|
+
error: z18.string().optional(),
|
|
14229
|
+
skippedBecause: z18.string().optional(),
|
|
14230
|
+
executedAt: z18.number().optional()
|
|
14189
14231
|
});
|
|
14190
|
-
var metaDraftStageRequestSchema =
|
|
14191
|
-
chatId:
|
|
14232
|
+
var metaDraftStageRequestSchema = z18.object({
|
|
14233
|
+
chatId: z18.string(),
|
|
14192
14234
|
op: metaDraftOpInputSchema
|
|
14193
14235
|
});
|
|
14194
|
-
var metaDraftStageResponseSchema =
|
|
14195
|
-
staged:
|
|
14196
|
-
ref:
|
|
14236
|
+
var metaDraftStageResponseSchema = z18.object({
|
|
14237
|
+
staged: z18.literal(true),
|
|
14238
|
+
ref: z18.string(),
|
|
14197
14239
|
kind: metaDraftOpKindSchema,
|
|
14198
14240
|
mode: metaWriteModeSchema,
|
|
14199
|
-
dependsOn:
|
|
14200
|
-
summary:
|
|
14201
|
-
warnings:
|
|
14241
|
+
dependsOn: z18.array(z18.string()),
|
|
14242
|
+
summary: z18.string(),
|
|
14243
|
+
warnings: z18.array(z18.string()),
|
|
14202
14244
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
14203
|
-
amended:
|
|
14204
|
-
});
|
|
14205
|
-
var metaDraftDuplicateRequestSchema =
|
|
14206
|
-
chatId:
|
|
14207
|
-
accountId:
|
|
14208
|
-
entity:
|
|
14209
|
-
sourceId:
|
|
14210
|
-
overrides:
|
|
14245
|
+
amended: z18.boolean().optional()
|
|
14246
|
+
});
|
|
14247
|
+
var metaDraftDuplicateRequestSchema = z18.object({
|
|
14248
|
+
chatId: z18.string(),
|
|
14249
|
+
accountId: z18.string(),
|
|
14250
|
+
entity: z18.enum(["campaign", "adSet", "ad"]),
|
|
14251
|
+
sourceId: z18.string(),
|
|
14252
|
+
overrides: z18.record(z18.string(), z18.unknown()).optional(),
|
|
14211
14253
|
/** Pause the original after the copy publishes. */
|
|
14212
|
-
replace:
|
|
14254
|
+
replace: z18.boolean().optional()
|
|
14213
14255
|
});
|
|
14214
|
-
var metaDraftOpViewSchema =
|
|
14215
|
-
ref:
|
|
14256
|
+
var metaDraftOpViewSchema = z18.object({
|
|
14257
|
+
ref: z18.string(),
|
|
14216
14258
|
kind: metaDraftOpKindSchema,
|
|
14217
|
-
accountId:
|
|
14218
|
-
target:
|
|
14219
|
-
dependsOn:
|
|
14220
|
-
summary:
|
|
14221
|
-
stagedAt:
|
|
14259
|
+
accountId: z18.string(),
|
|
14260
|
+
target: z18.string().optional(),
|
|
14261
|
+
dependsOn: z18.array(z18.string()),
|
|
14262
|
+
summary: z18.string(),
|
|
14263
|
+
stagedAt: z18.number(),
|
|
14222
14264
|
result: metaDraftOpResultSchema.optional()
|
|
14223
14265
|
});
|
|
14224
|
-
var metaDraftListRequestSchema =
|
|
14225
|
-
chatId:
|
|
14266
|
+
var metaDraftListRequestSchema = z18.object({
|
|
14267
|
+
chatId: z18.string()
|
|
14226
14268
|
});
|
|
14227
|
-
var metaDraftAdvisorySchema =
|
|
14228
|
-
ref:
|
|
14229
|
-
message:
|
|
14269
|
+
var metaDraftAdvisorySchema = z18.object({
|
|
14270
|
+
ref: z18.string(),
|
|
14271
|
+
message: z18.string()
|
|
14230
14272
|
});
|
|
14231
|
-
var metaDraftListResponseSchema =
|
|
14232
|
-
status:
|
|
14273
|
+
var metaDraftListResponseSchema = z18.object({
|
|
14274
|
+
status: z18.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
14233
14275
|
mode: metaWriteModeSchema,
|
|
14234
|
-
count:
|
|
14235
|
-
ops:
|
|
14276
|
+
count: z18.number(),
|
|
14277
|
+
ops: z18.array(metaDraftOpViewSchema),
|
|
14236
14278
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
14237
|
-
advisories:
|
|
14279
|
+
advisories: z18.array(metaDraftAdvisorySchema)
|
|
14238
14280
|
});
|
|
14239
|
-
var metaDraftRemoveRequestSchema =
|
|
14240
|
-
chatId:
|
|
14241
|
-
ref:
|
|
14281
|
+
var metaDraftRemoveRequestSchema = z18.object({
|
|
14282
|
+
chatId: z18.string(),
|
|
14283
|
+
ref: z18.string()
|
|
14242
14284
|
});
|
|
14243
|
-
var metaDraftRemoveResponseSchema =
|
|
14285
|
+
var metaDraftRemoveResponseSchema = z18.object({
|
|
14244
14286
|
/** The requested ref plus any dependents removed by cascade. */
|
|
14245
|
-
removed:
|
|
14287
|
+
removed: z18.array(z18.string())
|
|
14246
14288
|
});
|
|
14247
|
-
var metaDraftClearRequestSchema =
|
|
14248
|
-
chatId:
|
|
14289
|
+
var metaDraftClearRequestSchema = z18.object({
|
|
14290
|
+
chatId: z18.string()
|
|
14249
14291
|
});
|
|
14250
|
-
var metaDraftClearResponseSchema =
|
|
14251
|
-
cleared:
|
|
14292
|
+
var metaDraftClearResponseSchema = z18.object({
|
|
14293
|
+
cleared: z18.number()
|
|
14252
14294
|
});
|
|
14253
|
-
var metaFieldErrorSchema =
|
|
14254
|
-
path:
|
|
14255
|
-
message:
|
|
14295
|
+
var metaFieldErrorSchema = z18.object({
|
|
14296
|
+
path: z18.string(),
|
|
14297
|
+
message: z18.string()
|
|
14256
14298
|
});
|
|
14257
|
-
var metaDraftErrorResponseSchema =
|
|
14258
|
-
code:
|
|
14259
|
-
error:
|
|
14260
|
-
fields:
|
|
14299
|
+
var metaDraftErrorResponseSchema = z18.object({
|
|
14300
|
+
code: z18.string(),
|
|
14301
|
+
error: z18.string(),
|
|
14302
|
+
fields: z18.array(metaFieldErrorSchema).optional()
|
|
14261
14303
|
});
|
|
14262
14304
|
|
|
14263
14305
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -18137,7 +18179,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
18137
18179
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
18138
18180
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
18139
18181
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
18140
|
-
import { z as
|
|
18182
|
+
import { z as z19 } from "zod";
|
|
18141
18183
|
|
|
18142
18184
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
18143
18185
|
var SHOOT_MODES = [
|
|
@@ -18473,71 +18515,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
18473
18515
|
"{{out.video}}"
|
|
18474
18516
|
];
|
|
18475
18517
|
}
|
|
18476
|
-
var FrameAsset =
|
|
18477
|
-
var DialogueLine =
|
|
18478
|
-
speaker:
|
|
18479
|
-
line:
|
|
18518
|
+
var FrameAsset = z19.object({ url: z19.string().optional() }).loose().optional();
|
|
18519
|
+
var DialogueLine = z19.object({
|
|
18520
|
+
speaker: z19.string().optional(),
|
|
18521
|
+
line: z19.string().optional(),
|
|
18480
18522
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
18481
|
-
start_s:
|
|
18482
|
-
end_s:
|
|
18483
|
-
delivery:
|
|
18484
|
-
voice_description:
|
|
18523
|
+
start_s: z19.number().optional(),
|
|
18524
|
+
end_s: z19.number().optional(),
|
|
18525
|
+
delivery: z19.string().optional(),
|
|
18526
|
+
voice_description: z19.string().optional(),
|
|
18485
18527
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
18486
18528
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
18487
18529
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
18488
18530
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
18489
18531
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
18490
|
-
on_camera:
|
|
18532
|
+
on_camera: z19.boolean().optional()
|
|
18491
18533
|
}).loose();
|
|
18492
|
-
var Sfx =
|
|
18493
|
-
at_s:
|
|
18494
|
-
duration_s:
|
|
18495
|
-
sound_effect_prompt:
|
|
18496
|
-
description:
|
|
18534
|
+
var Sfx = z19.object({
|
|
18535
|
+
at_s: z19.number().optional(),
|
|
18536
|
+
duration_s: z19.number().optional(),
|
|
18537
|
+
sound_effect_prompt: z19.string().optional(),
|
|
18538
|
+
description: z19.string().optional()
|
|
18497
18539
|
}).loose();
|
|
18498
|
-
var CompositionRegion =
|
|
18540
|
+
var CompositionRegion = z19.object({
|
|
18499
18541
|
// full | top | bottom | left | right | inset
|
|
18500
|
-
panel:
|
|
18542
|
+
panel: z19.string().optional(),
|
|
18501
18543
|
// 9-grid anchor for an `inset` presenter box.
|
|
18502
|
-
position:
|
|
18503
|
-
is_presenter:
|
|
18544
|
+
position: z19.string().optional(),
|
|
18545
|
+
is_presenter: z19.boolean().optional(),
|
|
18504
18546
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
18505
|
-
cast_ref:
|
|
18547
|
+
cast_ref: z19.string().optional(),
|
|
18506
18548
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
18507
18549
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
18508
18550
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
18509
18551
|
// overlay layer, never AI-generated.
|
|
18510
|
-
kind:
|
|
18552
|
+
kind: z19.string().optional(),
|
|
18511
18553
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
18512
18554
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
18513
18555
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
18514
18556
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
18515
18557
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
18516
18558
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
18517
|
-
surface_id:
|
|
18559
|
+
surface_id: z19.string().optional(),
|
|
18518
18560
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
18519
18561
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
18520
18562
|
// must re-composite, not paint into the surface.
|
|
18521
|
-
nested:
|
|
18522
|
-
summary:
|
|
18523
|
-
frame_prompt:
|
|
18524
|
-
motion_prompt:
|
|
18563
|
+
nested: z19.array(z19.object({}).loose()).optional(),
|
|
18564
|
+
summary: z19.string().optional(),
|
|
18565
|
+
frame_prompt: z19.string().optional(),
|
|
18566
|
+
motion_prompt: z19.string().optional()
|
|
18525
18567
|
}).loose();
|
|
18526
|
-
var SceneComposition =
|
|
18568
|
+
var SceneComposition = z19.object({
|
|
18527
18569
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
18528
|
-
layout:
|
|
18570
|
+
layout: z19.string().optional(),
|
|
18529
18571
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
18530
|
-
split_axis:
|
|
18531
|
-
regions:
|
|
18572
|
+
split_axis: z19.string().optional(),
|
|
18573
|
+
regions: z19.array(CompositionRegion).optional()
|
|
18532
18574
|
}).loose();
|
|
18533
|
-
var CameraMotion =
|
|
18534
|
-
var TranscriptWord =
|
|
18535
|
-
var Scene =
|
|
18536
|
-
start_s:
|
|
18537
|
-
end_s:
|
|
18538
|
-
duration_s:
|
|
18539
|
-
summary:
|
|
18540
|
-
action_detail:
|
|
18575
|
+
var CameraMotion = z19.object({ movement: z19.string().optional(), detail: z19.string().optional() }).loose();
|
|
18576
|
+
var TranscriptWord = z19.object({ text: z19.string().optional() }).loose();
|
|
18577
|
+
var Scene = z19.object({
|
|
18578
|
+
start_s: z19.number().optional(),
|
|
18579
|
+
end_s: z19.number().optional(),
|
|
18580
|
+
duration_s: z19.number().optional(),
|
|
18581
|
+
summary: z19.string().optional(),
|
|
18582
|
+
action_detail: z19.string().optional(),
|
|
18541
18583
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
18542
18584
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
18543
18585
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -18545,82 +18587,82 @@ var Scene = z18.object({
|
|
|
18545
18587
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
18546
18588
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
18547
18589
|
// UGC/product mode; a human can override per scene by setting this.
|
|
18548
|
-
shoot_mode:
|
|
18590
|
+
shoot_mode: z19.string().optional(),
|
|
18549
18591
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
18550
18592
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
18551
|
-
ambient:
|
|
18593
|
+
ambient: z19.string().optional(),
|
|
18552
18594
|
camera_motion: CameraMotion.optional(),
|
|
18553
|
-
start_frame_prompt:
|
|
18554
|
-
end_frame_prompt:
|
|
18555
|
-
motion_prompt:
|
|
18595
|
+
start_frame_prompt: z19.string().optional(),
|
|
18596
|
+
end_frame_prompt: z19.string().optional(),
|
|
18597
|
+
motion_prompt: z19.string().optional(),
|
|
18556
18598
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
18557
18599
|
// script re-craft checklist. Inferred from position when absent.
|
|
18558
|
-
narrative_role:
|
|
18600
|
+
narrative_role: z19.string().optional(),
|
|
18559
18601
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
18560
18602
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
18561
18603
|
// into the hook's start-frame description so the generator renders that state,
|
|
18562
18604
|
// not a calm influencer (CCA-11).
|
|
18563
|
-
hook_mechanic:
|
|
18605
|
+
hook_mechanic: z19.object({ mechanic: z19.string().optional(), why_it_stops_scroll: z19.string().optional() }).loose().optional(),
|
|
18564
18606
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
18565
|
-
scene_setting:
|
|
18607
|
+
scene_setting: z19.string().optional(),
|
|
18566
18608
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
18567
18609
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
18568
18610
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
18569
18611
|
// ignored (nothing follows it).
|
|
18570
|
-
transition_out:
|
|
18571
|
-
dialogue:
|
|
18572
|
-
sfx:
|
|
18573
|
-
overlays:
|
|
18574
|
-
floating_elements:
|
|
18612
|
+
transition_out: z19.object({ type: z19.string().optional(), description: z19.string().optional() }).loose().optional(),
|
|
18613
|
+
dialogue: z19.array(DialogueLine).optional(),
|
|
18614
|
+
sfx: z19.array(Sfx).optional(),
|
|
18615
|
+
overlays: z19.array(z19.unknown()).optional(),
|
|
18616
|
+
floating_elements: z19.array(z19.unknown()).optional(),
|
|
18575
18617
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
18576
18618
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
18577
18619
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
18578
18620
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
18579
|
-
motion_level:
|
|
18580
|
-
transcript_slice:
|
|
18621
|
+
motion_level: z19.enum(["static", "subtle", "dynamic"]).optional(),
|
|
18622
|
+
transcript_slice: z19.array(TranscriptWord).optional(),
|
|
18581
18623
|
start_frame_asset: FrameAsset,
|
|
18582
18624
|
end_frame_asset: FrameAsset,
|
|
18583
18625
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
18584
18626
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
18585
18627
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
18586
18628
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
18587
|
-
continues_previous:
|
|
18629
|
+
continues_previous: z19.boolean().optional()
|
|
18588
18630
|
}).loose();
|
|
18589
|
-
var VideoBlueprint =
|
|
18590
|
-
source:
|
|
18591
|
-
global:
|
|
18592
|
-
music:
|
|
18593
|
-
present:
|
|
18594
|
-
music_prompt:
|
|
18631
|
+
var VideoBlueprint = z19.object({
|
|
18632
|
+
source: z19.object({ aspect_ratio: z19.string().optional(), duration_s: z19.number().optional() }).loose().optional(),
|
|
18633
|
+
global: z19.object({
|
|
18634
|
+
music: z19.object({
|
|
18635
|
+
present: z19.boolean().optional(),
|
|
18636
|
+
music_prompt: z19.string().optional(),
|
|
18595
18637
|
// Absolute second the music enters in the reference (the bed often
|
|
18596
18638
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
18597
18639
|
// instead of at 0 so the timing matches.
|
|
18598
|
-
starts_at_s:
|
|
18640
|
+
starts_at_s: z19.number().optional(),
|
|
18599
18641
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
18600
18642
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
18601
|
-
identified_track:
|
|
18643
|
+
identified_track: z19.object({ title: z19.string().optional(), artist: z19.string().optional() }).loose().nullish()
|
|
18602
18644
|
}).loose().optional(),
|
|
18603
|
-
cast:
|
|
18604
|
-
|
|
18605
|
-
id:
|
|
18606
|
-
description:
|
|
18645
|
+
cast: z19.array(
|
|
18646
|
+
z19.object({
|
|
18647
|
+
id: z19.string().optional(),
|
|
18648
|
+
description: z19.string().optional(),
|
|
18607
18649
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
18608
18650
|
// French speaker") — read to derive the spoken-track language code.
|
|
18609
|
-
market_localization_note:
|
|
18651
|
+
market_localization_note: z19.string().optional()
|
|
18610
18652
|
}).loose()
|
|
18611
18653
|
).optional(),
|
|
18612
|
-
voiceover:
|
|
18654
|
+
voiceover: z19.object({
|
|
18613
18655
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
18614
18656
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
18615
|
-
mode:
|
|
18616
|
-
voice_description:
|
|
18617
|
-
persona:
|
|
18657
|
+
mode: z19.string().optional(),
|
|
18658
|
+
voice_description: z19.string().optional(),
|
|
18659
|
+
persona: z19.string().optional()
|
|
18618
18660
|
}).loose().optional(),
|
|
18619
18661
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
18620
18662
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
18621
|
-
style:
|
|
18663
|
+
style: z19.object({ palette: z19.array(z19.object({ hex: z19.string().optional() }).loose()).optional() }).loose().optional()
|
|
18622
18664
|
}).loose().optional(),
|
|
18623
|
-
scenes:
|
|
18665
|
+
scenes: z19.array(Scene).min(1)
|
|
18624
18666
|
}).loose();
|
|
18625
18667
|
function injectHookPhysicality(blueprint) {
|
|
18626
18668
|
for (const scene of blueprint.scenes) {
|
|
@@ -18637,26 +18679,26 @@ function clipIntentOf(scene, sceneIndex) {
|
|
|
18637
18679
|
if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
|
|
18638
18680
|
return "body";
|
|
18639
18681
|
}
|
|
18640
|
-
var AppearsItem =
|
|
18641
|
-
var RecurringElement =
|
|
18682
|
+
var AppearsItem = z19.union([z19.number(), z19.object({ scene: z19.number(), edge: z19.string().optional() }).loose()]);
|
|
18683
|
+
var RecurringElement = z19.object({
|
|
18642
18684
|
// person | animal | product | logo | badge | other
|
|
18643
|
-
type:
|
|
18644
|
-
label:
|
|
18645
|
-
description:
|
|
18646
|
-
expression:
|
|
18685
|
+
type: z19.string(),
|
|
18686
|
+
label: z19.string().optional(),
|
|
18687
|
+
description: z19.string().optional(),
|
|
18688
|
+
expression: z19.string().nullable().optional(),
|
|
18647
18689
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
18648
|
-
cast_id:
|
|
18690
|
+
cast_id: z19.string().nullable().optional(),
|
|
18649
18691
|
// The label of another element that is the SAME individual as this one, shown
|
|
18650
18692
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
18651
18693
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
18652
18694
|
// slot, but the face/identity must stay identical across them.
|
|
18653
|
-
same_as:
|
|
18695
|
+
same_as: z19.string().nullable().optional(),
|
|
18654
18696
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
18655
18697
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
18656
|
-
scenes:
|
|
18657
|
-
appears_in:
|
|
18698
|
+
scenes: z19.array(z19.number()).optional(),
|
|
18699
|
+
appears_in: z19.array(AppearsItem).optional()
|
|
18658
18700
|
}).loose();
|
|
18659
|
-
var RecurringElements =
|
|
18701
|
+
var RecurringElements = z19.array(RecurringElement);
|
|
18660
18702
|
function sanitizeId(raw, fallback) {
|
|
18661
18703
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
18662
18704
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -19131,7 +19173,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
19131
19173
|
return kept;
|
|
19132
19174
|
}
|
|
19133
19175
|
function sceneFloatDescs(scene) {
|
|
19134
|
-
const floats =
|
|
19176
|
+
const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
19135
19177
|
if (!floats.success) return [];
|
|
19136
19178
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
19137
19179
|
}
|
|
@@ -20555,25 +20597,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
|
|
|
20555
20597
|
}
|
|
20556
20598
|
return tracks;
|
|
20557
20599
|
}
|
|
20558
|
-
var OverlayStyle =
|
|
20559
|
-
var Overlay =
|
|
20560
|
-
text:
|
|
20561
|
-
appears_at_s:
|
|
20562
|
-
duration_s:
|
|
20563
|
-
position:
|
|
20564
|
-
role:
|
|
20565
|
-
animation:
|
|
20566
|
-
animation_detail:
|
|
20600
|
+
var OverlayStyle = z19.object({ color_hex: z19.string().optional(), background: z19.string().optional(), size: z19.string().optional() }).loose();
|
|
20601
|
+
var Overlay = z19.object({
|
|
20602
|
+
text: z19.string().optional(),
|
|
20603
|
+
appears_at_s: z19.number().optional(),
|
|
20604
|
+
duration_s: z19.number().optional(),
|
|
20605
|
+
position: z19.string().optional(),
|
|
20606
|
+
role: z19.string().optional(),
|
|
20607
|
+
animation: z19.string().optional(),
|
|
20608
|
+
animation_detail: z19.string().optional(),
|
|
20567
20609
|
style: OverlayStyle.optional()
|
|
20568
20610
|
}).loose();
|
|
20569
|
-
var FloatingElement =
|
|
20570
|
-
kind:
|
|
20571
|
-
description:
|
|
20572
|
-
brand_name:
|
|
20573
|
-
what_it_represents:
|
|
20574
|
-
appears_at_s:
|
|
20575
|
-
duration_s:
|
|
20576
|
-
position:
|
|
20611
|
+
var FloatingElement = z19.object({
|
|
20612
|
+
kind: z19.string().optional(),
|
|
20613
|
+
description: z19.string().optional(),
|
|
20614
|
+
brand_name: z19.string().nullish(),
|
|
20615
|
+
what_it_represents: z19.string().optional(),
|
|
20616
|
+
appears_at_s: z19.number().optional(),
|
|
20617
|
+
duration_s: z19.number().optional(),
|
|
20618
|
+
position: z19.string().optional()
|
|
20577
20619
|
}).loose();
|
|
20578
20620
|
function escapeHtml(s) {
|
|
20579
20621
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -20605,7 +20647,7 @@ function positionClass(position) {
|
|
|
20605
20647
|
function collectCaptions(blueprint, clock) {
|
|
20606
20648
|
return blueprint.scenes.flatMap((scene, i) => {
|
|
20607
20649
|
const sceneStart = scene.start_s ?? 0;
|
|
20608
|
-
const overlays =
|
|
20650
|
+
const overlays = z19.array(Overlay).safeParse(scene.overlays ?? []);
|
|
20609
20651
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
20610
20652
|
const at = clock.map(i, ov.appears_at_s ?? sceneStart);
|
|
20611
20653
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -20685,7 +20727,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
|
|
|
20685
20727
|
const windows = /* @__PURE__ */ new Map();
|
|
20686
20728
|
blueprint.scenes.forEach((scene, i) => {
|
|
20687
20729
|
const sceneStart = scene.start_s ?? 0;
|
|
20688
|
-
const floats =
|
|
20730
|
+
const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
20689
20731
|
if (!floats.success) return;
|
|
20690
20732
|
for (const fe of floats.data) {
|
|
20691
20733
|
const at = clock.map(i, fe.appears_at_s ?? sceneStart);
|
|
@@ -21133,8 +21175,8 @@ function buildMotionBoard(blueprint) {
|
|
|
21133
21175
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
21134
21176
|
cursor = end_s;
|
|
21135
21177
|
const spoken = sceneSpokenText(scene);
|
|
21136
|
-
const overlays =
|
|
21137
|
-
const floats =
|
|
21178
|
+
const overlays = z19.array(Overlay).safeParse(scene.overlays ?? []);
|
|
21179
|
+
const floats = z19.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
21138
21180
|
const graphics = [
|
|
21139
21181
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
21140
21182
|
kind: "text",
|
|
@@ -22573,7 +22615,7 @@ import path18 from "path";
|
|
|
22573
22615
|
import { defineCommand as defineCommand95 } from "citty";
|
|
22574
22616
|
|
|
22575
22617
|
// src/engine/scaffold/staticAd.ts
|
|
22576
|
-
import { z as
|
|
22618
|
+
import { z as z20 } from "zod";
|
|
22577
22619
|
var GEN_ASPECT_RATIOS = /* @__PURE__ */ new Set(["1:1", "4:5", "9:16", "16:9", "4:3", "3:4", "2:3", "3:2", "21:9"]);
|
|
22578
22620
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
22579
22621
|
var SHEET_SUBJECT_TYPE2 = {
|
|
@@ -22585,24 +22627,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
|
|
|
22585
22627
|
var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
|
|
22586
22628
|
var ADAPT_IMAGE_SIZE = "2K";
|
|
22587
22629
|
var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
|
|
22588
|
-
var Blueprint =
|
|
22589
|
-
meta:
|
|
22590
|
-
text_content:
|
|
22630
|
+
var Blueprint = z20.object({
|
|
22631
|
+
meta: z20.object({ estimated_aspect_ratio: z20.string().optional() }).loose().optional(),
|
|
22632
|
+
text_content: z20.array(z20.object({ text: z20.string().optional() }).loose()).optional()
|
|
22591
22633
|
}).loose();
|
|
22592
|
-
var ElementLocator =
|
|
22593
|
-
collection:
|
|
22594
|
-
index:
|
|
22634
|
+
var ElementLocator = z20.object({
|
|
22635
|
+
collection: z20.enum(["subjects", "people", "brands_logos"]),
|
|
22636
|
+
index: z20.number().int().nonnegative()
|
|
22595
22637
|
}).loose();
|
|
22596
|
-
var MainElement =
|
|
22638
|
+
var MainElement = z20.object({
|
|
22597
22639
|
// logo | product | person | animal | badge | other
|
|
22598
|
-
type:
|
|
22599
|
-
label:
|
|
22600
|
-
description:
|
|
22601
|
-
expression:
|
|
22602
|
-
reason:
|
|
22640
|
+
type: z20.string(),
|
|
22641
|
+
label: z20.string().optional(),
|
|
22642
|
+
description: z20.string().optional(),
|
|
22643
|
+
expression: z20.string().nullable().optional(),
|
|
22644
|
+
reason: z20.string().optional(),
|
|
22603
22645
|
locator: ElementLocator.optional()
|
|
22604
22646
|
}).loose();
|
|
22605
|
-
var MainElements =
|
|
22647
|
+
var MainElements = z20.array(MainElement);
|
|
22606
22648
|
function sanitizeId2(raw, fallback) {
|
|
22607
22649
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
22608
22650
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -29162,7 +29204,24 @@ function parseBrandMd(brandMd, fonts, colors) {
|
|
|
29162
29204
|
if (named) for (const n of named) fonts.add(n.slice(1, -1).trim().toLowerCase());
|
|
29163
29205
|
}
|
|
29164
29206
|
}
|
|
29207
|
+
function brandTokensFromCanonical(tokens) {
|
|
29208
|
+
const fonts = new Set(tokens.fonts.map((f) => f.family.toLowerCase()));
|
|
29209
|
+
const colors = [];
|
|
29210
|
+
for (const color of tokens.colors) {
|
|
29211
|
+
const parsed = parseColor2(color.value);
|
|
29212
|
+
if (parsed) colors.push(parsed);
|
|
29213
|
+
}
|
|
29214
|
+
return { fonts, colors, hasTokens: fonts.size > 0 || colors.length > 0 };
|
|
29215
|
+
}
|
|
29165
29216
|
async function loadBrandTokens(projectRoot) {
|
|
29217
|
+
const tokensRaw = await safeRead(path24.join(projectRoot, "src", "brand", "tokens.json"));
|
|
29218
|
+
if (tokensRaw) {
|
|
29219
|
+
try {
|
|
29220
|
+
const canonical2 = brandTokensSchema.safeParse(JSON.parse(tokensRaw));
|
|
29221
|
+
if (canonical2.success) return brandTokensFromCanonical(canonical2.data);
|
|
29222
|
+
} catch {
|
|
29223
|
+
}
|
|
29224
|
+
}
|
|
29166
29225
|
const globalCss = await safeRead(path24.join(projectRoot, "src", "styles", "global.css"));
|
|
29167
29226
|
const brandMd = await safeRead(path24.join(projectRoot, "src", "brand", "BRAND.md"));
|
|
29168
29227
|
if (!globalCss && !brandMd) return EMPTY;
|