@docsxai/engine 0.2.0 → 0.2.1-rc.1
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 +8 -1
- package/dist/auth/api-login.d.ts +3 -3
- package/dist/auth/api-login.js +6 -2
- package/dist/auth/email-otp.d.ts +60 -60
- package/dist/auth/jwt-injection.d.ts +45 -45
- package/dist/auth/pat-header.d.ts +2 -2
- package/dist/auth/types.d.ts +2 -2
- package/dist/auth/ui-form.d.ts +54 -54
- package/dist/auth/webauthn.d.ts +22 -22
- package/dist/backend-client-contracts.d.ts +2 -2
- package/dist/calibrate.d.ts +2 -2
- package/dist/cli-commands-session.js +1 -0
- package/dist/cli-usage.d.ts +1 -1
- package/dist/cli-usage.js +1 -1
- package/dist/doc-pack.d.ts +268 -179
- package/dist/doc-pack.js +19 -1
- package/dist/doctor-checks.js +4 -4
- package/dist/flow-file.d.ts +2 -2
- package/dist/flow-runtime.d.ts +18 -2
- package/dist/flow-runtime.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/obstacles.d.ts +33 -0
- package/dist/obstacles.js +72 -0
- package/dist/page-nearby-boxes.d.ts +9 -0
- package/dist/page-nearby-boxes.js +92 -0
- package/dist/playwright-driver.d.ts +2 -0
- package/dist/playwright-driver.js +25 -0
- package/dist/plugins/manifest.d.ts +9 -9
- package/dist/style.d.ts +2 -2
- package/dist/workspace.d.ts +8 -0
- package/dist/zip.d.ts +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ The engine **never** calls a model API. Calibration-time inference is supplied b
|
|
|
10
10
|
- **Execution environment** — optional `environment` block (`EnvironmentSpec`): frozen `clock` (Playwright clock API), `locale`, `timezone`, `viewport` (`VIEWPORT_PRESETS`: desktop / tablet / mobile, or explicit size), `color_scheme`, `reduced_motion`. Applied at context creation by `launchPlaywrightSession({ environment })`; on CDP-attached sessions only the clock applies (one stderr warning lists skipped fields). `contextOptions` passes `httpCredentials` / `clientCertificates` / `extraHTTPHeaders` through to `browser.newContext`.
|
|
11
11
|
- **Redactions** — flow-level + per-step `RedactionSpec[]` (`{ selector }` or `{ region }`, style `box` | `pixelate`) masked deterministically before any screenshot (halt shots included) hits disk. The pure pixel transform is `applyRedactions` in `redact.ts`.
|
|
12
12
|
- **`BrowserDriver`** interface — what the runtime needs from a browser. The `PlaywrightDriver` implementation includes the `actionable()` predicate (see [`docs/actionability-contract.md`](../../docs/actionability-contract.md)) that browser-bridge consumers can mirror, plus a real `element_stable` wait (bounding-box polling, 10 s best-effort budget).
|
|
13
|
+
- **Annotation obstacles** — opt-in (`.docsxai.json` → `"annotations": { "obstacles": true }`, default off). After a step's screenshot, `runFlow` asks the driver for `nearbyBoxes(selector, 320)`: the visible text (per rendered line) and interactive elements around the target, in screenshot pixels, the target's subtree and elements containing it excluded. The pure `selectObstacles` (`obstacles.ts`) rounds boxes outward to whole pixels, clips them to the screenshot, drops duplicates, boxes inside the target and boxes covered by another kept box, caps at the 40 nearest and sorts by y, x, width, height. The result lands as `obstacles` on the annotation record, where the viewer's `burn` uses it to keep callouts off page content. The scan reads the page's own DOM (no iframe or shadow-root content) and runs only through the driver, so any `BrowserDriver` must implement `nearbyBoxes`. Off or absent, records and screenshots are unchanged.
|
|
13
14
|
- **Auth strategies** — `auth/strategy.yaml` descriptor + a catalogue of scripted strategies (`api-login`, `ui-form` with a TOTP hop, `email-otp`, `webauthn`, `jwt-injection`, `http-basic`, `pat-header`, `mtls`, `test-backdoor`) alongside the human-in-the-loop `manual-capture`. See [Auth strategies](#auth-strategies) below.
|
|
14
15
|
- **CLI** — `docsxai <command>`. See `--help` or the [top-level README](../../README.md) for the full surface; this package's `dist/cli.js` is the binary.
|
|
15
16
|
|
|
@@ -31,6 +32,10 @@ zip package the doc pack for hand-off
|
|
|
31
32
|
baseline snapshot the doc pack (flows, prose, annotations, screenshots, locators) for drift comparison
|
|
32
33
|
diff deterministic drift report against a baseline (--fail-on warn|fail gates CI)
|
|
33
34
|
export project the doc pack to a publisher format (`export adf` — Confluence ADF; `export playwright` — Playwright specs)
|
|
35
|
+
plugins list / info / sync the workspace plugin set (see Plugins below)
|
|
36
|
+
login validate a backend bearer token (`--oauth` runs the OAuth 2.1 + PKCE flow)
|
|
37
|
+
push upload the doc pack to the backend as a new revision
|
|
38
|
+
pull fetch a backend revision's artifacts into the workspace
|
|
34
39
|
```
|
|
35
40
|
|
|
36
41
|
`run` has a sub-3-second iteration mode for long-async flows: `--start-from <step-id> --cdp <endpoint>` skips every step before the target and attaches to an already-warm Chrome.
|
|
@@ -104,7 +109,7 @@ The register module exports a `register(api)` function (named or default). `api`
|
|
|
104
109
|
|
|
105
110
|
### Workspace config + lock
|
|
106
111
|
|
|
107
|
-
Two optional `.docsxai.json` keys wire plugins into a workspace:
|
|
112
|
+
Two optional `.docsxai.json` keys wire plugins into a workspace (a third, `annotations.obstacles`, switches on obstacle scanning for `run`; see the engine overview above):
|
|
108
113
|
|
|
109
114
|
```json
|
|
110
115
|
{
|
|
@@ -113,6 +118,8 @@ Two optional `.docsxai.json` keys wire plugins into a workspace:
|
|
|
113
118
|
}
|
|
114
119
|
```
|
|
115
120
|
|
|
121
|
+
`@docsxai/plugin-confluence` is repo-only (`private: true`, not on npm). Build it in a checkout (`pnpm -r build`) and wire it by path instead: `{ "path": "<checkout>/packages/plugin-confluence" }`. The `{ "package": ... }` form resolves only once the package is installed in the workspace.
|
|
122
|
+
|
|
116
123
|
`plugins-lock.json` (schema `docsxai/plugins-lock@1`, next to the config) pins each plugin's register-module sha256. When it exists, every resolve verifies the bytes **before** importing; a mismatch fails closed with a "run `docsxai plugins sync`" message.
|
|
117
124
|
|
|
118
125
|
### CLI
|
package/dist/auth/api-login.d.ts
CHANGED
|
@@ -34,9 +34,9 @@ export declare const ApiLoginOptions: z.ZodObject<{
|
|
|
34
34
|
equals?: unknown;
|
|
35
35
|
}>]>>;
|
|
36
36
|
}, "strict", z.ZodTypeAny, {
|
|
37
|
-
method: string;
|
|
38
37
|
login_url: string;
|
|
39
|
-
|
|
38
|
+
method: string;
|
|
39
|
+
body_format: "form" | "json";
|
|
40
40
|
success_check?: {
|
|
41
41
|
cookie: string;
|
|
42
42
|
} | {
|
|
@@ -48,7 +48,7 @@ export declare const ApiLoginOptions: z.ZodObject<{
|
|
|
48
48
|
}, {
|
|
49
49
|
login_url: string;
|
|
50
50
|
method?: string | undefined;
|
|
51
|
-
body_format?: "
|
|
51
|
+
body_format?: "form" | "json" | undefined;
|
|
52
52
|
success_check?: {
|
|
53
53
|
cookie: string;
|
|
54
54
|
} | {
|
package/dist/auth/api-login.js
CHANGED
|
@@ -45,14 +45,18 @@ export class ApiLoginStrategy {
|
|
|
45
45
|
const opts = parseStrategyOptions(this.name, ApiLoginOptions, ctx.options);
|
|
46
46
|
const url = new URL(opts.login_url, ctx.baseURL);
|
|
47
47
|
const isJson = opts.body_format === "json";
|
|
48
|
+
// GET and HEAD cannot carry a body (fetch throws), so a link-style login sends none.
|
|
49
|
+
const hasBody = !["GET", "HEAD"].includes(opts.method.toUpperCase());
|
|
48
50
|
const body = isJson ? JSON.stringify(ctx.creds) : new URLSearchParams(ctx.creds).toString();
|
|
49
51
|
const result = await fetchCollectingCookies(url, {
|
|
50
52
|
method: opts.method,
|
|
51
53
|
headers: {
|
|
52
|
-
|
|
54
|
+
...(hasBody
|
|
55
|
+
? { "content-type": isJson ? "application/json" : "application/x-www-form-urlencoded" }
|
|
56
|
+
: {}),
|
|
53
57
|
accept: "application/json, text/html;q=0.9, */*;q=0.8",
|
|
54
58
|
},
|
|
55
|
-
body,
|
|
59
|
+
...(hasBody ? { body } : {}),
|
|
56
60
|
}, { fetchImpl: this.fetchImpl });
|
|
57
61
|
// Failure messages name the endpoint and the check — never the credential values.
|
|
58
62
|
const check = opts.success_check;
|
package/dist/auth/email-otp.d.ts
CHANGED
|
@@ -47,17 +47,17 @@ export declare const EmailOtpInboxOptions: z.ZodObject<{
|
|
|
47
47
|
/** How long to wait for the code mail. Default 30000. */
|
|
48
48
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
49
49
|
}, "strict", z.ZodTypeAny, {
|
|
50
|
-
options: Record<string, unknown>;
|
|
51
|
-
timeout_ms: number;
|
|
52
50
|
provider: string;
|
|
53
|
-
|
|
51
|
+
options: Record<string, unknown>;
|
|
54
52
|
to_env?: string | undefined;
|
|
53
|
+
code_pattern: string;
|
|
54
|
+
timeout_ms: number;
|
|
55
55
|
}, {
|
|
56
|
-
options?: Record<string, unknown> | undefined;
|
|
57
|
-
timeout_ms?: number | undefined;
|
|
58
56
|
provider?: string | undefined;
|
|
57
|
+
options?: Record<string, unknown> | undefined;
|
|
59
58
|
to_env?: string | undefined;
|
|
60
59
|
code_pattern?: string | undefined;
|
|
60
|
+
timeout_ms?: number | undefined;
|
|
61
61
|
}>;
|
|
62
62
|
export type EmailOtpInboxOptions = z.infer<typeof EmailOtpInboxOptions>;
|
|
63
63
|
export declare const EmailOtpOptions: z.ZodEffects<z.ZodObject<{
|
|
@@ -76,12 +76,12 @@ export declare const EmailOtpOptions: z.ZodEffects<z.ZodObject<{
|
|
|
76
76
|
selector: z.ZodString;
|
|
77
77
|
value_env: z.ZodOptional<z.ZodString>;
|
|
78
78
|
}, "strict", z.ZodTypeAny, {
|
|
79
|
+
action: "click" | "fill";
|
|
79
80
|
selector: string;
|
|
80
|
-
action: "fill" | "click";
|
|
81
81
|
value_env?: string | undefined;
|
|
82
82
|
}, {
|
|
83
|
+
action: "click" | "fill";
|
|
83
84
|
selector: string;
|
|
84
|
-
action: "fill" | "click";
|
|
85
85
|
value_env?: string | undefined;
|
|
86
86
|
}>, "many">>;
|
|
87
87
|
inbox: z.ZodObject<{
|
|
@@ -95,110 +95,110 @@ export declare const EmailOtpOptions: z.ZodEffects<z.ZodObject<{
|
|
|
95
95
|
/** How long to wait for the code mail. Default 30000. */
|
|
96
96
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
97
97
|
}, "strict", z.ZodTypeAny, {
|
|
98
|
-
options: Record<string, unknown>;
|
|
99
|
-
timeout_ms: number;
|
|
100
98
|
provider: string;
|
|
101
|
-
|
|
99
|
+
options: Record<string, unknown>;
|
|
102
100
|
to_env?: string | undefined;
|
|
101
|
+
code_pattern: string;
|
|
102
|
+
timeout_ms: number;
|
|
103
103
|
}, {
|
|
104
|
-
options?: Record<string, unknown> | undefined;
|
|
105
|
-
timeout_ms?: number | undefined;
|
|
106
104
|
provider?: string | undefined;
|
|
105
|
+
options?: Record<string, unknown> | undefined;
|
|
107
106
|
to_env?: string | undefined;
|
|
108
107
|
code_pattern?: string | undefined;
|
|
108
|
+
timeout_ms?: number | undefined;
|
|
109
109
|
}>;
|
|
110
110
|
}, "strict", z.ZodTypeAny, {
|
|
111
|
-
timeout_ms: number;
|
|
112
111
|
login_url: string;
|
|
113
|
-
ignore_https_errors: boolean;
|
|
114
|
-
otp_selector: string;
|
|
115
|
-
submit_selector: string;
|
|
116
112
|
username_selector: string;
|
|
117
113
|
password_selector: string;
|
|
114
|
+
submit_selector: string;
|
|
115
|
+
otp_selector: string;
|
|
116
|
+
otp_submit_selector?: string | undefined;
|
|
117
|
+
success_selector?: string | undefined;
|
|
118
|
+
url_matches?: string | undefined;
|
|
119
|
+
timeout_ms: number;
|
|
120
|
+
ignore_https_errors: boolean;
|
|
118
121
|
pre_steps: {
|
|
122
|
+
action: "click" | "fill";
|
|
119
123
|
selector: string;
|
|
120
|
-
action: "fill" | "click";
|
|
121
124
|
value_env?: string | undefined;
|
|
122
125
|
}[];
|
|
123
126
|
inbox: {
|
|
124
|
-
options: Record<string, unknown>;
|
|
125
|
-
timeout_ms: number;
|
|
126
127
|
provider: string;
|
|
127
|
-
|
|
128
|
+
options: Record<string, unknown>;
|
|
128
129
|
to_env?: string | undefined;
|
|
130
|
+
code_pattern: string;
|
|
131
|
+
timeout_ms: number;
|
|
129
132
|
};
|
|
130
|
-
url_matches?: string | undefined;
|
|
131
|
-
success_selector?: string | undefined;
|
|
132
|
-
otp_submit_selector?: string | undefined;
|
|
133
133
|
}, {
|
|
134
134
|
login_url: string;
|
|
135
|
-
otp_selector: string;
|
|
136
|
-
submit_selector: string;
|
|
137
135
|
username_selector: string;
|
|
138
136
|
password_selector: string;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
to_env?: string | undefined;
|
|
144
|
-
code_pattern?: string | undefined;
|
|
145
|
-
};
|
|
146
|
-
timeout_ms?: number | undefined;
|
|
137
|
+
submit_selector: string;
|
|
138
|
+
otp_selector: string;
|
|
139
|
+
otp_submit_selector?: string | undefined;
|
|
140
|
+
success_selector?: string | undefined;
|
|
147
141
|
url_matches?: string | undefined;
|
|
142
|
+
timeout_ms?: number | undefined;
|
|
148
143
|
ignore_https_errors?: boolean | undefined;
|
|
149
|
-
success_selector?: string | undefined;
|
|
150
144
|
pre_steps?: {
|
|
145
|
+
action: "click" | "fill";
|
|
151
146
|
selector: string;
|
|
152
|
-
action: "fill" | "click";
|
|
153
147
|
value_env?: string | undefined;
|
|
154
148
|
}[] | undefined;
|
|
155
|
-
|
|
149
|
+
inbox: {
|
|
150
|
+
provider?: string | undefined;
|
|
151
|
+
options?: Record<string, unknown> | undefined;
|
|
152
|
+
to_env?: string | undefined;
|
|
153
|
+
code_pattern?: string | undefined;
|
|
154
|
+
timeout_ms?: number | undefined;
|
|
155
|
+
};
|
|
156
156
|
}>, {
|
|
157
|
-
timeout_ms: number;
|
|
158
157
|
login_url: string;
|
|
159
|
-
ignore_https_errors: boolean;
|
|
160
|
-
otp_selector: string;
|
|
161
|
-
submit_selector: string;
|
|
162
158
|
username_selector: string;
|
|
163
159
|
password_selector: string;
|
|
160
|
+
submit_selector: string;
|
|
161
|
+
otp_selector: string;
|
|
162
|
+
otp_submit_selector?: string | undefined;
|
|
163
|
+
success_selector?: string | undefined;
|
|
164
|
+
url_matches?: string | undefined;
|
|
165
|
+
timeout_ms: number;
|
|
166
|
+
ignore_https_errors: boolean;
|
|
164
167
|
pre_steps: {
|
|
168
|
+
action: "click" | "fill";
|
|
165
169
|
selector: string;
|
|
166
|
-
action: "fill" | "click";
|
|
167
170
|
value_env?: string | undefined;
|
|
168
171
|
}[];
|
|
169
172
|
inbox: {
|
|
170
|
-
options: Record<string, unknown>;
|
|
171
|
-
timeout_ms: number;
|
|
172
173
|
provider: string;
|
|
173
|
-
|
|
174
|
+
options: Record<string, unknown>;
|
|
174
175
|
to_env?: string | undefined;
|
|
176
|
+
code_pattern: string;
|
|
177
|
+
timeout_ms: number;
|
|
175
178
|
};
|
|
176
|
-
url_matches?: string | undefined;
|
|
177
|
-
success_selector?: string | undefined;
|
|
178
|
-
otp_submit_selector?: string | undefined;
|
|
179
179
|
}, {
|
|
180
180
|
login_url: string;
|
|
181
|
-
otp_selector: string;
|
|
182
|
-
submit_selector: string;
|
|
183
181
|
username_selector: string;
|
|
184
182
|
password_selector: string;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
to_env?: string | undefined;
|
|
190
|
-
code_pattern?: string | undefined;
|
|
191
|
-
};
|
|
192
|
-
timeout_ms?: number | undefined;
|
|
183
|
+
submit_selector: string;
|
|
184
|
+
otp_selector: string;
|
|
185
|
+
otp_submit_selector?: string | undefined;
|
|
186
|
+
success_selector?: string | undefined;
|
|
193
187
|
url_matches?: string | undefined;
|
|
188
|
+
timeout_ms?: number | undefined;
|
|
194
189
|
ignore_https_errors?: boolean | undefined;
|
|
195
|
-
success_selector?: string | undefined;
|
|
196
190
|
pre_steps?: {
|
|
191
|
+
action: "click" | "fill";
|
|
197
192
|
selector: string;
|
|
198
|
-
action: "fill" | "click";
|
|
199
193
|
value_env?: string | undefined;
|
|
200
194
|
}[] | undefined;
|
|
201
|
-
|
|
195
|
+
inbox: {
|
|
196
|
+
provider?: string | undefined;
|
|
197
|
+
options?: Record<string, unknown> | undefined;
|
|
198
|
+
to_env?: string | undefined;
|
|
199
|
+
code_pattern?: string | undefined;
|
|
200
|
+
timeout_ms?: number | undefined;
|
|
201
|
+
};
|
|
202
202
|
}>;
|
|
203
203
|
export type EmailOtpOptions = z.infer<typeof EmailOtpOptions>;
|
|
204
204
|
export declare class EmailOtpStrategy implements AuthStrategy {
|
|
@@ -26,119 +26,119 @@ export declare const JwtInjectionOptions: z.ZodEffects<z.ZodObject<{
|
|
|
26
26
|
}, "strict", z.ZodTypeAny, {
|
|
27
27
|
name: string;
|
|
28
28
|
value_template: string;
|
|
29
|
-
path?: string | undefined;
|
|
30
29
|
domain?: string | undefined;
|
|
30
|
+
path?: string | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
name: string;
|
|
33
|
-
path?: string | undefined;
|
|
34
|
-
domain?: string | undefined;
|
|
35
33
|
value_template?: string | undefined;
|
|
34
|
+
domain?: string | undefined;
|
|
35
|
+
path?: string | undefined;
|
|
36
36
|
}>, "many">>;
|
|
37
37
|
}, "strict", z.ZodTypeAny, {
|
|
38
|
-
cookies?: {
|
|
39
|
-
name: string;
|
|
40
|
-
value_template: string;
|
|
41
|
-
path?: string | undefined;
|
|
42
|
-
domain?: string | undefined;
|
|
43
|
-
}[] | undefined;
|
|
44
38
|
localStorage?: {
|
|
45
39
|
key: string;
|
|
46
40
|
value_template: string;
|
|
47
41
|
}[] | undefined;
|
|
48
|
-
}, {
|
|
49
42
|
cookies?: {
|
|
50
43
|
name: string;
|
|
51
|
-
|
|
44
|
+
value_template: string;
|
|
52
45
|
domain?: string | undefined;
|
|
53
|
-
|
|
46
|
+
path?: string | undefined;
|
|
54
47
|
}[] | undefined;
|
|
48
|
+
}, {
|
|
55
49
|
localStorage?: {
|
|
56
50
|
key: string;
|
|
57
51
|
value_template?: string | undefined;
|
|
58
52
|
}[] | undefined;
|
|
59
|
-
}>, {
|
|
60
53
|
cookies?: {
|
|
61
54
|
name: string;
|
|
62
|
-
value_template
|
|
63
|
-
path?: string | undefined;
|
|
55
|
+
value_template?: string | undefined;
|
|
64
56
|
domain?: string | undefined;
|
|
57
|
+
path?: string | undefined;
|
|
65
58
|
}[] | undefined;
|
|
59
|
+
}>, {
|
|
66
60
|
localStorage?: {
|
|
67
61
|
key: string;
|
|
68
62
|
value_template: string;
|
|
69
63
|
}[] | undefined;
|
|
70
|
-
}, {
|
|
71
64
|
cookies?: {
|
|
72
65
|
name: string;
|
|
73
|
-
|
|
66
|
+
value_template: string;
|
|
74
67
|
domain?: string | undefined;
|
|
75
|
-
|
|
68
|
+
path?: string | undefined;
|
|
76
69
|
}[] | undefined;
|
|
70
|
+
}, {
|
|
77
71
|
localStorage?: {
|
|
78
72
|
key: string;
|
|
79
73
|
value_template?: string | undefined;
|
|
80
74
|
}[] | undefined;
|
|
81
|
-
}>;
|
|
82
|
-
}, "strict", z.ZodTypeAny, {
|
|
83
|
-
inject: {
|
|
84
75
|
cookies?: {
|
|
85
76
|
name: string;
|
|
86
|
-
value_template
|
|
87
|
-
path?: string | undefined;
|
|
77
|
+
value_template?: string | undefined;
|
|
88
78
|
domain?: string | undefined;
|
|
79
|
+
path?: string | undefined;
|
|
89
80
|
}[] | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
}, "strict", z.ZodTypeAny, {
|
|
83
|
+
token_env?: string | undefined;
|
|
84
|
+
token_url?: string | undefined;
|
|
85
|
+
inject: {
|
|
90
86
|
localStorage?: {
|
|
91
87
|
key: string;
|
|
92
88
|
value_template: string;
|
|
93
89
|
}[] | undefined;
|
|
94
|
-
};
|
|
95
|
-
token_env?: string | undefined;
|
|
96
|
-
token_url?: string | undefined;
|
|
97
|
-
}, {
|
|
98
|
-
inject: {
|
|
99
90
|
cookies?: {
|
|
100
91
|
name: string;
|
|
101
|
-
|
|
92
|
+
value_template: string;
|
|
102
93
|
domain?: string | undefined;
|
|
103
|
-
|
|
94
|
+
path?: string | undefined;
|
|
104
95
|
}[] | undefined;
|
|
96
|
+
};
|
|
97
|
+
}, {
|
|
98
|
+
token_env?: string | undefined;
|
|
99
|
+
token_url?: string | undefined;
|
|
100
|
+
inject: {
|
|
105
101
|
localStorage?: {
|
|
106
102
|
key: string;
|
|
107
103
|
value_template?: string | undefined;
|
|
108
104
|
}[] | undefined;
|
|
105
|
+
cookies?: {
|
|
106
|
+
name: string;
|
|
107
|
+
value_template?: string | undefined;
|
|
108
|
+
domain?: string | undefined;
|
|
109
|
+
path?: string | undefined;
|
|
110
|
+
}[] | undefined;
|
|
109
111
|
};
|
|
112
|
+
}>, {
|
|
110
113
|
token_env?: string | undefined;
|
|
111
114
|
token_url?: string | undefined;
|
|
112
|
-
}>, {
|
|
113
115
|
inject: {
|
|
116
|
+
localStorage?: {
|
|
117
|
+
key: string;
|
|
118
|
+
value_template: string;
|
|
119
|
+
}[] | undefined;
|
|
114
120
|
cookies?: {
|
|
115
121
|
name: string;
|
|
116
122
|
value_template: string;
|
|
117
|
-
path?: string | undefined;
|
|
118
123
|
domain?: string | undefined;
|
|
119
|
-
|
|
120
|
-
localStorage?: {
|
|
121
|
-
key: string;
|
|
122
|
-
value_template: string;
|
|
124
|
+
path?: string | undefined;
|
|
123
125
|
}[] | undefined;
|
|
124
126
|
};
|
|
127
|
+
}, {
|
|
125
128
|
token_env?: string | undefined;
|
|
126
129
|
token_url?: string | undefined;
|
|
127
|
-
}, {
|
|
128
130
|
inject: {
|
|
129
|
-
cookies?: {
|
|
130
|
-
name: string;
|
|
131
|
-
path?: string | undefined;
|
|
132
|
-
domain?: string | undefined;
|
|
133
|
-
value_template?: string | undefined;
|
|
134
|
-
}[] | undefined;
|
|
135
131
|
localStorage?: {
|
|
136
132
|
key: string;
|
|
137
133
|
value_template?: string | undefined;
|
|
138
134
|
}[] | undefined;
|
|
135
|
+
cookies?: {
|
|
136
|
+
name: string;
|
|
137
|
+
value_template?: string | undefined;
|
|
138
|
+
domain?: string | undefined;
|
|
139
|
+
path?: string | undefined;
|
|
140
|
+
}[] | undefined;
|
|
139
141
|
};
|
|
140
|
-
token_env?: string | undefined;
|
|
141
|
-
token_url?: string | undefined;
|
|
142
142
|
}>;
|
|
143
143
|
export type JwtInjectionOptions = z.infer<typeof JwtInjectionOptions>;
|
|
144
144
|
/** Decode a JWT's payload (base64url, **no signature verification**) — claims-reading only. */
|
|
@@ -6,11 +6,11 @@ export declare const PatHeaderOptions: z.ZodObject<{
|
|
|
6
6
|
/** `{{token}}` template for the header value. Default `Bearer {{token}}`. */
|
|
7
7
|
value_template: z.ZodDefault<z.ZodString>;
|
|
8
8
|
}, "strict", z.ZodTypeAny, {
|
|
9
|
-
value_template: string;
|
|
10
9
|
header: string;
|
|
10
|
+
value_template: string;
|
|
11
11
|
}, {
|
|
12
|
-
value_template?: string | undefined;
|
|
13
12
|
header?: string | undefined;
|
|
13
|
+
value_template?: string | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
export type PatHeaderOptions = z.infer<typeof PatHeaderOptions>;
|
|
16
16
|
export declare class PatHeaderStrategy implements AuthStrategy {
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -71,8 +71,8 @@ export declare class NotImplementedStrategyError extends Error {
|
|
|
71
71
|
constructor(name: string);
|
|
72
72
|
}
|
|
73
73
|
export declare class AuthStrategyConfigError extends Error {
|
|
74
|
-
readonly cause?: unknown
|
|
75
|
-
constructor(message: string, cause?: unknown
|
|
74
|
+
readonly cause?: unknown;
|
|
75
|
+
constructor(message: string, cause?: unknown);
|
|
76
76
|
}
|
|
77
77
|
/** Validate a strategy's `options` record against its schema; config errors name the offending key, never values. */
|
|
78
78
|
export declare function parseStrategyOptions<S extends z.ZodTypeAny>(strategy: string, schema: S, options: Record<string, unknown>): z.infer<S>;
|
package/dist/auth/ui-form.d.ts
CHANGED
|
@@ -8,12 +8,12 @@ export declare const PreStep: z.ZodObject<{
|
|
|
8
8
|
/** Env var *name* holding the fill value (required for `fill`). */
|
|
9
9
|
value_env: z.ZodOptional<z.ZodString>;
|
|
10
10
|
}, "strict", z.ZodTypeAny, {
|
|
11
|
+
action: "click" | "fill";
|
|
11
12
|
selector: string;
|
|
12
|
-
action: "fill" | "click";
|
|
13
13
|
value_env?: string | undefined;
|
|
14
14
|
}, {
|
|
15
|
+
action: "click" | "fill";
|
|
15
16
|
selector: string;
|
|
16
|
-
action: "fill" | "click";
|
|
17
17
|
value_env?: string | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export type PreStep = z.infer<typeof PreStep>;
|
|
@@ -32,19 +32,19 @@ export declare const UiFormTotpOptions: z.ZodObject<{
|
|
|
32
32
|
period: z.ZodDefault<z.ZodNumber>;
|
|
33
33
|
algorithm: z.ZodDefault<z.ZodEnum<["sha1", "sha256"]>>;
|
|
34
34
|
}, "strict", z.ZodTypeAny, {
|
|
35
|
-
digits: 8 | 6;
|
|
36
|
-
period: number;
|
|
37
|
-
algorithm: "sha1" | "sha256";
|
|
38
35
|
secret_env: string;
|
|
39
36
|
otp_selector: string;
|
|
40
37
|
submit_selector?: string | undefined;
|
|
38
|
+
digits: 6 | 8;
|
|
39
|
+
period: number;
|
|
40
|
+
algorithm: "sha1" | "sha256";
|
|
41
41
|
}, {
|
|
42
42
|
secret_env: string;
|
|
43
43
|
otp_selector: string;
|
|
44
|
-
|
|
44
|
+
submit_selector?: string | undefined;
|
|
45
|
+
digits?: 6 | 8 | undefined;
|
|
45
46
|
period?: number | undefined;
|
|
46
47
|
algorithm?: "sha1" | "sha256" | undefined;
|
|
47
|
-
submit_selector?: string | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type UiFormTotpOptions = z.infer<typeof UiFormTotpOptions>;
|
|
50
50
|
export declare const UiFormOptions: z.ZodEffects<z.ZodObject<{
|
|
@@ -67,12 +67,12 @@ export declare const UiFormOptions: z.ZodEffects<z.ZodObject<{
|
|
|
67
67
|
/** Env var *name* holding the fill value (required for `fill`). */
|
|
68
68
|
value_env: z.ZodOptional<z.ZodString>;
|
|
69
69
|
}, "strict", z.ZodTypeAny, {
|
|
70
|
+
action: "click" | "fill";
|
|
70
71
|
selector: string;
|
|
71
|
-
action: "fill" | "click";
|
|
72
72
|
value_env?: string | undefined;
|
|
73
73
|
}, {
|
|
74
|
+
action: "click" | "fill";
|
|
74
75
|
selector: string;
|
|
75
|
-
action: "fill" | "click";
|
|
76
76
|
value_env?: string | undefined;
|
|
77
77
|
}>, "many">>;
|
|
78
78
|
totp: z.ZodOptional<z.ZodObject<{
|
|
@@ -84,108 +84,108 @@ export declare const UiFormOptions: z.ZodEffects<z.ZodObject<{
|
|
|
84
84
|
period: z.ZodDefault<z.ZodNumber>;
|
|
85
85
|
algorithm: z.ZodDefault<z.ZodEnum<["sha1", "sha256"]>>;
|
|
86
86
|
}, "strict", z.ZodTypeAny, {
|
|
87
|
-
digits: 8 | 6;
|
|
88
|
-
period: number;
|
|
89
|
-
algorithm: "sha1" | "sha256";
|
|
90
87
|
secret_env: string;
|
|
91
88
|
otp_selector: string;
|
|
92
89
|
submit_selector?: string | undefined;
|
|
90
|
+
digits: 6 | 8;
|
|
91
|
+
period: number;
|
|
92
|
+
algorithm: "sha1" | "sha256";
|
|
93
93
|
}, {
|
|
94
94
|
secret_env: string;
|
|
95
95
|
otp_selector: string;
|
|
96
|
-
|
|
96
|
+
submit_selector?: string | undefined;
|
|
97
|
+
digits?: 6 | 8 | undefined;
|
|
97
98
|
period?: number | undefined;
|
|
98
99
|
algorithm?: "sha1" | "sha256" | undefined;
|
|
99
|
-
submit_selector?: string | undefined;
|
|
100
100
|
}>>;
|
|
101
101
|
}, "strict", z.ZodTypeAny, {
|
|
102
|
-
timeout_ms: number;
|
|
103
102
|
login_url: string;
|
|
104
|
-
ignore_https_errors: boolean;
|
|
105
|
-
submit_selector: string;
|
|
106
103
|
username_selector: string;
|
|
107
104
|
password_selector: string;
|
|
105
|
+
submit_selector: string;
|
|
106
|
+
success_selector?: string | undefined;
|
|
107
|
+
url_matches?: string | undefined;
|
|
108
|
+
timeout_ms: number;
|
|
109
|
+
ignore_https_errors: boolean;
|
|
108
110
|
pre_steps: {
|
|
111
|
+
action: "click" | "fill";
|
|
109
112
|
selector: string;
|
|
110
|
-
action: "fill" | "click";
|
|
111
113
|
value_env?: string | undefined;
|
|
112
114
|
}[];
|
|
113
|
-
url_matches?: string | undefined;
|
|
114
115
|
totp?: {
|
|
115
|
-
digits: 8 | 6;
|
|
116
|
-
period: number;
|
|
117
|
-
algorithm: "sha1" | "sha256";
|
|
118
116
|
secret_env: string;
|
|
119
117
|
otp_selector: string;
|
|
120
118
|
submit_selector?: string | undefined;
|
|
119
|
+
digits: 6 | 8;
|
|
120
|
+
period: number;
|
|
121
|
+
algorithm: "sha1" | "sha256";
|
|
121
122
|
} | undefined;
|
|
122
|
-
success_selector?: string | undefined;
|
|
123
123
|
}, {
|
|
124
124
|
login_url: string;
|
|
125
|
-
submit_selector: string;
|
|
126
125
|
username_selector: string;
|
|
127
126
|
password_selector: string;
|
|
128
|
-
|
|
127
|
+
submit_selector: string;
|
|
128
|
+
success_selector?: string | undefined;
|
|
129
129
|
url_matches?: string | undefined;
|
|
130
|
+
timeout_ms?: number | undefined;
|
|
131
|
+
ignore_https_errors?: boolean | undefined;
|
|
132
|
+
pre_steps?: {
|
|
133
|
+
action: "click" | "fill";
|
|
134
|
+
selector: string;
|
|
135
|
+
value_env?: string | undefined;
|
|
136
|
+
}[] | undefined;
|
|
130
137
|
totp?: {
|
|
131
138
|
secret_env: string;
|
|
132
139
|
otp_selector: string;
|
|
133
|
-
|
|
140
|
+
submit_selector?: string | undefined;
|
|
141
|
+
digits?: 6 | 8 | undefined;
|
|
134
142
|
period?: number | undefined;
|
|
135
143
|
algorithm?: "sha1" | "sha256" | undefined;
|
|
136
|
-
submit_selector?: string | undefined;
|
|
137
144
|
} | undefined;
|
|
138
|
-
ignore_https_errors?: boolean | undefined;
|
|
139
|
-
success_selector?: string | undefined;
|
|
140
|
-
pre_steps?: {
|
|
141
|
-
selector: string;
|
|
142
|
-
action: "fill" | "click";
|
|
143
|
-
value_env?: string | undefined;
|
|
144
|
-
}[] | undefined;
|
|
145
145
|
}>, {
|
|
146
|
-
timeout_ms: number;
|
|
147
146
|
login_url: string;
|
|
148
|
-
ignore_https_errors: boolean;
|
|
149
|
-
submit_selector: string;
|
|
150
147
|
username_selector: string;
|
|
151
148
|
password_selector: string;
|
|
149
|
+
submit_selector: string;
|
|
150
|
+
success_selector?: string | undefined;
|
|
151
|
+
url_matches?: string | undefined;
|
|
152
|
+
timeout_ms: number;
|
|
153
|
+
ignore_https_errors: boolean;
|
|
152
154
|
pre_steps: {
|
|
155
|
+
action: "click" | "fill";
|
|
153
156
|
selector: string;
|
|
154
|
-
action: "fill" | "click";
|
|
155
157
|
value_env?: string | undefined;
|
|
156
158
|
}[];
|
|
157
|
-
url_matches?: string | undefined;
|
|
158
159
|
totp?: {
|
|
159
|
-
digits: 8 | 6;
|
|
160
|
-
period: number;
|
|
161
|
-
algorithm: "sha1" | "sha256";
|
|
162
160
|
secret_env: string;
|
|
163
161
|
otp_selector: string;
|
|
164
162
|
submit_selector?: string | undefined;
|
|
163
|
+
digits: 6 | 8;
|
|
164
|
+
period: number;
|
|
165
|
+
algorithm: "sha1" | "sha256";
|
|
165
166
|
} | undefined;
|
|
166
|
-
success_selector?: string | undefined;
|
|
167
167
|
}, {
|
|
168
168
|
login_url: string;
|
|
169
|
-
submit_selector: string;
|
|
170
169
|
username_selector: string;
|
|
171
170
|
password_selector: string;
|
|
172
|
-
|
|
171
|
+
submit_selector: string;
|
|
172
|
+
success_selector?: string | undefined;
|
|
173
173
|
url_matches?: string | undefined;
|
|
174
|
+
timeout_ms?: number | undefined;
|
|
175
|
+
ignore_https_errors?: boolean | undefined;
|
|
176
|
+
pre_steps?: {
|
|
177
|
+
action: "click" | "fill";
|
|
178
|
+
selector: string;
|
|
179
|
+
value_env?: string | undefined;
|
|
180
|
+
}[] | undefined;
|
|
174
181
|
totp?: {
|
|
175
182
|
secret_env: string;
|
|
176
183
|
otp_selector: string;
|
|
177
|
-
|
|
184
|
+
submit_selector?: string | undefined;
|
|
185
|
+
digits?: 6 | 8 | undefined;
|
|
178
186
|
period?: number | undefined;
|
|
179
187
|
algorithm?: "sha1" | "sha256" | undefined;
|
|
180
|
-
submit_selector?: string | undefined;
|
|
181
188
|
} | undefined;
|
|
182
|
-
ignore_https_errors?: boolean | undefined;
|
|
183
|
-
success_selector?: string | undefined;
|
|
184
|
-
pre_steps?: {
|
|
185
|
-
selector: string;
|
|
186
|
-
action: "fill" | "click";
|
|
187
|
-
value_env?: string | undefined;
|
|
188
|
-
}[] | undefined;
|
|
189
189
|
}>;
|
|
190
190
|
export type UiFormOptions = z.infer<typeof UiFormOptions>;
|
|
191
191
|
export declare class UiFormStrategy implements AuthStrategy {
|