eile mit weile : components
This commit is contained in:
parent
7411452ecf
commit
aeb81068ff
213
packages/commons/dist/component.d.ts
vendored
213
packages/commons/dist/component.d.ts
vendored
@ -1,13 +1,32 @@
|
||||
import { z } from "zod";
|
||||
export declare const CADMetaSchema: z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
name: z.ZodString;
|
||||
step: z.ZodString;
|
||||
model: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}>;
|
||||
export declare const AuthorSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>;
|
||||
export declare const ContentSchema: z.ZodObject<{
|
||||
body: z.ZodOptional<z.ZodString>;
|
||||
@ -48,25 +67,25 @@ export declare const ProductionSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}>;
|
||||
export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
@ -82,45 +101,26 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">>;
|
||||
replaced_by: z.ZodOptional<z.ZodString>;
|
||||
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
flags: z.ZodOptional<z.ZodNumber>;
|
||||
download: z.ZodOptional<z.ZodBoolean>;
|
||||
image: z.ZodOptional<z.ZodString>;
|
||||
name: z.ZodString;
|
||||
download: z.ZodOptional<z.ZodBoolean>;
|
||||
edrawings: z.ZodOptional<z.ZodString>;
|
||||
showDimensions: z.ZodOptional<z.ZodBoolean>;
|
||||
showParts: z.ZodOptional<z.ZodBoolean>;
|
||||
slug: z.ZodString;
|
||||
score: z.ZodOptional<z.ZodNumber>;
|
||||
Preview3d: z.ZodOptional<z.ZodBoolean>;
|
||||
keywords: z.ZodOptional<z.ZodString>;
|
||||
meta_keywords: z.ZodOptional<z.ZodString>;
|
||||
content: z.ZodOptional<z.ZodObject<{
|
||||
body: z.ZodOptional<z.ZodString>;
|
||||
features: z.ZodOptional<z.ZodString>;
|
||||
highlights: z.ZodOptional<z.ZodString>;
|
||||
specs: z.ZodOptional<z.ZodString>;
|
||||
license: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
body?: string;
|
||||
features?: string;
|
||||
highlights?: string;
|
||||
specs?: string;
|
||||
license?: string;
|
||||
}, {
|
||||
body?: string;
|
||||
features?: string;
|
||||
highlights?: string;
|
||||
specs?: string;
|
||||
license?: string;
|
||||
}>>;
|
||||
assets: z.ZodOptional<z.ZodObject<{
|
||||
assets: z.ZodDefault<z.ZodObject<{
|
||||
gallery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
renderings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
@ -133,9 +133,29 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>>;
|
||||
cad: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
name: z.ZodString;
|
||||
step: z.ZodString;
|
||||
model: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}>, "many">>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
Preview3d: z.ZodOptional<z.ZodBoolean>;
|
||||
howto_categories: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
||||
steps: z.ZodOptional<z.ZodAny>;
|
||||
sourceLanguage: z.ZodOptional<z.ZodString>;
|
||||
@ -148,25 +168,25 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}>>;
|
||||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
||||
@ -182,45 +202,26 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">>;
|
||||
replaced_by: z.ZodOptional<z.ZodString>;
|
||||
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
flags: z.ZodOptional<z.ZodNumber>;
|
||||
download: z.ZodOptional<z.ZodBoolean>;
|
||||
image: z.ZodOptional<z.ZodString>;
|
||||
name: z.ZodString;
|
||||
download: z.ZodOptional<z.ZodBoolean>;
|
||||
edrawings: z.ZodOptional<z.ZodString>;
|
||||
showDimensions: z.ZodOptional<z.ZodBoolean>;
|
||||
showParts: z.ZodOptional<z.ZodBoolean>;
|
||||
slug: z.ZodString;
|
||||
score: z.ZodOptional<z.ZodNumber>;
|
||||
Preview3d: z.ZodOptional<z.ZodBoolean>;
|
||||
keywords: z.ZodOptional<z.ZodString>;
|
||||
meta_keywords: z.ZodOptional<z.ZodString>;
|
||||
content: z.ZodOptional<z.ZodObject<{
|
||||
body: z.ZodOptional<z.ZodString>;
|
||||
features: z.ZodOptional<z.ZodString>;
|
||||
highlights: z.ZodOptional<z.ZodString>;
|
||||
specs: z.ZodOptional<z.ZodString>;
|
||||
license: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
body?: string;
|
||||
features?: string;
|
||||
highlights?: string;
|
||||
specs?: string;
|
||||
license?: string;
|
||||
}, {
|
||||
body?: string;
|
||||
features?: string;
|
||||
highlights?: string;
|
||||
specs?: string;
|
||||
license?: string;
|
||||
}>>;
|
||||
assets: z.ZodOptional<z.ZodObject<{
|
||||
assets: z.ZodDefault<z.ZodObject<{
|
||||
gallery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
renderings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
@ -233,9 +234,29 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>>;
|
||||
cad: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
name: z.ZodString;
|
||||
step: z.ZodString;
|
||||
model: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}>, "many">>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
Preview3d: z.ZodOptional<z.ZodBoolean>;
|
||||
howto_categories: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
||||
steps: z.ZodOptional<z.ZodAny>;
|
||||
sourceLanguage: z.ZodOptional<z.ZodString>;
|
||||
@ -248,25 +269,25 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}>>;
|
||||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
||||
@ -282,45 +303,26 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">>;
|
||||
replaced_by: z.ZodOptional<z.ZodString>;
|
||||
alternatives: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
flags: z.ZodOptional<z.ZodNumber>;
|
||||
download: z.ZodOptional<z.ZodBoolean>;
|
||||
image: z.ZodOptional<z.ZodString>;
|
||||
name: z.ZodString;
|
||||
download: z.ZodOptional<z.ZodBoolean>;
|
||||
edrawings: z.ZodOptional<z.ZodString>;
|
||||
showDimensions: z.ZodOptional<z.ZodBoolean>;
|
||||
showParts: z.ZodOptional<z.ZodBoolean>;
|
||||
slug: z.ZodString;
|
||||
score: z.ZodOptional<z.ZodNumber>;
|
||||
Preview3d: z.ZodOptional<z.ZodBoolean>;
|
||||
keywords: z.ZodOptional<z.ZodString>;
|
||||
meta_keywords: z.ZodOptional<z.ZodString>;
|
||||
content: z.ZodOptional<z.ZodObject<{
|
||||
body: z.ZodOptional<z.ZodString>;
|
||||
features: z.ZodOptional<z.ZodString>;
|
||||
highlights: z.ZodOptional<z.ZodString>;
|
||||
specs: z.ZodOptional<z.ZodString>;
|
||||
license: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
body?: string;
|
||||
features?: string;
|
||||
highlights?: string;
|
||||
specs?: string;
|
||||
license?: string;
|
||||
}, {
|
||||
body?: string;
|
||||
features?: string;
|
||||
highlights?: string;
|
||||
specs?: string;
|
||||
license?: string;
|
||||
}>>;
|
||||
assets: z.ZodOptional<z.ZodObject<{
|
||||
assets: z.ZodDefault<z.ZodObject<{
|
||||
gallery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
renderings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
@ -333,9 +335,29 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>>;
|
||||
cad: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
url: z.ZodString;
|
||||
name: z.ZodString;
|
||||
step: z.ZodString;
|
||||
model: z.ZodString;
|
||||
html: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}, {
|
||||
url?: string;
|
||||
name?: string;
|
||||
step?: string;
|
||||
model?: string;
|
||||
html?: string;
|
||||
}>, "many">>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
Preview3d: z.ZodOptional<z.ZodBoolean>;
|
||||
howto_categories: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
||||
steps: z.ZodOptional<z.ZodAny>;
|
||||
sourceLanguage: z.ZodOptional<z.ZodString>;
|
||||
@ -348,31 +370,32 @@ export declare const ComponentConfigSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
name?: string;
|
||||
}[];
|
||||
}>>;
|
||||
}, z.ZodTypeAny, "passthrough">>;
|
||||
export type IComponentConfig = z.infer<typeof ComponentConfigSchema>;
|
||||
export declare const get: (src: any, root: any, type: any) => {
|
||||
rel: any;
|
||||
path: any;
|
||||
config: any;
|
||||
}[];
|
||||
export interface IComponentNode {
|
||||
rel: string;
|
||||
path: string;
|
||||
config: IComponentConfig;
|
||||
}
|
||||
export declare const get: (src: any, root: any, type: any) => IComponentNode[];
|
||||
|
||||
22
packages/commons/dist/component.js
vendored
22
packages/commons/dist/component.js
vendored
File diff suppressed because one or more lines are too long
8
packages/commons/dist/shemas/path.js
vendored
8
packages/commons/dist/shemas/path.js
vendored
File diff suppressed because one or more lines are too long
@ -2,6 +2,14 @@ import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import { z } from "zod";
|
||||
|
||||
export const CADMetaSchema = z.object({
|
||||
url: z.string(),
|
||||
name: z.string(),
|
||||
step: z.string(),
|
||||
model: z.string(),
|
||||
html: z.string()
|
||||
});
|
||||
|
||||
// Author schema
|
||||
export const AuthorSchema = z.object({
|
||||
name: z.string(),
|
||||
@ -48,12 +56,13 @@ export const ComponentConfigSchema = z.object({
|
||||
authors: z.array(AuthorSchema).optional(),
|
||||
replaced_by: z.string().optional(),
|
||||
alternatives: z.array(z.string()).optional(),
|
||||
flags: z.number().optional(),
|
||||
flags: z.number().optional(),
|
||||
|
||||
image: z.string().optional(),
|
||||
name: z.string(),
|
||||
|
||||
|
||||
// public
|
||||
download: z.boolean().optional(),
|
||||
name: z.string(),
|
||||
|
||||
edrawings: z.string().optional(),
|
||||
showDimensions: z.boolean().optional(),
|
||||
@ -61,16 +70,20 @@ export const ComponentConfigSchema = z.object({
|
||||
slug: z.string(),
|
||||
score: z.number().optional(),
|
||||
|
||||
Preview3d: z.boolean().optional(),
|
||||
keywords: z.string().optional(),
|
||||
meta_keywords: z.string().optional(),
|
||||
|
||||
content: ContentSchema.optional(),
|
||||
assets: AssetsSchema.optional(),
|
||||
|
||||
assets: AssetsSchema.default({
|
||||
gallery: [],
|
||||
renderings: [],
|
||||
components: []
|
||||
}),
|
||||
cad: z.array(CADMetaSchema).default([]),
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
Preview3d: z.boolean().optional(),
|
||||
howto_categories: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
steps: z.any().optional(),
|
||||
sourceLanguage: z.string().optional(),
|
||||
@ -86,6 +99,13 @@ import { forward_slash, pathInfoEx } from './fs/_glob.js'
|
||||
import { resolve } from './variables.js'
|
||||
import { readOSRConfig } from './config.js'
|
||||
|
||||
export interface IComponentNode
|
||||
{
|
||||
rel: string
|
||||
path : string
|
||||
config: IComponentConfig
|
||||
}
|
||||
|
||||
const find_items = (nodes: string[], options) => {
|
||||
nodes = nodes.filter(options.filter)
|
||||
return nodes.map((c) => {
|
||||
@ -98,7 +118,7 @@ const find_items = (nodes: string[], options) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const get = (src, root, type) => {
|
||||
export const get = (src, root, type): IComponentNode[] => {
|
||||
const srcInfo = pathInfoEx(src, false, {
|
||||
absolute: true
|
||||
})
|
||||
@ -128,3 +148,4 @@ export const get = (src, root, type) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,14 +3,11 @@ import * as path from 'path'
|
||||
import { accessSync, constants, lstatSync, existsSync } from 'fs'
|
||||
|
||||
import { isString } from '@polymech/core/primitives'
|
||||
|
||||
import { logger } from '@/logger.js'
|
||||
|
||||
import { sync as exists } from '@polymech/fs/exists'
|
||||
import { sync as read } from '@polymech/fs/read'
|
||||
|
||||
import { logger } from '@/logger.js'
|
||||
import { DEFAULT_VARS, resolve, resolveVariables } from '@/variables.js'
|
||||
|
||||
import { getDescription } from '@/shemas/index.js'
|
||||
import { isFile } from '@/lib/fs.js'
|
||||
|
||||
@ -40,6 +37,7 @@ export enum E_PATH {
|
||||
ENSURE_PATH_IS_RELATIVE,
|
||||
GET_PATH_INFO
|
||||
}
|
||||
|
||||
export const Transformers:Record<string,any> = {
|
||||
resolve: (val: string, variables: Record<string, string> = {}) => {
|
||||
if (!val) {
|
||||
@ -193,9 +191,9 @@ export const ENSURE_DIRECTORY_WRITABLE = (inputPath: string, ctx: any, variables
|
||||
}
|
||||
|
||||
}
|
||||
export const IS_VALID_STRING = (inputPath: string) => {
|
||||
return isString(inputPath)
|
||||
}
|
||||
|
||||
export const IS_VALID_STRING = (inputPath: string) => isString(inputPath)
|
||||
|
||||
export const ENSURE_PATH_EXISTS = (inputPath: string, ctx: any, variables: Record<string, string>) => {
|
||||
if (!inputPath || !ctx) {
|
||||
return z.NEVER
|
||||
|
||||
1
packages/i18n/.gitignore
vendored
1
packages/i18n/.gitignore
vendored
@ -5,3 +5,4 @@
|
||||
tests/temp
|
||||
data
|
||||
clear_history.sh
|
||||
.kbot
|
||||
@ -1,4 +1,5 @@
|
||||
./docs
|
||||
./scripts
|
||||
./tests
|
||||
./incoming
|
||||
./incoming
|
||||
.kbot
|
||||
|
||||
75
packages/i18n/dist/zod_schema_cli.d.ts
vendored
Normal file
75
packages/i18n/dist/zod_schema_cli.d.ts
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
import { z } from 'zod';
|
||||
export declare const TranslateOptionsSchema: z.ZodObject<{
|
||||
debug: z.ZodDefault<z.ZodBoolean>;
|
||||
dry: z.ZodDefault<z.ZodBoolean>;
|
||||
env_key: z.ZodDefault<z.ZodString>;
|
||||
src: z.ZodOptional<z.ZodString>;
|
||||
dst: z.ZodDefault<z.ZodString>;
|
||||
formality: z.ZodDefault<z.ZodEnum<["default", "more", "less"]>>;
|
||||
srcLang: z.ZodDefault<z.ZodString>;
|
||||
cache: z.ZodDefault<z.ZodBoolean>;
|
||||
dstLang: z.ZodDefault<z.ZodString>;
|
||||
text: z.ZodOptional<z.ZodString>;
|
||||
all: z.ZodDefault<z.ZodBoolean>;
|
||||
alt: z.ZodDefault<z.ZodBoolean>;
|
||||
glossary: z.ZodDefault<z.ZodBoolean>;
|
||||
createGlossary: z.ZodDefault<z.ZodBoolean>;
|
||||
filters: z.ZodOptional<z.ZodString>;
|
||||
keys: z.ZodOptional<z.ZodString>;
|
||||
query: z.ZodOptional<z.ZodString>;
|
||||
dumpJSON: z.ZodDefault<z.ZodBoolean>;
|
||||
storeRoot: z.ZodDefault<z.ZodString>;
|
||||
store: z.ZodDefault<z.ZodString>;
|
||||
csvStore: z.ZodDefault<z.ZodBoolean>;
|
||||
stdout: z.ZodDefault<z.ZodBoolean>;
|
||||
logLevel: z.ZodDefault<z.ZodEnum<["silly", "debug", "trace", "info", "warn", "error", "fatal"]>>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
debug?: boolean;
|
||||
dry?: boolean;
|
||||
env_key?: string;
|
||||
src?: string;
|
||||
dst?: string;
|
||||
formality?: "default" | "more" | "less";
|
||||
srcLang?: string;
|
||||
cache?: boolean;
|
||||
dstLang?: string;
|
||||
text?: string;
|
||||
all?: boolean;
|
||||
alt?: boolean;
|
||||
glossary?: boolean;
|
||||
createGlossary?: boolean;
|
||||
filters?: string;
|
||||
keys?: string;
|
||||
query?: string;
|
||||
dumpJSON?: boolean;
|
||||
storeRoot?: string;
|
||||
store?: string;
|
||||
csvStore?: boolean;
|
||||
stdout?: boolean;
|
||||
logLevel?: "debug" | "silly" | "trace" | "info" | "warn" | "error" | "fatal";
|
||||
}, {
|
||||
debug?: boolean;
|
||||
dry?: boolean;
|
||||
env_key?: string;
|
||||
src?: string;
|
||||
dst?: string;
|
||||
formality?: "default" | "more" | "less";
|
||||
srcLang?: string;
|
||||
cache?: boolean;
|
||||
dstLang?: string;
|
||||
text?: string;
|
||||
all?: boolean;
|
||||
alt?: boolean;
|
||||
glossary?: boolean;
|
||||
createGlossary?: boolean;
|
||||
filters?: string;
|
||||
keys?: string;
|
||||
query?: string;
|
||||
dumpJSON?: boolean;
|
||||
storeRoot?: string;
|
||||
store?: string;
|
||||
csvStore?: boolean;
|
||||
stdout?: boolean;
|
||||
logLevel?: "debug" | "silly" | "trace" | "info" | "warn" | "error" | "fatal";
|
||||
}>;
|
||||
export type TranslateOptions = z.infer<typeof TranslateOptionsSchema>;
|
||||
29
packages/i18n/dist/zod_schema_cli.js
vendored
Normal file
29
packages/i18n/dist/zod_schema_cli.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { z } from 'zod';
|
||||
const logLevels = ['silly', 'debug', 'trace', 'info', 'warn', 'error', 'fatal'];
|
||||
const formalityLevels = ['default', 'more', 'less'];
|
||||
export const TranslateOptionsSchema = z.object({
|
||||
debug: z.boolean().default(false),
|
||||
dry: z.boolean().default(false),
|
||||
env_key: z.string().default('OSR-CONFIG'),
|
||||
src: z.string().optional(),
|
||||
dst: z.string().default('${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'),
|
||||
formality: z.enum(formalityLevels).default('default'),
|
||||
srcLang: z.string().default(''),
|
||||
cache: z.boolean().default(false),
|
||||
dstLang: z.string().default('DE'),
|
||||
text: z.string().optional(),
|
||||
all: z.boolean().default(false),
|
||||
alt: z.boolean().default(false),
|
||||
glossary: z.boolean().default(false),
|
||||
createGlossary: z.boolean().default(true),
|
||||
filters: z.string().optional(),
|
||||
keys: z.string().optional(),
|
||||
query: z.string().optional(),
|
||||
dumpJSON: z.boolean().default(false),
|
||||
storeRoot: z.string().default('${OSR_ROOT}/i18n-store/'),
|
||||
store: z.string().default('${OSR_ROOT}/i18n-store/store-${DST_LANG}.json'),
|
||||
csvStore: z.boolean().default(false),
|
||||
stdout: z.boolean().default(true),
|
||||
logLevel: z.enum(logLevels).default('warn'),
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiem9kX3NjaGVtYV9jbGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvem9kX3NjaGVtYV9jbGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLENBQUMsRUFBRSxNQUFNLEtBQUssQ0FBQTtBQUV2QixNQUFNLFNBQVMs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0FBQyxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUM7Q0FDOUMsQ0FBQyxDQUFBIn0=
|
||||
32
packages/i18n/src/zod_schema_cli.ts
Normal file
32
packages/i18n/src/zod_schema_cli.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
const logLevels = ['silly', 'debug', 'trace', 'info', 'warn', 'error', 'fatal'] as const
|
||||
const formalityLevels = ['default', 'more', 'less'] as const
|
||||
|
||||
export const TranslateOptionsSchema = z.object({
|
||||
debug: z.boolean().default(false),
|
||||
dry: z.boolean().default(false),
|
||||
env_key: z.string().default('OSR-CONFIG'),
|
||||
src: z.string().optional(),
|
||||
dst: z.string().default('${SRC_DIR}/${DST_LANG}/${SRC_NAME}${SRC_EXT}'),
|
||||
formality: z.enum(formalityLevels).default('default'),
|
||||
srcLang: z.string().default(''),
|
||||
cache: z.boolean().default(false),
|
||||
dstLang: z.string().default('DE'),
|
||||
text: z.string().optional(),
|
||||
all: z.boolean().default(false),
|
||||
alt: z.boolean().default(false),
|
||||
glossary: z.boolean().default(false),
|
||||
createGlossary: z.boolean().default(true),
|
||||
filters: z.string().optional(),
|
||||
keys: z.string().optional(),
|
||||
query: z.string().optional(),
|
||||
dumpJSON: z.boolean().default(false),
|
||||
storeRoot: z.string().default('${OSR_ROOT}/i18n-store/'),
|
||||
store: z.string().default('${OSR_ROOT}/i18n-store/store-${DST_LANG}.json'),
|
||||
csvStore: z.boolean().default(false),
|
||||
stdout: z.boolean().default(true),
|
||||
logLevel: z.enum(logLevels).default('warn'),
|
||||
})
|
||||
|
||||
export type TranslateOptions = z.infer<typeof TranslateOptionsSchema>
|
||||
Loading…
Reference in New Issue
Block a user