@checkly/playwright-reporter 0.1.5 → 0.1.6

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 CHANGED
@@ -109,6 +109,7 @@ You can also pass options directly in `playwright.config.ts`:
109
109
  apiKey: process.env.CHECKLY_API_KEY, // Not recommended, use env vars
110
110
  accountId: process.env.CHECKLY_ACCOUNT_ID, // Not recommended, use env vars
111
111
  dryRun: false, // Skip API calls, only create local ZIP
112
+ sessionName: 'My E2E Tests', // Custom session name
112
113
  outputPath: 'checkly-report.zip', // Custom ZIP output path
113
114
  jsonReportPath: 'test-results/report.json', // Custom JSON report path
114
115
  testResultsDir: 'test-results' // Custom test results directory
@@ -117,6 +118,7 @@ You can also pass options directly in `playwright.config.ts`:
117
118
 
118
119
  | Option | Type | Default | Description |
119
120
  |--------|------|---------|-------------|
121
+ | `sessionName` | `string \| function` | `'Playwright Test Session: {dir}'` | Custom name for the test session |
120
122
  | `dryRun` | `boolean` | `false` | Skip all API calls and only create local ZIP file |
121
123
  | `apiKey` | `string` | - | Checkly API key (use env var instead) |
122
124
  | `accountId` | `string` | - | Checkly account ID (use env var instead) |
@@ -126,17 +128,50 @@ You can also pass options directly in `playwright.config.ts`:
126
128
 
127
129
  > **Security Note**: Always use environment variables for credentials. Never commit API keys to version control.
128
130
 
131
+ ### Custom Session Names
132
+
133
+ By default, sessions are named after your project directory (e.g., `Playwright Test Session: my-app`). You can customize this with the `sessionName` option.
134
+
135
+ **Static string:**
136
+
137
+ ```typescript
138
+ ['@checkly/playwright-reporter', {
139
+ sessionName: 'E2E Tests - Production'
140
+ }]
141
+ ```
142
+
143
+ **Dynamic with callback:**
144
+
145
+ ```typescript
146
+ ['@checkly/playwright-reporter', {
147
+ sessionName: ({ directoryName, config, suite }) => {
148
+ const projectCount = config.projects.length
149
+ return `E2E: ${directoryName} (${projectCount} projects)`
150
+ }
151
+ }]
152
+ ```
153
+
154
+ The callback receives a context object with:
155
+
156
+ | Property | Type | Description |
157
+ |----------|------|-------------|
158
+ | `directoryName` | `string` | The directory name where tests are running |
159
+ | `config` | `FullConfig` | Playwright's full configuration object |
160
+ | `suite` | `Suite` | The root test suite containing all tests |
161
+
129
162
  ## How It Works
130
163
 
131
164
  ### Suite-Level Test Sessions
132
165
 
133
- This reporter creates **one test session per test run**, not per individual test. The session is named after your project directory:
166
+ This reporter creates **one test session per test run**, not per individual test. By default, sessions are named after your project directory:
134
167
 
135
168
  ```
136
169
  Directory: /Users/john/my-app
137
170
  Session: Playwright Test Session: my-app
138
171
  ```
139
172
 
173
+ You can customize the session name using the [`sessionName` option](#custom-session-names).
174
+
140
175
  All test results, screenshots, videos, and traces are bundled together in a single session for easy analysis.
141
176
 
142
177
  ### Flaky Test Detection
@@ -0,0 +1,295 @@
1
+ import { FullConfig, Suite, JSONReport, Reporter, TestCase, TestResult, TestError } from '@playwright/test/reporter';
2
+
3
+ /**
4
+ * Checkly environment for API endpoints
5
+ */
6
+ type ChecklyEnvironment = 'local' | 'development' | 'staging' | 'production';
7
+ /**
8
+ * Context passed to sessionName callback function
9
+ */
10
+ interface SessionNameContext {
11
+ /**
12
+ * The directory name where tests are running
13
+ */
14
+ directoryName: string;
15
+ /**
16
+ * Playwright's full configuration object
17
+ */
18
+ config: FullConfig;
19
+ /**
20
+ * The root test suite containing all tests
21
+ */
22
+ suite: Suite;
23
+ }
24
+ /**
25
+ * Session name can be a static string or a function that returns a string
26
+ */
27
+ type SessionNameOption = string | ((context: SessionNameContext) => string);
28
+ /**
29
+ * Configuration options for ChecklyReporter
30
+ */
31
+ interface ChecklyReporterOptions {
32
+ /**
33
+ * Checkly account ID for uploading test results
34
+ * Required for Phase 2 (upload functionality)
35
+ */
36
+ accountId?: string;
37
+ /**
38
+ * Checkly API key for authentication
39
+ * Required for Phase 2 (upload functionality)
40
+ */
41
+ apiKey?: string;
42
+ /**
43
+ * Checkly environment to use
44
+ * Can also be set via CHECKLY_ENV environment variable
45
+ * @default 'production'
46
+ */
47
+ environment?: ChecklyEnvironment;
48
+ /**
49
+ * Output path for the generated ZIP file (for testing/debugging)
50
+ * @default 'checkly-report.zip'
51
+ * @internal
52
+ */
53
+ outputPath?: string;
54
+ /**
55
+ * Path to the JSON report file generated by Playwright's json reporter
56
+ * @default 'test-results/playwright-test-report.json'
57
+ * @internal
58
+ */
59
+ jsonReportPath?: string;
60
+ /**
61
+ * Directory containing test results and assets
62
+ * @default 'test-results'
63
+ * @internal
64
+ */
65
+ testResultsDir?: string;
66
+ /**
67
+ * Dry run mode - skips API calls and only creates local ZIP file
68
+ * @default false
69
+ */
70
+ dryRun?: boolean;
71
+ /**
72
+ * Custom name for the test session
73
+ * Can be a string or a callback function for dynamic names
74
+ * @default 'Playwright Test Session: {directoryName}'
75
+ * @example
76
+ * // Static string
77
+ * sessionName: 'My E2E Tests'
78
+ *
79
+ * // Dynamic with callback
80
+ * sessionName: ({ directoryName, config }) => `E2E: ${directoryName} (${config.projects.length} projects)`
81
+ */
82
+ sessionName?: SessionNameOption;
83
+ }
84
+ /**
85
+ * Represents a test asset file to be included in the ZIP
86
+ */
87
+ interface Asset {
88
+ /**
89
+ * Absolute path to the asset file on disk
90
+ */
91
+ sourcePath: string;
92
+ /**
93
+ * Relative path within the ZIP archive
94
+ */
95
+ archivePath: string;
96
+ /**
97
+ * Type of asset
98
+ */
99
+ type: 'screenshot' | 'video' | 'trace' | 'attachment' | 'other';
100
+ /**
101
+ * Content type / MIME type
102
+ */
103
+ contentType: string;
104
+ }
105
+ /**
106
+ * Options for creating a ZIP archive
107
+ */
108
+ interface ZipperOptions {
109
+ /**
110
+ * Output path for the ZIP file
111
+ */
112
+ outputPath: string;
113
+ }
114
+ /**
115
+ * Result of ZIP creation
116
+ */
117
+ interface ZipResult {
118
+ /**
119
+ * Path to the created ZIP file
120
+ */
121
+ zipPath: string;
122
+ /**
123
+ * Total size of ZIP file in bytes
124
+ */
125
+ size: number;
126
+ /**
127
+ * Number of entries in ZIP
128
+ */
129
+ entryCount: number;
130
+ /**
131
+ * Metadata about ZIP entries (for range-based access)
132
+ */
133
+ entries: ZipEntry[];
134
+ }
135
+ /**
136
+ * Metadata about a single entry in the ZIP archive
137
+ */
138
+ interface ZipEntry {
139
+ /**
140
+ * Entry name (path within ZIP)
141
+ */
142
+ name: string;
143
+ /**
144
+ * Starting byte offset in ZIP file
145
+ */
146
+ start: number;
147
+ /**
148
+ * Ending byte offset in ZIP file
149
+ */
150
+ end: number;
151
+ }
152
+
153
+ /**
154
+ * Collects test assets from a directory for inclusion in ZIP archive
155
+ */
156
+ declare class AssetCollector {
157
+ private testResultsDir;
158
+ constructor(testResultsDir: string);
159
+ /**
160
+ * Collects assets from test results directory
161
+ * Simply iterates through the test-results folder and collects all assets
162
+ * @param _report Optional Playwright JSONReport (not used, kept for compatibility)
163
+ * @returns Array of Asset objects with source and archive paths
164
+ */
165
+ collectAssets(_report?: JSONReport): Promise<Asset[]>;
166
+ /**
167
+ * Recursively traverses directories to collect assets
168
+ */
169
+ private collectAssetsRecursive;
170
+ /**
171
+ * Determines if a file should be skipped
172
+ */
173
+ private shouldSkipFile;
174
+ /**
175
+ * Creates an Asset object from file path
176
+ */
177
+ private createAsset;
178
+ /**
179
+ * Determines asset type and content type from file extension
180
+ */
181
+ private determineAssetType;
182
+ /**
183
+ * Gets content type for image files
184
+ */
185
+ private getImageContentType;
186
+ /**
187
+ * Gets content type for video files
188
+ */
189
+ private getVideoContentType;
190
+ }
191
+
192
+ /**
193
+ * Checkly Playwright Reporter
194
+ *
195
+ * Creates a ZIP archive containing the JSON report and all test assets.
196
+ * Designed to work alongside Playwright's built-in JSONReporter.
197
+ *
198
+ * @example
199
+ * // playwright.config.ts
200
+ * export default defineConfig({
201
+ * reporter: [
202
+ * ['json', { outputFile: 'test-results/playwright-test-report.json' }],
203
+ * ['@checkly/playwright-reporter', {
204
+ * apiKey: process.env.CHECKLY_API_KEY,
205
+ * accountId: process.env.CHECKLY_ACCOUNT_ID,
206
+ * }]
207
+ * ]
208
+ * });
209
+ */
210
+ declare class ChecklyReporter implements Reporter {
211
+ private options;
212
+ private assetCollector;
213
+ private zipper;
214
+ private testResults?;
215
+ private testSession?;
216
+ private startTime?;
217
+ private testCounts;
218
+ constructor(options?: ChecklyReporterOptions);
219
+ /**
220
+ * Resolves the session name from options
221
+ * Supports string, callback function, or falls back to default
222
+ */
223
+ private resolveSessionName;
224
+ /**
225
+ * Called once before running tests
226
+ * Creates test session in Checkly if credentials provided
227
+ */
228
+ onBegin(config: FullConfig, suite: Suite): void;
229
+ /**
230
+ * Called for each test when it completes
231
+ * Track test results for final status calculation
232
+ */
233
+ onTestEnd(test: TestCase, result: TestResult): void;
234
+ /**
235
+ * Called after all tests have completed
236
+ * This is where we create the ZIP archive and upload results
237
+ */
238
+ onEnd(): Promise<void>;
239
+ private printSummary;
240
+ /**
241
+ * Uploads test results to Checkly API
242
+ */
243
+ private uploadResults;
244
+ /**
245
+ * Called when a global error occurs
246
+ */
247
+ onError(error: TestError): void;
248
+ }
249
+
250
+ /**
251
+ * Creates ZIP archives containing test reports and assets
252
+ * Uses Checkly's fork of node-archiver with byte offset tracking
253
+ */
254
+ declare class Zipper {
255
+ private outputPath;
256
+ constructor(options: ZipperOptions);
257
+ /**
258
+ * Creates a ZIP archive containing the JSON report and assets
259
+ * @param reportPath - Path to the JSON report file
260
+ * @param assets - Array of assets to include in the ZIP
261
+ * @returns ZIP creation result with metadata
262
+ */
263
+ createZip(reportPath: string, assets: Asset[]): Promise<ZipResult>;
264
+ /**
265
+ * Transforms the JSON report to use relative paths for attachments
266
+ * This ensures the UI can map attachment paths to ZIP entries
267
+ * @param reportPath - Path to the original JSON report
268
+ * @returns Path to the transformed JSON report (in temp directory)
269
+ */
270
+ private transformJsonReport;
271
+ /**
272
+ * Recursively transforms attachment paths in the report structure
273
+ * Converts absolute paths to relative paths matching ZIP structure
274
+ * @param obj - Object to transform (mutated in place)
275
+ */
276
+ private transformAttachmentPaths;
277
+ /**
278
+ * Normalizes attachment paths by extracting the relevant snapshot directory portion.
279
+ * Supports Playwright's default and common custom snapshot directory patterns.
280
+ *
281
+ * Priority order (first match wins):
282
+ * 1. test-results/ (highest priority, existing behavior)
283
+ * 2. *-snapshots/ (Playwright default pattern)
284
+ * 3. __screenshots__/ (common custom pattern)
285
+ * 4. __snapshots__/ (common custom pattern)
286
+ * 5. screenshots/ (simple custom pattern)
287
+ * 6. snapshots/ (simple custom pattern)
288
+ *
289
+ * @param attachmentPath - Absolute or relative path to attachment
290
+ * @returns Normalized path starting from the matched directory, or original path if no match
291
+ */
292
+ private normalizeAttachmentPath;
293
+ }
294
+
295
+ export { type Asset, AssetCollector, ChecklyReporter, type ChecklyReporterOptions, type ZipEntry, type ZipResult, Zipper, type ZipperOptions, ChecklyReporter as default };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function a6_0x9da0(_0x181701,_0x24254e){_0x181701=_0x181701-0x1c0;var _0x1016ec=a6_0x1016();var _0x9da0d7=_0x1016ec[_0x181701];return _0x9da0d7;}(function(_0x5bc3a0,_0x6585ad){var _0x427d94=a6_0x9da0,_0x196632=_0x5bc3a0();while(!![]){try{var _0x1863df=parseInt(_0x427d94(0x1c7))/0x1*(parseInt(_0x427d94(0x1c9))/0x2)+-parseInt(_0x427d94(0x1c0))/0x3*(parseInt(_0x427d94(0x1c4))/0x4)+parseInt(_0x427d94(0x1c1))/0x5*(-parseInt(_0x427d94(0x1c5))/0x6)+-parseInt(_0x427d94(0x1c8))/0x7+-parseInt(_0x427d94(0x1c3))/0x8+parseInt(_0x427d94(0x1c6))/0x9+parseInt(_0x427d94(0x1c2))/0xa;if(_0x1863df===_0x6585ad)break;else _0x196632['push'](_0x196632['shift']());}catch(_0x6a0cb4){_0x196632['push'](_0x196632['shift']());}}}(a6_0x1016,0x2c5fc));function a6_0x1016(){var _0x3baf3f=['27114qglyOx','814041updBIT','19542XDbSZA','1359253GFKSKw','16UXhciG','293790bpXJMH','270htEmFX','5993960opQwGf','242880kIhRkx','8jGckKj'];a6_0x1016=function(){return _0x3baf3f;};return a6_0x1016();}export{ChecklyReporter}from'./reporter.js';export{AssetCollector}from'./asset-collector.js';export{Zipper}from'./zipper.js';export{ChecklyReporter as default}from'./reporter.js';
1
+ const a0_0x25037f=a0_0x4c90;(function(_0x1a495a,_0x3d6c57){const _0x2386d6=a0_0x4c90,_0x13aa0a=_0x1a495a();while(!![]){try{const _0x74df10=-parseInt(_0x2386d6(0x14b))/0x1+parseInt(_0x2386d6(0xde))/0x2*(parseInt(_0x2386d6(0xe9))/0x3)+parseInt(_0x2386d6(0x140))/0x4*(parseInt(_0x2386d6(0xe1))/0x5)+parseInt(_0x2386d6(0x1a0))/0x6+-parseInt(_0x2386d6(0x153))/0x7*(-parseInt(_0x2386d6(0x181))/0x8)+-parseInt(_0x2386d6(0x14f))/0x9*(parseInt(_0x2386d6(0x199))/0xa)+-parseInt(_0x2386d6(0x13b))/0xb;if(_0x74df10===_0x3d6c57)break;else _0x13aa0a['push'](_0x13aa0a['shift']());}catch(_0x3ed807){_0x13aa0a['push'](_0x13aa0a['shift']());}}}(a0_0x1d61,0xa49be));import*as a0_0x5d4dd3 from'fs';import*as a0_0x38b769 from'path';var AssetCollector=class{constructor(_0x292948){const _0x2afc61=a0_0x4c90;this[_0x2afc61(0x1a3)]=_0x292948;}async[a0_0x25037f(0x168)](_0x32fe3a){const _0x9ffa2a=a0_0x25037f,_0x23a039=[],_0x50fd5d=new Set();if(!a0_0x5d4dd3[_0x9ffa2a(0xd6)](this[_0x9ffa2a(0x1a3)]))return _0x23a039;return await this[_0x9ffa2a(0xe7)](this[_0x9ffa2a(0x1a3)],'',_0x23a039,_0x50fd5d),_0x23a039;}async[a0_0x25037f(0xe7)](_0x3d16bf,_0x36fad9,_0x55634a,_0x37aaa0){const _0x1d8660=a0_0x25037f;let _0x22e56b;try{_0x22e56b=a0_0x5d4dd3[_0x1d8660(0xe5)](_0x3d16bf,{'withFileTypes':!![]});}catch{return;}const _0x5003e3=a0_0x38b769[_0x1d8660(0x105)](a0_0x38b769[_0x1d8660(0x137)](this[_0x1d8660(0x1a3)]));for(const _0x3a7fdb of _0x22e56b){const _0x1bd2f9=a0_0x38b769[_0x1d8660(0x176)](_0x3d16bf,_0x3a7fdb[_0x1d8660(0x169)]),_0x552375=a0_0x38b769['relative'](this['testResultsDir'],_0x1bd2f9),_0x1a91de=a0_0x38b769['join'](_0x5003e3,_0x552375);if(this['shouldSkipFile'](_0x3a7fdb[_0x1d8660(0x169)]))continue;if(_0x3a7fdb[_0x1d8660(0x106)]())await this[_0x1d8660(0xe7)](_0x1bd2f9,_0x1a91de,_0x55634a,_0x37aaa0);else{if(_0x3a7fdb[_0x1d8660(0x100)]()){if(!_0x37aaa0['has'](_0x1bd2f9)){const _0xb42ac2=this['createAsset'](_0x1bd2f9,_0x1a91de);_0x55634a['push'](_0xb42ac2),_0x37aaa0[_0x1d8660(0x179)](_0x1bd2f9);}}}}}[a0_0x25037f(0x175)](_0x4998f4){const _0x3c623f=a0_0x25037f,_0x537d09=[/^\./,/\.tmp$/i,/~$/,/\.swp$/i,/\.lock$/i,/^playwright-test-report\.json$/i];return _0x537d09[_0x3c623f(0x16a)](_0x226119=>_0x226119[_0x3c623f(0x180)](_0x4998f4));}[a0_0x25037f(0xda)](_0x5c70cb,_0x202990){const _0x469b33=a0_0x25037f,_0x8330cb=a0_0x38b769[_0x469b33(0x1a5)](_0x5c70cb)['toLowerCase'](),{type:_0x4005e3,contentType:_0x2701dc}=this[_0x469b33(0xe0)](_0x8330cb),_0x4a4a7c=_0x202990[_0x469b33(0x110)](a0_0x38b769['sep'])[_0x469b33(0x176)]('/');return{'sourcePath':_0x5c70cb,'archivePath':_0x4a4a7c,'type':_0x4005e3,'contentType':_0x2701dc};}['determineAssetType'](_0x5ac8ba){const _0x24d50a=a0_0x25037f;if([_0x24d50a(0xf3),_0x24d50a(0x184),_0x24d50a(0xdf),_0x24d50a(0x19e),_0x24d50a(0xf5),_0x24d50a(0x11f)][_0x24d50a(0x146)](_0x5ac8ba))return{'type':_0x24d50a(0x109),'contentType':this[_0x24d50a(0x192)](_0x5ac8ba)};if([_0x24d50a(0xd7),'.mp4',_0x24d50a(0x139),_0x24d50a(0x11a)]['includes'](_0x5ac8ba))return{'type':_0x24d50a(0xd8),'contentType':this[_0x24d50a(0xf2)](_0x5ac8ba)};if(_0x5ac8ba===_0x24d50a(0x163))return{'type':_0x24d50a(0x13a),'contentType':_0x24d50a(0x16d)};if(_0x5ac8ba===_0x24d50a(0x134)||_0x5ac8ba===_0x24d50a(0x171))return{'type':'attachment','contentType':_0x24d50a(0x10b)};if(_0x5ac8ba===_0x24d50a(0x1b0))return{'type':_0x24d50a(0x158),'contentType':_0x24d50a(0x147)};if(_0x5ac8ba==='.txt'||_0x5ac8ba==='.log')return{'type':_0x24d50a(0x158),'contentType':_0x24d50a(0x10e)};return{'type':_0x24d50a(0x107),'contentType':_0x24d50a(0x193)};}[a0_0x25037f(0x192)](_0x1fe7c4){const _0x2acb95=a0_0x25037f,_0x2cc499={'.png':_0x2acb95(0xeb),'.jpg':_0x2acb95(0x13e),'.jpeg':'image/jpeg','.gif':_0x2acb95(0x19f),'.bmp':_0x2acb95(0x130),'.svg':_0x2acb95(0x122)};return _0x2cc499[_0x1fe7c4]||_0x2acb95(0xeb);}[a0_0x25037f(0xf2)](_0x9228bc){const _0x3030d2=a0_0x25037f,_0x522f11={'.webm':_0x3030d2(0x12e),'.mp4':'video/mp4','.avi':_0x3030d2(0x1ae),'.mov':_0x3030d2(0xd9)};return _0x522f11[_0x9228bc]||'video/webm';}};import*as a0_0x24212e from'fs';import{readFileSync as a0_0x546335}from'fs';import*as a0_0x3d351b from'path';import{dirname,join as a0_0x55d174}from'path';import{fileURLToPath}from'url';import a0_0x5c40a8 from'axios';var ApiError=class extends Error{[a0_0x25037f(0x18b)];constructor(_0x3050a7,_0x4c4d49){const _0xfd22f=a0_0x25037f;super(_0x3050a7[_0xfd22f(0x161)],_0x4c4d49),this[_0xfd22f(0x169)]=this[_0xfd22f(0x183)][_0xfd22f(0x169)],this['data']=_0x3050a7;}},ValidationError=class extends ApiError{constructor(_0x168fb8,_0x5e5449){super(_0x168fb8,_0x5e5449);}},UnauthorizedError=class extends ApiError{constructor(_0x1d3246,_0xeefdf1){super(_0x1d3246,_0xeefdf1);}},ForbiddenError=class extends ApiError{constructor(_0x105db4,_0x1be9ec){super(_0x105db4,_0x1be9ec);}},NotFoundError=class extends ApiError{constructor(_0x50a175,_0x45c56e){super(_0x50a175,_0x45c56e);}},RequestTimeoutError=class extends ApiError{constructor(_0x10a4b0,_0x387bd8){super(_0x10a4b0,_0x387bd8);}},ConflictError=class extends ApiError{constructor(_0x44eda5,_0xa8f484){super(_0x44eda5,_0xa8f484);}},ServerError=class extends ApiError{constructor(_0x3db616,_0x50c0e8){super(_0x3db616,_0x50c0e8);}},MiscellaneousError=class extends ApiError{constructor(_0x24ea9f,_0x1eca40){super(_0x24ea9f,_0x1eca40);}},MissingResponseError=class extends Error{constructor(_0x2d6c8d,_0x89b2d3){const _0x130ed4=a0_0x25037f;super(_0x2d6c8d,_0x89b2d3),this[_0x130ed4(0x169)]=_0x130ed4(0x101);}};function parseErrorData(_0x5c4f30,_0x5773ba){const _0x5d1657=a0_0x25037f;if(!_0x5c4f30)return void 0x0;if(typeof _0x5c4f30==='object'&&_0x5c4f30[_0x5d1657(0x1b6)]&&_0x5c4f30[_0x5d1657(0x1a4)]&&_0x5c4f30[_0x5d1657(0x161)])return{'statusCode':_0x5c4f30['statusCode'],'error':_0x5c4f30[_0x5d1657(0x1a4)],'message':_0x5c4f30['message'],'errorCode':_0x5c4f30[_0x5d1657(0x165)]};if(typeof _0x5c4f30==='object'&&_0x5c4f30[_0x5d1657(0x1a4)]&&!_0x5c4f30['message'])return{'statusCode':_0x5773ba['statusCode'],'error':_0x5c4f30['error'],'message':_0x5c4f30['error']};if(typeof _0x5c4f30===_0x5d1657(0x166)&&_0x5c4f30[_0x5d1657(0x1a4)]&&_0x5c4f30['message'])return{'statusCode':_0x5773ba[_0x5d1657(0x1b6)],'error':_0x5c4f30[_0x5d1657(0x1a4)],'message':_0x5c4f30[_0x5d1657(0x161)],'errorCode':_0x5c4f30[_0x5d1657(0x165)]};if(typeof _0x5c4f30===_0x5d1657(0x166)&&_0x5c4f30[_0x5d1657(0x161)])return{'statusCode':_0x5773ba[_0x5d1657(0x1b6)],'error':_0x5c4f30[_0x5d1657(0x161)],'message':_0x5c4f30['message'],'errorCode':_0x5c4f30['errorCode']};if(typeof _0x5c4f30===_0x5d1657(0x172))return{'statusCode':_0x5773ba[_0x5d1657(0x1b6)],'error':_0x5c4f30,'message':_0x5c4f30};return void 0x0;}function handleErrorResponse(_0x36c51e){const _0x1b3541=a0_0x25037f;if(!_0x36c51e[_0x1b3541(0x18f)])throw new MissingResponseError(_0x36c51e[_0x1b3541(0x161)]||_0x1b3541(0x156));const {status:_0x19f375,data:_0x441c44}=_0x36c51e[_0x1b3541(0x18f)],_0x1cac24=parseErrorData(_0x441c44,{'statusCode':_0x19f375});if(!_0x1cac24)throw new MiscellaneousError({'statusCode':_0x19f375,'error':_0x1b3541(0x154),'message':_0x36c51e[_0x1b3541(0x161)]||_0x1b3541(0x1b4)});switch(_0x19f375){case 0x190:throw new ValidationError(_0x1cac24);case 0x191:throw new UnauthorizedError(_0x1cac24);case 0x193:throw new ForbiddenError(_0x1cac24);case 0x194:throw new NotFoundError(_0x1cac24);case 0x198:throw new RequestTimeoutError(_0x1cac24);case 0x199:throw new ConflictError(_0x1cac24);default:if(_0x19f375>=0x1f4)throw new ServerError(_0x1cac24);throw new MiscellaneousError(_0x1cac24);}}function getVersion(){const _0x240d2d=a0_0x25037f;return _0x240d2d(0x174);}function createRequestInterceptor(_0xd412d0,_0x289c7f){return _0x2ae78b=>{const _0x177567=a0_0x4c90;return _0x2ae78b[_0x177567(0x119)]&&(_0x2ae78b['headers'][_0x177567(0x17f)]='Bearer\x20'+_0xd412d0,_0x2ae78b[_0x177567(0x119)][_0x177567(0x19b)]=_0x289c7f,_0x2ae78b[_0x177567(0x119)]['User-Agent']=_0x177567(0x15a)+getVersion()),_0x2ae78b;};}function createResponseErrorInterceptor(){return _0x436452=>{handleErrorResponse(_0x436452);};}var ChecklyClient=class{[a0_0x25037f(0x1a7)];['baseUrl'];[a0_0x25037f(0x104)];[a0_0x25037f(0xf1)];constructor(_0x1e7de9){const _0xbebcb5=a0_0x25037f;this[_0xbebcb5(0x104)]=_0x1e7de9[_0xbebcb5(0x104)],this[_0xbebcb5(0x1a7)]=_0x1e7de9[_0xbebcb5(0x1a7)],this['baseUrl']=_0x1e7de9[_0xbebcb5(0x188)],this[_0xbebcb5(0xf1)]=a0_0x5c40a8['create']({'baseURL':this[_0xbebcb5(0x188)],'timeout':0x1d4c0,'maxContentLength':Number[_0xbebcb5(0x182)],'maxBodyLength':Number[_0xbebcb5(0x182)]}),this[_0xbebcb5(0xf1)][_0xbebcb5(0xfc)][_0xbebcb5(0x124)]['use'](createRequestInterceptor(this[_0xbebcb5(0x1a7)],this['accountId'])),this['api']['interceptors'][_0xbebcb5(0x18f)][_0xbebcb5(0xf4)](_0x1139c2=>_0x1139c2,createResponseErrorInterceptor());}[a0_0x25037f(0x16c)](){const _0x4e54dc=a0_0x25037f;return this[_0x4e54dc(0xf1)];}};import a0_0x337fd1 from'form-data';var TestResults=class{constructor(_0x5c2d8d){const _0x125ee5=a0_0x25037f;this[_0x125ee5(0xf1)]=_0x5c2d8d;}async['createTestSession'](_0x7fe39a){const _0x22cafe=a0_0x25037f,_0x12b9eb=await this['api'][_0x22cafe(0x13c)](_0x22cafe(0x145),_0x7fe39a);return _0x12b9eb[_0x22cafe(0x18b)];}async['uploadTestResultAsset'](_0x4cda13,_0x3b6e14,_0x1ae84f){const _0x2acc8f=a0_0x25037f,_0x533dc4=new a0_0x337fd1();_0x533dc4[_0x2acc8f(0x155)](_0x2acc8f(0x15b),_0x1ae84f,{'filename':_0x2acc8f(0x19c),'contentType':_0x2acc8f(0x16d)});const _0x4edc6d=await this[_0x2acc8f(0xf1)][_0x2acc8f(0x13c)](_0x2acc8f(0xe4)+_0x4cda13+_0x2acc8f(0x131)+_0x3b6e14+_0x2acc8f(0x12b),_0x533dc4,{'headers':{..._0x533dc4[_0x2acc8f(0xd4)]()}});return _0x4edc6d[_0x2acc8f(0x18b)];}async[a0_0x25037f(0x14c)](_0x11e3e8,_0x106ec3,_0x3507e4){const _0x4e0a76=a0_0x25037f,_0x927d3d=await this[_0x4e0a76(0xf1)]['post']('/next/test-sessions/'+_0x11e3e8+'/results/'+_0x106ec3,_0x3507e4);return _0x927d3d[_0x4e0a76(0x18b)];}};import*as a0_0x34e740 from'fs';import*as a0_0x2f8d03 from'os';function a0_0x4c90(_0x2e1c0f,_0x127217){_0x2e1c0f=_0x2e1c0f-0xd3;const _0x1d61f6=a0_0x1d61();let _0x4c9085=_0x1d61f6[_0x2e1c0f];return _0x4c9085;}import*as a0_0x3ba4ad from'path';import{ZipArchive}from'archiver';var Zipper=class{[a0_0x25037f(0xd3)];constructor(_0xec772a){const _0x16573c=a0_0x25037f;this['outputPath']=_0xec772a[_0x16573c(0xd3)];}async[a0_0x25037f(0xe8)](_0x26330b,_0x2cda22){const _0x451191=[];return new Promise((_0x4bd962,_0x1daf9d)=>{const _0x3a2efe=a0_0x4c90;try{const _0x54862f=a0_0x34e740[_0x3a2efe(0xe2)](this[_0x3a2efe(0xd3)]),_0xcdeed4=new ZipArchive({'zlib':{'level':0x0}});_0xcdeed4['on'](_0x3a2efe(0x1ab),_0x251899=>{const _0x391eef=_0x3a2efe,_0x58a42c=_0x251899[_0x391eef(0x169)][_0x391eef(0x113)](/\\/g,'/'),_0x2c9eee=_0x251899[_0x391eef(0x157)]?.['contents']??0x0,_0x50eb64=_0x251899[_0x391eef(0x157)]?.['contents']+(_0x251899[_0x391eef(0xf6)]??0x0)-0x1;_0x451191[_0x391eef(0xee)]({'name':_0x58a42c,'start':_0x2c9eee,'end':_0x50eb64});}),_0x54862f['on'](_0x3a2efe(0x121),()=>{const _0x51dd03=_0x3a2efe,_0x179a32=_0xcdeed4[_0x51dd03(0x187)]();_0x4bd962({'zipPath':this[_0x51dd03(0xd3)],'size':_0x179a32,'entryCount':_0x451191[_0x51dd03(0x143)],'entries':_0x451191});}),_0xcdeed4['on'](_0x3a2efe(0x1a4),_0x26b3af=>{_0x1daf9d(_0x26b3af);}),_0x54862f['on'](_0x3a2efe(0x1a4),_0x333236=>{_0x1daf9d(_0x333236);}),_0xcdeed4['pipe'](_0x54862f);if(!a0_0x34e740['existsSync'](_0x26330b)){_0x1daf9d(new Error(_0x3a2efe(0x1af)+_0x26330b));return;}const _0x29f5f0=this[_0x3a2efe(0x189)](_0x26330b);_0xcdeed4['file'](_0x29f5f0,{'name':'output/playwright-test-report.json'});for(const _0x20fd2c of _0x2cda22){if(!a0_0x34e740[_0x3a2efe(0xd6)](_0x20fd2c[_0x3a2efe(0x16b)])){_0x1daf9d(new Error(_0x3a2efe(0x11c)+_0x20fd2c[_0x3a2efe(0x16b)]));return;}_0xcdeed4[_0x3a2efe(0x123)](_0x20fd2c[_0x3a2efe(0x16b)],{'name':_0x20fd2c[_0x3a2efe(0x10a)]});}_0xcdeed4['finalize']();}catch(_0x2d98ee){_0x1daf9d(_0x2d98ee);}});}['transformJsonReport'](_0x3984e8){const _0x2c0648=a0_0x25037f,_0x20d4b4=a0_0x34e740[_0x2c0648(0xf0)](_0x3984e8,_0x2c0648(0x10c)),_0x30d61e=JSON['parse'](_0x20d4b4);this['transformAttachmentPaths'](_0x30d61e);const _0x4864b4=a0_0x3ba4ad['join'](a0_0x2f8d03[_0x2c0648(0x12a)](),_0x2c0648(0x1a8)+Date[_0x2c0648(0x18d)]()+'.json');return a0_0x34e740[_0x2c0648(0x118)](_0x4864b4,JSON['stringify'](_0x30d61e,null,0x2)),_0x4864b4;}[a0_0x25037f(0x112)](_0x2ff750){const _0x501408=a0_0x25037f;if(typeof _0x2ff750!==_0x501408(0x166)||_0x2ff750===null)return;if(Array[_0x501408(0x1a1)](_0x2ff750)){_0x2ff750[_0x501408(0x102)](_0x74bd9a=>this[_0x501408(0x112)](_0x74bd9a));return;}_0x2ff750[_0x501408(0x10f)]&&Array[_0x501408(0x1a1)](_0x2ff750[_0x501408(0x10f)])&&_0x2ff750[_0x501408(0x10f)]['forEach'](_0x43b73a=>{const _0x3d2b6f=_0x501408;_0x43b73a[_0x3d2b6f(0x186)]&&typeof _0x43b73a[_0x3d2b6f(0x186)]===_0x3d2b6f(0x172)&&(_0x43b73a[_0x3d2b6f(0x186)]=this['normalizeAttachmentPath'](_0x43b73a['path']));}),Object[_0x501408(0xf7)](_0x2ff750)[_0x501408(0x102)](_0x2c5f37=>this['transformAttachmentPaths'](_0x2c5f37));}[a0_0x25037f(0x11e)](_0x113c03){const _0x2459c4=a0_0x25037f,_0x5e74b6=_0x113c03[_0x2459c4(0x113)](/\\/g,'/'),_0x4841e7=_0x5e74b6[_0x2459c4(0xfa)](_0x2459c4(0x126));if(_0x4841e7!==-0x1)return _0x5e74b6[_0x2459c4(0x1a9)](_0x4841e7);const _0x3fb0b0=_0x5e74b6['indexOf'](_0x2459c4(0x14a));if(_0x3fb0b0!==-0x1){const _0x51bd78=_0x5e74b6[_0x2459c4(0x1a9)](0x0,_0x3fb0b0),_0x5ab4f9=_0x51bd78[_0x2459c4(0x115)]('/'),_0x19cc96=_0x5ab4f9!==-0x1?_0x5ab4f9+0x1:0x0;return _0x5e74b6[_0x2459c4(0x1a9)](_0x19cc96);}const _0x21f4f9=['__screenshots__/',_0x2459c4(0xdc),_0x2459c4(0x1b1),_0x2459c4(0x142)];for(const _0x2077a4 of _0x21f4f9){const _0x2b257b=_0x5e74b6['indexOf'](_0x2077a4);if(_0x2b257b!==-0x1)return _0x5e74b6[_0x2459c4(0x1a9)](_0x2b257b);}return console[_0x2459c4(0x12f)](_0x2459c4(0xdd)+_0x113c03),_0x113c03;}},__filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),packageJson=JSON[a0_0x25037f(0x13f)](a0_0x546335(a0_0x55d174(__dirname,'..',a0_0x25037f(0x159)),'utf-8')),pkgVersion=packageJson[a0_0x25037f(0xdb)],pluralRules=new Intl[(a0_0x25037f(0x18a))](a0_0x25037f(0x17c)),projectForms={'zero':a0_0x25037f(0x14d),'one':'Project','two':a0_0x25037f(0x129),'few':a0_0x25037f(0x129),'many':a0_0x25037f(0x129),'other':'Projects'};function getApiUrl(_0x2329a1){const _0x542f2d=a0_0x25037f,_0x3963e5={'local':_0x542f2d(0xe6),'development':_0x542f2d(0x15c),'staging':'https://api-test.checklyhq.com','production':_0x542f2d(0x11d)};return _0x3963e5[_0x2329a1];}function getEnvironment(_0x4e9281){const _0x5ded98=a0_0x25037f,_0xe27536=_0x4e9281?.[_0x5ded98(0xed)],_0x1e298e=process['env'][_0x5ded98(0x12d)],_0x13d83c=_0xe27536||_0x1e298e||_0x5ded98(0x17a),_0x1ae78c=[_0x5ded98(0x1a6),_0x5ded98(0x111),_0x5ded98(0x150),'production'];if(!_0x1ae78c[_0x5ded98(0x146)](_0x13d83c))return console[_0x5ded98(0x12f)]('[Checkly\x20Reporter]\x20Invalid\x20environment\x20\x22'+_0x13d83c+_0x5ded98(0x1ad)),_0x5ded98(0x17a);return _0x13d83c;}function getDirectoryName(){const _0x1db52d=a0_0x25037f,_0x4938c5=process[_0x1db52d(0x18e)]();let _0x354907=a0_0x3d351b['basename'](_0x4938c5);return(!_0x354907||_0x354907==='/'||_0x354907==='.')&&(_0x354907=_0x1db52d(0x114)),_0x354907=_0x354907[_0x1db52d(0x113)](/[<>:"|?*]/g,'-'),_0x354907[_0x1db52d(0x143)]>0xff&&(_0x354907=_0x354907[_0x1db52d(0x1a9)](0x0,0xff)),_0x354907;}var ChecklyReporter=class{['options'];[a0_0x25037f(0x15d)];[a0_0x25037f(0x15e)];[a0_0x25037f(0xe3)];[a0_0x25037f(0x1aa)];[a0_0x25037f(0x190)];[a0_0x25037f(0xff)]={'passed':0x0,'failed':0x0,'flaky':0x0};constructor(_0x409731={}){const _0xfe9a07=a0_0x25037f,_0xcf40d4=getEnvironment(_0x409731),_0x197ccc=getApiUrl(_0xcf40d4),_0x2419ea=process['env'][_0xfe9a07(0x191)]||_0x409731[_0xfe9a07(0x1a7)],_0x1e6769=process[_0xfe9a07(0x125)][_0xfe9a07(0x17b)]||_0x409731[_0xfe9a07(0x104)];this['options']={'accountId':_0x1e6769,'apiKey':_0x2419ea,'outputPath':_0x409731['outputPath']??_0xfe9a07(0x108),'jsonReportPath':_0x409731[_0xfe9a07(0x1a2)]??_0xfe9a07(0x120),'testResultsDir':_0x409731[_0xfe9a07(0x1a3)]??'test-results','dryRun':_0x409731['dryRun']??![],'sessionName':_0x409731[_0xfe9a07(0x17d)]},this['assetCollector']=new AssetCollector(this[_0xfe9a07(0x12c)]['testResultsDir']),this['zipper']=new Zipper({'outputPath':this[_0xfe9a07(0x12c)][_0xfe9a07(0xd3)]});if(!this[_0xfe9a07(0x12c)][_0xfe9a07(0xea)]&&this['options'][_0xfe9a07(0x1a7)]&&this[_0xfe9a07(0x12c)][_0xfe9a07(0x104)]){const _0x5ff83=new ChecklyClient({'apiKey':this[_0xfe9a07(0x12c)]['apiKey'],'accountId':this[_0xfe9a07(0x12c)][_0xfe9a07(0x104)],'baseUrl':_0x197ccc});this['testResults']=new TestResults(_0x5ff83[_0xfe9a07(0x16c)]());}}[a0_0x25037f(0x138)](_0x2a547e){const _0x5508d5=a0_0x25037f,{sessionName:_0x248951}=this[_0x5508d5(0x12c)];if(typeof _0x248951===_0x5508d5(0x17e))return _0x248951(_0x2a547e);if(typeof _0x248951===_0x5508d5(0x172))return _0x248951;return'Playwright\x20Test\x20Session:\x20'+_0x2a547e[_0x5508d5(0x167)];}[a0_0x25037f(0xec)](_0x5e3e32,_0x3f2a66){const _0x3290db=a0_0x25037f;this[_0x3290db(0x190)]=new Date();if(!this[_0x3290db(0xe3)])return;try{const _0x4ac4d2=getDirectoryName(),_0x4ab124=this[_0x3290db(0x138)]({'directoryName':_0x4ac4d2,'config':_0x5e3e32,'suite':_0x3f2a66}),_0x1be3ae=[{'name':_0x4ac4d2}],_0x2cec3f=process['env'][_0x3290db(0x127)]?'https://github.com/'+process[_0x3290db(0x125)][_0x3290db(0x127)]:void 0x0,_0x559466=_0x2cec3f?{'repoUrl':_0x2cec3f,'commitId':process[_0x3290db(0x125)][_0x3290db(0x177)],'branchName':process[_0x3290db(0x125)]['GITHUB_REF_NAME'],'commitOwner':process[_0x3290db(0x125)][_0x3290db(0x16f)],'commitMessage':process[_0x3290db(0x125)]['GITHUB_EVENT_NAME']}:void 0x0;this[_0x3290db(0xe3)]['createTestSession']({'name':_0x4ab124,'environment':process[_0x3290db(0x125)][_0x3290db(0x162)]||_0x3290db(0x180),'repoInfo':_0x559466,'startedAt':this['startTime']['getTime'](),'testResults':_0x1be3ae,'provider':'PW_REPORTER'})[_0x3290db(0x198)](_0x48ba5b=>{const _0x2255ea=_0x3290db;this[_0x2255ea(0x1aa)]=_0x48ba5b;})[_0x3290db(0x15f)](_0x255409=>{const _0x56bcab=_0x3290db;console[_0x56bcab(0x1a4)](_0x56bcab(0x136),_0x255409[_0x56bcab(0x161)]);});}catch(_0x4d890a){console[_0x3290db(0x1a4)]('[Checkly\x20Reporter]\x20Error\x20in\x20onBegin:',_0x4d890a);}}[a0_0x25037f(0xd5)](_0x1992ad,_0x291c42){const _0x3bd4db=a0_0x25037f;try{const _0xdc5445=_0x1992ad[_0x3bd4db(0x148)](),_0xec18fb=_0x291c42[_0x3bd4db(0x19a)]===_0x1992ad[_0x3bd4db(0x197)]||_0xdc5445!==_0x3bd4db(0x16e);if(!_0xec18fb)return;const _0x4e2d2a=_0xdc5445===_0x3bd4db(0xfd);if(_0x4e2d2a)this[_0x3bd4db(0xff)]['flaky']++,this[_0x3bd4db(0xff)][_0x3bd4db(0x135)]++;else{if(_0x291c42[_0x3bd4db(0x19d)]==='passed')this[_0x3bd4db(0xff)][_0x3bd4db(0x135)]++;else(_0x291c42[_0x3bd4db(0x19d)]===_0x3bd4db(0x185)||_0x291c42[_0x3bd4db(0x19d)]==='timedOut')&&this[_0x3bd4db(0xff)][_0x3bd4db(0x185)]++;}}catch(_0x158fed){console[_0x3bd4db(0x1a4)]('[Checkly\x20Reporter]\x20Error\x20in\x20onTestEnd:',_0x158fed);}}async[a0_0x25037f(0x11b)](){const _0x55e923=a0_0x25037f;try{const _0x31c1ca=this[_0x55e923(0x12c)]['jsonReportPath'];if(!a0_0x24212e[_0x55e923(0xd6)](_0x31c1ca)){console['error'](_0x55e923(0x1b2)+_0x31c1ca),console[_0x55e923(0x1a4)](_0x55e923(0xef)),console[_0x55e923(0x1a4)](_0x55e923(0x18c));return;}const _0x547fab=a0_0x24212e['readFileSync'](_0x31c1ca,_0x55e923(0x10c)),_0x38ab84=JSON[_0x55e923(0x13f)](_0x547fab),_0x2eb42d=await this[_0x55e923(0x15d)]['collectAssets'](_0x38ab84),_0x3e746a=await this[_0x55e923(0x15e)][_0x55e923(0xe8)](_0x31c1ca,_0x2eb42d);if(this['testResults']&&this[_0x55e923(0x1aa)]){await this['uploadResults'](_0x38ab84,_0x3e746a[_0x55e923(0x170)],_0x3e746a['entries']);if(!this[_0x55e923(0x12c)][_0x55e923(0xea)])try{a0_0x24212e[_0x55e923(0x132)](_0x3e746a[_0x55e923(0x170)]);}catch(_0x417f1c){console['warn'](_0x55e923(0x141)+_0x417f1c);}}this['testResults']&&this[_0x55e923(0x1aa)]?.[_0x55e923(0x152)]&&this['printSummary'](_0x38ab84,this[_0x55e923(0x1aa)]);}catch(_0x506259){console[_0x55e923(0x1a4)](_0x55e923(0x10d),_0x506259);}}[a0_0x25037f(0x151)](_0x336e59,_0x392538){const _0x1c3966=a0_0x25037f,_0x49bfb5=pluralRules[_0x1c3966(0x164)](_0x336e59[_0x1c3966(0x1ac)][_0x1c3966(0x144)][_0x1c3966(0x143)]);console[_0x1c3966(0x160)](_0x1c3966(0x14e)),console[_0x1c3966(0x160)](_0x1c3966(0xfe)+pkgVersion),console[_0x1c3966(0x160)]('🎭\x20Playwright:\x20'+_0x336e59['config']['version']),console[_0x1c3966(0x160)](_0x1c3966(0x116)+projectForms[_0x49bfb5]+':\x20'+_0x336e59[_0x1c3966(0x1ac)][_0x1c3966(0x144)]['map'](({name:_0x5ec683})=>_0x5ec683)['join'](',')),console[_0x1c3966(0x160)](_0x1c3966(0xf9)+_0x392538[_0x1c3966(0x152)]),console[_0x1c3966(0x160)]('\x0a======================================================');}async[a0_0x25037f(0x196)](_0x45eb42,_0x279816,_0x16ddf8){const _0x2593bc=a0_0x25037f;if(!this[_0x2593bc(0xe3)]||!this[_0x2593bc(0x1aa)])return;try{const {failed:_0x35b0a0,flaky:_0x45f4f3}=this[_0x2593bc(0xff)],_0x5c9dbb=_0x35b0a0>0x0?_0x2593bc(0x195):_0x2593bc(0x1b5),_0x5e8eb0=_0x35b0a0===0x0&&_0x45f4f3>0x0,_0x36431d=new Date(),_0x12c827=this[_0x2593bc(0x190)]?Math[_0x2593bc(0x173)](0x0,_0x36431d['getTime']()-this[_0x2593bc(0x190)][_0x2593bc(0x149)]()):0x0,_0xd3c5a8=(await a0_0x24212e[_0x2593bc(0xfb)][_0x2593bc(0x1b3)](_0x279816))[_0x2593bc(0x133)];if(this[_0x2593bc(0x1aa)]['testResults'][_0x2593bc(0x143)]>0x0){const _0x26dce5=this[_0x2593bc(0x1aa)]['testResults'][0x0];let _0x2c5831;if(_0xd3c5a8>0x0)try{const _0x4bbd64=a0_0x24212e[_0x2593bc(0x178)](_0x279816),_0x3d4bb2=await this[_0x2593bc(0xe3)][_0x2593bc(0xf8)](this['testSession'][_0x2593bc(0x194)],_0x26dce5['testResultId'],_0x4bbd64);_0x2c5831=_0x3d4bb2['assetId'];}catch(_0x41f4a3){const _0x1bfee4=_0x41f4a3 instanceof Error?_0x41f4a3['message']:String(_0x41f4a3);console[_0x2593bc(0x1a4)](_0x2593bc(0x128),_0x1bfee4);}await this['testResults']['updateTestResult'](this[_0x2593bc(0x1aa)]['testSessionId'],_0x26dce5['testResultId'],{'status':_0x5c9dbb,'assetEntries':_0x2c5831?_0x16ddf8:void 0x0,'isDegraded':_0x5e8eb0,'startedAt':this[_0x2593bc(0x190)]?.[_0x2593bc(0x117)](),'stoppedAt':_0x36431d[_0x2593bc(0x117)](),'responseTime':_0x12c827,'metadata':{'usageData':{'s3PostTotalBytes':_0xd3c5a8}}});}}catch(_0x4b7ca0){const _0x590df2=_0x4b7ca0 instanceof Error?_0x4b7ca0[_0x2593bc(0x161)]:String(_0x4b7ca0);console['error'](_0x2593bc(0x13d),_0x590df2);}}[a0_0x25037f(0x103)](_0x190c31){const _0x25acaa=a0_0x25037f;console[_0x25acaa(0x1a4)]('[Checkly\x20Reporter]\x20Global\x20error:',_0x190c31);}};function a0_0x1d61(){const _0x119b3a=['0.1.0','shouldSkipFile','join','GITHUB_SHA','createReadStream','add','production','CHECKLY_ACCOUNT_ID','en-US','sessionName','function','Authorization','test','4019448wjmKDN','POSITIVE_INFINITY','constructor','.jpg','failed','path','pointer','baseUrl','transformJsonReport','PluralRules','data','\x20\x20reporter:\x20[\x0a\x20\x20\x20\x20[\x27json\x27,\x20{\x20outputFile:\x20\x27test-results/playwright-test-report.json\x27\x20}],\x0a\x20\x20\x20\x20[\x27@checkly/playwright-reporter\x27]\x0a\x20\x20]','now','cwd','response','startTime','CHECKLY_API_KEY','getImageContentType','application/octet-stream','testSessionId','FAILED','uploadResults','retries','then','4204410mSaIvj','retry','x-checkly-account','assets.zip','status','.gif','image/gif','3335478FRUWTn','isArray','jsonReportPath','testResultsDir','error','extname','local','apiKey','playwright-test-report-','substring','testSession','entry','config','\x22,\x20using\x20\x22production\x22','video/x-msvideo','Report\x20file\x20not\x20found:\x20','.json','screenshots/','[Checkly\x20Reporter]\x20ERROR:\x20JSON\x20report\x20not\x20found\x20at:\x20','stat','An\x20error\x20occurred','PASSED','statusCode','outputPath','getHeaders','onTestEnd','existsSync','.webm','video','video/quicktime','createAsset','version','__snapshots__/','[Checkly\x20Reporter]\x20Could\x20not\x20normalize\x20attachment\x20path:\x20','34882nkVoqT','.jpeg','determineAssetType','785245HzpgOz','createWriteStream','testResults','/next/test-sessions/','readdirSync','http://127.0.0.1:3000','collectAssetsRecursive','createZip','15TPJqcE','dryRun','image/png','onBegin','environment','push','[Checkly\x20Reporter]\x20Make\x20sure\x20to\x20configure\x20the\x20json\x20reporter\x20before\x20the\x20checkly\x20reporter:','readFileSync','api','getVideoContentType','.png','use','.bmp','csize','values','uploadTestResultAsset','🔗\x20Test\x20session\x20URL:\x20','indexOf','promises','interceptors','flaky','🦝\x20Checkly\x20reporter:\x20','testCounts','isFile','MissingResponseError','forEach','onError','accountId','basename','isDirectory','other','checkly-report.zip','screenshot','archivePath','text/html','utf-8','[Checkly\x20Reporter]\x20ERROR\x20creating\x20report:','text/plain','attachments','split','development','transformAttachmentPaths','replace','playwright-tests','lastIndexOf','📔\x20','toISOString','writeFileSync','headers','.mov','onEnd','Asset\x20file\x20not\x20found:\x20','https://api.checklyhq.com','normalizeAttachmentPath','.svg','test-results/playwright-test-report.json','close','image/svg+xml','file','request','env','test-results/','GITHUB_REPOSITORY','[Checkly\x20Reporter]\x20Asset\x20upload\x20failed:','Projects','tmpdir','/assets','options','CHECKLY_ENV','video/webm','warn','image/bmp','/results/','unlinkSync','size','.html','passed','[Checkly\x20Reporter]\x20Failed\x20to\x20create\x20test\x20session:','resolve','resolveSessionName','.avi','trace','10372725gFlEFx','post','[Checkly\x20Reporter]\x20Failed\x20to\x20upload\x20results:','image/jpeg','parse','24vXADxZ','[Checkly\x20Reporter]\x20Warning:\x20Could\x20not\x20delete\x20ZIP\x20file:\x20','snapshots/','length','projects','/next/test-sessions/create','includes','application/json','outcome','getTime','-snapshots/','552620qOgnXt','updateTestResult','Project','\x0a======================================================\x0a','9zkaFKf','staging','printSummary','link','14mltush','Unknown\x20error','append','Network\x20error','_offsets','attachment','package.json','@checkly/playwright-reporter/','assets','https://api-dev.checklyhq.com','assetCollector','zipper','catch','log','message','NODE_ENV','.zip','select','errorCode','object','directoryName','collectAssets','name','some','sourcePath','getAxiosInstance','application/zip','unexpected','GITHUB_ACTOR','zipPath','.htm','string','max'];a0_0x1d61=function(){return _0x119b3a;};return a0_0x1d61();}export{AssetCollector,ChecklyReporter,Zipper,ChecklyReporter as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkly/playwright-reporter",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Playwright reporter that generates ZIP archives containing JSON reports and test assets",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,14 +14,18 @@
14
14
  "url": "https://github.com/checkly/checkly-playwright-reporter-changelog.git"
15
15
  },
16
16
  "scripts": {
17
- "build": "tsc && npx --yes javascript-obfuscator raw-dist --output dist",
17
+ "build": "tsup && npx --yes javascript-obfuscator raw-dist --output dist && cp raw-dist/*.d.ts dist/",
18
18
  "test": "vitest run",
19
19
  "test:watch": "vitest watch",
20
20
  "test:coverage": "vitest run --coverage",
21
21
  "typecheck": "tsc --noEmit",
22
- "lint": "eslint src tests",
23
- "lint:fix": "eslint src tests --fix",
24
- "clean": "rm -rf dist coverage *.zip"
22
+ "format": "biome check --write --no-errors-on-unmatched",
23
+ "lint": "biome lint",
24
+ "lint:fix": "biome lint --write",
25
+ "lint:ci": "biome ci --reporter=github",
26
+ "clean": "rm -rf dist raw-dist coverage *.zip",
27
+ "up": "taze -I",
28
+ "prepare": "simple-git-hooks"
25
29
  },
26
30
  "keywords": [
27
31
  "playwright",
@@ -45,16 +49,26 @@
45
49
  "form-data": "^4.0.4"
46
50
  },
47
51
  "devDependencies": {
52
+ "@biomejs/biome": "2.3.11",
48
53
  "@playwright/test": "^1.56.0",
49
54
  "@types/adm-zip": "^0.5.7",
50
55
  "@types/archiver": "^6.0.3",
51
56
  "@types/node": "^24.7.2",
52
- "@typescript-eslint/eslint-plugin": "^8.46.1",
53
- "@typescript-eslint/parser": "^8.46.1",
54
- "@vitest/coverage-v8": "^3.2.4",
57
+ "@vitest/coverage-v8": "4.0.17",
55
58
  "adm-zip": "^0.5.16",
56
- "eslint": "^9.37.0",
59
+ "lint-staged": "16.2.7",
60
+ "simple-git-hooks": "2.13.1",
61
+ "taze": "19.9.2",
62
+ "tsup": "8.5.1",
57
63
  "typescript": "^5.9.3",
58
- "vitest": "^3.2.4"
64
+ "vitest": "4.0.17"
65
+ },
66
+ "simple-git-hooks": {
67
+ "pre-commit": "npx lint-staged"
68
+ },
69
+ "lint-staged": {
70
+ "*.{js,ts}": [
71
+ "biome check --write --no-errors-on-unmatched"
72
+ ]
59
73
  }
60
74
  }
@@ -1 +0,0 @@
1
- function a0_0xef21(_0x56de62,_0x13ba8f){_0x56de62=_0x56de62-0x64;const _0x1cb662=a0_0x1cb6();let _0xef215=_0x1cb662[_0x56de62];return _0xef215;}const a0_0x475340=a0_0xef21;function a0_0x1cb6(){const _0x1a5619=['createAsset','18HzDvVL','.zip','video','9205zRDZnT','shouldSkipFile','readdirSync','collectAssetsRecursive','.png','6602772mtENsy','image/bmp','resolve','toLowerCase','name','.gif','118113zqdWJO','extname','relative','50FdyUCn','testResultsDir','join','collectAssets','attachment','152712QkrovE','.avi','includes','getImageContentType','text/plain','52EIClac','image/gif','getVideoContentType','video/webm','video/mp4','test','other','6296bXPeUK','.mov','sep','determineAssetType','.txt','image/jpeg','.jpeg','.bmp','basename','.jpg','.svg','.webm','16277rZJExV','trace','some','video/x-msvideo','text/html','image/svg+xml','.mp4','271705VwTpgy','split','application/zip','existsSync','video/quicktime','1012626xWgOqL','image/png'];a0_0x1cb6=function(){return _0x1a5619;};return a0_0x1cb6();}(function(_0x233634,_0x589c28){const _0x30b879=a0_0xef21,_0x30e730=_0x233634();while(!![]){try{const _0xb195ca=parseInt(_0x30b879(0x87))/0x1+parseInt(_0x30b879(0x6f))/0x2+-parseInt(_0x30b879(0x67))/0x3*(parseInt(_0x30b879(0x74))/0x4)+parseInt(_0x30b879(0x8e))/0x5*(parseInt(_0x30b879(0x96))/0x6)+parseInt(_0x30b879(0x99))/0x7*(parseInt(_0x30b879(0x7b))/0x8)+-parseInt(_0x30b879(0x93))/0x9*(-parseInt(_0x30b879(0x6a))/0xa)+-parseInt(_0x30b879(0x9e))/0xb;if(_0xb195ca===_0x589c28)break;else _0x30e730['push'](_0x30e730['shift']());}catch(_0x55d32f){_0x30e730['push'](_0x30e730['shift']());}}}(a0_0x1cb6,0xb4ec0));import*as a0_0x116555 from'fs';import*as a0_0x4a9982 from'path';export class AssetCollector{[a0_0x475340(0x6b)];constructor(_0x176648){const _0x58c69a=a0_0x475340;this[_0x58c69a(0x6b)]=_0x176648;}async[a0_0x475340(0x6d)](_0x1332aa){const _0x5b06e7=a0_0x475340,_0x56faa2=[],_0x376a00=new Set();if(!a0_0x116555[_0x5b06e7(0x91)](this[_0x5b06e7(0x6b)]))return _0x56faa2;return await this[_0x5b06e7(0x9c)](this[_0x5b06e7(0x6b)],'',_0x56faa2,_0x376a00),_0x56faa2;}async['collectAssetsRecursive'](_0x54bcb1,_0x2f3135,_0x412989,_0x20b37a){const _0x16cf14=a0_0x475340;let _0x4fc1fe;try{_0x4fc1fe=a0_0x116555[_0x16cf14(0x9b)](_0x54bcb1,{'withFileTypes':!![]});}catch{return;}const _0x3ad32f=a0_0x4a9982[_0x16cf14(0x83)](a0_0x4a9982[_0x16cf14(0xa0)](this[_0x16cf14(0x6b)]));for(const _0x491c8e of _0x4fc1fe){const _0x4f7de5=a0_0x4a9982[_0x16cf14(0x6c)](_0x54bcb1,_0x491c8e[_0x16cf14(0x65)]),_0x131ef2=a0_0x4a9982[_0x16cf14(0x69)](this['testResultsDir'],_0x4f7de5),_0x542449=a0_0x4a9982[_0x16cf14(0x6c)](_0x3ad32f,_0x131ef2);if(this[_0x16cf14(0x9a)](_0x491c8e[_0x16cf14(0x65)]))continue;if(_0x491c8e['isDirectory']())await this[_0x16cf14(0x9c)](_0x4f7de5,_0x542449,_0x412989,_0x20b37a);else{if(_0x491c8e['isFile']()){if(!_0x20b37a['has'](_0x4f7de5)){const _0x34c983=this[_0x16cf14(0x95)](_0x4f7de5,_0x542449);_0x412989['push'](_0x34c983),_0x20b37a['add'](_0x4f7de5);}}}}}[a0_0x475340(0x9a)](_0xce36b0){const _0x47e316=a0_0x475340,_0x70c03=[/^\./,/\.tmp$/i,/~$/,/\.swp$/i,/\.lock$/i,/^playwright-test-report\.json$/i];return _0x70c03[_0x47e316(0x89)](_0x23ae8c=>_0x23ae8c[_0x47e316(0x79)](_0xce36b0));}[a0_0x475340(0x95)](_0x5885db,_0x24b180){const _0x9ea562=a0_0x475340,_0x479ff0=a0_0x4a9982[_0x9ea562(0x68)](_0x5885db)[_0x9ea562(0x64)](),{type:_0x2cb575,contentType:_0x4db46d}=this['determineAssetType'](_0x479ff0),_0x4e5129=_0x24b180[_0x9ea562(0x8f)](a0_0x4a9982[_0x9ea562(0x7d)])[_0x9ea562(0x6c)]('/');return{'sourcePath':_0x5885db,'archivePath':_0x4e5129,'type':_0x2cb575,'contentType':_0x4db46d};}[a0_0x475340(0x7e)](_0x5cbfe2){const _0x4f9179=a0_0x475340;if([_0x4f9179(0x9d),_0x4f9179(0x84),_0x4f9179(0x81),_0x4f9179(0x66),_0x4f9179(0x82),_0x4f9179(0x85)][_0x4f9179(0x71)](_0x5cbfe2))return{'type':'screenshot','contentType':this['getImageContentType'](_0x5cbfe2)};if([_0x4f9179(0x86),_0x4f9179(0x8d),_0x4f9179(0x70),_0x4f9179(0x7c)][_0x4f9179(0x71)](_0x5cbfe2))return{'type':_0x4f9179(0x98),'contentType':this[_0x4f9179(0x76)](_0x5cbfe2)};if(_0x5cbfe2===_0x4f9179(0x97))return{'type':_0x4f9179(0x88),'contentType':_0x4f9179(0x90)};if(_0x5cbfe2==='.html'||_0x5cbfe2==='.htm')return{'type':_0x4f9179(0x6e),'contentType':_0x4f9179(0x8b)};if(_0x5cbfe2==='.json')return{'type':_0x4f9179(0x6e),'contentType':'application/json'};if(_0x5cbfe2===_0x4f9179(0x7f)||_0x5cbfe2==='.log')return{'type':'attachment','contentType':_0x4f9179(0x73)};return{'type':_0x4f9179(0x7a),'contentType':'application/octet-stream'};}[a0_0x475340(0x72)](_0x48123c){const _0x508c6c=a0_0x475340,_0x24f098={'.png':_0x508c6c(0x94),'.jpg':'image/jpeg','.jpeg':_0x508c6c(0x80),'.gif':_0x508c6c(0x75),'.bmp':_0x508c6c(0x9f),'.svg':_0x508c6c(0x8c)};return _0x24f098[_0x48123c]||_0x508c6c(0x94);}['getVideoContentType'](_0x5a43ac){const _0xa9bb9a=a0_0x475340,_0x3bc8fa={'.webm':_0xa9bb9a(0x77),'.mp4':_0xa9bb9a(0x78),'.avi':_0xa9bb9a(0x8a),'.mov':_0xa9bb9a(0x92)};return _0x3bc8fa[_0x5a43ac]||_0xa9bb9a(0x77);}}
@@ -1 +0,0 @@
1
- var a1_0x11a668=a1_0x5cd3;function a1_0x5cd3(_0x258139,_0x46de){_0x258139=_0x258139-0x1d0;var _0x5681a6=a1_0x5681();var _0x5cd32d=_0x5681a6[_0x258139];return _0x5cd32d;}(function(_0x1327ff,_0x1784bc){var _0x1c3c54=a1_0x5cd3,_0x339be7=_0x1327ff();while(!![]){try{var _0x10bb9a=-parseInt(_0x1c3c54(0x1da))/0x1+-parseInt(_0x1c3c54(0x1e3))/0x2+-parseInt(_0x1c3c54(0x1e7))/0x3*(-parseInt(_0x1c3c54(0x1e2))/0x4)+parseInt(_0x1c3c54(0x1d4))/0x5+parseInt(_0x1c3c54(0x1e4))/0x6+-parseInt(_0x1c3c54(0x1e5))/0x7+-parseInt(_0x1c3c54(0x1dc))/0x8*(-parseInt(_0x1c3c54(0x1d6))/0x9);if(_0x10bb9a===_0x1784bc)break;else _0x339be7['push'](_0x339be7['shift']());}catch(_0x14ee8d){_0x339be7['push'](_0x339be7['shift']());}}}(a1_0x5681,0x4ebf5));import a1_0x27f9fa from'axios';import{handleErrorResponse}from'./errors.js';function getVersion(){return'0.1.0';}export function createRequestInterceptor(_0x37144f,_0xe2ad97){return _0x33cd67=>{var _0x467c76=a1_0x5cd3;return _0x33cd67['headers']&&(_0x33cd67[_0x467c76(0x1d5)][_0x467c76(0x1db)]=_0x467c76(0x1d2)+_0x37144f,_0x33cd67['headers'][_0x467c76(0x1de)]=_0xe2ad97,_0x33cd67['headers'][_0x467c76(0x1d0)]=_0x467c76(0x1df)+getVersion()),_0x33cd67;};}export function createResponseErrorInterceptor(){return _0xe00502=>{handleErrorResponse(_0xe00502);};}function a1_0x5681(){var _0x417f0e=['Bearer\x20','apiKey','440110JEqjLM','headers','29547JZPhyo','accountId','getAxiosInstance','interceptors','31805jOkWik','Authorization','1456ZeifxJ','use','x-checkly-account','@checkly/playwright-reporter/','create','api','4GvjcEA','957954tEYNyF','3164166bzoHwA','4028388lzUBKz','baseUrl','587778htxmsh','User-Agent','response'];a1_0x5681=function(){return _0x417f0e;};return a1_0x5681();}export default class ChecklyClient{[a1_0x11a668(0x1d3)];[a1_0x11a668(0x1e6)];['accountId'];[a1_0x11a668(0x1e1)];constructor(_0x3303ee){var _0x2a3a05=a1_0x11a668;this['accountId']=_0x3303ee[_0x2a3a05(0x1d7)],this['apiKey']=_0x3303ee['apiKey'],this[_0x2a3a05(0x1e6)]=_0x3303ee[_0x2a3a05(0x1e6)],this[_0x2a3a05(0x1e1)]=a1_0x27f9fa[_0x2a3a05(0x1e0)]({'baseURL':this[_0x2a3a05(0x1e6)],'timeout':0x1d4c0,'maxContentLength':Infinity,'maxBodyLength':Infinity}),this[_0x2a3a05(0x1e1)][_0x2a3a05(0x1d9)]['request'][_0x2a3a05(0x1dd)](createRequestInterceptor(this[_0x2a3a05(0x1d3)],this[_0x2a3a05(0x1d7)])),this[_0x2a3a05(0x1e1)][_0x2a3a05(0x1d9)][_0x2a3a05(0x1d1)][_0x2a3a05(0x1dd)](_0xc5f088=>_0xc5f088,createResponseErrorInterceptor());}[a1_0x11a668(0x1d8)](){return this['api'];}}
@@ -1 +0,0 @@
1
- const a2_0x48f638=a2_0x4cae;(function(_0x2dcc25,_0x1338f3){const _0x2b667f=a2_0x4cae,_0x137188=_0x2dcc25();while(!![]){try{const _0x5bdf01=-parseInt(_0x2b667f(0xd4))/0x1+parseInt(_0x2b667f(0xdf))/0x2*(parseInt(_0x2b667f(0xe3))/0x3)+-parseInt(_0x2b667f(0xdb))/0x4*(parseInt(_0x2b667f(0xd6))/0x5)+-parseInt(_0x2b667f(0xdd))/0x6+parseInt(_0x2b667f(0xe1))/0x7*(-parseInt(_0x2b667f(0xce))/0x8)+parseInt(_0x2b667f(0xcd))/0x9+parseInt(_0x2b667f(0xd9))/0xa;if(_0x5bdf01===_0x1338f3)break;else _0x137188['push'](_0x137188['shift']());}catch(_0x521927){_0x137188['push'](_0x137188['shift']());}}}(a2_0x17c6,0x66698));function a2_0x17c6(){const _0x25b9cf=['statusCode','3RNsOCe','errorCode','5166954zFLgwP','234488hmQdyt','name','error','Unknown\x20error','response','object','468672OVextW','MissingResponseError','635pmTUer','An\x20error\x20occurred','data','13452730DvtXXq','string','5304SugmGO','constructor','3931194picTDC','message','933054zFKyPk','Network\x20error','161rznpON'];a2_0x17c6=function(){return _0x25b9cf;};return a2_0x17c6();}export class ApiError extends Error{[a2_0x48f638(0xd8)];constructor(_0x5ec489,_0x2eaa3d){const _0xbfd4f1=a2_0x48f638;super(_0x5ec489[_0xbfd4f1(0xde)],_0x2eaa3d),this[_0xbfd4f1(0xcf)]=this[_0xbfd4f1(0xdc)]['name'],this['data']=_0x5ec489;}}export class ValidationError extends ApiError{constructor(_0x4ecad2,_0x41f051){super(_0x4ecad2,_0x41f051);}}export class UnauthorizedError extends ApiError{constructor(_0x5cc46e,_0x5e885a){super(_0x5cc46e,_0x5e885a);}}export class ForbiddenError extends ApiError{constructor(_0x5e5a12,_0x996b8f){super(_0x5e5a12,_0x996b8f);}}export class NotFoundError extends ApiError{constructor(_0xcab78b,_0x525a30){super(_0xcab78b,_0x525a30);}}export class RequestTimeoutError extends ApiError{constructor(_0x23820b,_0x1db4b3){super(_0x23820b,_0x1db4b3);}}function a2_0x4cae(_0x93ea2,_0x55ff55){_0x93ea2=_0x93ea2-0xcc;const _0x17c6a0=a2_0x17c6();let _0x4cae19=_0x17c6a0[_0x93ea2];return _0x4cae19;}export class ConflictError extends ApiError{constructor(_0x73ae46,_0x1d4d1c){super(_0x73ae46,_0x1d4d1c);}}export class ServerError extends ApiError{constructor(_0x30b292,_0xe0ef32){super(_0x30b292,_0xe0ef32);}}export class MiscellaneousError extends ApiError{constructor(_0x51415d,_0x4daea6){super(_0x51415d,_0x4daea6);}}export class MissingResponseError extends Error{constructor(_0x5c7ae9,_0x3361db){const _0x242002=a2_0x48f638;super(_0x5c7ae9,_0x3361db),this[_0x242002(0xcf)]=_0x242002(0xd5);}}export function parseErrorData(_0x7273bd,_0x354084){const _0xe0970f=a2_0x48f638;if(!_0x7273bd)return undefined;if(typeof _0x7273bd==='object'&&_0x7273bd[_0xe0970f(0xe2)]&&_0x7273bd[_0xe0970f(0xd0)]&&_0x7273bd[_0xe0970f(0xde)])return{'statusCode':_0x7273bd[_0xe0970f(0xe2)],'error':_0x7273bd[_0xe0970f(0xd0)],'message':_0x7273bd['message'],'errorCode':_0x7273bd[_0xe0970f(0xcc)]};if(typeof _0x7273bd==='object'&&_0x7273bd['error']&&!_0x7273bd['message'])return{'statusCode':_0x354084['statusCode'],'error':_0x7273bd[_0xe0970f(0xd0)],'message':_0x7273bd[_0xe0970f(0xd0)]};if(typeof _0x7273bd===_0xe0970f(0xd3)&&_0x7273bd[_0xe0970f(0xd0)]&&_0x7273bd['message'])return{'statusCode':_0x354084['statusCode'],'error':_0x7273bd[_0xe0970f(0xd0)],'message':_0x7273bd[_0xe0970f(0xde)],'errorCode':_0x7273bd[_0xe0970f(0xcc)]};if(typeof _0x7273bd===_0xe0970f(0xd3)&&_0x7273bd[_0xe0970f(0xde)])return{'statusCode':_0x354084[_0xe0970f(0xe2)],'error':_0x7273bd[_0xe0970f(0xde)],'message':_0x7273bd[_0xe0970f(0xde)],'errorCode':_0x7273bd[_0xe0970f(0xcc)]};if(typeof _0x7273bd===_0xe0970f(0xda))return{'statusCode':_0x354084[_0xe0970f(0xe2)],'error':_0x7273bd,'message':_0x7273bd};return undefined;}export function handleErrorResponse(_0xbcbe7f){const _0x19ff67=a2_0x48f638;if(!_0xbcbe7f['response'])throw new MissingResponseError(_0xbcbe7f[_0x19ff67(0xde)]||_0x19ff67(0xe0));const {status:_0x5b31f6,data:_0x4163fe}=_0xbcbe7f[_0x19ff67(0xd2)],_0x5deab4=parseErrorData(_0x4163fe,{'statusCode':_0x5b31f6});if(!_0x5deab4)throw new MiscellaneousError({'statusCode':_0x5b31f6,'error':_0x19ff67(0xd1),'message':_0xbcbe7f[_0x19ff67(0xde)]||_0x19ff67(0xd7)});switch(_0x5b31f6){case 0x190:throw new ValidationError(_0x5deab4);case 0x191:throw new UnauthorizedError(_0x5deab4);case 0x193:throw new ForbiddenError(_0x5deab4);case 0x194:throw new NotFoundError(_0x5deab4);case 0x198:throw new RequestTimeoutError(_0x5deab4);case 0x199:throw new ConflictError(_0x5deab4);default:if(_0x5b31f6>=0x1f4)throw new ServerError(_0x5deab4);throw new MiscellaneousError(_0x5deab4);}}
@@ -1 +0,0 @@
1
- (function(_0x3f3af6,_0x114878){var _0x396f4b=a3_0x3918,_0x3dd07d=_0x3f3af6();while(!![]){try{var _0x10d4d1=-parseInt(_0x396f4b(0x97))/0x1+-parseInt(_0x396f4b(0x95))/0x2*(-parseInt(_0x396f4b(0x90))/0x3)+parseInt(_0x396f4b(0x94))/0x4+parseInt(_0x396f4b(0x93))/0x5+-parseInt(_0x396f4b(0x8f))/0x6+parseInt(_0x396f4b(0x92))/0x7+-parseInt(_0x396f4b(0x91))/0x8*(parseInt(_0x396f4b(0x96))/0x9);if(_0x10d4d1===_0x114878)break;else _0x3dd07d['push'](_0x3dd07d['shift']());}catch(_0x2ee737){_0x3dd07d['push'](_0x3dd07d['shift']());}}}(a3_0x2a18,0x3667e));function a3_0x3918(_0xe3a34e,_0x15d3ff){_0xe3a34e=_0xe3a34e-0x8f;var _0x2a1840=a3_0x2a18();var _0x3918ac=_0x2a1840[_0xe3a34e];return _0x3918ac;}export{default as ChecklyClient}from'./checkly-client.js';export{TestResults}from'./test-results.js';export*from'./types.js';function a3_0x2a18(){var _0x1e9db7=['9fkzFhW','46989yBkmCR','1227144IOthEK','12039cZuFVi','502968QyuhDq','447832Zmevbp','1658200toAexu','68844eFpNNE','62PxTzsN'];a3_0x2a18=function(){return _0x1e9db7;};return a3_0x2a18();}export*from'./errors.js';
@@ -1 +0,0 @@
1
- function a4_0x2efc(_0xbd3651,_0x534f51){_0xbd3651=_0xbd3651-0x1bd;const _0x3665a6=a4_0x3665();let _0x2efca8=_0x3665a6[_0xbd3651];return _0x2efca8;}function a4_0x3665(){const _0x2b976d=['/next/test-sessions/','11oQdMlH','5letnPD','1199802GkMlQm','post','getHeaders','append','62068gyihrH','1814706Uzjqvu','api','19271IQXebF','/results/','216IiqClk','application/zip','/assets','assets','data','2311830WgyJFt','assets.zip','623945PUaRUo','18artZqa','/next/test-sessions/create','130968KahNLr'];a4_0x3665=function(){return _0x2b976d;};return a4_0x3665();}(function(_0x3e3441,_0x1cdab7){const _0x3c7fd5=a4_0x2efc,_0x2c9929=_0x3e3441();while(!![]){try{const _0x5f50d8=-parseInt(_0x3c7fd5(0x1c5))/0x1*(-parseInt(_0x3c7fd5(0x1ca))/0x2)+-parseInt(_0x3c7fd5(0x1c0))/0x3*(parseInt(_0x3c7fd5(0x1c2))/0x4)+-parseInt(_0x3c7fd5(0x1bf))/0x5+parseInt(_0x3c7fd5(0x1c6))/0x6+-parseInt(_0x3c7fd5(0x1cd))/0x7*(-parseInt(_0x3c7fd5(0x1cf))/0x8)+-parseInt(_0x3c7fd5(0x1cb))/0x9+parseInt(_0x3c7fd5(0x1bd))/0xa*(parseInt(_0x3c7fd5(0x1c4))/0xb);if(_0x5f50d8===_0x1cdab7)break;else _0x2c9929['push'](_0x2c9929['shift']());}catch(_0xa44d69){_0x2c9929['push'](_0x2c9929['shift']());}}}(a4_0x3665,0x21a30));import a4_0x1013ef from'form-data';export class TestResults{['api'];constructor(_0x3dc818){this['api']=_0x3dc818;}async['createTestSession'](_0x34003c){const _0x2dd26e=a4_0x2efc,_0x256198=await this['api'][_0x2dd26e(0x1c7)](_0x2dd26e(0x1c1),_0x34003c);return _0x256198['data'];}async['uploadTestResultAsset'](_0x21b8b6,_0xaa9fd6,_0x57498e){const _0x5490d4=a4_0x2efc,_0x9ee64=new a4_0x1013ef();_0x9ee64[_0x5490d4(0x1c9)](_0x5490d4(0x1d2),_0x57498e,{'filename':_0x5490d4(0x1be),'contentType':_0x5490d4(0x1d0)});const _0x119579=await this[_0x5490d4(0x1cc)]['post'](_0x5490d4(0x1c3)+_0x21b8b6+_0x5490d4(0x1ce)+_0xaa9fd6+_0x5490d4(0x1d1),_0x9ee64,{'headers':{..._0x9ee64[_0x5490d4(0x1c8)]()}});return _0x119579['data'];}async['updateTestResult'](_0x508406,_0x3c9b9,_0x3c7a23){const _0x41957a=a4_0x2efc,_0x3b8a47=await this[_0x41957a(0x1cc)][_0x41957a(0x1c7)]('/next/test-sessions/'+_0x508406+_0x41957a(0x1ce)+_0x3c9b9,_0x3c7a23);return _0x3b8a47[_0x41957a(0x1d3)];}}
@@ -1 +0,0 @@
1
- export{};
package/dist/reporter.js DELETED
@@ -1 +0,0 @@
1
- const a7_0x4caca5=a7_0x3617;(function(_0x3abe83,_0x11b944){const _0x58fcb8=a7_0x3617,_0x296b05=_0x3abe83();while(!![]){try{const _0x2a8b76=parseInt(_0x58fcb8(0x12a))/0x1*(-parseInt(_0x58fcb8(0x11d))/0x2)+parseInt(_0x58fcb8(0x12e))/0x3+-parseInt(_0x58fcb8(0x13f))/0x4+parseInt(_0x58fcb8(0x136))/0x5+parseInt(_0x58fcb8(0x101))/0x6+-parseInt(_0x58fcb8(0xed))/0x7+parseInt(_0x58fcb8(0xd3))/0x8;if(_0x2a8b76===_0x11b944)break;else _0x296b05['push'](_0x296b05['shift']());}catch(_0x1865bf){_0x296b05['push'](_0x296b05['shift']());}}}(a7_0xbb47,0x82e7f));import*as a7_0x1b685b from'fs';function a7_0x3617(_0x1302ce,_0x3fa550){_0x1302ce=_0x1302ce-0xcc;const _0xbb47aa=a7_0xbb47();let _0x361777=_0xbb47aa[_0x1302ce];return _0x361777;}import*as a7_0x3ca764 from'path';function a7_0xbb47(){const _0x31d0bd=['\x20\x20]','retry','https://api.checklyhq.com','log','5DHHorQ','printSummary','timedOut','[Checkly\x20Reporter]\x20ERROR:\x20JSON\x20report\x20not\x20found\x20at:\x20','708360tjpWFs','existsSync','passed','playwright-tests','outputPath','\x20\x20reporter:\x20[\x0a','checkly-report.zip','CHECKLY_ENV','1198490CuOwbc','uploadTestResultAsset','FAILED','toISOString','🦝\x20Checkly\x20reporter:\x20','CHECKLY_ACCOUNT_ID','apiKey','\x0a======================================================\x0a','🎭\x20Playwright:\x20','1388556IZrcCu','version','[Checkly\x20Reporter]\x20Invalid\x20environment\x20\x22','join','\x22,\x20using\x20\x22production\x22','getTime','testResultId','GITHUB_REPOSITORY','14409688OyHRKH','link','createReadStream','error','flaky','GITHUB_SHA','includes','basename','accountId','[Checkly\x20Reporter]\x20Make\x20sure\x20to\x20configure\x20the\x20json\x20reporter\x20before\x20the\x20checkly\x20reporter:','outcome','getAxiosInstance','testResults','GITHUB_REF_NAME','development','parse','select','updateTestResult','https://github.com/','readFileSync','NODE_ENV','options','message','promises','\x20\x20\x20\x20[\x27json\x27,\x20{\x20outputFile:\x20\x27test-results/playwright-test-report.json\x27\x20}],\x0a','replace','7437374DhowDe','📔\x20','config','PASSED','testSessionId','[Checkly\x20Reporter]\x20Error\x20in\x20onTestEnd:','utf-8','env','http://127.0.0.1:3000','staging','onTestEnd','🔗\x20Test\x20session\x20URL:\x20','production','\x0a======================================================','testCounts','dryRun','jsonReportPath','unlinkSync','https://api-dev.checklyhq.com','environment','777228NDWqZZ','PW_REPORTER','startTime','[Checkly\x20Reporter]\x20Error\x20in\x20onBegin:','en-US','\x20\x20\x20\x20[\x27@checkly/playwright-reporter\x27]\x0a','testSession','retries','max','collectAssets','package.json','Playwright\x20Test\x20Session:\x20','CHECKLY_API_KEY','projects','stat','test-results','PluralRules','zipper','https://api-test.checklyhq.com','assetCollector','onEnd','warn','Projects','test','cwd','size','[Checkly\x20Reporter]\x20Failed\x20to\x20create\x20test\x20session:','uploadResults','184302GRVMPc','length','local','testResultsDir','zipPath','GITHUB_EVENT_NAME','test-results/playwright-test-report.json','substring','status'];a7_0xbb47=function(){return _0x31d0bd;};return a7_0xbb47();}import{AssetCollector}from'./asset-collector.js';import{Zipper}from'./zipper.js';import a7_0x310b0b from'./clients/checkly-client.js';import{TestResults}from'./clients/test-results.js';import{readFileSync}from'fs';import{fileURLToPath}from'url';import{dirname,join}from'path';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename),packageJson=JSON['parse'](readFileSync(join(__dirname,'..',a7_0x4caca5(0x10b)),a7_0x4caca5(0xf3))),pkgVersion=packageJson[a7_0x4caca5(0xcc)],pluralRules=new Intl[(a7_0x4caca5(0x111))](a7_0x4caca5(0x105)),projectForms={'zero':'Project','one':'Project','two':a7_0x4caca5(0x117),'few':a7_0x4caca5(0x117),'many':'Projects','other':a7_0x4caca5(0x117)};function getApiUrl(_0x469658){const _0x56dec7=a7_0x4caca5,_0x544da7={'local':_0x56dec7(0xf5),'development':_0x56dec7(0xff),'staging':_0x56dec7(0x113),'production':_0x56dec7(0x128)};return _0x544da7[_0x469658];}function getEnvironment(_0x47f5eb){const _0x4f53c0=a7_0x4caca5,_0x35eea0=_0x47f5eb?.[_0x4f53c0(0x100)],_0x412e98=process[_0x4f53c0(0xf4)][_0x4f53c0(0x135)],_0x242551=_0x35eea0||_0x412e98||_0x4f53c0(0xf9),_0x1ba7c1=[_0x4f53c0(0x11f),_0x4f53c0(0xe1),_0x4f53c0(0xf6),_0x4f53c0(0xf9)];if(!_0x1ba7c1[_0x4f53c0(0xd9)](_0x242551))return console[_0x4f53c0(0x116)](_0x4f53c0(0xcd)+_0x242551+_0x4f53c0(0xcf)),'production';return _0x242551;}function getDirectoryName(){const _0x2093e0=a7_0x4caca5,_0x46197d=process[_0x2093e0(0x119)]();let _0x29d812=a7_0x3ca764[_0x2093e0(0xda)](_0x46197d);return(!_0x29d812||_0x29d812==='/'||_0x29d812==='.')&&(_0x29d812=_0x2093e0(0x131)),_0x29d812=_0x29d812[_0x2093e0(0xec)](/[<>:"|?*]/g,'-'),_0x29d812[_0x2093e0(0x11e)]>0xff&&(_0x29d812=_0x29d812[_0x2093e0(0x124)](0x0,0xff)),_0x29d812;}export class ChecklyReporter{[a7_0x4caca5(0xe8)];[a7_0x4caca5(0x114)];[a7_0x4caca5(0x112)];['testResults'];[a7_0x4caca5(0x107)];['startTime'];['testCounts']={'passed':0x0,'failed':0x0,'flaky':0x0};constructor(_0x579924={}){const _0x5d2c2a=a7_0x4caca5,_0x55c625=getEnvironment(_0x579924),_0x4fcdf4=getApiUrl(_0x55c625),_0x4dfa7d=process['env'][_0x5d2c2a(0x10d)]||_0x579924[_0x5d2c2a(0x13c)],_0x3a1a30=process[_0x5d2c2a(0xf4)][_0x5d2c2a(0x13b)]||_0x579924[_0x5d2c2a(0xdb)];this[_0x5d2c2a(0xe8)]={'accountId':_0x3a1a30,'apiKey':_0x4dfa7d,'outputPath':_0x579924[_0x5d2c2a(0x132)]??_0x5d2c2a(0x134),'jsonReportPath':_0x579924[_0x5d2c2a(0xfd)]??_0x5d2c2a(0x123),'testResultsDir':_0x579924[_0x5d2c2a(0x120)]??_0x5d2c2a(0x110),'dryRun':_0x579924[_0x5d2c2a(0xfc)]??![]},this[_0x5d2c2a(0x114)]=new AssetCollector(this[_0x5d2c2a(0xe8)][_0x5d2c2a(0x120)]),this[_0x5d2c2a(0x112)]=new Zipper({'outputPath':this[_0x5d2c2a(0xe8)][_0x5d2c2a(0x132)]});if(!this[_0x5d2c2a(0xe8)][_0x5d2c2a(0xfc)]&&this[_0x5d2c2a(0xe8)][_0x5d2c2a(0x13c)]&&this[_0x5d2c2a(0xe8)][_0x5d2c2a(0xdb)]){const _0x4d96cf=new a7_0x310b0b({'apiKey':this[_0x5d2c2a(0xe8)][_0x5d2c2a(0x13c)],'accountId':this[_0x5d2c2a(0xe8)][_0x5d2c2a(0xdb)],'baseUrl':_0x4fcdf4});this['testResults']=new TestResults(_0x4d96cf[_0x5d2c2a(0xde)]());}}['onBegin'](_0x26ade8,_0x5b016d){const _0x4b89ad=a7_0x4caca5;this[_0x4b89ad(0x103)]=new Date();if(!this[_0x4b89ad(0xdf)])return;try{const _0x43acd4=getDirectoryName(),_0x5a729b=[{'name':_0x43acd4}],_0xe49b24=process[_0x4b89ad(0xf4)][_0x4b89ad(0xd2)]?_0x4b89ad(0xe5)+process['env'][_0x4b89ad(0xd2)]:undefined,_0xe2feee=_0xe49b24?{'repoUrl':_0xe49b24,'commitId':process[_0x4b89ad(0xf4)][_0x4b89ad(0xd8)],'branchName':process['env'][_0x4b89ad(0xe0)],'commitOwner':process[_0x4b89ad(0xf4)]['GITHUB_ACTOR'],'commitMessage':process['env'][_0x4b89ad(0x122)]}:undefined;this['testResults']['createTestSession']({'name':_0x4b89ad(0x10c)+_0x43acd4,'environment':process[_0x4b89ad(0xf4)][_0x4b89ad(0xe7)]||_0x4b89ad(0x118),'repoInfo':_0xe2feee,'startedAt':this[_0x4b89ad(0x103)]['getTime'](),'testResults':_0x5a729b,'provider':_0x4b89ad(0x102)})['then'](_0x1f2d8d=>{const _0x8780bd=_0x4b89ad;this[_0x8780bd(0x107)]=_0x1f2d8d;})['catch'](_0x412069=>{const _0x205466=_0x4b89ad;console[_0x205466(0xd6)](_0x205466(0x11b),_0x412069[_0x205466(0xe9)]);});}catch(_0x339b92){console[_0x4b89ad(0xd6)](_0x4b89ad(0x104),_0x339b92);}}[a7_0x4caca5(0xf7)](_0x585144,_0x5ad52d){const _0x4cd974=a7_0x4caca5;try{const _0x315b25=_0x585144[_0x4cd974(0xdd)](),_0x55d1fa=_0x5ad52d[_0x4cd974(0x127)]===_0x585144[_0x4cd974(0x108)]||_0x315b25!=='unexpected';if(!_0x55d1fa)return;const _0x1c1fbd=_0x315b25===_0x4cd974(0xd7);if(_0x1c1fbd)this[_0x4cd974(0xfb)]['flaky']++,this[_0x4cd974(0xfb)][_0x4cd974(0x130)]++;else{if(_0x5ad52d[_0x4cd974(0x125)]===_0x4cd974(0x130))this[_0x4cd974(0xfb)]['passed']++;else(_0x5ad52d[_0x4cd974(0x125)]==='failed'||_0x5ad52d[_0x4cd974(0x125)]===_0x4cd974(0x12c))&&this[_0x4cd974(0xfb)]['failed']++;}}catch(_0x31f5dc){console[_0x4cd974(0xd6)](_0x4cd974(0xf2),_0x31f5dc);}}async[a7_0x4caca5(0x115)](){const _0x32c7ca=a7_0x4caca5;try{const _0x51d2c1=this[_0x32c7ca(0xe8)]['jsonReportPath'];if(!a7_0x1b685b[_0x32c7ca(0x12f)](_0x51d2c1)){console[_0x32c7ca(0xd6)](_0x32c7ca(0x12d)+_0x51d2c1),console[_0x32c7ca(0xd6)](_0x32c7ca(0xdc)),console[_0x32c7ca(0xd6)](_0x32c7ca(0x133)+_0x32c7ca(0xeb)+_0x32c7ca(0x106)+_0x32c7ca(0x126));return;}const _0x1616f2=a7_0x1b685b[_0x32c7ca(0xe6)](_0x51d2c1,'utf-8'),_0x45b079=JSON[_0x32c7ca(0xe2)](_0x1616f2),_0x59165e=await this[_0x32c7ca(0x114)][_0x32c7ca(0x10a)](_0x45b079),_0x4d3301=await this[_0x32c7ca(0x112)]['createZip'](_0x51d2c1,_0x59165e);if(this[_0x32c7ca(0xdf)]&&this[_0x32c7ca(0x107)]){await this[_0x32c7ca(0x11c)](_0x45b079,_0x4d3301[_0x32c7ca(0x121)],_0x4d3301['entries']);if(!this[_0x32c7ca(0xe8)][_0x32c7ca(0xfc)])try{a7_0x1b685b[_0x32c7ca(0xfe)](_0x4d3301[_0x32c7ca(0x121)]);}catch(_0x2a0242){console[_0x32c7ca(0x116)]('[Checkly\x20Reporter]\x20Warning:\x20Could\x20not\x20delete\x20ZIP\x20file:\x20'+_0x2a0242);}}this['testResults']&&this['testSession']?.[_0x32c7ca(0xd4)]&&this[_0x32c7ca(0x12b)](_0x45b079,this['testSession']);}catch(_0x3fa22f){console[_0x32c7ca(0xd6)]('[Checkly\x20Reporter]\x20ERROR\x20creating\x20report:',_0x3fa22f);}}[a7_0x4caca5(0x12b)](_0x449979,_0x1ac191){const _0x189bdd=a7_0x4caca5,_0x21e4e9=pluralRules[_0x189bdd(0xe3)](_0x449979[_0x189bdd(0xef)][_0x189bdd(0x10e)][_0x189bdd(0x11e)]);console[_0x189bdd(0x129)](_0x189bdd(0x13d)),console[_0x189bdd(0x129)](_0x189bdd(0x13a)+pkgVersion),console[_0x189bdd(0x129)](_0x189bdd(0x13e)+_0x449979[_0x189bdd(0xef)][_0x189bdd(0xcc)]),console[_0x189bdd(0x129)](_0x189bdd(0xee)+projectForms[_0x21e4e9]+':\x20'+_0x449979[_0x189bdd(0xef)]['projects']['map'](({name:_0x5ae52e})=>_0x5ae52e)[_0x189bdd(0xce)](',')),console['log'](_0x189bdd(0xf8)+_0x1ac191[_0x189bdd(0xd4)]),console[_0x189bdd(0x129)](_0x189bdd(0xfa));}async['uploadResults'](_0x250bf4,_0x3ddd37,_0x28ed6c){const _0x1b714b=a7_0x4caca5;if(!this['testResults']||!this[_0x1b714b(0x107)])return;try{const {failed:_0x13b0ba,flaky:_0x71f53c}=this[_0x1b714b(0xfb)],_0x42a4d8=_0x13b0ba>0x0?_0x1b714b(0x138):_0x1b714b(0xf0),_0x1a0fde=_0x13b0ba===0x0&&_0x71f53c>0x0,_0x1cb4a7=new Date(),_0x2f82cf=this[_0x1b714b(0x103)]?Math[_0x1b714b(0x109)](0x0,_0x1cb4a7['getTime']()-this[_0x1b714b(0x103)][_0x1b714b(0xd0)]()):0x0,_0x1133a2=(await a7_0x1b685b[_0x1b714b(0xea)][_0x1b714b(0x10f)](_0x3ddd37))[_0x1b714b(0x11a)];if(this[_0x1b714b(0x107)][_0x1b714b(0xdf)][_0x1b714b(0x11e)]>0x0){const _0x259922=this[_0x1b714b(0x107)][_0x1b714b(0xdf)][0x0];let _0x53f836;if(_0x1133a2>0x0)try{const _0x40d3b3=a7_0x1b685b[_0x1b714b(0xd5)](_0x3ddd37),_0xa815d7=await this['testResults'][_0x1b714b(0x137)](this['testSession'][_0x1b714b(0xf1)],_0x259922[_0x1b714b(0xd1)],_0x40d3b3);_0x53f836=_0xa815d7['assetId'];}catch(_0x1fbf7e){const _0x338b34=_0x1fbf7e instanceof Error?_0x1fbf7e[_0x1b714b(0xe9)]:String(_0x1fbf7e);console[_0x1b714b(0xd6)]('[Checkly\x20Reporter]\x20Asset\x20upload\x20failed:',_0x338b34);}await this[_0x1b714b(0xdf)][_0x1b714b(0xe4)](this[_0x1b714b(0x107)]['testSessionId'],_0x259922[_0x1b714b(0xd1)],{'status':_0x42a4d8,'assetEntries':_0x53f836?_0x28ed6c:undefined,'isDegraded':_0x1a0fde,'startedAt':this[_0x1b714b(0x103)]?.[_0x1b714b(0x139)](),'stoppedAt':_0x1cb4a7[_0x1b714b(0x139)](),'responseTime':_0x2f82cf,'metadata':{'usageData':{'s3PostTotalBytes':_0x1133a2}}});}}catch(_0x3a70ba){const _0x58e4b0=_0x3a70ba instanceof Error?_0x3a70ba[_0x1b714b(0xe9)]:String(_0x3a70ba);console[_0x1b714b(0xd6)]('[Checkly\x20Reporter]\x20Failed\x20to\x20upload\x20results:',_0x58e4b0);}}['onError'](_0x4e822b){const _0xd4d836=a7_0x4caca5;console[_0xd4d836(0xd6)]('[Checkly\x20Reporter]\x20Global\x20error:',_0x4e822b);}}
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export{};
package/dist/zipper.js DELETED
@@ -1 +0,0 @@
1
- function a9_0x5b22(_0x538716,_0x27f691){_0x538716=_0x538716-0x1c5;const _0xd9640a=a9_0xd964();let _0x5b22ce=_0xd9640a[_0x538716];return _0x5b22ce;}const a9_0x48733b=a9_0x5b22;(function(_0x2749c1,_0x5abcc2){const _0x44393b=a9_0x5b22,_0x567b1d=_0x2749c1();while(!![]){try{const _0x448026=parseInt(_0x44393b(0x1cf))/0x1+-parseInt(_0x44393b(0x1ea))/0x2*(parseInt(_0x44393b(0x1d2))/0x3)+-parseInt(_0x44393b(0x1da))/0x4*(parseInt(_0x44393b(0x1e1))/0x5)+-parseInt(_0x44393b(0x1f4))/0x6*(-parseInt(_0x44393b(0x1cc))/0x7)+parseInt(_0x44393b(0x1c7))/0x8*(parseInt(_0x44393b(0x1e8))/0x9)+parseInt(_0x44393b(0x1d7))/0xa+-parseInt(_0x44393b(0x1d6))/0xb;if(_0x448026===_0x5abcc2)break;else _0x567b1d['push'](_0x567b1d['shift']());}catch(_0x7c5b9d){_0x567b1d['push'](_0x567b1d['shift']());}}}(a9_0xd964,0x874ab));import*as a9_0x4c388a from'fs';function a9_0xd964(){const _0x2f1784=['4551RzxNRf','isArray','archivePath','outputPath','787743OCSOdb','188370VpREuP','transformJsonReport','close','4icKfTj','finalize','error','pointer','stringify','.json','__snapshots__/','3945165xIVbca','entry','substring','writeFileSync','file','Report\x20file\x20not\x20found:\x20','indexOf','953532ehWdmm','pipe','1370svBicX','-snapshots/','tmpdir','parse','Asset\x20file\x20not\x20found:\x20','path','attachments','__screenshots__/','forEach','createZip','1434pHyvvC','utf-8','test-results/','contents','_offsets','64OKFUId','string','transformAttachmentPaths','length','existsSync','22141VRXoBc','normalizeAttachmentPath','sourcePath','831568IzETjT','playwright-test-report-','object'];a9_0xd964=function(){return _0x2f1784;};return a9_0xd964();}import*as a9_0x4a6679 from'path';import*as a9_0x3c8511 from'os';import{ZipArchive}from'archiver';export class Zipper{[a9_0x48733b(0x1d5)];constructor(_0x6bbd3f){const _0x4cdaf8=a9_0x48733b;this[_0x4cdaf8(0x1d5)]=_0x6bbd3f[_0x4cdaf8(0x1d5)];}async[a9_0x48733b(0x1f3)](_0x12c746,_0x1105a0){const _0xda1e14=[];return new Promise((_0x132e99,_0x51d202)=>{const _0x3d349f=a9_0x5b22;try{const _0x2f0a16=a9_0x4c388a['createWriteStream'](this['outputPath']),_0x266bc5=new ZipArchive({'zlib':{'level':0x0}});_0x266bc5['on'](_0x3d349f(0x1e2),_0x40527b=>{const _0x3c50fc=_0x3d349f,_0x218119=_0x40527b['name']['replace'](/\\/g,'/'),_0x47fe96=_0x40527b[_0x3c50fc(0x1c6)]?.[_0x3c50fc(0x1c5)]??0x0,_0x2d95e1=_0x40527b['_offsets']?.[_0x3c50fc(0x1c5)]+(_0x40527b['csize']??0x0)-0x1;_0xda1e14['push']({'name':_0x218119,'start':_0x47fe96,'end':_0x2d95e1});}),_0x2f0a16['on'](_0x3d349f(0x1d9),()=>{const _0x4f3b63=_0x3d349f,_0x31691f=_0x266bc5[_0x4f3b63(0x1dd)]();_0x132e99({'zipPath':this[_0x4f3b63(0x1d5)],'size':_0x31691f,'entryCount':_0xda1e14[_0x4f3b63(0x1ca)],'entries':_0xda1e14});}),_0x266bc5['on'](_0x3d349f(0x1dc),_0xcf3dd6=>{_0x51d202(_0xcf3dd6);}),_0x2f0a16['on'](_0x3d349f(0x1dc),_0x1236a9=>{_0x51d202(_0x1236a9);}),_0x266bc5[_0x3d349f(0x1e9)](_0x2f0a16);if(!a9_0x4c388a['existsSync'](_0x12c746)){_0x51d202(new Error(_0x3d349f(0x1e6)+_0x12c746));return;}const _0xa945a1=this[_0x3d349f(0x1d8)](_0x12c746);_0x266bc5['file'](_0xa945a1,{'name':'output/playwright-test-report.json'});for(const _0x4e7d6b of _0x1105a0){if(!a9_0x4c388a[_0x3d349f(0x1cb)](_0x4e7d6b[_0x3d349f(0x1ce)])){_0x51d202(new Error(_0x3d349f(0x1ee)+_0x4e7d6b[_0x3d349f(0x1ce)]));return;}_0x266bc5[_0x3d349f(0x1e5)](_0x4e7d6b[_0x3d349f(0x1ce)],{'name':_0x4e7d6b[_0x3d349f(0x1d4)]});}_0x266bc5[_0x3d349f(0x1db)]();}catch(_0x1fee40){_0x51d202(_0x1fee40);}});}[a9_0x48733b(0x1d8)](_0x419375){const _0x55c609=a9_0x48733b,_0x26b876=a9_0x4c388a['readFileSync'](_0x419375,_0x55c609(0x1f5)),_0x2e939f=JSON[_0x55c609(0x1ed)](_0x26b876);this['transformAttachmentPaths'](_0x2e939f);const _0x7ecded=a9_0x4a6679['join'](a9_0x3c8511[_0x55c609(0x1ec)](),_0x55c609(0x1d0)+Date['now']()+_0x55c609(0x1df));return a9_0x4c388a[_0x55c609(0x1e4)](_0x7ecded,JSON[_0x55c609(0x1de)](_0x2e939f,null,0x2)),_0x7ecded;}[a9_0x48733b(0x1c9)](_0x3519c1){const _0x3e2eac=a9_0x48733b;if(typeof _0x3519c1!==_0x3e2eac(0x1d1)||_0x3519c1===null)return;if(Array['isArray'](_0x3519c1)){_0x3519c1[_0x3e2eac(0x1f2)](_0x210d81=>this[_0x3e2eac(0x1c9)](_0x210d81));return;}_0x3519c1['attachments']&&Array[_0x3e2eac(0x1d3)](_0x3519c1['attachments'])&&_0x3519c1[_0x3e2eac(0x1f0)]['forEach'](_0x11bdfe=>{const _0x29da6e=_0x3e2eac;_0x11bdfe[_0x29da6e(0x1ef)]&&typeof _0x11bdfe[_0x29da6e(0x1ef)]===_0x29da6e(0x1c8)&&(_0x11bdfe[_0x29da6e(0x1ef)]=this[_0x29da6e(0x1cd)](_0x11bdfe[_0x29da6e(0x1ef)]));}),Object['values'](_0x3519c1)[_0x3e2eac(0x1f2)](_0x357b85=>this['transformAttachmentPaths'](_0x357b85));}[a9_0x48733b(0x1cd)](_0x400a50){const _0x9fdd49=a9_0x48733b,_0x14cf48=_0x400a50['replace'](/\\/g,'/'),_0x483efa=_0x14cf48['indexOf'](_0x9fdd49(0x1f6));if(_0x483efa!==-0x1)return _0x14cf48[_0x9fdd49(0x1e3)](_0x483efa);const _0x5f5d6a=_0x14cf48['indexOf'](_0x9fdd49(0x1eb));if(_0x5f5d6a!==-0x1){const _0x4ef6b2=_0x14cf48[_0x9fdd49(0x1e3)](0x0,_0x5f5d6a),_0x5911c7=_0x4ef6b2['lastIndexOf']('/'),_0x7f7c4c=_0x5911c7!==-0x1?_0x5911c7+0x1:0x0;return _0x14cf48[_0x9fdd49(0x1e3)](_0x7f7c4c);}const _0x3e9582=[_0x9fdd49(0x1f1),_0x9fdd49(0x1e0),'screenshots/','snapshots/'];for(const _0x3665ee of _0x3e9582){const _0x46902a=_0x14cf48[_0x9fdd49(0x1e7)](_0x3665ee);if(_0x46902a!==-0x1)return _0x14cf48[_0x9fdd49(0x1e3)](_0x46902a);}return console['warn']('[Checkly\x20Reporter]\x20Could\x20not\x20normalize\x20attachment\x20path:\x20'+_0x400a50),_0x400a50;}}