@lingo.dev/_spec 0.33.1 → 0.33.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/i18n.schema.json +22 -57
- package/build/index.cjs +18 -23
- package/build/index.d.cts +21 -130
- package/build/index.d.ts +21 -130
- package/build/index.mjs +18 -23
- package/package.json +1 -1
package/build/i18n.schema.json
CHANGED
@@ -145,66 +145,31 @@
|
|
145
145
|
"default": "https://lingo.dev/schema/i18n.json"
|
146
146
|
},
|
147
147
|
"provider": {
|
148
|
-
"
|
149
|
-
|
150
|
-
|
151
|
-
"
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
"model": {
|
157
|
-
"type": "string",
|
158
|
-
"const": "best"
|
159
|
-
},
|
160
|
-
"prompt": {
|
161
|
-
"type": "string"
|
162
|
-
},
|
163
|
-
"baseUrl": {
|
164
|
-
"type": "string"
|
165
|
-
}
|
166
|
-
},
|
167
|
-
"required": [
|
168
|
-
"id",
|
169
|
-
"model",
|
170
|
-
"prompt"
|
171
|
-
],
|
172
|
-
"additionalProperties": false
|
148
|
+
"type": "object",
|
149
|
+
"properties": {
|
150
|
+
"id": {
|
151
|
+
"type": "string",
|
152
|
+
"enum": [
|
153
|
+
"openai",
|
154
|
+
"anthropic"
|
155
|
+
]
|
173
156
|
},
|
174
|
-
{
|
175
|
-
"type": "
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
]
|
183
|
-
},
|
184
|
-
"model": {
|
185
|
-
"type": "string"
|
186
|
-
},
|
187
|
-
"prompt": {
|
188
|
-
"$ref": "#/properties/provider/anyOf/0/properties/prompt"
|
189
|
-
},
|
190
|
-
"baseUrl": {
|
191
|
-
"$ref": "#/properties/provider/anyOf/0/properties/baseUrl"
|
192
|
-
}
|
193
|
-
},
|
194
|
-
"required": [
|
195
|
-
"id",
|
196
|
-
"model",
|
197
|
-
"prompt"
|
198
|
-
],
|
199
|
-
"additionalProperties": false
|
157
|
+
"model": {
|
158
|
+
"type": "string"
|
159
|
+
},
|
160
|
+
"prompt": {
|
161
|
+
"type": "string"
|
162
|
+
},
|
163
|
+
"baseUrl": {
|
164
|
+
"type": "string"
|
200
165
|
}
|
166
|
+
},
|
167
|
+
"required": [
|
168
|
+
"id",
|
169
|
+
"model",
|
170
|
+
"prompt"
|
201
171
|
],
|
202
|
-
"
|
203
|
-
"id": "lingo",
|
204
|
-
"model": "best",
|
205
|
-
"baseUrl": "https://engine.lingo.dev",
|
206
|
-
"prompt": ""
|
207
|
-
}
|
172
|
+
"additionalProperties": false
|
208
173
|
}
|
209
174
|
},
|
210
175
|
"required": [
|
package/build/index.cjs
CHANGED
@@ -251,11 +251,17 @@ var localeMap = {
|
|
251
251
|
// Telugu (India)
|
252
252
|
te: ["te-IN"],
|
253
253
|
// Kinyarwanda (Rwanda)
|
254
|
-
rw: ["rw-RW"]
|
254
|
+
rw: ["rw-RW"],
|
255
|
+
// Georgian (Georgia)
|
256
|
+
ka: ["ka-GE"]
|
255
257
|
};
|
256
258
|
var localeCodesShort = Object.keys(localeMap);
|
257
|
-
var localeCodesFull = Object.values(
|
258
|
-
|
259
|
+
var localeCodesFull = Object.values(
|
260
|
+
localeMap
|
261
|
+
).flat();
|
262
|
+
var localeCodesFullUnderscore = localeCodesFull.map(
|
263
|
+
(value) => value.replace("-", "_")
|
264
|
+
);
|
259
265
|
var localeCodesFullExplicitRegion = localeCodesFull.map((value) => {
|
260
266
|
const chunks = value.split("-");
|
261
267
|
const result = [chunks[0], "-r", chunks.slice(1).join("-")].join("");
|
@@ -267,9 +273,12 @@ var localeCodes = [
|
|
267
273
|
...localeCodesFullUnderscore,
|
268
274
|
...localeCodesFullExplicitRegion
|
269
275
|
];
|
270
|
-
var localeCodeSchema = _zod2.default.string().refine(
|
271
|
-
|
272
|
-
|
276
|
+
var localeCodeSchema = _zod2.default.string().refine(
|
277
|
+
(value) => localeCodes.includes(value),
|
278
|
+
{
|
279
|
+
message: "Invalid locale code"
|
280
|
+
}
|
281
|
+
);
|
273
282
|
var resolveLocaleCode = (value) => {
|
274
283
|
const existingFullLocaleCode = Object.values(localeMap).flat().includes(value);
|
275
284
|
if (existingFullLocaleCode) {
|
@@ -513,31 +522,17 @@ var configV1_4Definition = extendConfigDefinition(
|
|
513
522
|
})
|
514
523
|
}
|
515
524
|
);
|
516
|
-
var
|
517
|
-
id: _zod2.default.
|
525
|
+
var providerSchema = _zod2.default.object({
|
526
|
+
id: _zod2.default.enum(["openai", "anthropic"]),
|
518
527
|
model: _zod2.default.string(),
|
519
528
|
prompt: _zod2.default.string(),
|
520
529
|
baseUrl: _zod2.default.string().optional()
|
521
530
|
});
|
522
|
-
var providerSchema = _zod2.default.union([
|
523
|
-
commonProviderSchema.extend({
|
524
|
-
id: _zod2.default.literal("lingo"),
|
525
|
-
model: _zod2.default.literal("best")
|
526
|
-
}),
|
527
|
-
commonProviderSchema.extend({
|
528
|
-
id: _zod2.default.enum(["openai", "anthropic"])
|
529
|
-
})
|
530
|
-
]);
|
531
531
|
var configV1_5Definition = extendConfigDefinition(
|
532
532
|
configV1_4Definition,
|
533
533
|
{
|
534
534
|
createSchema: (baseSchema) => baseSchema.extend({
|
535
|
-
provider: providerSchema.
|
536
|
-
id: "lingo",
|
537
|
-
model: "best",
|
538
|
-
baseUrl: "https://engine.lingo.dev",
|
539
|
-
prompt: ""
|
540
|
-
}).optional()
|
535
|
+
provider: providerSchema.optional()
|
541
536
|
}),
|
542
537
|
createDefaultValue: (baseDefaultValue) => ({
|
543
538
|
...baseDefaultValue,
|
package/build/index.d.cts
CHANGED
@@ -67,6 +67,7 @@ declare const localeMap: {
|
|
67
67
|
readonly tl: readonly ["tl-PH"];
|
68
68
|
readonly te: readonly ["te-IN"];
|
69
69
|
readonly rw: readonly ["rw-RW"];
|
70
|
+
readonly ka: readonly ["ka-GE"];
|
70
71
|
};
|
71
72
|
type LocaleCodeShort = keyof typeof localeMap;
|
72
73
|
type LocaleCodeFull = (typeof localeMap)[LocaleCodeShort][number];
|
@@ -530,32 +531,12 @@ declare const configV1_5Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
530
531
|
}>, {
|
531
532
|
$schema: Z.ZodDefault<Z.ZodString>;
|
532
533
|
}>, {
|
533
|
-
provider: Z.ZodOptional<Z.
|
534
|
-
id: Z.
|
535
|
-
model: Z.ZodString;
|
536
|
-
prompt: Z.ZodString;
|
537
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
538
|
-
}, {
|
539
|
-
id: Z.ZodLiteral<"lingo">;
|
540
|
-
model: Z.ZodLiteral<"best">;
|
541
|
-
}>, "strip", Z.ZodTypeAny, {
|
542
|
-
id: "lingo";
|
543
|
-
model: "best";
|
544
|
-
prompt: string;
|
545
|
-
baseUrl?: string | undefined;
|
546
|
-
}, {
|
547
|
-
id: "lingo";
|
548
|
-
model: "best";
|
549
|
-
prompt: string;
|
550
|
-
baseUrl?: string | undefined;
|
551
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
552
|
-
id: Z.ZodString;
|
534
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
535
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
553
536
|
model: Z.ZodString;
|
554
537
|
prompt: Z.ZodString;
|
555
538
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
556
|
-
}, {
|
557
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
558
|
-
}>, "strip", Z.ZodTypeAny, {
|
539
|
+
}, "strip", Z.ZodTypeAny, {
|
559
540
|
id: "openai" | "anthropic";
|
560
541
|
model: string;
|
561
542
|
prompt: string;
|
@@ -565,7 +546,7 @@ declare const configV1_5Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
565
546
|
model: string;
|
566
547
|
prompt: string;
|
567
548
|
baseUrl?: string | undefined;
|
568
|
-
}
|
549
|
+
}>>;
|
569
550
|
}>, Z.ZodRawShape>;
|
570
551
|
declare const bucketValueSchemaV1_6: Z.ZodObject<Z.objectUtil.extendShape<{
|
571
552
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -701,32 +682,12 @@ declare const configV1_6Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
701
682
|
}>, {
|
702
683
|
$schema: Z.ZodDefault<Z.ZodString>;
|
703
684
|
}>, {
|
704
|
-
provider: Z.ZodOptional<Z.
|
705
|
-
id: Z.
|
706
|
-
model: Z.ZodString;
|
707
|
-
prompt: Z.ZodString;
|
708
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
709
|
-
}, {
|
710
|
-
id: Z.ZodLiteral<"lingo">;
|
711
|
-
model: Z.ZodLiteral<"best">;
|
712
|
-
}>, "strip", Z.ZodTypeAny, {
|
713
|
-
id: "lingo";
|
714
|
-
model: "best";
|
715
|
-
prompt: string;
|
716
|
-
baseUrl?: string | undefined;
|
717
|
-
}, {
|
718
|
-
id: "lingo";
|
719
|
-
model: "best";
|
720
|
-
prompt: string;
|
721
|
-
baseUrl?: string | undefined;
|
722
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
723
|
-
id: Z.ZodString;
|
685
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
686
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
724
687
|
model: Z.ZodString;
|
725
688
|
prompt: Z.ZodString;
|
726
689
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
727
|
-
}, {
|
728
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
729
|
-
}>, "strip", Z.ZodTypeAny, {
|
690
|
+
}, "strip", Z.ZodTypeAny, {
|
730
691
|
id: "openai" | "anthropic";
|
731
692
|
model: string;
|
732
693
|
prompt: string;
|
@@ -736,7 +697,7 @@ declare const configV1_6Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
736
697
|
model: string;
|
737
698
|
prompt: string;
|
738
699
|
baseUrl?: string | undefined;
|
739
|
-
}
|
700
|
+
}>>;
|
740
701
|
}>, {
|
741
702
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
742
703
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -924,32 +885,12 @@ declare const configV1_7Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
924
885
|
}>, {
|
925
886
|
$schema: Z.ZodDefault<Z.ZodString>;
|
926
887
|
}>, {
|
927
|
-
provider: Z.ZodOptional<Z.
|
928
|
-
id: Z.
|
929
|
-
model: Z.ZodString;
|
930
|
-
prompt: Z.ZodString;
|
931
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
932
|
-
}, {
|
933
|
-
id: Z.ZodLiteral<"lingo">;
|
934
|
-
model: Z.ZodLiteral<"best">;
|
935
|
-
}>, "strip", Z.ZodTypeAny, {
|
936
|
-
id: "lingo";
|
937
|
-
model: "best";
|
938
|
-
prompt: string;
|
939
|
-
baseUrl?: string | undefined;
|
940
|
-
}, {
|
941
|
-
id: "lingo";
|
942
|
-
model: "best";
|
943
|
-
prompt: string;
|
944
|
-
baseUrl?: string | undefined;
|
945
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
946
|
-
id: Z.ZodString;
|
888
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
889
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
947
890
|
model: Z.ZodString;
|
948
891
|
prompt: Z.ZodString;
|
949
892
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
950
|
-
}, {
|
951
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
952
|
-
}>, "strip", Z.ZodTypeAny, {
|
893
|
+
}, "strip", Z.ZodTypeAny, {
|
953
894
|
id: "openai" | "anthropic";
|
954
895
|
model: string;
|
955
896
|
prompt: string;
|
@@ -959,7 +900,7 @@ declare const configV1_7Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
959
900
|
model: string;
|
960
901
|
prompt: string;
|
961
902
|
baseUrl?: string | undefined;
|
962
|
-
}
|
903
|
+
}>>;
|
963
904
|
}>, {
|
964
905
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
965
906
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -1203,32 +1144,12 @@ declare const configV1_8Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
1203
1144
|
}>, {
|
1204
1145
|
$schema: Z.ZodDefault<Z.ZodString>;
|
1205
1146
|
}>, {
|
1206
|
-
provider: Z.ZodOptional<Z.
|
1207
|
-
id: Z.
|
1208
|
-
model: Z.ZodString;
|
1209
|
-
prompt: Z.ZodString;
|
1210
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1211
|
-
}, {
|
1212
|
-
id: Z.ZodLiteral<"lingo">;
|
1213
|
-
model: Z.ZodLiteral<"best">;
|
1214
|
-
}>, "strip", Z.ZodTypeAny, {
|
1215
|
-
id: "lingo";
|
1216
|
-
model: "best";
|
1217
|
-
prompt: string;
|
1218
|
-
baseUrl?: string | undefined;
|
1219
|
-
}, {
|
1220
|
-
id: "lingo";
|
1221
|
-
model: "best";
|
1222
|
-
prompt: string;
|
1223
|
-
baseUrl?: string | undefined;
|
1224
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1225
|
-
id: Z.ZodString;
|
1147
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
1148
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1226
1149
|
model: Z.ZodString;
|
1227
1150
|
prompt: Z.ZodString;
|
1228
1151
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1229
|
-
}, {
|
1230
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1231
|
-
}>, "strip", Z.ZodTypeAny, {
|
1152
|
+
}, "strip", Z.ZodTypeAny, {
|
1232
1153
|
id: "openai" | "anthropic";
|
1233
1154
|
model: string;
|
1234
1155
|
prompt: string;
|
@@ -1238,7 +1159,7 @@ declare const configV1_8Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
1238
1159
|
model: string;
|
1239
1160
|
prompt: string;
|
1240
1161
|
baseUrl?: string | undefined;
|
1241
|
-
}
|
1162
|
+
}>>;
|
1242
1163
|
}>, {
|
1243
1164
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1244
1165
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -1483,32 +1404,12 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
1483
1404
|
}>, {
|
1484
1405
|
$schema: Z.ZodDefault<Z.ZodString>;
|
1485
1406
|
}>, {
|
1486
|
-
provider: Z.ZodOptional<Z.
|
1487
|
-
id: Z.
|
1488
|
-
model: Z.ZodString;
|
1489
|
-
prompt: Z.ZodString;
|
1490
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1491
|
-
}, {
|
1492
|
-
id: Z.ZodLiteral<"lingo">;
|
1493
|
-
model: Z.ZodLiteral<"best">;
|
1494
|
-
}>, "strip", Z.ZodTypeAny, {
|
1495
|
-
id: "lingo";
|
1496
|
-
model: "best";
|
1497
|
-
prompt: string;
|
1498
|
-
baseUrl?: string | undefined;
|
1499
|
-
}, {
|
1500
|
-
id: "lingo";
|
1501
|
-
model: "best";
|
1502
|
-
prompt: string;
|
1503
|
-
baseUrl?: string | undefined;
|
1504
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1505
|
-
id: Z.ZodString;
|
1407
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
1408
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1506
1409
|
model: Z.ZodString;
|
1507
1410
|
prompt: Z.ZodString;
|
1508
1411
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1509
|
-
}, {
|
1510
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1511
|
-
}>, "strip", Z.ZodTypeAny, {
|
1412
|
+
}, "strip", Z.ZodTypeAny, {
|
1512
1413
|
id: "openai" | "anthropic";
|
1513
1414
|
model: string;
|
1514
1415
|
prompt: string;
|
@@ -1518,7 +1419,7 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
1518
1419
|
model: string;
|
1519
1420
|
prompt: string;
|
1520
1421
|
baseUrl?: string | undefined;
|
1521
|
-
}
|
1422
|
+
}>>;
|
1522
1423
|
}>, {
|
1523
1424
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1524
1425
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -1700,11 +1601,6 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
1700
1601
|
}>>;
|
1701
1602
|
$schema: string;
|
1702
1603
|
provider?: {
|
1703
|
-
id: "lingo";
|
1704
|
-
model: "best";
|
1705
|
-
prompt: string;
|
1706
|
-
baseUrl?: string | undefined;
|
1707
|
-
} | {
|
1708
1604
|
id: "openai" | "anthropic";
|
1709
1605
|
model: string;
|
1710
1606
|
prompt: string;
|
@@ -1734,11 +1630,6 @@ declare const defaultConfig: {
|
|
1734
1630
|
}>>;
|
1735
1631
|
$schema: string;
|
1736
1632
|
provider?: {
|
1737
|
-
id: "lingo";
|
1738
|
-
model: "best";
|
1739
|
-
prompt: string;
|
1740
|
-
baseUrl?: string | undefined;
|
1741
|
-
} | {
|
1742
1633
|
id: "openai" | "anthropic";
|
1743
1634
|
model: string;
|
1744
1635
|
prompt: string;
|
package/build/index.d.ts
CHANGED
@@ -67,6 +67,7 @@ declare const localeMap: {
|
|
67
67
|
readonly tl: readonly ["tl-PH"];
|
68
68
|
readonly te: readonly ["te-IN"];
|
69
69
|
readonly rw: readonly ["rw-RW"];
|
70
|
+
readonly ka: readonly ["ka-GE"];
|
70
71
|
};
|
71
72
|
type LocaleCodeShort = keyof typeof localeMap;
|
72
73
|
type LocaleCodeFull = (typeof localeMap)[LocaleCodeShort][number];
|
@@ -530,32 +531,12 @@ declare const configV1_5Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
530
531
|
}>, {
|
531
532
|
$schema: Z.ZodDefault<Z.ZodString>;
|
532
533
|
}>, {
|
533
|
-
provider: Z.ZodOptional<Z.
|
534
|
-
id: Z.
|
535
|
-
model: Z.ZodString;
|
536
|
-
prompt: Z.ZodString;
|
537
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
538
|
-
}, {
|
539
|
-
id: Z.ZodLiteral<"lingo">;
|
540
|
-
model: Z.ZodLiteral<"best">;
|
541
|
-
}>, "strip", Z.ZodTypeAny, {
|
542
|
-
id: "lingo";
|
543
|
-
model: "best";
|
544
|
-
prompt: string;
|
545
|
-
baseUrl?: string | undefined;
|
546
|
-
}, {
|
547
|
-
id: "lingo";
|
548
|
-
model: "best";
|
549
|
-
prompt: string;
|
550
|
-
baseUrl?: string | undefined;
|
551
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
552
|
-
id: Z.ZodString;
|
534
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
535
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
553
536
|
model: Z.ZodString;
|
554
537
|
prompt: Z.ZodString;
|
555
538
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
556
|
-
}, {
|
557
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
558
|
-
}>, "strip", Z.ZodTypeAny, {
|
539
|
+
}, "strip", Z.ZodTypeAny, {
|
559
540
|
id: "openai" | "anthropic";
|
560
541
|
model: string;
|
561
542
|
prompt: string;
|
@@ -565,7 +546,7 @@ declare const configV1_5Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
565
546
|
model: string;
|
566
547
|
prompt: string;
|
567
548
|
baseUrl?: string | undefined;
|
568
|
-
}
|
549
|
+
}>>;
|
569
550
|
}>, Z.ZodRawShape>;
|
570
551
|
declare const bucketValueSchemaV1_6: Z.ZodObject<Z.objectUtil.extendShape<{
|
571
552
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -701,32 +682,12 @@ declare const configV1_6Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
701
682
|
}>, {
|
702
683
|
$schema: Z.ZodDefault<Z.ZodString>;
|
703
684
|
}>, {
|
704
|
-
provider: Z.ZodOptional<Z.
|
705
|
-
id: Z.
|
706
|
-
model: Z.ZodString;
|
707
|
-
prompt: Z.ZodString;
|
708
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
709
|
-
}, {
|
710
|
-
id: Z.ZodLiteral<"lingo">;
|
711
|
-
model: Z.ZodLiteral<"best">;
|
712
|
-
}>, "strip", Z.ZodTypeAny, {
|
713
|
-
id: "lingo";
|
714
|
-
model: "best";
|
715
|
-
prompt: string;
|
716
|
-
baseUrl?: string | undefined;
|
717
|
-
}, {
|
718
|
-
id: "lingo";
|
719
|
-
model: "best";
|
720
|
-
prompt: string;
|
721
|
-
baseUrl?: string | undefined;
|
722
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
723
|
-
id: Z.ZodString;
|
685
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
686
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
724
687
|
model: Z.ZodString;
|
725
688
|
prompt: Z.ZodString;
|
726
689
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
727
|
-
}, {
|
728
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
729
|
-
}>, "strip", Z.ZodTypeAny, {
|
690
|
+
}, "strip", Z.ZodTypeAny, {
|
730
691
|
id: "openai" | "anthropic";
|
731
692
|
model: string;
|
732
693
|
prompt: string;
|
@@ -736,7 +697,7 @@ declare const configV1_6Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
736
697
|
model: string;
|
737
698
|
prompt: string;
|
738
699
|
baseUrl?: string | undefined;
|
739
|
-
}
|
700
|
+
}>>;
|
740
701
|
}>, {
|
741
702
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
742
703
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -924,32 +885,12 @@ declare const configV1_7Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
924
885
|
}>, {
|
925
886
|
$schema: Z.ZodDefault<Z.ZodString>;
|
926
887
|
}>, {
|
927
|
-
provider: Z.ZodOptional<Z.
|
928
|
-
id: Z.
|
929
|
-
model: Z.ZodString;
|
930
|
-
prompt: Z.ZodString;
|
931
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
932
|
-
}, {
|
933
|
-
id: Z.ZodLiteral<"lingo">;
|
934
|
-
model: Z.ZodLiteral<"best">;
|
935
|
-
}>, "strip", Z.ZodTypeAny, {
|
936
|
-
id: "lingo";
|
937
|
-
model: "best";
|
938
|
-
prompt: string;
|
939
|
-
baseUrl?: string | undefined;
|
940
|
-
}, {
|
941
|
-
id: "lingo";
|
942
|
-
model: "best";
|
943
|
-
prompt: string;
|
944
|
-
baseUrl?: string | undefined;
|
945
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
946
|
-
id: Z.ZodString;
|
888
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
889
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
947
890
|
model: Z.ZodString;
|
948
891
|
prompt: Z.ZodString;
|
949
892
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
950
|
-
}, {
|
951
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
952
|
-
}>, "strip", Z.ZodTypeAny, {
|
893
|
+
}, "strip", Z.ZodTypeAny, {
|
953
894
|
id: "openai" | "anthropic";
|
954
895
|
model: string;
|
955
896
|
prompt: string;
|
@@ -959,7 +900,7 @@ declare const configV1_7Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
959
900
|
model: string;
|
960
901
|
prompt: string;
|
961
902
|
baseUrl?: string | undefined;
|
962
|
-
}
|
903
|
+
}>>;
|
963
904
|
}>, {
|
964
905
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
965
906
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -1203,32 +1144,12 @@ declare const configV1_8Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
1203
1144
|
}>, {
|
1204
1145
|
$schema: Z.ZodDefault<Z.ZodString>;
|
1205
1146
|
}>, {
|
1206
|
-
provider: Z.ZodOptional<Z.
|
1207
|
-
id: Z.
|
1208
|
-
model: Z.ZodString;
|
1209
|
-
prompt: Z.ZodString;
|
1210
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1211
|
-
}, {
|
1212
|
-
id: Z.ZodLiteral<"lingo">;
|
1213
|
-
model: Z.ZodLiteral<"best">;
|
1214
|
-
}>, "strip", Z.ZodTypeAny, {
|
1215
|
-
id: "lingo";
|
1216
|
-
model: "best";
|
1217
|
-
prompt: string;
|
1218
|
-
baseUrl?: string | undefined;
|
1219
|
-
}, {
|
1220
|
-
id: "lingo";
|
1221
|
-
model: "best";
|
1222
|
-
prompt: string;
|
1223
|
-
baseUrl?: string | undefined;
|
1224
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1225
|
-
id: Z.ZodString;
|
1147
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
1148
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1226
1149
|
model: Z.ZodString;
|
1227
1150
|
prompt: Z.ZodString;
|
1228
1151
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1229
|
-
}, {
|
1230
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1231
|
-
}>, "strip", Z.ZodTypeAny, {
|
1152
|
+
}, "strip", Z.ZodTypeAny, {
|
1232
1153
|
id: "openai" | "anthropic";
|
1233
1154
|
model: string;
|
1234
1155
|
prompt: string;
|
@@ -1238,7 +1159,7 @@ declare const configV1_8Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
1238
1159
|
model: string;
|
1239
1160
|
prompt: string;
|
1240
1161
|
baseUrl?: string | undefined;
|
1241
|
-
}
|
1162
|
+
}>>;
|
1242
1163
|
}>, {
|
1243
1164
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1244
1165
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -1483,32 +1404,12 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
1483
1404
|
}>, {
|
1484
1405
|
$schema: Z.ZodDefault<Z.ZodString>;
|
1485
1406
|
}>, {
|
1486
|
-
provider: Z.ZodOptional<Z.
|
1487
|
-
id: Z.
|
1488
|
-
model: Z.ZodString;
|
1489
|
-
prompt: Z.ZodString;
|
1490
|
-
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1491
|
-
}, {
|
1492
|
-
id: Z.ZodLiteral<"lingo">;
|
1493
|
-
model: Z.ZodLiteral<"best">;
|
1494
|
-
}>, "strip", Z.ZodTypeAny, {
|
1495
|
-
id: "lingo";
|
1496
|
-
model: "best";
|
1497
|
-
prompt: string;
|
1498
|
-
baseUrl?: string | undefined;
|
1499
|
-
}, {
|
1500
|
-
id: "lingo";
|
1501
|
-
model: "best";
|
1502
|
-
prompt: string;
|
1503
|
-
baseUrl?: string | undefined;
|
1504
|
-
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1505
|
-
id: Z.ZodString;
|
1407
|
+
provider: Z.ZodOptional<Z.ZodObject<{
|
1408
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1506
1409
|
model: Z.ZodString;
|
1507
1410
|
prompt: Z.ZodString;
|
1508
1411
|
baseUrl: Z.ZodOptional<Z.ZodString>;
|
1509
|
-
}, {
|
1510
|
-
id: Z.ZodEnum<["openai", "anthropic"]>;
|
1511
|
-
}>, "strip", Z.ZodTypeAny, {
|
1412
|
+
}, "strip", Z.ZodTypeAny, {
|
1512
1413
|
id: "openai" | "anthropic";
|
1513
1414
|
model: string;
|
1514
1415
|
prompt: string;
|
@@ -1518,7 +1419,7 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
1518
1419
|
model: string;
|
1519
1420
|
prompt: string;
|
1520
1421
|
baseUrl?: string | undefined;
|
1521
|
-
}
|
1422
|
+
}>>;
|
1522
1423
|
}>, {
|
1523
1424
|
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "mdx", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json", "typescript"]>, Z.ZodObject<Z.objectUtil.extendShape<{
|
1524
1425
|
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
@@ -1700,11 +1601,6 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
1700
1601
|
}>>;
|
1701
1602
|
$schema: string;
|
1702
1603
|
provider?: {
|
1703
|
-
id: "lingo";
|
1704
|
-
model: "best";
|
1705
|
-
prompt: string;
|
1706
|
-
baseUrl?: string | undefined;
|
1707
|
-
} | {
|
1708
1604
|
id: "openai" | "anthropic";
|
1709
1605
|
model: string;
|
1710
1606
|
prompt: string;
|
@@ -1734,11 +1630,6 @@ declare const defaultConfig: {
|
|
1734
1630
|
}>>;
|
1735
1631
|
$schema: string;
|
1736
1632
|
provider?: {
|
1737
|
-
id: "lingo";
|
1738
|
-
model: "best";
|
1739
|
-
prompt: string;
|
1740
|
-
baseUrl?: string | undefined;
|
1741
|
-
} | {
|
1742
1633
|
id: "openai" | "anthropic";
|
1743
1634
|
model: string;
|
1744
1635
|
prompt: string;
|
package/build/index.mjs
CHANGED
@@ -251,11 +251,17 @@ var localeMap = {
|
|
251
251
|
// Telugu (India)
|
252
252
|
te: ["te-IN"],
|
253
253
|
// Kinyarwanda (Rwanda)
|
254
|
-
rw: ["rw-RW"]
|
254
|
+
rw: ["rw-RW"],
|
255
|
+
// Georgian (Georgia)
|
256
|
+
ka: ["ka-GE"]
|
255
257
|
};
|
256
258
|
var localeCodesShort = Object.keys(localeMap);
|
257
|
-
var localeCodesFull = Object.values(
|
258
|
-
|
259
|
+
var localeCodesFull = Object.values(
|
260
|
+
localeMap
|
261
|
+
).flat();
|
262
|
+
var localeCodesFullUnderscore = localeCodesFull.map(
|
263
|
+
(value) => value.replace("-", "_")
|
264
|
+
);
|
259
265
|
var localeCodesFullExplicitRegion = localeCodesFull.map((value) => {
|
260
266
|
const chunks = value.split("-");
|
261
267
|
const result = [chunks[0], "-r", chunks.slice(1).join("-")].join("");
|
@@ -267,9 +273,12 @@ var localeCodes = [
|
|
267
273
|
...localeCodesFullUnderscore,
|
268
274
|
...localeCodesFullExplicitRegion
|
269
275
|
];
|
270
|
-
var localeCodeSchema = Z.string().refine(
|
271
|
-
|
272
|
-
|
276
|
+
var localeCodeSchema = Z.string().refine(
|
277
|
+
(value) => localeCodes.includes(value),
|
278
|
+
{
|
279
|
+
message: "Invalid locale code"
|
280
|
+
}
|
281
|
+
);
|
273
282
|
var resolveLocaleCode = (value) => {
|
274
283
|
const existingFullLocaleCode = Object.values(localeMap).flat().includes(value);
|
275
284
|
if (existingFullLocaleCode) {
|
@@ -513,31 +522,17 @@ var configV1_4Definition = extendConfigDefinition(
|
|
513
522
|
})
|
514
523
|
}
|
515
524
|
);
|
516
|
-
var
|
517
|
-
id: Z3.
|
525
|
+
var providerSchema = Z3.object({
|
526
|
+
id: Z3.enum(["openai", "anthropic"]),
|
518
527
|
model: Z3.string(),
|
519
528
|
prompt: Z3.string(),
|
520
529
|
baseUrl: Z3.string().optional()
|
521
530
|
});
|
522
|
-
var providerSchema = Z3.union([
|
523
|
-
commonProviderSchema.extend({
|
524
|
-
id: Z3.literal("lingo"),
|
525
|
-
model: Z3.literal("best")
|
526
|
-
}),
|
527
|
-
commonProviderSchema.extend({
|
528
|
-
id: Z3.enum(["openai", "anthropic"])
|
529
|
-
})
|
530
|
-
]);
|
531
531
|
var configV1_5Definition = extendConfigDefinition(
|
532
532
|
configV1_4Definition,
|
533
533
|
{
|
534
534
|
createSchema: (baseSchema) => baseSchema.extend({
|
535
|
-
provider: providerSchema.
|
536
|
-
id: "lingo",
|
537
|
-
model: "best",
|
538
|
-
baseUrl: "https://engine.lingo.dev",
|
539
|
-
prompt: ""
|
540
|
-
}).optional()
|
535
|
+
provider: providerSchema.optional()
|
541
536
|
}),
|
542
537
|
createDefaultValue: (baseDefaultValue) => ({
|
543
538
|
...baseDefaultValue,
|