declare const timeBasedDynamicVars: Set; declare const mockDataFunctions: { guid: () => string; timestamp: () => string; isoTimestamp: () => string; randomUUID: () => string; randomNanoId: () => string; randomAlphaNumeric: () => string; randomBoolean: () => boolean; randomInt: () => number; randomColor: () => string; randomHexColor: () => string; randomAbbreviation: () => string; randomIP: () => string; randomIPV4: () => string; randomIPV6: () => string; randomMACAddress: () => string; randomPassword: () => string; randomLocale: () => string; randomUserAgent: () => string; randomProtocol: () => "http" | "https"; randomSemver: () => string; randomFirstName: () => string; randomLastName: () => string; randomFullName: () => string; randomNamePrefix: () => string; randomNameSuffix: () => string; randomJobArea: () => string; randomJobDescriptor: () => string; randomJobTitle: () => string; randomJobType: () => string; randomPhoneNumber: () => string; randomPhoneNumberExt: () => string; randomCity: () => string; randomStreetName: () => string; randomStreetAddress: () => string; randomCountry: () => string; randomCountryCode: () => string; randomLatitude: () => number; randomLongitude: () => number; randomAvatarImage: () => string; randomImageUrl: () => string; randomAbstractImage: () => string; randomAnimalsImage: () => string; randomBusinessImage: () => string; randomCatsImage: () => string; randomCityImage: () => string; randomFoodImage: () => string; randomNightlifeImage: () => string; randomFashionImage: () => string; randomPeopleImage: () => string; randomNatureImage: () => string; randomSportsImage: () => string; randomTransportImage: () => string; randomImageDataUri: () => string; randomBankAccount: () => string; randomBankAccountName: () => string; randomCreditCardMask: () => string; randomBankAccountBic: () => string; randomBankAccountIban: () => string; randomTransactionType: () => string; randomCurrencyCode: () => string; randomCurrencyName: () => string; randomCurrencySymbol: () => string; randomBitcoin: () => string; randomCompanyName: () => string; randomCompanySuffix: () => string; randomBs: () => string; randomBsAdjective: () => string; randomBsBuzz: () => string; randomBsNoun: () => string; randomCatchPhrase: () => string; randomCatchPhraseAdjective: () => string; randomCatchPhraseDescriptor: () => string; randomCatchPhraseNoun: () => string; randomDatabaseColumn: () => string; randomDatabaseType: () => string; randomDatabaseCollation: () => string; randomDatabaseEngine: () => string; randomDateFuture: () => string; randomDatePast: () => string; randomDateRecent: () => string; randomWeekday: () => string; randomMonth: () => string; randomDomainName: () => string; randomDomainSuffix: () => string; randomDomainWord: () => string; randomEmail: () => string; randomExampleEmail: () => string; randomUserName: () => string; randomUrl: () => string; randomFileName: () => string; randomFileType: () => string; randomFileExt: () => string; randomCommonFileName: () => string; randomCommonFileType: () => string; randomCommonFileExt: () => string; randomFilePath: () => string; randomDirectoryPath: () => string; randomMimeType: () => string; randomPrice: () => string; randomProduct: () => string; randomProductAdjective: () => string; randomProductMaterial: () => string; randomProductName: () => string; randomDepartment: () => string; randomNoun: () => string; randomVerb: () => string; randomIngverb: () => string; randomAdjective: () => string; randomWord: () => string; randomWords: () => string; randomPhrase: () => string; randomLoremWord: () => string; randomLoremWords: () => string; randomLoremSentence: () => string; randomLoremSentences: () => string; randomLoremParagraph: () => string; randomLoremParagraphs: () => string; randomLoremText: () => string; randomLoremSlug: () => string; randomLoremLines: () => string; }; /** * The interpolation function expects a string with placeholders and an object with the values to replace the placeholders. * The keys passed can have dot notation too. * * Ex: interpolate('Hello, my name is ${user.name} and I am ${user.age} years old', { * "user.name": "Bruno", * "user": { * "age": 6 * } * }); * Output: Hello, my name is Bruno and I am 6 years old */ declare const interpolate: (str: string, obj: Record, options?: { escapeJSONStrings?: boolean; }) => string; declare const interpolateObject: (obj: unknown, variables: Record) => unknown; declare const percentageToZoomLevel: (percentage: number) => number; /** * A request should be included if it has at least one tag that is included and no tags that are excluded * @param requestTags Tags of the request * @param includeTags Tags to include * @param excludeTags Tags to exclude */ declare const isRequestTagsIncluded: (requestTags: string[], includeTags: string[], excludeTags: string[]) => boolean; interface Collection { items?: any[]; [key: string]: any; } /** * Backward compatibility: Convert string status to number in examples * Old collections exported before the fix had status as string * This function ensures status is always a number for schema validation */ declare const transformExampleStatusInCollection: (collection: Collection | Collection[]) => Collection; /** * Returns true when `url` already carries an explicit network scheme. * * Per the WHATWG URL Standard, all network-fetch schemes (http, https, ftp, * ws, wss, file) require "://" — the authority component is mandatory. * This means "localhost:8080" is NOT a scheme: the colon separates host from * port, so callers should prepend "http://" to it. * * The scheme character set (ASCII alpha/digit/+/-/.) follows the WHATWG URL * scheme-state parser, which accepts the same characters as all major browsers. * @see https://url.spec.whatwg.org/#scheme-state * * @example * hasExplicitScheme('https://example.com') // true * hasExplicitScheme('ftp://files.example') // true * hasExplicitScheme('localhost:8080') // false — port colon, not scheme * hasExplicitScheme('example.com/api') // false — no scheme at all */ declare function hasExplicitScheme(url: string): boolean; interface QueryParam { name: string; value?: string; } interface BuildQueryStringOptions { encode?: boolean; } interface ExtractQueryParamsOptions { decode?: boolean; } declare function buildQueryString(paramsArray: QueryParam[], { encode }?: BuildQueryStringOptions): string; declare function parseQueryParams(query: string, { decode }?: ExtractQueryParamsOptions): QueryParam[]; declare const encodeUrl: (url: string) => string; /** * Strip the origin (scheme + authority) from a URL, returning the path, query, and fragment. * Returns '/' if the URL has no path component. * * @example * stripOrigin('https://example.com/api/users?name=foo') // '/api/users?name=foo' * stripOrigin('http://localhost:3000') // '/' */ declare const stripOrigin: (url: string) => string; /** * Builds a URL-encoded payload from various data formats * * This function handles multiple input formats: * - Array of objects with 'name' and 'value' properties (preserves order) * * @param data The request body data * @returns URL-encoded string suitable for application/x-www-form-urlencoded content type * * @example * // Array format (preserves order) * buildFormUrlEncodedPayload([{name: 'a', value: '1'}, {name: 'b', value: '2'}]) * // Returns: 'a=1&b=2' */ declare const buildFormUrlEncodedPayload: (params: Array<{ name: string; value: string | number | boolean | undefined; }>) => string; /** * Determines if the given object is a FormData instance. * Supports native FormData (Node 18+, browser) and the 'form-data' npm package. * @param obj - Object to check. * @returns True if obj is a FormData instance, false otherwise. */ declare const isFormData: (obj: unknown) => boolean; /** * Extracts boundary parameter from a Content-Type header value. * @param contentType - The Content-Type header value (e.g., "multipart/mixed; boundary=my-boundary") * @returns The boundary value if found, or null if not present */ declare const extractBoundaryFromContentType: (contentType: unknown) => string | null; /** * Was implemented specifically for request.url where the url might have variables * that might need to be sanitised before being passed to a URL validator that doesn't * allow special characters that bruno uses as variables (`{{var_name}}`) * * The function replaces the input string with a unique hash that can be restored * later by the helper returned by this function */ declare function patternHasher(input: string, pattern?: string | RegExp): { hashed: string; restore(current: string): string; }; /** * Valid examples: "?Name", "?Prompt Var", "?x" * Invalid examples: "? Name", "?Name ", "?{{Name}}", "?{Name}" */ declare const PROMPT_VARIABLE_TEXT_PATTERN: RegExp; /** * Valid matches: "{{?Name}}", "{{?Prompt Var}}", "{{?x}}" * Invalid: "{{? Name}}", "{{?Name }}", "{{?{Name}}}" */ declare const PROMPT_VARIABLE_TEMPLATE_PATTERN: RegExp; /** * Extract prompt variables matching {{?}} from a string. * @param {string} str - The input string. * @returns {string[]} - An array of extracted prompt variables. */ declare const extractPromptVariablesFromString: (str: string) => string[]; /** * Extract prompt variables from an object. * @param {*} obj - The input object. * @returns {string[]} - An array of extracted prompt variables. */ declare function extractPromptVariables(obj: any): string[]; interface DotenvVariable { name: string; value?: string; } /** * Serializes an array of environment variables to .env file format. * * This is the inverse of dotenvToJson - it converts a variables array * back to .env file content that can be parsed by the dotenv package. * * Quoting strategy based on dotenv parser behavior: * - Unquoted: preserves \, ", ' literally. Only # is problematic (starts comment). * - Single-quoted: everything is literal. Cannot contain single quotes. * - Double-quoted: only \n and \r are expanded. Everything else is literal. * * Therefore: * - Values with actual newlines/carriage returns → double-quote + escape \n/\r * - Values with # but no ' → single-quote (literal) * - Values with # and ' → backtick-quote or double-quote fallback * - Values with leading/trailing whitespace → quote to prevent trimming * - Everything else → unquoted (preserves \, ", ' as-is) */ declare const jsonToDotenv: (variables: DotenvVariable[]) => string; declare const ENV_VAR_WRITE_APIS: string[]; declare const GITHUB_DISCUSSION_URL = "https://github.com/usebruno/bruno/discussions/8257"; declare const ENV_VAR_WRITE_OPEN_PATTERN: RegExp; declare const scriptWritesEnvVar: (code?: string | null) => boolean; type index_DotenvVariable = DotenvVariable; declare const index_ENV_VAR_WRITE_APIS: typeof ENV_VAR_WRITE_APIS; declare const index_ENV_VAR_WRITE_OPEN_PATTERN: typeof ENV_VAR_WRITE_OPEN_PATTERN; declare const index_GITHUB_DISCUSSION_URL: typeof GITHUB_DISCUSSION_URL; declare const index_PROMPT_VARIABLE_TEMPLATE_PATTERN: typeof PROMPT_VARIABLE_TEMPLATE_PATTERN; declare const index_PROMPT_VARIABLE_TEXT_PATTERN: typeof PROMPT_VARIABLE_TEXT_PATTERN; declare const index_buildFormUrlEncodedPayload: typeof buildFormUrlEncodedPayload; declare const index_buildQueryString: typeof buildQueryString; declare const index_encodeUrl: typeof encodeUrl; declare const index_extractBoundaryFromContentType: typeof extractBoundaryFromContentType; declare const index_extractPromptVariables: typeof extractPromptVariables; declare const index_extractPromptVariablesFromString: typeof extractPromptVariablesFromString; declare const index_hasExplicitScheme: typeof hasExplicitScheme; declare const index_isFormData: typeof isFormData; declare const index_jsonToDotenv: typeof jsonToDotenv; declare const index_parseQueryParams: typeof parseQueryParams; declare const index_patternHasher: typeof patternHasher; declare const index_scriptWritesEnvVar: typeof scriptWritesEnvVar; declare const index_stripOrigin: typeof stripOrigin; declare namespace index { export { index_DotenvVariable as DotenvVariable, index_ENV_VAR_WRITE_APIS as ENV_VAR_WRITE_APIS, index_ENV_VAR_WRITE_OPEN_PATTERN as ENV_VAR_WRITE_OPEN_PATTERN, index_GITHUB_DISCUSSION_URL as GITHUB_DISCUSSION_URL, index_PROMPT_VARIABLE_TEMPLATE_PATTERN as PROMPT_VARIABLE_TEMPLATE_PATTERN, index_PROMPT_VARIABLE_TEXT_PATTERN as PROMPT_VARIABLE_TEXT_PATTERN, index_buildFormUrlEncodedPayload as buildFormUrlEncodedPayload, index_buildQueryString as buildQueryString, index_encodeUrl as encodeUrl, index_extractBoundaryFromContentType as extractBoundaryFromContentType, index_extractPromptVariables as extractPromptVariables, index_extractPromptVariablesFromString as extractPromptVariablesFromString, index_hasExplicitScheme as hasExplicitScheme, index_isFormData as isFormData, index_jsonToDotenv as jsonToDotenv, index_parseQueryParams as parseQueryParams, index_patternHasher as patternHasher, index_scriptWritesEnvVar as scriptWritesEnvVar, index_stripOrigin as stripOrigin, }; } export { interpolate, interpolateObject, isRequestTagsIncluded, mockDataFunctions, percentageToZoomLevel, timeBasedDynamicVars, transformExampleStatusInCollection, index as utils };