@lingo.dev/_spec 0.26.6 → 0.27.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/build/i18n.schema.json +62 -0
- package/build/index.cjs +38 -2
- package/build/index.d.cts +186 -2
- package/build/index.d.ts +186 -2
- package/build/index.mjs +37 -1
- package/package.json +1 -1
package/build/i18n.schema.json
CHANGED
@@ -120,6 +120,68 @@
|
|
120
120
|
"$schema": {
|
121
121
|
"type": "string",
|
122
122
|
"default": "https://lingo.dev/schema/i18n.json"
|
123
|
+
},
|
124
|
+
"provider": {
|
125
|
+
"anyOf": [
|
126
|
+
{
|
127
|
+
"type": "object",
|
128
|
+
"properties": {
|
129
|
+
"id": {
|
130
|
+
"type": "string",
|
131
|
+
"const": "lingo"
|
132
|
+
},
|
133
|
+
"model": {
|
134
|
+
"type": "string",
|
135
|
+
"const": "best"
|
136
|
+
},
|
137
|
+
"prompt": {
|
138
|
+
"type": "string"
|
139
|
+
},
|
140
|
+
"baseUrl": {
|
141
|
+
"type": "string"
|
142
|
+
}
|
143
|
+
},
|
144
|
+
"required": [
|
145
|
+
"id",
|
146
|
+
"model",
|
147
|
+
"prompt"
|
148
|
+
],
|
149
|
+
"additionalProperties": false
|
150
|
+
},
|
151
|
+
{
|
152
|
+
"type": "object",
|
153
|
+
"properties": {
|
154
|
+
"id": {
|
155
|
+
"type": "string",
|
156
|
+
"enum": [
|
157
|
+
"openai",
|
158
|
+
"anthropic"
|
159
|
+
]
|
160
|
+
},
|
161
|
+
"model": {
|
162
|
+
"type": "string"
|
163
|
+
},
|
164
|
+
"prompt": {
|
165
|
+
"$ref": "#/properties/provider/anyOf/0/properties/prompt"
|
166
|
+
},
|
167
|
+
"baseUrl": {
|
168
|
+
"$ref": "#/properties/provider/anyOf/0/properties/baseUrl"
|
169
|
+
}
|
170
|
+
},
|
171
|
+
"required": [
|
172
|
+
"id",
|
173
|
+
"model",
|
174
|
+
"prompt"
|
175
|
+
],
|
176
|
+
"additionalProperties": false
|
177
|
+
}
|
178
|
+
],
|
179
|
+
"default": {
|
180
|
+
"id": "lingo",
|
181
|
+
"model": "best",
|
182
|
+
"baseUrl": "https://engine.lingo.dev",
|
183
|
+
"prompt": ""
|
184
|
+
}
|
123
185
|
}
|
124
186
|
},
|
125
187
|
"required": [
|
package/build/index.cjs
CHANGED
@@ -149,6 +149,8 @@ var localeMap = {
|
|
149
149
|
bg: ["bg-BG"],
|
150
150
|
// Czech (Czech Republic)
|
151
151
|
cs: ["cs-CZ"],
|
152
|
+
// Welsh (Wales)
|
153
|
+
cy: ["cy-GB"],
|
152
154
|
// Dutch
|
153
155
|
nl: [
|
154
156
|
"nl-NL",
|
@@ -496,7 +498,40 @@ var configV1_4Definition = extendConfigDefinition(configV1_3Definition, {
|
|
496
498
|
$schema: configSchema
|
497
499
|
})
|
498
500
|
});
|
499
|
-
var
|
501
|
+
var commonProviderSchema = _zod2.default.object({
|
502
|
+
id: _zod2.default.string(),
|
503
|
+
model: _zod2.default.string(),
|
504
|
+
prompt: _zod2.default.string(),
|
505
|
+
baseUrl: _zod2.default.string().optional()
|
506
|
+
});
|
507
|
+
var providerSchema = _zod2.default.union([
|
508
|
+
commonProviderSchema.extend({
|
509
|
+
id: _zod2.default.literal("lingo"),
|
510
|
+
model: _zod2.default.literal("best")
|
511
|
+
}),
|
512
|
+
commonProviderSchema.extend({
|
513
|
+
id: _zod2.default.enum(["openai", "anthropic"])
|
514
|
+
})
|
515
|
+
]);
|
516
|
+
var configV1_5Definition = extendConfigDefinition(configV1_4Definition, {
|
517
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
518
|
+
provider: providerSchema.default({
|
519
|
+
id: "lingo",
|
520
|
+
model: "best",
|
521
|
+
baseUrl: "https://engine.lingo.dev",
|
522
|
+
prompt: ""
|
523
|
+
}).optional()
|
524
|
+
}),
|
525
|
+
createDefaultValue: (baseDefaultValue) => ({
|
526
|
+
...baseDefaultValue,
|
527
|
+
version: 1.5
|
528
|
+
}),
|
529
|
+
createUpgrader: (oldConfig) => ({
|
530
|
+
...oldConfig,
|
531
|
+
version: 1.5
|
532
|
+
})
|
533
|
+
});
|
534
|
+
var LATEST_CONFIG_DEFINITION = configV1_5Definition;
|
500
535
|
function parseI18nConfig(rawConfig) {
|
501
536
|
try {
|
502
537
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -530,4 +565,5 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
|
530
565
|
|
531
566
|
|
532
567
|
|
533
|
-
|
568
|
+
|
569
|
+
exports.LATEST_CONFIG_DEFINITION = LATEST_CONFIG_DEFINITION; exports.bucketItemSchema = bucketItemSchema; exports.bucketTypeSchema = bucketTypeSchema; exports.bucketTypes = bucketTypes; exports.configV0Definition = configV0Definition; exports.configV1Definition = configV1Definition; exports.configV1_1Definition = configV1_1Definition; exports.configV1_2Definition = configV1_2Definition; exports.configV1_3Definition = configV1_3Definition; exports.configV1_4Definition = configV1_4Definition; exports.configV1_5Definition = configV1_5Definition; exports.defaultConfig = defaultConfig; exports.getLocaleCodeDelimiter = getLocaleCodeDelimiter; exports.localeCodeSchema = localeCodeSchema; exports.localeCodes = localeCodes; exports.localeCodesFull = localeCodesFull; exports.localeCodesFullExplicitRegion = localeCodesFullExplicitRegion; exports.localeCodesFullUnderscore = localeCodesFullUnderscore; exports.localeCodesShort = localeCodesShort; exports.localeSchema = localeSchema; exports.normalizeLocale = normalizeLocale; exports.parseI18nConfig = parseI18nConfig; exports.resolveLocaleCode = resolveLocaleCode; exports.resolveOverriddenLocale = resolveOverriddenLocale;
|
package/build/index.d.cts
CHANGED
@@ -32,6 +32,7 @@ declare const localeMap: {
|
|
32
32
|
readonly ar: readonly ["ar-EG", "ar-SA", "ar-AE", "ar-MA"];
|
33
33
|
readonly bg: readonly ["bg-BG"];
|
34
34
|
readonly cs: readonly ["cs-CZ"];
|
35
|
+
readonly cy: readonly ["cy-GB"];
|
35
36
|
readonly nl: readonly ["nl-NL", "nl-BE"];
|
36
37
|
readonly pl: readonly ["pl-PL"];
|
37
38
|
readonly id: readonly ["id-ID"];
|
@@ -399,7 +400,7 @@ declare const configV1_4Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
399
400
|
}>, {
|
400
401
|
$schema: Z.ZodDefault<Z.ZodString>;
|
401
402
|
}>, Z.ZodRawShape>;
|
402
|
-
declare const
|
403
|
+
declare const configV1_5Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
403
404
|
version: Z.ZodDefault<Z.ZodNumber>;
|
404
405
|
}, {
|
405
406
|
locale: Z.ZodObject<{
|
@@ -485,6 +486,167 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
485
486
|
}>>>;
|
486
487
|
}>, {
|
487
488
|
$schema: Z.ZodDefault<Z.ZodString>;
|
489
|
+
}>, {
|
490
|
+
provider: Z.ZodOptional<Z.ZodDefault<Z.ZodUnion<[Z.ZodObject<Z.objectUtil.extendShape<{
|
491
|
+
id: Z.ZodString;
|
492
|
+
model: Z.ZodString;
|
493
|
+
prompt: Z.ZodString;
|
494
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
495
|
+
}, {
|
496
|
+
id: Z.ZodLiteral<"lingo">;
|
497
|
+
model: Z.ZodLiteral<"best">;
|
498
|
+
}>, "strip", Z.ZodTypeAny, {
|
499
|
+
id: "lingo";
|
500
|
+
model: "best";
|
501
|
+
prompt: string;
|
502
|
+
baseUrl?: string | undefined;
|
503
|
+
}, {
|
504
|
+
id: "lingo";
|
505
|
+
model: "best";
|
506
|
+
prompt: string;
|
507
|
+
baseUrl?: string | undefined;
|
508
|
+
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
509
|
+
id: Z.ZodString;
|
510
|
+
model: Z.ZodString;
|
511
|
+
prompt: Z.ZodString;
|
512
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
513
|
+
}, {
|
514
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
515
|
+
}>, "strip", Z.ZodTypeAny, {
|
516
|
+
id: "openai" | "anthropic";
|
517
|
+
model: string;
|
518
|
+
prompt: string;
|
519
|
+
baseUrl?: string | undefined;
|
520
|
+
}, {
|
521
|
+
id: "openai" | "anthropic";
|
522
|
+
model: string;
|
523
|
+
prompt: string;
|
524
|
+
baseUrl?: string | undefined;
|
525
|
+
}>]>>>;
|
526
|
+
}>, Z.ZodRawShape>;
|
527
|
+
declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
528
|
+
version: Z.ZodDefault<Z.ZodNumber>;
|
529
|
+
}, {
|
530
|
+
locale: Z.ZodObject<{
|
531
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
532
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
533
|
+
}, "strip", Z.ZodTypeAny, {
|
534
|
+
source: string;
|
535
|
+
targets: string[];
|
536
|
+
}, {
|
537
|
+
source: string;
|
538
|
+
targets: string[];
|
539
|
+
}>;
|
540
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>>>>;
|
541
|
+
}>, {
|
542
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>, Z.ZodObject<{
|
543
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
544
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
545
|
+
}, "strip", Z.ZodTypeAny, {
|
546
|
+
include: string[];
|
547
|
+
exclude?: string[] | undefined;
|
548
|
+
}, {
|
549
|
+
exclude?: string[] | undefined;
|
550
|
+
include?: string[] | undefined;
|
551
|
+
}>>>;
|
552
|
+
}>, {
|
553
|
+
locale: Z.ZodObject<Z.objectUtil.extendShape<{
|
554
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
555
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
556
|
+
}, {
|
557
|
+
extraSource: Z.ZodOptional<Z.ZodEffects<Z.ZodString, string, string>>;
|
558
|
+
}>, "strip", Z.ZodTypeAny, {
|
559
|
+
source: string;
|
560
|
+
targets: string[];
|
561
|
+
extraSource?: string | undefined;
|
562
|
+
}, {
|
563
|
+
source: string;
|
564
|
+
targets: string[];
|
565
|
+
extraSource?: string | undefined;
|
566
|
+
}>;
|
567
|
+
}>, {
|
568
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>, Z.ZodObject<{
|
569
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
570
|
+
path: Z.ZodString;
|
571
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
572
|
+
}, "strip", Z.ZodTypeAny, {
|
573
|
+
path: string;
|
574
|
+
delimiter?: "-" | "_" | null | undefined;
|
575
|
+
}, {
|
576
|
+
path: string;
|
577
|
+
delimiter?: "-" | "_" | null | undefined;
|
578
|
+
}>]>, "many">>;
|
579
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
580
|
+
path: Z.ZodString;
|
581
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
582
|
+
}, "strip", Z.ZodTypeAny, {
|
583
|
+
path: string;
|
584
|
+
delimiter?: "-" | "_" | null | undefined;
|
585
|
+
}, {
|
586
|
+
path: string;
|
587
|
+
delimiter?: "-" | "_" | null | undefined;
|
588
|
+
}>]>, "many">>>;
|
589
|
+
injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>;
|
590
|
+
}, "strip", Z.ZodTypeAny, {
|
591
|
+
include: (string | {
|
592
|
+
path: string;
|
593
|
+
delimiter?: "-" | "_" | null | undefined;
|
594
|
+
})[];
|
595
|
+
exclude?: (string | {
|
596
|
+
path: string;
|
597
|
+
delimiter?: "-" | "_" | null | undefined;
|
598
|
+
})[] | undefined;
|
599
|
+
injectLocale?: string[] | undefined;
|
600
|
+
}, {
|
601
|
+
exclude?: (string | {
|
602
|
+
path: string;
|
603
|
+
delimiter?: "-" | "_" | null | undefined;
|
604
|
+
})[] | undefined;
|
605
|
+
include?: (string | {
|
606
|
+
path: string;
|
607
|
+
delimiter?: "-" | "_" | null | undefined;
|
608
|
+
})[] | undefined;
|
609
|
+
injectLocale?: string[] | undefined;
|
610
|
+
}>>>;
|
611
|
+
}>, {
|
612
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
613
|
+
}>, {
|
614
|
+
provider: Z.ZodOptional<Z.ZodDefault<Z.ZodUnion<[Z.ZodObject<Z.objectUtil.extendShape<{
|
615
|
+
id: Z.ZodString;
|
616
|
+
model: Z.ZodString;
|
617
|
+
prompt: Z.ZodString;
|
618
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
619
|
+
}, {
|
620
|
+
id: Z.ZodLiteral<"lingo">;
|
621
|
+
model: Z.ZodLiteral<"best">;
|
622
|
+
}>, "strip", Z.ZodTypeAny, {
|
623
|
+
id: "lingo";
|
624
|
+
model: "best";
|
625
|
+
prompt: string;
|
626
|
+
baseUrl?: string | undefined;
|
627
|
+
}, {
|
628
|
+
id: "lingo";
|
629
|
+
model: "best";
|
630
|
+
prompt: string;
|
631
|
+
baseUrl?: string | undefined;
|
632
|
+
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
633
|
+
id: Z.ZodString;
|
634
|
+
model: Z.ZodString;
|
635
|
+
prompt: Z.ZodString;
|
636
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
637
|
+
}, {
|
638
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
639
|
+
}>, "strip", Z.ZodTypeAny, {
|
640
|
+
id: "openai" | "anthropic";
|
641
|
+
model: string;
|
642
|
+
prompt: string;
|
643
|
+
baseUrl?: string | undefined;
|
644
|
+
}, {
|
645
|
+
id: "openai" | "anthropic";
|
646
|
+
model: string;
|
647
|
+
prompt: string;
|
648
|
+
baseUrl?: string | undefined;
|
649
|
+
}>]>>>;
|
488
650
|
}>, Z.ZodRawShape>;
|
489
651
|
type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
|
490
652
|
declare function parseI18nConfig(rawConfig: unknown): {
|
@@ -506,6 +668,17 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
506
668
|
injectLocale?: string[] | undefined;
|
507
669
|
}>>;
|
508
670
|
$schema: string;
|
671
|
+
provider?: {
|
672
|
+
id: "lingo";
|
673
|
+
model: "best";
|
674
|
+
prompt: string;
|
675
|
+
baseUrl?: string | undefined;
|
676
|
+
} | {
|
677
|
+
id: "openai" | "anthropic";
|
678
|
+
model: string;
|
679
|
+
prompt: string;
|
680
|
+
baseUrl?: string | undefined;
|
681
|
+
} | undefined;
|
509
682
|
};
|
510
683
|
declare const defaultConfig: {
|
511
684
|
version: number;
|
@@ -526,6 +699,17 @@ declare const defaultConfig: {
|
|
526
699
|
injectLocale?: string[] | undefined;
|
527
700
|
}>>;
|
528
701
|
$schema: string;
|
702
|
+
provider?: {
|
703
|
+
id: "lingo";
|
704
|
+
model: "best";
|
705
|
+
prompt: string;
|
706
|
+
baseUrl?: string | undefined;
|
707
|
+
} | {
|
708
|
+
id: "openai" | "anthropic";
|
709
|
+
model: string;
|
710
|
+
prompt: string;
|
711
|
+
baseUrl?: string | undefined;
|
712
|
+
} | undefined;
|
529
713
|
};
|
530
714
|
|
531
|
-
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
|
715
|
+
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
|
package/build/index.d.ts
CHANGED
@@ -32,6 +32,7 @@ declare const localeMap: {
|
|
32
32
|
readonly ar: readonly ["ar-EG", "ar-SA", "ar-AE", "ar-MA"];
|
33
33
|
readonly bg: readonly ["bg-BG"];
|
34
34
|
readonly cs: readonly ["cs-CZ"];
|
35
|
+
readonly cy: readonly ["cy-GB"];
|
35
36
|
readonly nl: readonly ["nl-NL", "nl-BE"];
|
36
37
|
readonly pl: readonly ["pl-PL"];
|
37
38
|
readonly id: readonly ["id-ID"];
|
@@ -399,7 +400,7 @@ declare const configV1_4Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.
|
|
399
400
|
}>, {
|
400
401
|
$schema: Z.ZodDefault<Z.ZodString>;
|
401
402
|
}>, Z.ZodRawShape>;
|
402
|
-
declare const
|
403
|
+
declare const configV1_5Definition: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
403
404
|
version: Z.ZodDefault<Z.ZodNumber>;
|
404
405
|
}, {
|
405
406
|
locale: Z.ZodObject<{
|
@@ -485,6 +486,167 @@ declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShap
|
|
485
486
|
}>>>;
|
486
487
|
}>, {
|
487
488
|
$schema: Z.ZodDefault<Z.ZodString>;
|
489
|
+
}>, {
|
490
|
+
provider: Z.ZodOptional<Z.ZodDefault<Z.ZodUnion<[Z.ZodObject<Z.objectUtil.extendShape<{
|
491
|
+
id: Z.ZodString;
|
492
|
+
model: Z.ZodString;
|
493
|
+
prompt: Z.ZodString;
|
494
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
495
|
+
}, {
|
496
|
+
id: Z.ZodLiteral<"lingo">;
|
497
|
+
model: Z.ZodLiteral<"best">;
|
498
|
+
}>, "strip", Z.ZodTypeAny, {
|
499
|
+
id: "lingo";
|
500
|
+
model: "best";
|
501
|
+
prompt: string;
|
502
|
+
baseUrl?: string | undefined;
|
503
|
+
}, {
|
504
|
+
id: "lingo";
|
505
|
+
model: "best";
|
506
|
+
prompt: string;
|
507
|
+
baseUrl?: string | undefined;
|
508
|
+
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
509
|
+
id: Z.ZodString;
|
510
|
+
model: Z.ZodString;
|
511
|
+
prompt: Z.ZodString;
|
512
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
513
|
+
}, {
|
514
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
515
|
+
}>, "strip", Z.ZodTypeAny, {
|
516
|
+
id: "openai" | "anthropic";
|
517
|
+
model: string;
|
518
|
+
prompt: string;
|
519
|
+
baseUrl?: string | undefined;
|
520
|
+
}, {
|
521
|
+
id: "openai" | "anthropic";
|
522
|
+
model: string;
|
523
|
+
prompt: string;
|
524
|
+
baseUrl?: string | undefined;
|
525
|
+
}>]>>>;
|
526
|
+
}>, Z.ZodRawShape>;
|
527
|
+
declare const LATEST_CONFIG_DEFINITION: ConfigDefinition<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<Z.objectUtil.extendShape<{
|
528
|
+
version: Z.ZodDefault<Z.ZodNumber>;
|
529
|
+
}, {
|
530
|
+
locale: Z.ZodObject<{
|
531
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
532
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
533
|
+
}, "strip", Z.ZodTypeAny, {
|
534
|
+
source: string;
|
535
|
+
targets: string[];
|
536
|
+
}, {
|
537
|
+
source: string;
|
538
|
+
targets: string[];
|
539
|
+
}>;
|
540
|
+
buckets: Z.ZodOptional<Z.ZodDefault<Z.ZodRecord<Z.ZodString, Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>>>>;
|
541
|
+
}>, {
|
542
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>, Z.ZodObject<{
|
543
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>;
|
544
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodString, "many">>>;
|
545
|
+
}, "strip", Z.ZodTypeAny, {
|
546
|
+
include: string[];
|
547
|
+
exclude?: string[] | undefined;
|
548
|
+
}, {
|
549
|
+
exclude?: string[] | undefined;
|
550
|
+
include?: string[] | undefined;
|
551
|
+
}>>>;
|
552
|
+
}>, {
|
553
|
+
locale: Z.ZodObject<Z.objectUtil.extendShape<{
|
554
|
+
source: Z.ZodEffects<Z.ZodString, string, string>;
|
555
|
+
targets: Z.ZodArray<Z.ZodEffects<Z.ZodString, string, string>, "many">;
|
556
|
+
}, {
|
557
|
+
extraSource: Z.ZodOptional<Z.ZodEffects<Z.ZodString, string, string>>;
|
558
|
+
}>, "strip", Z.ZodTypeAny, {
|
559
|
+
source: string;
|
560
|
+
targets: string[];
|
561
|
+
extraSource?: string | undefined;
|
562
|
+
}, {
|
563
|
+
source: string;
|
564
|
+
targets: string[];
|
565
|
+
extraSource?: string | undefined;
|
566
|
+
}>;
|
567
|
+
}>, {
|
568
|
+
buckets: Z.ZodDefault<Z.ZodRecord<Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>, Z.ZodObject<{
|
569
|
+
include: Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
570
|
+
path: Z.ZodString;
|
571
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
572
|
+
}, "strip", Z.ZodTypeAny, {
|
573
|
+
path: string;
|
574
|
+
delimiter?: "-" | "_" | null | undefined;
|
575
|
+
}, {
|
576
|
+
path: string;
|
577
|
+
delimiter?: "-" | "_" | null | undefined;
|
578
|
+
}>]>, "many">>;
|
579
|
+
exclude: Z.ZodOptional<Z.ZodDefault<Z.ZodArray<Z.ZodUnion<[Z.ZodString, Z.ZodObject<{
|
580
|
+
path: Z.ZodString;
|
581
|
+
delimiter: Z.ZodOptional<Z.ZodUnion<[Z.ZodLiteral<"-">, Z.ZodLiteral<"_">, Z.ZodLiteral<null>]>>;
|
582
|
+
}, "strip", Z.ZodTypeAny, {
|
583
|
+
path: string;
|
584
|
+
delimiter?: "-" | "_" | null | undefined;
|
585
|
+
}, {
|
586
|
+
path: string;
|
587
|
+
delimiter?: "-" | "_" | null | undefined;
|
588
|
+
}>]>, "many">>>;
|
589
|
+
injectLocale: Z.ZodOptional<Z.ZodArray<Z.ZodString, "many">>;
|
590
|
+
}, "strip", Z.ZodTypeAny, {
|
591
|
+
include: (string | {
|
592
|
+
path: string;
|
593
|
+
delimiter?: "-" | "_" | null | undefined;
|
594
|
+
})[];
|
595
|
+
exclude?: (string | {
|
596
|
+
path: string;
|
597
|
+
delimiter?: "-" | "_" | null | undefined;
|
598
|
+
})[] | undefined;
|
599
|
+
injectLocale?: string[] | undefined;
|
600
|
+
}, {
|
601
|
+
exclude?: (string | {
|
602
|
+
path: string;
|
603
|
+
delimiter?: "-" | "_" | null | undefined;
|
604
|
+
})[] | undefined;
|
605
|
+
include?: (string | {
|
606
|
+
path: string;
|
607
|
+
delimiter?: "-" | "_" | null | undefined;
|
608
|
+
})[] | undefined;
|
609
|
+
injectLocale?: string[] | undefined;
|
610
|
+
}>>>;
|
611
|
+
}>, {
|
612
|
+
$schema: Z.ZodDefault<Z.ZodString>;
|
613
|
+
}>, {
|
614
|
+
provider: Z.ZodOptional<Z.ZodDefault<Z.ZodUnion<[Z.ZodObject<Z.objectUtil.extendShape<{
|
615
|
+
id: Z.ZodString;
|
616
|
+
model: Z.ZodString;
|
617
|
+
prompt: Z.ZodString;
|
618
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
619
|
+
}, {
|
620
|
+
id: Z.ZodLiteral<"lingo">;
|
621
|
+
model: Z.ZodLiteral<"best">;
|
622
|
+
}>, "strip", Z.ZodTypeAny, {
|
623
|
+
id: "lingo";
|
624
|
+
model: "best";
|
625
|
+
prompt: string;
|
626
|
+
baseUrl?: string | undefined;
|
627
|
+
}, {
|
628
|
+
id: "lingo";
|
629
|
+
model: "best";
|
630
|
+
prompt: string;
|
631
|
+
baseUrl?: string | undefined;
|
632
|
+
}>, Z.ZodObject<Z.objectUtil.extendShape<{
|
633
|
+
id: Z.ZodString;
|
634
|
+
model: Z.ZodString;
|
635
|
+
prompt: Z.ZodString;
|
636
|
+
baseUrl: Z.ZodOptional<Z.ZodString>;
|
637
|
+
}, {
|
638
|
+
id: Z.ZodEnum<["openai", "anthropic"]>;
|
639
|
+
}>, "strip", Z.ZodTypeAny, {
|
640
|
+
id: "openai" | "anthropic";
|
641
|
+
model: string;
|
642
|
+
prompt: string;
|
643
|
+
baseUrl?: string | undefined;
|
644
|
+
}, {
|
645
|
+
id: "openai" | "anthropic";
|
646
|
+
model: string;
|
647
|
+
prompt: string;
|
648
|
+
baseUrl?: string | undefined;
|
649
|
+
}>]>>>;
|
488
650
|
}>, Z.ZodRawShape>;
|
489
651
|
type I18nConfig = Z.infer<(typeof LATEST_CONFIG_DEFINITION)["schema"]>;
|
490
652
|
declare function parseI18nConfig(rawConfig: unknown): {
|
@@ -506,6 +668,17 @@ declare function parseI18nConfig(rawConfig: unknown): {
|
|
506
668
|
injectLocale?: string[] | undefined;
|
507
669
|
}>>;
|
508
670
|
$schema: string;
|
671
|
+
provider?: {
|
672
|
+
id: "lingo";
|
673
|
+
model: "best";
|
674
|
+
prompt: string;
|
675
|
+
baseUrl?: string | undefined;
|
676
|
+
} | {
|
677
|
+
id: "openai" | "anthropic";
|
678
|
+
model: string;
|
679
|
+
prompt: string;
|
680
|
+
baseUrl?: string | undefined;
|
681
|
+
} | undefined;
|
509
682
|
};
|
510
683
|
declare const defaultConfig: {
|
511
684
|
version: number;
|
@@ -526,6 +699,17 @@ declare const defaultConfig: {
|
|
526
699
|
injectLocale?: string[] | undefined;
|
527
700
|
}>>;
|
528
701
|
$schema: string;
|
702
|
+
provider?: {
|
703
|
+
id: "lingo";
|
704
|
+
model: "best";
|
705
|
+
prompt: string;
|
706
|
+
baseUrl?: string | undefined;
|
707
|
+
} | {
|
708
|
+
id: "openai" | "anthropic";
|
709
|
+
model: string;
|
710
|
+
prompt: string;
|
711
|
+
baseUrl?: string | undefined;
|
712
|
+
} | undefined;
|
529
713
|
};
|
530
714
|
|
531
|
-
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
|
715
|
+
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, type LocaleDelimiter, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, configV1_5Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverriddenLocale };
|
package/build/index.mjs
CHANGED
@@ -149,6 +149,8 @@ var localeMap = {
|
|
149
149
|
bg: ["bg-BG"],
|
150
150
|
// Czech (Czech Republic)
|
151
151
|
cs: ["cs-CZ"],
|
152
|
+
// Welsh (Wales)
|
153
|
+
cy: ["cy-GB"],
|
152
154
|
// Dutch
|
153
155
|
nl: [
|
154
156
|
"nl-NL",
|
@@ -496,7 +498,40 @@ var configV1_4Definition = extendConfigDefinition(configV1_3Definition, {
|
|
496
498
|
$schema: configSchema
|
497
499
|
})
|
498
500
|
});
|
499
|
-
var
|
501
|
+
var commonProviderSchema = Z3.object({
|
502
|
+
id: Z3.string(),
|
503
|
+
model: Z3.string(),
|
504
|
+
prompt: Z3.string(),
|
505
|
+
baseUrl: Z3.string().optional()
|
506
|
+
});
|
507
|
+
var providerSchema = Z3.union([
|
508
|
+
commonProviderSchema.extend({
|
509
|
+
id: Z3.literal("lingo"),
|
510
|
+
model: Z3.literal("best")
|
511
|
+
}),
|
512
|
+
commonProviderSchema.extend({
|
513
|
+
id: Z3.enum(["openai", "anthropic"])
|
514
|
+
})
|
515
|
+
]);
|
516
|
+
var configV1_5Definition = extendConfigDefinition(configV1_4Definition, {
|
517
|
+
createSchema: (baseSchema) => baseSchema.extend({
|
518
|
+
provider: providerSchema.default({
|
519
|
+
id: "lingo",
|
520
|
+
model: "best",
|
521
|
+
baseUrl: "https://engine.lingo.dev",
|
522
|
+
prompt: ""
|
523
|
+
}).optional()
|
524
|
+
}),
|
525
|
+
createDefaultValue: (baseDefaultValue) => ({
|
526
|
+
...baseDefaultValue,
|
527
|
+
version: 1.5
|
528
|
+
}),
|
529
|
+
createUpgrader: (oldConfig) => ({
|
530
|
+
...oldConfig,
|
531
|
+
version: 1.5
|
532
|
+
})
|
533
|
+
});
|
534
|
+
var LATEST_CONFIG_DEFINITION = configV1_5Definition;
|
500
535
|
function parseI18nConfig(rawConfig) {
|
501
536
|
try {
|
502
537
|
const result = LATEST_CONFIG_DEFINITION.parse(rawConfig);
|
@@ -517,6 +552,7 @@ export {
|
|
517
552
|
configV1_2Definition,
|
518
553
|
configV1_3Definition,
|
519
554
|
configV1_4Definition,
|
555
|
+
configV1_5Definition,
|
520
556
|
defaultConfig,
|
521
557
|
getLocaleCodeDelimiter,
|
522
558
|
localeCodeSchema,
|