@lokalise/ragnarok-api-contracts 1.1.0 → 2.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/dist/common.d.ts CHANGED
@@ -2,6 +2,20 @@ import { z } from 'zod';
2
2
  export declare const AUTH_HEADERS: z.ZodObject<{
3
3
  authorization: z.ZodString;
4
4
  }, z.core.$strip>;
5
+ export declare const METADATA_SCHEMA: z.ZodRecord<z.ZodString, z.ZodUnknown>;
6
+ export type Metadata = z.infer<typeof METADATA_SCHEMA>;
7
+ export declare const INTEGRATION_INPUT_SCHEMA: z.ZodObject<{
8
+ engine: z.ZodOptional<z.ZodEnum<{
9
+ readonly CLAUDE: "Claude";
10
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
11
+ readonly GPT: "GPT";
12
+ readonly GEMINI: "Gemini";
13
+ readonly DEEPL: "DeepL";
14
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
15
+ }>>;
16
+ isForced: z.ZodDefault<z.ZodBoolean>;
17
+ }, z.core.$strip>;
18
+ export type IntegrationInput = z.infer<typeof INTEGRATION_INPUT_SCHEMA>;
5
19
  export declare const WEBHOOK_SCHEMA: z.ZodObject<{
6
20
  url: z.ZodURL;
7
21
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
package/dist/common.js CHANGED
@@ -1,7 +1,20 @@
1
+ import { RealIntegrationEngineEnum } from '@lokalise/polyglot-sdk';
1
2
  import { z } from 'zod';
2
3
  export const AUTH_HEADERS = z.object({
3
4
  authorization: z.string(),
4
5
  });
6
+ export const METADATA_SCHEMA = z
7
+ .record(z.string(), z.unknown())
8
+ .describe('A free-form object that can be used to provide some additional info');
9
+ export const INTEGRATION_INPUT_SCHEMA = z
10
+ .object({
11
+ engine: z.enum(RealIntegrationEngineEnum).optional().describe('Preferred translation engine'),
12
+ isForced: z
13
+ .boolean()
14
+ .default(false)
15
+ .describe('If true, the request will fail if the engine is unavailable instead of falling back'),
16
+ })
17
+ .describe('A preferred integration to be used for Translation');
5
18
  export const WEBHOOK_SCHEMA = z
6
19
  .object({
7
20
  url: z
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,GAAG,EAAE,CAAC;SACH,GAAG,EAAE;SACL,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,CACP,2FAA2F,CAC5F;IACH,OAAO,EAAE,CAAC;SACP,MAAM,CACL,CAAC;SACE,MAAM,EAAE;SACR,KAAK,CAAC,iBAAiB,EAAE;QACxB,OAAO,EAAE,6DAA6D;KACvE,CAAC;SACD,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CAAC,yDAAyD,CAAC,EACtE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,mDAAmD,CAAC,CAC1F;SACA,QAAQ,EAAE;SACV,QAAQ,CAAC,uDAAuD,CAAC;CACrE,CAAC;KACD,QAAQ,CAAC,sEAAsE,CAAC,CAAA"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;KAC/B,QAAQ,CAAC,qEAAqE,CAAC,CAAA;AAIlF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7F,QAAQ,EAAE,CAAC;SACR,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,qFAAqF,CACtF;CACJ,CAAC;KACD,QAAQ,CAAC,oDAAoD,CAAC,CAAA;AAIjE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,GAAG,EAAE,CAAC;SACH,GAAG,EAAE;SACL,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,CACP,2FAA2F,CAC5F;IACH,OAAO,EAAE,CAAC;SACP,MAAM,CACL,CAAC;SACE,MAAM,EAAE;SACR,KAAK,CAAC,iBAAiB,EAAE;QACxB,OAAO,EAAE,6DAA6D;KACvE,CAAC;SACD,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,CAAC,yDAAyD,CAAC,EACtE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,mDAAmD,CAAC,CAC1F;SACA,QAAQ,EAAE;SACV,QAAQ,CAAC,uDAAuD,CAAC;CACrE,CAAC;KACD,QAAQ,CAAC,sEAAsE,CAAC,CAAA"}
@@ -11,6 +11,24 @@ export declare const getEvaluation: import("@lokalise/api-contracts").GetRouteDe
11
11
  completed: "completed";
12
12
  failed: "failed";
13
13
  }>;
14
+ resultByConfigurationName: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
15
+ global: z.ZodObject<{
16
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
17
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
18
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
19
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
20
+ bleu: z.ZodOptional<z.ZodNumber>;
21
+ meteor: z.ZodOptional<z.ZodNumber>;
22
+ }, z.core.$strip>;
23
+ }, z.core.$catchall<z.ZodObject<{
24
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
25
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
26
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
27
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
28
+ bleu: z.ZodOptional<z.ZodNumber>;
29
+ meteor: z.ZodOptional<z.ZodNumber>;
30
+ }, z.core.$strip>>>>>;
31
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
32
  }, z.core.$strip>, z.ZodObject<{
15
33
  evaluationId: z.ZodUUID;
16
34
  }, z.core.$strip>, undefined, z.ZodObject<{
@@ -19,6 +37,55 @@ export declare const getEvaluation: import("@lokalise/api-contracts").GetRouteDe
19
37
  export declare const DATASET_INPUT_SCHEMA: z.ZodObject<{
20
38
  fileUrl: z.ZodURL;
21
39
  }, z.core.$strip>;
40
+ export declare const RUN_CONFIGURATION_INPUT_SCHEMA: z.ZodObject<{
41
+ name: z.ZodString;
42
+ integration: z.ZodOptional<z.ZodObject<{
43
+ engine: z.ZodOptional<z.ZodEnum<{
44
+ readonly CLAUDE: "Claude";
45
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
46
+ readonly GPT: "GPT";
47
+ readonly GEMINI: "Gemini";
48
+ readonly DEEPL: "DeepL";
49
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
50
+ }>>;
51
+ isForced: z.ZodDefault<z.ZodBoolean>;
52
+ }, z.core.$strip>>;
53
+ useExamples: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
54
+ useStyleguide: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
55
+ useGlossary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
56
+ useDescriptions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
57
+ }, z.core.$strip>;
58
+ export type RunConfigurationInput = z.infer<typeof RUN_CONFIGURATION_INPUT_SCHEMA>;
59
+ declare const SCHEDULE_EVALUATION_BODY_SCHEMA: z.ZodObject<{
60
+ ownerId: z.ZodString;
61
+ datasets: z.ZodArray<z.ZodObject<{
62
+ fileUrl: z.ZodURL;
63
+ }, z.core.$strip>>;
64
+ webhook: z.ZodObject<{
65
+ url: z.ZodURL;
66
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ }, z.core.$strip>;
68
+ runConfigurations: z.ZodArray<z.ZodObject<{
69
+ name: z.ZodString;
70
+ integration: z.ZodOptional<z.ZodObject<{
71
+ engine: z.ZodOptional<z.ZodEnum<{
72
+ readonly CLAUDE: "Claude";
73
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
74
+ readonly GPT: "GPT";
75
+ readonly GEMINI: "Gemini";
76
+ readonly DEEPL: "DeepL";
77
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
78
+ }>>;
79
+ isForced: z.ZodDefault<z.ZodBoolean>;
80
+ }, z.core.$strip>>;
81
+ useExamples: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
82
+ useStyleguide: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
83
+ useGlossary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
84
+ useDescriptions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
85
+ }, z.core.$strip>>;
86
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
+ }, z.core.$strip>;
88
+ export type ScheduleEvaluationInput = z.infer<typeof SCHEDULE_EVALUATION_BODY_SCHEMA>;
22
89
  export declare const postScheduleEvaluation: import("@lokalise/api-contracts").PayloadRouteDefinition<z.ZodObject<{
23
90
  ownerId: z.ZodString;
24
91
  datasets: z.ZodArray<z.ZodObject<{
@@ -28,6 +95,25 @@ export declare const postScheduleEvaluation: import("@lokalise/api-contracts").P
28
95
  url: z.ZodURL;
29
96
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
30
97
  }, z.core.$strip>;
98
+ runConfigurations: z.ZodArray<z.ZodObject<{
99
+ name: z.ZodString;
100
+ integration: z.ZodOptional<z.ZodObject<{
101
+ engine: z.ZodOptional<z.ZodEnum<{
102
+ readonly CLAUDE: "Claude";
103
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
104
+ readonly GPT: "GPT";
105
+ readonly GEMINI: "Gemini";
106
+ readonly DEEPL: "DeepL";
107
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
108
+ }>>;
109
+ isForced: z.ZodDefault<z.ZodBoolean>;
110
+ }, z.core.$strip>>;
111
+ useExamples: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
112
+ useStyleguide: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
113
+ useGlossary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
114
+ useDescriptions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
115
+ }, z.core.$strip>>;
116
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
117
  }, z.core.$strip>, z.ZodObject<{
32
118
  evaluationId: z.ZodUUID;
33
119
  }, z.core.$strip>, undefined, undefined, z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  import { buildRestContract } from '@lokalise/api-contracts';
2
2
  import { z } from 'zod';
3
- import { AUTH_HEADERS, WEBHOOK_SCHEMA } from "./common.js";
3
+ import { AUTH_HEADERS, INTEGRATION_INPUT_SCHEMA, METADATA_SCHEMA, WEBHOOK_SCHEMA, } from "./common.js";
4
4
  import { EVALUATION_SCHEMA } from "./objects.js";
5
5
  const GET_EVALUATION_SCHEMA = z.object({
6
6
  evaluationId: z.uuid().describe('The unique identifier of the evaluation to retrieve.'),
@@ -16,16 +16,58 @@ export const getEvaluation = buildRestContract({
16
16
  export const DATASET_INPUT_SCHEMA = z.object({
17
17
  fileUrl: z.url().describe('Presigned URL to the JSONL dataset file'),
18
18
  });
19
+ export const RUN_CONFIGURATION_INPUT_SCHEMA = z.object({
20
+ name: z
21
+ .string()
22
+ .min(1)
23
+ .describe('A unique (within the request) identifier for the configuration'),
24
+ integration: INTEGRATION_INPUT_SCHEMA.optional().describe('A preferred integration to be used for Translation'),
25
+ useExamples: z
26
+ .boolean()
27
+ .optional()
28
+ .default(true)
29
+ .describe('If false, will not send translation examples with Translation calls.'),
30
+ useStyleguide: z
31
+ .boolean()
32
+ .optional()
33
+ .default(true)
34
+ .describe('If false, will not send styleguide with Translation calls.'),
35
+ useGlossary: z
36
+ .boolean()
37
+ .optional()
38
+ .default(true)
39
+ .describe('If false, will not send glossary terms with Translation calls.'),
40
+ useDescriptions: z
41
+ .boolean()
42
+ .optional()
43
+ .default(true)
44
+ .describe('If false, will not send neither global nor per-item descriptions with Translation calls.'),
45
+ });
46
+ const SCHEDULE_EVALUATION_BODY_SCHEMA = z
47
+ .object({
48
+ ownerId: z
49
+ .string()
50
+ .min(1)
51
+ .describe('Owner identifier (team ID or similar) for this evaluation'),
52
+ datasets: z.array(DATASET_INPUT_SCHEMA).min(1).describe('Dataset files to process'),
53
+ webhook: WEBHOOK_SCHEMA.describe('Webhook for completion notification'),
54
+ runConfigurations: z
55
+ .array(RUN_CONFIGURATION_INPUT_SCHEMA)
56
+ .min(1, 'At least one run configuration is required')
57
+ .max(10, 'Maximum 10 run configurations allowed')
58
+ .describe('A list of configurations to evaluate using dataset items and aggregate metrics on.'),
59
+ metadata: METADATA_SCHEMA.optional(),
60
+ })
61
+ .refine((data) => {
62
+ const names = data.runConfigurations.map((c) => c.name);
63
+ return new Set(names).size === names.length;
64
+ }, { message: 'Run configuration names must be unique within the request' });
19
65
  export const postScheduleEvaluation = buildRestContract({
20
66
  method: 'post',
21
67
  pathResolver: () => '/v1/evaluations',
22
68
  description: 'Schedule evaluation',
23
69
  requestHeaderSchema: AUTH_HEADERS,
24
- requestBodySchema: z.object({
25
- ownerId: z.string().describe('Owner identifier (team ID or similar) for this evaluation'),
26
- datasets: z.array(DATASET_INPUT_SCHEMA).min(1).describe('Dataset files to process'),
27
- webhook: WEBHOOK_SCHEMA.describe('Webhook for completion notification'),
28
- }),
70
+ requestBodySchema: SCHEDULE_EVALUATION_BODY_SCHEMA,
29
71
  successResponseBodySchema: z.object({
30
72
  evaluationId: z
31
73
  .uuid()
@@ -1 +1 @@
1
- {"version":3,"file":"evaluation-contracts.js","sourceRoot":"","sources":["../src/evaluation-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;CACxF,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC;IAC7C,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,CAAC,MAA2B,EAAE,EAAE,CAAC,mBAAmB,MAAM,CAAC,YAAY,EAAE;IACvF,WAAW,EAAE,2BAA2B;IACxC,uBAAuB,EAAE,qBAAqB;IAC9C,mBAAmB,EAAE,YAAY;IACjC,yBAAyB,EAAE,iBAAiB;CAC7C,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,GA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;SACN,QAAQ,CAAC,2DAA2D,CAAC;IACxE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACnF,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACvE,iBAAiB,EAAE,CAAC;SACjB,KAAK,CAAC,8BAA8B,CAAC;SACrC,GAAG,CAAC,CAAC,EAAE,4CAA4C,CAAC;SACpD,GAAG,CAAC,EAAE,EAAE,uCAAuC,CAAC;SAChD,QAAQ,CACP,oFAAoF,CACrF;IACH,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE;CACrC,CAAC;KACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;IACP,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACvD,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,CAAA;AAC7C,CAAC,EACD,EAAE,OAAO,EAAE,2DAA2D,EAAE,CACzE,CAAA;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;IACtD,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,GAAG,EAAE,CAAC,iBAAiB;IACrC,WAAW,EAAE,qBAAqB;IAClC,mBAAmB,EAAE,YAAY;IACjC,iBAAiB,EAAE,+BAA+B;IAClD,yBAAyB,EAAE,CAAC,CAAC,MAAM,CAAC;QAClC,YAAY,EAAE,CAAC;aACZ,IAAI,EAAE;aACN,QAAQ,CACP,qGAAqG,CACtG;KACJ,CAAC;CACH,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { AUTH_HEADERS } from './common.ts';
1
+ export * from './common.ts';
2
2
  export * from './evaluation-contracts.ts';
3
3
  export * from './objects.ts';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { AUTH_HEADERS } from "./common.js";
1
+ export * from "./common.js";
2
2
  export * from "./evaluation-contracts.js";
3
3
  export * from "./objects.js";
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,cAAc,2BAA2B,CAAA;AACzC,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,2BAA2B,CAAA;AACzC,cAAc,cAAc,CAAA"}
package/dist/objects.d.ts CHANGED
@@ -1,4 +1,40 @@
1
1
  import { z } from 'zod';
2
+ export declare const CONFIGURATION_RESULT_SCHEMA: z.ZodObject<{
3
+ global: z.ZodObject<{
4
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
5
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
6
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
7
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
8
+ bleu: z.ZodOptional<z.ZodNumber>;
9
+ meteor: z.ZodOptional<z.ZodNumber>;
10
+ }, z.core.$strip>;
11
+ }, z.core.$catchall<z.ZodObject<{
12
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
13
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
14
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
15
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
16
+ bleu: z.ZodOptional<z.ZodNumber>;
17
+ meteor: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strip>>>;
19
+ export type ConfigurationResult = z.infer<typeof CONFIGURATION_RESULT_SCHEMA>;
20
+ export declare const RESULT_BY_CONFIGURATION_NAME_SCHEMA: z.ZodRecord<z.ZodString, z.ZodObject<{
21
+ global: z.ZodObject<{
22
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
23
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
24
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
25
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
26
+ bleu: z.ZodOptional<z.ZodNumber>;
27
+ meteor: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strip>;
29
+ }, z.core.$catchall<z.ZodObject<{
30
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
31
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
32
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
33
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
34
+ bleu: z.ZodOptional<z.ZodNumber>;
35
+ meteor: z.ZodOptional<z.ZodNumber>;
36
+ }, z.core.$strip>>>>;
37
+ export type ResultByConfigurationName = z.infer<typeof RESULT_BY_CONFIGURATION_NAME_SCHEMA>;
2
38
  export declare const EVALUATION_SCHEMA: z.ZodObject<{
3
39
  id: z.ZodUUID;
4
40
  ownerId: z.ZodString;
@@ -7,5 +43,23 @@ export declare const EVALUATION_SCHEMA: z.ZodObject<{
7
43
  completed: "completed";
8
44
  failed: "failed";
9
45
  }>;
46
+ resultByConfigurationName: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
47
+ global: z.ZodObject<{
48
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
49
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
50
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
51
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
52
+ bleu: z.ZodOptional<z.ZodNumber>;
53
+ meteor: z.ZodOptional<z.ZodNumber>;
54
+ }, z.core.$strip>;
55
+ }, z.core.$catchall<z.ZodObject<{
56
+ referenceTranslationScore: z.ZodOptional<z.ZodNumber>;
57
+ actualTranslationScore: z.ZodOptional<z.ZodNumber>;
58
+ perfectMatch: z.ZodOptional<z.ZodNumber>;
59
+ translationErrorRate: z.ZodOptional<z.ZodNumber>;
60
+ bleu: z.ZodOptional<z.ZodNumber>;
61
+ meteor: z.ZodOptional<z.ZodNumber>;
62
+ }, z.core.$strip>>>>>;
63
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10
64
  }, z.core.$strip>;
11
65
  export type Evaluation = z.infer<typeof EVALUATION_SCHEMA>;
package/dist/objects.js CHANGED
@@ -1,7 +1,41 @@
1
1
  import { z } from 'zod';
2
+ const METRICS_SCHEMA = z.object({
3
+ referenceTranslationScore: z
4
+ .number()
5
+ .optional()
6
+ .describe('Average LQA score of reference translations'),
7
+ actualTranslationScore: z
8
+ .number()
9
+ .optional()
10
+ .describe('Average LQA score of actual (generated) translations'),
11
+ perfectMatch: z
12
+ .number()
13
+ .optional()
14
+ .describe('Rate of translations that exactly match the reference (0–1)'),
15
+ translationErrorRate: z
16
+ .number()
17
+ .optional()
18
+ .describe('TER score measuring post-editing effort relative to reference length'),
19
+ bleu: z
20
+ .number()
21
+ .optional()
22
+ .describe('BLEU score measuring n-gram overlap with reference translations'),
23
+ meteor: z.number().optional().describe('METEOR score measuring translation quality'),
24
+ });
25
+ export const CONFIGURATION_RESULT_SCHEMA = z
26
+ .object({
27
+ global: METRICS_SCHEMA.describe('Aggregated metrics across all language pairs for this configuration'),
28
+ })
29
+ .catchall(METRICS_SCHEMA)
30
+ .describe('Metrics keyed by language pair (e.g. "en->pl") plus a "global" aggregate');
31
+ export const RESULT_BY_CONFIGURATION_NAME_SCHEMA = z
32
+ .record(z.string(), CONFIGURATION_RESULT_SCHEMA)
33
+ .describe('Evaluation results grouped by configuration name');
2
34
  export const EVALUATION_SCHEMA = z.object({
3
- id: z.uuid(),
4
- ownerId: z.string(),
5
- status: z.enum(['pending', 'completed', 'failed']),
35
+ id: z.uuid().describe('Unique identifier of the evaluation request'),
36
+ ownerId: z.string().describe('Owner identifier (team ID or similar) for this evaluation'),
37
+ status: z.enum(['pending', 'completed', 'failed']).describe('Current status of the evaluation'),
38
+ resultByConfigurationName: RESULT_BY_CONFIGURATION_NAME_SCHEMA.nullable(),
39
+ metadata: z.record(z.string(), z.unknown()).nullable(),
6
40
  });
7
41
  //# sourceMappingURL=objects.js.map
@@ -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,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;IACZ,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;CACnD,CAAC,CAAA"}
1
+ {"version":3,"file":"objects.js","sourceRoot":"","sources":["../src/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,yBAAyB,EAAE,CAAC;SACzB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,sBAAsB,EAAE,CAAC;SACtB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sDAAsD,CAAC;IACnE,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,6DAA6D,CAAC;IAC1E,oBAAoB,EAAE,CAAC;SACpB,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;IA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