/** * Placeholders a preset payload can carry, resolved when the preset is APPLIED. * * A write preset is usually single-use: it creates something with an email, a reference or a * slug that cannot be reused, so the second press either replays the first or is refused, and * whoever is testing has to hand-edit the values before every run. * * Some presets need the opposite, though: one proving an idempotent replay has to send the value * the previous request sent, and one proving that a reference cannot be reused across two buyers * has to reuse it. Resolve a token per REQUEST and those stop testing anything while still * answering 200, which reads as a pass. * * So there are two kinds of token, and which one a preset wants depends on what it is proving: * * - `{{UNIQUE}}` is fresh on every apply. This is the default for a preset that creates * something: press play, get values nobody has used, press play again, get another set. Two * people testing at the same time never collide with each other either. * - `{{RUN}}` is stable until someone starts a new run, and shared by every preset of the * endpoint. This is for the rarer case where two DIFFERENT presets have to meet on the same * value — a reference one preset creates and another tries to reuse. * * Resolution happens when the preset is APPLIED, not when the request is sent, and that is what * lets a single preset prove an idempotent replay even with `{{UNIQUE}}`: apply once, then send * twice. The second send reuses the body already in the editor, which is exactly what a retried * webhook does. * * Every token resolves once per apply, so an email and a reference in the same payload agree * with each other. */ /** Token → value for a single apply. Built once so every occurrence resolves identically. */ export interface PresetPlaceholderValues { UNIQUE: string; RUN: string; TIMESTAMP: string; UUID: string; FIRST_TEAM_ID: string; } export declare const PRESET_RUN_TOKEN_KEY = "devtools.presetRunToken"; /** The current run token, minting one on first use. Survives reloads: a run outlives a refresh. */ export declare function readPresetRunToken(): string; /** Starts a new run. Presets applied from here on get values nothing has used before. */ export declare function regeneratePresetRunToken(): string; export declare function createPresetPlaceholderValues(): PresetPlaceholderValues; /** * Replaces every known token inside a preset value, walking strings, arrays and objects. * * An unknown token is left exactly as written rather than blanked: a preset that names something * this version does not provide should show that in the editor, where it can be read and fixed, * instead of silently sending an empty string that the endpoint then rejects for the wrong reason. */ export declare function resolvePresetPlaceholders(value: T, values?: PresetPlaceholderValues): T; //# sourceMappingURL=preset-placeholders.d.ts.map