@lokalise/tm-api-schemas 5.5.3 → 5.6.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/api-contracts/translation-memory/bulk-find-matches.d.ts +112 -0
- package/dist/api-contracts/translation-memory/get-matches.d.ts +84 -0
- package/dist/api-contracts/translation-memory/get-records.d.ts +87 -3
- package/dist/api-contracts/translation-memory/put-records.d.ts +57 -1
- package/dist/api-contracts/translation-memory/put-records.js +19 -2
- package/dist/api-contracts/translation-memory/put-records.js.map +1 -1
- package/dist/objects/translation-memory.d.ts +114 -0
- package/dist/objects/translation-memory.js +57 -0
- package/dist/objects/translation-memory.js.map +1 -1
- package/package.json +3 -3
|
@@ -34,6 +34,34 @@ export declare const BULK_TRANSLATION_MEMORY_MATCHES_SCHEMA: z.ZodObject<{
|
|
|
34
34
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
35
35
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
36
36
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
37
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
readonly HUMAN: "human";
|
|
39
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
40
|
+
readonly AI: "ai";
|
|
41
|
+
readonly MT: "mt";
|
|
42
|
+
readonly IMPORTED: "imported";
|
|
43
|
+
}>>;
|
|
44
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
45
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
47
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
48
|
+
}>>;
|
|
49
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
50
|
+
readonly SINGULAR: "singular";
|
|
51
|
+
readonly PLURAL: "plural";
|
|
52
|
+
}>>;
|
|
53
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
readonly ZERO: "zero";
|
|
55
|
+
readonly ONE: "one";
|
|
56
|
+
readonly TWO: "two";
|
|
57
|
+
readonly FEW: "few";
|
|
58
|
+
readonly MANY: "many";
|
|
59
|
+
readonly OTHER: "other";
|
|
60
|
+
}>>;
|
|
61
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
63
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
37
65
|
createdAt: z.ZodISODateTime;
|
|
38
66
|
updatedAt: z.ZodISODateTime;
|
|
39
67
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -64,6 +92,34 @@ export declare const POST_BULK_FIND_MATCHES_RESPONSE_SCHEMA: z.ZodObject<{
|
|
|
64
92
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
65
93
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
66
94
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
95
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
readonly HUMAN: "human";
|
|
97
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
98
|
+
readonly AI: "ai";
|
|
99
|
+
readonly MT: "mt";
|
|
100
|
+
readonly IMPORTED: "imported";
|
|
101
|
+
}>>;
|
|
102
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
103
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
104
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
105
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
106
|
+
}>>;
|
|
107
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
108
|
+
readonly SINGULAR: "singular";
|
|
109
|
+
readonly PLURAL: "plural";
|
|
110
|
+
}>>;
|
|
111
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
112
|
+
readonly ZERO: "zero";
|
|
113
|
+
readonly ONE: "one";
|
|
114
|
+
readonly TWO: "two";
|
|
115
|
+
readonly FEW: "few";
|
|
116
|
+
readonly MANY: "many";
|
|
117
|
+
readonly OTHER: "other";
|
|
118
|
+
}>>;
|
|
119
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
121
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, z.core.$loose>>;
|
|
67
123
|
createdAt: z.ZodISODateTime;
|
|
68
124
|
updatedAt: z.ZodISODateTime;
|
|
69
125
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -110,6 +166,34 @@ export declare const postBulkFindMatchesContract: import("@lokalise/api-contract
|
|
|
110
166
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
111
167
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
112
168
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
169
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
readonly HUMAN: "human";
|
|
171
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
172
|
+
readonly AI: "ai";
|
|
173
|
+
readonly MT: "mt";
|
|
174
|
+
readonly IMPORTED: "imported";
|
|
175
|
+
}>>;
|
|
176
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
177
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
178
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
179
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
180
|
+
}>>;
|
|
181
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
182
|
+
readonly SINGULAR: "singular";
|
|
183
|
+
readonly PLURAL: "plural";
|
|
184
|
+
}>>;
|
|
185
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
186
|
+
readonly ZERO: "zero";
|
|
187
|
+
readonly ONE: "one";
|
|
188
|
+
readonly TWO: "two";
|
|
189
|
+
readonly FEW: "few";
|
|
190
|
+
readonly MANY: "many";
|
|
191
|
+
readonly OTHER: "other";
|
|
192
|
+
}>>;
|
|
193
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
195
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$loose>>;
|
|
113
197
|
createdAt: z.ZodISODateTime;
|
|
114
198
|
updatedAt: z.ZodISODateTime;
|
|
115
199
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -148,6 +232,34 @@ export declare const postBulkFindMatchesContract: import("@lokalise/api-contract
|
|
|
148
232
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
149
233
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
150
234
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
235
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
236
|
+
readonly HUMAN: "human";
|
|
237
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
238
|
+
readonly AI: "ai";
|
|
239
|
+
readonly MT: "mt";
|
|
240
|
+
readonly IMPORTED: "imported";
|
|
241
|
+
}>>;
|
|
242
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
243
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
244
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
245
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
246
|
+
}>>;
|
|
247
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
248
|
+
readonly SINGULAR: "singular";
|
|
249
|
+
readonly PLURAL: "plural";
|
|
250
|
+
}>>;
|
|
251
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
252
|
+
readonly ZERO: "zero";
|
|
253
|
+
readonly ONE: "one";
|
|
254
|
+
readonly TWO: "two";
|
|
255
|
+
readonly FEW: "few";
|
|
256
|
+
readonly MANY: "many";
|
|
257
|
+
readonly OTHER: "other";
|
|
258
|
+
}>>;
|
|
259
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
261
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
262
|
+
}, z.core.$loose>>;
|
|
151
263
|
createdAt: z.ZodISODateTime;
|
|
152
264
|
updatedAt: z.ZodISODateTime;
|
|
153
265
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -28,6 +28,34 @@ export declare const GET_TRANSLATION_MEMORY_MATCHES_RESPONSE_SCHEMA: z.ZodObject
|
|
|
28
28
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
29
29
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
30
30
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
31
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
readonly HUMAN: "human";
|
|
33
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
34
|
+
readonly AI: "ai";
|
|
35
|
+
readonly MT: "mt";
|
|
36
|
+
readonly IMPORTED: "imported";
|
|
37
|
+
}>>;
|
|
38
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
41
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
42
|
+
}>>;
|
|
43
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
44
|
+
readonly SINGULAR: "singular";
|
|
45
|
+
readonly PLURAL: "plural";
|
|
46
|
+
}>>;
|
|
47
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
48
|
+
readonly ZERO: "zero";
|
|
49
|
+
readonly ONE: "one";
|
|
50
|
+
readonly TWO: "two";
|
|
51
|
+
readonly FEW: "few";
|
|
52
|
+
readonly MANY: "many";
|
|
53
|
+
readonly OTHER: "other";
|
|
54
|
+
}>>;
|
|
55
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
57
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$loose>>;
|
|
31
59
|
createdAt: z.ZodISODateTime;
|
|
32
60
|
updatedAt: z.ZodISODateTime;
|
|
33
61
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -56,6 +84,34 @@ export declare const getTranslationMemoryMatchesContract: import("@lokalise/api-
|
|
|
56
84
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
57
85
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
58
86
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
87
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
readonly HUMAN: "human";
|
|
89
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
90
|
+
readonly AI: "ai";
|
|
91
|
+
readonly MT: "mt";
|
|
92
|
+
readonly IMPORTED: "imported";
|
|
93
|
+
}>>;
|
|
94
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
97
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
98
|
+
}>>;
|
|
99
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
100
|
+
readonly SINGULAR: "singular";
|
|
101
|
+
readonly PLURAL: "plural";
|
|
102
|
+
}>>;
|
|
103
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
104
|
+
readonly ZERO: "zero";
|
|
105
|
+
readonly ONE: "one";
|
|
106
|
+
readonly TWO: "two";
|
|
107
|
+
readonly FEW: "few";
|
|
108
|
+
readonly MANY: "many";
|
|
109
|
+
readonly OTHER: "other";
|
|
110
|
+
}>>;
|
|
111
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
113
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$loose>>;
|
|
59
115
|
createdAt: z.ZodISODateTime;
|
|
60
116
|
updatedAt: z.ZodISODateTime;
|
|
61
117
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -101,6 +157,34 @@ export declare const getTranslationMemoryMatchesContract: import("@lokalise/api-
|
|
|
101
157
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
102
158
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
103
159
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
160
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
161
|
+
readonly HUMAN: "human";
|
|
162
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
163
|
+
readonly AI: "ai";
|
|
164
|
+
readonly MT: "mt";
|
|
165
|
+
readonly IMPORTED: "imported";
|
|
166
|
+
}>>;
|
|
167
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
169
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
170
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
171
|
+
}>>;
|
|
172
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
173
|
+
readonly SINGULAR: "singular";
|
|
174
|
+
readonly PLURAL: "plural";
|
|
175
|
+
}>>;
|
|
176
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
readonly ZERO: "zero";
|
|
178
|
+
readonly ONE: "one";
|
|
179
|
+
readonly TWO: "two";
|
|
180
|
+
readonly FEW: "few";
|
|
181
|
+
readonly MANY: "many";
|
|
182
|
+
readonly OTHER: "other";
|
|
183
|
+
}>>;
|
|
184
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
186
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$loose>>;
|
|
104
188
|
createdAt: z.ZodISODateTime;
|
|
105
189
|
updatedAt: z.ZodISODateTime;
|
|
106
190
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -45,6 +45,34 @@ export declare const GET_TRANSLATION_MEMORY_RECORDS_RESPONSE_SCHEMA: z.ZodObject
|
|
|
45
45
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
46
46
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
47
47
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
48
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
readonly HUMAN: "human";
|
|
50
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
51
|
+
readonly AI: "ai";
|
|
52
|
+
readonly MT: "mt";
|
|
53
|
+
readonly IMPORTED: "imported";
|
|
54
|
+
}>>;
|
|
55
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
58
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
59
|
+
}>>;
|
|
60
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
61
|
+
readonly SINGULAR: "singular";
|
|
62
|
+
readonly PLURAL: "plural";
|
|
63
|
+
}>>;
|
|
64
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
readonly ZERO: "zero";
|
|
66
|
+
readonly ONE: "one";
|
|
67
|
+
readonly TWO: "two";
|
|
68
|
+
readonly FEW: "few";
|
|
69
|
+
readonly MANY: "many";
|
|
70
|
+
readonly OTHER: "other";
|
|
71
|
+
}>>;
|
|
72
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
74
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$loose>>;
|
|
48
76
|
createdAt: z.ZodISODateTime;
|
|
49
77
|
updatedAt: z.ZodISODateTime;
|
|
50
78
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -60,7 +88,7 @@ export declare const GET_TRANSLATION_MEMORY_RECORDS_RESPONSE_SCHEMA: z.ZodObject
|
|
|
60
88
|
meta: z.ZodObject<{
|
|
61
89
|
count: z.ZodNumber;
|
|
62
90
|
cursor: z.ZodOptional<z.ZodString>;
|
|
63
|
-
hasMore: z.
|
|
91
|
+
hasMore: z.ZodBoolean;
|
|
64
92
|
}, z.core.$strip>;
|
|
65
93
|
}, z.core.$strip>;
|
|
66
94
|
export type GetTranslationMemoryRecordsResponse = z.infer<typeof GET_TRANSLATION_MEMORY_RECORDS_RESPONSE_SCHEMA>;
|
|
@@ -77,6 +105,34 @@ export declare const getTranslationMemoryRecordsContract: import("@lokalise/api-
|
|
|
77
105
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
78
106
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
79
107
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
108
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
109
|
+
readonly HUMAN: "human";
|
|
110
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
111
|
+
readonly AI: "ai";
|
|
112
|
+
readonly MT: "mt";
|
|
113
|
+
readonly IMPORTED: "imported";
|
|
114
|
+
}>>;
|
|
115
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
117
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
118
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
119
|
+
}>>;
|
|
120
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
readonly SINGULAR: "singular";
|
|
122
|
+
readonly PLURAL: "plural";
|
|
123
|
+
}>>;
|
|
124
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
readonly ZERO: "zero";
|
|
126
|
+
readonly ONE: "one";
|
|
127
|
+
readonly TWO: "two";
|
|
128
|
+
readonly FEW: "few";
|
|
129
|
+
readonly MANY: "many";
|
|
130
|
+
readonly OTHER: "other";
|
|
131
|
+
}>>;
|
|
132
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
134
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$loose>>;
|
|
80
136
|
createdAt: z.ZodISODateTime;
|
|
81
137
|
updatedAt: z.ZodISODateTime;
|
|
82
138
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -92,7 +148,7 @@ export declare const getTranslationMemoryRecordsContract: import("@lokalise/api-
|
|
|
92
148
|
meta: z.ZodObject<{
|
|
93
149
|
count: z.ZodNumber;
|
|
94
150
|
cursor: z.ZodOptional<z.ZodString>;
|
|
95
|
-
hasMore: z.
|
|
151
|
+
hasMore: z.ZodBoolean;
|
|
96
152
|
}, z.core.$strip>;
|
|
97
153
|
}, z.core.$strip>, z.ZodObject<{
|
|
98
154
|
ownerId: z.ZodGUID;
|
|
@@ -130,6 +186,34 @@ export declare const getTranslationMemoryRecordsContract: import("@lokalise/api-
|
|
|
130
186
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
131
187
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
132
188
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
189
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
190
|
+
readonly HUMAN: "human";
|
|
191
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
192
|
+
readonly AI: "ai";
|
|
193
|
+
readonly MT: "mt";
|
|
194
|
+
readonly IMPORTED: "imported";
|
|
195
|
+
}>>;
|
|
196
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
197
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
198
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
199
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
200
|
+
}>>;
|
|
201
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
202
|
+
readonly SINGULAR: "singular";
|
|
203
|
+
readonly PLURAL: "plural";
|
|
204
|
+
}>>;
|
|
205
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
readonly ZERO: "zero";
|
|
207
|
+
readonly ONE: "one";
|
|
208
|
+
readonly TWO: "two";
|
|
209
|
+
readonly FEW: "few";
|
|
210
|
+
readonly MANY: "many";
|
|
211
|
+
readonly OTHER: "other";
|
|
212
|
+
}>>;
|
|
213
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
215
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$loose>>;
|
|
133
217
|
createdAt: z.ZodISODateTime;
|
|
134
218
|
updatedAt: z.ZodISODateTime;
|
|
135
219
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -145,7 +229,7 @@ export declare const getTranslationMemoryRecordsContract: import("@lokalise/api-
|
|
|
145
229
|
meta: z.ZodObject<{
|
|
146
230
|
count: z.ZodNumber;
|
|
147
231
|
cursor: z.ZodOptional<z.ZodString>;
|
|
148
|
-
hasMore: z.
|
|
232
|
+
hasMore: z.ZodBoolean;
|
|
149
233
|
}, z.core.$strip>;
|
|
150
234
|
}, z.core.$strip>;
|
|
151
235
|
400: z.ZodObject<{
|
|
@@ -13,8 +13,36 @@ export declare const PUT_TRANSLATION_MEMORY_RECORD_REQUEST_BODY_SCHEMA: z.ZodArr
|
|
|
13
13
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
14
14
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
15
15
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
16
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
readonly HUMAN: "human";
|
|
18
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
19
|
+
readonly AI: "ai";
|
|
20
|
+
readonly MT: "mt";
|
|
21
|
+
readonly IMPORTED: "imported";
|
|
22
|
+
}>>;
|
|
23
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
26
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
27
|
+
}>>;
|
|
28
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
29
|
+
readonly SINGULAR: "singular";
|
|
30
|
+
readonly PLURAL: "plural";
|
|
31
|
+
}>>;
|
|
32
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
readonly ZERO: "zero";
|
|
34
|
+
readonly ONE: "one";
|
|
35
|
+
readonly TWO: "two";
|
|
36
|
+
readonly FEW: "few";
|
|
37
|
+
readonly MANY: "many";
|
|
38
|
+
readonly OTHER: "other";
|
|
39
|
+
}>>;
|
|
40
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
42
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$loose>>;
|
|
16
44
|
}, z.core.$strip>>;
|
|
17
|
-
export type PutTranslationMemoryRecordRequestBody = z.
|
|
45
|
+
export type PutTranslationMemoryRecordRequestBody = z.input<typeof PUT_TRANSLATION_MEMORY_RECORD_REQUEST_BODY_SCHEMA>;
|
|
18
46
|
export declare const putTranslationMemoryRecordsContract: import("@lokalise/api-contracts").PayloadRouteDefinition<z.ZodArray<z.ZodObject<{
|
|
19
47
|
sourceLocale: z.ZodString;
|
|
20
48
|
targetLocale: z.ZodString;
|
|
@@ -24,6 +52,34 @@ export declare const putTranslationMemoryRecordsContract: import("@lokalise/api-
|
|
|
24
52
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
25
53
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
26
54
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
55
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
readonly HUMAN: "human";
|
|
57
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
58
|
+
readonly AI: "ai";
|
|
59
|
+
readonly MT: "mt";
|
|
60
|
+
readonly IMPORTED: "imported";
|
|
61
|
+
}>>;
|
|
62
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
65
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
66
|
+
}>>;
|
|
67
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
68
|
+
readonly SINGULAR: "singular";
|
|
69
|
+
readonly PLURAL: "plural";
|
|
70
|
+
}>>;
|
|
71
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
readonly ZERO: "zero";
|
|
73
|
+
readonly ONE: "one";
|
|
74
|
+
readonly TWO: "two";
|
|
75
|
+
readonly FEW: "few";
|
|
76
|
+
readonly MANY: "many";
|
|
77
|
+
readonly OTHER: "other";
|
|
78
|
+
}>>;
|
|
79
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
81
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$loose>>;
|
|
27
83
|
}, z.core.$strip>>, z.ZodUndefined, z.ZodObject<{
|
|
28
84
|
ownerId: z.ZodGUID;
|
|
29
85
|
groupId: z.ZodString;
|
|
@@ -2,14 +2,31 @@ import { buildRestContract } from '@lokalise/api-contracts';
|
|
|
2
2
|
import { commonErrorResponses } from '@lokalise/common-api-schemas';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { EXPERT_ADMIN_ROLES } from "../../constants.js";
|
|
5
|
-
import { TM_OWNER_GROUP_ID_SCHEMA, UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA, } from "../../objects/index.js";
|
|
5
|
+
import { TM_OWNER_GROUP_ID_SCHEMA, TranslationMemoryRecordKindEnum, UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA, } from "../../objects/index.js";
|
|
6
6
|
import { REQUEST_HEADER_SCHEMA } from "../common.js";
|
|
7
7
|
// --------------------------------------------
|
|
8
8
|
// PUT /v1/owners/:ownerId/:ownerId/groups/:groupId/records
|
|
9
9
|
// --------------------------------------------
|
|
10
10
|
export const PUT_TRANSLATION_MEMORY_RECORDS_PARAMS_SCHEMA = TM_OWNER_GROUP_ID_SCHEMA;
|
|
11
11
|
export const PUT_TRANSLATION_MEMORY_RECORD_REQUEST_BODY_SCHEMA = z
|
|
12
|
-
.array(UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA)
|
|
12
|
+
.array(UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA.superRefine((data, ctx) => {
|
|
13
|
+
const isPlural = data.kind === TranslationMemoryRecordKindEnum.PLURAL;
|
|
14
|
+
const hasVariant = !!data.kindVariant;
|
|
15
|
+
if (isPlural && !hasVariant) {
|
|
16
|
+
ctx.addIssue({
|
|
17
|
+
code: 'custom',
|
|
18
|
+
path: ['kindVariant'],
|
|
19
|
+
message: 'kindVariant is required when kind is plural',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (!isPlural && hasVariant) {
|
|
23
|
+
ctx.addIssue({
|
|
24
|
+
code: 'custom',
|
|
25
|
+
path: ['kindVariant'],
|
|
26
|
+
message: 'kindVariant must not be set when kind is singular',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}))
|
|
13
30
|
.min(1)
|
|
14
31
|
.max(100);
|
|
15
32
|
export const putTranslationMemoryRecordsContract = buildRestContract({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put-records.js","sourceRoot":"","sources":["../../../src/api-contracts/translation-memory/put-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAA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QAAQ,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5B,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,OAAO,EAAE,6CAA6C;SACvD,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,CAAC,QAAQ,IAAI,UAAU,EAAE,CAAC;QAC5B,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,aAAa,CAAC;YACrB,OAAO,EAAE,mDAAmD;SAC7D,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CACH;KACA,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC,CAAA;AAKX,MAAM,CAAC,MAAM,mCAAmC,GAAG,iBAAiB,CAAC;IACnE,MAAM,EAAE,KAAK;IACb,uBAAuB,EAAE,4CAA4C;IACrE,iBAAiB,EAAE,iDAAiD;IACpE,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,cAAc,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC,OAAO,UAAU;IACzF,WAAW,EAAE,6BAA6B;IAC1C,yBAAyB,EAAE,CAAC,CAAC,SAAS,EAAE;IACxC,uBAAuB,EAAE,IAAI;IAC7B,2BAA2B,EAAE;QAC3B,GAAG,oBAAoB;QACvB,GAAG,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KACjD;IACD,QAAQ,EAAE,EAAE,sBAAsB,EAAE,kBAAkB,EAAE;CACzD,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PaginationMeta } from '@lokalise/api-common';
|
|
2
|
+
import type { ObjectValues } from '@lokalise/universal-ts-utils/node';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
export declare const TRANSLATION_MEMORY_IMPORT_METADATA_SCHEMA: z.ZodObject<{
|
|
4
5
|
processId: z.ZodGUID;
|
|
@@ -10,6 +11,33 @@ export declare const TRANSLATION_MEMORY_IMPORT_METADATA_SCHEMA: z.ZodObject<{
|
|
|
10
11
|
creationId: z.ZodOptional<z.ZodString>;
|
|
11
12
|
}, z.core.$strip>;
|
|
12
13
|
export type TranslationMemoryRecordImportMetadata = z.infer<typeof TRANSLATION_MEMORY_IMPORT_METADATA_SCHEMA>;
|
|
14
|
+
export declare const TranslationMemoryRecordOriginEnum: {
|
|
15
|
+
readonly HUMAN: "human";
|
|
16
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
17
|
+
readonly AI: "ai";
|
|
18
|
+
readonly MT: "mt";
|
|
19
|
+
readonly IMPORTED: "imported";
|
|
20
|
+
};
|
|
21
|
+
export type TranslationMemoryRecordOrigin = ObjectValues<typeof TranslationMemoryRecordOriginEnum>;
|
|
22
|
+
export declare const TranslationMemoryRecordApprovedTypeEnum: {
|
|
23
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
24
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
25
|
+
};
|
|
26
|
+
export type TranslationMemoryRecordApprovedType = ObjectValues<typeof TranslationMemoryRecordApprovedTypeEnum>;
|
|
27
|
+
export declare const TranslationMemoryRecordKindEnum: {
|
|
28
|
+
readonly SINGULAR: "singular";
|
|
29
|
+
readonly PLURAL: "plural";
|
|
30
|
+
};
|
|
31
|
+
export type TranslationMemoryRecordKind = ObjectValues<typeof TranslationMemoryRecordKindEnum>;
|
|
32
|
+
export declare const TranslationMemoryRecordKindVariantEnum: {
|
|
33
|
+
readonly ZERO: "zero";
|
|
34
|
+
readonly ONE: "one";
|
|
35
|
+
readonly TWO: "two";
|
|
36
|
+
readonly FEW: "few";
|
|
37
|
+
readonly MANY: "many";
|
|
38
|
+
readonly OTHER: "other";
|
|
39
|
+
};
|
|
40
|
+
export type TranslationMemoryRecordKindVariant = ObjectValues<typeof TranslationMemoryRecordKindVariantEnum>;
|
|
13
41
|
export declare const TRANSLATION_MEMORY_RECORD_SCHEMA: z.ZodObject<{
|
|
14
42
|
id: z.ZodString;
|
|
15
43
|
groupId: z.ZodString;
|
|
@@ -22,6 +50,34 @@ export declare const TRANSLATION_MEMORY_RECORD_SCHEMA: z.ZodObject<{
|
|
|
22
50
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
23
51
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
24
52
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
53
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
readonly HUMAN: "human";
|
|
55
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
56
|
+
readonly AI: "ai";
|
|
57
|
+
readonly MT: "mt";
|
|
58
|
+
readonly IMPORTED: "imported";
|
|
59
|
+
}>>;
|
|
60
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
61
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
63
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
64
|
+
}>>;
|
|
65
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
66
|
+
readonly SINGULAR: "singular";
|
|
67
|
+
readonly PLURAL: "plural";
|
|
68
|
+
}>>;
|
|
69
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
readonly ZERO: "zero";
|
|
71
|
+
readonly ONE: "one";
|
|
72
|
+
readonly TWO: "two";
|
|
73
|
+
readonly FEW: "few";
|
|
74
|
+
readonly MANY: "many";
|
|
75
|
+
readonly OTHER: "other";
|
|
76
|
+
}>>;
|
|
77
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
79
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$loose>>;
|
|
25
81
|
createdAt: z.ZodISODateTime;
|
|
26
82
|
updatedAt: z.ZodISODateTime;
|
|
27
83
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -35,6 +91,7 @@ export declare const TRANSLATION_MEMORY_RECORD_SCHEMA: z.ZodObject<{
|
|
|
35
91
|
}, z.core.$strip>>;
|
|
36
92
|
}, z.core.$strip>;
|
|
37
93
|
export type TranslationMemoryRecord = z.infer<typeof TRANSLATION_MEMORY_RECORD_SCHEMA>;
|
|
94
|
+
export type TranslationMemoryRecordInput = z.input<typeof TRANSLATION_MEMORY_RECORD_SCHEMA>;
|
|
38
95
|
export declare const TRANSLATION_MEMORY_MATCH_SCHEMA: z.ZodObject<{
|
|
39
96
|
id: z.ZodString;
|
|
40
97
|
groupId: z.ZodString;
|
|
@@ -47,6 +104,34 @@ export declare const TRANSLATION_MEMORY_MATCH_SCHEMA: z.ZodObject<{
|
|
|
47
104
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
48
105
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
49
106
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
107
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
108
|
+
readonly HUMAN: "human";
|
|
109
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
110
|
+
readonly AI: "ai";
|
|
111
|
+
readonly MT: "mt";
|
|
112
|
+
readonly IMPORTED: "imported";
|
|
113
|
+
}>>;
|
|
114
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
115
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
116
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
117
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
118
|
+
}>>;
|
|
119
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
120
|
+
readonly SINGULAR: "singular";
|
|
121
|
+
readonly PLURAL: "plural";
|
|
122
|
+
}>>;
|
|
123
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
124
|
+
readonly ZERO: "zero";
|
|
125
|
+
readonly ONE: "one";
|
|
126
|
+
readonly TWO: "two";
|
|
127
|
+
readonly FEW: "few";
|
|
128
|
+
readonly MANY: "many";
|
|
129
|
+
readonly OTHER: "other";
|
|
130
|
+
}>>;
|
|
131
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
133
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$loose>>;
|
|
50
135
|
createdAt: z.ZodISODateTime;
|
|
51
136
|
updatedAt: z.ZodISODateTime;
|
|
52
137
|
importMetadata: z.ZodOptional<z.ZodObject<{
|
|
@@ -70,8 +155,37 @@ export declare const UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA: z.ZodObject<{
|
|
|
70
155
|
sourceNextContent: z.ZodOptional<z.ZodString>;
|
|
71
156
|
projectId: z.ZodOptional<z.ZodGUID>;
|
|
72
157
|
updatedBy: z.ZodOptional<z.ZodGUID>;
|
|
158
|
+
origin: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
readonly HUMAN: "human";
|
|
160
|
+
readonly AI_WITH_RAG: "ai-with-rag";
|
|
161
|
+
readonly AI: "ai";
|
|
162
|
+
readonly MT: "mt";
|
|
163
|
+
readonly IMPORTED: "imported";
|
|
164
|
+
}>>;
|
|
165
|
+
externalId: z.ZodOptional<z.ZodString>;
|
|
166
|
+
approved: z.ZodOptional<z.ZodEnum<{
|
|
167
|
+
readonly HUMAN_APPROVED: "human-approved";
|
|
168
|
+
readonly AI_SCORING_APPROVED: "ai-scoring-approved";
|
|
169
|
+
}>>;
|
|
170
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
171
|
+
readonly SINGULAR: "singular";
|
|
172
|
+
readonly PLURAL: "plural";
|
|
173
|
+
}>>;
|
|
174
|
+
kindVariant: z.ZodOptional<z.ZodEnum<{
|
|
175
|
+
readonly ZERO: "zero";
|
|
176
|
+
readonly ONE: "one";
|
|
177
|
+
readonly TWO: "two";
|
|
178
|
+
readonly FEW: "few";
|
|
179
|
+
readonly MANY: "many";
|
|
180
|
+
readonly OTHER: "other";
|
|
181
|
+
}>>;
|
|
182
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
keyName: z.ZodOptional<z.ZodString>;
|
|
184
|
+
keyDescription: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$loose>>;
|
|
73
186
|
}, z.core.$strip>;
|
|
74
187
|
export type UpsertTranslationMemoryRecordDto = z.infer<typeof UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA>;
|
|
188
|
+
export type UpsertTranslationMemoryRecordInputDto = z.input<typeof UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA>;
|
|
75
189
|
export type TranslationMemoryRecordsResponse = {
|
|
76
190
|
records: TranslationMemoryRecord[];
|
|
77
191
|
meta: PaginationMeta;
|
|
@@ -9,6 +9,29 @@ export const TRANSLATION_MEMORY_IMPORT_METADATA_SCHEMA = z.object({
|
|
|
9
9
|
creationDate: z.iso.datetime().optional().describe('TMX translation unit creation date'),
|
|
10
10
|
creationId: z.string().optional().describe('TMX translation unit creation ID'),
|
|
11
11
|
});
|
|
12
|
+
export const TranslationMemoryRecordOriginEnum = {
|
|
13
|
+
HUMAN: 'human',
|
|
14
|
+
AI_WITH_RAG: 'ai-with-rag',
|
|
15
|
+
AI: 'ai',
|
|
16
|
+
MT: 'mt',
|
|
17
|
+
IMPORTED: 'imported',
|
|
18
|
+
};
|
|
19
|
+
export const TranslationMemoryRecordApprovedTypeEnum = {
|
|
20
|
+
HUMAN_APPROVED: 'human-approved',
|
|
21
|
+
AI_SCORING_APPROVED: 'ai-scoring-approved',
|
|
22
|
+
};
|
|
23
|
+
export const TranslationMemoryRecordKindEnum = {
|
|
24
|
+
SINGULAR: 'singular',
|
|
25
|
+
PLURAL: 'plural',
|
|
26
|
+
};
|
|
27
|
+
export const TranslationMemoryRecordKindVariantEnum = {
|
|
28
|
+
ZERO: 'zero',
|
|
29
|
+
ONE: 'one',
|
|
30
|
+
TWO: 'two',
|
|
31
|
+
FEW: 'few',
|
|
32
|
+
MANY: 'many',
|
|
33
|
+
OTHER: 'other',
|
|
34
|
+
};
|
|
12
35
|
export const TRANSLATION_MEMORY_RECORD_SCHEMA = z.object({
|
|
13
36
|
id: z.string().nonempty().describe('Unique record ID, generated by TM service'),
|
|
14
37
|
groupId: GROUP_ID_SCHEMA,
|
|
@@ -29,6 +52,34 @@ export const TRANSLATION_MEMORY_RECORD_SCHEMA = z.object({
|
|
|
29
52
|
.describe('Text that appears right after the sought translation'),
|
|
30
53
|
projectId: z.guid().optional().describe('Project ID associated with the record'),
|
|
31
54
|
updatedBy: z.guid().optional().describe('User ID that updated the record last time'),
|
|
55
|
+
origin: z
|
|
56
|
+
.enum(TranslationMemoryRecordOriginEnum)
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('How the translation was produced'),
|
|
59
|
+
externalId: z
|
|
60
|
+
.string()
|
|
61
|
+
.nonempty()
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('External system identifier (e.g. translation key ID)'),
|
|
64
|
+
approved: z.enum(TranslationMemoryRecordApprovedTypeEnum).optional().describe('Approval status'),
|
|
65
|
+
kind: z
|
|
66
|
+
.enum(TranslationMemoryRecordKindEnum)
|
|
67
|
+
.default(TranslationMemoryRecordKindEnum.SINGULAR)
|
|
68
|
+
.describe('Plural form kind'),
|
|
69
|
+
kindVariant: z
|
|
70
|
+
.enum(TranslationMemoryRecordKindVariantEnum)
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Plural form variant'),
|
|
73
|
+
metadata: z
|
|
74
|
+
.looseObject({
|
|
75
|
+
keyName: z.string().optional(),
|
|
76
|
+
keyDescription: z.string().optional(),
|
|
77
|
+
})
|
|
78
|
+
.refine((obj) => JSON.stringify(obj).length <= 4096, {
|
|
79
|
+
message: 'metadata must not exceed 4KB',
|
|
80
|
+
})
|
|
81
|
+
.optional()
|
|
82
|
+
.describe('Arbitrary key-value metadata (e.g. key_name, description). Fully replaced on update.'),
|
|
32
83
|
createdAt: z.iso.datetime().describe('Timestamp of record creation, generated by TM service'),
|
|
33
84
|
updatedAt: z.iso.datetime().describe('Timestamp of the last update, generated by TM service'),
|
|
34
85
|
importMetadata: TRANSLATION_MEMORY_IMPORT_METADATA_SCHEMA.optional().describe('Import metadata'),
|
|
@@ -49,6 +100,12 @@ export const UPSERT_TRANSLATION_MEMORY_RECORD_SCHEMA = TRANSLATION_MEMORY_RECORD
|
|
|
49
100
|
sourceNextContent: true,
|
|
50
101
|
projectId: true,
|
|
51
102
|
updatedBy: true,
|
|
103
|
+
origin: true,
|
|
104
|
+
externalId: true,
|
|
105
|
+
kind: true,
|
|
106
|
+
kindVariant: true,
|
|
107
|
+
approved: true,
|
|
108
|
+
metadata: true,
|
|
52
109
|
});
|
|
53
110
|
export const TRANSLATION_MEMORY_LOOKUP_OPTIONS_SCHEMA = z
|
|
54
111
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-memory.js","sourceRoot":"","sources":["../../src/objects/translation-memory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translation-memory.js","sourceRoot":"","sources":["../../src/objects/translation-memory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7E,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAC1E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IAC1D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACjE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CA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,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,kFAAkF,CAAC;IAC/F,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CAAC,iFAAiF,CAAC;CAC/F,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokalise/tm-api-schemas",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Lokalise",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"postversion": "biome check --write package.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@lokalise/api-common": "^
|
|
37
|
+
"@lokalise/api-common": "^7.1.1",
|
|
38
38
|
"@lokalise/api-contracts": "^6.9.0",
|
|
39
|
-
"@lokalise/common-api-schemas": "^2.2.
|
|
39
|
+
"@lokalise/common-api-schemas": "^2.2.1",
|
|
40
40
|
"@lokalise/supported-languages": "^3.2.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|