@dvl-software/eip-cypress 0.0.0-stage → 0.1.0
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/CHANGELOG.md +19 -0
- package/LICENSE +8 -0
- package/README.md +129 -2
- package/dist/chunk-YFM4D27K.js +237 -0
- package/dist/cli.js +226 -0
- package/dist/index.cjs +899 -0
- package/dist/index.d.cts +60 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +646 -0
- package/dist/support.cjs +634 -0
- package/dist/support.d.cts +84 -0
- package/dist/support.d.ts +84 -0
- package/dist/support.js +375 -0
- package/package.json +66 -5
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Plugin settings, from the environment of the CI job (never from the spec files). */
|
|
2
|
+
interface PluginOptions {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
apiUrl?: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
rerunOf?: number;
|
|
7
|
+
environment?: string;
|
|
8
|
+
runName?: string;
|
|
9
|
+
/** Regular expression: app requests whose URL matches are not recorded (e.g. streaming endpoints). */
|
|
10
|
+
captureExclude?: string;
|
|
11
|
+
/** Allows a plain-http EIP_API_URL that isn't localhost. */
|
|
12
|
+
allowHttp: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** One cleaning pass; {@link count} tells how many values were removed. */
|
|
17
|
+
declare class Redaction {
|
|
18
|
+
count: number;
|
|
19
|
+
private readonly extraFields;
|
|
20
|
+
private readonly extraPatterns;
|
|
21
|
+
constructor(extraFields?: string[], extraPatterns?: string[]);
|
|
22
|
+
isSecretField(name: string): boolean;
|
|
23
|
+
headers(headers: unknown): unknown;
|
|
24
|
+
body(body: unknown): unknown;
|
|
25
|
+
private stringBody;
|
|
26
|
+
private pairs;
|
|
27
|
+
/** User info, base through the value patterns, query and a `k=v` fragment through the pair rules. */
|
|
28
|
+
url(url: string): string;
|
|
29
|
+
/** URLs in the text (through {@link url}), then `"secret": "…"` pairs, then the value patterns. */
|
|
30
|
+
text(text: string): string;
|
|
31
|
+
/** The value patterns only: bearer, JWT, email, IBAN, card, phone, own patterns. */
|
|
32
|
+
plain(text: string): string;
|
|
33
|
+
private replace;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Your own handlers for events the plugin uses: Cypress keeps only one handler per event, so pass them here. */
|
|
37
|
+
interface EipHooks {
|
|
38
|
+
beforeRun?: (details: Cypress.BeforeRunDetails) => unknown | Promise<unknown>;
|
|
39
|
+
afterSpec?: (spec: Cypress.Spec, results: CypressCommandLine.RunResult) => unknown | Promise<unknown>;
|
|
40
|
+
afterRun?: (results: CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult) => unknown | Promise<unknown>;
|
|
41
|
+
}
|
|
42
|
+
interface SetupOptions extends Partial<PluginOptions> {
|
|
43
|
+
hooks?: EipHooks;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Sends this Cypress run to EIP. Call it from `setupNodeEvents` and return its result:
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* setupNodeEvents(on, config) { return setupEip(on, config); }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* Reads `EIP_API_KEY`, `EIP_API_URL`, `EIP_PROJECT_ID` (and `EIP_RERUN_OF` for a re-run) from the environment.
|
|
53
|
+
* Without a key it does nothing. It never changes the outcome of the Cypress run.
|
|
54
|
+
*/
|
|
55
|
+
declare function setupEip(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions, options?: SetupOptions): Promise<Cypress.PluginConfigOptions>;
|
|
56
|
+
/** A file path as a literal glob (Cypress resolves specPattern with fast-glob). */
|
|
57
|
+
declare function escapeGlob(path: string): string;
|
|
58
|
+
declare function hhmmss(ms: number): string;
|
|
59
|
+
|
|
60
|
+
export { type EipHooks, type PluginOptions, Redaction, type SetupOptions, escapeGlob, hhmmss, setupEip };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Plugin settings, from the environment of the CI job (never from the spec files). */
|
|
2
|
+
interface PluginOptions {
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
apiUrl?: string;
|
|
5
|
+
projectId?: string;
|
|
6
|
+
rerunOf?: number;
|
|
7
|
+
environment?: string;
|
|
8
|
+
runName?: string;
|
|
9
|
+
/** Regular expression: app requests whose URL matches are not recorded (e.g. streaming endpoints). */
|
|
10
|
+
captureExclude?: string;
|
|
11
|
+
/** Allows a plain-http EIP_API_URL that isn't localhost. */
|
|
12
|
+
allowHttp: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** One cleaning pass; {@link count} tells how many values were removed. */
|
|
17
|
+
declare class Redaction {
|
|
18
|
+
count: number;
|
|
19
|
+
private readonly extraFields;
|
|
20
|
+
private readonly extraPatterns;
|
|
21
|
+
constructor(extraFields?: string[], extraPatterns?: string[]);
|
|
22
|
+
isSecretField(name: string): boolean;
|
|
23
|
+
headers(headers: unknown): unknown;
|
|
24
|
+
body(body: unknown): unknown;
|
|
25
|
+
private stringBody;
|
|
26
|
+
private pairs;
|
|
27
|
+
/** User info, base through the value patterns, query and a `k=v` fragment through the pair rules. */
|
|
28
|
+
url(url: string): string;
|
|
29
|
+
/** URLs in the text (through {@link url}), then `"secret": "…"` pairs, then the value patterns. */
|
|
30
|
+
text(text: string): string;
|
|
31
|
+
/** The value patterns only: bearer, JWT, email, IBAN, card, phone, own patterns. */
|
|
32
|
+
plain(text: string): string;
|
|
33
|
+
private replace;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Your own handlers for events the plugin uses: Cypress keeps only one handler per event, so pass them here. */
|
|
37
|
+
interface EipHooks {
|
|
38
|
+
beforeRun?: (details: Cypress.BeforeRunDetails) => unknown | Promise<unknown>;
|
|
39
|
+
afterSpec?: (spec: Cypress.Spec, results: CypressCommandLine.RunResult) => unknown | Promise<unknown>;
|
|
40
|
+
afterRun?: (results: CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult) => unknown | Promise<unknown>;
|
|
41
|
+
}
|
|
42
|
+
interface SetupOptions extends Partial<PluginOptions> {
|
|
43
|
+
hooks?: EipHooks;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Sends this Cypress run to EIP. Call it from `setupNodeEvents` and return its result:
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* setupNodeEvents(on, config) { return setupEip(on, config); }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* Reads `EIP_API_KEY`, `EIP_API_URL`, `EIP_PROJECT_ID` (and `EIP_RERUN_OF` for a re-run) from the environment.
|
|
53
|
+
* Without a key it does nothing. It never changes the outcome of the Cypress run.
|
|
54
|
+
*/
|
|
55
|
+
declare function setupEip(on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions, options?: SetupOptions): Promise<Cypress.PluginConfigOptions>;
|
|
56
|
+
/** A file path as a literal glob (Cypress resolves specPattern with fast-glob). */
|
|
57
|
+
declare function escapeGlob(path: string): string;
|
|
58
|
+
declare function hhmmss(ms: number): string;
|
|
59
|
+
|
|
60
|
+
export { type EipHooks, type PluginOptions, Redaction, type SetupOptions, escapeGlob, hhmmss, setupEip };
|