@checkly/playwright-reporter 0.1.4 → 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(_0x517d01,_0x5ba935){var _0x5cb378=a6_0x42ff,_0x2aafa2=_0x517d01();while(!![]){try{var _0x3b5959=-parseInt(_0x5cb378(0x1b5))/0x1+-parseInt(_0x5cb378(0x1b3))/0x2+-parseInt(_0x5cb378(0x1b7))/0x3*(parseInt(_0x5cb378(0x1b8))/0x4)+parseInt(_0x5cb378(0x1b9))/0x5*(-parseInt(_0x5cb378(0x1b6))/0x6)+parseInt(_0x5cb378(0x1bb))/0x7*(-parseInt(_0x5cb378(0x1bc))/0x8)+-parseInt(_0x5cb378(0x1ba))/0x9+parseInt(_0x5cb378(0x1b4))/0xa;if(_0x3b5959===_0x5ba935)break;else _0x2aafa2['push'](_0x2aafa2['shift']());}catch(_0x46fd05){_0x2aafa2['push'](_0x2aafa2['shift']());}}}(a6_0x3948,0xbb2bd));export{ChecklyReporter}from'./reporter.js';function a6_0x3948(){var _0x13898b=['50774470JoIDKn','1069754lWbMDL','6RhxRih','9984ZQIwwx','52Itvcis','1714970LUnIMy','10399608ncFDIJ','21kJwkgW','3621808KxnMML','682184OvAUCG'];a6_0x3948=function(){return _0x13898b;};return a6_0x3948();}export{AssetCollector}from'./asset-collector.js';function a6_0x42ff(_0x39adbf,_0xb391b8){var _0x394835=a6_0x3948();return a6_0x42ff=function(_0x42ffd6,_0x559694){_0x42ffd6=_0x42ffd6-0x1b3;var _0x452101=_0x394835[_0x42ffd6];return _0x452101;},a6_0x42ff(_0x39adbf,_0xb391b8);}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.4",
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_0x384b(_0x378286,_0x5ed1a7){const _0x38ea3f=a0_0x38ea();return a0_0x384b=function(_0x384b91,_0x3f2658){_0x384b91=_0x384b91-0x193;let _0x106896=_0x38ea3f[_0x384b91];return _0x106896;},a0_0x384b(_0x378286,_0x5ed1a7);}const a0_0x4c5a26=a0_0x384b;function a0_0x38ea(){const _0x34e052=['.htm','.log','3832592KPLdct','image/jpeg','application/zip','.jpeg','includes','3TlvlNG','join','.svg','14261700BQnwYe','basename','determineAssetType','.avi','has','testResultsDir','.zip','8lAWhAf','video/x-msvideo','collectAssetsRecursive','video','collectAssets','shouldSkipFile','520HpApEj','isDirectory','relative','5138ntFHXT','getImageContentType','.html','.json','71586ufFRAt','.txt','.mov','trace','other','image/png','screenshot','video/webm','.webm','.gif','application/json','23083687cVRYol','resolve','.jpg','video/mp4','application/octet-stream','97025dNsuDX','name','attachment','.mp4','createAsset','image/gif','extname','getVideoContentType','9028467xMjwkl','.png','existsSync','readdirSync','138qsFovQ','push','text/html','text/plain','isFile'];a0_0x38ea=function(){return _0x34e052;};return a0_0x38ea();}(function(_0x2b8eba,_0x40856b){const _0x3f4c29=a0_0x384b,_0x107a42=_0x2b8eba();while(!![]){try{const _0x2ca200=-parseInt(_0x3f4c29(0x1b0))/0x1*(parseInt(_0x3f4c29(0x1b9))/0x2)+parseInt(_0x3f4c29(0x1a6))/0x3*(-parseInt(_0x3f4c29(0x1a1))/0x4)+-parseInt(_0x3f4c29(0x1cd))/0x5*(-parseInt(_0x3f4c29(0x19a))/0x6)+parseInt(_0x3f4c29(0x196))/0x7+parseInt(_0x3f4c29(0x1b6))/0x8*(-parseInt(_0x3f4c29(0x1bd))/0x9)+-parseInt(_0x3f4c29(0x1a9))/0xa+parseInt(_0x3f4c29(0x1c8))/0xb;if(_0x2ca200===_0x40856b)break;else _0x107a42['push'](_0x107a42['shift']());}catch(_0x3158fb){_0x107a42['push'](_0x107a42['shift']());}}}(a0_0x38ea,0xded5d));import*as a0_0x214fe5 from'fs';import*as a0_0x2c5356 from'path';export class AssetCollector{['testResultsDir'];constructor(_0x540630){this['testResultsDir']=_0x540630;}async[a0_0x4c5a26(0x1b4)](_0x4ba095){const _0x26e3a1=a0_0x4c5a26,_0x5c38b7=[],_0x5e9c73=new Set();if(!a0_0x214fe5[_0x26e3a1(0x198)](this['testResultsDir']))return _0x5c38b7;return await this[_0x26e3a1(0x1b2)](this[_0x26e3a1(0x1ae)],'',_0x5c38b7,_0x5e9c73),_0x5c38b7;}async['collectAssetsRecursive'](_0x25842c,_0x14bc12,_0x46657d,_0xee04cb){const _0x311597=a0_0x4c5a26;let _0x426e58;try{_0x426e58=a0_0x214fe5[_0x311597(0x199)](_0x25842c,{'withFileTypes':!![]});}catch{return;}const _0x2c21da=a0_0x2c5356[_0x311597(0x1aa)](a0_0x2c5356[_0x311597(0x1c9)](this[_0x311597(0x1ae)]));for(const _0x1f34ae of _0x426e58){const _0x482219=a0_0x2c5356['join'](_0x25842c,_0x1f34ae['name']),_0x43b732=a0_0x2c5356[_0x311597(0x1b8)](this[_0x311597(0x1ae)],_0x482219),_0x3750c6=a0_0x2c5356['join'](_0x2c21da,_0x43b732);if(this['shouldSkipFile'](_0x1f34ae[_0x311597(0x1ce)]))continue;if(_0x1f34ae[_0x311597(0x1b7)]())await this[_0x311597(0x1b2)](_0x482219,_0x3750c6,_0x46657d,_0xee04cb);else{if(_0x1f34ae[_0x311597(0x19e)]()){if(!_0xee04cb[_0x311597(0x1ad)](_0x482219)){const _0xc20c4b=this[_0x311597(0x1d1)](_0x482219,_0x3750c6);_0x46657d[_0x311597(0x19b)](_0xc20c4b),_0xee04cb['add'](_0x482219);}}}}}[a0_0x4c5a26(0x1b5)](_0x3c827f){const _0x37a76c=[/^\./,/\.tmp$/i,/~$/,/\.swp$/i,/\.lock$/i,/^playwright-test-report\.json$/i];return _0x37a76c['some'](_0x378699=>_0x378699['test'](_0x3c827f));}[a0_0x4c5a26(0x1d1)](_0x4fb38e,_0x1dcead){const _0x2fe0d3=a0_0x4c5a26,_0x455c84=a0_0x2c5356[_0x2fe0d3(0x194)](_0x4fb38e)['toLowerCase'](),{type:_0x4a9523,contentType:_0xdf692a}=this[_0x2fe0d3(0x1ab)](_0x455c84),_0x32c674=_0x1dcead['split'](a0_0x2c5356['sep'])[_0x2fe0d3(0x1a7)]('/');return{'sourcePath':_0x4fb38e,'archivePath':_0x32c674,'type':_0x4a9523,'contentType':_0xdf692a};}['determineAssetType'](_0x18ea93){const _0x5bb93d=a0_0x4c5a26;if([_0x5bb93d(0x197),_0x5bb93d(0x1ca),_0x5bb93d(0x1a4),_0x5bb93d(0x1c6),'.bmp',_0x5bb93d(0x1a8)][_0x5bb93d(0x1a5)](_0x18ea93))return{'type':_0x5bb93d(0x1c3),'contentType':this[_0x5bb93d(0x1ba)](_0x18ea93)};if([_0x5bb93d(0x1c5),_0x5bb93d(0x1d0),_0x5bb93d(0x1ac),_0x5bb93d(0x1bf)][_0x5bb93d(0x1a5)](_0x18ea93))return{'type':_0x5bb93d(0x1b3),'contentType':this[_0x5bb93d(0x195)](_0x18ea93)};if(_0x18ea93===_0x5bb93d(0x1af))return{'type':_0x5bb93d(0x1c0),'contentType':_0x5bb93d(0x1a3)};if(_0x18ea93===_0x5bb93d(0x1bb)||_0x18ea93===_0x5bb93d(0x19f))return{'type':_0x5bb93d(0x1cf),'contentType':_0x5bb93d(0x19c)};if(_0x18ea93===_0x5bb93d(0x1bc))return{'type':_0x5bb93d(0x1cf),'contentType':_0x5bb93d(0x1c7)};if(_0x18ea93===_0x5bb93d(0x1be)||_0x18ea93===_0x5bb93d(0x1a0))return{'type':'attachment','contentType':_0x5bb93d(0x19d)};return{'type':_0x5bb93d(0x1c1),'contentType':_0x5bb93d(0x1cc)};}[a0_0x4c5a26(0x1ba)](_0x4d6c64){const _0x1b524b=a0_0x4c5a26,_0xf1f35c={'.png':_0x1b524b(0x1c2),'.jpg':_0x1b524b(0x1a2),'.jpeg':_0x1b524b(0x1a2),'.gif':_0x1b524b(0x193),'.bmp':'image/bmp','.svg':'image/svg+xml'};return _0xf1f35c[_0x4d6c64]||_0x1b524b(0x1c2);}['getVideoContentType'](_0x11eb3d){const _0x33e994=a0_0x4c5a26,_0x34003e={'.webm':_0x33e994(0x1c4),'.mp4':_0x33e994(0x1cb),'.avi':_0x33e994(0x1b1),'.mov':'video/quicktime'};return _0x34003e[_0x11eb3d]||_0x33e994(0x1c4);}}
@@ -1 +0,0 @@
1
- var a1_0xf650f4=a1_0x5d8f;(function(_0x29ac56,_0x53d13a){var _0x27625c=a1_0x5d8f,_0x11e59e=_0x29ac56();while(!![]){try{var _0xb6cf92=parseInt(_0x27625c(0x169))/0x1*(-parseInt(_0x27625c(0x172))/0x2)+-parseInt(_0x27625c(0x178))/0x3+-parseInt(_0x27625c(0x179))/0x4+parseInt(_0x27625c(0x167))/0x5*(-parseInt(_0x27625c(0x17a))/0x6)+-parseInt(_0x27625c(0x16d))/0x7*(-parseInt(_0x27625c(0x168))/0x8)+parseInt(_0x27625c(0x162))/0x9*(parseInt(_0x27625c(0x164))/0xa)+parseInt(_0x27625c(0x163))/0xb*(parseInt(_0x27625c(0x16a))/0xc);if(_0xb6cf92===_0x53d13a)break;else _0x11e59e['push'](_0x11e59e['shift']());}catch(_0x3602b4){_0x11e59e['push'](_0x11e59e['shift']());}}}(a1_0x334a,0x299bf));import a1_0x6350e5 from'axios';import{handleErrorResponse}from'./errors.js';function getVersion(){var _0xc71fc1=a1_0x5d8f;return _0xc71fc1(0x175);}export function createRequestInterceptor(_0x3297a6,_0x23216f){return _0x148a45=>{var _0x3691fb=a1_0x5d8f;return _0x148a45[_0x3691fb(0x16c)]&&(_0x148a45[_0x3691fb(0x16c)]['Authorization']=_0x3691fb(0x174)+_0x3297a6,_0x148a45[_0x3691fb(0x16c)][_0x3691fb(0x16e)]=_0x23216f,_0x148a45[_0x3691fb(0x16c)][_0x3691fb(0x171)]='@checkly/playwright-reporter/'+getVersion()),_0x148a45;};}function a1_0x5d8f(_0x491118,_0x1d7f2c){var _0x334aef=a1_0x334a();return a1_0x5d8f=function(_0x5d8f65,_0x175ad4){_0x5d8f65=_0x5d8f65-0x162;var _0x15e7de=_0x334aef[_0x5d8f65];return _0x15e7de;},a1_0x5d8f(_0x491118,_0x1d7f2c);}function a1_0x334a(){var _0x436e1b=['1725399JQRRoo','64339EFbiLN','10ClfxwR','use','api','115HgTwac','9392QuiQwh','35SwVAGm','588bBERSx','create','headers','1043myzmiq','x-checkly-account','apiKey','accountId','User-Agent','1150xAcPzC','request','Bearer\x20','0.1.0','baseUrl','interceptors','559398RYhvxe','876888IezLvA','14868RlYIKj'];a1_0x334a=function(){return _0x436e1b;};return a1_0x334a();}export function createResponseErrorInterceptor(){return _0x311bf6=>{handleErrorResponse(_0x311bf6);};}export default class ChecklyClient{['apiKey'];[a1_0xf650f4(0x176)];['accountId'];[a1_0xf650f4(0x166)];constructor(_0x390075){var _0xede48b=a1_0xf650f4;this[_0xede48b(0x170)]=_0x390075[_0xede48b(0x170)],this[_0xede48b(0x16f)]=_0x390075['apiKey'],this[_0xede48b(0x176)]=_0x390075[_0xede48b(0x176)],this[_0xede48b(0x166)]=a1_0x6350e5[_0xede48b(0x16b)]({'baseURL':this[_0xede48b(0x176)],'timeout':0x1d4c0,'maxContentLength':Infinity,'maxBodyLength':Infinity}),this[_0xede48b(0x166)][_0xede48b(0x177)][_0xede48b(0x173)][_0xede48b(0x165)](createRequestInterceptor(this[_0xede48b(0x16f)],this['accountId'])),this[_0xede48b(0x166)][_0xede48b(0x177)]['response']['use'](_0x55c1a8=>_0x55c1a8,createResponseErrorInterceptor());}['getAxiosInstance'](){var _0x51d725=a1_0xf650f4;return this[_0x51d725(0x166)];}}
@@ -1 +0,0 @@
1
- const a2_0x35e760=a2_0x3ccf;(function(_0x310170,_0x56d8c7){const _0x2e3588=a2_0x3ccf,_0x5d9e91=_0x310170();while(!![]){try{const _0x2a09db=parseInt(_0x2e3588(0xbb))/0x1+parseInt(_0x2e3588(0xc2))/0x2+-parseInt(_0x2e3588(0xb0))/0x3*(parseInt(_0x2e3588(0xc0))/0x4)+-parseInt(_0x2e3588(0xb3))/0x5+parseInt(_0x2e3588(0xb9))/0x6+-parseInt(_0x2e3588(0xb4))/0x7+-parseInt(_0x2e3588(0xb7))/0x8*(-parseInt(_0x2e3588(0xb1))/0x9);if(_0x2a09db===_0x56d8c7)break;else _0x5d9e91['push'](_0x5d9e91['shift']());}catch(_0x33069b){_0x5d9e91['push'](_0x5d9e91['shift']());}}}(a2_0x2810,0x4b4ba));export class ApiError extends Error{[a2_0x35e760(0xb5)];constructor(_0x5b2121,_0x2a2721){const _0x470c0b=a2_0x35e760;super(_0x5b2121['message'],_0x2a2721),this[_0x470c0b(0xbd)]=this[_0x470c0b(0xb2)][_0x470c0b(0xbd)],this['data']=_0x5b2121;}}export class ValidationError extends ApiError{constructor(_0x2dfc3f,_0x52eb04){super(_0x2dfc3f,_0x52eb04);}}export class UnauthorizedError extends ApiError{constructor(_0x1a18c6,_0x1fd789){super(_0x1a18c6,_0x1fd789);}}export class ForbiddenError extends ApiError{constructor(_0x28a30e,_0x489e93){super(_0x28a30e,_0x489e93);}}export class NotFoundError extends ApiError{constructor(_0x3e9ce3,_0x5dd1a7){super(_0x3e9ce3,_0x5dd1a7);}}export class RequestTimeoutError extends ApiError{constructor(_0x26d1f7,_0x545a71){super(_0x26d1f7,_0x545a71);}}function a2_0x3ccf(_0x4482b8,_0x123399){const _0x28100f=a2_0x2810();return a2_0x3ccf=function(_0x3ccf83,_0x1e6d70){_0x3ccf83=_0x3ccf83-0xad;let _0x30cc7f=_0x28100f[_0x3ccf83];return _0x30cc7f;},a2_0x3ccf(_0x4482b8,_0x123399);}function a2_0x2810(){const _0x148053=['constructor','2600065yqRyJu','1594453eYmMqq','data','string','1240LHEqaZ','statusCode','3250092AaktrT','Unknown\x20error','601906gxmLWl','object','name','error','Network\x20error','908876cfWiQE','MissingResponseError','90256qggFOL','errorCode','response','message','3ZDBPDm','5499iPZpNX'];a2_0x2810=function(){return _0x148053;};return a2_0x2810();}export class ConflictError extends ApiError{constructor(_0xa208a2,_0x1d8c47){super(_0xa208a2,_0x1d8c47);}}export class ServerError extends ApiError{constructor(_0x33b04b,_0x11f226){super(_0x33b04b,_0x11f226);}}export class MiscellaneousError extends ApiError{constructor(_0x5c087f,_0x3e9bd1){super(_0x5c087f,_0x3e9bd1);}}export class MissingResponseError extends Error{constructor(_0x4bee08,_0x34fc1f){const _0x3ee4de=a2_0x35e760;super(_0x4bee08,_0x34fc1f),this[_0x3ee4de(0xbd)]=_0x3ee4de(0xc1);}}export function parseErrorData(_0x48630c,_0x24fc0f){const _0x5806f4=a2_0x35e760;if(!_0x48630c)return undefined;if(typeof _0x48630c==='object'&&_0x48630c[_0x5806f4(0xb8)]&&_0x48630c[_0x5806f4(0xbe)]&&_0x48630c['message'])return{'statusCode':_0x48630c[_0x5806f4(0xb8)],'error':_0x48630c[_0x5806f4(0xbe)],'message':_0x48630c[_0x5806f4(0xaf)],'errorCode':_0x48630c['errorCode']};if(typeof _0x48630c===_0x5806f4(0xbc)&&_0x48630c[_0x5806f4(0xbe)]&&!_0x48630c['message'])return{'statusCode':_0x24fc0f['statusCode'],'error':_0x48630c[_0x5806f4(0xbe)],'message':_0x48630c[_0x5806f4(0xbe)]};if(typeof _0x48630c==='object'&&_0x48630c['error']&&_0x48630c['message'])return{'statusCode':_0x24fc0f[_0x5806f4(0xb8)],'error':_0x48630c[_0x5806f4(0xbe)],'message':_0x48630c['message'],'errorCode':_0x48630c[_0x5806f4(0xad)]};if(typeof _0x48630c===_0x5806f4(0xbc)&&_0x48630c[_0x5806f4(0xaf)])return{'statusCode':_0x24fc0f[_0x5806f4(0xb8)],'error':_0x48630c[_0x5806f4(0xaf)],'message':_0x48630c[_0x5806f4(0xaf)],'errorCode':_0x48630c[_0x5806f4(0xad)]};if(typeof _0x48630c===_0x5806f4(0xb6))return{'statusCode':_0x24fc0f['statusCode'],'error':_0x48630c,'message':_0x48630c};return undefined;}export function handleErrorResponse(_0x563603){const _0x175cbf=a2_0x35e760;if(!_0x563603[_0x175cbf(0xae)])throw new MissingResponseError(_0x563603[_0x175cbf(0xaf)]||_0x175cbf(0xbf));const {status:_0x52ebae,data:_0x15c3ac}=_0x563603['response'],_0x56b613=parseErrorData(_0x15c3ac,{'statusCode':_0x52ebae});if(!_0x56b613)throw new MiscellaneousError({'statusCode':_0x52ebae,'error':_0x175cbf(0xba),'message':_0x563603[_0x175cbf(0xaf)]||'An\x20error\x20occurred'});switch(_0x52ebae){case 0x190:throw new ValidationError(_0x56b613);case 0x191:throw new UnauthorizedError(_0x56b613);case 0x193:throw new ForbiddenError(_0x56b613);case 0x194:throw new NotFoundError(_0x56b613);case 0x198:throw new RequestTimeoutError(_0x56b613);case 0x199:throw new ConflictError(_0x56b613);default:if(_0x52ebae>=0x1f4)throw new ServerError(_0x56b613);throw new MiscellaneousError(_0x56b613);}}
@@ -1 +0,0 @@
1
- (function(_0x299063,_0x4770f8){var _0x3fe5b6=a3_0x408d,_0x5e806f=_0x299063();while(!![]){try{var _0x57e8d3=-parseInt(_0x3fe5b6(0x10e))/0x1+-parseInt(_0x3fe5b6(0x111))/0x2+parseInt(_0x3fe5b6(0x110))/0x3+-parseInt(_0x3fe5b6(0x10f))/0x4*(parseInt(_0x3fe5b6(0x112))/0x5)+parseInt(_0x3fe5b6(0x113))/0x6*(-parseInt(_0x3fe5b6(0x116))/0x7)+-parseInt(_0x3fe5b6(0x114))/0x8+parseInt(_0x3fe5b6(0x115))/0x9;if(_0x57e8d3===_0x4770f8)break;else _0x5e806f['push'](_0x5e806f['shift']());}catch(_0x1f42a6){_0x5e806f['push'](_0x5e806f['shift']());}}}(a3_0x27b3,0xa7083));export{default as ChecklyClient}from'./checkly-client.js';export{TestResults}from'./test-results.js';export*from'./types.js';export*from'./errors.js';function a3_0x408d(_0x3fa733,_0x34b2da){var _0x27b3fd=a3_0x27b3();return a3_0x408d=function(_0x408d92,_0x221b57){_0x408d92=_0x408d92-0x10e;var _0x3de2f3=_0x27b3fd[_0x408d92];return _0x3de2f3;},a3_0x408d(_0x3fa733,_0x34b2da);}function a3_0x27b3(){var _0x42e58c=['8772160cTllhg','17332218owwnHs','30079IDMRFC','994215LtTHfU','1391024mYrsfE','4058970FlbNbS','148990OgXAAa','5QIwYur','114ZKfowf'];a3_0x27b3=function(){return _0x42e58c;};return a3_0x27b3();}
@@ -1 +0,0 @@
1
- const a4_0x1375db=a4_0x3311;function a4_0x3311(_0x1fc5d2,_0x229435){const _0x175dde=a4_0x175d();return a4_0x3311=function(_0x33118f,_0x39968f){_0x33118f=_0x33118f-0x1d0;let _0xebbe55=_0x175dde[_0x33118f];return _0xebbe55;},a4_0x3311(_0x1fc5d2,_0x229435);}(function(_0x4c83f5,_0x55cff3){const _0x328f21=a4_0x3311,_0x405ecf=_0x4c83f5();while(!![]){try{const _0x242b59=-parseInt(_0x328f21(0x1d6))/0x1+parseInt(_0x328f21(0x1e3))/0x2+-parseInt(_0x328f21(0x1df))/0x3*(-parseInt(_0x328f21(0x1d4))/0x4)+parseInt(_0x328f21(0x1e2))/0x5*(-parseInt(_0x328f21(0x1dc))/0x6)+-parseInt(_0x328f21(0x1d0))/0x7+-parseInt(_0x328f21(0x1d8))/0x8+parseInt(_0x328f21(0x1e5))/0x9;if(_0x242b59===_0x55cff3)break;else _0x405ecf['push'](_0x405ecf['shift']());}catch(_0x5d5ea2){_0x405ecf['push'](_0x405ecf['shift']());}}}(a4_0x175d,0x6345c));import a4_0x44ffb5 from'form-data';function a4_0x175d(){const _0x4fdb6e=['data','954BzHnmT','/assets','uploadTestResultAsset','72FqVDqp','createTestSession','post','20645HPOzlN','491582xhzsYz','/next/test-sessions/create','21901383mDnisj','updateTestResult','5336198ovsNtG','/next/test-sessions/','api','append','19356jBHQop','getHeaders','414401jOysAF','assets','4444544ydsBIY','application/zip','/results/'];a4_0x175d=function(){return _0x4fdb6e;};return a4_0x175d();}export class TestResults{[a4_0x1375db(0x1d2)];constructor(_0x3c44f7){const _0x31e419=a4_0x1375db;this[_0x31e419(0x1d2)]=_0x3c44f7;}async[a4_0x1375db(0x1e0)](_0xfa8ac3){const _0x242ea1=a4_0x1375db,_0x1cd753=await this[_0x242ea1(0x1d2)][_0x242ea1(0x1e1)](_0x242ea1(0x1e4),_0xfa8ac3);return _0x1cd753[_0x242ea1(0x1db)];}async[a4_0x1375db(0x1de)](_0x58641d,_0xdaa7e0,_0xc3bd40){const _0x2f25eb=a4_0x1375db,_0x436890=new a4_0x44ffb5();_0x436890[_0x2f25eb(0x1d3)](_0x2f25eb(0x1d7),_0xc3bd40,{'filename':'assets.zip','contentType':_0x2f25eb(0x1d9)});const _0x3f0446=await this[_0x2f25eb(0x1d2)]['post']('/next/test-sessions/'+_0x58641d+_0x2f25eb(0x1da)+_0xdaa7e0+_0x2f25eb(0x1dd),_0x436890,{'headers':{..._0x436890[_0x2f25eb(0x1d5)]()}});return _0x3f0446[_0x2f25eb(0x1db)];}async[a4_0x1375db(0x1e6)](_0xd513d6,_0x2f35e4,_0x304579){const _0x43a4de=a4_0x1375db,_0x5674a3=await this[_0x43a4de(0x1d2)]['post'](_0x43a4de(0x1d1)+_0xd513d6+_0x43a4de(0x1da)+_0x2f35e4,_0x304579);return _0x5674a3[_0x43a4de(0x1db)];}}
@@ -1 +0,0 @@
1
- export{};
package/dist/reporter.js DELETED
@@ -1 +0,0 @@
1
- const a7_0x3d9455=a7_0x34c7;(function(_0x4fd62d,_0x72ce1b){const _0x5411f8=a7_0x34c7,_0x4d3ae2=_0x4fd62d();while(!![]){try{const _0x375cfb=parseInt(_0x5411f8(0x1f4))/0x1+-parseInt(_0x5411f8(0x200))/0x2*(-parseInt(_0x5411f8(0x214))/0x3)+-parseInt(_0x5411f8(0x1f8))/0x4*(-parseInt(_0x5411f8(0x1ab))/0x5)+parseInt(_0x5411f8(0x1e8))/0x6*(-parseInt(_0x5411f8(0x1aa))/0x7)+parseInt(_0x5411f8(0x1b7))/0x8*(-parseInt(_0x5411f8(0x1c0))/0x9)+parseInt(_0x5411f8(0x1e9))/0xa*(parseInt(_0x5411f8(0x1f3))/0xb)+-parseInt(_0x5411f8(0x1df))/0xc*(parseInt(_0x5411f8(0x1b1))/0xd);if(_0x375cfb===_0x72ce1b)break;else _0x4d3ae2['push'](_0x4d3ae2['shift']());}catch(_0x1b1363){_0x4d3ae2['push'](_0x4d3ae2['shift']());}}}(a7_0x2637,0x7873d));import*as a7_0x39e285 from'fs';import*as a7_0x4066ea from'path';import{AssetCollector}from'./asset-collector.js';function a7_0x34c7(_0x47d2e7,_0x3f8f27){const _0x263760=a7_0x2637();return a7_0x34c7=function(_0x34c76d,_0x19c94e){_0x34c76d=_0x34c76d-0x1a9;let _0x6f2e8e=_0x263760[_0x34c76d];return _0x6f2e8e;},a7_0x34c7(_0x47d2e7,_0x3f8f27);}import{Zipper}from'./zipper.js';import a7_0x51fdd9 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';function a7_0x2637(){const _0x27d31e=['updateTestResult','169527pkEnwz','testResultsDir','21lQxmCW','371155jUbJXP','outcome','\x22,\x20using\x20\x22production\x22','options','\x20\x20\x20\x20[\x27@checkly/playwright-reporter\x27]\x0a','development','26BQiTpX','zipPath','staging','Project','\x0a======================================================\x0a','testResults','8dmrwCV','Playwright\x20Test\x20Session:\x20','env','\x20\x20\x20\x20[\x27json\x27,\x20{\x20outputFile:\x20\x27test-results/playwright-test-report.json\x27\x20}],\x0a','https://api.checklyhq.com','testResultId','dryRun','testCounts','test-results/playwright-test-report.json','1158093ImpQFn','production','test','join','[Checkly\x20Reporter]\x20Failed\x20to\x20create\x20test\x20session:','uploadTestResultAsset','log','version','passed','parse','readFileSync','startTime','PASSED','cwd','length','FAILED','CHECKLY_ACCOUNT_ID','stat','package.json','warn','jsonReportPath','🦝\x20Checkly\x20reporter:\x20','📔\x20','\x20\x20reporter:\x20[\x0a','GITHUB_EVENT_NAME','flaky','zipper','CHECKLY_ENV','then','GITHUB_ACTOR','createReadStream','1661388eAQbhi','config','onBegin','checkly-report.zip','[Checkly\x20Reporter]\x20Invalid\x20environment\x20\x22','[Checkly\x20Reporter]\x20Warning:\x20Could\x20not\x20delete\x20ZIP\x20file:\x20','status','outputPath','\x20\x20]','618222syVlUG','447540MtuxFp','includes','link','[Checkly\x20Reporter]\x20Global\x20error:','printSummary','test-results','failed','substring','max','testSession','55GAlZsj','288459lTyvuJ','apiKey','assetId','accountId','4HKFUrK','Projects','https://api-dev.checklyhq.com','utf-8','onEnd','retries','[Checkly\x20Reporter]\x20Error\x20in\x20onTestEnd:','message','22KdhOgC','testSessionId','environment','GITHUB_SHA','uploadResults','CHECKLY_API_KEY','error','[Checkly\x20Reporter]\x20Asset\x20upload\x20failed:','toISOString','onTestEnd','projects','en-US','getTime','unlinkSync','[Checkly\x20Reporter]\x20ERROR:\x20JSON\x20report\x20not\x20found\x20at:\x20','GITHUB_REPOSITORY','onError','retry','PW_REPORTER'];a7_0x2637=function(){return _0x27d31e;};return a7_0x2637();}const __filename=fileURLToPath(import.meta['url']),__dirname=dirname(__filename),packageJson=JSON[a7_0x3d9455(0x1c9)](readFileSync(join(__dirname,'..',a7_0x3d9455(0x1d2)),a7_0x3d9455(0x1fb))),pkgVersion=packageJson[a7_0x3d9455(0x1c7)],pluralRules=new Intl['PluralRules'](a7_0x3d9455(0x20b)),projectForms={'zero':'Project','one':a7_0x3d9455(0x1b4),'two':a7_0x3d9455(0x1f9),'few':'Projects','many':a7_0x3d9455(0x1f9),'other':a7_0x3d9455(0x1f9)};function getApiUrl(_0x45db26){const _0x2b5d50=a7_0x3d9455,_0x1a5e1d={'local':'http://127.0.0.1:3000','development':_0x2b5d50(0x1fa),'staging':'https://api-test.checklyhq.com','production':_0x2b5d50(0x1bb)};return _0x1a5e1d[_0x45db26];}function getEnvironment(_0x33cdf2){const _0x229e68=a7_0x3d9455,_0x33dc90=_0x33cdf2?.[_0x229e68(0x202)],_0x4c5178=process[_0x229e68(0x1b9)][_0x229e68(0x1db)],_0x7dbeca=_0x33dc90||_0x4c5178||'production',_0x520974=['local',_0x229e68(0x1b0),_0x229e68(0x1b3),_0x229e68(0x1c1)];if(!_0x520974[_0x229e68(0x1ea)](_0x7dbeca))return console[_0x229e68(0x1d3)](_0x229e68(0x1e3)+_0x7dbeca+_0x229e68(0x1ad)),_0x229e68(0x1c1);return _0x7dbeca;}function getDirectoryName(){const _0x3adcea=a7_0x3d9455,_0x298af5=process[_0x3adcea(0x1cd)]();let _0x57305f=a7_0x4066ea['basename'](_0x298af5);return(!_0x57305f||_0x57305f==='/'||_0x57305f==='.')&&(_0x57305f='playwright-tests'),_0x57305f=_0x57305f['replace'](/[<>:"|?*]/g,'-'),_0x57305f[_0x3adcea(0x1ce)]>0xff&&(_0x57305f=_0x57305f[_0x3adcea(0x1f0)](0x0,0xff)),_0x57305f;}export class ChecklyReporter{[a7_0x3d9455(0x1ae)];['assetCollector'];[a7_0x3d9455(0x1da)];[a7_0x3d9455(0x1b6)];[a7_0x3d9455(0x1f2)];[a7_0x3d9455(0x1cb)];[a7_0x3d9455(0x1be)]={'passed':0x0,'failed':0x0,'flaky':0x0};constructor(_0x29a42e={}){const _0x14edc5=a7_0x3d9455,_0x14141a=getEnvironment(_0x29a42e),_0x3b450f=getApiUrl(_0x14141a),_0x2b490d=process['env'][_0x14edc5(0x205)]||_0x29a42e[_0x14edc5(0x1f5)],_0x4f4cb2=process[_0x14edc5(0x1b9)][_0x14edc5(0x1d0)]||_0x29a42e['accountId'];this[_0x14edc5(0x1ae)]={'accountId':_0x4f4cb2,'apiKey':_0x2b490d,'outputPath':_0x29a42e[_0x14edc5(0x1e6)]??_0x14edc5(0x1e2),'jsonReportPath':_0x29a42e['jsonReportPath']??_0x14edc5(0x1bf),'testResultsDir':_0x29a42e[_0x14edc5(0x1a9)]??_0x14edc5(0x1ee),'dryRun':_0x29a42e[_0x14edc5(0x1bd)]??![]},this['assetCollector']=new AssetCollector(this['options'][_0x14edc5(0x1a9)]),this[_0x14edc5(0x1da)]=new Zipper({'outputPath':this[_0x14edc5(0x1ae)]['outputPath']});if(!this[_0x14edc5(0x1ae)][_0x14edc5(0x1bd)]&&this[_0x14edc5(0x1ae)][_0x14edc5(0x1f5)]&&this[_0x14edc5(0x1ae)][_0x14edc5(0x1f7)]){const _0x46caf5=new a7_0x51fdd9({'apiKey':this[_0x14edc5(0x1ae)][_0x14edc5(0x1f5)],'accountId':this[_0x14edc5(0x1ae)][_0x14edc5(0x1f7)],'baseUrl':_0x3b450f});this[_0x14edc5(0x1b6)]=new TestResults(_0x46caf5['getAxiosInstance']());}}[a7_0x3d9455(0x1e1)](_0x5cbf9a,_0x5b964d){const _0xffbb8f=a7_0x3d9455;this[_0xffbb8f(0x1cb)]=new Date();if(!this['testResults'])return;try{const _0x49f7a3=getDirectoryName(),_0x20602f=[{'name':_0x49f7a3}],_0x307ab8=process[_0xffbb8f(0x1b9)][_0xffbb8f(0x20f)]?'https://github.com/'+process[_0xffbb8f(0x1b9)][_0xffbb8f(0x20f)]:undefined,_0x19035c=_0x307ab8?{'repoUrl':_0x307ab8,'commitId':process[_0xffbb8f(0x1b9)][_0xffbb8f(0x203)],'branchName':process[_0xffbb8f(0x1b9)]['GITHUB_REF_NAME'],'commitOwner':process[_0xffbb8f(0x1b9)][_0xffbb8f(0x1dd)],'commitMessage':process[_0xffbb8f(0x1b9)][_0xffbb8f(0x1d8)]}:undefined;this['testResults']['createTestSession']({'name':_0xffbb8f(0x1b8)+_0x49f7a3,'environment':process['env']['NODE_ENV']||_0xffbb8f(0x1c2),'repoInfo':_0x19035c,'startedAt':this[_0xffbb8f(0x1cb)][_0xffbb8f(0x20c)](),'testResults':_0x20602f,'provider':_0xffbb8f(0x212)})[_0xffbb8f(0x1dc)](_0x3d61a6=>{const _0x32a2ca=_0xffbb8f;this[_0x32a2ca(0x1f2)]=_0x3d61a6;})['catch'](_0x2918d3=>{const _0x56601e=_0xffbb8f;console[_0x56601e(0x206)](_0x56601e(0x1c4),_0x2918d3['message']);});}catch(_0x331382){console[_0xffbb8f(0x206)]('[Checkly\x20Reporter]\x20Error\x20in\x20onBegin:',_0x331382);}}[a7_0x3d9455(0x209)](_0x4b0fbe,_0x125684){const _0x10da5d=a7_0x3d9455;try{const _0x3de55a=_0x125684[_0x10da5d(0x1e5)]===_0x10da5d(0x1c8)||_0x125684[_0x10da5d(0x211)]===_0x4b0fbe[_0x10da5d(0x1fd)];if(!_0x3de55a)return;const _0xf2d7ac=_0x4b0fbe[_0x10da5d(0x1ac)]()==='flaky';if(_0xf2d7ac)this[_0x10da5d(0x1be)][_0x10da5d(0x1d9)]++,this[_0x10da5d(0x1be)][_0x10da5d(0x1c8)]++;else{if(_0x125684[_0x10da5d(0x1e5)]===_0x10da5d(0x1c8))this['testCounts'][_0x10da5d(0x1c8)]++;else _0x125684[_0x10da5d(0x1e5)]===_0x10da5d(0x1ef)&&this[_0x10da5d(0x1be)][_0x10da5d(0x1ef)]++;}}catch(_0x377454){console['error'](_0x10da5d(0x1fe),_0x377454);}}async[a7_0x3d9455(0x1fc)](){const _0x2a81ea=a7_0x3d9455;try{const _0x32dad2=this[_0x2a81ea(0x1ae)][_0x2a81ea(0x1d4)];if(!a7_0x39e285['existsSync'](_0x32dad2)){console[_0x2a81ea(0x206)](_0x2a81ea(0x20e)+_0x32dad2),console[_0x2a81ea(0x206)]('[Checkly\x20Reporter]\x20Make\x20sure\x20to\x20configure\x20the\x20json\x20reporter\x20before\x20the\x20checkly\x20reporter:'),console['error'](_0x2a81ea(0x1d7)+_0x2a81ea(0x1ba)+_0x2a81ea(0x1af)+_0x2a81ea(0x1e7));return;}const _0x19222c=a7_0x39e285[_0x2a81ea(0x1ca)](_0x32dad2,'utf-8'),_0x141d44=JSON['parse'](_0x19222c),_0x17b24c=await this['assetCollector']['collectAssets'](_0x141d44),_0x288251=await this[_0x2a81ea(0x1da)]['createZip'](_0x32dad2,_0x17b24c);if(this[_0x2a81ea(0x1b6)]&&this[_0x2a81ea(0x1f2)]){await this[_0x2a81ea(0x204)](_0x141d44,_0x288251[_0x2a81ea(0x1b2)],_0x288251['entries']);if(!this[_0x2a81ea(0x1ae)][_0x2a81ea(0x1bd)])try{a7_0x39e285[_0x2a81ea(0x20d)](_0x288251[_0x2a81ea(0x1b2)]);}catch(_0x3032e8){console[_0x2a81ea(0x1d3)](_0x2a81ea(0x1e4)+_0x3032e8);}}this['testResults']&&this[_0x2a81ea(0x1f2)]?.[_0x2a81ea(0x1eb)]&&this[_0x2a81ea(0x1ed)](_0x141d44,this[_0x2a81ea(0x1f2)]);}catch(_0x34b3fe){console[_0x2a81ea(0x206)]('[Checkly\x20Reporter]\x20ERROR\x20creating\x20report:',_0x34b3fe);}}[a7_0x3d9455(0x1ed)](_0x5f05be,_0x4326b9){const _0x4059d4=a7_0x3d9455,_0x9c1507=pluralRules['select'](_0x5f05be['config'][_0x4059d4(0x20a)][_0x4059d4(0x1ce)]);console['log'](_0x4059d4(0x1b5)),console[_0x4059d4(0x1c6)](_0x4059d4(0x1d5)+pkgVersion),console['log']('🎭\x20Playwright:\x20'+_0x5f05be[_0x4059d4(0x1e0)][_0x4059d4(0x1c7)]),console[_0x4059d4(0x1c6)](_0x4059d4(0x1d6)+projectForms[_0x9c1507]+':\x20'+_0x5f05be[_0x4059d4(0x1e0)][_0x4059d4(0x20a)]['map'](({name:_0x7b2b3})=>_0x7b2b3)[_0x4059d4(0x1c3)](',')),console[_0x4059d4(0x1c6)]('🔗\x20Test\x20session\x20URL:\x20'+_0x4326b9[_0x4059d4(0x1eb)]),console[_0x4059d4(0x1c6)]('\x0a======================================================');}async[a7_0x3d9455(0x204)](_0x589e1b,_0x4276d1,_0x3e79d1){const _0x408106=a7_0x3d9455;if(!this['testResults']||!this[_0x408106(0x1f2)])return;try{const {failed:_0x3be0c2,flaky:_0x18951f}=this[_0x408106(0x1be)],_0x97f312=_0x3be0c2>0x0?_0x408106(0x1cf):_0x408106(0x1cc),_0x2907c6=_0x3be0c2===0x0&&_0x18951f>0x0,_0x33c78e=new Date(),_0x346a08=this[_0x408106(0x1cb)]?Math[_0x408106(0x1f1)](0x0,_0x33c78e[_0x408106(0x20c)]()-this[_0x408106(0x1cb)][_0x408106(0x20c)]()):0x0,_0x586ac7=(await a7_0x39e285['promises'][_0x408106(0x1d1)](_0x4276d1))['size'];if(this[_0x408106(0x1f2)]['testResults'][_0x408106(0x1ce)]>0x0){const _0x40dc28=this[_0x408106(0x1f2)][_0x408106(0x1b6)][0x0];let _0x3d966b;if(_0x586ac7>0x0)try{const _0x33f37e=a7_0x39e285[_0x408106(0x1de)](_0x4276d1),_0x34e6bd=await this['testResults'][_0x408106(0x1c5)](this['testSession'][_0x408106(0x201)],_0x40dc28[_0x408106(0x1bc)],_0x33f37e);_0x3d966b=_0x34e6bd[_0x408106(0x1f6)];}catch(_0x30d1cd){const _0x3dd9c1=_0x30d1cd instanceof Error?_0x30d1cd[_0x408106(0x1ff)]:String(_0x30d1cd);console['error'](_0x408106(0x207),_0x3dd9c1);}await this[_0x408106(0x1b6)][_0x408106(0x213)](this[_0x408106(0x1f2)][_0x408106(0x201)],_0x40dc28[_0x408106(0x1bc)],{'status':_0x97f312,'assetEntries':_0x3d966b?_0x3e79d1:undefined,'isDegraded':_0x2907c6,'startedAt':this[_0x408106(0x1cb)]?.[_0x408106(0x208)](),'stoppedAt':_0x33c78e[_0x408106(0x208)](),'responseTime':_0x346a08,'metadata':{'usageData':{'s3PostTotalBytes':_0x586ac7}}});}}catch(_0x7a76b0){const _0x1cd1c9=_0x7a76b0 instanceof Error?_0x7a76b0[_0x408106(0x1ff)]:String(_0x7a76b0);console['error']('[Checkly\x20Reporter]\x20Failed\x20to\x20upload\x20results:',_0x1cd1c9);}}[a7_0x3d9455(0x210)](_0x33f3dc){const _0x5cc44a=a7_0x3d9455;console[_0x5cc44a(0x206)](_0x5cc44a(0x1ec),_0x33f3dc);}}
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export{};
package/dist/zipper.js DELETED
@@ -1 +0,0 @@
1
- const a9_0x43d28b=a9_0x16a0;function a9_0x16a0(_0x5d4079,_0x21bec2){const _0xe61b65=a9_0xe61b();return a9_0x16a0=function(_0x16a0d8,_0x267f19){_0x16a0d8=_0x16a0d8-0x165;let _0x3379e1=_0xe61b65[_0x16a0d8];return _0x3379e1;},a9_0x16a0(_0x5d4079,_0x21bec2);}(function(_0x27a7a2,_0x8f7e01){const _0x988db7=a9_0x16a0,_0x58b7ea=_0x27a7a2();while(!![]){try{const _0x422096=parseInt(_0x988db7(0x16f))/0x1*(parseInt(_0x988db7(0x178))/0x2)+parseInt(_0x988db7(0x175))/0x3*(parseInt(_0x988db7(0x187))/0x4)+-parseInt(_0x988db7(0x177))/0x5+-parseInt(_0x988db7(0x167))/0x6*(-parseInt(_0x988db7(0x17f))/0x7)+-parseInt(_0x988db7(0x17c))/0x8+-parseInt(_0x988db7(0x18c))/0x9*(-parseInt(_0x988db7(0x197))/0xa)+-parseInt(_0x988db7(0x17b))/0xb*(parseInt(_0x988db7(0x169))/0xc);if(_0x422096===_0x8f7e01)break;else _0x58b7ea['push'](_0x58b7ea['shift']());}catch(_0x5a9e29){_0x58b7ea['push'](_0x58b7ea['shift']());}}}(a9_0xe61b,0x7fc0d));import*as a9_0x433878 from'fs';import*as a9_0x383a98 from'path';import*as a9_0xdb0610 from'os';import{ZipArchive}from'archiver';function a9_0xe61b(){const _0x123fe2=['sourcePath','createZip','indexOf','contents','108gAxZgT','_offsets','12RKFSDn','Report\x20file\x20not\x20found:\x20','finalize','isArray','test-results/','parse','9111bkmSqR','transformAttachmentPaths','pipe','name','push','attachments','2793whyxxg','path','1817835LAlFbV','156xRnGpG','output/playwright-test-report.json','join','11771639FpSqvL','6285856qzYQdq','error','close','353857RdKkIL','existsSync','playwright-test-report-','stringify','__snapshots__/','utf-8','lastIndexOf','file','3748tFWGKQ','now','__screenshots__/','forEach','replace','160587ZObwPa','Asset\x20file\x20not\x20found:\x20','normalizeAttachmentPath','substring','outputPath','transformJsonReport','values','archivePath','object','warn','snapshots/','140gtvhCe','string','screenshots/','createWriteStream'];a9_0xe61b=function(){return _0x123fe2;};return a9_0xe61b();}export class Zipper{[a9_0x43d28b(0x190)];constructor(_0x2db449){const _0x3722d0=a9_0x43d28b;this[_0x3722d0(0x190)]=_0x2db449[_0x3722d0(0x190)];}async[a9_0x43d28b(0x19c)](_0x3193a1,_0x11c37f){const _0x4e0b21=[];return new Promise((_0x3a08c1,_0x14f1d3)=>{const _0x4eb8ed=a9_0x16a0;try{const _0x1f5468=a9_0x433878[_0x4eb8ed(0x19a)](this[_0x4eb8ed(0x190)]),_0x2f5db0=new ZipArchive({'zlib':{'level':0x0}});_0x2f5db0['on']('entry',_0x5a809c=>{const _0x55ed8f=_0x4eb8ed,_0x59660f=_0x5a809c[_0x55ed8f(0x172)][_0x55ed8f(0x18b)](/\\/g,'/'),_0x198a00=_0x5a809c[_0x55ed8f(0x168)]?.['contents']??0x0,_0x5cd36f=_0x5a809c[_0x55ed8f(0x168)]?.[_0x55ed8f(0x166)]+(_0x5a809c['csize']??0x0)-0x1;_0x4e0b21[_0x55ed8f(0x173)]({'name':_0x59660f,'start':_0x198a00,'end':_0x5cd36f});}),_0x1f5468['on'](_0x4eb8ed(0x17e),()=>{const _0x4d13c3=_0x2f5db0['pointer']();_0x3a08c1({'zipPath':this['outputPath'],'size':_0x4d13c3,'entryCount':_0x4e0b21['length'],'entries':_0x4e0b21});}),_0x2f5db0['on'](_0x4eb8ed(0x17d),_0x120bb4=>{_0x14f1d3(_0x120bb4);}),_0x1f5468['on'](_0x4eb8ed(0x17d),_0x3d298b=>{_0x14f1d3(_0x3d298b);}),_0x2f5db0[_0x4eb8ed(0x171)](_0x1f5468);if(!a9_0x433878[_0x4eb8ed(0x180)](_0x3193a1)){_0x14f1d3(new Error(_0x4eb8ed(0x16a)+_0x3193a1));return;}const _0x5b77f5=this[_0x4eb8ed(0x191)](_0x3193a1);_0x2f5db0['file'](_0x5b77f5,{'name':_0x4eb8ed(0x179)});for(const _0x2c035c of _0x11c37f){if(!a9_0x433878['existsSync'](_0x2c035c[_0x4eb8ed(0x19b)])){_0x14f1d3(new Error(_0x4eb8ed(0x18d)+_0x2c035c['sourcePath']));return;}_0x2f5db0[_0x4eb8ed(0x186)](_0x2c035c[_0x4eb8ed(0x19b)],{'name':_0x2c035c[_0x4eb8ed(0x193)]});}_0x2f5db0[_0x4eb8ed(0x16b)]();}catch(_0x2da9b5){_0x14f1d3(_0x2da9b5);}});}[a9_0x43d28b(0x191)](_0xe036ae){const _0x47cc89=a9_0x43d28b,_0x5699a3=a9_0x433878['readFileSync'](_0xe036ae,_0x47cc89(0x184)),_0x22e2d9=JSON[_0x47cc89(0x16e)](_0x5699a3);this['transformAttachmentPaths'](_0x22e2d9);const _0x4dc54a=a9_0x383a98[_0x47cc89(0x17a)](a9_0xdb0610['tmpdir'](),_0x47cc89(0x181)+Date[_0x47cc89(0x188)]()+'.json');return a9_0x433878['writeFileSync'](_0x4dc54a,JSON[_0x47cc89(0x182)](_0x22e2d9,null,0x2)),_0x4dc54a;}[a9_0x43d28b(0x170)](_0x8c0ef4){const _0x52e796=a9_0x43d28b;if(typeof _0x8c0ef4!==_0x52e796(0x194)||_0x8c0ef4===null)return;if(Array[_0x52e796(0x16c)](_0x8c0ef4)){_0x8c0ef4[_0x52e796(0x18a)](_0x1758ee=>this[_0x52e796(0x170)](_0x1758ee));return;}_0x8c0ef4[_0x52e796(0x174)]&&Array[_0x52e796(0x16c)](_0x8c0ef4[_0x52e796(0x174)])&&_0x8c0ef4[_0x52e796(0x174)]['forEach'](_0xf0de80=>{const _0x3e0081=_0x52e796;_0xf0de80['path']&&typeof _0xf0de80[_0x3e0081(0x176)]===_0x3e0081(0x198)&&(_0xf0de80['path']=this['normalizeAttachmentPath'](_0xf0de80['path']));}),Object[_0x52e796(0x192)](_0x8c0ef4)[_0x52e796(0x18a)](_0x3e04a6=>this[_0x52e796(0x170)](_0x3e04a6));}[a9_0x43d28b(0x18e)](_0x448ca3){const _0x5988ef=a9_0x43d28b,_0x550715=_0x448ca3['replace'](/\\/g,'/'),_0x536387=_0x550715[_0x5988ef(0x165)](_0x5988ef(0x16d));if(_0x536387!==-0x1)return _0x550715[_0x5988ef(0x18f)](_0x536387);const _0x23a03e=_0x550715[_0x5988ef(0x165)]('-snapshots/');if(_0x23a03e!==-0x1){const _0x4388fd=_0x550715[_0x5988ef(0x18f)](0x0,_0x23a03e),_0x3c654a=_0x4388fd[_0x5988ef(0x185)]('/'),_0xca75e5=_0x3c654a!==-0x1?_0x3c654a+0x1:0x0;return _0x550715[_0x5988ef(0x18f)](_0xca75e5);}const _0x3ddb38=[_0x5988ef(0x189),_0x5988ef(0x183),_0x5988ef(0x199),_0x5988ef(0x196)];for(const _0x4237e2 of _0x3ddb38){const _0x5eae79=_0x550715[_0x5988ef(0x165)](_0x4237e2);if(_0x5eae79!==-0x1)return _0x550715[_0x5988ef(0x18f)](_0x5eae79);}return console[_0x5988ef(0x195)]('[Checkly\x20Reporter]\x20Could\x20not\x20normalize\x20attachment\x20path:\x20'+_0x448ca3),_0x448ca3;}}