@lokalise/content-conversion-schemas 11.1.0 → 11.2.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/README.md +9 -3
- package/dist/index.d.ts +2 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -18
- package/dist/index.js.map +1 -1
- package/package.json +5 -8
- package/dist/api/common.d.ts +0 -34
- package/dist/api/common.d.ts.map +0 -1
- package/dist/api/common.js +0 -30
- package/dist/api/common.js.map +0 -1
- package/dist/api/contentObjects.d.ts +0 -576
- package/dist/api/contentObjects.d.ts.map +0 -1
- package/dist/api/contentObjects.js +0 -93
- package/dist/api/contentObjects.js.map +0 -1
- package/dist/api/contentObjectsNew.d.ts +0 -1563
- package/dist/api/contentObjectsNew.d.ts.map +0 -1
- package/dist/api/contentObjectsNew.js +0 -121
- package/dist/api/contentObjectsNew.js.map +0 -1
- package/dist/api/enums.d.ts +0 -38
- package/dist/api/enums.d.ts.map +0 -1
- package/dist/api/enums.js +0 -32
- package/dist/api/enums.js.map +0 -1
- package/dist/api/exportObjects.d.ts +0 -546
- package/dist/api/exportObjects.d.ts.map +0 -1
- package/dist/api/exportObjects.js +0 -205
- package/dist/api/exportObjects.js.map +0 -1
- package/dist/api/generationObjects.d.ts +0 -1451
- package/dist/api/generationObjects.d.ts.map +0 -1
- package/dist/api/generationObjects.js +0 -43
- package/dist/api/generationObjects.js.map +0 -1
- package/dist/api/pluralForm.d.ts +0 -10
- package/dist/api/pluralForm.d.ts.map +0 -1
- package/dist/api/pluralForm.js +0 -9
- package/dist/api/pluralForm.js.map +0 -1
- package/dist/api/pptx.d.ts +0 -24
- package/dist/api/pptx.d.ts.map +0 -1
- package/dist/api/pptx.js +0 -21
- package/dist/api/pptx.js.map +0 -1
- package/dist/api/textSegment.d.ts +0 -4
- package/dist/api/textSegment.d.ts.map +0 -1
- package/dist/api/textSegment.js +0 -5
- package/dist/api/textSegment.js.map +0 -1
- package/dist/api/textUnit.d.ts +0 -477
- package/dist/api/textUnit.d.ts.map +0 -1
- package/dist/api/textUnit.js +0 -65
- package/dist/api/textUnit.js.map +0 -1
- package/dist/api/textUnitMetadata.d.ts +0 -47
- package/dist/api/textUnitMetadata.d.ts.map +0 -1
- package/dist/api/textUnitMetadata.js +0 -9
- package/dist/api/textUnitMetadata.js.map +0 -1
- package/dist/api/textUnitTarget.d.ts +0 -69
- package/dist/api/textUnitTarget.d.ts.map +0 -1
- package/dist/api/textUnitTarget.js +0 -30
- package/dist/api/textUnitTarget.js.map +0 -1
- package/dist/api/translationObjects.d.ts +0 -286
- package/dist/api/translationObjects.d.ts.map +0 -1
- package/dist/api/translationObjects.js +0 -58
- package/dist/api/translationObjects.js.map +0 -1
- package/dist/api/xcstrings.d.ts +0 -51
- package/dist/api/xcstrings.d.ts.map +0 -1
- package/dist/api/xcstrings.js +0 -52
- package/dist/api/xcstrings.js.map +0 -1
- package/dist/common.d.ts +0 -51
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js +0 -45
- package/dist/common.js.map +0 -1
- package/dist/events/conversion.d.ts +0 -4699
- package/dist/events/conversion.d.ts.map +0 -1
- package/dist/events/conversion.js +0 -148
- package/dist/events/conversion.js.map +0 -1
- package/dist/events/export.d.ts +0 -154
- package/dist/events/export.d.ts.map +0 -1
- package/dist/events/export.js +0 -65
- package/dist/events/export.js.map +0 -1
- package/dist/events/upload.d.ts +0 -329
- package/dist/events/upload.d.ts.map +0 -1
- package/dist/events/upload.js +0 -137
- package/dist/events/upload.js.map +0 -1
|
@@ -1,576 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains schemas for content-related objects.
|
|
3
|
-
*
|
|
4
|
-
* A Content Item is a piece of generic content that can be imported and handled by the system.
|
|
5
|
-
* It consists of content units, which are the smallest parts of the content that a user can manipulate (import, export).
|
|
6
|
-
*
|
|
7
|
-
* When parsed, each content unit is split into text units, which represent the individual pieces of text that can be translated.
|
|
8
|
-
* Each text unit can be further segmented into segments (e.g., individual sentences).
|
|
9
|
-
* Users cannot manipulate text units or segments directly (e.g., remove or add them, otherwise, the system won't be able to
|
|
10
|
-
* reconstruct the content unit properly), but they should be able to influence the text unit extraction process or segmentation rules.
|
|
11
|
-
*
|
|
12
|
-
* In the context of Shopify, a Product would correspond to a Content Item.
|
|
13
|
-
* Two properties of the product, "title" and "description," would be the content units.
|
|
14
|
-
* "title" would be regular text (example: "Premium Cotton T-Shirt"), a single sentence, so it will consist of a single text unit and a single segment.
|
|
15
|
-
* "description" would be HTML content (example: <h1>Product Overview</h1><p>This is a premium cotton t-shirt. It is available in multiple colors.</p>),
|
|
16
|
-
* so it will consist of two text units: one for the <h1> element and another for the <p> element.
|
|
17
|
-
* The <p> element's text unit will contain two segments because it has two sentences.
|
|
18
|
-
*
|
|
19
|
-
* RawContentItem represents the content item before parsing, while ParsedContentItem represents the content item after parsing.
|
|
20
|
-
*/
|
|
21
|
-
import { z } from 'zod';
|
|
22
|
-
export declare const RAW_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
23
|
-
id: z.ZodString;
|
|
24
|
-
type: z.ZodEnum<{
|
|
25
|
-
readonly HTML_FILE: "HTML_FILE";
|
|
26
|
-
readonly DOCX_FILE: "DOCX_FILE";
|
|
27
|
-
readonly PPTX_FILE: "PPTX_FILE";
|
|
28
|
-
readonly XLSX_FILE: "XLSX_FILE";
|
|
29
|
-
readonly MARKDOWN_FILE: "MARKDOWN_FILE";
|
|
30
|
-
readonly IDML_FILE: "IDML_FILE";
|
|
31
|
-
readonly JSON_FILE: "JSON_FILE";
|
|
32
|
-
readonly YAML_FILE: "YAML_FILE";
|
|
33
|
-
readonly XCSTRINGS_FILE: "XCSTRINGS_FILE";
|
|
34
|
-
readonly TEXT: "TEXT";
|
|
35
|
-
readonly HTML: "HTML";
|
|
36
|
-
readonly JSON: "JSON";
|
|
37
|
-
readonly CONTENTFUL_RICH_TEXT: "CONTENTFUL_RICH_TEXT";
|
|
38
|
-
}>;
|
|
39
|
-
source: z.ZodUnion<readonly [z.ZodObject<{
|
|
40
|
-
type: z.ZodLiteral<"inline">;
|
|
41
|
-
value: z.ZodString;
|
|
42
|
-
storageId: z.ZodOptional<z.ZodNever>;
|
|
43
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
-
type: z.ZodLiteral<"remote">;
|
|
45
|
-
storageId: z.ZodString;
|
|
46
|
-
contentSize: z.ZodOptional<z.ZodString>;
|
|
47
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
48
|
-
value: z.ZodOptional<z.ZodNever>;
|
|
49
|
-
}, z.core.$strip>]>;
|
|
50
|
-
context: z.ZodOptional<z.ZodString>;
|
|
51
|
-
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
export declare const PARSED_CONTENT_UNIT_METADATA_SCHEMA: z.ZodObject<{
|
|
55
|
-
pptxAttributes: z.ZodObject<{
|
|
56
|
-
slideNumber: z.ZodNumber;
|
|
57
|
-
slideType: z.ZodString;
|
|
58
|
-
}, z.core.$strip>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
export declare const PARSED_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
61
|
-
id: z.ZodString;
|
|
62
|
-
type: z.ZodEnum<{
|
|
63
|
-
readonly HTML_FILE: "HTML_FILE";
|
|
64
|
-
readonly DOCX_FILE: "DOCX_FILE";
|
|
65
|
-
readonly PPTX_FILE: "PPTX_FILE";
|
|
66
|
-
readonly XLSX_FILE: "XLSX_FILE";
|
|
67
|
-
readonly MARKDOWN_FILE: "MARKDOWN_FILE";
|
|
68
|
-
readonly IDML_FILE: "IDML_FILE";
|
|
69
|
-
readonly JSON_FILE: "JSON_FILE";
|
|
70
|
-
readonly YAML_FILE: "YAML_FILE";
|
|
71
|
-
readonly XCSTRINGS_FILE: "XCSTRINGS_FILE";
|
|
72
|
-
readonly TEXT: "TEXT";
|
|
73
|
-
readonly HTML: "HTML";
|
|
74
|
-
readonly JSON: "JSON";
|
|
75
|
-
readonly CONTENTFUL_RICH_TEXT: "CONTENTFUL_RICH_TEXT";
|
|
76
|
-
}>;
|
|
77
|
-
context: z.ZodOptional<z.ZodString>;
|
|
78
|
-
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
80
|
-
source: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
81
|
-
type: z.ZodLiteral<"inline">;
|
|
82
|
-
value: z.ZodString;
|
|
83
|
-
storageId: z.ZodOptional<z.ZodNever>;
|
|
84
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
-
type: z.ZodLiteral<"remote">;
|
|
86
|
-
storageId: z.ZodString;
|
|
87
|
-
contentSize: z.ZodOptional<z.ZodString>;
|
|
88
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
89
|
-
value: z.ZodOptional<z.ZodNever>;
|
|
90
|
-
}, z.core.$strip>]>]>;
|
|
91
|
-
sourceWordCount: z.ZodNumber;
|
|
92
|
-
textUnits: z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
-
id: z.ZodString;
|
|
94
|
-
isTranslatable: z.ZodBoolean;
|
|
95
|
-
name: z.ZodOptional<z.ZodString>;
|
|
96
|
-
description: z.ZodOptional<z.ZodString>;
|
|
97
|
-
type: z.ZodOptional<z.ZodString>;
|
|
98
|
-
skeleton: z.ZodOptional<z.ZodString>;
|
|
99
|
-
targets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
100
|
-
isPlural: z.ZodLiteral<false>;
|
|
101
|
-
source: z.ZodObject<{
|
|
102
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
103
|
-
segments: z.ZodArray<z.ZodString>;
|
|
104
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
105
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
106
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
-
}, z.core.$strip>>;
|
|
108
|
-
}, z.core.$strip>>;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
-
isPlural: z.ZodLiteral<true>;
|
|
112
|
-
pluralForms: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
113
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
114
|
-
segments: z.ZodArray<z.ZodString>;
|
|
115
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
116
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
117
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
-
}, z.core.$strip>>;
|
|
119
|
-
}, z.core.$strip>>;
|
|
120
|
-
}, z.core.$strip>>;
|
|
121
|
-
}, z.core.$strip>], "isPlural">>>;
|
|
122
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
123
|
-
pptxAttributes: z.ZodOptional<z.ZodObject<{
|
|
124
|
-
slideNumber: z.ZodNumber;
|
|
125
|
-
slideType: z.ZodEnum<{
|
|
126
|
-
readonly LAYOUT: "LAYOUT";
|
|
127
|
-
readonly NOTES: "NOTES";
|
|
128
|
-
readonly MASTER_NOTES: "MASTER_NOTES";
|
|
129
|
-
readonly SLIDE: "SLIDE";
|
|
130
|
-
readonly MASTER_SLIDE: "MASTER_SLIDE";
|
|
131
|
-
readonly CHART: "CHART";
|
|
132
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
133
|
-
}>;
|
|
134
|
-
}, z.core.$strip>>;
|
|
135
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
136
|
-
state: z.ZodOptional<z.ZodString>;
|
|
137
|
-
shouldTranslate: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
-
extractionState: z.ZodOptional<z.ZodString>;
|
|
139
|
-
localizationType: z.ZodOptional<z.ZodEnum<{
|
|
140
|
-
readonly STRING_UNIT: "STRING_UNIT";
|
|
141
|
-
readonly SUBSTITUTIONS: "SUBSTITUTIONS";
|
|
142
|
-
readonly PLURAL_VARIATIONS: "PLURAL_VARIATIONS";
|
|
143
|
-
readonly DEVICE_VARIATION: "DEVICE_VARIATION";
|
|
144
|
-
readonly DEVICE_PLURAL_VARIATION: "DEVICE_PLURAL_VARIATION";
|
|
145
|
-
}>>;
|
|
146
|
-
keyPath: z.ZodOptional<z.ZodString>;
|
|
147
|
-
device: z.ZodOptional<z.ZodEnum<{
|
|
148
|
-
readonly MAC: "MAC";
|
|
149
|
-
readonly IPHONE: "IPHONE";
|
|
150
|
-
readonly APPLE_WATCH: "APPLE_WATCH";
|
|
151
|
-
readonly IPAD: "IPAD";
|
|
152
|
-
readonly OTHER: "OTHER";
|
|
153
|
-
}>>;
|
|
154
|
-
pluralForm: z.ZodOptional<z.ZodEnum<{
|
|
155
|
-
readonly ZERO: "ZERO";
|
|
156
|
-
readonly ONE: "ONE";
|
|
157
|
-
readonly TWO: "TWO";
|
|
158
|
-
readonly FEW: "FEW";
|
|
159
|
-
readonly MANY: "MANY";
|
|
160
|
-
readonly OTHER: "OTHER";
|
|
161
|
-
}>>;
|
|
162
|
-
formatSpecifier: z.ZodOptional<z.ZodString>;
|
|
163
|
-
argNum: z.ZodOptional<z.ZodNumber>;
|
|
164
|
-
}, z.core.$strip>>;
|
|
165
|
-
}, z.core.$strip>>;
|
|
166
|
-
isPlural: z.ZodLiteral<true>;
|
|
167
|
-
pluralForms: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
168
|
-
textCodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
169
|
-
id: z.ZodString;
|
|
170
|
-
type: z.ZodEnum<{
|
|
171
|
-
readonly OPENING: "OPENING";
|
|
172
|
-
readonly CLOSING: "CLOSING";
|
|
173
|
-
readonly PLACEHOLDER: "PLACEHOLDER";
|
|
174
|
-
}>;
|
|
175
|
-
value: z.ZodString;
|
|
176
|
-
attributes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
-
parser: z.ZodDefault<z.ZodLiteral<"okapi">>;
|
|
178
|
-
}, z.core.$strip>>>>;
|
|
179
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
180
|
-
segments: z.ZodArray<z.ZodString>;
|
|
181
|
-
}, z.core.$strip>>;
|
|
182
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
-
id: z.ZodString;
|
|
184
|
-
isTranslatable: z.ZodBoolean;
|
|
185
|
-
name: z.ZodOptional<z.ZodString>;
|
|
186
|
-
description: z.ZodOptional<z.ZodString>;
|
|
187
|
-
type: z.ZodOptional<z.ZodString>;
|
|
188
|
-
skeleton: z.ZodOptional<z.ZodString>;
|
|
189
|
-
targets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
190
|
-
isPlural: z.ZodLiteral<false>;
|
|
191
|
-
source: z.ZodObject<{
|
|
192
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
193
|
-
segments: z.ZodArray<z.ZodString>;
|
|
194
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
195
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
196
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
-
}, z.core.$strip>>;
|
|
198
|
-
}, z.core.$strip>>;
|
|
199
|
-
}, z.core.$strip>;
|
|
200
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
-
isPlural: z.ZodLiteral<true>;
|
|
202
|
-
pluralForms: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
203
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
204
|
-
segments: z.ZodArray<z.ZodString>;
|
|
205
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
206
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
207
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
-
}, z.core.$strip>>;
|
|
209
|
-
}, z.core.$strip>>;
|
|
210
|
-
}, z.core.$strip>>;
|
|
211
|
-
}, z.core.$strip>], "isPlural">>>;
|
|
212
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
213
|
-
pptxAttributes: z.ZodOptional<z.ZodObject<{
|
|
214
|
-
slideNumber: z.ZodNumber;
|
|
215
|
-
slideType: z.ZodEnum<{
|
|
216
|
-
readonly LAYOUT: "LAYOUT";
|
|
217
|
-
readonly NOTES: "NOTES";
|
|
218
|
-
readonly MASTER_NOTES: "MASTER_NOTES";
|
|
219
|
-
readonly SLIDE: "SLIDE";
|
|
220
|
-
readonly MASTER_SLIDE: "MASTER_SLIDE";
|
|
221
|
-
readonly CHART: "CHART";
|
|
222
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
223
|
-
}>;
|
|
224
|
-
}, z.core.$strip>>;
|
|
225
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
226
|
-
state: z.ZodOptional<z.ZodString>;
|
|
227
|
-
shouldTranslate: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
-
extractionState: z.ZodOptional<z.ZodString>;
|
|
229
|
-
localizationType: z.ZodOptional<z.ZodEnum<{
|
|
230
|
-
readonly STRING_UNIT: "STRING_UNIT";
|
|
231
|
-
readonly SUBSTITUTIONS: "SUBSTITUTIONS";
|
|
232
|
-
readonly PLURAL_VARIATIONS: "PLURAL_VARIATIONS";
|
|
233
|
-
readonly DEVICE_VARIATION: "DEVICE_VARIATION";
|
|
234
|
-
readonly DEVICE_PLURAL_VARIATION: "DEVICE_PLURAL_VARIATION";
|
|
235
|
-
}>>;
|
|
236
|
-
keyPath: z.ZodOptional<z.ZodString>;
|
|
237
|
-
device: z.ZodOptional<z.ZodEnum<{
|
|
238
|
-
readonly MAC: "MAC";
|
|
239
|
-
readonly IPHONE: "IPHONE";
|
|
240
|
-
readonly APPLE_WATCH: "APPLE_WATCH";
|
|
241
|
-
readonly IPAD: "IPAD";
|
|
242
|
-
readonly OTHER: "OTHER";
|
|
243
|
-
}>>;
|
|
244
|
-
pluralForm: z.ZodOptional<z.ZodEnum<{
|
|
245
|
-
readonly ZERO: "ZERO";
|
|
246
|
-
readonly ONE: "ONE";
|
|
247
|
-
readonly TWO: "TWO";
|
|
248
|
-
readonly FEW: "FEW";
|
|
249
|
-
readonly MANY: "MANY";
|
|
250
|
-
readonly OTHER: "OTHER";
|
|
251
|
-
}>>;
|
|
252
|
-
formatSpecifier: z.ZodOptional<z.ZodString>;
|
|
253
|
-
argNum: z.ZodOptional<z.ZodNumber>;
|
|
254
|
-
}, z.core.$strip>>;
|
|
255
|
-
}, z.core.$strip>>;
|
|
256
|
-
isPlural: z.ZodLiteral<false>;
|
|
257
|
-
source: z.ZodObject<{
|
|
258
|
-
textCodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
259
|
-
id: z.ZodString;
|
|
260
|
-
type: z.ZodEnum<{
|
|
261
|
-
readonly OPENING: "OPENING";
|
|
262
|
-
readonly CLOSING: "CLOSING";
|
|
263
|
-
readonly PLACEHOLDER: "PLACEHOLDER";
|
|
264
|
-
}>;
|
|
265
|
-
value: z.ZodString;
|
|
266
|
-
attributes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
|
-
parser: z.ZodDefault<z.ZodLiteral<"okapi">>;
|
|
268
|
-
}, z.core.$strip>>>>;
|
|
269
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
270
|
-
segments: z.ZodArray<z.ZodString>;
|
|
271
|
-
}, z.core.$strip>;
|
|
272
|
-
}, z.core.$strip>], "isPlural">>>;
|
|
273
|
-
position: z.ZodNumber;
|
|
274
|
-
}, z.core.$strip>;
|
|
275
|
-
export declare const RAW_CONTENT_ITEM_SCHEMA: z.ZodObject<{
|
|
276
|
-
id: z.ZodString;
|
|
277
|
-
name: z.ZodOptional<z.ZodString>;
|
|
278
|
-
priority: z.ZodNumber;
|
|
279
|
-
contentUnits: z.ZodArray<z.ZodObject<{
|
|
280
|
-
id: z.ZodString;
|
|
281
|
-
type: z.ZodEnum<{
|
|
282
|
-
readonly HTML_FILE: "HTML_FILE";
|
|
283
|
-
readonly DOCX_FILE: "DOCX_FILE";
|
|
284
|
-
readonly PPTX_FILE: "PPTX_FILE";
|
|
285
|
-
readonly XLSX_FILE: "XLSX_FILE";
|
|
286
|
-
readonly MARKDOWN_FILE: "MARKDOWN_FILE";
|
|
287
|
-
readonly IDML_FILE: "IDML_FILE";
|
|
288
|
-
readonly JSON_FILE: "JSON_FILE";
|
|
289
|
-
readonly YAML_FILE: "YAML_FILE";
|
|
290
|
-
readonly XCSTRINGS_FILE: "XCSTRINGS_FILE";
|
|
291
|
-
readonly TEXT: "TEXT";
|
|
292
|
-
readonly HTML: "HTML";
|
|
293
|
-
readonly JSON: "JSON";
|
|
294
|
-
readonly CONTENTFUL_RICH_TEXT: "CONTENTFUL_RICH_TEXT";
|
|
295
|
-
}>;
|
|
296
|
-
source: z.ZodUnion<readonly [z.ZodObject<{
|
|
297
|
-
type: z.ZodLiteral<"inline">;
|
|
298
|
-
value: z.ZodString;
|
|
299
|
-
storageId: z.ZodOptional<z.ZodNever>;
|
|
300
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
301
|
-
type: z.ZodLiteral<"remote">;
|
|
302
|
-
storageId: z.ZodString;
|
|
303
|
-
contentSize: z.ZodOptional<z.ZodString>;
|
|
304
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
305
|
-
value: z.ZodOptional<z.ZodNever>;
|
|
306
|
-
}, z.core.$strip>]>;
|
|
307
|
-
context: z.ZodOptional<z.ZodString>;
|
|
308
|
-
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
309
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
310
|
-
}, z.core.$strip>>;
|
|
311
|
-
categoryHierarchy: z.ZodArray<z.ZodString>;
|
|
312
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
313
|
-
}, z.core.$strip>;
|
|
314
|
-
export declare const PARSED_CONTENT_ITEM_SCHEMA: z.ZodObject<{
|
|
315
|
-
id: z.ZodString;
|
|
316
|
-
name: z.ZodOptional<z.ZodString>;
|
|
317
|
-
priority: z.ZodNumber;
|
|
318
|
-
categoryHierarchy: z.ZodArray<z.ZodString>;
|
|
319
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
320
|
-
contentUnits: z.ZodArray<z.ZodObject<{
|
|
321
|
-
id: z.ZodString;
|
|
322
|
-
type: z.ZodEnum<{
|
|
323
|
-
readonly HTML_FILE: "HTML_FILE";
|
|
324
|
-
readonly DOCX_FILE: "DOCX_FILE";
|
|
325
|
-
readonly PPTX_FILE: "PPTX_FILE";
|
|
326
|
-
readonly XLSX_FILE: "XLSX_FILE";
|
|
327
|
-
readonly MARKDOWN_FILE: "MARKDOWN_FILE";
|
|
328
|
-
readonly IDML_FILE: "IDML_FILE";
|
|
329
|
-
readonly JSON_FILE: "JSON_FILE";
|
|
330
|
-
readonly YAML_FILE: "YAML_FILE";
|
|
331
|
-
readonly XCSTRINGS_FILE: "XCSTRINGS_FILE";
|
|
332
|
-
readonly TEXT: "TEXT";
|
|
333
|
-
readonly HTML: "HTML";
|
|
334
|
-
readonly JSON: "JSON";
|
|
335
|
-
readonly CONTENTFUL_RICH_TEXT: "CONTENTFUL_RICH_TEXT";
|
|
336
|
-
}>;
|
|
337
|
-
context: z.ZodOptional<z.ZodString>;
|
|
338
|
-
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
339
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
340
|
-
source: z.ZodUnion<readonly [z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
341
|
-
type: z.ZodLiteral<"inline">;
|
|
342
|
-
value: z.ZodString;
|
|
343
|
-
storageId: z.ZodOptional<z.ZodNever>;
|
|
344
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
345
|
-
type: z.ZodLiteral<"remote">;
|
|
346
|
-
storageId: z.ZodString;
|
|
347
|
-
contentSize: z.ZodOptional<z.ZodString>;
|
|
348
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
349
|
-
value: z.ZodOptional<z.ZodNever>;
|
|
350
|
-
}, z.core.$strip>]>]>;
|
|
351
|
-
sourceWordCount: z.ZodNumber;
|
|
352
|
-
textUnits: z.ZodArray<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
353
|
-
id: z.ZodString;
|
|
354
|
-
isTranslatable: z.ZodBoolean;
|
|
355
|
-
name: z.ZodOptional<z.ZodString>;
|
|
356
|
-
description: z.ZodOptional<z.ZodString>;
|
|
357
|
-
type: z.ZodOptional<z.ZodString>;
|
|
358
|
-
skeleton: z.ZodOptional<z.ZodString>;
|
|
359
|
-
targets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
360
|
-
isPlural: z.ZodLiteral<false>;
|
|
361
|
-
source: z.ZodObject<{
|
|
362
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
363
|
-
segments: z.ZodArray<z.ZodString>;
|
|
364
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
365
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
366
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
-
}, z.core.$strip>>;
|
|
368
|
-
}, z.core.$strip>>;
|
|
369
|
-
}, z.core.$strip>;
|
|
370
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
371
|
-
isPlural: z.ZodLiteral<true>;
|
|
372
|
-
pluralForms: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
373
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
374
|
-
segments: z.ZodArray<z.ZodString>;
|
|
375
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
376
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
377
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
378
|
-
}, z.core.$strip>>;
|
|
379
|
-
}, z.core.$strip>>;
|
|
380
|
-
}, z.core.$strip>>;
|
|
381
|
-
}, z.core.$strip>], "isPlural">>>;
|
|
382
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
383
|
-
pptxAttributes: z.ZodOptional<z.ZodObject<{
|
|
384
|
-
slideNumber: z.ZodNumber;
|
|
385
|
-
slideType: z.ZodEnum<{
|
|
386
|
-
readonly LAYOUT: "LAYOUT";
|
|
387
|
-
readonly NOTES: "NOTES";
|
|
388
|
-
readonly MASTER_NOTES: "MASTER_NOTES";
|
|
389
|
-
readonly SLIDE: "SLIDE";
|
|
390
|
-
readonly MASTER_SLIDE: "MASTER_SLIDE";
|
|
391
|
-
readonly CHART: "CHART";
|
|
392
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
393
|
-
}>;
|
|
394
|
-
}, z.core.$strip>>;
|
|
395
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
396
|
-
state: z.ZodOptional<z.ZodString>;
|
|
397
|
-
shouldTranslate: z.ZodOptional<z.ZodBoolean>;
|
|
398
|
-
extractionState: z.ZodOptional<z.ZodString>;
|
|
399
|
-
localizationType: z.ZodOptional<z.ZodEnum<{
|
|
400
|
-
readonly STRING_UNIT: "STRING_UNIT";
|
|
401
|
-
readonly SUBSTITUTIONS: "SUBSTITUTIONS";
|
|
402
|
-
readonly PLURAL_VARIATIONS: "PLURAL_VARIATIONS";
|
|
403
|
-
readonly DEVICE_VARIATION: "DEVICE_VARIATION";
|
|
404
|
-
readonly DEVICE_PLURAL_VARIATION: "DEVICE_PLURAL_VARIATION";
|
|
405
|
-
}>>;
|
|
406
|
-
keyPath: z.ZodOptional<z.ZodString>;
|
|
407
|
-
device: z.ZodOptional<z.ZodEnum<{
|
|
408
|
-
readonly MAC: "MAC";
|
|
409
|
-
readonly IPHONE: "IPHONE";
|
|
410
|
-
readonly APPLE_WATCH: "APPLE_WATCH";
|
|
411
|
-
readonly IPAD: "IPAD";
|
|
412
|
-
readonly OTHER: "OTHER";
|
|
413
|
-
}>>;
|
|
414
|
-
pluralForm: z.ZodOptional<z.ZodEnum<{
|
|
415
|
-
readonly ZERO: "ZERO";
|
|
416
|
-
readonly ONE: "ONE";
|
|
417
|
-
readonly TWO: "TWO";
|
|
418
|
-
readonly FEW: "FEW";
|
|
419
|
-
readonly MANY: "MANY";
|
|
420
|
-
readonly OTHER: "OTHER";
|
|
421
|
-
}>>;
|
|
422
|
-
formatSpecifier: z.ZodOptional<z.ZodString>;
|
|
423
|
-
argNum: z.ZodOptional<z.ZodNumber>;
|
|
424
|
-
}, z.core.$strip>>;
|
|
425
|
-
}, z.core.$strip>>;
|
|
426
|
-
isPlural: z.ZodLiteral<true>;
|
|
427
|
-
pluralForms: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
428
|
-
textCodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
429
|
-
id: z.ZodString;
|
|
430
|
-
type: z.ZodEnum<{
|
|
431
|
-
readonly OPENING: "OPENING";
|
|
432
|
-
readonly CLOSING: "CLOSING";
|
|
433
|
-
readonly PLACEHOLDER: "PLACEHOLDER";
|
|
434
|
-
}>;
|
|
435
|
-
value: z.ZodString;
|
|
436
|
-
attributes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
437
|
-
parser: z.ZodDefault<z.ZodLiteral<"okapi">>;
|
|
438
|
-
}, z.core.$strip>>>>;
|
|
439
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
440
|
-
segments: z.ZodArray<z.ZodString>;
|
|
441
|
-
}, z.core.$strip>>;
|
|
442
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
443
|
-
id: z.ZodString;
|
|
444
|
-
isTranslatable: z.ZodBoolean;
|
|
445
|
-
name: z.ZodOptional<z.ZodString>;
|
|
446
|
-
description: z.ZodOptional<z.ZodString>;
|
|
447
|
-
type: z.ZodOptional<z.ZodString>;
|
|
448
|
-
skeleton: z.ZodOptional<z.ZodString>;
|
|
449
|
-
targets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
450
|
-
isPlural: z.ZodLiteral<false>;
|
|
451
|
-
source: z.ZodObject<{
|
|
452
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
453
|
-
segments: z.ZodArray<z.ZodString>;
|
|
454
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
455
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
456
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
457
|
-
}, z.core.$strip>>;
|
|
458
|
-
}, z.core.$strip>>;
|
|
459
|
-
}, z.core.$strip>;
|
|
460
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
461
|
-
isPlural: z.ZodLiteral<true>;
|
|
462
|
-
pluralForms: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
463
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
464
|
-
segments: z.ZodArray<z.ZodString>;
|
|
465
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
466
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
467
|
-
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
468
|
-
}, z.core.$strip>>;
|
|
469
|
-
}, z.core.$strip>>;
|
|
470
|
-
}, z.core.$strip>>;
|
|
471
|
-
}, z.core.$strip>], "isPlural">>>;
|
|
472
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
473
|
-
pptxAttributes: z.ZodOptional<z.ZodObject<{
|
|
474
|
-
slideNumber: z.ZodNumber;
|
|
475
|
-
slideType: z.ZodEnum<{
|
|
476
|
-
readonly LAYOUT: "LAYOUT";
|
|
477
|
-
readonly NOTES: "NOTES";
|
|
478
|
-
readonly MASTER_NOTES: "MASTER_NOTES";
|
|
479
|
-
readonly SLIDE: "SLIDE";
|
|
480
|
-
readonly MASTER_SLIDE: "MASTER_SLIDE";
|
|
481
|
-
readonly CHART: "CHART";
|
|
482
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
483
|
-
}>;
|
|
484
|
-
}, z.core.$strip>>;
|
|
485
|
-
xcstrings: z.ZodOptional<z.ZodObject<{
|
|
486
|
-
state: z.ZodOptional<z.ZodString>;
|
|
487
|
-
shouldTranslate: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
-
extractionState: z.ZodOptional<z.ZodString>;
|
|
489
|
-
localizationType: z.ZodOptional<z.ZodEnum<{
|
|
490
|
-
readonly STRING_UNIT: "STRING_UNIT";
|
|
491
|
-
readonly SUBSTITUTIONS: "SUBSTITUTIONS";
|
|
492
|
-
readonly PLURAL_VARIATIONS: "PLURAL_VARIATIONS";
|
|
493
|
-
readonly DEVICE_VARIATION: "DEVICE_VARIATION";
|
|
494
|
-
readonly DEVICE_PLURAL_VARIATION: "DEVICE_PLURAL_VARIATION";
|
|
495
|
-
}>>;
|
|
496
|
-
keyPath: z.ZodOptional<z.ZodString>;
|
|
497
|
-
device: z.ZodOptional<z.ZodEnum<{
|
|
498
|
-
readonly MAC: "MAC";
|
|
499
|
-
readonly IPHONE: "IPHONE";
|
|
500
|
-
readonly APPLE_WATCH: "APPLE_WATCH";
|
|
501
|
-
readonly IPAD: "IPAD";
|
|
502
|
-
readonly OTHER: "OTHER";
|
|
503
|
-
}>>;
|
|
504
|
-
pluralForm: z.ZodOptional<z.ZodEnum<{
|
|
505
|
-
readonly ZERO: "ZERO";
|
|
506
|
-
readonly ONE: "ONE";
|
|
507
|
-
readonly TWO: "TWO";
|
|
508
|
-
readonly FEW: "FEW";
|
|
509
|
-
readonly MANY: "MANY";
|
|
510
|
-
readonly OTHER: "OTHER";
|
|
511
|
-
}>>;
|
|
512
|
-
formatSpecifier: z.ZodOptional<z.ZodString>;
|
|
513
|
-
argNum: z.ZodOptional<z.ZodNumber>;
|
|
514
|
-
}, z.core.$strip>>;
|
|
515
|
-
}, z.core.$strip>>;
|
|
516
|
-
isPlural: z.ZodLiteral<false>;
|
|
517
|
-
source: z.ZodObject<{
|
|
518
|
-
textCodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
519
|
-
id: z.ZodString;
|
|
520
|
-
type: z.ZodEnum<{
|
|
521
|
-
readonly OPENING: "OPENING";
|
|
522
|
-
readonly CLOSING: "CLOSING";
|
|
523
|
-
readonly PLACEHOLDER: "PLACEHOLDER";
|
|
524
|
-
}>;
|
|
525
|
-
value: z.ZodString;
|
|
526
|
-
attributes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
527
|
-
parser: z.ZodDefault<z.ZodLiteral<"okapi">>;
|
|
528
|
-
}, z.core.$strip>>>>;
|
|
529
|
-
hasBeenSegmented: z.ZodBoolean;
|
|
530
|
-
segments: z.ZodArray<z.ZodString>;
|
|
531
|
-
}, z.core.$strip>;
|
|
532
|
-
}, z.core.$strip>], "isPlural">>>;
|
|
533
|
-
position: z.ZodNumber;
|
|
534
|
-
}, z.core.$strip>>;
|
|
535
|
-
failedContentUnits: z.ZodArray<z.ZodObject<{
|
|
536
|
-
error: z.ZodString;
|
|
537
|
-
rawContentUnit: z.ZodObject<{
|
|
538
|
-
id: z.ZodString;
|
|
539
|
-
type: z.ZodEnum<{
|
|
540
|
-
readonly HTML_FILE: "HTML_FILE";
|
|
541
|
-
readonly DOCX_FILE: "DOCX_FILE";
|
|
542
|
-
readonly PPTX_FILE: "PPTX_FILE";
|
|
543
|
-
readonly XLSX_FILE: "XLSX_FILE";
|
|
544
|
-
readonly MARKDOWN_FILE: "MARKDOWN_FILE";
|
|
545
|
-
readonly IDML_FILE: "IDML_FILE";
|
|
546
|
-
readonly JSON_FILE: "JSON_FILE";
|
|
547
|
-
readonly YAML_FILE: "YAML_FILE";
|
|
548
|
-
readonly XCSTRINGS_FILE: "XCSTRINGS_FILE";
|
|
549
|
-
readonly TEXT: "TEXT";
|
|
550
|
-
readonly HTML: "HTML";
|
|
551
|
-
readonly JSON: "JSON";
|
|
552
|
-
readonly CONTENTFUL_RICH_TEXT: "CONTENTFUL_RICH_TEXT";
|
|
553
|
-
}>;
|
|
554
|
-
source: z.ZodUnion<readonly [z.ZodObject<{
|
|
555
|
-
type: z.ZodLiteral<"inline">;
|
|
556
|
-
value: z.ZodString;
|
|
557
|
-
storageId: z.ZodOptional<z.ZodNever>;
|
|
558
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
559
|
-
type: z.ZodLiteral<"remote">;
|
|
560
|
-
storageId: z.ZodString;
|
|
561
|
-
contentSize: z.ZodOptional<z.ZodString>;
|
|
562
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
563
|
-
value: z.ZodOptional<z.ZodNever>;
|
|
564
|
-
}, z.core.$strip>]>;
|
|
565
|
-
context: z.ZodOptional<z.ZodString>;
|
|
566
|
-
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
567
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
568
|
-
}, z.core.$strip>;
|
|
569
|
-
}, z.core.$strip>>;
|
|
570
|
-
}, z.core.$strip>;
|
|
571
|
-
export type RawContentItem = z.infer<typeof RAW_CONTENT_ITEM_SCHEMA>;
|
|
572
|
-
export type RawContentUnit = z.infer<typeof RAW_CONTENT_UNIT_SCHEMA>;
|
|
573
|
-
export type ParsedContentUnitMetadata = z.infer<typeof PARSED_CONTENT_UNIT_METADATA_SCHEMA>;
|
|
574
|
-
export type ParsedContentItem = z.infer<typeof PARSED_CONTENT_ITEM_SCHEMA>;
|
|
575
|
-
export type ParsedContentUnit = z.infer<typeof PARSED_CONTENT_UNIT_SCHEMA>;
|
|
576
|
-
//# sourceMappingURL=contentObjects.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contentObjects.d.ts","sourceRoot":"","sources":["../../src/api/contentObjects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BlC,CAAA;AAEF,eAAO,MAAM,mCAAmC;;;;;iBAO9C,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKrC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BlC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUG,CAAA;AAE1C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACpE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAC3F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains schemas for content-related objects.
|
|
3
|
-
*
|
|
4
|
-
* A Content Item is a piece of generic content that can be imported and handled by the system.
|
|
5
|
-
* It consists of content units, which are the smallest parts of the content that a user can manipulate (import, export).
|
|
6
|
-
*
|
|
7
|
-
* When parsed, each content unit is split into text units, which represent the individual pieces of text that can be translated.
|
|
8
|
-
* Each text unit can be further segmented into segments (e.g., individual sentences).
|
|
9
|
-
* Users cannot manipulate text units or segments directly (e.g., remove or add them, otherwise, the system won't be able to
|
|
10
|
-
* reconstruct the content unit properly), but they should be able to influence the text unit extraction process or segmentation rules.
|
|
11
|
-
*
|
|
12
|
-
* In the context of Shopify, a Product would correspond to a Content Item.
|
|
13
|
-
* Two properties of the product, "title" and "description," would be the content units.
|
|
14
|
-
* "title" would be regular text (example: "Premium Cotton T-Shirt"), a single sentence, so it will consist of a single text unit and a single segment.
|
|
15
|
-
* "description" would be HTML content (example: <h1>Product Overview</h1><p>This is a premium cotton t-shirt. It is available in multiple colors.</p>),
|
|
16
|
-
* so it will consist of two text units: one for the <h1> element and another for the <p> element.
|
|
17
|
-
* The <p> element's text unit will contain two segments because it has two sentences.
|
|
18
|
-
*
|
|
19
|
-
* RawContentItem represents the content item before parsing, while ParsedContentItem represents the content item after parsing.
|
|
20
|
-
*/
|
|
21
|
-
import { ContentUnitTypeEnum } from '@lokalise/common-api-schemas';
|
|
22
|
-
import { z } from 'zod';
|
|
23
|
-
import { CONTENT_UNIT_SOURCE } from "./contentObjectsNew.js";
|
|
24
|
-
import { TEXT_UNIT } from "./textUnit.js";
|
|
25
|
-
export const RAW_CONTENT_UNIT_SCHEMA = z.object({
|
|
26
|
-
id: z
|
|
27
|
-
.string()
|
|
28
|
-
.min(1)
|
|
29
|
-
.describe('Identifier of the unit, unique across other contentUnits belonging to a single item, usually human-readable, e.g. "welcome_message" or "header.welcome_message.title".'),
|
|
30
|
-
type: z
|
|
31
|
-
.enum(ContentUnitTypeEnum)
|
|
32
|
-
.describe('The type of content, which may determine requirements for processing, storage, or display.'),
|
|
33
|
-
source: CONTENT_UNIT_SOURCE,
|
|
34
|
-
context: z
|
|
35
|
-
.string()
|
|
36
|
-
.optional()
|
|
37
|
-
.describe('Optional context providing additional information about the content.'),
|
|
38
|
-
characterLimit: z
|
|
39
|
-
.number()
|
|
40
|
-
.positive()
|
|
41
|
-
.optional()
|
|
42
|
-
.describe('Optional maximum number of characters allowed for the content unit.'),
|
|
43
|
-
metadata: z
|
|
44
|
-
.record(z.string(), z.any())
|
|
45
|
-
.optional()
|
|
46
|
-
.describe('Optional metadata associated with the content unit.'),
|
|
47
|
-
});
|
|
48
|
-
export const PARSED_CONTENT_UNIT_METADATA_SCHEMA = z.object({
|
|
49
|
-
pptxAttributes: z
|
|
50
|
-
.object({
|
|
51
|
-
slideNumber: z.number(),
|
|
52
|
-
slideType: z.string(),
|
|
53
|
-
})
|
|
54
|
-
.describe('PPTX-specific attributes of the content unit.'),
|
|
55
|
-
});
|
|
56
|
-
export const PARSED_CONTENT_UNIT_SCHEMA = RAW_CONTENT_UNIT_SCHEMA.extend({
|
|
57
|
-
source: z.union([z.string(), CONTENT_UNIT_SOURCE]),
|
|
58
|
-
sourceWordCount: z.number().gte(0).describe('The total word count of the source text.'),
|
|
59
|
-
textUnits: TEXT_UNIT.array().describe('The text units extracted from the content unit.'),
|
|
60
|
-
position: z.number().int().nonnegative(), // >= 0
|
|
61
|
-
});
|
|
62
|
-
export const RAW_CONTENT_ITEM_SCHEMA = z.object({
|
|
63
|
-
id: z
|
|
64
|
-
.string()
|
|
65
|
-
.min(1)
|
|
66
|
-
.describe('Identifier of the item, unique across other items belonging to a single project.'),
|
|
67
|
-
name: z
|
|
68
|
-
.string()
|
|
69
|
-
.min(1)
|
|
70
|
-
.max(256)
|
|
71
|
-
.optional()
|
|
72
|
-
.describe('Human-readable name of the item. Maximum length is dictated by TSS item name limit.'),
|
|
73
|
-
priority: z
|
|
74
|
-
.number()
|
|
75
|
-
.min(0)
|
|
76
|
-
.describe("Number indicating how important it is to have this item translated in user's store. It is relevant in case not all items fit within the user's current limit defined by their subscription plan. The higher the number, the higher the priority, and so the more likely the item is to be translated."),
|
|
77
|
-
contentUnits: RAW_CONTENT_UNIT_SCHEMA.array(),
|
|
78
|
-
categoryHierarchy: z.array(z.string()).refine((data) => {
|
|
79
|
-
const set = new Set(data);
|
|
80
|
-
return set.size === data.length;
|
|
81
|
-
}, 'Category names must be unique'),
|
|
82
|
-
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
83
|
-
});
|
|
84
|
-
export const PARSED_CONTENT_ITEM_SCHEMA = RAW_CONTENT_ITEM_SCHEMA.extend({
|
|
85
|
-
contentUnits: PARSED_CONTENT_UNIT_SCHEMA.array(),
|
|
86
|
-
failedContentUnits: z
|
|
87
|
-
.array(z.object({
|
|
88
|
-
error: z.string().describe('Error message.'),
|
|
89
|
-
rawContentUnit: RAW_CONTENT_UNIT_SCHEMA,
|
|
90
|
-
}))
|
|
91
|
-
.describe('Content units that failed to be parsed.'),
|
|
92
|
-
}).describe('Content item after parsing.');
|
|
93
|
-
//# sourceMappingURL=contentObjects.js.map
|