@enhance-eng/sdk 0.1.0-dev.sha-3f7dd0acb078
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 +111 -0
- package/dist/browser/kernel.iife.js +16737 -0
- package/dist/capture-client.client-BDphetFj.mjs +226 -0
- package/dist/capture-files.lib-BA_KBz9W.mjs +406 -0
- package/dist/capture-files.lib-CvX7Ca8M.d.mts +11 -0
- package/dist/environment.config-BgNT6S_H.mjs +14 -0
- package/dist/index-PIb9iIwo.d.mts +257 -0
- package/dist/index.d.mts +42 -0
- package/dist/index.mjs +3 -0
- package/dist/playwright/index.d.mts +20 -0
- package/dist/playwright/index.mjs +6507 -0
- package/dist/playwright/reporter.d.mts +19 -0
- package/dist/playwright/reporter.mjs +114 -0
- package/package.json +68 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region ../contract/src/capture/capture.schema.d.ts
|
|
3
|
+
declare const captureBlobSchema: z.ZodObject<{
|
|
4
|
+
sha256: z.ZodString;
|
|
5
|
+
bytes: z.ZodNumber;
|
|
6
|
+
mediaType: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
type CaptureBlob = z.infer<typeof captureBlobSchema>;
|
|
9
|
+
declare const captureArtifactSchema: z.ZodObject<{
|
|
10
|
+
format: z.ZodLiteral<"enhance-capture">;
|
|
11
|
+
version: z.ZodLiteral<1>;
|
|
12
|
+
key: z.ZodObject<{
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
journey: z.ZodString;
|
|
15
|
+
step: z.ZodString;
|
|
16
|
+
variant: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
label: z.ZodString;
|
|
19
|
+
journeyLabel: z.ZodString;
|
|
20
|
+
order: z.ZodNumber;
|
|
21
|
+
viewport: z.ZodObject<{
|
|
22
|
+
width: z.ZodNumber;
|
|
23
|
+
height: z.ZodNumber;
|
|
24
|
+
deviceScaleFactor: z.ZodNumber;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
extent: z.ZodEnum<{
|
|
27
|
+
viewport: "viewport";
|
|
28
|
+
"full-page": "full-page";
|
|
29
|
+
}>;
|
|
30
|
+
source: z.ZodObject<{
|
|
31
|
+
format: z.ZodLiteral<"rrweb-screen">;
|
|
32
|
+
version: z.ZodLiteral<1>;
|
|
33
|
+
blob: z.ZodObject<{
|
|
34
|
+
sha256: z.ZodString;
|
|
35
|
+
bytes: z.ZodNumber;
|
|
36
|
+
mediaType: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
preview: z.ZodObject<{
|
|
40
|
+
blob: z.ZodObject<{
|
|
41
|
+
sha256: z.ZodString;
|
|
42
|
+
bytes: z.ZodNumber;
|
|
43
|
+
mediaType: z.ZodString;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
width: z.ZodNumber;
|
|
46
|
+
height: z.ZodNumber;
|
|
47
|
+
pixelRatio: z.ZodNumber;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
50
|
+
url: z.ZodURL;
|
|
51
|
+
blob: z.ZodObject<{
|
|
52
|
+
sha256: z.ZodString;
|
|
53
|
+
bytes: z.ZodNumber;
|
|
54
|
+
mediaType: z.ZodString;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
provenance: z.ZodObject<{
|
|
58
|
+
adapter: z.ZodString;
|
|
59
|
+
sdkVersion: z.ZodString;
|
|
60
|
+
kernelVersion: z.ZodString;
|
|
61
|
+
browser: z.ZodString;
|
|
62
|
+
capturedAt: z.ZodISODateTime;
|
|
63
|
+
sourceUrl: z.ZodOptional<z.ZodURL>;
|
|
64
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
67
|
+
code: z.ZodString;
|
|
68
|
+
message: z.ZodString;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
type CaptureArtifact = z.infer<typeof captureArtifactSchema>;
|
|
72
|
+
declare const captureRunDescriptorSchema: z.ZodObject<{
|
|
73
|
+
id: z.ZodUUID;
|
|
74
|
+
canvasId: z.ZodUUID;
|
|
75
|
+
source: z.ZodString;
|
|
76
|
+
runKey: z.ZodString;
|
|
77
|
+
generation: z.ZodNumber;
|
|
78
|
+
participants: z.ZodArray<z.ZodString>;
|
|
79
|
+
expiresAt: z.ZodISODateTime;
|
|
80
|
+
formatVersion: z.ZodLiteral<1>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
type CaptureRunDescriptor = z.infer<typeof captureRunDescriptorSchema>;
|
|
83
|
+
declare const captureManifestSchema: z.ZodObject<{
|
|
84
|
+
format: z.ZodLiteral<"enhance-capture-run">;
|
|
85
|
+
version: z.ZodLiteral<1>;
|
|
86
|
+
run: z.ZodObject<{
|
|
87
|
+
id: z.ZodUUID;
|
|
88
|
+
canvasId: z.ZodUUID;
|
|
89
|
+
source: z.ZodString;
|
|
90
|
+
runKey: z.ZodString;
|
|
91
|
+
generation: z.ZodNumber;
|
|
92
|
+
participants: z.ZodArray<z.ZodString>;
|
|
93
|
+
expiresAt: z.ZodISODateTime;
|
|
94
|
+
formatVersion: z.ZodLiteral<1>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
participants: z.ZodArray<z.ZodObject<{
|
|
97
|
+
id: z.ZodString;
|
|
98
|
+
status: z.ZodEnum<{
|
|
99
|
+
passed: "passed";
|
|
100
|
+
failed: "failed";
|
|
101
|
+
interrupted: "interrupted";
|
|
102
|
+
}>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
attempts: z.ZodArray<z.ZodObject<{
|
|
105
|
+
participant: z.ZodString;
|
|
106
|
+
testId: z.ZodString;
|
|
107
|
+
project: z.ZodString;
|
|
108
|
+
retry: z.ZodNumber;
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
passed: "passed";
|
|
111
|
+
failed: "failed";
|
|
112
|
+
interrupted: "interrupted";
|
|
113
|
+
skipped: "skipped";
|
|
114
|
+
timedOut: "timedOut";
|
|
115
|
+
}>;
|
|
116
|
+
captures: z.ZodArray<z.ZodObject<{
|
|
117
|
+
format: z.ZodLiteral<"enhance-capture">;
|
|
118
|
+
version: z.ZodLiteral<1>;
|
|
119
|
+
key: z.ZodObject<{
|
|
120
|
+
source: z.ZodString;
|
|
121
|
+
journey: z.ZodString;
|
|
122
|
+
step: z.ZodString;
|
|
123
|
+
variant: z.ZodString;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
label: z.ZodString;
|
|
126
|
+
journeyLabel: z.ZodString;
|
|
127
|
+
order: z.ZodNumber;
|
|
128
|
+
viewport: z.ZodObject<{
|
|
129
|
+
width: z.ZodNumber;
|
|
130
|
+
height: z.ZodNumber;
|
|
131
|
+
deviceScaleFactor: z.ZodNumber;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
extent: z.ZodEnum<{
|
|
134
|
+
viewport: "viewport";
|
|
135
|
+
"full-page": "full-page";
|
|
136
|
+
}>;
|
|
137
|
+
source: z.ZodObject<{
|
|
138
|
+
format: z.ZodLiteral<"rrweb-screen">;
|
|
139
|
+
version: z.ZodLiteral<1>;
|
|
140
|
+
blob: z.ZodObject<{
|
|
141
|
+
sha256: z.ZodString;
|
|
142
|
+
bytes: z.ZodNumber;
|
|
143
|
+
mediaType: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
}, z.core.$strict>;
|
|
146
|
+
preview: z.ZodObject<{
|
|
147
|
+
blob: z.ZodObject<{
|
|
148
|
+
sha256: z.ZodString;
|
|
149
|
+
bytes: z.ZodNumber;
|
|
150
|
+
mediaType: z.ZodString;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
width: z.ZodNumber;
|
|
153
|
+
height: z.ZodNumber;
|
|
154
|
+
pixelRatio: z.ZodNumber;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
assets: z.ZodArray<z.ZodObject<{
|
|
157
|
+
url: z.ZodURL;
|
|
158
|
+
blob: z.ZodObject<{
|
|
159
|
+
sha256: z.ZodString;
|
|
160
|
+
bytes: z.ZodNumber;
|
|
161
|
+
mediaType: z.ZodString;
|
|
162
|
+
}, z.core.$strict>;
|
|
163
|
+
}, z.core.$strict>>;
|
|
164
|
+
provenance: z.ZodObject<{
|
|
165
|
+
adapter: z.ZodString;
|
|
166
|
+
sdkVersion: z.ZodString;
|
|
167
|
+
kernelVersion: z.ZodString;
|
|
168
|
+
browser: z.ZodString;
|
|
169
|
+
capturedAt: z.ZodISODateTime;
|
|
170
|
+
sourceUrl: z.ZodOptional<z.ZodURL>;
|
|
171
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
174
|
+
code: z.ZodString;
|
|
175
|
+
message: z.ZodString;
|
|
176
|
+
}, z.core.$strict>>;
|
|
177
|
+
}, z.core.$strict>>;
|
|
178
|
+
}, z.core.$strict>>;
|
|
179
|
+
ordering: z.ZodEnum<{
|
|
180
|
+
partial: "partial";
|
|
181
|
+
complete: "complete";
|
|
182
|
+
}>;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
type CaptureManifest = z.infer<typeof captureManifestSchema>;
|
|
185
|
+
declare const captureReceiptSchema: z.ZodObject<{
|
|
186
|
+
runId: z.ZodUUID;
|
|
187
|
+
canvasId: z.ZodUUID;
|
|
188
|
+
canvasUrl: z.ZodURL;
|
|
189
|
+
version: z.ZodNumber;
|
|
190
|
+
manifestDigest: z.ZodString;
|
|
191
|
+
frames: z.ZodArray<z.ZodObject<{
|
|
192
|
+
key: z.ZodObject<{
|
|
193
|
+
source: z.ZodString;
|
|
194
|
+
journey: z.ZodString;
|
|
195
|
+
step: z.ZodString;
|
|
196
|
+
variant: z.ZodString;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
frameId: z.ZodString;
|
|
199
|
+
captureId: z.ZodUUID;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
202
|
+
code: z.ZodString;
|
|
203
|
+
message: z.ZodString;
|
|
204
|
+
}, z.core.$strict>>;
|
|
205
|
+
}, z.core.$strict>;
|
|
206
|
+
type CaptureReceipt = z.infer<typeof captureReceiptSchema>;
|
|
207
|
+
declare const getCaptureRunOutputSchema: z.ZodObject<{
|
|
208
|
+
run: z.ZodObject<{
|
|
209
|
+
id: z.ZodUUID;
|
|
210
|
+
canvasId: z.ZodUUID;
|
|
211
|
+
source: z.ZodString;
|
|
212
|
+
runKey: z.ZodString;
|
|
213
|
+
generation: z.ZodNumber;
|
|
214
|
+
participants: z.ZodArray<z.ZodString>;
|
|
215
|
+
expiresAt: z.ZodISODateTime;
|
|
216
|
+
formatVersion: z.ZodLiteral<1>;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
state: z.ZodEnum<{
|
|
219
|
+
failed: "failed";
|
|
220
|
+
collecting: "collecting";
|
|
221
|
+
sealed: "sealed";
|
|
222
|
+
converting: "converting";
|
|
223
|
+
committed: "committed";
|
|
224
|
+
cancelled: "cancelled";
|
|
225
|
+
}>;
|
|
226
|
+
receipt: z.ZodNullable<z.ZodObject<{
|
|
227
|
+
runId: z.ZodUUID;
|
|
228
|
+
canvasId: z.ZodUUID;
|
|
229
|
+
canvasUrl: z.ZodURL;
|
|
230
|
+
version: z.ZodNumber;
|
|
231
|
+
manifestDigest: z.ZodString;
|
|
232
|
+
frames: z.ZodArray<z.ZodObject<{
|
|
233
|
+
key: z.ZodObject<{
|
|
234
|
+
source: z.ZodString;
|
|
235
|
+
journey: z.ZodString;
|
|
236
|
+
step: z.ZodString;
|
|
237
|
+
variant: z.ZodString;
|
|
238
|
+
}, z.core.$strict>;
|
|
239
|
+
frameId: z.ZodString;
|
|
240
|
+
captureId: z.ZodUUID;
|
|
241
|
+
}, z.core.$strict>>;
|
|
242
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
243
|
+
code: z.ZodString;
|
|
244
|
+
message: z.ZodString;
|
|
245
|
+
}, z.core.$strict>>;
|
|
246
|
+
}, z.core.$strict>>;
|
|
247
|
+
failure: z.ZodNullable<z.ZodObject<{
|
|
248
|
+
code: z.ZodString;
|
|
249
|
+
message: z.ZodString;
|
|
250
|
+
}, z.core.$strict>>;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region ../contract/src/capture/capture-manifest.lib.d.ts
|
|
254
|
+
/** All publishers select whole terminal attempts with the same completeness rules. */
|
|
255
|
+
declare const selectedCaptures: (input: CaptureManifest) => readonly CaptureArtifact[] | string;
|
|
256
|
+
//#endregion
|
|
257
|
+
export { CaptureReceipt as a, captureManifestSchema as c, CaptureManifest as i, getCaptureRunOutputSchema as l, CaptureArtifact as n, CaptureRunDescriptor as o, CaptureBlob as r, captureArtifactSchema as s, selectedCaptures as t };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { a as CaptureReceipt, c as captureManifestSchema, i as CaptureManifest, l as getCaptureRunOutputSchema, n as CaptureArtifact, o as CaptureRunDescriptor, s as captureArtifactSchema, t as selectedCaptures } from "./index-PIb9iIwo.mjs";
|
|
2
|
+
import { t as CapturePayload } from "./capture-files.lib-CvX7Ca8M.mjs";
|
|
3
|
+
//#region src/core/capture-error.error.d.ts
|
|
4
|
+
type CaptureErrorCode = 'configuration' | 'capture' | 'artifact' | 'authorization' | 'conversion' | 'conflict' | 'transport';
|
|
5
|
+
interface CaptureError extends Error {
|
|
6
|
+
readonly code: CaptureErrorCode;
|
|
7
|
+
readonly runId?: string;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/node/capture-transport.client.d.ts
|
|
11
|
+
interface CaptureClientOptions {
|
|
12
|
+
readonly apiUrl: string;
|
|
13
|
+
readonly token: string;
|
|
14
|
+
readonly timeoutMs?: number;
|
|
15
|
+
readonly publicationTimeoutMs?: number;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/node/capture-client.client.d.ts
|
|
19
|
+
interface BeginCaptureRun {
|
|
20
|
+
readonly canvas: string;
|
|
21
|
+
readonly source?: string;
|
|
22
|
+
readonly runKey: string;
|
|
23
|
+
readonly participants?: readonly string[];
|
|
24
|
+
readonly directory?: string;
|
|
25
|
+
}
|
|
26
|
+
interface CaptureRun {
|
|
27
|
+
readonly descriptor: CaptureRunDescriptor;
|
|
28
|
+
readonly directory: string;
|
|
29
|
+
readonly add: (payload: CapturePayload) => Promise<void>;
|
|
30
|
+
readonly publish: () => Promise<CaptureReceipt>;
|
|
31
|
+
readonly cancel: () => Promise<CaptureReceipt | null>;
|
|
32
|
+
}
|
|
33
|
+
interface EnhanceClient {
|
|
34
|
+
readonly captures: {
|
|
35
|
+
readonly begin: (input: BeginCaptureRun) => Promise<CaptureRun>;
|
|
36
|
+
readonly publishManifest: (path: string) => Promise<CaptureReceipt>;
|
|
37
|
+
readonly get: (runId: string) => Promise<ReturnType<typeof getCaptureRunOutputSchema.parse>>;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
declare const createEnhance: (options: CaptureClientOptions) => EnhanceClient;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { type BeginCaptureRun, type CaptureArtifact, type CaptureClientOptions, type CaptureError, type CaptureErrorCode, type CaptureManifest, type CapturePayload, type CaptureReceipt, type CaptureRun, type CaptureRunDescriptor, type EnhanceClient, captureArtifactSchema, captureManifestSchema, createEnhance, selectedCaptures };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { m as captureManifestSchema, p as captureArtifactSchema, u as selectedCaptures } from "./capture-files.lib-BA_KBz9W.mjs";
|
|
2
|
+
import { t as createEnhance } from "./capture-client.client-BDphetFj.mjs";
|
|
3
|
+
export { captureArtifactSchema, captureManifestSchema, createEnhance, selectedCaptures };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "../capture-files.lib-CvX7Ca8M.mjs";
|
|
2
|
+
import { Page } from "@playwright/test";
|
|
3
|
+
//#region src/playwright/capture-page.lib.d.ts
|
|
4
|
+
interface CaptureStepOptions {
|
|
5
|
+
readonly journey: string;
|
|
6
|
+
readonly step: string;
|
|
7
|
+
readonly order?: number;
|
|
8
|
+
readonly variant?: string;
|
|
9
|
+
readonly label?: string;
|
|
10
|
+
readonly journeyLabel?: string;
|
|
11
|
+
readonly extent?: 'viewport' | 'full-page';
|
|
12
|
+
readonly blockSelector?: string;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/playwright/capture-step.lib.d.ts
|
|
16
|
+
declare const enhance: {
|
|
17
|
+
capture: (page: Page, options: CaptureStepOptions) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type CaptureStepOptions, enhance };
|