@lokalise/ragnarok-api-contracts 2.1.3 → 2.3.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/dist/evaluation-contracts.d.ts +79 -24
- package/dist/evaluation-contracts.js +9 -1
- package/dist/evaluation-contracts.js.map +1 -1
- package/dist/objects.d.ts +91 -45
- package/dist/objects.js +43 -19
- package/dist/objects.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,22 +11,49 @@ export declare const getEvaluation: import("@lokalise/api-contracts").GetRouteDe
|
|
|
11
11
|
completed: "completed";
|
|
12
12
|
failed: "failed";
|
|
13
13
|
}>;
|
|
14
|
-
|
|
14
|
+
metricsMetadata: z.ZodObject<{
|
|
15
|
+
exactMatch: z.ZodObject<{
|
|
16
|
+
betterWhen: z.ZodEnum<{
|
|
17
|
+
higher: "higher";
|
|
18
|
+
lower: "lower";
|
|
19
|
+
}>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
ter: z.ZodObject<{
|
|
22
|
+
betterWhen: z.ZodEnum<{
|
|
23
|
+
higher: "higher";
|
|
24
|
+
lower: "lower";
|
|
25
|
+
}>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
bleu: z.ZodObject<{
|
|
28
|
+
betterWhen: z.ZodEnum<{
|
|
29
|
+
higher: "higher";
|
|
30
|
+
lower: "lower";
|
|
31
|
+
}>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
meteor: z.ZodObject<{
|
|
34
|
+
betterWhen: z.ZodEnum<{
|
|
35
|
+
higher: "higher";
|
|
36
|
+
lower: "lower";
|
|
37
|
+
}>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
results: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
41
|
+
configurationName: z.ZodString;
|
|
15
42
|
global: z.ZodObject<{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
20
45
|
bleu: z.ZodOptional<z.ZodNumber>;
|
|
21
46
|
meteor: z.ZodOptional<z.ZodNumber>;
|
|
22
47
|
}, z.core.$strip>;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
resultsByLocalePair: z.ZodArray<z.ZodObject<{
|
|
49
|
+
sourceLocale: z.ZodString;
|
|
50
|
+
targetLocale: z.ZodString;
|
|
51
|
+
metrics: z.ZodObject<{
|
|
52
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, z.core.$strip>;
|
|
30
57
|
}, z.core.$strip>>;
|
|
31
58
|
}, z.core.$strip>>>;
|
|
32
59
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -43,22 +70,49 @@ export declare const getEvaluation: import("@lokalise/api-contracts").GetRouteDe
|
|
|
43
70
|
completed: "completed";
|
|
44
71
|
failed: "failed";
|
|
45
72
|
}>;
|
|
46
|
-
|
|
73
|
+
metricsMetadata: z.ZodObject<{
|
|
74
|
+
exactMatch: z.ZodObject<{
|
|
75
|
+
betterWhen: z.ZodEnum<{
|
|
76
|
+
higher: "higher";
|
|
77
|
+
lower: "lower";
|
|
78
|
+
}>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
ter: z.ZodObject<{
|
|
81
|
+
betterWhen: z.ZodEnum<{
|
|
82
|
+
higher: "higher";
|
|
83
|
+
lower: "lower";
|
|
84
|
+
}>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
bleu: z.ZodObject<{
|
|
87
|
+
betterWhen: z.ZodEnum<{
|
|
88
|
+
higher: "higher";
|
|
89
|
+
lower: "lower";
|
|
90
|
+
}>;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
meteor: z.ZodObject<{
|
|
93
|
+
betterWhen: z.ZodEnum<{
|
|
94
|
+
higher: "higher";
|
|
95
|
+
lower: "lower";
|
|
96
|
+
}>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
results: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
100
|
+
configurationName: z.ZodString;
|
|
47
101
|
global: z.ZodObject<{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
52
104
|
bleu: z.ZodOptional<z.ZodNumber>;
|
|
53
105
|
meteor: z.ZodOptional<z.ZodNumber>;
|
|
54
106
|
}, z.core.$strip>;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
107
|
+
resultsByLocalePair: z.ZodArray<z.ZodObject<{
|
|
108
|
+
sourceLocale: z.ZodString;
|
|
109
|
+
targetLocale: z.ZodString;
|
|
110
|
+
metrics: z.ZodObject<{
|
|
111
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
}, z.core.$strip>;
|
|
62
116
|
}, z.core.$strip>>;
|
|
63
117
|
}, z.core.$strip>>>;
|
|
64
118
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -148,6 +202,7 @@ export declare const postScheduleEvaluation: import("@lokalise/api-contracts").P
|
|
|
148
202
|
evaluationId: z.ZodUUID;
|
|
149
203
|
}, z.core.$strip>, undefined, undefined, z.ZodObject<{
|
|
150
204
|
authorization: z.ZodString;
|
|
205
|
+
'idempotency-key': z.ZodOptional<z.ZodString>;
|
|
151
206
|
}, z.core.$strip>, undefined, false, false, {
|
|
152
207
|
202: z.ZodObject<{
|
|
153
208
|
evaluationId: z.ZodUUID;
|
|
@@ -67,6 +67,14 @@ const SCHEDULE_EVALUATION_BODY_SCHEMA = z
|
|
|
67
67
|
const names = data.runConfigurations.map((c) => c.name);
|
|
68
68
|
return new Set(names).size === names.length;
|
|
69
69
|
}, { message: 'Run configuration names must be unique within the request' });
|
|
70
|
+
const SCHEDULE_EVALUATION_HEADERS = AUTH_HEADERS.extend({
|
|
71
|
+
'idempotency-key': z
|
|
72
|
+
.string()
|
|
73
|
+
.min(1, 'Idempotency-Key must not be empty')
|
|
74
|
+
.max(256, 'Idempotency-Key must not exceed 256 characters')
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('Globally unique key to prevent duplicate evaluation scheduling'),
|
|
77
|
+
});
|
|
70
78
|
const SCHEDULE_EVALUATION_RESPONSE_SCHEMA = z.object({
|
|
71
79
|
evaluationId: z
|
|
72
80
|
.uuid()
|
|
@@ -76,7 +84,7 @@ export const postScheduleEvaluation = buildRestContract({
|
|
|
76
84
|
method: 'post',
|
|
77
85
|
pathResolver: () => '/v1/evaluations',
|
|
78
86
|
description: 'Schedule evaluation',
|
|
79
|
-
requestHeaderSchema:
|
|
87
|
+
requestHeaderSchema: SCHEDULE_EVALUATION_HEADERS,
|
|
80
88
|
requestBodySchema: SCHEDULE_EVALUATION_BODY_SCHEMA,
|
|
81
89
|
successResponseBodySchema: SCHEDULE_EVALUATION_RESPONSE_SCHEMA,
|
|
82
90
|
responseSchemasByStatusCode: {
|
|
@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mCAAmC;KACzC;CACF,CAAC,CAAA"}
|
package/dist/objects.d.ts
CHANGED
|
@@ -1,51 +1,70 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const METRICS_SCHEMA: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
3
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
7
5
|
bleu: z.ZodOptional<z.ZodNumber>;
|
|
8
6
|
meteor: z.ZodOptional<z.ZodNumber>;
|
|
9
7
|
}, z.core.$strip>;
|
|
10
8
|
export type Metrics = z.infer<typeof METRICS_SCHEMA>;
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
export declare const METRICS_METADATA_SCHEMA: z.ZodObject<{
|
|
10
|
+
exactMatch: z.ZodObject<{
|
|
11
|
+
betterWhen: z.ZodEnum<{
|
|
12
|
+
higher: "higher";
|
|
13
|
+
lower: "lower";
|
|
14
|
+
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
ter: z.ZodObject<{
|
|
17
|
+
betterWhen: z.ZodEnum<{
|
|
18
|
+
higher: "higher";
|
|
19
|
+
lower: "lower";
|
|
20
|
+
}>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
bleu: z.ZodObject<{
|
|
23
|
+
betterWhen: z.ZodEnum<{
|
|
24
|
+
higher: "higher";
|
|
25
|
+
lower: "lower";
|
|
26
|
+
}>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
meteor: z.ZodObject<{
|
|
29
|
+
betterWhen: z.ZodEnum<{
|
|
30
|
+
higher: "higher";
|
|
31
|
+
lower: "lower";
|
|
32
|
+
}>;
|
|
19
33
|
}, z.core.$strip>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type MetricsMetadata = z.infer<typeof METRICS_METADATA_SCHEMA>;
|
|
36
|
+
export declare const METRICS_METADATA: MetricsMetadata;
|
|
37
|
+
export declare const LOCALE_PAIR_RESULT_SCHEMA: z.ZodObject<{
|
|
38
|
+
sourceLocale: z.ZodString;
|
|
39
|
+
targetLocale: z.ZodString;
|
|
40
|
+
metrics: z.ZodObject<{
|
|
41
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
25
43
|
bleu: z.ZodOptional<z.ZodNumber>;
|
|
26
44
|
meteor: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
}, z.core.$strip
|
|
45
|
+
}, z.core.$strip>;
|
|
28
46
|
}, z.core.$strip>;
|
|
29
|
-
export type
|
|
30
|
-
export declare const
|
|
47
|
+
export type LocalePairResult = z.infer<typeof LOCALE_PAIR_RESULT_SCHEMA>;
|
|
48
|
+
export declare const CONFIGURATION_RESULT_SCHEMA: z.ZodObject<{
|
|
49
|
+
configurationName: z.ZodString;
|
|
31
50
|
global: z.ZodObject<{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
36
53
|
bleu: z.ZodOptional<z.ZodNumber>;
|
|
37
54
|
meteor: z.ZodOptional<z.ZodNumber>;
|
|
38
55
|
}, z.core.$strip>;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
resultsByLocalePair: z.ZodArray<z.ZodObject<{
|
|
57
|
+
sourceLocale: z.ZodString;
|
|
58
|
+
targetLocale: z.ZodString;
|
|
59
|
+
metrics: z.ZodObject<{
|
|
60
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>;
|
|
46
65
|
}, z.core.$strip>>;
|
|
47
|
-
}, z.core.$strip
|
|
48
|
-
export type
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type ConfigurationResult = z.infer<typeof CONFIGURATION_RESULT_SCHEMA>;
|
|
49
68
|
export declare const EVALUATION_SCHEMA: z.ZodObject<{
|
|
50
69
|
id: z.ZodUUID;
|
|
51
70
|
ownerId: z.ZodString;
|
|
@@ -54,22 +73,49 @@ export declare const EVALUATION_SCHEMA: z.ZodObject<{
|
|
|
54
73
|
completed: "completed";
|
|
55
74
|
failed: "failed";
|
|
56
75
|
}>;
|
|
57
|
-
|
|
76
|
+
metricsMetadata: z.ZodObject<{
|
|
77
|
+
exactMatch: z.ZodObject<{
|
|
78
|
+
betterWhen: z.ZodEnum<{
|
|
79
|
+
higher: "higher";
|
|
80
|
+
lower: "lower";
|
|
81
|
+
}>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
ter: z.ZodObject<{
|
|
84
|
+
betterWhen: z.ZodEnum<{
|
|
85
|
+
higher: "higher";
|
|
86
|
+
lower: "lower";
|
|
87
|
+
}>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
bleu: z.ZodObject<{
|
|
90
|
+
betterWhen: z.ZodEnum<{
|
|
91
|
+
higher: "higher";
|
|
92
|
+
lower: "lower";
|
|
93
|
+
}>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
meteor: z.ZodObject<{
|
|
96
|
+
betterWhen: z.ZodEnum<{
|
|
97
|
+
higher: "higher";
|
|
98
|
+
lower: "lower";
|
|
99
|
+
}>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
results: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
103
|
+
configurationName: z.ZodString;
|
|
58
104
|
global: z.ZodObject<{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
perfectMatch: z.ZodOptional<z.ZodNumber>;
|
|
62
|
-
translationErrorRate: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
63
107
|
bleu: z.ZodOptional<z.ZodNumber>;
|
|
64
108
|
meteor: z.ZodOptional<z.ZodNumber>;
|
|
65
109
|
}, z.core.$strip>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
110
|
+
resultsByLocalePair: z.ZodArray<z.ZodObject<{
|
|
111
|
+
sourceLocale: z.ZodString;
|
|
112
|
+
targetLocale: z.ZodString;
|
|
113
|
+
metrics: z.ZodObject<{
|
|
114
|
+
exactMatch: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
ter: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
bleu: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
meteor: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
}, z.core.$strip>;
|
|
73
119
|
}, z.core.$strip>>;
|
|
74
120
|
}, z.core.$strip>>>;
|
|
75
121
|
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
package/dist/objects.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const METRICS_SCHEMA = z.object({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
actualTranslationScore: z
|
|
8
|
-
.number()
|
|
9
|
-
.optional()
|
|
10
|
-
.describe('Average LQA score of actual (generated) translations'),
|
|
11
|
-
perfectMatch: z
|
|
3
|
+
// TODO bring it back and adjust it once we align on ai scoring metrics
|
|
4
|
+
// referenceTranslationScore: z.number().optional().describe('Average LQA score of reference translations'),
|
|
5
|
+
// actualTranslationScore: z.number().optional().describe('Average LQA score of actual (generated) translations'),
|
|
6
|
+
exactMatch: z
|
|
12
7
|
.number()
|
|
13
8
|
.optional()
|
|
14
9
|
.describe('Rate of translations that exactly match the reference (0–1)'),
|
|
15
|
-
|
|
10
|
+
ter: z
|
|
16
11
|
.number()
|
|
17
12
|
.optional()
|
|
18
13
|
.describe('TER score measuring post-editing effort relative to reference length'),
|
|
@@ -20,24 +15,53 @@ export const METRICS_SCHEMA = z.object({
|
|
|
20
15
|
.number()
|
|
21
16
|
.optional()
|
|
22
17
|
.describe('BLEU score measuring n-gram overlap with reference translations'),
|
|
23
|
-
meteor: z
|
|
18
|
+
meteor: z
|
|
19
|
+
.number()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('METEOR score measuring n-gram overlap with synonym and morphological variant support'),
|
|
24
22
|
});
|
|
23
|
+
const METRIC_DIRECTION_SCHEMA = z.object({
|
|
24
|
+
betterWhen: z
|
|
25
|
+
.enum(['higher', 'lower'])
|
|
26
|
+
.describe('Whether a higher or lower score indicates better translation quality'),
|
|
27
|
+
});
|
|
28
|
+
export const METRICS_METADATA_SCHEMA = z
|
|
29
|
+
.object({
|
|
30
|
+
exactMatch: METRIC_DIRECTION_SCHEMA,
|
|
31
|
+
ter: METRIC_DIRECTION_SCHEMA,
|
|
32
|
+
bleu: METRIC_DIRECTION_SCHEMA,
|
|
33
|
+
meteor: METRIC_DIRECTION_SCHEMA,
|
|
34
|
+
})
|
|
35
|
+
.describe('Metadata about each metric, indicating whether a higher or lower value is better');
|
|
36
|
+
export const METRICS_METADATA = {
|
|
37
|
+
exactMatch: { betterWhen: 'higher' },
|
|
38
|
+
ter: { betterWhen: 'lower' },
|
|
39
|
+
bleu: { betterWhen: 'higher' },
|
|
40
|
+
meteor: { betterWhen: 'higher' },
|
|
41
|
+
};
|
|
42
|
+
export const LOCALE_PAIR_RESULT_SCHEMA = z
|
|
43
|
+
.object({
|
|
44
|
+
sourceLocale: z.string().describe('Source language locale'),
|
|
45
|
+
targetLocale: z.string().describe('Target language locale'),
|
|
46
|
+
metrics: METRICS_SCHEMA.describe('Metrics for this locale pair'),
|
|
47
|
+
})
|
|
48
|
+
.describe('Evaluation metrics for a single locale pair');
|
|
25
49
|
export const CONFIGURATION_RESULT_SCHEMA = z
|
|
26
50
|
.object({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.describe('Metrics per language pair, keyed by "source->target" (e.g. "en-GB->pl-PL")'),
|
|
51
|
+
configurationName: z.string().describe('Name of the run configuration'),
|
|
52
|
+
global: METRICS_SCHEMA.describe('Metrics aggregated across all locale pairs'),
|
|
53
|
+
resultsByLocalePair: z.array(LOCALE_PAIR_RESULT_SCHEMA).describe('Metrics per locale pair'),
|
|
31
54
|
})
|
|
32
55
|
.describe('Evaluation metrics for a single run configuration');
|
|
33
|
-
export const RESULT_BY_CONFIGURATION_NAME_SCHEMA = z
|
|
34
|
-
.record(z.string(), CONFIGURATION_RESULT_SCHEMA)
|
|
35
|
-
.describe('Evaluation results grouped by configuration name');
|
|
36
56
|
export const EVALUATION_SCHEMA = z.object({
|
|
37
57
|
id: z.uuid().describe('Unique identifier of the evaluation request'),
|
|
38
58
|
ownerId: z.string().describe('Owner identifier (team ID or similar) for this evaluation'),
|
|
39
59
|
status: z.enum(['pending', 'completed', 'failed']).describe('Current status of the evaluation'),
|
|
40
|
-
|
|
60
|
+
metricsMetadata: METRICS_METADATA_SCHEMA.describe('Per-metric metadata for interpreting evaluation scores'),
|
|
61
|
+
results: z
|
|
62
|
+
.array(CONFIGURATION_RESULT_SCHEMA)
|
|
63
|
+
.nullable()
|
|
64
|
+
.describe('Evaluation results per run configuration'),
|
|
41
65
|
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
42
66
|
});
|
|
43
67
|
//# sourceMappingURL=objects.js.map
|
package/dist/objects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,uEAAuE;IACvE,4GAA4G;IAC5G,kHAAkH;IAClH,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sEAAsE,CAAC;IACnF,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iEAAiE,CAAC;IAC9E,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,sFAAsF,CACvF;CACJ,CAAC,CAAA;AAIF,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,UAAU,EAAE,CAAC;SACV,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACzB,QAAQ,CAAC,sEAAsE,CAAC;CACpF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,UAAU,EAAE,uBAAuB;IACnC,GAAG,EAAE,uBAAuB;IAC5B,IAAI,EAAE,uB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