@lokalise/connector-api-contracts 1.47.0 → 2.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.
|
@@ -11,23 +11,34 @@ export declare const ITEM_IDENTIFIER_SCHEMA: z.ZodObject<{
|
|
|
11
11
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
13
|
export type ItemIdentifier = z.infer<typeof ITEM_IDENTIFIER_SCHEMA>;
|
|
14
|
-
export
|
|
14
|
+
export declare const CONTENT_UNIT_SOURCE: z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"inline">;
|
|
16
|
+
value: z.ZodString;
|
|
17
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"remote">;
|
|
20
|
+
fileUrl: z.ZodString;
|
|
21
|
+
contentSize: z.ZodOptional<z.ZodString>;
|
|
22
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
23
|
+
value: z.ZodOptional<z.ZodNever>;
|
|
24
|
+
}, z.core.$strip>]>;
|
|
25
|
+
export type ContentUnitSource = z.infer<typeof CONTENT_UNIT_SOURCE>;
|
|
15
26
|
export declare const CONTENT_ITEM_SCHEMA: z.ZodObject<{
|
|
16
27
|
uniqueId: z.ZodString;
|
|
17
28
|
groupId: z.ZodString;
|
|
18
29
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
19
30
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
20
|
-
|
|
31
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
21
32
|
type: z.ZodLiteral<"inline">;
|
|
22
33
|
value: z.ZodString;
|
|
23
|
-
|
|
34
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
24
35
|
}, z.core.$strip>, z.ZodObject<{
|
|
25
36
|
type: z.ZodLiteral<"remote">;
|
|
26
|
-
|
|
37
|
+
fileUrl: z.ZodString;
|
|
27
38
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
28
39
|
filePath: z.ZodOptional<z.ZodString>;
|
|
29
40
|
value: z.ZodOptional<z.ZodNever>;
|
|
30
|
-
}, z.core.$strip>]
|
|
41
|
+
}, z.core.$strip>]>>>;
|
|
31
42
|
}, z.core.$strip>;
|
|
32
43
|
export type ContentItem = z.infer<typeof CONTENT_ITEM_SCHEMA>;
|
|
33
44
|
export declare const apiError: z.ZodObject<{
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CONTENT_UNIT_SOURCE } from '@lokalise/content-conversion-schemas';
|
|
2
1
|
import { z } from 'zod/v4';
|
|
3
2
|
import { CONNECTOR_ID_HEADER } from "./connectorApiConstants.js";
|
|
4
3
|
export const ERROR_RESPONSE_SCHEMA = z.object({
|
|
@@ -11,10 +10,26 @@ export const ITEM_IDENTIFIER_SCHEMA = z.object({
|
|
|
11
10
|
groupId: z.string(),
|
|
12
11
|
metadata: z.record(z.any(), z.any()),
|
|
13
12
|
});
|
|
14
|
-
export
|
|
13
|
+
export const CONTENT_UNIT_SOURCE = z.union([
|
|
14
|
+
z.object({
|
|
15
|
+
type: z.literal('inline'),
|
|
16
|
+
value: z.string().describe('The source text of the unit.'),
|
|
17
|
+
fileUrl: z.never().optional(),
|
|
18
|
+
}),
|
|
19
|
+
z.object({
|
|
20
|
+
type: z.literal('remote'),
|
|
21
|
+
fileUrl: z.string().describe('External downloadable file url'),
|
|
22
|
+
contentSize: z.string().optional().describe('Offloaded content size in bytes'),
|
|
23
|
+
filePath: z.string().describe('System file path provided with file content').optional(),
|
|
24
|
+
value: z.never().optional(),
|
|
25
|
+
}),
|
|
26
|
+
]);
|
|
15
27
|
export const CONTENT_ITEM_SCHEMA = ITEM_IDENTIFIER_SCHEMA.extend({
|
|
16
28
|
translations: z.record(z.string(), z.string()),
|
|
17
|
-
|
|
29
|
+
translatedSourceMap: z
|
|
30
|
+
.record(z.string(), CONTENT_UNIT_SOURCE)
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Structured source reference; when type is remote, connector should download content via URL'),
|
|
18
33
|
});
|
|
19
34
|
export const apiError = z.object({
|
|
20
35
|
message: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonSchemas.js","sourceRoot":"","sources":["../../src/contracts/commonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"commonSchemas.js","sourceRoot":"","sources":["../../src/contracts/commonSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAEhE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;CAC3B,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;CACrC,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;IACzC,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,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AA;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAA;AAI/C,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAA"}
|
|
@@ -12,17 +12,17 @@ export declare const publishRequestBody: z.ZodObject<{
|
|
|
12
12
|
groupId: z.ZodString;
|
|
13
13
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
14
14
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
15
|
-
|
|
15
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
16
16
|
type: z.ZodLiteral<"inline">;
|
|
17
17
|
value: z.ZodString;
|
|
18
|
-
|
|
18
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
19
19
|
}, z.core.$strip>, z.ZodObject<{
|
|
20
20
|
type: z.ZodLiteral<"remote">;
|
|
21
|
-
|
|
21
|
+
fileUrl: z.ZodString;
|
|
22
22
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
23
23
|
filePath: z.ZodOptional<z.ZodString>;
|
|
24
24
|
value: z.ZodOptional<z.ZodNever>;
|
|
25
|
-
}, z.core.$strip>]
|
|
25
|
+
}, z.core.$strip>]>>>;
|
|
26
26
|
}, z.core.$strip>>;
|
|
27
27
|
defaultLocale: z.ZodString;
|
|
28
28
|
exportOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -51,17 +51,17 @@ export declare const postPublishContract: import("@lokalise/api-contracts").Payl
|
|
|
51
51
|
groupId: z.ZodString;
|
|
52
52
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
53
53
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
54
|
-
|
|
54
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
55
55
|
type: z.ZodLiteral<"inline">;
|
|
56
56
|
value: z.ZodString;
|
|
57
|
-
|
|
57
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
58
58
|
}, z.core.$strip>, z.ZodObject<{
|
|
59
59
|
type: z.ZodLiteral<"remote">;
|
|
60
|
-
|
|
60
|
+
fileUrl: z.ZodString;
|
|
61
61
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
62
62
|
filePath: z.ZodOptional<z.ZodString>;
|
|
63
63
|
value: z.ZodOptional<z.ZodNever>;
|
|
64
|
-
}, z.core.$strip>]
|
|
64
|
+
}, z.core.$strip>]>>>;
|
|
65
65
|
}, z.core.$strip>>;
|
|
66
66
|
defaultLocale: z.ZodString;
|
|
67
67
|
exportOptions: z.ZodOptional<z.ZodObject<{
|
|
@@ -46,17 +46,17 @@ export declare const TRANSLATE_CONTENT_ITEM_SCHEMA: z.ZodObject<{
|
|
|
46
46
|
groupId: z.ZodString;
|
|
47
47
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
48
48
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
49
|
-
|
|
49
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
50
50
|
type: z.ZodLiteral<"inline">;
|
|
51
51
|
value: z.ZodString;
|
|
52
|
-
|
|
52
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
53
53
|
}, z.core.$strip>, z.ZodObject<{
|
|
54
54
|
type: z.ZodLiteral<"remote">;
|
|
55
|
-
|
|
55
|
+
fileUrl: z.ZodString;
|
|
56
56
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
57
57
|
filePath: z.ZodOptional<z.ZodString>;
|
|
58
58
|
value: z.ZodOptional<z.ZodNever>;
|
|
59
|
-
}, z.core.$strip>]
|
|
59
|
+
}, z.core.$strip>]>>>;
|
|
60
60
|
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
61
|
id: z.ZodString;
|
|
62
62
|
name: z.ZodString;
|
|
@@ -72,17 +72,17 @@ export declare const translateResponseBody: z.ZodObject<{
|
|
|
72
72
|
groupId: z.ZodString;
|
|
73
73
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
74
74
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
75
|
-
|
|
75
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
76
76
|
type: z.ZodLiteral<"inline">;
|
|
77
77
|
value: z.ZodString;
|
|
78
|
-
|
|
78
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
79
79
|
}, z.core.$strip>, z.ZodObject<{
|
|
80
80
|
type: z.ZodLiteral<"remote">;
|
|
81
|
-
|
|
81
|
+
fileUrl: z.ZodString;
|
|
82
82
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
83
83
|
filePath: z.ZodOptional<z.ZodString>;
|
|
84
84
|
value: z.ZodOptional<z.ZodNever>;
|
|
85
|
-
}, z.core.$strip>]
|
|
85
|
+
}, z.core.$strip>]>>>;
|
|
86
86
|
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
87
87
|
id: z.ZodString;
|
|
88
88
|
name: z.ZodString;
|
|
@@ -121,17 +121,17 @@ export declare const postTranslateContract: import("@lokalise/api-contracts").Pa
|
|
|
121
121
|
groupId: z.ZodString;
|
|
122
122
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
123
123
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
124
|
-
|
|
124
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
125
125
|
type: z.ZodLiteral<"inline">;
|
|
126
126
|
value: z.ZodString;
|
|
127
|
-
|
|
127
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
128
128
|
}, z.core.$strip>, z.ZodObject<{
|
|
129
129
|
type: z.ZodLiteral<"remote">;
|
|
130
|
-
|
|
130
|
+
fileUrl: z.ZodString;
|
|
131
131
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
132
132
|
filePath: z.ZodOptional<z.ZodString>;
|
|
133
133
|
value: z.ZodOptional<z.ZodNever>;
|
|
134
|
-
}, z.core.$strip>]
|
|
134
|
+
}, z.core.$strip>]>>>;
|
|
135
135
|
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
136
136
|
id: z.ZodString;
|
|
137
137
|
name: z.ZodString;
|
|
@@ -162,17 +162,17 @@ export declare const postTranslateContract: import("@lokalise/api-contracts").Pa
|
|
|
162
162
|
groupId: z.ZodString;
|
|
163
163
|
metadata: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
164
164
|
translations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
165
|
-
|
|
165
|
+
translatedSourceMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
166
166
|
type: z.ZodLiteral<"inline">;
|
|
167
167
|
value: z.ZodString;
|
|
168
|
-
|
|
168
|
+
fileUrl: z.ZodOptional<z.ZodNever>;
|
|
169
169
|
}, z.core.$strip>, z.ZodObject<{
|
|
170
170
|
type: z.ZodLiteral<"remote">;
|
|
171
|
-
|
|
171
|
+
fileUrl: z.ZodString;
|
|
172
172
|
contentSize: z.ZodOptional<z.ZodString>;
|
|
173
173
|
filePath: z.ZodOptional<z.ZodString>;
|
|
174
174
|
value: z.ZodOptional<z.ZodNever>;
|
|
175
|
-
}, z.core.$strip>]
|
|
175
|
+
}, z.core.$strip>]>>>;
|
|
176
176
|
itemGroups: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
177
|
id: z.ZodString;
|
|
178
178
|
name: z.ZodString;
|