@nodaro/shared 3.16.0 → 3.19.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/dist/index.cjs +427 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +397 -35
- package/dist/index.d.ts +397 -35
- package/dist/index.js +397 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/apply-edl-credit-id.test.ts +25 -0
- package/src/__tests__/caption-plan.test.ts +27 -0
- package/src/__tests__/exposed-field-keys.test.ts +78 -0
- package/src/__tests__/instagram-scrape.test.ts +62 -0
- package/src/__tests__/node-preset-extract.test.ts +62 -0
- package/src/__tests__/node-runtime-keys.test.ts +1 -0
- package/src/__tests__/studio-sequence-owner.test.ts +356 -0
- package/src/__tests__/studio-transient.test.ts +34 -0
- package/src/__tests__/text-to-audio-pricing.test.ts +71 -0
- package/src/__tests__/tts-capabilities.test.ts +237 -0
- package/src/caption-plan.ts +27 -0
- package/src/credit-estimators/index.ts +7 -0
- package/src/credit-estimators/text-to-audio.ts +58 -0
- package/src/credit-identifiers.ts +12 -0
- package/src/exposed-field-keys.ts +49 -0
- package/src/index.ts +36 -1
- package/src/instagram-scrape.ts +91 -16
- package/src/model-catalog.ts +121 -2
- package/src/model-constants.ts +26 -16
- package/src/node-preset-extract.ts +33 -1
- package/src/node-runtime-keys.ts +12 -0
- package/src/presentation-utils.ts +5 -1
- package/src/social-search.ts +3 -3
- package/src/studio-transient.ts +337 -36
- package/src/tts-capabilities.ts +75 -0
package/src/model-catalog.ts
CHANGED
|
@@ -82,6 +82,40 @@ export interface PriceVariant {
|
|
|
82
82
|
note?: string
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/** A voice-setting lever a speech model honours. */
|
|
86
|
+
export type TtsSettingLever = "stability" | "similarity" | "style" | "speed" | "speakerBoost"
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* What a speech model (text-to-speech or dialogue) accepts. The ONE source for
|
|
90
|
+
* every "does this model do X" decision on the text-to-speech lane — tag
|
|
91
|
+
* stripping, which voice settings are sent and shown, the language picker, the
|
|
92
|
+
* per-request character cap. Never compare a provider id by hand; read the sheet
|
|
93
|
+
* through the helpers in `tts-capabilities.ts`.
|
|
94
|
+
*
|
|
95
|
+
* The dialogue model carries a sheet for its own lane too, but until that lane
|
|
96
|
+
* is moved onto it only `maxChars` and `languages` of that sheet are read:
|
|
97
|
+
* editing its other fields changes no dialogue request.
|
|
98
|
+
*/
|
|
99
|
+
export interface TtsCapabilities {
|
|
100
|
+
/** Inline `[audio tags]` are performed. false ⇒ strip them before sending (the model reads them aloud). */
|
|
101
|
+
audioTags: boolean
|
|
102
|
+
/** SSML `<break time="…"/>` tags are honoured. */
|
|
103
|
+
ssmlBreaks: boolean
|
|
104
|
+
/** Voice settings the model honours. A lever not listed is never sent and never shown. */
|
|
105
|
+
levers: readonly TtsSettingLever[]
|
|
106
|
+
/** The request may carry a language code. false ⇒ the field is omitted. */
|
|
107
|
+
languageCode: boolean
|
|
108
|
+
/**
|
|
109
|
+
* Per-request character cap (the total across lines for a dialogue model).
|
|
110
|
+
* `getMaxTtsChars` reads it by exact id and answers {@link TTS_TEXT_MAX}'s 5,000 for
|
|
111
|
+
* the legacy alias and for ids with no sheet, while the sheet lookups answer
|
|
112
|
+
* with the cap of the model such a request actually runs as (turbo's 40,000).
|
|
113
|
+
*/
|
|
114
|
+
maxChars: number
|
|
115
|
+
/** Languages offered in pickers (ISO 639-1; `fil` has no two-letter code). A curated list, not the vendor's full one. */
|
|
116
|
+
languages: readonly string[]
|
|
117
|
+
}
|
|
118
|
+
|
|
85
119
|
export interface ModelCatalogEntry {
|
|
86
120
|
id: string
|
|
87
121
|
kind: ModelKind
|
|
@@ -189,6 +223,11 @@ export interface ModelCatalogEntry {
|
|
|
189
223
|
* the catalog model to offer when it blocks again.
|
|
190
224
|
*/
|
|
191
225
|
safetyFilter?: { stochastic: true; fallback?: string }
|
|
226
|
+
/**
|
|
227
|
+
* Capability sheet of a speech model. REQUIRED on every entry whose `modes`
|
|
228
|
+
* include "tts" or "dialogue" — `tts-capabilities.test.ts` fails otherwise.
|
|
229
|
+
*/
|
|
230
|
+
tts?: TtsCapabilities
|
|
192
231
|
}
|
|
193
232
|
|
|
194
233
|
/**
|
|
@@ -2421,6 +2460,20 @@ const VIDEO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2421
2460
|
// =============================================================================
|
|
2422
2461
|
// AUDIO MODELS
|
|
2423
2462
|
// =============================================================================
|
|
2463
|
+
// Languages each speech model is offered in. The three lists nest: Multilingual
|
|
2464
|
+
// v2 ⊂ Flash v2.5 ⊂ v3.
|
|
2465
|
+
const TTS_LANGS_MULTILINGUAL_V2 = [
|
|
2466
|
+
"en", "ja", "zh", "de", "hi", "fr", "ko", "pt", "it", "es", "id", "nl", "tr", "fil", "pl",
|
|
2467
|
+
"sv", "bg", "ro", "ar", "cs", "el", "fi", "hr", "ms", "sk", "da", "ta", "uk", "ru",
|
|
2468
|
+
] as const
|
|
2469
|
+
const TTS_LANGS_FLASH_V25 = [...TTS_LANGS_MULTILINGUAL_V2, "hu", "no", "vi"] as const
|
|
2470
|
+
const TTS_LANGS_V3 = [
|
|
2471
|
+
...TTS_LANGS_FLASH_V25,
|
|
2472
|
+
"he", "th", "bn", "ur", "fa", "sr", "lt", "lv", "et", "ka", "is", "ca", "af", "sw",
|
|
2473
|
+
] as const
|
|
2474
|
+
// Every lever the v2 families are sent today.
|
|
2475
|
+
const TTS_LEVERS_V2 = ["stability", "similarity", "style", "speed", "speakerBoost"] as const
|
|
2476
|
+
|
|
2424
2477
|
const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
2425
2478
|
// ── ElevenLabs TTS ──
|
|
2426
2479
|
"elevenlabs-v3": {
|
|
@@ -2430,11 +2483,42 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2430
2483
|
family: "ElevenLabs",
|
|
2431
2484
|
label: "ElevenLabs v3",
|
|
2432
2485
|
series: "ElevenLabs",
|
|
2433
|
-
description: "
|
|
2486
|
+
description: "Expressive ElevenLabs TTS — supports [audio tags] for emotion / pacing. Direct API.",
|
|
2434
2487
|
useCases: ["tts", "voice-over", "narration", "expressive"],
|
|
2435
2488
|
features: ["audio-tags", "voice-cloning"],
|
|
2436
2489
|
pricing: [{ identifier: "elevenlabs-v3", credits: 30 }],
|
|
2437
2490
|
featured: true,
|
|
2491
|
+
tts: {
|
|
2492
|
+
audioTags: true,
|
|
2493
|
+
ssmlBreaks: false,
|
|
2494
|
+
levers: ["stability"],
|
|
2495
|
+
languageCode: true,
|
|
2496
|
+
maxChars: 5000, // official cap (probed: 5,200 chars accepted; keep the clamp)
|
|
2497
|
+
languages: TTS_LANGS_V3,
|
|
2498
|
+
},
|
|
2499
|
+
},
|
|
2500
|
+
"elevenlabs-v4": {
|
|
2501
|
+
id: "elevenlabs-v4",
|
|
2502
|
+
kind: "audio",
|
|
2503
|
+
modes: ["tts"] as const,
|
|
2504
|
+
family: "ElevenLabs",
|
|
2505
|
+
label: "ElevenLabs v4",
|
|
2506
|
+
series: "ElevenLabs",
|
|
2507
|
+
description: "Newest ElevenLabs TTS — [audio tags], stability and similarity control, up to 10,000 characters per request. Direct API.",
|
|
2508
|
+
useCases: ["tts", "voice-over", "narration", "expressive", "long-form"],
|
|
2509
|
+
features: ["audio-tags", "voice-cloning"],
|
|
2510
|
+
pricing: [{ identifier: "elevenlabs-v4", credits: 30 }],
|
|
2511
|
+
tts: {
|
|
2512
|
+
audioTags: true,
|
|
2513
|
+
ssmlBreaks: false,
|
|
2514
|
+
levers: ["stability", "similarity"],
|
|
2515
|
+
languageCode: true,
|
|
2516
|
+
maxChars: 10000,
|
|
2517
|
+
// The curated picker, the same 46 as v3. The model itself lists 85
|
|
2518
|
+
// (it adds e.g. Cantonese, Maltese, Mongolian, Burmese, Uzbek); widening
|
|
2519
|
+
// the picker is its own change — it needs a name and a translation per language.
|
|
2520
|
+
languages: TTS_LANGS_V3,
|
|
2521
|
+
},
|
|
2438
2522
|
},
|
|
2439
2523
|
"elevenlabs-turbo": {
|
|
2440
2524
|
id: "elevenlabs-turbo",
|
|
@@ -2446,6 +2530,14 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2446
2530
|
description: "Fast, cheap ElevenLabs TTS via the direct ElevenLabs API. Good for narration.",
|
|
2447
2531
|
useCases: ["tts", "narration", "fast"],
|
|
2448
2532
|
pricing: [{ identifier: "elevenlabs-turbo", credits: 15, note: "per 1K chars" }],
|
|
2533
|
+
tts: {
|
|
2534
|
+
audioTags: false,
|
|
2535
|
+
ssmlBreaks: true,
|
|
2536
|
+
levers: TTS_LEVERS_V2,
|
|
2537
|
+
languageCode: true,
|
|
2538
|
+
maxChars: 40000, // == eleven_flash_v2_5 (functionally equivalent)
|
|
2539
|
+
languages: TTS_LANGS_FLASH_V25,
|
|
2540
|
+
},
|
|
2449
2541
|
},
|
|
2450
2542
|
"elevenlabs-multilingual": {
|
|
2451
2543
|
id: "elevenlabs-multilingual",
|
|
@@ -2457,6 +2549,15 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2457
2549
|
description: "Multi-language ElevenLabs TTS via the direct ElevenLabs API.",
|
|
2458
2550
|
useCases: ["tts", "multilingual"],
|
|
2459
2551
|
pricing: [{ identifier: "elevenlabs-multilingual", credits: 30, note: "per 1K chars" }],
|
|
2552
|
+
tts: {
|
|
2553
|
+
audioTags: false,
|
|
2554
|
+
ssmlBreaks: true,
|
|
2555
|
+
levers: TTS_LEVERS_V2,
|
|
2556
|
+
// The API reference: "This parameter is not supported for multilingual_v2 models."
|
|
2557
|
+
languageCode: false,
|
|
2558
|
+
maxChars: 10000,
|
|
2559
|
+
languages: TTS_LANGS_MULTILINGUAL_V2,
|
|
2560
|
+
},
|
|
2460
2561
|
},
|
|
2461
2562
|
"elevenlabs-dialogue": {
|
|
2462
2563
|
id: "elevenlabs-dialogue",
|
|
@@ -2472,6 +2573,16 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2472
2573
|
useCases: ["tts", "dialogue", "multi-speaker"],
|
|
2473
2574
|
features: ["audio-tags", "voice-cloning"],
|
|
2474
2575
|
pricing: [{ identifier: "elevenlabs-dialogue", credits: 25, note: "per 1K chars" }],
|
|
2576
|
+
tts: {
|
|
2577
|
+
audioTags: true,
|
|
2578
|
+
ssmlBreaks: false,
|
|
2579
|
+
levers: ["stability"],
|
|
2580
|
+
languageCode: true,
|
|
2581
|
+
// Total across lines. The documented 2,000 is a recommendation, not a
|
|
2582
|
+
// limit (2,500 and 5,000 both probed 200); capped like v3, the model underneath.
|
|
2583
|
+
maxChars: 5000,
|
|
2584
|
+
languages: TTS_LANGS_V3,
|
|
2585
|
+
},
|
|
2475
2586
|
},
|
|
2476
2587
|
|
|
2477
2588
|
// ── ElevenLabs voice utilities ──
|
|
@@ -2589,7 +2700,15 @@ const AUDIO_MODELS: Record<string, ModelCatalogEntry> = {
|
|
|
2589
2700
|
series: "ElevenLabs",
|
|
2590
2701
|
description: "Generate short sound effects from a text prompt.",
|
|
2591
2702
|
useCases: ["sfx", "ambient"],
|
|
2592
|
-
|
|
2703
|
+
// Priced per whole second asked for (`elevenlabs-sfx:<n>s`, 1–30 s, rounded
|
|
2704
|
+
// up — textToAudioCreditId); representative rows, every second has its own.
|
|
2705
|
+
// First row = the default variant (a request with no duration bills 5 s).
|
|
2706
|
+
pricing: [
|
|
2707
|
+
{ identifier: "elevenlabs-sfx:5s", credits: 5, note: "5s — also the price when no duration is set; 1 credit per second, rounded up" },
|
|
2708
|
+
{ identifier: "elevenlabs-sfx:1s", credits: 1, note: "1s (min)" },
|
|
2709
|
+
{ identifier: "elevenlabs-sfx:10s", credits: 10, note: "10s" },
|
|
2710
|
+
{ identifier: "elevenlabs-sfx:30s", credits: 30, note: "30s (max)" },
|
|
2711
|
+
],
|
|
2593
2712
|
},
|
|
2594
2713
|
|
|
2595
2714
|
// ── Suno music ──
|
package/src/model-constants.ts
CHANGED
|
@@ -286,28 +286,29 @@ export function getMaxNegativePromptChars(provider: string | undefined): number
|
|
|
286
286
|
return (provider && MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER[provider]) || NEGATIVE_PROMPT_MAX
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
/**
|
|
289
|
+
/** What {@link getMaxTtsChars} answers for an id with no entry of its own: the legacy `elevenlabs` alias (which runs as turbo — pass `canonicalTtsProvider(id)` to get that model's cap), a missing id and an unknown id. */
|
|
290
290
|
export const TTS_TEXT_MAX = 5000
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
* Per-model Text-to-Speech character cap (PER REQUEST)
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
* returned 200 — the old "API hard-limits v3 at 3000" report no longer holds).
|
|
297
|
-
* Dialogue's documented 2,000 is a recommendation, not a limit (2,500 and
|
|
298
|
-
* 5,000 total chars both probed 200); we cap at 5000 like v3 — same model
|
|
299
|
-
* underneath. Absent → {@link TTS_TEXT_MAX}.
|
|
293
|
+
* Per-model Text-to-Speech character cap (PER REQUEST). DERIVED from each
|
|
294
|
+
* speech model's capability sheet (`tts.maxChars` in `MODEL_CATALOG`) — set the
|
|
295
|
+
* cap there, never here. Absent → {@link TTS_TEXT_MAX}.
|
|
300
296
|
*/
|
|
301
|
-
export const MAX_TTS_CHARS_BY_PROVIDER: Record<string, number> =
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
297
|
+
export const MAX_TTS_CHARS_BY_PROVIDER: Record<string, number> = Object.fromEntries(
|
|
298
|
+
Object.values(MODEL_CATALOG)
|
|
299
|
+
.filter((m) => m.tts !== undefined)
|
|
300
|
+
.map((m) => [m.id, m.tts!.maxChars]),
|
|
301
|
+
)
|
|
307
302
|
|
|
308
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* Max TTS text length (chars) for a provider: verified override, else
|
|
305
|
+
* {@link TTS_TEXT_MAX}. The legacy `elevenlabs` alias has no entry of its own
|
|
306
|
+
* (callers that mean the model it runs as pass `canonicalTtsProvider(id)`), and
|
|
307
|
+
* an id named like an inherited object member (`constructor`) is just unknown.
|
|
308
|
+
*/
|
|
309
309
|
export function getMaxTtsChars(provider: string | undefined): number {
|
|
310
|
-
|
|
310
|
+
const cap = provider && Object.hasOwn(MAX_TTS_CHARS_BY_PROVIDER, provider) ? MAX_TTS_CHARS_BY_PROVIDER[provider] : undefined
|
|
311
|
+
return cap || TTS_TEXT_MAX
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
/**
|
|
@@ -1214,6 +1215,7 @@ export type MotionTransferProviderType = typeof MOTION_TRANSFER_PROVIDERS[number
|
|
|
1214
1215
|
/** Text-to-speech providers */
|
|
1215
1216
|
export const TTS_PROVIDERS = [
|
|
1216
1217
|
"elevenlabs-v3",
|
|
1218
|
+
"elevenlabs-v4",
|
|
1217
1219
|
"elevenlabs-turbo",
|
|
1218
1220
|
"elevenlabs-multilingual",
|
|
1219
1221
|
"elevenlabs",
|
|
@@ -1228,6 +1230,14 @@ export const TEXT_TO_AUDIO_PROVIDERS = [
|
|
|
1228
1230
|
] as const
|
|
1229
1231
|
export type TextToAudioProvider = typeof TEXT_TO_AUDIO_PROVIDERS[number]
|
|
1230
1232
|
|
|
1233
|
+
/**
|
|
1234
|
+
* The Text to Audio engine used when a request names none — the route's
|
|
1235
|
+
* credit reservation, the worker, the orchestrator payload and the editor's
|
|
1236
|
+
* node default all read THIS, so they can never disagree about which model
|
|
1237
|
+
* ran and which one was billed.
|
|
1238
|
+
*/
|
|
1239
|
+
export const DEFAULT_TEXT_TO_AUDIO_PROVIDER: TextToAudioProvider = "elevenlabs-sfx"
|
|
1240
|
+
|
|
1231
1241
|
/** Music generation providers */
|
|
1232
1242
|
export const MUSIC_PROVIDERS = [
|
|
1233
1243
|
// Replicate disabled
|
|
@@ -63,11 +63,43 @@ const PROMPT_CONTENT_KEYS: readonly string[] = ["prompt", "scenePrompt", "editPr
|
|
|
63
63
|
*/
|
|
64
64
|
export function presetApplyClearKeys(
|
|
65
65
|
presetData: Readonly<Record<string, unknown>>,
|
|
66
|
+
nodeType?: string,
|
|
66
67
|
): readonly string[] {
|
|
67
68
|
const ownsPromptContent = PROMPT_CONTENT_KEYS.some((k) => presetData[k] !== undefined)
|
|
68
|
-
|
|
69
|
+
const base = ownsPromptContent
|
|
69
70
|
? [...PRESET_APPLY_CLEAR_KEYS, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY]
|
|
70
71
|
: PRESET_APPLY_CLEAR_KEYS
|
|
72
|
+
const levers = presetLeverClearKeys(presetData, nodeType)
|
|
73
|
+
return levers.length > 0 ? [...base, ...levers] : base
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Per node type, the look levers a preset may leave unset. Applying any preset
|
|
78
|
+
* with data to a node of a listed type clears every member that preset does not
|
|
79
|
+
* set, so one preset's plate colour, weight or position never carries over into
|
|
80
|
+
* the next. Data-driven, so a new preset of a listed type is covered by
|
|
81
|
+
* construction. The members stay capture-included: a saved preset carries the
|
|
82
|
+
* levers its node had, so it clears only the ones that were unset when it was saved.
|
|
83
|
+
*/
|
|
84
|
+
export const PRESET_LEVER_GROUPS: Readonly<Record<string, readonly string[]>> = {
|
|
85
|
+
"add-captions": [
|
|
86
|
+
"look", "fontFamily", "fontWeight", "strokeColor", "strokeWidth", "highlightColor",
|
|
87
|
+
"uppercase", "positionY", "animate", "maxWordsPerLine", "backgroundColor",
|
|
88
|
+
],
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The lever-group keys applying THIS preset clears on a node of `nodeType`: every
|
|
93
|
+
* member of the node type's group that the preset does not set. Nothing for a node
|
|
94
|
+
* type with no group, and nothing for empty preset data. Pure.
|
|
95
|
+
*/
|
|
96
|
+
export function presetLeverClearKeys(
|
|
97
|
+
presetData: Readonly<Record<string, unknown>>,
|
|
98
|
+
nodeType?: string,
|
|
99
|
+
): readonly string[] {
|
|
100
|
+
if (!nodeType || !Object.hasOwn(PRESET_LEVER_GROUPS, nodeType)) return []
|
|
101
|
+
if (!Object.values(presetData).some((v) => v !== undefined)) return []
|
|
102
|
+
return PRESET_LEVER_GROUPS[nodeType]!.filter((k) => presetData[k] === undefined)
|
|
71
103
|
}
|
|
72
104
|
|
|
73
105
|
/**
|
package/src/node-runtime-keys.ts
CHANGED
|
@@ -51,6 +51,11 @@ export const EXECUTION_DATA_KEYS: ReadonlySet<string> = new Set([
|
|
|
51
51
|
// List fan-out window flag (abandon-guard exemption). Set/cleared by
|
|
52
52
|
// executeNodeForList — purely execution-related, never user-edited.
|
|
53
53
|
"__listRunning",
|
|
54
|
+
// One token per paid run still out on this node that no executor mark
|
|
55
|
+
// covers (the editor's `withRunInFlight`, around each paid call outside the
|
|
56
|
+
// executors). Purely execution-related, never user-edited; also in
|
|
57
|
+
// TRANSIENT_RUNTIME_KEYS.
|
|
58
|
+
"__runsInFlight",
|
|
54
59
|
// Selector node dual-channel outputs (picked + rest). Server-side execution
|
|
55
60
|
// output, not user-edited config.
|
|
56
61
|
"pickedResults",
|
|
@@ -118,6 +123,10 @@ export const EXECUTION_DATA_KEYS: ReadonlySet<string> = new Set([
|
|
|
118
123
|
// and not config: it stops a reload from painting the same run again over
|
|
119
124
|
// edits made since. Persisted for the same reason as resultsClearedAt.
|
|
120
125
|
"resultsRunId",
|
|
126
|
+
// When that run ended the node (beside resultsRunId): the editor's reopen
|
|
127
|
+
// keeps a result a NEWER run left even when its own run listing cannot see
|
|
128
|
+
// that run. Bookkeeping, persisted for the same reason.
|
|
129
|
+
"resultsRunEndedAt",
|
|
121
130
|
// A trigger's last run values (also in TRANSIENT_RUNTIME_KEYS: never saved).
|
|
122
131
|
"__triggerData",
|
|
123
132
|
])
|
|
@@ -149,6 +158,9 @@ export const TRANSIENT_RUNTIME_KEYS: ReadonlySet<string> = new Set([
|
|
|
149
158
|
"__listTotal",
|
|
150
159
|
"__listCompleted",
|
|
151
160
|
"__listRunning",
|
|
161
|
+
// A paid run still out, held by the editor tab that started it. Never
|
|
162
|
+
// saved, so a reload, which has no such run, starts without one.
|
|
163
|
+
"__runsInFlight",
|
|
152
164
|
"_upstreamRefresh",
|
|
153
165
|
"__upstreamCount",
|
|
154
166
|
// Video URL node download ticks. They used to dirty the workflow twice a
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { GenericNode, GenericEdge } from "./types.js"
|
|
7
7
|
import type { PresentationItem } from "./presentation-types.js"
|
|
8
8
|
import { AUDIO_PRODUCER_TYPES, VIDEO_PRODUCER_TYPES } from "./producer-types.js"
|
|
9
|
+
import { canonicalizeOverrideKeys } from "./exposed-field-keys.js"
|
|
9
10
|
|
|
10
11
|
// ---------------------------------------------------------------------------
|
|
11
12
|
// Node type sets
|
|
@@ -422,13 +423,16 @@ const MEDIA_INPUT_FIELD_TYPES: ReadonlySet<InputFieldSchema["type"]> = new Set([
|
|
|
422
423
|
*
|
|
423
424
|
* Schema-driven on purpose: a new media input node is covered by its
|
|
424
425
|
* `INPUT_FIELD_MAP` row, with no list to remember here.
|
|
426
|
+
*
|
|
427
|
+
* An override sent under a renamed exposed-field key (an app published before
|
|
428
|
+
* the rename) lands on the node's current field — `canonicalizeOverrideKeys`.
|
|
425
429
|
*/
|
|
426
430
|
export function mergeNodeInputOverrides(
|
|
427
431
|
nodeType: string | undefined,
|
|
428
432
|
data: Record<string, unknown>,
|
|
429
433
|
overrides: Record<string, unknown>,
|
|
430
434
|
): Record<string, unknown> {
|
|
431
|
-
const merged: Record<string, unknown> = { ...data, ...overrides }
|
|
435
|
+
const merged: Record<string, unknown> = { ...data, ...canonicalizeOverrideKeys(nodeType, overrides) }
|
|
432
436
|
const schema = nodeType ? INPUT_FIELD_MAP[nodeType] : undefined
|
|
433
437
|
if (
|
|
434
438
|
schema &&
|
package/src/social-search.ts
CHANGED
|
@@ -19,8 +19,8 @@ export const SOCIAL_SEARCH_NODE_TYPE = "social-search" as const
|
|
|
19
19
|
export const SOCIAL_PLATFORMS = ["tiktok", "instagram", "youtube", "x", "reddit", "linkedin", "meta_ads"] as const
|
|
20
20
|
export type SocialPlatform = (typeof SOCIAL_PLATFORMS)[number]
|
|
21
21
|
|
|
22
|
-
/** `account` is a creator, a LinkedIn company page or
|
|
23
|
-
* `community` is a subreddit. */
|
|
22
|
+
/** `account` is a creator, a LinkedIn company page or person's profile, or
|
|
23
|
+
* a Meta advertiser; `community` is a subreddit. */
|
|
24
24
|
export const SOCIAL_SEARCH_MODES = ["keyword", "account", "community"] as const
|
|
25
25
|
export type SocialSearchMode = (typeof SOCIAL_SEARCH_MODES)[number]
|
|
26
26
|
|
|
@@ -165,7 +165,7 @@ export type SocialSearchParams = {
|
|
|
165
165
|
/** Default `keyword`. */
|
|
166
166
|
readonly mode?: SocialSearchMode
|
|
167
167
|
/** A keyword, or an account: a handle, a profile link, a subreddit, a
|
|
168
|
-
* LinkedIn company page, a Meta advertiser's name or page id. */
|
|
168
|
+
* LinkedIn company page or profile, a Meta advertiser's name or page id. */
|
|
169
169
|
readonly query: string
|
|
170
170
|
/** 20, 40 or 60 results. Default 20. */
|
|
171
171
|
readonly count?: SocialSearchCount
|