@bloom-perf/yaml-pptr 2.0.2 → 3.1.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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * JSON Schema (draft 2020-12) of the YAML configuration, generated from the
3
+ * zod schema used at runtime, so both always agree. Published as
4
+ * `dist/schema.json` for editors (completion, hover documentation, validation).
5
+ */
6
+ export declare const buildJsonSchema: () => Record<string, unknown>;
@@ -1,2 +1,2 @@
1
- import { RootYaml } from './validator';
1
+ import { RootYaml } from './validator.js';
2
2
  export declare const parseYaml: (yamlContent: string) => RootYaml;
@@ -1,10 +1,19 @@
1
- import { YpLogger } from '../core/logger';
2
- import { Scenario } from '../core/model';
3
- import { RootYaml } from './validator';
4
- type EnvVarResolve = (arg: string) => string;
1
+ import { YpLogger } from '../core/logger.js';
2
+ import { Scenario } from '../core/model.js';
3
+ import { RootYaml } from './validator.js';
4
+ type EnvVarResolve = (name: string) => string;
5
+ /**
6
+ * Transforms the validated YAML into the domain model and resolves
7
+ * environment variables:
8
+ * - `${VAR}` anywhere in URLs, selectors, typed texts and screenshot paths;
9
+ * - `$VAR` as the whole value of location, navigate, GOTO url and SCREENSHOT path;
10
+ * - `$VAR[workerIndex]` as the whole value of location and navigate.
11
+ *
12
+ * Resolved values are never logged: they may contain credentials.
13
+ */
5
14
  export declare class Resolver {
6
- private envVarResolve;
7
- private logger;
15
+ private readonly envVarResolve;
16
+ private readonly logger;
8
17
  constructor(envVarResolve: EnvVarResolve, logger?: YpLogger);
9
18
  resolve(yaml: RootYaml): {
10
19
  scenarios: Scenario[];
@@ -13,7 +22,10 @@ export declare class Resolver {
13
22
  private resolveStep;
14
23
  private resolveAction;
15
24
  private createNavigateAction;
16
- private resolveUrlOrEnv;
17
- private resolveStringOrEnv;
25
+ /** `$VAR` as the whole value, or `${VAR}` placeholders anywhere. */
26
+ private resolveWholeValueOrInterpolate;
27
+ /** Replaces `${VAR}` placeholders; `$${` produces a literal `${`. */
28
+ private interpolate;
29
+ private env;
18
30
  }
19
31
  export {};