@lokalise/ragnarok-api-contracts 0.0.2 → 0.0.3
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/LICENSE +12 -12
- package/README.md +22 -22
- package/dist/common.d.ts +8 -0
- package/dist/common.js +23 -0
- package/dist/common.js.map +1 -0
- package/dist/evaluation-contracts.d.ts +11 -0
- package/dist/evaluation-contracts.js +16 -0
- package/dist/evaluation-contracts.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -50
package/LICENSE
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Copyright 2026 Lokalise, Inc.
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
See the License for the specific language governing permissions and
|
|
1
|
+
Copyright 2026 Lokalise, Inc.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
13
|
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# @lokalise/ragnarok-api-contracts
|
|
2
|
-
|
|
3
|
-
API contracts for the Lokalise Ragnarok Service.
|
|
4
|
-
This package provides type-safe, validated API route definitions using Zod schemas.
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm install @lokalise/ragnarok-api-contracts
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
### Peer Dependencies
|
|
13
|
-
|
|
14
|
-
This package requires `zod` as a peer dependency:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install zod@^4.0.0
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## License
|
|
21
|
-
|
|
22
|
-
Apache-2.0
|
|
1
|
+
# @lokalise/ragnarok-api-contracts
|
|
2
|
+
|
|
3
|
+
API contracts for the Lokalise Ragnarok Service.
|
|
4
|
+
This package provides type-safe, validated API route definitions using Zod schemas.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @lokalise/ragnarok-api-contracts
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Peer Dependencies
|
|
13
|
+
|
|
14
|
+
This package requires `zod` as a peer dependency:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install zod@^4.0.0
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## License
|
|
21
|
+
|
|
22
|
+
Apache-2.0
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AUTH_HEADERS: z.ZodObject<{
|
|
3
|
+
authorization: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const WEBHOOK_SCHEMA: z.ZodObject<{
|
|
6
|
+
url: z.ZodURL;
|
|
7
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const AUTH_HEADERS = z.object({
|
|
3
|
+
authorization: z.string(),
|
|
4
|
+
});
|
|
5
|
+
export const WEBHOOK_SCHEMA = z
|
|
6
|
+
.object({
|
|
7
|
+
url: z
|
|
8
|
+
.url()
|
|
9
|
+
.max(2048)
|
|
10
|
+
.describe('The URL to which the webhook will be sent as HTTP POST request once the job has finished.'),
|
|
11
|
+
headers: z
|
|
12
|
+
.record(z
|
|
13
|
+
.string()
|
|
14
|
+
.regex(/^[A-Za-z0-9-]+$/, {
|
|
15
|
+
message: 'Header names must contain only letters, numbers, and dashes',
|
|
16
|
+
})
|
|
17
|
+
.max(128)
|
|
18
|
+
.describe('The HTTP header name (e.g., Authorization, X-Custom-Id)'), z.string().min(1).max(2048).describe('The HTTP header value; must be a non-empty string'))
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Additional headers to include in the webhook request.'),
|
|
21
|
+
})
|
|
22
|
+
.describe('Configuration for sending a webhook callback when the job completes.');
|
|
23
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const postScheduleEvaluation: import("@lokalise/api-contracts").PayloadRouteDefinition<z.ZodObject<{
|
|
3
|
+
webhook: z.ZodObject<{
|
|
4
|
+
url: z.ZodURL;
|
|
5
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
evaluationId: z.ZodUUID;
|
|
9
|
+
}, z.core.$strip>, undefined, undefined, z.ZodObject<{
|
|
10
|
+
authorization: z.ZodString;
|
|
11
|
+
}, z.core.$strip>, undefined, false, false, undefined>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { buildPayloadRoute } from '@lokalise/api-contracts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AUTH_HEADERS, WEBHOOK_SCHEMA } from "./common.js";
|
|
4
|
+
export const postScheduleEvaluation = buildPayloadRoute({
|
|
5
|
+
method: 'post',
|
|
6
|
+
pathResolver: () => '/evaluation/schedule',
|
|
7
|
+
description: 'Schedule evaluation',
|
|
8
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
9
|
+
requestBodySchema: z.object({
|
|
10
|
+
webhook: WEBHOOK_SCHEMA,
|
|
11
|
+
}),
|
|
12
|
+
successResponseBodySchema: z.object({
|
|
13
|
+
evaluationId: z.uuid(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=evaluation-contracts.js.map
|
|
@@ -0,0 +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;AAE1D,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;IACtD,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,GAAG,EAAE,CAAC,sBAAsB;IAC1C,WAAW,EAAE,qBAAqB;IAClC,mBAAmB,EAAE,YAAY;IACjC,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,cAAc;KACxB,CAAC;IACF,yBAAyB,EAAE,CAAC,CAAC,MAAM,CAAC;QAClC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE;KACvB,CAAC;CACH,CAAC,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { postScheduleEvaluation } from './evaluation-contracts.ts';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@lokalise/ragnarok-api-contracts",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"author": {
|
|
5
|
-
"name": "Lokalise",
|
|
6
|
-
"url": "https://lokalise.com"
|
|
7
|
-
},
|
|
8
|
-
"description": "Ragnarok API contracts",
|
|
9
|
-
"license": "Apache-2.0",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git://github.com/lokalise/ragnarok.git",
|
|
13
|
-
"directory": "packages/ragnarok-api-contracts"
|
|
14
|
-
},
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist"
|
|
20
|
-
],
|
|
21
|
-
"type": "module",
|
|
22
|
-
"main": "dist/index.js",
|
|
23
|
-
"exports": {
|
|
24
|
-
".": "./dist/index.js",
|
|
25
|
-
"./package.json": "./package.json"
|
|
26
|
-
},
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
32
|
-
"lint": "biome check . && tsc",
|
|
33
|
-
"lint:fix": "biome check --write",
|
|
34
|
-
"package-version": "echo $npm_package_version",
|
|
35
|
-
"postversion": "biome check --write package.json"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@biomejs/biome": "^2.3.8",
|
|
39
|
-
"@lokalise/biome-config": "^3.1.0",
|
|
40
|
-
"@lokalise/tsconfig": "^3.0.0",
|
|
41
|
-
"rimraf": "^6.0.1",
|
|
42
|
-
"typescript": "5.9.3"
|
|
43
|
-
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"zod": "^4.0.0"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"@lokalise/api-contracts": "^6.1.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@lokalise/ragnarok-api-contracts",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "Lokalise",
|
|
6
|
+
"url": "https://lokalise.com"
|
|
7
|
+
},
|
|
8
|
+
"description": "Ragnarok API contracts",
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git://github.com/lokalise/ragnarok.git",
|
|
13
|
+
"directory": "packages/ragnarok-api-contracts"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"main": "dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./dist/index.js",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
32
|
+
"lint": "biome check . && tsc",
|
|
33
|
+
"lint:fix": "biome check --write",
|
|
34
|
+
"package-version": "echo $npm_package_version",
|
|
35
|
+
"postversion": "biome check --write package.json"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@biomejs/biome": "^2.3.8",
|
|
39
|
+
"@lokalise/biome-config": "^3.1.0",
|
|
40
|
+
"@lokalise/tsconfig": "^3.0.0",
|
|
41
|
+
"rimraf": "^6.0.1",
|
|
42
|
+
"typescript": "5.9.3"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"zod": "^4.0.0"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@lokalise/api-contracts": "^6.1.0"
|
|
49
|
+
}
|
|
50
|
+
}
|