@xera-ai/web 0.1.6 → 0.1.7
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/dist/core/src/adapter/types.d.ts +69 -0
- package/dist/core/src/artifact/hash.d.ts +3 -0
- package/dist/core/src/artifact/meta.d.ts +45 -0
- package/dist/core/src/artifact/paths.d.ts +24 -0
- package/dist/core/src/artifact/status.d.ts +95 -0
- package/dist/core/src/auth/encrypt.d.ts +3 -0
- package/dist/core/src/auth/key.d.ts +2 -0
- package/dist/core/src/auth/refresh.d.ts +8 -0
- package/dist/core/src/auth/state.d.ts +23 -0
- package/dist/core/src/config/define.d.ts +2 -0
- package/dist/core/src/config/load.d.ts +2 -0
- package/dist/core/src/config/schema.d.ts +325 -0
- package/dist/core/src/index.d.ts +19 -0
- package/dist/core/src/jira/client.d.ts +10 -0
- package/dist/core/src/jira/fields.d.ts +6 -0
- package/dist/core/src/jira/mcp-backend.d.ts +2 -0
- package/dist/core/src/jira/rest-backend.d.ts +7 -0
- package/dist/core/src/jira/retry.d.ts +7 -0
- package/dist/core/src/jira/types.d.ts +28 -0
- package/dist/core/src/lock/file-lock.d.ts +11 -0
- package/dist/core/src/logging/ndjson-logger.d.ts +10 -0
- package/dist/index.js +44 -12
- package/dist/{trace-normalizer → web/src/trace-normalizer}/scrub-rules.d.ts +4 -0
- package/package.json +1 -1
- package/src/adapter.ts +16 -5
- package/src/auth-setup/playwright-state.ts +1 -1
- package/src/auth-setup/runner.ts +1 -1
- package/src/executor/index.ts +4 -1
- package/src/generator/lint.ts +2 -2
- package/src/generator/pom-scan.ts +1 -1
- package/src/generator/promote.ts +4 -2
- package/src/generator/selector-rules.ts +18 -3
- package/src/trace-normalizer/normalize.ts +20 -7
- package/src/trace-normalizer/parse.ts +36 -11
- package/src/trace-normalizer/scrub-rules.ts +11 -2
- package/src/trace-normalizer/scrub.ts +6 -3
- package/src/trace-normalizer/unzip.ts +6 -1
- /package/dist/{adapter.d.ts → web/src/adapter.d.ts} +0 -0
- /package/dist/{auth-setup → web/src/auth-setup}/define.d.ts +0 -0
- /package/dist/{auth-setup → web/src/auth-setup}/playwright-state.d.ts +0 -0
- /package/dist/{auth-setup → web/src/auth-setup}/runner.d.ts +0 -0
- /package/dist/{executor → web/src/executor}/index.d.ts +0 -0
- /package/dist/{executor → web/src/executor}/playwright-args.d.ts +0 -0
- /package/dist/{generator → web/src/generator}/gherkin-validate.d.ts +0 -0
- /package/dist/{generator → web/src/generator}/lint.d.ts +0 -0
- /package/dist/{generator → web/src/generator}/pom-scan.d.ts +0 -0
- /package/dist/{generator → web/src/generator}/promote.d.ts +0 -0
- /package/dist/{generator → web/src/generator}/selector-rules.d.ts +0 -0
- /package/dist/{generator → web/src/generator}/typecheck.d.ts +0 -0
- /package/dist/{index.d.ts → web/src/index.d.ts} +0 -0
- /package/dist/{trace-normalizer → web/src/trace-normalizer}/normalize.d.ts +0 -0
- /package/dist/{trace-normalizer → web/src/trace-normalizer}/parse.d.ts +0 -0
- /package/dist/{trace-normalizer → web/src/trace-normalizer}/scrub.d.ts +0 -0
- /package/dist/{trace-normalizer → web/src/trace-normalizer}/unzip.d.ts +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Classification } from '../artifact/status';
|
|
2
|
+
import type { XeraConfig } from '../config/schema';
|
|
3
|
+
export interface GenerateInput {
|
|
4
|
+
ticketDir: string;
|
|
5
|
+
feature: string;
|
|
6
|
+
story: string;
|
|
7
|
+
config: XeraConfig;
|
|
8
|
+
}
|
|
9
|
+
export interface GenerateResult {
|
|
10
|
+
artifacts: string[];
|
|
11
|
+
warnings: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface ExecuteInput {
|
|
14
|
+
ticketDir: string;
|
|
15
|
+
config: XeraConfig;
|
|
16
|
+
runId: string;
|
|
17
|
+
env: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ScenarioResult {
|
|
20
|
+
name: string;
|
|
21
|
+
outcome: 'PASS' | 'FAIL' | 'SKIPPED';
|
|
22
|
+
failure?: {
|
|
23
|
+
step?: string;
|
|
24
|
+
errorMessage?: string;
|
|
25
|
+
domSnapshotAtFailure?: string;
|
|
26
|
+
networkAtFailure?: Array<{
|
|
27
|
+
method: string;
|
|
28
|
+
url: string;
|
|
29
|
+
status: number;
|
|
30
|
+
}>;
|
|
31
|
+
consoleAtFailure?: string[];
|
|
32
|
+
screenshotPath?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface RunResult {
|
|
36
|
+
runId: string;
|
|
37
|
+
outcome: 'PASS' | 'FAIL';
|
|
38
|
+
scenarios: ScenarioResult[];
|
|
39
|
+
artifactsDir: string;
|
|
40
|
+
rawReportPath: string;
|
|
41
|
+
normalizedReportPath: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ClassifyContext {
|
|
44
|
+
history: Array<{
|
|
45
|
+
ts: string;
|
|
46
|
+
result: 'PASS' | 'FAIL';
|
|
47
|
+
class: Classification;
|
|
48
|
+
}>;
|
|
49
|
+
storyHashChanged: boolean;
|
|
50
|
+
specHashChanged: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface DoctorReport {
|
|
53
|
+
ok: boolean;
|
|
54
|
+
checks: Array<{
|
|
55
|
+
name: string;
|
|
56
|
+
ok: boolean;
|
|
57
|
+
message?: string;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
export interface TestAdapter {
|
|
61
|
+
readonly id: string;
|
|
62
|
+
generate(input: GenerateInput): Promise<GenerateResult>;
|
|
63
|
+
execute(input: ExecuteInput): Promise<RunResult>;
|
|
64
|
+
classify?(run: RunResult, ctx: ClassifyContext): Partial<{
|
|
65
|
+
class: Classification;
|
|
66
|
+
rationale: string;
|
|
67
|
+
}>;
|
|
68
|
+
doctor(): Promise<DoctorReport>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const MetaJsonSchema: z.ZodObject<{
|
|
3
|
+
ticket: z.ZodString;
|
|
4
|
+
adapter: z.ZodString;
|
|
5
|
+
xera_version: z.ZodString;
|
|
6
|
+
prompts_version: z.ZodString;
|
|
7
|
+
fetched_at: z.ZodOptional<z.ZodString>;
|
|
8
|
+
story_hash: z.ZodOptional<z.ZodString>;
|
|
9
|
+
feature_generated_at: z.ZodOptional<z.ZodString>;
|
|
10
|
+
feature_generated_from_story_hash: z.ZodOptional<z.ZodString>;
|
|
11
|
+
feature_hash: z.ZodOptional<z.ZodString>;
|
|
12
|
+
script_generated_at: z.ZodOptional<z.ZodString>;
|
|
13
|
+
script_generated_from_feature_hash: z.ZodOptional<z.ZodString>;
|
|
14
|
+
script_warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
ticket: string;
|
|
17
|
+
adapter: string;
|
|
18
|
+
xera_version: string;
|
|
19
|
+
prompts_version: string;
|
|
20
|
+
fetched_at?: string | undefined;
|
|
21
|
+
story_hash?: string | undefined;
|
|
22
|
+
feature_generated_at?: string | undefined;
|
|
23
|
+
feature_generated_from_story_hash?: string | undefined;
|
|
24
|
+
feature_hash?: string | undefined;
|
|
25
|
+
script_generated_at?: string | undefined;
|
|
26
|
+
script_generated_from_feature_hash?: string | undefined;
|
|
27
|
+
script_warnings?: string[] | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
ticket: string;
|
|
30
|
+
adapter: string;
|
|
31
|
+
xera_version: string;
|
|
32
|
+
prompts_version: string;
|
|
33
|
+
fetched_at?: string | undefined;
|
|
34
|
+
story_hash?: string | undefined;
|
|
35
|
+
feature_generated_at?: string | undefined;
|
|
36
|
+
feature_generated_from_story_hash?: string | undefined;
|
|
37
|
+
feature_hash?: string | undefined;
|
|
38
|
+
script_generated_at?: string | undefined;
|
|
39
|
+
script_generated_from_feature_hash?: string | undefined;
|
|
40
|
+
script_warnings?: string[] | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export type MetaJson = z.infer<typeof MetaJsonSchema>;
|
|
43
|
+
export declare function readMeta(path: string): MetaJson | null;
|
|
44
|
+
export declare function writeMeta(path: string, meta: MetaJson): void;
|
|
45
|
+
export declare function updateMeta(path: string, patch: Partial<MetaJson>): MetaJson;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface RunPaths {
|
|
2
|
+
runDir: string;
|
|
3
|
+
reportJsonPath: string;
|
|
4
|
+
tracePath: string;
|
|
5
|
+
normalizedPath: string;
|
|
6
|
+
screenshotsDir: string;
|
|
7
|
+
videoDir: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ArtifactPaths {
|
|
10
|
+
ticketDir: string;
|
|
11
|
+
storyPath: string;
|
|
12
|
+
featurePath: string;
|
|
13
|
+
specPath: string;
|
|
14
|
+
pageObjectsDir: string;
|
|
15
|
+
runsDir: string;
|
|
16
|
+
metaPath: string;
|
|
17
|
+
statusPath: string;
|
|
18
|
+
logPath: string;
|
|
19
|
+
lockPath: string;
|
|
20
|
+
authDir: string;
|
|
21
|
+
runPath: (runId: string) => RunPaths;
|
|
22
|
+
}
|
|
23
|
+
export declare function resolveArtifactPaths(repoRoot: string, ticket: string): ArtifactPaths;
|
|
24
|
+
export declare function generateRunId(now?: Date): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const ClassificationEnum: z.ZodEnum<["PASS", "REAL_BUG", "SELECTOR_DRIFT", "FLAKY", "TEST_BUG"]>;
|
|
3
|
+
export declare const HistoryEntrySchema: z.ZodObject<{
|
|
4
|
+
ts: z.ZodString;
|
|
5
|
+
result: z.ZodEnum<["PASS", "FAIL"]>;
|
|
6
|
+
class: z.ZodEnum<["PASS", "REAL_BUG", "SELECTOR_DRIFT", "FLAKY", "TEST_BUG"]>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
ts: string;
|
|
9
|
+
result: "PASS" | "FAIL";
|
|
10
|
+
class: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
11
|
+
}, {
|
|
12
|
+
ts: string;
|
|
13
|
+
result: "PASS" | "FAIL";
|
|
14
|
+
class: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const StatusJsonSchema: z.ZodObject<{
|
|
17
|
+
ticket: z.ZodString;
|
|
18
|
+
lastRun: z.ZodString;
|
|
19
|
+
result: z.ZodEnum<["PASS", "FAIL"]>;
|
|
20
|
+
classification: z.ZodEnum<["PASS", "REAL_BUG", "SELECTOR_DRIFT", "FLAKY", "TEST_BUG"]>;
|
|
21
|
+
confidence: z.ZodEnum<["low", "medium", "high"]>;
|
|
22
|
+
scenarios: z.ZodObject<{
|
|
23
|
+
total: z.ZodNumber;
|
|
24
|
+
passed: z.ZodNumber;
|
|
25
|
+
failed: z.ZodNumber;
|
|
26
|
+
skipped: z.ZodNumber;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
total: number;
|
|
29
|
+
passed: number;
|
|
30
|
+
failed: number;
|
|
31
|
+
skipped: number;
|
|
32
|
+
}, {
|
|
33
|
+
total: number;
|
|
34
|
+
passed: number;
|
|
35
|
+
failed: number;
|
|
36
|
+
skipped: number;
|
|
37
|
+
}>;
|
|
38
|
+
history: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
39
|
+
ts: z.ZodString;
|
|
40
|
+
result: z.ZodEnum<["PASS", "FAIL"]>;
|
|
41
|
+
class: z.ZodEnum<["PASS", "REAL_BUG", "SELECTOR_DRIFT", "FLAKY", "TEST_BUG"]>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
ts: string;
|
|
44
|
+
result: "PASS" | "FAIL";
|
|
45
|
+
class: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
46
|
+
}, {
|
|
47
|
+
ts: string;
|
|
48
|
+
result: "PASS" | "FAIL";
|
|
49
|
+
class: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
50
|
+
}>, "many">>;
|
|
51
|
+
last_jira_comment_id: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
result: "PASS" | "FAIL";
|
|
54
|
+
ticket: string;
|
|
55
|
+
lastRun: string;
|
|
56
|
+
classification: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
57
|
+
confidence: "low" | "medium" | "high";
|
|
58
|
+
scenarios: {
|
|
59
|
+
total: number;
|
|
60
|
+
passed: number;
|
|
61
|
+
failed: number;
|
|
62
|
+
skipped: number;
|
|
63
|
+
};
|
|
64
|
+
history: {
|
|
65
|
+
ts: string;
|
|
66
|
+
result: "PASS" | "FAIL";
|
|
67
|
+
class: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
68
|
+
}[];
|
|
69
|
+
last_jira_comment_id?: string | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
result: "PASS" | "FAIL";
|
|
72
|
+
ticket: string;
|
|
73
|
+
lastRun: string;
|
|
74
|
+
classification: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
75
|
+
confidence: "low" | "medium" | "high";
|
|
76
|
+
scenarios: {
|
|
77
|
+
total: number;
|
|
78
|
+
passed: number;
|
|
79
|
+
failed: number;
|
|
80
|
+
skipped: number;
|
|
81
|
+
};
|
|
82
|
+
history?: {
|
|
83
|
+
ts: string;
|
|
84
|
+
result: "PASS" | "FAIL";
|
|
85
|
+
class: "PASS" | "REAL_BUG" | "SELECTOR_DRIFT" | "FLAKY" | "TEST_BUG";
|
|
86
|
+
}[] | undefined;
|
|
87
|
+
last_jira_comment_id?: string | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export type StatusJson = z.infer<typeof StatusJsonSchema>;
|
|
90
|
+
export type HistoryEntry = z.infer<typeof HistoryEntrySchema>;
|
|
91
|
+
export type Classification = z.infer<typeof ClassificationEnum>;
|
|
92
|
+
export declare function readStatus(path: string): StatusJson | null;
|
|
93
|
+
export declare function writeStatus(path: string, status: StatusJson): void;
|
|
94
|
+
export declare function appendHistory(path: string, entry: HistoryEntry): StatusJson;
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuthStateEntry } from './state';
|
|
2
|
+
export type { AuthStateEntry } from './state';
|
|
3
|
+
export declare function parseDuration(d: string): number;
|
|
4
|
+
export interface RefreshPolicy {
|
|
5
|
+
ttl: string;
|
|
6
|
+
refreshBuffer: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function needsRefresh(entry: AuthStateEntry | null, policy: RefreshPolicy, now?: Date): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AuthStateEntrySchema: z.ZodObject<{
|
|
3
|
+
role: z.ZodString;
|
|
4
|
+
strategy: z.ZodEnum<["storageState", "apiToken"]>;
|
|
5
|
+
created_at: z.ZodString;
|
|
6
|
+
expires_at: z.ZodString;
|
|
7
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
strategy: "storageState" | "apiToken";
|
|
10
|
+
role: string;
|
|
11
|
+
created_at: string;
|
|
12
|
+
expires_at: string;
|
|
13
|
+
payload: Record<string, unknown>;
|
|
14
|
+
}, {
|
|
15
|
+
strategy: "storageState" | "apiToken";
|
|
16
|
+
role: string;
|
|
17
|
+
created_at: string;
|
|
18
|
+
expires_at: string;
|
|
19
|
+
payload: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
21
|
+
export type AuthStateEntry = z.infer<typeof AuthStateEntrySchema>;
|
|
22
|
+
export declare function writeAuthState(authDir: string, entry: AuthStateEntry): void;
|
|
23
|
+
export declare function readAuthState(authDir: string, role: string): AuthStateEntry | null;
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const XeraConfigSchema: z.ZodObject<{
|
|
3
|
+
jira: z.ZodObject<{
|
|
4
|
+
baseUrl: z.ZodString;
|
|
5
|
+
projectKeys: z.ZodArray<z.ZodString, "many">;
|
|
6
|
+
fields: z.ZodObject<{
|
|
7
|
+
story: z.ZodString;
|
|
8
|
+
acceptanceCriteria: z.ZodOptional<z.ZodString>;
|
|
9
|
+
attachments: z.ZodDefault<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
story: string;
|
|
12
|
+
attachments: string;
|
|
13
|
+
acceptanceCriteria?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
story: string;
|
|
16
|
+
acceptanceCriteria?: string | undefined;
|
|
17
|
+
attachments?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
projectKeys: string[];
|
|
22
|
+
fields: {
|
|
23
|
+
story: string;
|
|
24
|
+
attachments: string;
|
|
25
|
+
acceptanceCriteria?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
baseUrl: string;
|
|
29
|
+
projectKeys: string[];
|
|
30
|
+
fields: {
|
|
31
|
+
story: string;
|
|
32
|
+
acceptanceCriteria?: string | undefined;
|
|
33
|
+
attachments?: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
web: z.ZodEffects<z.ZodObject<{
|
|
37
|
+
baseUrl: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>;
|
|
38
|
+
defaultEnv: z.ZodString;
|
|
39
|
+
auth: z.ZodDefault<z.ZodObject<{
|
|
40
|
+
strategy: z.ZodDefault<z.ZodEnum<["storageState", "apiToken", "none"]>>;
|
|
41
|
+
ttl: z.ZodDefault<z.ZodString>;
|
|
42
|
+
refreshBuffer: z.ZodDefault<z.ZodString>;
|
|
43
|
+
setupScript: z.ZodOptional<z.ZodString>;
|
|
44
|
+
roles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
|
+
envEmail: z.ZodString;
|
|
46
|
+
envPassword: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
envEmail: string;
|
|
49
|
+
envPassword: string;
|
|
50
|
+
}, {
|
|
51
|
+
envEmail: string;
|
|
52
|
+
envPassword: string;
|
|
53
|
+
}>>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
strategy: "storageState" | "apiToken" | "none";
|
|
56
|
+
ttl: string;
|
|
57
|
+
refreshBuffer: string;
|
|
58
|
+
roles: Record<string, {
|
|
59
|
+
envEmail: string;
|
|
60
|
+
envPassword: string;
|
|
61
|
+
}>;
|
|
62
|
+
setupScript?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
strategy?: "storageState" | "apiToken" | "none" | undefined;
|
|
65
|
+
ttl?: string | undefined;
|
|
66
|
+
refreshBuffer?: string | undefined;
|
|
67
|
+
setupScript?: string | undefined;
|
|
68
|
+
roles?: Record<string, {
|
|
69
|
+
envEmail: string;
|
|
70
|
+
envPassword: string;
|
|
71
|
+
}> | undefined;
|
|
72
|
+
}>>;
|
|
73
|
+
testData: z.ZodDefault<z.ZodObject<{
|
|
74
|
+
users: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
75
|
+
fromAuth: z.ZodString;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
fromAuth: string;
|
|
78
|
+
}, {
|
|
79
|
+
fromAuth: string;
|
|
80
|
+
}>>>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
users: Record<string, {
|
|
83
|
+
fromAuth: string;
|
|
84
|
+
}>;
|
|
85
|
+
}, {
|
|
86
|
+
users?: Record<string, {
|
|
87
|
+
fromAuth: string;
|
|
88
|
+
}> | undefined;
|
|
89
|
+
}>>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
baseUrl: Record<string, string>;
|
|
92
|
+
defaultEnv: string;
|
|
93
|
+
auth: {
|
|
94
|
+
strategy: "storageState" | "apiToken" | "none";
|
|
95
|
+
ttl: string;
|
|
96
|
+
refreshBuffer: string;
|
|
97
|
+
roles: Record<string, {
|
|
98
|
+
envEmail: string;
|
|
99
|
+
envPassword: string;
|
|
100
|
+
}>;
|
|
101
|
+
setupScript?: string | undefined;
|
|
102
|
+
};
|
|
103
|
+
testData: {
|
|
104
|
+
users: Record<string, {
|
|
105
|
+
fromAuth: string;
|
|
106
|
+
}>;
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
baseUrl: Record<string, string>;
|
|
110
|
+
defaultEnv: string;
|
|
111
|
+
auth?: {
|
|
112
|
+
strategy?: "storageState" | "apiToken" | "none" | undefined;
|
|
113
|
+
ttl?: string | undefined;
|
|
114
|
+
refreshBuffer?: string | undefined;
|
|
115
|
+
setupScript?: string | undefined;
|
|
116
|
+
roles?: Record<string, {
|
|
117
|
+
envEmail: string;
|
|
118
|
+
envPassword: string;
|
|
119
|
+
}> | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
testData?: {
|
|
122
|
+
users?: Record<string, {
|
|
123
|
+
fromAuth: string;
|
|
124
|
+
}> | undefined;
|
|
125
|
+
} | undefined;
|
|
126
|
+
}>, {
|
|
127
|
+
baseUrl: Record<string, string>;
|
|
128
|
+
defaultEnv: string;
|
|
129
|
+
auth: {
|
|
130
|
+
strategy: "storageState" | "apiToken" | "none";
|
|
131
|
+
ttl: string;
|
|
132
|
+
refreshBuffer: string;
|
|
133
|
+
roles: Record<string, {
|
|
134
|
+
envEmail: string;
|
|
135
|
+
envPassword: string;
|
|
136
|
+
}>;
|
|
137
|
+
setupScript?: string | undefined;
|
|
138
|
+
};
|
|
139
|
+
testData: {
|
|
140
|
+
users: Record<string, {
|
|
141
|
+
fromAuth: string;
|
|
142
|
+
}>;
|
|
143
|
+
};
|
|
144
|
+
}, {
|
|
145
|
+
baseUrl: Record<string, string>;
|
|
146
|
+
defaultEnv: string;
|
|
147
|
+
auth?: {
|
|
148
|
+
strategy?: "storageState" | "apiToken" | "none" | undefined;
|
|
149
|
+
ttl?: string | undefined;
|
|
150
|
+
refreshBuffer?: string | undefined;
|
|
151
|
+
setupScript?: string | undefined;
|
|
152
|
+
roles?: Record<string, {
|
|
153
|
+
envEmail: string;
|
|
154
|
+
envPassword: string;
|
|
155
|
+
}> | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
testData?: {
|
|
158
|
+
users?: Record<string, {
|
|
159
|
+
fromAuth: string;
|
|
160
|
+
}> | undefined;
|
|
161
|
+
} | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
ai: z.ZodDefault<z.ZodObject<{
|
|
164
|
+
livePageSnapshot: z.ZodDefault<z.ZodBoolean>;
|
|
165
|
+
confidenceThreshold: z.ZodDefault<z.ZodEnum<["low", "medium", "high"]>>;
|
|
166
|
+
maxRetries: z.ZodDefault<z.ZodObject<{
|
|
167
|
+
typecheck: z.ZodDefault<z.ZodNumber>;
|
|
168
|
+
lint: z.ZodDefault<z.ZodNumber>;
|
|
169
|
+
validateFeature: z.ZodDefault<z.ZodNumber>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
typecheck: number;
|
|
172
|
+
lint: number;
|
|
173
|
+
validateFeature: number;
|
|
174
|
+
}, {
|
|
175
|
+
typecheck?: number | undefined;
|
|
176
|
+
lint?: number | undefined;
|
|
177
|
+
validateFeature?: number | undefined;
|
|
178
|
+
}>>;
|
|
179
|
+
}, "strip", z.ZodTypeAny, {
|
|
180
|
+
livePageSnapshot: boolean;
|
|
181
|
+
confidenceThreshold: "low" | "medium" | "high";
|
|
182
|
+
maxRetries: {
|
|
183
|
+
typecheck: number;
|
|
184
|
+
lint: number;
|
|
185
|
+
validateFeature: number;
|
|
186
|
+
};
|
|
187
|
+
}, {
|
|
188
|
+
livePageSnapshot?: boolean | undefined;
|
|
189
|
+
confidenceThreshold?: "low" | "medium" | "high" | undefined;
|
|
190
|
+
maxRetries?: {
|
|
191
|
+
typecheck?: number | undefined;
|
|
192
|
+
lint?: number | undefined;
|
|
193
|
+
validateFeature?: number | undefined;
|
|
194
|
+
} | undefined;
|
|
195
|
+
}>>;
|
|
196
|
+
reporting: z.ZodDefault<z.ZodObject<{
|
|
197
|
+
language: z.ZodDefault<z.ZodEnum<["en", "vi"]>>;
|
|
198
|
+
postToJira: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
+
transition: z.ZodDefault<z.ZodObject<{
|
|
200
|
+
onPass: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
201
|
+
onFail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
onPass: string | null;
|
|
204
|
+
onFail: string | null;
|
|
205
|
+
}, {
|
|
206
|
+
onPass?: string | null | undefined;
|
|
207
|
+
onFail?: string | null | undefined;
|
|
208
|
+
}>>;
|
|
209
|
+
artifactLinks: z.ZodDefault<z.ZodEnum<["git", "local"]>>;
|
|
210
|
+
}, "strip", z.ZodTypeAny, {
|
|
211
|
+
language: "en" | "vi";
|
|
212
|
+
postToJira: boolean;
|
|
213
|
+
transition: {
|
|
214
|
+
onPass: string | null;
|
|
215
|
+
onFail: string | null;
|
|
216
|
+
};
|
|
217
|
+
artifactLinks: "git" | "local";
|
|
218
|
+
}, {
|
|
219
|
+
language?: "en" | "vi" | undefined;
|
|
220
|
+
postToJira?: boolean | undefined;
|
|
221
|
+
transition?: {
|
|
222
|
+
onPass?: string | null | undefined;
|
|
223
|
+
onFail?: string | null | undefined;
|
|
224
|
+
} | undefined;
|
|
225
|
+
artifactLinks?: "git" | "local" | undefined;
|
|
226
|
+
}>>;
|
|
227
|
+
adapters: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
jira: {
|
|
230
|
+
baseUrl: string;
|
|
231
|
+
projectKeys: string[];
|
|
232
|
+
fields: {
|
|
233
|
+
story: string;
|
|
234
|
+
attachments: string;
|
|
235
|
+
acceptanceCriteria?: string | undefined;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
web: {
|
|
239
|
+
baseUrl: Record<string, string>;
|
|
240
|
+
defaultEnv: string;
|
|
241
|
+
auth: {
|
|
242
|
+
strategy: "storageState" | "apiToken" | "none";
|
|
243
|
+
ttl: string;
|
|
244
|
+
refreshBuffer: string;
|
|
245
|
+
roles: Record<string, {
|
|
246
|
+
envEmail: string;
|
|
247
|
+
envPassword: string;
|
|
248
|
+
}>;
|
|
249
|
+
setupScript?: string | undefined;
|
|
250
|
+
};
|
|
251
|
+
testData: {
|
|
252
|
+
users: Record<string, {
|
|
253
|
+
fromAuth: string;
|
|
254
|
+
}>;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
ai: {
|
|
258
|
+
livePageSnapshot: boolean;
|
|
259
|
+
confidenceThreshold: "low" | "medium" | "high";
|
|
260
|
+
maxRetries: {
|
|
261
|
+
typecheck: number;
|
|
262
|
+
lint: number;
|
|
263
|
+
validateFeature: number;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
reporting: {
|
|
267
|
+
language: "en" | "vi";
|
|
268
|
+
postToJira: boolean;
|
|
269
|
+
transition: {
|
|
270
|
+
onPass: string | null;
|
|
271
|
+
onFail: string | null;
|
|
272
|
+
};
|
|
273
|
+
artifactLinks: "git" | "local";
|
|
274
|
+
};
|
|
275
|
+
adapters: string[];
|
|
276
|
+
}, {
|
|
277
|
+
jira: {
|
|
278
|
+
baseUrl: string;
|
|
279
|
+
projectKeys: string[];
|
|
280
|
+
fields: {
|
|
281
|
+
story: string;
|
|
282
|
+
acceptanceCriteria?: string | undefined;
|
|
283
|
+
attachments?: string | undefined;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
web: {
|
|
287
|
+
baseUrl: Record<string, string>;
|
|
288
|
+
defaultEnv: string;
|
|
289
|
+
auth?: {
|
|
290
|
+
strategy?: "storageState" | "apiToken" | "none" | undefined;
|
|
291
|
+
ttl?: string | undefined;
|
|
292
|
+
refreshBuffer?: string | undefined;
|
|
293
|
+
setupScript?: string | undefined;
|
|
294
|
+
roles?: Record<string, {
|
|
295
|
+
envEmail: string;
|
|
296
|
+
envPassword: string;
|
|
297
|
+
}> | undefined;
|
|
298
|
+
} | undefined;
|
|
299
|
+
testData?: {
|
|
300
|
+
users?: Record<string, {
|
|
301
|
+
fromAuth: string;
|
|
302
|
+
}> | undefined;
|
|
303
|
+
} | undefined;
|
|
304
|
+
};
|
|
305
|
+
ai?: {
|
|
306
|
+
livePageSnapshot?: boolean | undefined;
|
|
307
|
+
confidenceThreshold?: "low" | "medium" | "high" | undefined;
|
|
308
|
+
maxRetries?: {
|
|
309
|
+
typecheck?: number | undefined;
|
|
310
|
+
lint?: number | undefined;
|
|
311
|
+
validateFeature?: number | undefined;
|
|
312
|
+
} | undefined;
|
|
313
|
+
} | undefined;
|
|
314
|
+
reporting?: {
|
|
315
|
+
language?: "en" | "vi" | undefined;
|
|
316
|
+
postToJira?: boolean | undefined;
|
|
317
|
+
transition?: {
|
|
318
|
+
onPass?: string | null | undefined;
|
|
319
|
+
onFail?: string | null | undefined;
|
|
320
|
+
} | undefined;
|
|
321
|
+
artifactLinks?: "git" | "local" | undefined;
|
|
322
|
+
} | undefined;
|
|
323
|
+
adapters?: string[] | undefined;
|
|
324
|
+
}>;
|
|
325
|
+
export type XeraConfig = z.infer<typeof XeraConfigSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const VERSION = "0.1.0";
|
|
2
|
+
export type * from './adapter/types';
|
|
3
|
+
export * from './config/schema';
|
|
4
|
+
export * from './config/define';
|
|
5
|
+
export * from './config/load';
|
|
6
|
+
export * from './artifact/paths';
|
|
7
|
+
export * from './artifact/hash';
|
|
8
|
+
export * from './artifact/meta';
|
|
9
|
+
export * from './artifact/status';
|
|
10
|
+
export * from './logging/ndjson-logger';
|
|
11
|
+
export * from './lock/file-lock';
|
|
12
|
+
export * from './jira/types';
|
|
13
|
+
export * from './jira/client';
|
|
14
|
+
export * from './jira/fields';
|
|
15
|
+
export * from './jira/retry';
|
|
16
|
+
export * from './auth/encrypt';
|
|
17
|
+
export * from './auth/key';
|
|
18
|
+
export * from './auth/state';
|
|
19
|
+
export * from './auth/refresh';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JiraClient } from './types';
|
|
2
|
+
export interface CreateJiraClientOptions {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
preferMcp?: boolean;
|
|
5
|
+
rest?: {
|
|
6
|
+
email: string;
|
|
7
|
+
apiToken: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function createJiraClient(opts: CreateJiraClientOptions): Promise<JiraClient>;
|