@lokalise/content-type-app-engine-contracts 3.22.1 → 3.24.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/schemas/settings/settingsApiSchemas.js +2 -2
- package/dist/schemas/settings/settingsApiSchemas.js.map +1 -1
- package/dist/schemas/settings/settingsSchemas.d.ts +88 -3
- package/dist/schemas/settings/settingsSchemas.js +20 -18
- package/dist/schemas/settings/settingsSchemas.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { buildGetRoute, buildPayloadRoute } from '@lokalise/api-contracts';
|
|
|
2
2
|
import { AUTHORIZATION_HEADER_SCHEMA, COMMON_ERROR_RESPONSE_SCHEMA_V2, } from "../commonRequestSchemas.js";
|
|
3
3
|
import { GET_SETTINGS_RESPONSE, SETTINGS_PATH_PARAMS, UPDATE_SETTINGS_BODY, UPDATE_SETTINGS_RESPONSE, } from "./settingsSchemas.js";
|
|
4
4
|
export const getSettingsContract = buildGetRoute({
|
|
5
|
-
pathResolver: ({ type, id }) => `/v1/${type}/${id}
|
|
5
|
+
pathResolver: ({ type, id }) => `/v1/settings/parent/${type}/${id}`,
|
|
6
6
|
requestPathParamsSchema: SETTINGS_PATH_PARAMS,
|
|
7
7
|
description: 'Get settings for parent',
|
|
8
8
|
successResponseBodySchema: GET_SETTINGS_RESPONSE,
|
|
@@ -14,7 +14,7 @@ export const getSettingsContract = buildGetRoute({
|
|
|
14
14
|
});
|
|
15
15
|
export const updateSettingsContract = buildPayloadRoute({
|
|
16
16
|
method: 'put',
|
|
17
|
-
pathResolver: ({ type, id }) => `/v1/${type}/${id}
|
|
17
|
+
pathResolver: ({ type, id }) => `/v1/settings/parent/${type}/${id}`,
|
|
18
18
|
requestPathParamsSchema: SETTINGS_PATH_PARAMS,
|
|
19
19
|
description: 'Upsert settings for parent',
|
|
20
20
|
requestBodySchema: UPDATE_SETTINGS_BODY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsApiSchemas.js","sourceRoot":"","sources":["../../../src/schemas/settings/settingsApiSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;IAC/C,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"settingsApiSchemas.js","sourceRoot":"","sources":["../../../src/schemas/settings/settingsApiSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC;IAC/C,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,uBAAuB,IAAI,IAAI,EAAE,EAAE;IACnE,uBAAuB,EAAE,oBAAoB;IAC7C,WAAW,EAAE,yBAAyB;IACtC,yBAAyB,EAAE,qBAAqB;IAChD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B;KACrC;IACD,mBAAmB,EAAE,2BAA2B;CACjD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;IACtD,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,uBAAuB,IAAI,IAAI,EAAE,EAAE;IACnE,uBAAuB,EAAE,oBAAoB;IAC7C,WAAW,EAAE,4BAA4B;IACzC,iBAAiB,EAAE,oBAAoB;IACvC,yBAAyB,EAAE,wBAAwB;IACnD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,wBAAwB;QAC7B,GAAG,EAAE,+BAA+B;QACpC,GAAG,EAAE,+BAA+B;KACrC;IACD,mBAAmB,EAAE,2BAA2B;CACjD,CAAC,CAAA"}
|
|
@@ -1,4 +1,88 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
+
export declare const EXPORT_V1: z.ZodObject<{
|
|
3
|
+
version: z.ZodLiteral<1>;
|
|
4
|
+
content: z.ZodObject<{
|
|
5
|
+
languages: z.ZodArray<z.ZodString>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const EXPORT_VERSIONS: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
version: z.ZodLiteral<1>;
|
|
10
|
+
content: z.ZodObject<{
|
|
11
|
+
languages: z.ZodArray<z.ZodString>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
}, z.core.$strict>], "version">;
|
|
14
|
+
export declare const IMPORT_V1: z.ZodObject<{
|
|
15
|
+
version: z.ZodLiteral<1>;
|
|
16
|
+
content: z.ZodObject<{
|
|
17
|
+
languages: z.ZodArray<z.ZodString>;
|
|
18
|
+
options: z.ZodObject<{
|
|
19
|
+
overrideUpdatedTranslations: z.ZodBoolean;
|
|
20
|
+
skipEmptyTranslations: z.ZodBoolean;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export declare const IMPORT_VERSIONS: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
25
|
+
version: z.ZodLiteral<1>;
|
|
26
|
+
content: z.ZodObject<{
|
|
27
|
+
languages: z.ZodArray<z.ZodString>;
|
|
28
|
+
options: z.ZodObject<{
|
|
29
|
+
overrideUpdatedTranslations: z.ZodBoolean;
|
|
30
|
+
skipEmptyTranslations: z.ZodBoolean;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
}, z.core.$strict>], "version">;
|
|
34
|
+
export declare const FOLDERS_V1: z.ZodObject<{
|
|
35
|
+
version: z.ZodLiteral<1>;
|
|
36
|
+
content: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
slug: z.ZodString;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
}, z.core.$strict>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export declare const FOLDERS_VERSIONS: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
43
|
+
version: z.ZodLiteral<1>;
|
|
44
|
+
content: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
slug: z.ZodString;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>], "version">;
|
|
50
|
+
export declare const ALL_SETTINGS: z.ZodObject<{
|
|
51
|
+
import: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
+
version: z.ZodLiteral<1>;
|
|
53
|
+
content: z.ZodObject<{
|
|
54
|
+
languages: z.ZodArray<z.ZodString>;
|
|
55
|
+
options: z.ZodObject<{
|
|
56
|
+
overrideUpdatedTranslations: z.ZodBoolean;
|
|
57
|
+
skipEmptyTranslations: z.ZodBoolean;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
}, z.core.$strict>], "version">>;
|
|
61
|
+
export: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
+
version: z.ZodLiteral<1>;
|
|
63
|
+
content: z.ZodObject<{
|
|
64
|
+
languages: z.ZodArray<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
}, z.core.$strict>], "version">>;
|
|
67
|
+
folders: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
68
|
+
version: z.ZodLiteral<1>;
|
|
69
|
+
content: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
slug: z.ZodString;
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
}, z.core.$strict>>;
|
|
74
|
+
}, z.core.$strict>], "version">>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const LINK_SETTINGS: z.ZodObject<{
|
|
77
|
+
folders: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
version: z.ZodLiteral<1>;
|
|
79
|
+
content: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
slug: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
}, z.core.$strict>], "version">>;
|
|
85
|
+
}, z.core.$strip>;
|
|
2
86
|
export declare const GET_SETTINGS_RESPONSE: z.ZodObject<{
|
|
3
87
|
settings: z.ZodObject<{
|
|
4
88
|
import: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -27,7 +111,6 @@ export declare const GET_SETTINGS_RESPONSE: z.ZodObject<{
|
|
|
27
111
|
}, z.core.$strict>], "version">>;
|
|
28
112
|
}, z.core.$strip>;
|
|
29
113
|
}, z.core.$strip>;
|
|
30
|
-
export type GetSettingsResponse = z.infer<typeof GET_SETTINGS_RESPONSE>;
|
|
31
114
|
export declare const UPDATE_SETTINGS_RESPONSE: z.ZodObject<{
|
|
32
115
|
settings: z.ZodObject<{
|
|
33
116
|
import: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -84,9 +167,11 @@ export declare const UPDATE_SETTINGS_BODY: z.ZodObject<{
|
|
|
84
167
|
}, z.core.$strict>], "version">>;
|
|
85
168
|
}, z.core.$strip>;
|
|
86
169
|
}, z.core.$strip>;
|
|
87
|
-
export type UpdateSettingsBody = z.infer<typeof UPDATE_SETTINGS_BODY>;
|
|
88
|
-
export type UpdateSettingsResponse = z.infer<typeof UPDATE_SETTINGS_RESPONSE>;
|
|
89
170
|
export declare const SETTINGS_PATH_PARAMS: z.ZodObject<{
|
|
90
171
|
type: z.ZodString;
|
|
91
172
|
id: z.ZodString;
|
|
92
173
|
}, z.core.$strip>;
|
|
174
|
+
export type LinkSettings = z.infer<typeof LINK_SETTINGS>;
|
|
175
|
+
export type GetSettingsResponse = z.infer<typeof GET_SETTINGS_RESPONSE>;
|
|
176
|
+
export type UpdateSettingsBody = z.infer<typeof UPDATE_SETTINGS_BODY>;
|
|
177
|
+
export type UpdateSettingsResponse = z.infer<typeof UPDATE_SETTINGS_RESPONSE>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
// Export
|
|
3
|
-
const
|
|
2
|
+
// Export
|
|
3
|
+
export const EXPORT_V1 = z.strictObject({
|
|
4
4
|
version: z.literal(1),
|
|
5
5
|
content: z.strictObject({
|
|
6
6
|
languages: z.array(z.string().describe('Language iso')),
|
|
7
7
|
}),
|
|
8
8
|
});
|
|
9
|
-
const
|
|
10
|
-
// Import
|
|
11
|
-
const
|
|
9
|
+
export const EXPORT_VERSIONS = z.discriminatedUnion('version', [EXPORT_V1]);
|
|
10
|
+
// Import
|
|
11
|
+
export const IMPORT_V1 = z.strictObject({
|
|
12
12
|
version: z.literal(1),
|
|
13
13
|
content: z.strictObject({
|
|
14
14
|
languages: z.array(z.string().describe('Language iso')),
|
|
@@ -18,9 +18,9 @@ const IMPORT_SETTINGS_V1 = z.strictObject({
|
|
|
18
18
|
}),
|
|
19
19
|
}),
|
|
20
20
|
});
|
|
21
|
-
const
|
|
22
|
-
//
|
|
23
|
-
const
|
|
21
|
+
export const IMPORT_VERSIONS = z.discriminatedUnion('version', [IMPORT_V1]);
|
|
22
|
+
// Folders
|
|
23
|
+
export const FOLDERS_V1 = z.strictObject({
|
|
24
24
|
version: z.literal(1),
|
|
25
25
|
content: z.record(z.string().describe('Language iso'), z.strictObject({
|
|
26
26
|
id: z.string().describe('Folder id'),
|
|
@@ -28,23 +28,25 @@ const FOLDERS_SETTINGS_V1 = z.strictObject({
|
|
|
28
28
|
name: z.string().describe('Folder name'),
|
|
29
29
|
})),
|
|
30
30
|
});
|
|
31
|
-
const
|
|
31
|
+
export const FOLDERS_VERSIONS = z.discriminatedUnion('version', [FOLDERS_V1]);
|
|
32
32
|
// Settings
|
|
33
|
-
const
|
|
34
|
-
import:
|
|
35
|
-
export:
|
|
36
|
-
folders:
|
|
33
|
+
export const ALL_SETTINGS = z.object({
|
|
34
|
+
import: IMPORT_VERSIONS.optional(),
|
|
35
|
+
export: EXPORT_VERSIONS.optional(),
|
|
36
|
+
folders: FOLDERS_VERSIONS.optional(),
|
|
37
37
|
});
|
|
38
|
-
|
|
38
|
+
export const LINK_SETTINGS = ALL_SETTINGS.pick({
|
|
39
|
+
folders: true,
|
|
40
|
+
});
|
|
41
|
+
// HTTP
|
|
39
42
|
export const GET_SETTINGS_RESPONSE = z.object({
|
|
40
|
-
settings:
|
|
43
|
+
settings: ALL_SETTINGS,
|
|
41
44
|
});
|
|
42
|
-
// Update settings
|
|
43
45
|
export const UPDATE_SETTINGS_RESPONSE = z.object({
|
|
44
|
-
settings:
|
|
46
|
+
settings: ALL_SETTINGS,
|
|
45
47
|
});
|
|
46
48
|
export const UPDATE_SETTINGS_BODY = z.object({
|
|
47
|
-
settings:
|
|
49
|
+
settings: ALL_SETTINGS,
|
|
48
50
|
});
|
|
49
51
|
export const SETTINGS_PATH_PARAMS = z.object({
|
|
50
52
|
type: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsSchemas.js","sourceRoot":"","sources":["../../../src/schemas/settings/settingsSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,
|
|
1
|
+
{"version":3,"file":"settingsSchemas.js","sourceRoot":"","sources":["../../../src/schemas/settings/settingsSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,SAAS;AAET,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACrB,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC;QACtB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;KACxD,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;AAE3E,SAAS;AAET,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACrB,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC;QACtB,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QACvD,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC;YACtB,2BAA2B,EAAE,CAAC,CAAC,OAAO,EAAE;YACxC,qBAAqB,EAAE,CAAC,CAAC,OAAO,EAAE;SACnC,CAAC;KACH,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE,CAAC,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