@lokalise/ragnarok-api-contracts 0.0.3 → 1.0.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 +25 -0
- package/dist/evaluation-contracts.js +22 -4
- package/dist/evaluation-contracts.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/objects.d.ts +11 -0
- package/dist/objects.js +7 -0
- package/dist/objects.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
declare const GET_EVALUATION_SCHEMA: z.ZodObject<{
|
|
3
|
+
evaluationId: z.ZodUUID;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type GetEvaluationParams = z.infer<typeof GET_EVALUATION_SCHEMA>;
|
|
6
|
+
export declare const getEvaluation: import("@lokalise/api-contracts").GetRouteDefinition<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
ownerId: z.ZodString;
|
|
9
|
+
status: z.ZodEnum<{
|
|
10
|
+
pending: "pending";
|
|
11
|
+
completed: "completed";
|
|
12
|
+
failed: "failed";
|
|
13
|
+
}>;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
evaluationId: z.ZodUUID;
|
|
16
|
+
}, z.core.$strip>, undefined, z.ZodObject<{
|
|
17
|
+
authorization: z.ZodString;
|
|
18
|
+
}, z.core.$strip>, undefined, false, false, undefined>;
|
|
19
|
+
export declare const DATASET_INPUT_SCHEMA: z.ZodObject<{
|
|
20
|
+
fileUrl: z.ZodURL;
|
|
21
|
+
}, z.core.$strip>;
|
|
2
22
|
export declare const postScheduleEvaluation: import("@lokalise/api-contracts").PayloadRouteDefinition<z.ZodObject<{
|
|
23
|
+
ownerId: z.ZodString;
|
|
24
|
+
datasets: z.ZodArray<z.ZodObject<{
|
|
25
|
+
fileUrl: z.ZodURL;
|
|
26
|
+
}, z.core.$strip>>;
|
|
3
27
|
webhook: z.ZodObject<{
|
|
4
28
|
url: z.ZodURL;
|
|
5
29
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -9,3 +33,4 @@ export declare const postScheduleEvaluation: import("@lokalise/api-contracts").P
|
|
|
9
33
|
}, z.core.$strip>, undefined, undefined, z.ZodObject<{
|
|
10
34
|
authorization: z.ZodString;
|
|
11
35
|
}, z.core.$strip>, undefined, false, false, undefined>;
|
|
36
|
+
export {};
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import { buildPayloadRoute } from '@lokalise/api-contracts';
|
|
1
|
+
import { buildGetRoute, buildPayloadRoute } from '@lokalise/api-contracts';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { AUTH_HEADERS, WEBHOOK_SCHEMA } from "./common.js";
|
|
4
|
+
import { EVALUATION_SCHEMA } from "./objects.js";
|
|
5
|
+
const GET_EVALUATION_SCHEMA = z.object({
|
|
6
|
+
evaluationId: z.uuid().describe('The unique identifier of the evaluation to retrieve.'),
|
|
7
|
+
});
|
|
8
|
+
export const getEvaluation = buildGetRoute({
|
|
9
|
+
pathResolver: (params) => `/v1/evaluations/${params.evaluationId}`,
|
|
10
|
+
description: 'Retrieve evaluation by id',
|
|
11
|
+
requestPathParamsSchema: GET_EVALUATION_SCHEMA,
|
|
12
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
13
|
+
successResponseBodySchema: EVALUATION_SCHEMA,
|
|
14
|
+
});
|
|
15
|
+
export const DATASET_INPUT_SCHEMA = z.object({
|
|
16
|
+
fileUrl: z.url().describe('Presigned URL to the JSONL dataset file'),
|
|
17
|
+
});
|
|
4
18
|
export const postScheduleEvaluation = buildPayloadRoute({
|
|
5
19
|
method: 'post',
|
|
6
|
-
pathResolver: () => '/
|
|
20
|
+
pathResolver: () => '/v1/evaluations',
|
|
7
21
|
description: 'Schedule evaluation',
|
|
8
22
|
requestHeaderSchema: AUTH_HEADERS,
|
|
9
23
|
requestBodySchema: z.object({
|
|
10
|
-
|
|
24
|
+
ownerId: z.string().describe('Owner identifier (team ID or similar) for this evaluation'),
|
|
25
|
+
datasets: z.array(DATASET_INPUT_SCHEMA).min(1).describe('Dataset files to process'),
|
|
26
|
+
webhook: WEBHOOK_SCHEMA.describe('Webhook for completion notification'),
|
|
11
27
|
}),
|
|
12
28
|
successResponseBodySchema: z.object({
|
|
13
|
-
evaluationId: z
|
|
29
|
+
evaluationId: z
|
|
30
|
+
.uuid()
|
|
31
|
+
.describe('The unique identifier of the scheduled evaluation. Use it to retrieve the evaluation results later.'),
|
|
14
32
|
}),
|
|
15
33
|
});
|
|
16
34
|
//# sourceMappingURL=evaluation-contracts.js.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"evaluation-contracts.js","sourceRoot":"","sources":["../src/evaluation-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC1E,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,aAAa,CAAC;IACzC,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,GAAG,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACrE,CAAC,CAAA;AAEF,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,CAAC,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;QACzF,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QACnF,OAAO,EAAE,cAAc,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACxE,CAAC;IACF,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 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './evaluation-contracts.ts';
|
|
2
|
+
export * from './objects.ts';
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EVALUATION_SCHEMA: z.ZodObject<{
|
|
3
|
+
id: z.ZodUUID;
|
|
4
|
+
ownerId: z.ZodString;
|
|
5
|
+
status: z.ZodEnum<{
|
|
6
|
+
pending: "pending";
|
|
7
|
+
completed: "completed";
|
|
8
|
+
failed: "failed";
|
|
9
|
+
}>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type Evaluation = z.infer<typeof EVALUATION_SCHEMA>;
|
package/dist/objects.js
ADDED
|
@@ -0,0 +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"}
|