@replayio/test-utils
Advanced tools
Comparing version 0.0.0-pr577-20240701135511 to 0.0.0-pr577-20240701165011
# @replayio/test-utils | ||
## 0.0.0-pr577-20240701135511 | ||
## 0.0.0-pr577-20240701165011 | ||
@@ -5,0 +5,0 @@ ### Patch Changes |
declare function fetchWorkspaceConfig(apiKey: string): Promise<{ | ||
env: any; | ||
}>; | ||
//# sourceMappingURL=config.d.ts.map | ||
export { fetchWorkspaceConfig }; |
@@ -1,5 +0,2 @@ | ||
import { ReplayReporterConfig } from './types.js'; | ||
declare function getAccessToken(config: ReplayReporterConfig<any>): string | undefined; | ||
export { getAccessToken }; | ||
import { ReplayReporterConfig } from "./types"; | ||
export declare function getAccessToken(config: ReplayReporterConfig<any>): string | undefined; |
@@ -1,11 +0,13 @@ | ||
export { TestMetadataV1 } from './legacy-cli/metadata/test/v1.js'; | ||
export { TestMetadataV2 } from './legacy-cli/metadata/test/v2.js'; | ||
export { fetchWorkspaceConfig } from './config.js'; | ||
export { getAccessToken } from './getAccessToken.js'; | ||
export { log, warn } from './logging.js'; | ||
export { getMetadataFilePath, initMetadataFile } from './metadata.js'; | ||
export { pingTestMetrics } from './metrics.js'; | ||
export { PendingWork, default as ReplayReporter, ReporterError } from './reporter.js'; | ||
export { removeAnsiCodes } from './terminal.js'; | ||
export { buildTestId } from './testId.js'; | ||
export { RecordingEntry, ReplayReporterConfig } from './types.js'; | ||
export type { TestMetadataV1, TestMetadataV2 } from "./legacy-cli/metadata/test"; | ||
export { fetchWorkspaceConfig } from "./config"; | ||
export { getAccessToken } from "./getAccessToken"; | ||
export * from "./logging"; | ||
export { getMetadataFilePath, initMetadataFile } from "./metadata"; | ||
export { pingTestMetrics } from "./metrics"; | ||
export { ReporterError } from "./reporter"; | ||
export type { PendingWork } from "./reporter"; | ||
export { removeAnsiCodes } from "./terminal"; | ||
export { buildTestId } from "./testId"; | ||
export type { RecordingEntry, ReplayReporterConfig } from "./types"; | ||
export { ReplayReporter }; | ||
import ReplayReporter from "./reporter"; |
'use strict'; | ||
var retryOnFailure = require('../shared/dist/async/retryOnFailure.js'); | ||
var retryOnFailure = require('../_bundled/@replay-cli/shared/async/retryOnFailure.js'); | ||
var fs = require('fs'); | ||
@@ -5,0 +5,0 @@ var debug$1 = require('./debug.js'); |
'use strict'; | ||
var cachedFetch = require('../../shared/dist/cachedFetch.js'); | ||
var cachedFetch = require('../../_bundled/@replay-cli/shared/cachedFetch.js'); | ||
var dbg = require('debug'); | ||
@@ -5,0 +5,0 @@ var fs = require('fs'); |
@@ -1,12 +0,10 @@ | ||
import * as superstruct from 'superstruct'; | ||
import { Infer } from 'superstruct'; | ||
declare const testResult: superstruct.Struct<"unknown" | "failed" | "passed" | "timedOut" | "skipped", { | ||
unknown: "unknown"; | ||
import { Infer } from "superstruct"; | ||
declare const testResult: import("superstruct").Struct<"failed" | "passed" | "skipped" | "timedOut" | "unknown", { | ||
failed: "failed"; | ||
passed: "passed"; | ||
skipped: "skipped"; | ||
timedOut: "timedOut"; | ||
skipped: "skipped"; | ||
unknown: "unknown"; | ||
}>; | ||
declare const testError: superstruct.Struct<{ | ||
declare const testError: import("superstruct").Struct<{ | ||
message: string; | ||
@@ -16,13 +14,11 @@ line?: number | undefined; | ||
}, { | ||
message: superstruct.Struct<string, null>; | ||
line: superstruct.Struct<number | undefined, null>; | ||
column: superstruct.Struct<number | undefined, null>; | ||
message: import("superstruct").Struct<string, null>; | ||
line: import("superstruct").Struct<number | undefined, null>; | ||
column: import("superstruct").Struct<number | undefined, null>; | ||
}>; | ||
declare const test: superstruct.Struct<{ | ||
declare const test: import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
result: "unknown" | "failed" | "passed" | "timedOut" | "skipped"; | ||
id?: string | undefined; | ||
path?: string[] | undefined; | ||
parentId?: string | undefined; | ||
relativePath?: string | undefined; | ||
error?: { | ||
@@ -33,2 +29,4 @@ message: string; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
@@ -38,15 +36,15 @@ duration?: number | undefined; | ||
}, { | ||
id: superstruct.Struct<string | undefined, null>; | ||
parentId: superstruct.Struct<string | undefined, null>; | ||
title: superstruct.Struct<string, null>; | ||
path: superstruct.Struct<string[] | undefined, superstruct.Struct<string, null>>; | ||
relativePath: superstruct.Struct<string | undefined, null>; | ||
result: superstruct.Struct<"unknown" | "failed" | "passed" | "timedOut" | "skipped", { | ||
unknown: "unknown"; | ||
id: import("superstruct").Struct<string | undefined, null>; | ||
parentId: import("superstruct").Struct<string | undefined, null>; | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>; | ||
relativePath: import("superstruct").Struct<string | undefined, null>; | ||
result: import("superstruct").Struct<"failed" | "passed" | "skipped" | "timedOut" | "unknown", { | ||
failed: "failed"; | ||
passed: "passed"; | ||
skipped: "skipped"; | ||
timedOut: "timedOut"; | ||
skipped: "skipped"; | ||
unknown: "unknown"; | ||
}>; | ||
error: superstruct.Struct<{ | ||
error: import("superstruct").Struct<{ | ||
message: string; | ||
@@ -56,13 +54,13 @@ line?: number | undefined; | ||
} | undefined, { | ||
message: superstruct.Struct<string, null>; | ||
line: superstruct.Struct<number | undefined, null>; | ||
column: superstruct.Struct<number | undefined, null>; | ||
message: import("superstruct").Struct<string, null>; | ||
line: import("superstruct").Struct<number | undefined, null>; | ||
column: import("superstruct").Struct<number | undefined, null>; | ||
}>; | ||
relativeStartTime: superstruct.Struct<number | undefined, null>; | ||
duration: superstruct.Struct<number | undefined, null>; | ||
steps: superstruct.Struct<any[] | undefined, superstruct.Struct<any, null>>; | ||
relativeStartTime: import("superstruct").Struct<number | undefined, null>; | ||
duration: import("superstruct").Struct<number | undefined, null>; | ||
steps: import("superstruct").Struct<any[] | undefined, import("superstruct").Struct<any, null>>; | ||
}>; | ||
declare const v1_0_0: superstruct.Struct<{ | ||
declare const v1_0_0: import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
result: "unknown" | "failed" | "passed" | "timedOut" | "skipped"; | ||
version: number; | ||
@@ -74,13 +72,11 @@ reporterErrors: any[]; | ||
hooks?: { | ||
title: string; | ||
path: string[]; | ||
title: string; | ||
steps?: any[] | undefined; | ||
}[] | undefined; | ||
tests?: { | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
result: "unknown" | "failed" | "passed" | "timedOut" | "skipped"; | ||
id?: string | undefined; | ||
path?: string[] | undefined; | ||
parentId?: string | undefined; | ||
relativePath?: string | undefined; | ||
error?: { | ||
@@ -91,2 +87,4 @@ message: string; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
@@ -107,33 +105,31 @@ duration?: number | undefined; | ||
}, { | ||
suite: superstruct.Struct<string | undefined, null>; | ||
file: superstruct.Struct<string | undefined, null>; | ||
title: superstruct.Struct<string, null>; | ||
path: superstruct.Struct<string[] | undefined, superstruct.Struct<string, null>>; | ||
result: superstruct.Struct<"unknown" | "failed" | "passed" | "timedOut" | "skipped", { | ||
unknown: "unknown"; | ||
suite: import("superstruct").Struct<string | undefined, null>; | ||
file: import("superstruct").Struct<string | undefined, null>; | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>; | ||
result: import("superstruct").Struct<"failed" | "passed" | "skipped" | "timedOut" | "unknown", { | ||
failed: "failed"; | ||
passed: "passed"; | ||
skipped: "skipped"; | ||
timedOut: "timedOut"; | ||
skipped: "skipped"; | ||
unknown: "unknown"; | ||
}>; | ||
hooks: superstruct.Struct<{ | ||
hooks: import("superstruct").Struct<{ | ||
title: string; | ||
path: string[]; | ||
steps?: any[] | undefined; | ||
}[] | undefined, import("superstruct").Struct<{ | ||
title: string; | ||
steps?: any[] | undefined; | ||
}[] | undefined, superstruct.Struct<{ | ||
path: string[]; | ||
title: string; | ||
steps?: any[] | undefined; | ||
}, { | ||
title: superstruct.Struct<string, null>; | ||
path: superstruct.Struct<string[], superstruct.Struct<string, null>>; | ||
steps: superstruct.Struct<any[] | undefined, superstruct.Struct<any, null>>; | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>; | ||
steps: import("superstruct").Struct<any[] | undefined, import("superstruct").Struct<any, null>>; | ||
}>>; | ||
tests: superstruct.Struct<{ | ||
tests: import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
result: "unknown" | "failed" | "passed" | "timedOut" | "skipped"; | ||
id?: string | undefined; | ||
path?: string[] | undefined; | ||
parentId?: string | undefined; | ||
relativePath?: string | undefined; | ||
error?: { | ||
@@ -144,12 +140,12 @@ message: string; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
duration?: number | undefined; | ||
steps?: any[] | undefined; | ||
}[] | undefined, superstruct.Struct<{ | ||
}[] | undefined, import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
result: "unknown" | "failed" | "passed" | "timedOut" | "skipped"; | ||
id?: string | undefined; | ||
path?: string[] | undefined; | ||
parentId?: string | undefined; | ||
relativePath?: string | undefined; | ||
error?: { | ||
@@ -160,2 +156,4 @@ message: string; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
@@ -165,15 +163,15 @@ duration?: number | undefined; | ||
}, { | ||
id: superstruct.Struct<string | undefined, null>; | ||
parentId: superstruct.Struct<string | undefined, null>; | ||
title: superstruct.Struct<string, null>; | ||
path: superstruct.Struct<string[] | undefined, superstruct.Struct<string, null>>; | ||
relativePath: superstruct.Struct<string | undefined, null>; | ||
result: superstruct.Struct<"unknown" | "failed" | "passed" | "timedOut" | "skipped", { | ||
unknown: "unknown"; | ||
id: import("superstruct").Struct<string | undefined, null>; | ||
parentId: import("superstruct").Struct<string | undefined, null>; | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>; | ||
relativePath: import("superstruct").Struct<string | undefined, null>; | ||
result: import("superstruct").Struct<"failed" | "passed" | "skipped" | "timedOut" | "unknown", { | ||
failed: "failed"; | ||
passed: "passed"; | ||
skipped: "skipped"; | ||
timedOut: "timedOut"; | ||
skipped: "skipped"; | ||
unknown: "unknown"; | ||
}>; | ||
error: superstruct.Struct<{ | ||
error: import("superstruct").Struct<{ | ||
message: string; | ||
@@ -183,11 +181,11 @@ line?: number | undefined; | ||
} | undefined, { | ||
message: superstruct.Struct<string, null>; | ||
line: superstruct.Struct<number | undefined, null>; | ||
column: superstruct.Struct<number | undefined, null>; | ||
message: import("superstruct").Struct<string, null>; | ||
line: import("superstruct").Struct<number | undefined, null>; | ||
column: import("superstruct").Struct<number | undefined, null>; | ||
}>; | ||
relativeStartTime: superstruct.Struct<number | undefined, null>; | ||
duration: superstruct.Struct<number | undefined, null>; | ||
steps: superstruct.Struct<any[] | undefined, superstruct.Struct<any, null>>; | ||
relativeStartTime: import("superstruct").Struct<number | undefined, null>; | ||
duration: import("superstruct").Struct<number | undefined, null>; | ||
steps: import("superstruct").Struct<any[] | undefined, import("superstruct").Struct<any, null>>; | ||
}>>; | ||
runner: superstruct.Struct<{ | ||
runner: import("superstruct").Struct<{ | ||
name?: string | undefined; | ||
@@ -197,7 +195,7 @@ version?: string | undefined; | ||
} | undefined, { | ||
name: superstruct.Struct<string | undefined, null>; | ||
version: superstruct.Struct<string | undefined, null>; | ||
plugin: superstruct.Struct<string | undefined, null>; | ||
name: import("superstruct").Struct<string | undefined, null>; | ||
version: import("superstruct").Struct<string | undefined, null>; | ||
plugin: import("superstruct").Struct<string | undefined, null>; | ||
}>; | ||
run: superstruct.Struct<{ | ||
run: import("superstruct").Struct<{ | ||
id: unknown; | ||
@@ -207,10 +205,10 @@ title?: string | undefined; | ||
} | undefined, { | ||
id: superstruct.Struct<unknown, null>; | ||
title: superstruct.Struct<string | undefined, null>; | ||
mode: superstruct.Struct<string | undefined, null>; | ||
id: import("superstruct").Struct<unknown, null>; | ||
title: import("superstruct").Struct<string | undefined, null>; | ||
mode: import("superstruct").Struct<string | undefined, null>; | ||
}>; | ||
reporterErrors: superstruct.Struct<any[], superstruct.Struct<any, null>>; | ||
version: superstruct.Struct<number, null>; | ||
reporterErrors: import("superstruct").Struct<any[], import("superstruct").Struct<any, null>>; | ||
version: import("superstruct").Struct<number, null>; | ||
}>; | ||
declare namespace TestMetadataV1 { | ||
export declare namespace TestMetadataV1 { | ||
type UserActionEvent = any; | ||
@@ -222,3 +220,145 @@ type Test = Infer<typeof test>; | ||
} | ||
export { TestMetadataV1 }; | ||
declare const _default: { | ||
"1.0.0": import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
version: number; | ||
reporterErrors: any[]; | ||
path?: string[] | undefined; | ||
suite?: string | undefined; | ||
file?: string | undefined; | ||
hooks?: { | ||
title: string; | ||
path: string[]; | ||
steps?: any[] | undefined; | ||
}[] | undefined; | ||
tests?: { | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
id?: string | undefined; | ||
parentId?: string | undefined; | ||
error?: { | ||
message: string; | ||
line?: number | undefined; | ||
column?: number | undefined; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
duration?: number | undefined; | ||
steps?: any[] | undefined; | ||
}[] | undefined; | ||
runner?: { | ||
name?: string | undefined; | ||
version?: string | undefined; | ||
plugin?: string | undefined; | ||
} | undefined; | ||
run?: { | ||
id: unknown; | ||
title?: string | undefined; | ||
mode?: string | undefined; | ||
} | undefined; | ||
}, { | ||
suite: import("superstruct").Struct<string | undefined, null>; | ||
file: import("superstruct").Struct<string | undefined, null>; | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>; | ||
result: import("superstruct").Struct<"failed" | "passed" | "skipped" | "timedOut" | "unknown", { | ||
failed: "failed"; | ||
passed: "passed"; | ||
skipped: "skipped"; | ||
timedOut: "timedOut"; | ||
unknown: "unknown"; | ||
}>; | ||
hooks: import("superstruct").Struct<{ | ||
title: string; | ||
path: string[]; | ||
steps?: any[] | undefined; | ||
}[] | undefined, import("superstruct").Struct<{ | ||
title: string; | ||
path: string[]; | ||
steps?: any[] | undefined; | ||
}, { | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[], import("superstruct").Struct<string, null>>; | ||
steps: import("superstruct").Struct<any[] | undefined, import("superstruct").Struct<any, null>>; | ||
}>>; | ||
tests: import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
id?: string | undefined; | ||
parentId?: string | undefined; | ||
error?: { | ||
message: string; | ||
line?: number | undefined; | ||
column?: number | undefined; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
duration?: number | undefined; | ||
steps?: any[] | undefined; | ||
}[] | undefined, import("superstruct").Struct<{ | ||
result: "failed" | "passed" | "skipped" | "timedOut" | "unknown"; | ||
title: string; | ||
id?: string | undefined; | ||
parentId?: string | undefined; | ||
error?: { | ||
message: string; | ||
line?: number | undefined; | ||
column?: number | undefined; | ||
} | undefined; | ||
path?: string[] | undefined; | ||
relativePath?: string | undefined; | ||
relativeStartTime?: number | undefined; | ||
duration?: number | undefined; | ||
steps?: any[] | undefined; | ||
}, { | ||
id: import("superstruct").Struct<string | undefined, null>; | ||
parentId: import("superstruct").Struct<string | undefined, null>; | ||
title: import("superstruct").Struct<string, null>; | ||
path: import("superstruct").Struct<string[] | undefined, import("superstruct").Struct<string, null>>; | ||
relativePath: import("superstruct").Struct<string | undefined, null>; | ||
result: import("superstruct").Struct<"failed" | "passed" | "skipped" | "timedOut" | "unknown", { | ||
failed: "failed"; | ||
passed: "passed"; | ||
skipped: "skipped"; | ||
timedOut: "timedOut"; | ||
unknown: "unknown"; | ||
}>; | ||
error: import("superstruct").Struct<{ | ||
message: string; | ||
line?: number | undefined; | ||
column?: number | undefined; | ||
} | undefined, { | ||
message: import("superstruct").Struct<string, null>; | ||
line: import("superstruct").Struct<number | undefined, null>; | ||
column: import("superstruct").Struct<number | undefined, null>; | ||
}>; | ||
relativeStartTime: import("superstruct").Struct<number | undefined, null>; | ||
duration: import("superstruct").Struct<number | undefined, null>; | ||
steps: import("superstruct").Struct<any[] | undefined, import("superstruct").Struct<any, null>>; | ||
}>>; | ||
runner: import("superstruct").Struct<{ | ||
name?: string | undefined; | ||
version?: string | undefined; | ||
plugin?: string | undefined; | ||
} | undefined, { | ||
name: import("superstruct").Struct<string | undefined, null>; | ||
version: import("superstruct").Struct<string | undefined, null>; | ||
plugin: import("superstruct").Struct<string | undefined, null>; | ||
}>; | ||
run: import("superstruct").Struct<{ | ||
id: unknown; | ||
title?: string | undefined; | ||
mode?: string | undefined; | ||
} | undefined, { | ||
id: import("superstruct").Struct<unknown, null>; | ||
title: import("superstruct").Struct<string | undefined, null>; | ||
mode: import("superstruct").Struct<string | undefined, null>; | ||
}>; | ||
reporterErrors: import("superstruct").Struct<any[], import("superstruct").Struct<any, null>>; | ||
version: import("superstruct").Struct<number, null>; | ||
}>; | ||
}; | ||
export default _default; |
@@ -1,7 +0,85 @@ | ||
type UnstructuredMetadata = Record<string, unknown>; | ||
interface OriginalSourceEntry { | ||
import type { AgentOptions } from "http"; | ||
export type UnstructuredMetadata = Record<string, unknown>; | ||
export interface Options { | ||
/** | ||
* Alternate recording directory | ||
*/ | ||
directory?: string; | ||
/** | ||
* Alternate server to upload recordings to | ||
*/ | ||
server?: string; | ||
/** | ||
* Alternate server to use for opening devtools | ||
*/ | ||
viewServer?: string; | ||
/** | ||
* Authentication API Key | ||
*/ | ||
apiKey?: string; | ||
verbose?: boolean; | ||
agentOptions?: AgentOptions; | ||
} | ||
export interface SourcemapUploadOptions { | ||
group: string; | ||
dryRun?: boolean; | ||
extensions?: Array<string>; | ||
ignore?: Array<string>; | ||
quiet?: boolean; | ||
verbose?: boolean; | ||
root?: string; | ||
batchSize?: number; | ||
} | ||
export interface MetadataOptions { | ||
init?: string; | ||
keys?: string[]; | ||
warn?: boolean; | ||
verbose?: boolean; | ||
directory?: string; | ||
} | ||
export interface FilterOptions { | ||
filter?: string | ((recordings: RecordingEntry, index: number, allRecordings: RecordingEntry[]) => boolean); | ||
includeCrashes?: boolean; | ||
} | ||
export interface LaunchOptions { | ||
browser?: string; | ||
attach?: boolean; | ||
} | ||
export interface ListOptions extends FilterOptions { | ||
all?: boolean; | ||
} | ||
export interface UploadOptions extends Options { | ||
/** | ||
* Fail the recording upload if any part of the upload fails. | ||
*/ | ||
strict?: boolean; | ||
/** | ||
* Remove assets associated with the recording after successful upload | ||
*/ | ||
removeAssets?: boolean; | ||
} | ||
export interface UploadAllOptions extends FilterOptions, UploadOptions { | ||
batchSize?: number; | ||
warn?: boolean; | ||
} | ||
/** | ||
* Supported replay browsers | ||
*/ | ||
export interface RecordingMetadata { | ||
recordingData: { | ||
id?: string; | ||
duration?: number; | ||
url?: string; | ||
title?: string; | ||
operations: object | null; | ||
lastScreenData?: string; | ||
lastScreenMimeType: string; | ||
}; | ||
metadata: UnstructuredMetadata; | ||
} | ||
export interface OriginalSourceEntry { | ||
path: string; | ||
parentOffset: number; | ||
} | ||
interface SourceMapEntry { | ||
export interface SourceMapEntry { | ||
id: string; | ||
@@ -15,3 +93,3 @@ path: string; | ||
} | ||
interface RecordingEntry<TMetadata extends UnstructuredMetadata = UnstructuredMetadata> { | ||
export interface RecordingEntry<TMetadata extends UnstructuredMetadata = UnstructuredMetadata> { | ||
id: string; | ||
@@ -30,4 +108,2 @@ createTime: Date; | ||
} | ||
type ExternalRecordingEntry<TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata> = Omit<RecordingEntry<TRecordingMetadata>, "buildId" | "crashData">; | ||
export type { ExternalRecordingEntry, OriginalSourceEntry, RecordingEntry, SourceMapEntry, UnstructuredMetadata }; | ||
export type ExternalRecordingEntry<TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata> = Omit<RecordingEntry<TRecordingMetadata>, "buildId" | "crashData">; |
'use strict'; | ||
var retryOnFailure = require('../shared/dist/async/retryOnFailure.js'); | ||
var require$$2 = require('crypto'); | ||
var retryOnFailure = require('../_bundled/@replay-cli/shared/async/retryOnFailure.js'); | ||
var crypto = require('crypto'); | ||
var fs = require('fs'); | ||
@@ -14,6 +14,7 @@ var fetch = require('node-fetch'); | ||
var utils = require('./utils.js'); | ||
var userAgent = require('../_bundled/@replay-cli/shared/userAgent.js'); | ||
const debug = debug$1.default("replay:cli:upload"); | ||
function sha256(text) { | ||
return require$$2.createHash("sha256").update(text).digest("hex"); | ||
return crypto.createHash("sha256").update(text).digest("hex"); | ||
} | ||
@@ -129,3 +130,3 @@ class ReplayClient { | ||
method: "PUT", | ||
headers: { "Content-Length": size.toString(), "User-Agent": utils.getUserAgent() }, | ||
headers: { "Content-Length": size.toString(), "User-Agent": userAgent.getUserAgent() }, | ||
body: file | ||
@@ -132,0 +133,0 @@ }); |
@@ -7,3 +7,2 @@ 'use strict'; | ||
var path = require('path'); | ||
var _package = require('../test-utils/package.json.js'); | ||
@@ -43,8 +42,2 @@ const debug = dbg("replay:cli"); | ||
} | ||
function getNameAndVersion() { | ||
return `${_package.name}/${_package.version}`; | ||
} | ||
function getUserAgent() { | ||
return getNameAndVersion(); | ||
} | ||
function getHttpAgent(server, agentOptions) { | ||
@@ -66,4 +59,3 @@ const serverURL = new URL(server); | ||
exports.getHttpAgent = getHttpAgent; | ||
exports.getUserAgent = getUserAgent; | ||
exports.isValidUUID = isValidUUID; | ||
exports.maybeLog = maybeLog; |
@@ -1,4 +0,2 @@ | ||
declare function log(message: string): void; | ||
declare function warn(message: string, e?: unknown): void; | ||
export { log, warn }; | ||
export declare function log(message: string): void; | ||
export declare function warn(message: string, e?: unknown): void; |
@@ -1,4 +0,2 @@ | ||
declare function getMetadataFilePath(base: string, workerIndex?: number): string; | ||
declare function initMetadataFile(path: string): string | undefined; | ||
export { getMetadataFilePath, initMetadataFile }; | ||
export declare function getMetadataFilePath(base: string, workerIndex?: number): string; | ||
export declare function initMetadataFile(path: string): string | undefined; |
'use strict'; | ||
var getReplayPath = require('./shared/dist/getReplayPath.js'); | ||
var getReplayPath = require('./_bundled/@replay-cli/shared/getReplayPath.js'); | ||
var fs = require('fs'); | ||
@@ -5,0 +5,0 @@ var logging = require('./logging.js'); |
@@ -1,3 +0,2 @@ | ||
import { TestMetadataV2 } from './legacy-cli/metadata/test/v2.js'; | ||
import { TestMetadataV2 } from "./legacy-cli/metadata/test/v2"; | ||
declare function pingTestMetrics(recordingId: string | undefined, runId: string, test: { | ||
@@ -12,4 +11,2 @@ id: string; | ||
}, apiKey?: string): Promise<void>; | ||
//# sourceMappingURL=metrics.d.ts.map | ||
export { pingTestMetrics }; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var fetch = require('node-fetch'); | ||
var require$$0 = require('os'); | ||
var os = require('os'); | ||
@@ -21,3 +21,3 @@ const debug = dbg("replay:test-utils:metrics"); | ||
...test, | ||
platform: require$$0.platform(), | ||
platform: os.platform(), | ||
runId, | ||
@@ -24,0 +24,0 @@ env: { |
@@ -1,8 +0,6 @@ | ||
import { ExternalRecordingEntry } from './legacy-cli/types.js'; | ||
import { Properties } from './node_modules/@replay-cli/shared/dist/mixpanel/mixpanelAPI.js'; | ||
import { UnstructuredMetadata } from './node_modules/@replay-cli/shared/dist/recording/types.js'; | ||
import { TestMetadataV2 } from './legacy-cli/metadata/test/v2.js'; | ||
import { ReplayReporterConfig, RecordingEntry } from './types.js'; | ||
interface TestRunner { | ||
import { Properties } from "./_bundled/@replay-cli/shared/mixpanel/mixpanelAPI"; | ||
import { UnstructuredMetadata } from "./_bundled/@replay-cli/shared/recording/types"; | ||
import type { TestMetadataV2 } from "./legacy-cli/metadata/test"; | ||
import { RecordingEntry, ReplayReporterConfig } from "./types"; | ||
export interface TestRunner { | ||
name: string; | ||
@@ -12,9 +10,15 @@ version: string | undefined; | ||
} | ||
type Test = TestMetadataV2.Test; | ||
type TestRun = TestMetadataV2.TestRun; | ||
export type UserActionEvent = TestMetadataV2.UserActionEvent; | ||
export type Test = TestMetadataV2.Test; | ||
export type TestResult = TestMetadataV2.TestResult; | ||
export type TestError = TestMetadataV2.TestError; | ||
export type TestRun = TestMetadataV2.TestRun; | ||
type PendingWorkType = "test-run" | "test-run-tests" | "post-test" | "upload"; | ||
type PendingWorkError<K extends PendingWorkType, TErrorData = {}> = TErrorData & { | ||
export type PendingWorkError<K extends PendingWorkType, TErrorData = {}> = TErrorData & { | ||
type: K; | ||
error: Error; | ||
}; | ||
export type PendingUploadError = Extract<UploadPendingWork, { | ||
error: {}; | ||
}>; | ||
type PendingWorkEntry<TType extends PendingWorkType, TSuccessData = {}, TErrorData = {}> = PendingWorkError<TType, TErrorData> | (TSuccessData & { | ||
@@ -38,4 +42,4 @@ type: TType; | ||
}>; | ||
type PendingWork = TestRunPendingWork | TestRunTestsPendingWork | UploadPendingWork | PostTestPendingWork; | ||
declare class ReporterError extends Error { | ||
export type PendingWork = TestRunPendingWork | TestRunTestsPendingWork | UploadPendingWork | PostTestPendingWork; | ||
export declare class ReporterError extends Error { | ||
code: number; | ||
@@ -51,3 +55,3 @@ detail: any; | ||
} | ||
declare class ReplayReporter<TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata> { | ||
export default class ReplayReporter<TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata> { | ||
private _baseId; | ||
@@ -93,3 +97,3 @@ private _testRunShardId; | ||
executionId: string; | ||
}[]): ExternalRecordingEntry[]; | ||
}[]): import("./legacy-cli/types").ExternalRecordingEntry[]; | ||
private _buildTestMetadata; | ||
@@ -103,3 +107,2 @@ private _setRecordingMetadata; | ||
} | ||
export { type PendingWork, type PendingWorkError, ReporterError, type Test, type TestRun, type TestRunner, ReplayReporter as default }; | ||
export {}; |
@@ -5,8 +5,7 @@ 'use strict'; | ||
var retryOnFailure = require('./shared/dist/async/retryOnFailure.js'); | ||
var getAuthInfo = require('./shared/dist/graphql/getAuthInfo.js'); | ||
var queryGraphQL = require('./shared/dist/graphql/queryGraphQL.js'); | ||
var logger = require('./shared/dist/logger.js'); | ||
var mixpanelAPI = require('./shared/dist/mixpanel/mixpanelAPI.js'); | ||
var userAgent = require('./shared/dist/userAgent.js'); | ||
var retryOnFailure = require('./_bundled/@replay-cli/shared/async/retryOnFailure.js'); | ||
var getAuthInfo = require('./_bundled/@replay-cli/shared/graphql/getAuthInfo.js'); | ||
var queryGraphQL = require('./_bundled/@replay-cli/shared/graphql/queryGraphQL.js'); | ||
var logger = require('./_bundled/@replay-cli/shared/logger.js'); | ||
var mixpanelAPI = require('./_bundled/@replay-cli/shared/mixpanel/mixpanelAPI.js'); | ||
var child_process = require('child_process'); | ||
@@ -17,3 +16,2 @@ var fs = require('fs'); | ||
var uuid = require('uuid'); | ||
var _package = require('./test-utils/package.json.js'); | ||
var getAccessToken = require('./getAccessToken.js'); | ||
@@ -132,3 +130,2 @@ var main = require('./legacy-cli/main.js'); | ||
constructor(runner, schemaVersion, config) { | ||
userAgent.setUserAgent(`${_package.name}/${_package.version}`); | ||
this._runner = runner; | ||
@@ -135,0 +132,0 @@ this._schemaVersion = schemaVersion; |
@@ -1,3 +0,1 @@ | ||
declare const removeAnsiCodes: (message?: string) => string | undefined; | ||
export { removeAnsiCodes }; | ||
export declare const removeAnsiCodes: (message?: string) => string | undefined; |
@@ -1,6 +0,3 @@ | ||
import { Test } from './reporter.js'; | ||
declare function buildTestId(sourcePath: string, test: Pick<Test, "id" | "source">): string; | ||
declare function generateOpaqueId(contents: string): string; | ||
export { buildTestId, generateOpaqueId }; | ||
import type { Test } from "./reporter"; | ||
export declare function buildTestId(sourcePath: string, test: Pick<Test, "id" | "source">): string; | ||
export declare function generateOpaqueId(contents: string): string; |
@@ -1,4 +0,3 @@ | ||
import { UnstructuredMetadata, SourceMap } from './node_modules/@replay-cli/shared/dist/recording/types.js'; | ||
type RecordingEntry<TMetadata extends UnstructuredMetadata = UnstructuredMetadata> = { | ||
import { SourceMap, UnstructuredMetadata } from "@replay-cli/shared/recording/types"; | ||
export type RecordingEntry<TMetadata extends UnstructuredMetadata = UnstructuredMetadata> = { | ||
id: string; | ||
@@ -17,4 +16,4 @@ createTime: Date; | ||
}; | ||
type UploadStatusThreshold = "all" | "failed-and-flaky" | "failed"; | ||
type UploadOption = boolean | { | ||
export type UploadStatusThreshold = "all" | "failed-and-flaky" | "failed"; | ||
export type UploadOption = boolean | { | ||
/** | ||
@@ -28,3 +27,3 @@ * Minimize the number of recordings uploaded for a test attempt (within a shard). | ||
}; | ||
interface ReplayReporterConfig<TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata> { | ||
export interface ReplayReporterConfig<TRecordingMetadata extends UnstructuredMetadata = UnstructuredMetadata> { | ||
runTitle?: string; | ||
@@ -38,3 +37,1 @@ metadata?: Record<string, any> | string; | ||
} | ||
export type { RecordingEntry, ReplayReporterConfig, UploadOption, UploadStatusThreshold }; |
{ | ||
"name": "@replayio/test-utils", | ||
"version": "0.0.0-pr577-20240701135511", | ||
"version": "0.0.0-pr577-20240701165011", | ||
"description": "Utilities for recording tests with replay.io", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -13,3 +13,4 @@ import { retryWithLinearBackoff } from "@replay-cli/shared/async/retryOnFailure"; | ||
import { Options, OriginalSourceEntry, RecordingMetadata, SourceMapEntry } from "./types"; | ||
import { defer, getUserAgent, isValidUUID, maybeLog } from "./utils"; | ||
import { defer, isValidUUID, maybeLog } from "./utils"; | ||
import { getUserAgent } from "@replay-cli/shared/userAgent"; | ||
@@ -16,0 +17,0 @@ const debug = dbg("replay:cli:upload"); |
@@ -11,3 +11,2 @@ // This module is meant to be somewhat browser-friendly. | ||
import path from "path"; | ||
import { name as packageName, version as packageVersion } from "../../package.json"; | ||
@@ -69,10 +68,2 @@ import { Options } from "./types"; | ||
function getNameAndVersion() { | ||
return `${packageName}/${packageVersion}`; | ||
} | ||
function getUserAgent() { | ||
return getNameAndVersion(); | ||
} | ||
function getHttpAgent(server: string, agentOptions?: AgentOptions) { | ||
@@ -93,2 +84,2 @@ const serverURL = new URL(server); | ||
export { defer, getDirectory, getHttpAgent, getUserAgent, isValidUUID, maybeLog }; | ||
export { defer, getDirectory, getHttpAgent, isValidUUID, maybeLog }; |
@@ -7,3 +7,2 @@ import { retryWithExponentialBackoff } from "@replay-cli/shared/async/retryOnFailure"; | ||
import { UnstructuredMetadata } from "@replay-cli/shared/recording/types"; | ||
import { setUserAgent } from "@replay-cli/shared/userAgent"; | ||
import { spawnSync } from "child_process"; | ||
@@ -14,3 +13,2 @@ import { mkdirSync, writeFileSync } from "fs"; | ||
import { v4 as uuid } from "uuid"; | ||
import * as pkgJson from "../package.json"; | ||
import { getAccessToken } from "./getAccessToken"; | ||
@@ -247,3 +245,2 @@ import { listAllRecordings, removeRecording, uploadRecording } from "./legacy-cli"; | ||
) { | ||
setUserAgent(`${pkgJson.name}/${pkgJson.version}`); | ||
this._runner = runner; | ||
@@ -250,0 +247,0 @@ this._schemaVersion = schemaVersion; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
15427
74
7
572688
99