cli : each
This commit is contained in:
parent
9e0f245317
commit
85de9d61ec
9
packages/commons/dist/_glob.d.ts
vendored
9
packages/commons/dist/_glob.d.ts
vendored
@ -1,9 +0,0 @@
|
||||
import { GlobOptions } from 'glob';
|
||||
export declare const files: (cwd: any, glob: any, options?: any) => [];
|
||||
export declare const filesEx: (cwd: any, glob: any, options?: GlobOptions) => [];
|
||||
import { PATH_INFO } from './types_common.js';
|
||||
export { globBase } from './fs/glob-base.js';
|
||||
export { globParent } from './fs/glob-parent.js';
|
||||
export declare const forward_slash: (path: any) => any;
|
||||
export declare const pathInfoEx: (src: string, altToken?: boolean, globOptions?: GlobOptions) => PATH_INFO;
|
||||
export declare const pathInfo: (src: string, altToken?: boolean, cwd?: string) => PATH_INFO;
|
||||
93
packages/commons/dist/_glob.js
vendored
93
packages/commons/dist/_glob.js
vendored
@ -1,93 +0,0 @@
|
||||
import * as path from 'path';
|
||||
import { glob, globSync, hasMagic } from 'glob';
|
||||
import { REGEX_VAR, REGEX_VAR_ALT } from "@polymech/core/constants";
|
||||
import { sync as exists } from '@polymech/fs/exists';
|
||||
export const files = (cwd, glob, options) => globSync(glob, { ...{ dot: true, cwd, absolute: true, caseSensitiveMatch: false }, ...options || {} });
|
||||
export const filesEx = (cwd, glob, options) => globSync(glob, { ...{ dot: true, cwd, absolute: true, caseSensitiveMatch: false }, ...options || {} });
|
||||
import { substitute } from './variables.js';
|
||||
import { isFile, isFolder } from './fs.js';
|
||||
import { globBase } from './fs/glob-base.js';
|
||||
export { globBase } from './fs/glob-base.js';
|
||||
export { globParent } from './fs/glob-parent.js';
|
||||
export const forward_slash = (path) => {
|
||||
const isExtendedLengthPath = /^\\\\\?\\/.test(path);
|
||||
const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
|
||||
if (isExtendedLengthPath || hasNonAscii) {
|
||||
return path;
|
||||
}
|
||||
return path.replace(/\\/g, '/');
|
||||
};
|
||||
export const pathInfoEx = (src, altToken = false, globOptions = {}) => {
|
||||
const srcParts = path.parse(src);
|
||||
let variables = {
|
||||
PATH: src
|
||||
};
|
||||
variables.DIR = srcParts.dir;
|
||||
variables.NAME = srcParts.name;
|
||||
variables.FILE_NAME = srcParts.base;
|
||||
variables.FILE_EXT = srcParts.ext.replace('.', '');
|
||||
variables.PATH = src;
|
||||
variables.IS_FILE = isFile(src);
|
||||
variables.IS_FOLDER = isFolder(src);
|
||||
variables.IS_EXPRESSION = src.match(altToken ? REGEX_VAR_ALT : REGEX_VAR) != null;
|
||||
if (!variables.IS_FOLDER && !variables.IS_FILE) {
|
||||
variables.IS_GLOB = hasMagic(substitute(altToken, srcParts.base, {}, false));
|
||||
}
|
||||
else {
|
||||
variables.IS_GLOB = false;
|
||||
}
|
||||
if (variables.IS_GLOB) {
|
||||
//important: use the forward slash since path.resolve will return backslashes on Windows
|
||||
const glob_base = globBase(src);
|
||||
variables.DIR = path.resolve(glob_base.base);
|
||||
variables.FILE_NAME = glob_base.glob;
|
||||
variables.GLOB = glob_base.glob;
|
||||
//variables.GLOB_EXTENSIONS = getExtensions(glob_base.glob)
|
||||
globOptions = {
|
||||
...globOptions,
|
||||
cwd: globOptions.cwd ? path.join(globOptions.cwd, glob_base.base) : null
|
||||
};
|
||||
variables.FILES = glob.sync(glob_base.glob, globOptions);
|
||||
}
|
||||
else if (variables.IS_FILE && exists(src)) {
|
||||
variables.FILES = [src];
|
||||
}
|
||||
return variables;
|
||||
};
|
||||
export const pathInfo = (src, altToken = false, cwd = null) => {
|
||||
const srcParts = path.parse(src);
|
||||
let variables = {
|
||||
PATH: src
|
||||
};
|
||||
variables.DIR = srcParts.dir;
|
||||
variables.NAME = srcParts.name;
|
||||
variables.FILE_NAME = srcParts.base;
|
||||
variables.FILE_EXT = srcParts.ext.replace('.', '');
|
||||
variables.PATH = src;
|
||||
variables.IS_FILE = isFile(src);
|
||||
variables.IS_FOLDER = isFolder(src);
|
||||
variables.IS_EXPRESSION = src.match(altToken ? REGEX_VAR_ALT : REGEX_VAR) != null;
|
||||
if (!variables.IS_FOLDER && !variables.IS_FILE) {
|
||||
variables.IS_GLOB = hasMagic(srcParts.base);
|
||||
}
|
||||
else {
|
||||
variables.IS_GLOB = false;
|
||||
}
|
||||
if (variables.IS_GLOB) {
|
||||
const glob_base = globBase(src);
|
||||
variables.DIR = path.resolve(glob_base.base);
|
||||
variables.FILE_NAME = glob_base.glob;
|
||||
variables.GLOB = glob_base.glob;
|
||||
//variables.GLOB_EXTENSIONS = getExtensions(glob_base.glob)
|
||||
variables.FILES = globSync(glob_base.glob, {
|
||||
dot: true,
|
||||
cwd: path.resolve(cwd || variables.DIR),
|
||||
absolute: true
|
||||
});
|
||||
}
|
||||
else if (variables.IS_FILE && exists(src)) {
|
||||
variables.FILES = [src];
|
||||
}
|
||||
return variables;
|
||||
};
|
||||
//# sourceMappingURL=_glob.js.map
|
||||
1
packages/commons/dist/_glob.js.map
vendored
1
packages/commons/dist/_glob.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"_glob.js","sourceRoot":"","sources":["../src/_glob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAe,QAAQ,EAAG,MAAM,MAAM,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,OAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,EAAE,CAAO,CAAA;AAC/J,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,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O,EAAE;QACnB,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;QAC/B,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC5C,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAA;QACpC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC/B,2DAA2D;QAC3D,SAAS,CAAC,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE;YACvC,GAAG,EAAE,IAAI;YACT,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC;YACvC,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;KACL;SAAM,IAAI,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;QACzC,SAAS,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAA;KAC1B;IACD,OAAO,SAAS,CAAA;AACpB,CAAC,CAAA"}
|
||||
4
packages/commons/dist/commands/each.d.ts
vendored
Normal file
4
packages/commons/dist/commands/each.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import * as CLI from 'yargs';
|
||||
import { ZodObject } from 'zod';
|
||||
export declare const registerCommand: (cli: CLI.Argv, name: any, description: any, options: any, zodSchema: () => ZodObject<any>, main: (opts: any, argv: any) => Promise<any>) => any;
|
||||
export declare const registerCommands: (cli: CLI.Argv) => void;
|
||||
23
packages/commons/dist/commands/each.js
vendored
Normal file
23
packages/commons/dist/commands/each.js
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import { logger } from '../logger.js';
|
||||
import { yargsOptions as yargsOptionsEach, zodSchema as zodSchemaEach, each } from '../lib/each.js';
|
||||
import { yargsOptions as yargsOptionsRun, zodSchema as zodSchemaRun, run } from '../lib/run.js';
|
||||
export const registerCommand = (cli, name, description, options, zodSchema, main) => {
|
||||
return cli.command(name, description, options, async (argv) => {
|
||||
if (argv.help) {
|
||||
return;
|
||||
}
|
||||
let opts = null;
|
||||
try {
|
||||
opts = zodSchema().parse(argv);
|
||||
}
|
||||
catch (e) {
|
||||
logger.error(`Error parsing options: ${name}`, e.message);
|
||||
}
|
||||
return await main(opts, argv);
|
||||
});
|
||||
};
|
||||
export const registerCommands = (cli) => {
|
||||
registerCommand(cli, 'each', 'each', yargsOptionsEach, zodSchemaEach, each);
|
||||
registerCommand(cli, 'run', 'run', yargsOptionsRun, zodSchemaRun, run);
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWFjaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYW5kcy9lYWNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxjQUFjLENBQUE7QUFDckMsT0FBTyxFQUFFLFlBQVksSUFBSSxnQkFBZ0IsRUFBRSxTQUFTLElBQUksYUFBYSxFQUFFLElBQUksRUFBRSxNQUFNLGdCQUFnQixDQUFBO0FBQ25HLE9BQU8sRUFBRSxZQUFZLElBQUksZUFBZSxFQUFFLFNBQVMsSUFBSSxZQUFZLEVBQUUsR0FBRyxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBRS9GLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBRyxDQUMzQixHQUFhLEVBQ2IsSUFBSSxFQUNKLFdBQVcsRUFDWCxPQUFPLEVBQ1AsU0FBK0IsRUFDL0IsSUFBNEMsRUFBRSxFQUFFO0lBQ2hELE9BQU8sR0FBRyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsV0FBVyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsSUFBbUIsRUFBZ0IsRUFBRTtRQUN2RixJQUFJLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQztZQUFDLE9BQU07UUFBQyxDQUFDO1FBQ3pCLElBQUksSUFBSSxHQUFHLElBQUksQ0FBQTtRQUNmLElBQUksQ0FBQztZQUNELElBQUksR0FBRyxTQUFTLEVBQUUsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUE7UUFDbEMsQ0FBQztRQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUM7WUFDVCxNQUFNLENBQUMsS0FBSyxDQUFDLDBCQUEwQixJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUE7UUFDN0QsQ0FBQztRQUNELE9BQU8sTUFBTSxJQUFJLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBQ2pDLENBQUMsQ0FBQyxDQUFBO0FBQ04sQ0FBQyxDQUFBO0FBRUQsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsQ0FBQyxHQUFhLEVBQUUsRUFBRTtJQUM5QyxlQUFlLENBQUMsR0FBRyxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsYUFBYSxFQUFFLElBQUksQ0FBQyxDQUFBO0lBQzNFLGVBQWUsQ0FBQyxHQUFHLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxlQUFlLEVBQUUsWUFBWSxFQUFFLEdBQUcsQ0FBQyxDQUFBO0FBQzFFLENBQUMsQ0FBQSJ9
|
||||
File diff suppressed because one or more lines are too long
@ -1,6 +0,0 @@
|
||||
import * as CLI from 'yargs';
|
||||
export declare const defaultOptions: (yargs: CLI.Argv) => any;
|
||||
export declare const command = "salamander";
|
||||
export declare const desc = "Generate Salamander file manager menu entries from JSON configuration";
|
||||
export declare const builder: (yargs: CLI.Argv) => any;
|
||||
export declare function handler(argv: CLI.Arguments): Promise<void>;
|
||||
247
packages/commons/dist/commands/salamander.js
vendored
247
packages/commons/dist/commands/salamander.js
vendored
File diff suppressed because one or more lines are too long
151
packages/commons/dist/component.cjs
vendored
151
packages/commons/dist/component.cjs
vendored
@ -1,151 +0,0 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var component_exports = {};
|
||||
__export(component_exports, {
|
||||
AssetsSchema: () => AssetsSchema,
|
||||
AuthorSchema: () => AuthorSchema,
|
||||
ComponentConfigSchema: () => ComponentConfigSchema,
|
||||
ContentSchema: () => ContentSchema,
|
||||
ProductionSchema: () => ProductionSchema,
|
||||
get: () => get
|
||||
});
|
||||
module.exports = __toCommonJS(component_exports);
|
||||
var path = __toESM(require("path"), 1);
|
||||
var import_zod = require("zod");
|
||||
var import_filter = require("./filter.js");
|
||||
var import_glob = require("./fs/_glob.js");
|
||||
var import_variables = require("./variables.js");
|
||||
var import_config = require("./config.js");
|
||||
const AuthorSchema = import_zod.z.object({
|
||||
name: import_zod.z.string(),
|
||||
url: import_zod.z.string()
|
||||
});
|
||||
const ContentSchema = import_zod.z.object({
|
||||
body: import_zod.z.string().optional(),
|
||||
features: import_zod.z.string().optional(),
|
||||
highlights: import_zod.z.string().optional(),
|
||||
specs: import_zod.z.string().optional(),
|
||||
license: import_zod.z.string().optional()
|
||||
});
|
||||
const AssetsSchema = import_zod.z.object({
|
||||
gallery: import_zod.z.array(import_zod.z.string()).optional(),
|
||||
renderings: import_zod.z.array(import_zod.z.string()).optional(),
|
||||
components: import_zod.z.array(import_zod.z.string()).optional()
|
||||
});
|
||||
const ProductionSchema = import_zod.z.object({
|
||||
"fusion-folder": import_zod.z.string(),
|
||||
"nc-folder": import_zod.z.string(),
|
||||
cam: import_zod.z.array(AuthorSchema)
|
||||
});
|
||||
const ComponentConfigSchema = import_zod.z.object({
|
||||
// shop
|
||||
cart_id: import_zod.z.string().optional(),
|
||||
code: import_zod.z.string(),
|
||||
price: import_zod.z.number().optional(),
|
||||
cscartCats: import_zod.z.array(import_zod.z.number()).optional(),
|
||||
cscartId: import_zod.z.number().optional(),
|
||||
vendorId: import_zod.z.number().optional(),
|
||||
//internal
|
||||
version: import_zod.z.string().optional(),
|
||||
status: import_zod.z.string().optional(),
|
||||
authors: import_zod.z.array(AuthorSchema).optional(),
|
||||
replaced_by: import_zod.z.string().optional(),
|
||||
alternatives: import_zod.z.array(import_zod.z.string()).optional(),
|
||||
flags: import_zod.z.number().optional(),
|
||||
// public
|
||||
download: import_zod.z.boolean().optional(),
|
||||
name: import_zod.z.string(),
|
||||
edrawings: import_zod.z.string().optional(),
|
||||
showDimensions: import_zod.z.boolean().optional(),
|
||||
showParts: import_zod.z.boolean().optional(),
|
||||
slug: import_zod.z.string(),
|
||||
score: import_zod.z.number().optional(),
|
||||
Preview3d: import_zod.z.boolean().optional(),
|
||||
keywords: import_zod.z.string().optional(),
|
||||
meta_keywords: import_zod.z.string().optional(),
|
||||
content: ContentSchema.optional(),
|
||||
assets: AssetsSchema.optional(),
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
howto_categories: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.string())]).optional(),
|
||||
steps: import_zod.z.any().optional(),
|
||||
sourceLanguage: import_zod.z.string().optional(),
|
||||
category: import_zod.z.string(),
|
||||
product_dimensions: import_zod.z.string().optional(),
|
||||
production: ProductionSchema.optional()
|
||||
}).passthrough();
|
||||
const find_items = (nodes, options) => {
|
||||
nodes = nodes.filter(options.filter);
|
||||
return nodes.map((c) => {
|
||||
const root = (0, import_variables.resolve)(options.root, false, {});
|
||||
return {
|
||||
rel: (0, import_glob.forward_slash)(`${path.relative(root, path.parse(c).dir)}`),
|
||||
path: (0, import_glob.forward_slash)(`${options.root}/${path.relative(root, c)}`),
|
||||
config: (0, import_config.readOSRConfig)(c)
|
||||
};
|
||||
});
|
||||
};
|
||||
const get = (src, root, type) => {
|
||||
const srcInfo = (0, import_glob.pathInfoEx)(src, false, {
|
||||
absolute: true
|
||||
});
|
||||
switch (type) {
|
||||
case import_filter.PFilterValid.marketplace_component: {
|
||||
const options = {
|
||||
filter: import_filter.isValidMarketplaceComponent,
|
||||
root
|
||||
};
|
||||
return find_items(srcInfo.FILES, options);
|
||||
}
|
||||
case import_filter.PFilterValid.library_component: {
|
||||
const options = {
|
||||
filter: import_filter.isValidLibraryComponent,
|
||||
root
|
||||
};
|
||||
return find_items(srcInfo.FILES, options);
|
||||
}
|
||||
case import_filter.PFilterInvalid.marketplace_component: {
|
||||
const options = {
|
||||
filter: import_filter.isInvalidMarketplaceComponent,
|
||||
root
|
||||
};
|
||||
return find_items(srcInfo.FILES, options);
|
||||
}
|
||||
}
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
AssetsSchema,
|
||||
AuthorSchema,
|
||||
ComponentConfigSchema,
|
||||
ContentSchema,
|
||||
ProductionSchema,
|
||||
get
|
||||
});
|
||||
//# sourceMappingURL=component.cjs.map
|
||||
1
packages/commons/dist/component.cjs.map
vendored
1
packages/commons/dist/component.cjs.map
vendored
File diff suppressed because one or more lines are too long
381
packages/commons/dist/component.d.cts
vendored
381
packages/commons/dist/component.d.cts
vendored
@ -1,381 +0,0 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
declare const AuthorSchema: z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}>;
|
||||
declare const ContentSchema: 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;
|
||||
}>;
|
||||
declare const AssetsSchema: 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">>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>;
|
||||
declare const ProductionSchema: z.ZodObject<{
|
||||
"fusion-folder": z.ZodString;
|
||||
"nc-folder": z.ZodString;
|
||||
cam: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}>;
|
||||
declare const ComponentConfigSchema: z.ZodObject<{
|
||||
cart_id: z.ZodOptional<z.ZodString>;
|
||||
code: z.ZodString;
|
||||
price: z.ZodOptional<z.ZodNumber>;
|
||||
cscartCats: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
||||
cscartId: z.ZodOptional<z.ZodNumber>;
|
||||
vendorId: z.ZodOptional<z.ZodNumber>;
|
||||
version: z.ZodOptional<z.ZodString>;
|
||||
status: z.ZodOptional<z.ZodString>;
|
||||
authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: 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>;
|
||||
name: z.ZodString;
|
||||
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<{
|
||||
gallery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
renderings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
howto_categories: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
||||
steps: z.ZodOptional<z.ZodAny>;
|
||||
sourceLanguage: z.ZodOptional<z.ZodString>;
|
||||
category: z.ZodString;
|
||||
product_dimensions: z.ZodOptional<z.ZodString>;
|
||||
production: z.ZodOptional<z.ZodObject<{
|
||||
"fusion-folder": z.ZodString;
|
||||
"nc-folder": z.ZodString;
|
||||
cam: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}>>;
|
||||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
||||
cart_id: z.ZodOptional<z.ZodString>;
|
||||
code: z.ZodString;
|
||||
price: z.ZodOptional<z.ZodNumber>;
|
||||
cscartCats: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
||||
cscartId: z.ZodOptional<z.ZodNumber>;
|
||||
vendorId: z.ZodOptional<z.ZodNumber>;
|
||||
version: z.ZodOptional<z.ZodString>;
|
||||
status: z.ZodOptional<z.ZodString>;
|
||||
authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: 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>;
|
||||
name: z.ZodString;
|
||||
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<{
|
||||
gallery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
renderings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
howto_categories: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
||||
steps: z.ZodOptional<z.ZodAny>;
|
||||
sourceLanguage: z.ZodOptional<z.ZodString>;
|
||||
category: z.ZodString;
|
||||
product_dimensions: z.ZodOptional<z.ZodString>;
|
||||
production: z.ZodOptional<z.ZodObject<{
|
||||
"fusion-folder": z.ZodString;
|
||||
"nc-folder": z.ZodString;
|
||||
cam: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}>>;
|
||||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
||||
cart_id: z.ZodOptional<z.ZodString>;
|
||||
code: z.ZodString;
|
||||
price: z.ZodOptional<z.ZodNumber>;
|
||||
cscartCats: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
||||
cscartId: z.ZodOptional<z.ZodNumber>;
|
||||
vendorId: z.ZodOptional<z.ZodNumber>;
|
||||
version: z.ZodOptional<z.ZodString>;
|
||||
status: z.ZodOptional<z.ZodString>;
|
||||
authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: 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>;
|
||||
name: z.ZodString;
|
||||
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<{
|
||||
gallery: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
renderings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
components: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}, {
|
||||
gallery?: string[];
|
||||
renderings?: string[];
|
||||
components?: string[];
|
||||
}>>;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
howto_categories: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
||||
steps: z.ZodOptional<z.ZodAny>;
|
||||
sourceLanguage: z.ZodOptional<z.ZodString>;
|
||||
category: z.ZodString;
|
||||
product_dimensions: z.ZodOptional<z.ZodString>;
|
||||
production: z.ZodOptional<z.ZodObject<{
|
||||
"fusion-folder": z.ZodString;
|
||||
"nc-folder": z.ZodString;
|
||||
cam: z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
url: z.ZodString;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}, {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}>, "many">;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}, {
|
||||
"fusion-folder"?: string;
|
||||
"nc-folder"?: string;
|
||||
cam?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
}>>;
|
||||
}, z.ZodTypeAny, "passthrough">>;
|
||||
type IComponentConfig = z.infer<typeof ComponentConfigSchema>;
|
||||
declare const get: (src: any, root: any, type: any) => {
|
||||
rel: any;
|
||||
path: any;
|
||||
config: any;
|
||||
}[];
|
||||
|
||||
export { AssetsSchema, AuthorSchema, ComponentConfigSchema, ContentSchema, type IComponentConfig, ProductionSchema, get };
|
||||
1
packages/commons/dist/component.js.map
vendored
1
packages/commons/dist/component.js.map
vendored
File diff suppressed because one or more lines are too long
148
packages/commons/dist/config.cjs
vendored
148
packages/commons/dist/config.cjs
vendored
@ -1,148 +0,0 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var config_exports = {};
|
||||
__export(config_exports, {
|
||||
CONFIG_DEFAULT: () => CONFIG_DEFAULT,
|
||||
CONFIG_DEFAULT_PATH: () => CONFIG_DEFAULT_PATH,
|
||||
DEFAULT_ROOTS: () => DEFAULT_ROOTS,
|
||||
HOME: () => HOME,
|
||||
KB_ROOT: () => KB_ROOT,
|
||||
OA_ROOT: () => OA_ROOT,
|
||||
OSR_CACHE: () => OSR_CACHE,
|
||||
OSR_CUSTOMER_DRIVE: () => OSR_CUSTOMER_DRIVE,
|
||||
OSR_LIBRARY: () => OSR_LIBRARY,
|
||||
OSR_LIBRARY_DIRECTORY: () => OSR_LIBRARY_DIRECTORY,
|
||||
OSR_LIBRARY_MACHINES: () => OSR_LIBRARY_MACHINES,
|
||||
OSR_PRIVATE: () => OSR_PRIVATE,
|
||||
OSR_ROOT: () => OSR_ROOT,
|
||||
OSR_SUB_DEFAULT: () => OSR_SUB_DEFAULT,
|
||||
OSR_TEMP: () => OSR_TEMP,
|
||||
OSR_USER_ASSETS: () => OSR_USER_ASSETS,
|
||||
POLYMECH_ROOT: () => POLYMECH_ROOT,
|
||||
PRODUCT_ROOT: () => PRODUCT_ROOT,
|
||||
get_var: () => get_var,
|
||||
readNPMMeta: () => readNPMMeta,
|
||||
readOSRConfig: () => readOSRConfig,
|
||||
readOSRMeta: () => readOSRMeta,
|
||||
readPackage: () => readPackage
|
||||
});
|
||||
module.exports = __toCommonJS(config_exports);
|
||||
var path = __toESM(require("path"), 1);
|
||||
var import_env_var = __toESM(require("env-var"), 1);
|
||||
var import_read = require("@polymech/fs/read");
|
||||
var import_exists = require("@polymech/fs/exists");
|
||||
var import_primitives = require("@polymech/core/primitives");
|
||||
var import_constants = require("./constants.js");
|
||||
const { get } = import_env_var.default;
|
||||
const HOME = (sub = "") => path.join(process.env[process.platform == "win32" ? "USERPROFILE" : "HOME"], sub);
|
||||
const get_var = (key = "") => get(key).asString() || get(key.replace(/-/g, "_")).asString() || get(key.replace(/_/g, "-")).asString();
|
||||
const OSR_ROOT = (key = "OSR-ROOT") => get_var(key) || path.join(HOME("desktop"), import_constants.API_PREFIX);
|
||||
const OSR_SUB_DEFAULT = (key = "") => get_var(key) || path.join(OSR_ROOT(), key);
|
||||
const CONFIG_DEFAULT_PATH = (key = "OSR-CONFIG") => get_var(key) || path.join(HOME(`${import_constants.API_PREFIX}`), ".config.json");
|
||||
const OSR_TEMP = (key = "OSR-TEMP") => get_var(key) || OSR_SUB_DEFAULT(`.${import_constants.API_PREFIX}/temp`);
|
||||
const OSR_CACHE = (key = "OSR-CACHE") => get_var(key) || OSR_SUB_DEFAULT(`.${import_constants.API_PREFIX}/cache`);
|
||||
const OSR_PRIVATE = (key = "OSR-PRIVATE") => get_var(key);
|
||||
const KB_ROOT = (key = "OSR-KB") => get_var(key);
|
||||
const OSR_LIBRARY = (key = "OSR-LIBRARY") => get_var(key);
|
||||
const OSR_LIBRARY_MACHINES = (key = "OSR-LIBRARY-MACHINES") => get_var(key);
|
||||
const OSR_LIBRARY_DIRECTORY = (key = "OSR-LIBRARY-DIRECTORY") => get_var(key);
|
||||
const PRODUCT_ROOT = (key = "PRODUCT-ROOT") => get_var(key);
|
||||
const OSR_CUSTOMER_DRIVE = (key = "OSR-CUSTOMER-DRIVE") => get_var(key);
|
||||
const OA_ROOT = (key = "OA-ROOT") => get_var(key);
|
||||
const OSR_USER_ASSETS = (key = "OSR-USER-ASSETS") => get_var(key);
|
||||
const POLYMECH_ROOT = (key = "POLYMECH-ROOT") => get_var(key) || path.join(HOME("desktop"), import_constants.API_PREFIX_NEXT);
|
||||
const DEFAULT_ROOTS = {
|
||||
OSR_ROOT: OSR_ROOT(),
|
||||
OSR_TEMP: OSR_TEMP(),
|
||||
PRODUCT_ROOT: PRODUCT_ROOT(),
|
||||
OA_ROOT: OA_ROOT(),
|
||||
KB_ROOT: KB_ROOT(),
|
||||
OSR_CACHE: OSR_CACHE(),
|
||||
OSR_LIBRARY: OSR_LIBRARY(),
|
||||
OSR_LIBRARY_MACHINES: OSR_LIBRARY_MACHINES(),
|
||||
OSR_LIBRARY_DIRECTORY: OSR_LIBRARY_DIRECTORY(),
|
||||
OSR_USER_ASSETS: OSR_USER_ASSETS(),
|
||||
OSR_PRIVATE: OSR_PRIVATE(),
|
||||
OSR_TEMPLATES: path.join(OSR_SUB_DEFAULT("osr-templates")),
|
||||
OSR_CONTENT: path.join(OSR_SUB_DEFAULT("osr-content")),
|
||||
OSR_PROFILES: path.join(OSR_SUB_DEFAULT("osr-profiles")),
|
||||
OSR_CUSTOMER_DRIVE: OSR_CUSTOMER_DRIVE(),
|
||||
POLYMECH_ROOT: POLYMECH_ROOT()
|
||||
};
|
||||
const CONFIG_DEFAULT = (key = "OSR-CONFIG") => {
|
||||
const cPath = path.resolve(CONFIG_DEFAULT_PATH(key));
|
||||
if ((0, import_exists.sync)(cPath)) {
|
||||
return (0, import_read.sync)(cPath, "json");
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const readNPMMeta = (_path) => (0, import_read.sync)(_path, "json") || {};
|
||||
const readPackage = (val) => {
|
||||
if ((0, import_primitives.isString)(val)) {
|
||||
return readNPMMeta(val);
|
||||
} else if ((0, import_primitives.isObject)(val)) {
|
||||
return val;
|
||||
}
|
||||
return {};
|
||||
};
|
||||
const readOSRMeta = (_path) => (0, import_read.sync)(_path, "json");
|
||||
const readOSRConfig = (val) => {
|
||||
if ((0, import_primitives.isString)(val)) {
|
||||
return readOSRMeta(val);
|
||||
} else if ((0, import_primitives.isObject)(val)) {
|
||||
return val;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
CONFIG_DEFAULT,
|
||||
CONFIG_DEFAULT_PATH,
|
||||
DEFAULT_ROOTS,
|
||||
HOME,
|
||||
KB_ROOT,
|
||||
OA_ROOT,
|
||||
OSR_CACHE,
|
||||
OSR_CUSTOMER_DRIVE,
|
||||
OSR_LIBRARY,
|
||||
OSR_LIBRARY_DIRECTORY,
|
||||
OSR_LIBRARY_MACHINES,
|
||||
OSR_PRIVATE,
|
||||
OSR_ROOT,
|
||||
OSR_SUB_DEFAULT,
|
||||
OSR_TEMP,
|
||||
OSR_USER_ASSETS,
|
||||
POLYMECH_ROOT,
|
||||
PRODUCT_ROOT,
|
||||
get_var,
|
||||
readNPMMeta,
|
||||
readOSRConfig,
|
||||
readOSRMeta,
|
||||
readPackage
|
||||
});
|
||||
//# sourceMappingURL=config.cjs.map
|
||||
1
packages/commons/dist/config.cjs.map
vendored
1
packages/commons/dist/config.cjs.map
vendored
File diff suppressed because one or more lines are too long
47
packages/commons/dist/config.d.cts
vendored
47
packages/commons/dist/config.d.cts
vendored
@ -1,47 +0,0 @@
|
||||
import { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package';
|
||||
import { IComponentConfig } from './component.cjs';
|
||||
import 'zod';
|
||||
|
||||
declare const HOME: (sub?: string) => string;
|
||||
declare const get_var: (key?: string) => string;
|
||||
declare const OSR_ROOT: (key?: string) => string;
|
||||
declare const OSR_SUB_DEFAULT: (key?: string) => string;
|
||||
declare const CONFIG_DEFAULT_PATH: (key?: string) => string;
|
||||
declare const OSR_TEMP: (key?: string) => string;
|
||||
declare const OSR_CACHE: (key?: string) => string;
|
||||
declare const OSR_PRIVATE: (key?: string) => string;
|
||||
declare const KB_ROOT: (key?: string) => string;
|
||||
declare const OSR_LIBRARY: (key?: string) => string;
|
||||
declare const OSR_LIBRARY_MACHINES: (key?: string) => string;
|
||||
declare const OSR_LIBRARY_DIRECTORY: (key?: string) => string;
|
||||
declare const PRODUCT_ROOT: (key?: string) => string;
|
||||
declare const OSR_CUSTOMER_DRIVE: (key?: string) => string;
|
||||
declare const OA_ROOT: (key?: string) => string;
|
||||
declare const OSR_USER_ASSETS: (key?: string) => string;
|
||||
declare const POLYMECH_ROOT: (key?: string) => string;
|
||||
declare const DEFAULT_ROOTS: {
|
||||
OSR_ROOT: string;
|
||||
OSR_TEMP: string;
|
||||
PRODUCT_ROOT: string;
|
||||
OA_ROOT: string;
|
||||
KB_ROOT: string;
|
||||
OSR_CACHE: string;
|
||||
OSR_LIBRARY: string;
|
||||
OSR_LIBRARY_MACHINES: string;
|
||||
OSR_LIBRARY_DIRECTORY: string;
|
||||
OSR_USER_ASSETS: string;
|
||||
OSR_PRIVATE: string;
|
||||
OSR_TEMPLATES: string;
|
||||
OSR_CONTENT: string;
|
||||
OSR_PROFILES: string;
|
||||
OSR_CUSTOMER_DRIVE: string;
|
||||
POLYMECH_ROOT: string;
|
||||
};
|
||||
declare const CONFIG_DEFAULT: (key?: string) => string | false | object;
|
||||
|
||||
declare const readNPMMeta: (_path: string) => JSONSchemaForNPMPackageJsonFiles;
|
||||
declare const readPackage: (val: any) => JSONSchemaForNPMPackageJsonFiles;
|
||||
declare const readOSRMeta: (_path: string) => IComponentConfig;
|
||||
declare const readOSRConfig: (val: any) => any;
|
||||
|
||||
export { CONFIG_DEFAULT, CONFIG_DEFAULT_PATH, DEFAULT_ROOTS, HOME, KB_ROOT, OA_ROOT, OSR_CACHE, OSR_CUSTOMER_DRIVE, OSR_LIBRARY, OSR_LIBRARY_DIRECTORY, OSR_LIBRARY_MACHINES, OSR_PRIVATE, OSR_ROOT, OSR_SUB_DEFAULT, OSR_TEMP, OSR_USER_ASSETS, POLYMECH_ROOT, PRODUCT_ROOT, get_var, readNPMMeta, readOSRConfig, readOSRMeta, readPackage };
|
||||
1
packages/commons/dist/config.js.map
vendored
1
packages/commons/dist/config.js.map
vendored
File diff suppressed because one or more lines are too long
58
packages/commons/dist/constants.cjs
vendored
58
packages/commons/dist/constants.cjs
vendored
@ -1,58 +0,0 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var constants_exports = {};
|
||||
__export(constants_exports, {
|
||||
API_NAMESPACE: () => API_NAMESPACE,
|
||||
API_PREFIX: () => API_PREFIX,
|
||||
API_PREFIX_NEXT: () => API_PREFIX_NEXT,
|
||||
MODULE_NAME: () => MODULE_NAME,
|
||||
OA_LATEST: () => OA_LATEST,
|
||||
OA_LATEST_CENSORED: () => OA_LATEST_CENSORED,
|
||||
OA_LATEST_INVALID: () => OA_LATEST_INVALID,
|
||||
OA_LATEST_MERGED: () => OA_LATEST_MERGED,
|
||||
PP_BAZAR_LATEST_INDEX: () => PP_BAZAR_LATEST_INDEX,
|
||||
PP_BAZAR_LATEST_INDEX_MERGED: () => PP_BAZAR_LATEST_INDEX_MERGED,
|
||||
PROFILE_FILE_NAME: () => PROFILE_FILE_NAME
|
||||
});
|
||||
module.exports = __toCommonJS(constants_exports);
|
||||
const MODULE_NAME = `OSR-Commons`;
|
||||
const PROFILE_FILE_NAME = `.osrl.json`;
|
||||
const OA_LATEST = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}.json";
|
||||
const OA_LATEST_INVALID = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_INVALID.json";
|
||||
const OA_LATEST_CENSORED = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_CENSORED.json";
|
||||
const OA_LATEST_MERGED = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_MERGED.json";
|
||||
const PP_BAZAR_LATEST_INDEX = "${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index.json";
|
||||
const PP_BAZAR_LATEST_INDEX_MERGED = "${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index_merged.json";
|
||||
const API_NAMESPACE = "@polymech";
|
||||
const API_PREFIX = "polymech";
|
||||
const API_PREFIX_NEXT = "polymech";
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
API_NAMESPACE,
|
||||
API_PREFIX,
|
||||
API_PREFIX_NEXT,
|
||||
MODULE_NAME,
|
||||
OA_LATEST,
|
||||
OA_LATEST_CENSORED,
|
||||
OA_LATEST_INVALID,
|
||||
OA_LATEST_MERGED,
|
||||
PP_BAZAR_LATEST_INDEX,
|
||||
PP_BAZAR_LATEST_INDEX_MERGED,
|
||||
PROFILE_FILE_NAME
|
||||
});
|
||||
//# sourceMappingURL=constants.cjs.map
|
||||
1
packages/commons/dist/constants.cjs.map
vendored
1
packages/commons/dist/constants.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const MODULE_NAME = `OSR-Commons`\r\nexport const PROFILE_FILE_NAME = `.osrl.json`\r\n////////////////////////////////////////\r\n//\r\n// OA Migration\r\n\r\nexport const OA_LATEST = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}.json'\r\nexport const OA_LATEST_INVALID = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_INVALID.json'\r\nexport const OA_LATEST_CENSORED = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_CENSORED.json'\r\nexport const OA_LATEST_MERGED = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_MERGED.json'\r\n\r\n// fecking bazar\r\nexport const PP_BAZAR_LATEST_INDEX = '${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index.json'\r\nexport const PP_BAZAR_LATEST_INDEX_MERGED = '${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index_merged.json'\r\n\r\n// Namespaces\r\nexport const API_NAMESPACE = '@polymech'\r\nexport const API_PREFIX = 'polymech'\r\nexport const API_PREFIX_NEXT = 'polymech'"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAK1B,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,MAAM,mBAAmB;AAGzB,MAAM,wBAAwB;AAC9B,MAAM,+BAA+B;AAGrC,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,kBAAkB;","names":[]}
|
||||
13
packages/commons/dist/constants.d.cts
vendored
13
packages/commons/dist/constants.d.cts
vendored
@ -1,13 +0,0 @@
|
||||
declare const MODULE_NAME = "OSR-Commons";
|
||||
declare const PROFILE_FILE_NAME = ".osrl.json";
|
||||
declare const OA_LATEST = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}.json";
|
||||
declare const OA_LATEST_INVALID = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_INVALID.json";
|
||||
declare const OA_LATEST_CENSORED = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_CENSORED.json";
|
||||
declare const OA_LATEST_MERGED = "${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_MERGED.json";
|
||||
declare const PP_BAZAR_LATEST_INDEX = "${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index.json";
|
||||
declare const PP_BAZAR_LATEST_INDEX_MERGED = "${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index_merged.json";
|
||||
declare const API_NAMESPACE = "@polymech";
|
||||
declare const API_PREFIX = "polymech";
|
||||
declare const API_PREFIX_NEXT = "polymech";
|
||||
|
||||
export { API_NAMESPACE, API_PREFIX, API_PREFIX_NEXT, MODULE_NAME, OA_LATEST, OA_LATEST_CENSORED, OA_LATEST_INVALID, OA_LATEST_MERGED, PP_BAZAR_LATEST_INDEX, PP_BAZAR_LATEST_INDEX_MERGED, PROFILE_FILE_NAME };
|
||||
1
packages/commons/dist/constants.js.map
vendored
1
packages/commons/dist/constants.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const MODULE_NAME = `OSR-Commons`\r\nexport const PROFILE_FILE_NAME = `.osrl.json`\r\n////////////////////////////////////////\r\n//\r\n// OA Migration\r\n\r\nexport const OA_LATEST = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}.json'\r\nexport const OA_LATEST_INVALID = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_INVALID.json'\r\nexport const OA_LATEST_CENSORED = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_CENSORED.json'\r\nexport const OA_LATEST_MERGED = '${OSR_ROOT}/osr-directory/pp/${YYYY}_${MM}_MERGED.json'\r\n\r\n// fecking bazar\r\nexport const PP_BAZAR_LATEST_INDEX = '${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index.json'\r\nexport const PP_BAZAR_LATEST_INDEX_MERGED = '${OSR_ROOT}/pp-bazar/${YYYY}/${MM}/index_merged.json'\r\n\r\n// Namespaces\r\nexport const API_NAMESPACE = '@polymech'\r\nexport const API_PREFIX = 'polymech'\r\nexport const API_PREFIX_NEXT = 'polymech'"],"mappings":"AAAO,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAK1B,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,MAAM,mBAAmB;AAGzB,MAAM,wBAAwB;AAC9B,MAAM,+BAA+B;AAGrC,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,kBAAkB;","names":[]}
|
||||
101
packages/commons/dist/filter.cjs
vendored
101
packages/commons/dist/filter.cjs
vendored
@ -1,101 +0,0 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var filter_exports = {};
|
||||
__export(filter_exports, {
|
||||
FiltersValid: () => FiltersValid,
|
||||
PFilterInvalid: () => PFilterInvalid,
|
||||
PFilterValid: () => PFilterValid,
|
||||
hasDependency: () => hasDependency,
|
||||
isAPIPackage: () => isAPIPackage,
|
||||
isInvalidMarketplaceComponent: () => isInvalidMarketplaceComponent,
|
||||
isValidLibraryComponent: () => isValidLibraryComponent,
|
||||
isValidMarketplaceComponent: () => isValidMarketplaceComponent
|
||||
});
|
||||
module.exports = __toCommonJS(filter_exports);
|
||||
var path = __toESM(require("path"), 1);
|
||||
var import_exists = require("@polymech/fs/exists");
|
||||
var import_constants = require("./constants.js");
|
||||
var import_config = require("./config.js");
|
||||
const isAPIPackage = (_path) => {
|
||||
const pkg = (0, import_config.readPackage)(_path);
|
||||
return (pkg.name || "").startsWith(`${import_constants.API_NAMESPACE}/${import_constants.API_PREFIX}`) ? pkg : null;
|
||||
};
|
||||
const hasDependency = (pkg, dep) => {
|
||||
pkg = (0, import_config.readPackage)(pkg);
|
||||
return Object.keys(pkg.dependencies || {}).concat(Object.keys(pkg.devDependencies || {})).find((d) => d === dep);
|
||||
};
|
||||
const isValidMarketplaceComponent = (_path) => {
|
||||
const pkg = (0, import_config.readOSRConfig)(_path);
|
||||
if (!pkg || !pkg.name || !pkg.slug || !pkg.code) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const isInvalidMarketplaceComponent = (_path) => {
|
||||
const pkg = (0, import_config.readOSRConfig)(_path);
|
||||
if (pkg && !pkg.name || !pkg.slug || !pkg.code) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const isValidLibraryComponent = (_path) => {
|
||||
const pkg = (0, import_config.readOSRConfig)(_path);
|
||||
if (!pkg || !pkg.name) {
|
||||
return false;
|
||||
}
|
||||
const templatePath = path.resolve(`${path.parse(_path).dir}/templates/shared/body.md`);
|
||||
if (!(0, import_exists.sync)(templatePath)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const PFilterInvalid = {
|
||||
marketplace_component: "invalid_marketplace_component"
|
||||
};
|
||||
const PFilterValid = {
|
||||
marketplace_component: "marketplace_component",
|
||||
library_component: "library_component",
|
||||
package: "package"
|
||||
};
|
||||
const FiltersValid = {
|
||||
"marketplace_component": isValidMarketplaceComponent,
|
||||
"library_component": isValidLibraryComponent,
|
||||
"package": isAPIPackage
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
FiltersValid,
|
||||
PFilterInvalid,
|
||||
PFilterValid,
|
||||
hasDependency,
|
||||
isAPIPackage,
|
||||
isInvalidMarketplaceComponent,
|
||||
isValidLibraryComponent,
|
||||
isValidMarketplaceComponent
|
||||
});
|
||||
//# sourceMappingURL=filter.cjs.map
|
||||
1
packages/commons/dist/filter.cjs.map
vendored
1
packages/commons/dist/filter.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/filter.ts"],"sourcesContent":["import * as path from 'path'\r\nimport { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package'\r\nimport { sync as exists } from '@polymech/fs/exists'\r\n\r\nimport {\r\n API_NAMESPACE,\r\n API_PREFIX \r\n} from './constants.js'\r\n\r\nimport {\r\n readPackage,\r\n readOSRConfig\r\n} from './config.js'\r\n\r\n//////////////////////////////////////////////////////\r\n//\r\n// NPM related\r\n\r\nexport const isAPIPackage = (_path: string) => {\r\n const pkg = readPackage(_path)\r\n return (pkg.name || '').startsWith(`${API_NAMESPACE}/${API_PREFIX}`) ? pkg : null\r\n}\r\n\r\nexport const hasDependency = (pkg: string | JSONSchemaForNPMPackageJsonFiles, dep: string) => {\r\n pkg = readPackage(pkg)\r\n return Object.keys((pkg.dependencies || {})).\r\n concat( Object.keys(pkg.devDependencies || {})).\r\n find((d:string)=> d === dep)\r\n}\r\n\r\n//////////////////////////////////////////////////////\r\n//\r\n// OSR related\r\n\r\nexport const isValidMarketplaceComponent = (_path: string) => {\r\n const pkg = readOSRConfig(_path)\r\n if( !pkg ||\r\n !pkg.name ||\r\n !pkg.slug ||\r\n !pkg.code){\r\n return false\r\n }\r\n return true \r\n}\r\n\r\nexport const isInvalidMarketplaceComponent = (_path: string) => {\r\n const pkg = readOSRConfig(_path)\r\n if( pkg &&\r\n !pkg.name ||\r\n !pkg.slug ||\r\n !pkg.code){\r\n return true\r\n }\r\n return false\r\n}\r\n\r\nexport const isValidLibraryComponent = (_path: string) => {\r\n const pkg = readOSRConfig(_path)\r\n if( !pkg || !pkg.name){\r\n return false\r\n }\r\n const templatePath = path.resolve(`${path.parse(_path).dir}/templates/shared/body.md`)\r\n if(!exists(templatePath)){\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nexport const PFilterInvalid = {\r\n marketplace_component: 'invalid_marketplace_component'\r\n}\r\n\r\nexport const PFilterValid = {\r\n marketplace_component: 'marketplace_component',\r\n library_component: 'library_component',\r\n package: 'package'\r\n}\r\n\r\nexport const FiltersValid =\r\n{\r\n 'marketplace_component': isValidMarketplaceComponent,\r\n 'library_component': isValidLibraryComponent,\r\n 'package' : isAPIPackage\r\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AAEtB,oBAA+B;AAE/B,uBAGO;AAEP,oBAGO;AAMA,MAAM,eAAe,CAAC,UAAkB;AAC3C,QAAM,UAAM,2BAAY,KAAK;AAC7B,UAAQ,IAAI,QAAQ,IAAI,WAAW,GAAG,8BAAa,IAAI,2BAAU,EAAE,IAAI,MAAM;AACjF;AAEO,MAAM,gBAAgB,CAAC,KAAgD,QAAgB;AAC1F,YAAM,2BAAY,GAAG;AACrB,SAAQ,OAAO,KAAM,IAAI,gBAAgB,CAAC,CAAE,EACpC,OAAQ,OAAO,KAAK,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAC9C,KAAK,CAAC,MAAY,MAAM,GAAG;AACvC;AAMO,MAAM,8BAA8B,CAAC,UAAkB;AAC1D,QAAM,UAAM,6BAAc,KAAK;AAC/B,MAAI,CAAC,OACD,CAAC,IAAI,QACL,CAAC,IAAI,QACL,CAAC,IAAI,MAAK;AACV,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,MAAM,gCAAgC,CAAC,UAAkB;AAC5D,QAAM,UAAM,6BAAc,KAAK;AAC/B,MAAI,OACA,CAAC,IAAI,QACL,CAAC,IAAI,QACL,CAAC,IAAI,MAAK;AACV,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,MAAM,0BAA0B,CAAC,UAAkB;AACtD,QAAM,UAAM,6BAAc,KAAK;AAC/B,MAAI,CAAC,OAAO,CAAC,IAAI,MAAK;AAClB,WAAO;AAAA,EACX;AACA,QAAM,eAAgB,KAAK,QAAQ,GAAG,KAAK,MAAM,KAAK,EAAE,GAAG,2BAA2B;AACtF,MAAG,KAAC,cAAAA,MAAO,YAAY,GAAE;AACrB,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,MAAM,iBAAiB;AAAA,EAC1B,uBAAuB;AAC3B;AAEO,MAAM,eAAe;AAAA,EACxB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,SAAS;AACb;AAEO,MAAM,eACb;AAAA,EACI,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,WAAY;AAChB;","names":["exists"]}
|
||||
22
packages/commons/dist/filter.d.cts
vendored
22
packages/commons/dist/filter.d.cts
vendored
@ -1,22 +0,0 @@
|
||||
import { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package';
|
||||
|
||||
declare const isAPIPackage: (_path: string) => JSONSchemaForNPMPackageJsonFiles;
|
||||
declare const hasDependency: (pkg: string | JSONSchemaForNPMPackageJsonFiles, dep: string) => string;
|
||||
declare const isValidMarketplaceComponent: (_path: string) => boolean;
|
||||
declare const isInvalidMarketplaceComponent: (_path: string) => boolean;
|
||||
declare const isValidLibraryComponent: (_path: string) => boolean;
|
||||
declare const PFilterInvalid: {
|
||||
marketplace_component: string;
|
||||
};
|
||||
declare const PFilterValid: {
|
||||
marketplace_component: string;
|
||||
library_component: string;
|
||||
package: string;
|
||||
};
|
||||
declare const FiltersValid: {
|
||||
marketplace_component: (_path: string) => boolean;
|
||||
library_component: (_path: string) => boolean;
|
||||
package: (_path: string) => JSONSchemaForNPMPackageJsonFiles;
|
||||
};
|
||||
|
||||
export { FiltersValid, PFilterInvalid, PFilterValid, hasDependency, isAPIPackage, isInvalidMarketplaceComponent, isValidLibraryComponent, isValidMarketplaceComponent };
|
||||
1
packages/commons/dist/filter.js.map
vendored
1
packages/commons/dist/filter.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/filter.ts"],"sourcesContent":["import * as path from 'path'\r\nimport { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package'\r\nimport { sync as exists } from '@polymech/fs/exists'\r\n\r\nimport {\r\n API_NAMESPACE,\r\n API_PREFIX \r\n} from './constants.js'\r\n\r\nimport {\r\n readPackage,\r\n readOSRConfig\r\n} from './config.js'\r\n\r\n//////////////////////////////////////////////////////\r\n//\r\n// NPM related\r\n\r\nexport const isAPIPackage = (_path: string) => {\r\n const pkg = readPackage(_path)\r\n return (pkg.name || '').startsWith(`${API_NAMESPACE}/${API_PREFIX}`) ? pkg : null\r\n}\r\n\r\nexport const hasDependency = (pkg: string | JSONSchemaForNPMPackageJsonFiles, dep: string) => {\r\n pkg = readPackage(pkg)\r\n return Object.keys((pkg.dependencies || {})).\r\n concat( Object.keys(pkg.devDependencies || {})).\r\n find((d:string)=> d === dep)\r\n}\r\n\r\n//////////////////////////////////////////////////////\r\n//\r\n// OSR related\r\n\r\nexport const isValidMarketplaceComponent = (_path: string) => {\r\n const pkg = readOSRConfig(_path)\r\n if( !pkg ||\r\n !pkg.name ||\r\n !pkg.slug ||\r\n !pkg.code){\r\n return false\r\n }\r\n return true \r\n}\r\n\r\nexport const isInvalidMarketplaceComponent = (_path: string) => {\r\n const pkg = readOSRConfig(_path)\r\n if( pkg &&\r\n !pkg.name ||\r\n !pkg.slug ||\r\n !pkg.code){\r\n return true\r\n }\r\n return false\r\n}\r\n\r\nexport const isValidLibraryComponent = (_path: string) => {\r\n const pkg = readOSRConfig(_path)\r\n if( !pkg || !pkg.name){\r\n return false\r\n }\r\n const templatePath = path.resolve(`${path.parse(_path).dir}/templates/shared/body.md`)\r\n if(!exists(templatePath)){\r\n return false\r\n }\r\n return true\r\n}\r\n\r\nexport const PFilterInvalid = {\r\n marketplace_component: 'invalid_marketplace_component'\r\n}\r\n\r\nexport const PFilterValid = {\r\n marketplace_component: 'marketplace_component',\r\n library_component: 'library_component',\r\n package: 'package'\r\n}\r\n\r\nexport const FiltersValid =\r\n{\r\n 'marketplace_component': isValidMarketplaceComponent,\r\n 'library_component': isValidLibraryComponent,\r\n 'package' : isAPIPackage\r\n}"],"mappings":"AAAA,YAAY,UAAU;AAEtB,SAAS,QAAQ,cAAc;AAE/B;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAMA,MAAM,eAAe,CAAC,UAAkB;AAC3C,QAAM,MAAM,YAAY,KAAK;AAC7B,UAAQ,IAAI,QAAQ,IAAI,WAAW,GAAG,aAAa,IAAI,UAAU,EAAE,IAAI,MAAM;AACjF;AAEO,MAAM,gBAAgB,CAAC,KAAgD,QAAgB;AAC1F,QAAM,YAAY,GAAG;AACrB,SAAQ,OAAO,KAAM,IAAI,gBAAgB,CAAC,CAAE,EACpC,OAAQ,OAAO,KAAK,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAC9C,KAAK,CAAC,MAAY,MAAM,GAAG;AACvC;AAMO,MAAM,8BAA8B,CAAC,UAAkB;AAC1D,QAAM,MAAM,cAAc,KAAK;AAC/B,MAAI,CAAC,OACD,CAAC,IAAI,QACL,CAAC,IAAI,QACL,CAAC,IAAI,MAAK;AACV,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,MAAM,gCAAgC,CAAC,UAAkB;AAC5D,QAAM,MAAM,cAAc,KAAK;AAC/B,MAAI,OACA,CAAC,IAAI,QACL,CAAC,IAAI,QACL,CAAC,IAAI,MAAK;AACV,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,MAAM,0BAA0B,CAAC,UAAkB;AACtD,QAAM,MAAM,cAAc,KAAK;AAC/B,MAAI,CAAC,OAAO,CAAC,IAAI,MAAK;AAClB,WAAO;AAAA,EACX;AACA,QAAM,eAAgB,KAAK,QAAQ,GAAG,KAAK,MAAM,KAAK,EAAE,GAAG,2BAA2B;AACtF,MAAG,CAAC,OAAO,YAAY,GAAE;AACrB,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,MAAM,iBAAiB;AAAA,EAC1B,uBAAuB;AAC3B;AAEO,MAAM,eAAe;AAAA,EACxB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,SAAS;AACb;AAEO,MAAM,eACb;AAAA,EACI,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,WAAY;AAChB;","names":[]}
|
||||
77
packages/commons/dist/fs.cjs
vendored
77
packages/commons/dist/fs.cjs
vendored
@ -1,77 +0,0 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var fs_exports = {};
|
||||
__export(fs_exports, {
|
||||
UNC_REGEX: () => UNC_REGEX,
|
||||
WIN32_PATH_REGEX: () => WIN32_PATH_REGEX,
|
||||
isFile: () => isFile,
|
||||
isFolder: () => isFolder,
|
||||
is_absolute: () => is_absolute
|
||||
});
|
||||
module.exports = __toCommonJS(fs_exports);
|
||||
var fs = __toESM(require("fs"), 1);
|
||||
var import_os = require("./os.js");
|
||||
const UNC_REGEX = /^[\\\/]{2,}[^\\\/]+[\\\/]+[^\\\/]+/;
|
||||
const WIN32_PATH_REGEX = /^([a-z]:)?[\\\/]/i;
|
||||
const isFile = (src) => {
|
||||
let srcIsFile = false;
|
||||
try {
|
||||
srcIsFile = fs.lstatSync(src).isFile();
|
||||
} catch (e) {
|
||||
}
|
||||
return srcIsFile;
|
||||
};
|
||||
const isFolder = (src) => {
|
||||
let srcIsFolder = false;
|
||||
try {
|
||||
srcIsFolder = fs.lstatSync(src).isDirectory();
|
||||
} catch (e) {
|
||||
}
|
||||
return srcIsFolder;
|
||||
};
|
||||
const is_relative_win32 = (fp) => !fp.test(UNC_REGEX) && !WIN32_PATH_REGEX.test(fp);
|
||||
const is_absolute_posix = (fp) => fp.charAt(0) === "/";
|
||||
const is_absolute_win32 = (fp) => {
|
||||
if (/[a-z]/i.test(fp.charAt(0)) && fp.charAt(1) === ":" && fp.charAt(2) === "\\") {
|
||||
return true;
|
||||
}
|
||||
if (fp.slice(0, 2) === "\\\\") {
|
||||
return true;
|
||||
}
|
||||
return !is_relative_win32(fp);
|
||||
};
|
||||
const is_absolute = (fp) => (0, import_os.is_windows)() ? is_absolute_win32(fp) : is_absolute_posix(fp);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
UNC_REGEX,
|
||||
WIN32_PATH_REGEX,
|
||||
isFile,
|
||||
isFolder,
|
||||
is_absolute
|
||||
});
|
||||
//# sourceMappingURL=fs.cjs.map
|
||||
1
packages/commons/dist/fs.cjs.map
vendored
1
packages/commons/dist/fs.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/fs.ts"],"sourcesContent":["import * as fs from 'fs'\r\n\r\n// https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#namespaces\r\n// https://github.com/isaacs/node-glob/blob/main/src/pattern.ts\r\n\r\nexport const UNC_REGEX = /^[\\\\\\/]{2,}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+/\r\nexport const WIN32_PATH_REGEX = /^([a-z]:)?[\\\\\\/]/i\r\n\r\nimport { is_windows } from './os.js'\r\n\r\n\r\nexport const isFile = (src: string) => {\r\n let srcIsFile = false;\r\n try {\r\n srcIsFile = fs.lstatSync(src).isFile()\r\n } catch (e) { }\r\n return srcIsFile\r\n}\r\n\r\nexport const isFolder = (src: string) => {\r\n let srcIsFolder = false;\r\n try {\r\n srcIsFolder = fs.lstatSync(src).isDirectory()\r\n } catch (e) { }\r\n return srcIsFolder;\r\n}\r\n\r\nconst is_relative_win32 = (fp) => !fp.test(UNC_REGEX) && !WIN32_PATH_REGEX.test(fp)\r\nconst is_absolute_posix = (fp) => fp.charAt(0) === '/'\r\nconst is_absolute_win32 = (fp) => {\r\n if (/[a-z]/i.test(fp.charAt(0)) && fp.charAt(1) === ':' && fp.charAt(2) === '\\\\') {\r\n return true\r\n }\r\n // Microsoft Azure absolute filepath\r\n if (fp.slice(0, 2) === '\\\\\\\\') {\r\n return true;\r\n }\r\n return !is_relative_win32(fp)\r\n}\r\nexport const is_absolute = (fp) => is_windows() ? is_absolute_win32(fp) : is_absolute_posix(fp)\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AAQpB,gBAA2B;AAHpB,MAAM,YAAY;AAClB,MAAM,mBAAmB;AAKzB,MAAM,SAAS,CAAC,QAAgB;AACnC,MAAI,YAAY;AAChB,MAAI;AACA,gBAAY,GAAG,UAAU,GAAG,EAAE,OAAO;AAAA,EACzC,SAAS,GAAG;AAAA,EAAE;AACd,SAAO;AACX;AAEO,MAAM,WAAW,CAAC,QAAgB;AACrC,MAAI,cAAc;AAClB,MAAI;AACA,kBAAc,GAAG,UAAU,GAAG,EAAE,YAAY;AAAA,EAChD,SAAS,GAAG;AAAA,EAAE;AACd,SAAO;AACX;AAEA,MAAM,oBAAoB,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,KAAK,CAAC,iBAAiB,KAAK,EAAE;AAClF,MAAM,oBAAoB,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM;AACnD,MAAM,oBAAoB,CAAC,OAAO;AAC9B,MAAI,SAAS,KAAK,GAAG,OAAO,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,MAAM;AAC9E,WAAO;AAAA,EACX;AAEA,MAAI,GAAG,MAAM,GAAG,CAAC,MAAM,QAAQ;AAC3B,WAAO;AAAA,EACX;AACA,SAAO,CAAC,kBAAkB,EAAE;AAChC;AACO,MAAM,cAAc,CAAC,WAAQ,sBAAW,IAAI,kBAAkB,EAAE,IAAI,kBAAkB,EAAE;","names":[]}
|
||||
7
packages/commons/dist/fs.d.cts
vendored
7
packages/commons/dist/fs.d.cts
vendored
@ -1,7 +0,0 @@
|
||||
declare const UNC_REGEX: RegExp;
|
||||
declare const WIN32_PATH_REGEX: RegExp;
|
||||
declare const isFile: (src: string) => boolean;
|
||||
declare const isFolder: (src: string) => boolean;
|
||||
declare const is_absolute: (fp: any) => boolean;
|
||||
|
||||
export { UNC_REGEX, WIN32_PATH_REGEX, isFile, isFolder, is_absolute };
|
||||
1
packages/commons/dist/fs.js.map
vendored
1
packages/commons/dist/fs.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/fs.ts"],"sourcesContent":["import * as fs from 'fs'\r\n\r\n// https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#namespaces\r\n// https://github.com/isaacs/node-glob/blob/main/src/pattern.ts\r\n\r\nexport const UNC_REGEX = /^[\\\\\\/]{2,}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+/\r\nexport const WIN32_PATH_REGEX = /^([a-z]:)?[\\\\\\/]/i\r\n\r\nimport { is_windows } from './os.js'\r\n\r\n\r\nexport const isFile = (src: string) => {\r\n let srcIsFile = false;\r\n try {\r\n srcIsFile = fs.lstatSync(src).isFile()\r\n } catch (e) { }\r\n return srcIsFile\r\n}\r\n\r\nexport const isFolder = (src: string) => {\r\n let srcIsFolder = false;\r\n try {\r\n srcIsFolder = fs.lstatSync(src).isDirectory()\r\n } catch (e) { }\r\n return srcIsFolder;\r\n}\r\n\r\nconst is_relative_win32 = (fp) => !fp.test(UNC_REGEX) && !WIN32_PATH_REGEX.test(fp)\r\nconst is_absolute_posix = (fp) => fp.charAt(0) === '/'\r\nconst is_absolute_win32 = (fp) => {\r\n if (/[a-z]/i.test(fp.charAt(0)) && fp.charAt(1) === ':' && fp.charAt(2) === '\\\\') {\r\n return true\r\n }\r\n // Microsoft Azure absolute filepath\r\n if (fp.slice(0, 2) === '\\\\\\\\') {\r\n return true;\r\n }\r\n return !is_relative_win32(fp)\r\n}\r\nexport const is_absolute = (fp) => is_windows() ? is_absolute_win32(fp) : is_absolute_posix(fp)\r\n"],"mappings":"AAAA,YAAY,QAAQ;AAKb,MAAM,YAAY;AAClB,MAAM,mBAAmB;AAEhC,SAAS,kBAAkB;AAGpB,MAAM,SAAS,CAAC,QAAgB;AACnC,MAAI,YAAY;AAChB,MAAI;AACA,gBAAY,GAAG,UAAU,GAAG,EAAE,OAAO;AAAA,EACzC,SAAS,GAAG;AAAA,EAAE;AACd,SAAO;AACX;AAEO,MAAM,WAAW,CAAC,QAAgB;AACrC,MAAI,cAAc;AAClB,MAAI;AACA,kBAAc,GAAG,UAAU,GAAG,EAAE,YAAY;AAAA,EAChD,SAAS,GAAG;AAAA,EAAE;AACd,SAAO;AACX;AAEA,MAAM,oBAAoB,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,KAAK,CAAC,iBAAiB,KAAK,EAAE;AAClF,MAAM,oBAAoB,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM;AACnD,MAAM,oBAAoB,CAAC,OAAO;AAC9B,MAAI,SAAS,KAAK,GAAG,OAAO,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,MAAM;AAC9E,WAAO;AAAA,EACX;AAEA,MAAI,GAAG,MAAM,GAAG,CAAC,MAAM,QAAQ;AAC3B,WAAO;AAAA,EACX;AACA,SAAO,CAAC,kBAAkB,EAAE;AAChC;AACO,MAAM,cAAc,CAAC,OAAQ,WAAW,IAAI,kBAAkB,EAAE,IAAI,kBAAkB,EAAE;","names":[]}
|
||||
1
packages/commons/dist/fs/_glob.js.map
vendored
1
packages/commons/dist/fs/_glob.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"_glob.js","sourceRoot":"","sources":["../../src/fs/_glob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,MAAM,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,OAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,EAAE,CAAO,CAAA;AAC/J,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,OAAqB,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EA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AAC,SAAS,CAAC,OAAO,EAAE;QAC5C,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;KAC9C;SAAM;QACH,SAAS,CAAC,OAAO,GAAG,KAAK,CAAA;KAC5B;IACD,IAAI,SAAS,CAAC,OAAO,EAAE;QACnB,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;QAC/B,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QAC5C,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAA;QACpC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC/B,2DAA2D;QAC3D,SAAS,CAAC,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE;YACvC,GAAG,EAAE,IAAI;YACT,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC;YACvC,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;KACL;SAAM,IAAI,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;QACzC,SAAS,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAA;KAC1B;IACD,OAAO,SAAS,CAAA;AACpB,CAAC,CAAA"}
|
||||
1
packages/commons/dist/fs/glob-base.js.map
vendored
1
packages/commons/dist/fs/glob-base.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"glob-base.js","sourceRoot":"","sources":["../../src/fs/glob-base.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQ7C,SAAS,OAAO,CAAC,IAAY;IAC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IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC/B;IACD,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QAC9B,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC/B;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAA"}
|
||||
1
packages/commons/dist/fs/glob-parent.js.map
vendored
1
packages/commons/dist/fs/glob-parent.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"glob-parent.js","sourceRoot":"","sources":["../../src/fs/glob-parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAE/B,MAAM,OAAO,GAAG,QAAQ,EAAE,KAAK,OAAO,CAAA;AAEtC,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAMrC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,IAAc,EAAU,EAAE;IAChE,MAAM,OAAO,GAAY,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;IAE5D,+BAA+B;IAC/B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC9D,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;KACrC;IAED,yEAAyE;IACzE,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;QACpB,GAAG,IAAI,KAAK,CAAC;KACd;IAED,yDAAyD;IACzD,GAAG,IAAI,GAAG,CAAC;IAEX,oC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-1,13 +0,0 @@
|
||||
/*!
|
||||
* glob-base <https://github.com/jonschlinkert/glob-base>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
interface GlobBaseResult {
|
||||
base: string;
|
||||
isGlob: boolean;
|
||||
glob: string;
|
||||
}
|
||||
export declare const globBase: (pattern: string) => GlobBaseResult;
|
||||
export {};
|
||||
47
packages/commons/dist/glob-base.js
vendored
47
packages/commons/dist/glob-base.js
vendored
@ -1,47 +0,0 @@
|
||||
/*!
|
||||
* glob-base <https://github.com/jonschlinkert/glob-base>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
import { dirname as pathDirname } from 'path';
|
||||
import { hasMagic } from 'glob';
|
||||
import { globParent } from './glob-parent.js';
|
||||
function dirname(glob) {
|
||||
if (glob.slice(-1) === '/')
|
||||
return glob;
|
||||
return pathDirname(glob);
|
||||
}
|
||||
export const globBase = (pattern) => {
|
||||
if (typeof pattern !== 'string') {
|
||||
throw new TypeError('glob-base expects a string.');
|
||||
}
|
||||
const res = {
|
||||
base: globParent(pattern),
|
||||
isGlob: hasMagic(pattern),
|
||||
glob: ''
|
||||
};
|
||||
if (res.base !== '.') {
|
||||
res.glob = pattern.substr(res.base.length);
|
||||
if (res.glob.charAt(0) === '/') {
|
||||
res.glob = res.glob.substr(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
res.glob = pattern;
|
||||
}
|
||||
if (!res.isGlob) {
|
||||
res.base = dirname(pattern);
|
||||
res.glob = res.base !== '.'
|
||||
? pattern.substr(res.base.length)
|
||||
: pattern;
|
||||
}
|
||||
if (res.glob.substr(0, 2) === './') {
|
||||
res.glob = res.glob.substr(2);
|
||||
}
|
||||
if (res.glob.charAt(0) === '/') {
|
||||
res.glob = res.glob.substr(1);
|
||||
}
|
||||
return res;
|
||||
};
|
||||
//# sourceMappingURL=glob-base.js.map
|
||||
1
packages/commons/dist/glob-base.js.map
vendored
1
packages/commons/dist/glob-base.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"glob-base.js","sourceRoot":"","sources":["../src/glob-base.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQ7C,SAAS,OAAO,CAAC,IAAY;IAC3B,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAkB,EAAE;IAC1D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;KACpD;IAED,MAAM,GAAG,GAAmB;QAC1B,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;QACzB,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;QACpB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAC9B,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SAC/B;KACF;SAAM;QACL,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;KACpB;IAED,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;QACf,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5B,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,KAAK,GAAG;YACzB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;YACjC,CAAC,CAAC,OAAO,CAAC;KACb;IAED,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;QAClC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC/B;IACD,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QAC9B,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC/B;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAA"}
|
||||
5
packages/commons/dist/glob-parent.d.ts
vendored
5
packages/commons/dist/glob-parent.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
interface Options {
|
||||
flipBackslashes?: boolean;
|
||||
}
|
||||
export declare const globParent: (str: string, opts?: Options) => string;
|
||||
export {};
|
||||
58
packages/commons/dist/glob-parent.js
vendored
58
packages/commons/dist/glob-parent.js
vendored
@ -1,58 +0,0 @@
|
||||
import { posix } from 'path';
|
||||
import { platform } from 'os';
|
||||
import { hasMagic } from 'glob';
|
||||
const isWin32 = platform() === 'win32';
|
||||
const slash = '/';
|
||||
const backslash = /\\/g;
|
||||
const escaped = /\\([!*?|[\](){}])/g;
|
||||
export const globParent = (str, opts) => {
|
||||
const options = { flipBackslashes: true, ...opts };
|
||||
// flip windows path separators
|
||||
if (options.flipBackslashes && isWin32 && !str.includes(slash)) {
|
||||
str = str.replace(backslash, slash);
|
||||
}
|
||||
// special case for strings ending in enclosure containing path separator
|
||||
if (isEnclosure(str)) {
|
||||
str += slash;
|
||||
}
|
||||
// preserves full path in case of trailing path separator
|
||||
str += 'a';
|
||||
// remove path parts that are globby
|
||||
do {
|
||||
str = posix.dirname(str);
|
||||
} while (isGlobby(str));
|
||||
// remove escape chars and return result
|
||||
return str.replace(escaped, '$1');
|
||||
};
|
||||
function isEnclosure(str) {
|
||||
const lastChar = str.slice(-1);
|
||||
let enclosureStart;
|
||||
switch (lastChar) {
|
||||
case '}':
|
||||
enclosureStart = '{';
|
||||
break;
|
||||
case ']':
|
||||
enclosureStart = '[';
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
const foundIndex = str.indexOf(enclosureStart);
|
||||
if (foundIndex < 0) {
|
||||
return false;
|
||||
}
|
||||
return str.slice(foundIndex + 1, -1).includes(slash);
|
||||
}
|
||||
function isGlobby(str) {
|
||||
if (/\([^()]+$/.test(str)) {
|
||||
return true;
|
||||
}
|
||||
if (str[0] === '{' || str[0] === '[') {
|
||||
return true;
|
||||
}
|
||||
if (/[^\\][{[]/.test(str)) {
|
||||
return true;
|
||||
}
|
||||
return hasMagic(str);
|
||||
}
|
||||
//# sourceMappingURL=glob-parent.js.map
|
||||
1
packages/commons/dist/glob-parent.js.map
vendored
1
packages/commons/dist/glob-parent.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"glob-parent.js","sourceRoot":"","sources":["../src/glob-parent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAE/B,MAAM,OAAO,GAAG,QAAQ,EAAE,KAAK,OAAO,CAAA;AAEtC,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,OAAO,GAAG,oBAAoB,CAAC;AAMrC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAA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SAAS,QAAQ,CAAC,GAAW;IAC3B,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACpC,OAAO,IAAI,CAAC;KACb;IACD,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
||||
40
packages/commons/dist/index.cjs
vendored
40
packages/commons/dist/index.cjs
vendored
@ -1,40 +0,0 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var index_exports = {};
|
||||
module.exports = __toCommonJS(index_exports);
|
||||
__reExport(index_exports, require("./fs.js"), module.exports);
|
||||
__reExport(index_exports, require("./config.js"), module.exports);
|
||||
__reExport(index_exports, require("./os.js"), module.exports);
|
||||
__reExport(index_exports, require("./paths.js"), module.exports);
|
||||
__reExport(index_exports, require("./variables.js"), module.exports);
|
||||
__reExport(index_exports, require("./profile.js"), module.exports);
|
||||
__reExport(index_exports, require("./types.js"), module.exports);
|
||||
__reExport(index_exports, require("./constants.js"), module.exports);
|
||||
__reExport(index_exports, require("./fs/_glob.js"), module.exports);
|
||||
__reExport(index_exports, require("./component.js"), module.exports);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
...require("./fs.js"),
|
||||
...require("./config.js"),
|
||||
...require("./os.js"),
|
||||
...require("./paths.js"),
|
||||
...require("./variables.js"),
|
||||
...require("./profile.js"),
|
||||
...require("./types.js"),
|
||||
...require("./constants.js"),
|
||||
...require("./fs/_glob.js"),
|
||||
...require("./component.js")
|
||||
});
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
1
packages/commons/dist/index.cjs.map
vendored
1
packages/commons/dist/index.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './fs.js'\r\nexport * from './config.js'\r\nexport * from './os.js'\r\nexport * from './paths.js'\r\nexport * from './variables.js'\r\nexport * from './profile.js'\r\nexport * from './types.js'\r\nexport * from './constants.js'\r\nexport * from './fs/_glob.js'\r\nexport * from './component.js'\r\n\r\n\r\n\r\n\r\n\r\n\r\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,oBAAd;AACA,0BAAc,wBADd;AAEA,0BAAc,oBAFd;AAGA,0BAAc,uBAHd;AAIA,0BAAc,2BAJd;AAKA,0BAAc,yBALd;AAMA,0BAAc,uBANd;AAOA,0BAAc,2BAPd;AAQA,0BAAc,0BARd;AASA,0BAAc,2BATd;","names":[]}
|
||||
42
packages/commons/dist/index.d.cts
vendored
42
packages/commons/dist/index.d.cts
vendored
@ -1,42 +0,0 @@
|
||||
export { UNC_REGEX, WIN32_PATH_REGEX, isFile, isFolder, is_absolute } from './fs.cjs';
|
||||
export { CONFIG_DEFAULT, CONFIG_DEFAULT_PATH, DEFAULT_ROOTS, HOME, KB_ROOT, OA_ROOT, OSR_CACHE, OSR_CUSTOMER_DRIVE, OSR_LIBRARY, OSR_LIBRARY_DIRECTORY, OSR_LIBRARY_MACHINES, OSR_PRIVATE, OSR_ROOT, OSR_SUB_DEFAULT, OSR_TEMP, OSR_USER_ASSETS, POLYMECH_ROOT, PRODUCT_ROOT, get_var, readNPMMeta, readOSRConfig, readOSRMeta, readPackage } from './config.cjs';
|
||||
export { EArch, EPlatform, is_windows } from './os.cjs';
|
||||
export { DATE_VARS, DEFAULT_VARS, _substitute, resolve, resolveVariables, substitute } from './variables.cjs';
|
||||
export { IProfile, parse, resolveConfig } from './profile.cjs';
|
||||
export { IConvertedFileMeta, IDiscourseUser, IGeo, IGeoLocation, IGeo_Administrative, IGeo_Informative, IGeo_LocalityInfo, IImage, IMAchineBuilderXp, IModerable, IModerationStatus, INotification, IOA_Service, IOA_UserDetail, IOSRUserData, IOpeningHours, IPlasticType, IProduct, IProfileType, ISODateString, IUploadedFileMeta, IUrl, IUser, IUserDB, IUserPP, IUserPPDB, IUserState, IWorkspaceType, I_OSR_USER, I_USER_SHORT, MachineBuilderXpLabel, NotificationType, PlasticTypeLabel, TOSR_User_Type, WorkspaceType } from './types.cjs';
|
||||
export { API_NAMESPACE, API_PREFIX, API_PREFIX_NEXT, MODULE_NAME, OA_LATEST, OA_LATEST_CENSORED, OA_LATEST_INVALID, OA_LATEST_MERGED, PP_BAZAR_LATEST_INDEX, PP_BAZAR_LATEST_INDEX_MERGED, PROFILE_FILE_NAME } from './constants.cjs';
|
||||
import { GlobOptions } from 'glob';
|
||||
import { PATH_INFO } from './types_common.cjs';
|
||||
export { DST_VARIABLES, GeoPos, ICsCartConfig, ICsCartConfigMySQL, IDeeplConfig, IDiscourseConfig, IGiteaConfig, IIgConfig, IOSRConfig, IOptionsBase, IScaleserp, PATH_VARIABLES, SRC_VARIABLES } from './types_common.cjs';
|
||||
export { AssetsSchema, AuthorSchema, ComponentConfigSchema, ContentSchema, IComponentConfig, ProductionSchema, get } from './component.cjs';
|
||||
export { IKBotOptions } from './types_kbot.cjs';
|
||||
import '@schemastore/package';
|
||||
import 'zod';
|
||||
|
||||
/*!
|
||||
* glob-base <https://github.com/jonschlinkert/glob-base>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
interface GlobBaseResult {
|
||||
base: string;
|
||||
isGlob: boolean;
|
||||
glob: string;
|
||||
}
|
||||
declare const globBase: (pattern: string) => GlobBaseResult;
|
||||
|
||||
interface Options {
|
||||
flipBackslashes?: boolean;
|
||||
}
|
||||
declare const globParent: (str: string, opts?: Options) => string;
|
||||
|
||||
declare const files: (cwd: any, glob: any, options?: any) => [];
|
||||
declare const filesEx: (cwd: any, glob: any, options?: GlobOptions) => [];
|
||||
|
||||
declare const getExtensions: (glob: string) => string[];
|
||||
declare const forward_slash: (path: any) => any;
|
||||
declare const pathInfoEx: (src: string, altToken?: boolean, globOptions?: GlobOptions) => PATH_INFO;
|
||||
declare const pathInfo: (src: string, altToken?: boolean, cwd?: string) => PATH_INFO;
|
||||
|
||||
export { PATH_INFO, files, filesEx, forward_slash, getExtensions, globBase, globParent, pathInfo, pathInfoEx };
|
||||
1
packages/commons/dist/index.js.map
vendored
1
packages/commons/dist/index.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './fs.js'\r\nexport * from './config.js'\r\nexport * from './os.js'\r\nexport * from './paths.js'\r\nexport * from './variables.js'\r\nexport * from './profile.js'\r\nexport * from './types.js'\r\nexport * from './constants.js'\r\nexport * from './fs/_glob.js'\r\nexport * from './component.js'\r\n\r\n\r\n\r\n\r\n\r\n\r\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
||||
1
packages/commons/dist/lib/components.d.ts
vendored
1
packages/commons/dist/lib/components.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
2
packages/commons/dist/lib/components.js
vendored
2
packages/commons/dist/lib/components.js
vendored
@ -1,2 +0,0 @@
|
||||
export {};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY29tcG9uZW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
||||
1
packages/commons/dist/lib/components.js.map
vendored
1
packages/commons/dist/lib/components.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/lib/components.ts"],"names":[],"mappings":""}
|
||||
39
packages/commons/dist/lib/each.d.ts
vendored
Normal file
39
packages/commons/dist/lib/each.d.ts
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
import { z } from 'zod';
|
||||
import * as CLI from 'yargs';
|
||||
import { IOptionsEach } from './types.js';
|
||||
export declare const handleFs: (path: string) => Promise<string | object>;
|
||||
export declare const schemeHandlers: Record<string, (arg1: string, arg2?: URLSearchParams) => Promise<string | object>>;
|
||||
export declare const parseCustomUrl: (url: string) => Promise<string | object>;
|
||||
export declare const zodSchema: () => z.ZodObject<{
|
||||
logLevel: z.ZodDefault<z.ZodString>;
|
||||
main: z.ZodString;
|
||||
log: z.ZodOptional<z.ZodString>;
|
||||
list: z.ZodString;
|
||||
root: z.ZodOptional<z.ZodString>;
|
||||
cwd: z.ZodOptional<z.ZodString>;
|
||||
trace: z.ZodDefault<z.ZodBoolean>;
|
||||
env: z.ZodDefault<z.ZodString>;
|
||||
profile: z.ZodDefault<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
root?: string;
|
||||
cwd?: string;
|
||||
logLevel?: string;
|
||||
main?: string;
|
||||
log?: string;
|
||||
list?: string;
|
||||
trace?: boolean;
|
||||
env?: string;
|
||||
profile?: string;
|
||||
}, {
|
||||
root?: string;
|
||||
cwd?: string;
|
||||
logLevel?: string;
|
||||
main?: string;
|
||||
log?: string;
|
||||
list?: string;
|
||||
trace?: boolean;
|
||||
env?: string;
|
||||
profile?: string;
|
||||
}>;
|
||||
export declare const yargsOptions: (yargs: CLI.Argv) => CLI.Argv;
|
||||
export declare const each: (opts: IOptionsEach) => Promise<any[]>;
|
||||
117
packages/commons/dist/lib/each.js
vendored
Normal file
117
packages/commons/dist/lib/each.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
packages/commons/dist/lib/fs.js.map
vendored
1
packages/commons/dist/lib/fs.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/lib/fs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AAExB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,EAAE;IAClC,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI;QACA,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAA;KACzC;IAAC,OAAO,CAAC,EAAE,GAAG;IACf,OAAO,SAAS,CAAA;AACpB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;IACpC,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI;QACA,WAAW,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;KAChD;IAAC,OAAO,CAAC,EAAE,GAAG;IACf,OAAO,WAAW,CAAC;AACvB,CAAC,CAAA"}
|
||||
1
packages/commons/dist/lib/index.js.map
vendored
1
packages/commons/dist/lib/index.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
||||
18
packages/commons/dist/lib/process/index.d.ts
vendored
Normal file
18
packages/commons/dist/lib/process/index.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
export declare enum STATUS {
|
||||
OK = 0,
|
||||
ERROR = 1,
|
||||
PENDING = 2
|
||||
}
|
||||
export declare class Process {
|
||||
binary: string;
|
||||
cwd: string;
|
||||
args: string;
|
||||
buffer: string[];
|
||||
constructor(options?: any);
|
||||
optionsToString(options: any): string;
|
||||
optionsToArray(options: any): string[];
|
||||
exec(command: string, args?: string[]): Promise<any>;
|
||||
}
|
||||
export declare class Helper {
|
||||
static run(cwd: any, cmd: string, args: string[], buffer?: string[], debug_stream?: boolean): Promise<any>;
|
||||
}
|
||||
145
packages/commons/dist/lib/process/index.js
vendored
Normal file
145
packages/commons/dist/lib/process/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
23
packages/commons/dist/lib/run.d.ts
vendored
Normal file
23
packages/commons/dist/lib/run.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import * as CLI from 'yargs';
|
||||
import { z } from 'zod';
|
||||
export declare const zodSchema: () => z.ZodObject<{
|
||||
config: z.ZodDefault<z.ZodString>;
|
||||
dry: z.ZodDefault<z.ZodBoolean>;
|
||||
list: z.ZodDefault<z.ZodBoolean>;
|
||||
projectPath: z.ZodDefault<z.ZodString>;
|
||||
logFilePath: z.ZodDefault<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
config?: string;
|
||||
list?: boolean;
|
||||
dry?: boolean;
|
||||
projectPath?: string;
|
||||
logFilePath?: string;
|
||||
}, {
|
||||
config?: string;
|
||||
list?: boolean;
|
||||
dry?: boolean;
|
||||
projectPath?: string;
|
||||
logFilePath?: string;
|
||||
}>;
|
||||
export declare const run: (options: any, argv: any) => Promise<boolean>;
|
||||
export declare const yargsOptions: (yargs: CLI.Argv) => CLI.Argv;
|
||||
68
packages/commons/dist/lib/run.js
vendored
Normal file
68
packages/commons/dist/lib/run.js
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
import { z } from 'zod';
|
||||
import * as fs from 'fs';
|
||||
import * as child_process from 'child_process';
|
||||
import * as path from 'path';
|
||||
import { sync as read } from '@polymech/fs/read';
|
||||
import { sync as exists } from '@polymech/fs/exists';
|
||||
import { logger as log } from '../logger.js';
|
||||
import { toYargs } from '@polymech/commons';
|
||||
export const zodSchema = () => z.object({
|
||||
config: z.string().default('default'),
|
||||
dry: z.boolean().default(false),
|
||||
list: z.boolean().default(false),
|
||||
projectPath: z.string().default(process.cwd()),
|
||||
logFilePath: z.string().default(path.join(process.cwd(), 'log-configuration.json')),
|
||||
}, { description: 'RunDebugSchema' });
|
||||
export const run = async (options, argv) => {
|
||||
options = { ...options, ...argv };
|
||||
const vscodeDir = path.join(options.projectPath, '.vscode');
|
||||
const launchFile = path.join(vscodeDir, 'launch.json');
|
||||
if (!exists(launchFile)) {
|
||||
log.error('No launch.json found in the .vscode directory.');
|
||||
return false;
|
||||
}
|
||||
if (!exists(options.projectPath)) {
|
||||
log.error('Invalid project path:', options.projectPath);
|
||||
return false;
|
||||
}
|
||||
const launchConfig = read(launchFile, 'json');
|
||||
const config = launchConfig.configurations.find((c) => c.name === options.config);
|
||||
if (!config) {
|
||||
log.error(`Debug configuration with name "${options.config}" not found.`, launchConfig.configurations.map((c) => c.name), argv);
|
||||
return false;
|
||||
}
|
||||
let command = config.program;
|
||||
if (command === '${workspaceFolder}\\src\\main.ts' || command === '${workspaceFolder}\\src\\main.js') {
|
||||
command = 'node.exe ./main.js';
|
||||
}
|
||||
if (!command) {
|
||||
log.error('The configuration does not contain a "program" to execute.');
|
||||
return false;
|
||||
}
|
||||
const args = config.args || [];
|
||||
const exe_options = { cwd: options.projectPath };
|
||||
log.debug('Executing debug configuration:', command, exe_options);
|
||||
if (options.list) {
|
||||
log.info('Listing the debug configuration:', launchConfig.configurations.map((c) => c.name));
|
||||
return true;
|
||||
}
|
||||
if (options.dry) {
|
||||
log.info('Dry run of the debug configuration:', config);
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
const ret = child_process.execFileSync(command, args, {
|
||||
cwd: options.projectPath,
|
||||
stdio: 'inherit',
|
||||
shell: true
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
const logData = `${new Date().toISOString()} ERROR: ${err}`;
|
||||
fs.appendFileSync(options.logFilePath, logData, 'utf-8');
|
||||
log.error('Failed to execute the debug configuration:', err);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
export const yargsOptions = (yargs) => toYargs(yargs, zodSchema());
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVuLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi9ydW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLENBQUMsRUFBRSxNQUFNLEtBQUssQ0FBQTtBQUV2QixPQUFPLEtBQUssRUFBRSxNQUFNLElBQUksQ0FBQTtBQUN4QixPQUFPLEtBQUssYUFBYSxNQUFNLGVBQWUsQ0FBQTtBQUM5QyxPQUFPLEtBQUssSUFBSSxNQUFNLE1BQU0sQ0FBQTtBQUU1QixPQUFPLEVBQUUsSUFBSSxJQUFJLElBQUksRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBQ2hELE9BQU8sRUFBRSxJQUFJLElBQUksTUFBTSxFQUFFLE1BQU0scUJBQXFCLENBQUE7QUFDcEQsT0FBTyxFQUFFLE1BQU0sSUFBSSxHQUFHLEVBQUUsTUFBTSxjQUFjLENBQUE7QUFDNUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBTzNDLE1BQU0sQ0FBQyxNQUFNLFNBQVMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDO0lBQ3BDLE1BQU0sRUFBRSxDQUFDLENBQUMsTUFBTSxFQUFFLENBQUMsT0FBTyxDQUFDLFNBQVMsQ0FBQzt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RUFBRSxPQUFPLENBQUMsQ0FBQTtRQUN4RCxHQUFHLENBQUMsS0FBSyxDQUFDLDRDQUE0QyxFQUFFLEdBQUcsQ0FBQyxDQUFBO1FBQzVELE9BQU8sS0FBSyxDQUFBO0lBQ2hCLENBQUM7QUFDTCxDQUFDLENBQUE7QUFDRCxNQUFNLENBQUMsTUFBTSxZQUFZLEdBQUcsQ0FBQyxLQUFlLEVBQUUsRUFBRSxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQSJ9
|
||||
9
packages/commons/dist/lib/scheme.d.ts
vendored
Normal file
9
packages/commons/dist/lib/scheme.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export type ParsedURL = {
|
||||
scheme: string;
|
||||
host?: string;
|
||||
path?: string;
|
||||
query?: Record<string, string>;
|
||||
fragment?: string;
|
||||
};
|
||||
export declare const escapeFirstUrlSegment: (url: string) => string;
|
||||
export declare const parseURL: (url: string) => ParsedURL | null;
|
||||
45
packages/commons/dist/lib/scheme.js
vendored
Normal file
45
packages/commons/dist/lib/scheme.js
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
export const escapeFirstUrlSegment = (url) => {
|
||||
const schemeEndIndex = url.indexOf('://') + 3;
|
||||
const restOfUrl = url.slice(schemeEndIndex);
|
||||
const questionMarkIndex = restOfUrl.indexOf('?');
|
||||
if (questionMarkIndex !== -1) {
|
||||
const firstSegment = restOfUrl.slice(0, questionMarkIndex);
|
||||
const escapedFirstSegment = encodeURIComponent(firstSegment);
|
||||
return url.slice(0, schemeEndIndex) + escapedFirstSegment + restOfUrl.slice(questionMarkIndex);
|
||||
}
|
||||
else {
|
||||
const escapedFirstSegment = encodeURIComponent(restOfUrl);
|
||||
return url.slice(0, schemeEndIndex) + escapedFirstSegment;
|
||||
}
|
||||
};
|
||||
export const parseURL = (url) => {
|
||||
const trimmedUrl = escapeFirstUrlSegment(url.trim());
|
||||
//const urlPattern = /^([a-zA-Z][a-zA-Z\d+.-]*):\/\/([^\/\s?#]*)([^\s?#]*)?(\?[^#\s]*)?(#[^\s]*)?$/;
|
||||
const urlPattern = /([a-zA-Z]{2,20}):\/\/([\w_-]+(?:(?:\.[\w_-]+)?))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/igm;
|
||||
const match = trimmedUrl.match(urlPattern);
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
// Destructure the match groups
|
||||
const [, scheme, host, path, queryString, fragment] = match;
|
||||
// Parse query string if present
|
||||
const query = {};
|
||||
if (queryString) {
|
||||
queryString
|
||||
.substring(1)
|
||||
.split("&")
|
||||
.forEach((param) => {
|
||||
const [key, value] = param.split("=");
|
||||
query[decodeURIComponent(key)] = value ? decodeURIComponent(value) : "";
|
||||
});
|
||||
}
|
||||
// Return the parsed URL as an object
|
||||
return {
|
||||
scheme,
|
||||
host: host || undefined,
|
||||
path: path || undefined,
|
||||
query: Object.keys(query).length > 0 ? query : undefined,
|
||||
fragment: fragment ? fragment.substring(1) : undefined,
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xpYi9zY2hlbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBT0EsTUFBTSxDQUFDLE1BQU0scUJBQXFCLEdBQUcsQ0FBQyxHQUFXLEVBQVUsRUFBRTtJQUN6RCxNQUFNLGNBQWMsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUM5QyxNQUFNLFNBQVMsR0FBRyxHQUFHLENBQUMsS0FBSyxDQUFDLGNBQWMsQ0FBQyxDQUFDO0lBQzVDLE1BQU0saUJBQWlCLEdBQUcsU0FBUyxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztJQU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{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src/lib/strings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,0mVAA0mV,CAAC;AAExoV,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,ouYAAouY,EAAE,GAAG,CAAC,CAAA;AAEnxY,wBAAwB;AACxB,MAAM,CAAC,MAAM,cAAc,GAAG,62WAA62W,CAAC;AAE54W,MAAM,cAAc,GAAG,mYAAmY,CAAA"}
|
||||
11
packages/commons/dist/lib/types-each.d.ts
vendored
Normal file
11
packages/commons/dist/lib/types-each.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export interface each {
|
||||
logLevel?: string;
|
||||
main: string;
|
||||
log?: string | undefined;
|
||||
list: string;
|
||||
/** the current working directory to use, otherwise . is being assumed */
|
||||
cwd: string;
|
||||
trace?: boolean;
|
||||
env?: string;
|
||||
profile?: string;
|
||||
}
|
||||
2
packages/commons/dist/lib/types-each.js
vendored
Normal file
2
packages/commons/dist/lib/types-each.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMtZWFjaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvdHlwZXMtZWFjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
||||
12
packages/commons/dist/lib/types.d.ts
vendored
Normal file
12
packages/commons/dist/lib/types.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
export interface IOptionsEach {
|
||||
logLevel?: string;
|
||||
main: string;
|
||||
log?: string | undefined;
|
||||
list: string;
|
||||
root: string;
|
||||
/** the current working directory to use, otherwise . is being assumed */
|
||||
cwd: string;
|
||||
trace?: boolean;
|
||||
env?: string;
|
||||
profile?: string;
|
||||
}
|
||||
2
packages/commons/dist/lib/types.js
vendored
Normal file
2
packages/commons/dist/lib/types.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
||||
47
packages/commons/dist/logger.cjs
vendored
47
packages/commons/dist/logger.cjs
vendored
@ -1,47 +0,0 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var logger_exports = {};
|
||||
__export(logger_exports, {
|
||||
MODULE_NAME: () => import_constants2.MODULE_NAME,
|
||||
createLogger: () => createLogger,
|
||||
defaultLogger: () => defaultLogger,
|
||||
logger: () => logger
|
||||
});
|
||||
module.exports = __toCommonJS(logger_exports);
|
||||
var import_tslog = require("tslog");
|
||||
var import_constants = require("./constants.js");
|
||||
var import_constants2 = require("./constants.js");
|
||||
function createLogger(name, options) {
|
||||
return new import_tslog.Logger({
|
||||
name,
|
||||
type: "pretty",
|
||||
...options
|
||||
});
|
||||
}
|
||||
const defaultLogger = createLogger("DefaultLogger", {
|
||||
minLevel: 1
|
||||
});
|
||||
const logger = createLogger(import_constants.MODULE_NAME, {});
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
MODULE_NAME,
|
||||
createLogger,
|
||||
defaultLogger,
|
||||
logger
|
||||
});
|
||||
//# sourceMappingURL=logger.cjs.map
|
||||
1
packages/commons/dist/logger.cjs.map
vendored
1
packages/commons/dist/logger.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/logger.ts"],"sourcesContent":["import { ISettingsParam, Logger } from \"tslog\"\r\n\r\nexport function createLogger(name: string, options?: any) {\r\n return new Logger({\r\n name,\r\n type: 'pretty',\r\n ...options,\r\n })\r\n}\r\nexport const defaultLogger = createLogger('DefaultLogger', {\r\n minLevel: 1\r\n})\r\n\r\nimport { MODULE_NAME } from './constants.js'\r\nexport { MODULE_NAME } from './constants.js'\r\n\r\nexport const logger = createLogger(MODULE_NAME, {})\r\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwC;AAaxC,uBAA4B;AAC5B,IAAAA,oBAA4B;AAZrB,SAAS,aAAa,MAAc,SAAe;AACtD,SAAO,IAAI,oBAAO;AAAA,IACd;AAAA,IACA,MAAM;AAAA,IACN,GAAG;AAAA,EACP,CAAC;AACL;AACO,MAAM,gBAAgB,aAAa,iBAAiB;AAAA,EACvD,UAAU;AACd,CAAC;AAKM,MAAM,SAAS,aAAa,8BAAa,CAAC,CAAC;","names":["import_constants"]}
|
||||
9
packages/commons/dist/logger.d.cts
vendored
9
packages/commons/dist/logger.d.cts
vendored
@ -1,9 +0,0 @@
|
||||
import { Logger } from 'tslog';
|
||||
export { MODULE_NAME } from './constants.cjs';
|
||||
|
||||
declare function createLogger(name: string, options?: any): Logger;
|
||||
declare const defaultLogger: Logger;
|
||||
|
||||
declare const logger: Logger;
|
||||
|
||||
export { createLogger, defaultLogger, logger };
|
||||
2
packages/commons/dist/logger.js
vendored
2
packages/commons/dist/logger.js
vendored
@ -12,4 +12,4 @@ export const defaultLogger = createLogger('DefaultLogger', {
|
||||
import { MODULE_NAME } from './constants.js';
|
||||
export { MODULE_NAME } from './constants.js';
|
||||
export const logger = createLogger(MODULE_NAME, {});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUcsTUFBTSxFQUFFLE1BQU0sT0FBTyxDQUFBO0FBRS9CLE1BQU0sVUFBVSxZQUFZLENBQUMsSUFBWSxFQUFFLE9BQWE7SUFDcEQsT0FBTyxJQUFJLE1BQU0sQ0FBQztRQUNkLElBQUk7UUFDSixJQUFJLEVBQUUsUUFBUTtRQUNkLEdBQUcsT0FBTztLQUNiLENBQUMsQ0FBQTtBQUNOLENBQUM7QUFDRCxNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsWUFBWSxDQUFDLGVBQWUsRUFBRTtJQUN2RCxRQUFRLEVBQUUsQ0FBQztDQUNkLENBQUMsQ0FBQTtBQUVGLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQTtBQUM1QyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFFNUMsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLFlBQVksQ0FBQyxXQUFXLEVBQUUsRUFBRSxDQUFDLENBQUEifQ==
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sT0FBTyxDQUFBO0FBRTlCLE1BQU0sVUFBVSxZQUFZLENBQUMsSUFBWSxFQUFFLE9BQWE7SUFDcEQsT0FBTyxJQUFJLE1BQU0sQ0FBQztRQUNkLElBQUk7UUFDSixJQUFJLEVBQUUsUUFBUTtRQUNkLEdBQUcsT0FBTztLQUNiLENBQUMsQ0FBQTtBQUNOLENBQUM7QUFDRCxNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsWUFBWSxDQUFDLGVBQWUsRUFBRTtJQUN2RCxRQUFRLEVBQUUsQ0FBQztDQUNkLENBQUMsQ0FBQTtBQUVGLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQTtBQUM1QyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFFNUMsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLFlBQVksQ0FBQyxXQUFXLEVBQUUsRUFBRSxDQUFDLENBQUEifQ==
|
||||
1
packages/commons/dist/logger.js.map
vendored
1
packages/commons/dist/logger.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/logger.ts"],"sourcesContent":["import { ISettingsParam, Logger } from \"tslog\"\r\n\r\nexport function createLogger(name: string, options?: any) {\r\n return new Logger({\r\n name,\r\n type: 'pretty',\r\n ...options,\r\n })\r\n}\r\nexport const defaultLogger = createLogger('DefaultLogger', {\r\n minLevel: 1\r\n})\r\n\r\nimport { MODULE_NAME } from './constants.js'\r\nexport { MODULE_NAME } from './constants.js'\r\n\r\nexport const logger = createLogger(MODULE_NAME, {})\r\n"],"mappings":"AAAA,SAA0B,cAAc;AAEjC,SAAS,aAAa,MAAc,SAAe;AACtD,SAAO,IAAI,OAAO;AAAA,IACd;AAAA,IACA,MAAM;AAAA,IACN,GAAG;AAAA,EACP,CAAC;AACL;AACO,MAAM,gBAAgB,aAAa,iBAAiB;AAAA,EACvD,UAAU;AACd,CAAC;AAED,SAAS,mBAAmB;AAC5B,SAAS,eAAAA,oBAAmB;AAErB,MAAM,SAAS,aAAa,aAAa,CAAC,CAAC;","names":["MODULE_NAME"]}
|
||||
43
packages/commons/dist/os.cjs
vendored
43
packages/commons/dist/os.cjs
vendored
@ -1,43 +0,0 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var os_exports = {};
|
||||
__export(os_exports, {
|
||||
EArch: () => EArch,
|
||||
EPlatform: () => EPlatform,
|
||||
is_windows: () => is_windows
|
||||
});
|
||||
module.exports = __toCommonJS(os_exports);
|
||||
var EPlatform = /* @__PURE__ */ ((EPlatform2) => {
|
||||
EPlatform2["Linux"] = "linux";
|
||||
EPlatform2["Windows"] = "win32";
|
||||
EPlatform2["OSX"] = "darwin";
|
||||
return EPlatform2;
|
||||
})(EPlatform || {});
|
||||
var EArch = /* @__PURE__ */ ((EArch2) => {
|
||||
EArch2["x64"] = "64";
|
||||
EArch2["x32"] = "32";
|
||||
return EArch2;
|
||||
})(EArch || {});
|
||||
const is_windows = () => process && process.platform === "win32";
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
EArch,
|
||||
EPlatform,
|
||||
is_windows
|
||||
});
|
||||
//# sourceMappingURL=os.cjs.map
|
||||
1
packages/commons/dist/os.cjs.map
vendored
1
packages/commons/dist/os.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/os.ts"],"sourcesContent":["export enum EPlatform {\r\n\tLinux = 'linux',\r\n\tWindows = 'win32',\r\n\tOSX = 'darwin'\r\n}\r\nexport enum EArch {\r\n\tx64 = '64',\r\n\tx32 = '32'\r\n}\r\nexport const is_windows = () => process && (process.platform === 'win32')\r\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,YAAL,kBAAKA,eAAL;AACN,EAAAA,WAAA,WAAQ;AACR,EAAAA,WAAA,aAAU;AACV,EAAAA,WAAA,SAAM;AAHK,SAAAA;AAAA,GAAA;AAKL,IAAK,QAAL,kBAAKC,WAAL;AACN,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,SAAM;AAFK,SAAAA;AAAA,GAAA;AAIL,MAAM,aAAa,MAAM,WAAY,QAAQ,aAAa;","names":["EPlatform","EArch"]}
|
||||
12
packages/commons/dist/os.d.cts
vendored
12
packages/commons/dist/os.d.cts
vendored
@ -1,12 +0,0 @@
|
||||
declare enum EPlatform {
|
||||
Linux = "linux",
|
||||
Windows = "win32",
|
||||
OSX = "darwin"
|
||||
}
|
||||
declare enum EArch {
|
||||
x64 = "64",
|
||||
x32 = "32"
|
||||
}
|
||||
declare const is_windows: () => boolean;
|
||||
|
||||
export { EArch, EPlatform, is_windows };
|
||||
1
packages/commons/dist/os.js.map
vendored
1
packages/commons/dist/os.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["../src/os.ts"],"sourcesContent":["export enum EPlatform {\r\n\tLinux = 'linux',\r\n\tWindows = 'win32',\r\n\tOSX = 'darwin'\r\n}\r\nexport enum EArch {\r\n\tx64 = '64',\r\n\tx32 = '32'\r\n}\r\nexport const is_windows = () => process && (process.platform === 'win32')\r\n"],"mappings":"AAAO,IAAK,YAAL,kBAAKA,eAAL;AACN,EAAAA,WAAA,WAAQ;AACR,EAAAA,WAAA,aAAU;AACV,EAAAA,WAAA,SAAM;AAHK,SAAAA;AAAA,GAAA;AAKL,IAAK,QAAL,kBAAKC,WAAL;AACN,EAAAA,OAAA,SAAM;AACN,EAAAA,OAAA,SAAM;AAFK,SAAAA;AAAA,GAAA;AAIL,MAAM,aAAa,MAAM,WAAY,QAAQ,aAAa;","names":["EPlatform","EArch"]}
|
||||
56
packages/commons/dist/osr/component.d.ts
vendored
56
packages/commons/dist/osr/component.d.ts
vendored
@ -1,56 +0,0 @@
|
||||
import { IDiscourseUploadImage } from './discourse.js';
|
||||
export interface IDiscourseItemCommons {
|
||||
forum?: string | boolean;
|
||||
forumTitle?: string;
|
||||
forumCategory?: number;
|
||||
forumTags?: string | string[];
|
||||
forumPostId?: number;
|
||||
forumTopicId?: number;
|
||||
forumUserId?: number;
|
||||
forumUserName?: string;
|
||||
forumPostHash?: string;
|
||||
forumUploads?: Record<string, IDiscourseUploadImage>;
|
||||
}
|
||||
export interface IComponentConfig extends IDiscourseItemCommons {
|
||||
cart_id?: string;
|
||||
code: string;
|
||||
price?: number;
|
||||
cscartCats?: number[];
|
||||
cscartId?: number;
|
||||
vendorId?: number;
|
||||
version?: string;
|
||||
status?: string;
|
||||
authors: IAuthor[];
|
||||
replaced_by?: string;
|
||||
alternatives?: string[];
|
||||
flags?: number;
|
||||
howto_categories?: string | string[];
|
||||
sourceLanguage?: string;
|
||||
last_sync_ts?: number;
|
||||
download?: boolean;
|
||||
edrawings?: string;
|
||||
name: string;
|
||||
showDimensions?: boolean;
|
||||
showParts?: boolean;
|
||||
slug: string;
|
||||
score?: number;
|
||||
Preview3d?: boolean;
|
||||
keywords?: string;
|
||||
meta_keywords?: string;
|
||||
steps?: any;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
category: string;
|
||||
product_dimensions?: string;
|
||||
production?: IProduction;
|
||||
}
|
||||
export interface IAuthor {
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
export interface IProduction {
|
||||
"fusion-folder": string;
|
||||
"nc-folder": string;
|
||||
cam: IAuthor[];
|
||||
}
|
||||
2
packages/commons/dist/osr/component.js
vendored
2
packages/commons/dist/osr/component.js
vendored
@ -1,2 +0,0 @@
|
||||
export {};
|
||||
//# sourceMappingURL=component.js.map
|
||||
1
packages/commons/dist/osr/component.js.map
vendored
1
packages/commons/dist/osr/component.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/osr/component.ts"],"names":[],"mappings":""}
|
||||
15
packages/commons/dist/osr/discourse.d.ts
vendored
15
packages/commons/dist/osr/discourse.d.ts
vendored
@ -1,15 +0,0 @@
|
||||
export interface IDiscourseUploadImage {
|
||||
id: number;
|
||||
url: string;
|
||||
original_filename: string;
|
||||
filesize: number;
|
||||
width: number;
|
||||
height: number;
|
||||
thumbnail_width: number;
|
||||
thumbnail_height: number;
|
||||
extension: string;
|
||||
short_url: string;
|
||||
short_path: string;
|
||||
retain_hours: any;
|
||||
human_filesize: string;
|
||||
}
|
||||
2
packages/commons/dist/osr/discourse.js
vendored
2
packages/commons/dist/osr/discourse.js
vendored
@ -1,2 +0,0 @@
|
||||
export {};
|
||||
//# sourceMappingURL=discourse.js.map
|
||||
1
packages/commons/dist/osr/discourse.js.map
vendored
1
packages/commons/dist/osr/discourse.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"discourse.js","sourceRoot":"","sources":["../../src/osr/discourse.ts"],"names":[],"mappings":""}
|
||||
1
packages/commons/dist/paths.cjs
vendored
1
packages/commons/dist/paths.cjs
vendored
@ -1 +0,0 @@
|
||||
//# sourceMappingURL=paths.cjs.map
|
||||
1
packages/commons/dist/paths.cjs.map
vendored
1
packages/commons/dist/paths.cjs.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
||||
2
packages/commons/dist/paths.d.cts
vendored
2
packages/commons/dist/paths.d.cts
vendored
@ -1,2 +0,0 @@
|
||||
|
||||
export { }
|
||||
1
packages/commons/dist/paths.js.map
vendored
1
packages/commons/dist/paths.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
||||
112
packages/commons/dist/profile.cjs
vendored
112
packages/commons/dist/profile.cjs
vendored
@ -1,112 +0,0 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var profile_exports = {};
|
||||
__export(profile_exports, {
|
||||
parse: () => parse,
|
||||
resolveConfig: () => resolveConfig
|
||||
});
|
||||
module.exports = __toCommonJS(profile_exports);
|
||||
var path = __toESM(require("path"), 1);
|
||||
var import_constants = require("@polymech/core/constants");
|
||||
var import_read = require("@polymech/fs/read");
|
||||
var import_exists = require("@polymech/fs/exists");
|
||||
var import_types = require("@polymech/core/types");
|
||||
var import_variables = require("./variables.js");
|
||||
const _resolve = (config) => {
|
||||
for (const key in config) {
|
||||
if (config[key] && typeof config[key] == "string") {
|
||||
const resolved = (0, import_variables.substitute)(false, config[key], config);
|
||||
config[key] = resolved;
|
||||
}
|
||||
}
|
||||
return config;
|
||||
};
|
||||
const resolveConfig = (config) => {
|
||||
config = _resolve(config);
|
||||
config = _resolve(config);
|
||||
return config;
|
||||
};
|
||||
const parse = (profilePath, profile, options = { env: "default" }, rel) => {
|
||||
profilePath = path.resolve((0, import_variables.resolve)(profilePath, false, profile.variables));
|
||||
if (!(0, import_exists.sync)(profilePath)) {
|
||||
return;
|
||||
}
|
||||
const _profile = (0, import_read.sync)(profilePath, "json") || { includes: [], variables: {} };
|
||||
_profile.includes = _profile.includes || [];
|
||||
_profile.variables = _profile.variables || {};
|
||||
if (options.env && _profile.env && _profile.env[options.env] && _profile.env[options.env].includes) {
|
||||
profile.includes = [
|
||||
...profile.includes,
|
||||
..._profile.includes,
|
||||
..._profile.env[options.env].includes
|
||||
];
|
||||
} else {
|
||||
profile.includes = [
|
||||
...profile.includes,
|
||||
..._profile.includes
|
||||
];
|
||||
}
|
||||
if (options.env && _profile.env && _profile.env[options.env] && _profile.env[options.env].variables) {
|
||||
profile.variables = {
|
||||
...profile.variables,
|
||||
..._profile.variables,
|
||||
..._profile.env[options.env].variables
|
||||
};
|
||||
}
|
||||
for (const k in _profile.variables) {
|
||||
if ((0, import_types.isString)(_profile.variables[k])) {
|
||||
_profile.variables[k] = (0, import_variables.substitute)(false, _profile.variables[k], profile.variables);
|
||||
}
|
||||
}
|
||||
profile.variables = { ...profile.variables, ..._profile.variables, ..._profile.env[options.env]?.variables || {} };
|
||||
for (const k in profile.variables) {
|
||||
if ((0, import_types.isString)(profile.variables[k])) {
|
||||
profile.variables[k] = (0, import_variables.substitute)(false, profile.variables[k], profile.variables);
|
||||
}
|
||||
}
|
||||
profile.includes = Array.from(new Set(profile.includes));
|
||||
profile.includes = [
|
||||
...profile.includes.map((i) => {
|
||||
if (!path.isAbsolute(i) && rel && !i.match(import_constants.REGEX_VAR)) {
|
||||
return path.resolve(`${rel}/${i}`);
|
||||
}
|
||||
let ret = (0, import_variables.resolve)(i, false, profile.variables);
|
||||
ret = path.resolve((0, import_variables.substitute)(false, ret, profile.variables));
|
||||
return ret;
|
||||
})
|
||||
];
|
||||
profile.includes = profile.includes.filter((include) => include !== null && include !== "");
|
||||
profile.includes = Array.from(new Set(profile.includes));
|
||||
return profile;
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
parse,
|
||||
resolveConfig
|
||||
});
|
||||
//# sourceMappingURL=profile.cjs.map
|
||||
1
packages/commons/dist/profile.cjs.map
vendored
1
packages/commons/dist/profile.cjs.map
vendored
File diff suppressed because one or more lines are too long
20
packages/commons/dist/profile.d.cts
vendored
20
packages/commons/dist/profile.d.cts
vendored
@ -1,20 +0,0 @@
|
||||
interface EnvVariables {
|
||||
[key: string]: string;
|
||||
}
|
||||
interface EnvConfig {
|
||||
includes: string[];
|
||||
variables: EnvVariables;
|
||||
}
|
||||
interface IProfile {
|
||||
includes: string[];
|
||||
variables: EnvVariables;
|
||||
env?: {
|
||||
[key: string]: EnvConfig;
|
||||
};
|
||||
}
|
||||
declare const resolveConfig: (config: any) => any;
|
||||
declare const parse: (profilePath: string, profile: IProfile, options?: {
|
||||
env: string;
|
||||
}, rel?: string) => IProfile;
|
||||
|
||||
export { type IProfile, parse, resolveConfig };
|
||||
1
packages/commons/dist/profile.js.map
vendored
1
packages/commons/dist/profile.js.map
vendored
File diff suppressed because one or more lines are too long
23
packages/commons/dist/shemas/index.d.ts
vendored
23
packages/commons/dist/shemas/index.d.ts
vendored
@ -1,23 +0,0 @@
|
||||
import * as CLI from 'yargs';
|
||||
import { z, ZodTypeAny, ZodObject } from 'zod';
|
||||
export * from './path.js';
|
||||
export * from './zod_map.js';
|
||||
export declare const generate_interfaces: (schemas: ZodObject<any>[], dst: string) => void;
|
||||
export declare const enumerateHelpStrings: (schema: ZodTypeAny, path: string[], logger: any) => void;
|
||||
export declare const yargsDefaults: (yargs: CLI.Argv) => any;
|
||||
export declare const getInnerSchema: (schema: ZodTypeAny) => ZodTypeAny;
|
||||
export declare const getInnerType: (type: ZodTypeAny) => any;
|
||||
export declare const getDefaultValue: (schema: ZodTypeAny) => any;
|
||||
export declare const getFieldDefaultValue: (schema: ZodTypeAny) => any | undefined;
|
||||
export declare const getDescription: (schema: ZodTypeAny) => string | undefined;
|
||||
export declare const toYargs: (yargs: CLI.Argv, zodSchema: ZodObject<any>, options?: {
|
||||
onKey?: (yargs: CLI.Argv, key: string, options: any) => any;
|
||||
}) => CLI.Argv;
|
||||
export declare const WRITERS: {
|
||||
'.json': (data: any, file: string, name: string, options: {}) => void;
|
||||
};
|
||||
export declare const writer: (file: string) => any;
|
||||
export declare const write: (schemas: ZodObject<any>[], file: string, name: string, options: {}) => void;
|
||||
export declare const combineValidatorsOr: (validators: z.ZodTypeAny[]) => z.ZodEffects<z.ZodString, string, string>;
|
||||
export declare const combineValidatorsOrUsingZod: (validators: z.ZodTypeAny[]) => z.ZodTypeAny;
|
||||
export declare const combineValidatorsOrUsingZod2: (validators: z.ZodTypeAny[]) => z.ZodTypeAny;
|
||||
204
packages/commons/dist/shemas/index.js
vendored
204
packages/commons/dist/shemas/index.js
vendored
File diff suppressed because one or more lines are too long
1
packages/commons/dist/shemas/index.js.map
vendored
1
packages/commons/dist/shemas/index.js.map
vendored
File diff suppressed because one or more lines are too long
1
packages/commons/dist/shemas/openapi.d.ts
vendored
1
packages/commons/dist/shemas/openapi.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
22
packages/commons/dist/shemas/openapi.js
vendored
22
packages/commons/dist/shemas/openapi.js
vendored
@ -1,22 +0,0 @@
|
||||
export {};
|
||||
/*
|
||||
export const openapi = (data: ZodObject<any>[], file: string, name: string, options: {}) => {
|
||||
const registry = new OpenAPIRegistry()
|
||||
data.forEach((s) => registry.register(s.description, s))
|
||||
const generator = new OpenApiGeneratorV3(registry.definitions)
|
||||
const component = generator.generateComponents()
|
||||
// const content = stringifyYAML(component)
|
||||
return component
|
||||
}
|
||||
*/
|
||||
/*
|
||||
const yaml = (data: ZodObject<any>[], file: string, name: string, options: {}) => {
|
||||
const registry = new OpenAPIRegistry()
|
||||
data.forEach((s) => registry.register(s.description, s))
|
||||
const generator = new OpenApiGeneratorV3(registry.definitions)
|
||||
const component = generator.generateComponents()
|
||||
logger.debug(`Writing schema to ${file} : ${name}`,component)
|
||||
writeFS(file,stringifyYAML(component))
|
||||
}
|
||||
*/
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlbmFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaGVtYXMvb3BlbmFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7OztFQVNFO0FBQ0Y7Ozs7Ozs7OztFQVNFIn0=
|
||||
1
packages/commons/dist/shemas/openapi.js.map
vendored
1
packages/commons/dist/shemas/openapi.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"openapi.js","sourceRoot":"","sources":["../../src/shemas/openapi.ts"],"names":[],"mappings":";AAAA;;;;;;;;;EASE;AACF;;;;;;;;;EASE"}
|
||||
30
packages/commons/dist/shemas/path.d.ts
vendored
30
packages/commons/dist/shemas/path.d.ts
vendored
@ -1,30 +0,0 @@
|
||||
import { z, ZodTypeAny } from 'zod';
|
||||
export declare enum E_PATH {
|
||||
ENSURE_PATH_EXISTS = 1,
|
||||
INVALID_INPUT = 2,
|
||||
ENSURE_DIRECTORY_WRITABLE = 3,
|
||||
ENSURE_FILE_IS_JSON = 4,
|
||||
ENSURE_PATH_IS_ABSOLUTE = 5,
|
||||
ENSURE_PATH_IS_RELATIVE = 6,
|
||||
GET_PATH_INFO = 7
|
||||
}
|
||||
export declare const Transformers: Record<string, any>;
|
||||
export declare const TransformersDescription: {
|
||||
description: string;
|
||||
fn: any;
|
||||
}[];
|
||||
export declare const extendSchema: (baseSchema: z.ZodObject<any>, extend: Record<string, any>) => z.ZodObject<Record<string, z.ZodTypeAny>, "strip", z.ZodTypeAny, {
|
||||
[x: string]: any;
|
||||
}, {
|
||||
[x: string]: any;
|
||||
}>;
|
||||
export declare const ENSURE_DIRECTORY_WRITABLE: (inputPath: string, ctx: any, variables: Record<string, string>) => string;
|
||||
export declare const IS_VALID_STRING: (inputPath: string) => boolean;
|
||||
export declare const ENSURE_PATH_EXISTS: (inputPath: string, ctx: any, variables: Record<string, string>) => string;
|
||||
export declare const test: () => z.ZodObject<Record<string, z.ZodTypeAny>, "strip", z.ZodTypeAny, {
|
||||
[x: string]: any;
|
||||
}, {
|
||||
[x: string]: any;
|
||||
}>;
|
||||
export declare const Templates: Record<string, any>;
|
||||
export declare const extend: (baseSchema: ZodTypeAny, template: any, variables?: Record<string, string>) => z.ZodTypeAny;
|
||||
237
packages/commons/dist/shemas/path.js
vendored
237
packages/commons/dist/shemas/path.js
vendored
File diff suppressed because one or more lines are too long
1
packages/commons/dist/shemas/path.js.map
vendored
1
packages/commons/dist/shemas/path.js.map
vendored
File diff suppressed because one or more lines are too long
194
packages/commons/dist/shemas/types.d.ts
vendored
194
packages/commons/dist/shemas/types.d.ts
vendored
@ -1,194 +0,0 @@
|
||||
export declare enum FLAG {
|
||||
/**
|
||||
* Instruct for no additional extra processing
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
NONE = 0,
|
||||
/**
|
||||
* Will instruct the pre/post processor to base-64 decode or encode
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
BASE_64 = 1,
|
||||
/**
|
||||
* Post/Pre process the value with a user function
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
USE_FUNCTION = 2,
|
||||
/**
|
||||
* Replace variables with local scope's variables during the post/pre process
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
REPLACE_VARIABLES = 4,
|
||||
/**
|
||||
* Replace variables with local scope's variables during the post/pre process but evaluate the whole string
|
||||
* as Javascript
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
REPLACE_VARIABLES_EVALUATED = 8,
|
||||
/**
|
||||
* Will instruct the pre/post processor to escpape evaluated or replaced variables or expressions
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
ESCAPE = 16,
|
||||
/**
|
||||
* Will instruct the pre/post processor to replace block calls with oridinary vanilla script
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
REPLACE_BLOCK_CALLS = 32,
|
||||
/**
|
||||
* Will instruct the pre/post processor to remove variable delimitters/placeholders from the final string
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
REMOVE_DELIMTTERS = 64,
|
||||
/**
|
||||
* Will instruct the pre/post processor to remove "[" ,"]" , "(" , ")" , "{", "}" , "*" , "+" , "."
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
ESCAPE_SPECIAL_CHARS = 128,
|
||||
/**
|
||||
* Will instruct the pre/post processor to use regular expressions over string substitution
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
USE_REGEX = 256,
|
||||
/**
|
||||
* Will instruct the pre/post processor to use Filtrex (custom bison parser, needs xexpression) over string substitution
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
USE_FILTREX = 512,
|
||||
/**
|
||||
* Cascade entry. There are cases where #USE_FUNCTION is not enough or we'd like to avoid further type checking.
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
CASCADE = 1024,
|
||||
/**
|
||||
* Cascade entry. There are cases where #USE_FUNCTION is not enough or we'd like to avoid further type checking.
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
EXPRESSION = 2048,
|
||||
/**
|
||||
* Dont parse anything
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
DONT_PARSE = 4096,
|
||||
/**
|
||||
* Convert to hex
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
TO_HEX = 8192,
|
||||
/**
|
||||
* Convert to hex
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
REPLACE_HEX = 16384,
|
||||
/**
|
||||
* Wait for finish
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
WAIT = 32768,
|
||||
/**
|
||||
* Wait for finish
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
DONT_ESCAPE = 65536,
|
||||
/**
|
||||
* Flag to mark the maximum core bit mask, after here its user land
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
END = 131072
|
||||
}
|
||||
export declare enum EType {
|
||||
Number = "Number",
|
||||
String = "String",
|
||||
Boolean = "Boolean",
|
||||
Date = "Date",
|
||||
TimeStamp = "TimeStamp",
|
||||
Duration = "Duration",
|
||||
Url = "Url",
|
||||
UrlScheme = "Url-Scheme",
|
||||
Asset = "Asset",
|
||||
Symbol = "Symbol",
|
||||
Value = "Value",
|
||||
Values = "Values",
|
||||
Attribute = "Attribute",
|
||||
Parameter = "Parameter",
|
||||
Operation = "Operation",
|
||||
ParameterOperation = "ParameterOperation",
|
||||
Template = "Template",
|
||||
Arguments = "Arguments"
|
||||
}
|
||||
export type TVector2D = [number, number];
|
||||
export type TVector3D = [number, number, number];
|
||||
export type TBBox = [TVector3D, TVector3D];
|
||||
export type TQuaternion = [number, number, number, number];
|
||||
export type TFlags = Record<string, bigint>;
|
||||
export type TExpression = string | [string | RegExp, {
|
||||
[key: string]: any;
|
||||
}];
|
||||
export type TOptions = {
|
||||
flags?: TFlags | {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export interface IUrlScheme {
|
||||
url: string;
|
||||
options?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
export interface IAsset {
|
||||
urlScheme: IUrlScheme;
|
||||
options?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
export type TSelector = TExpression | [TExpression, {
|
||||
[key: string]: any;
|
||||
}];
|
||||
export interface ITypeInfo {
|
||||
type: string;
|
||||
symbol: bigint;
|
||||
}
|
||||
export interface IRef {
|
||||
key: string | string;
|
||||
struct: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
export interface IAttribute {
|
||||
type: ITypeInfo;
|
||||
value: bigint;
|
||||
}
|
||||
export interface IParameter {
|
||||
type: ITypeInfo;
|
||||
value: bigint;
|
||||
}
|
||||
export interface IParameterOperation {
|
||||
param1: bigint;
|
||||
param2: bigint;
|
||||
operation: bigint;
|
||||
}
|
||||
export type TTemplate = string | [ITypeInfo | TSelector, {
|
||||
[key: string]: any;
|
||||
}];
|
||||
export type TArguments = {
|
||||
[key: string]: any;
|
||||
} | any[];
|
||||
140
packages/commons/dist/shemas/types.js
vendored
140
packages/commons/dist/shemas/types.js
vendored
@ -1,140 +0,0 @@
|
||||
export var FLAG;
|
||||
(function (FLAG) {
|
||||
/**
|
||||
* Instruct for no additional extra processing
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["NONE"] = 0] = "NONE";
|
||||
/**
|
||||
* Will instruct the pre/post processor to base-64 decode or encode
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["BASE_64"] = 1] = "BASE_64";
|
||||
/**
|
||||
* Post/Pre process the value with a user function
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["USE_FUNCTION"] = 2] = "USE_FUNCTION";
|
||||
/**
|
||||
* Replace variables with local scope's variables during the post/pre process
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["REPLACE_VARIABLES"] = 4] = "REPLACE_VARIABLES";
|
||||
/**
|
||||
* Replace variables with local scope's variables during the post/pre process but evaluate the whole string
|
||||
* as Javascript
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["REPLACE_VARIABLES_EVALUATED"] = 8] = "REPLACE_VARIABLES_EVALUATED";
|
||||
/**
|
||||
* Will instruct the pre/post processor to escpape evaluated or replaced variables or expressions
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["ESCAPE"] = 16] = "ESCAPE";
|
||||
/**
|
||||
* Will instruct the pre/post processor to replace block calls with oridinary vanilla script
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["REPLACE_BLOCK_CALLS"] = 32] = "REPLACE_BLOCK_CALLS";
|
||||
/**
|
||||
* Will instruct the pre/post processor to remove variable delimitters/placeholders from the final string
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["REMOVE_DELIMTTERS"] = 64] = "REMOVE_DELIMTTERS";
|
||||
/**
|
||||
* Will instruct the pre/post processor to remove "[" ,"]" , "(" , ")" , "{", "}" , "*" , "+" , "."
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["ESCAPE_SPECIAL_CHARS"] = 128] = "ESCAPE_SPECIAL_CHARS";
|
||||
/**
|
||||
* Will instruct the pre/post processor to use regular expressions over string substitution
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["USE_REGEX"] = 256] = "USE_REGEX";
|
||||
/**
|
||||
* Will instruct the pre/post processor to use Filtrex (custom bison parser, needs xexpression) over string substitution
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["USE_FILTREX"] = 512] = "USE_FILTREX";
|
||||
/**
|
||||
* Cascade entry. There are cases where #USE_FUNCTION is not enough or we'd like to avoid further type checking.
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["CASCADE"] = 1024] = "CASCADE";
|
||||
/**
|
||||
* Cascade entry. There are cases where #USE_FUNCTION is not enough or we'd like to avoid further type checking.
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["EXPRESSION"] = 2048] = "EXPRESSION";
|
||||
/**
|
||||
* Dont parse anything
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["DONT_PARSE"] = 4096] = "DONT_PARSE";
|
||||
/**
|
||||
* Convert to hex
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["TO_HEX"] = 8192] = "TO_HEX";
|
||||
/**
|
||||
* Convert to hex
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["REPLACE_HEX"] = 16384] = "REPLACE_HEX";
|
||||
/**
|
||||
* Wait for finish
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["WAIT"] = 32768] = "WAIT";
|
||||
/**
|
||||
* Wait for finish
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["DONT_ESCAPE"] = 65536] = "DONT_ESCAPE";
|
||||
/**
|
||||
* Flag to mark the maximum core bit mask, after here its user land
|
||||
* @constant
|
||||
* @type int
|
||||
*/
|
||||
FLAG[FLAG["END"] = 131072] = "END";
|
||||
})(FLAG || (FLAG = {}));
|
||||
export var EType;
|
||||
(function (EType) {
|
||||
EType["Number"] = "Number";
|
||||
EType["String"] = "String";
|
||||
EType["Boolean"] = "Boolean";
|
||||
EType["Date"] = "Date";
|
||||
EType["TimeStamp"] = "TimeStamp";
|
||||
EType["Duration"] = "Duration";
|
||||
EType["Url"] = "Url";
|
||||
EType["UrlScheme"] = "Url-Scheme";
|
||||
EType["Asset"] = "Asset";
|
||||
EType["Symbol"] = "Symbol";
|
||||
EType["Value"] = "Value";
|
||||
EType["Values"] = "Values";
|
||||
EType["Attribute"] = "Attribute";
|
||||
EType["Parameter"] = "Parameter";
|
||||
EType["Operation"] = "Operation";
|
||||
EType["ParameterOperation"] = "ParameterOperation";
|
||||
EType["Template"] = "Template";
|
||||
EType["Arguments"] = "Arguments";
|
||||
})(EType || (EType = {}));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2hlbWFzL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBTixJQUFZLElBb0hYO0FBcEhELFdBQVksSUFBSTtJQUNmOzs7O09BSUc7SUFDSCwrQkFBaUIsQ0FBQTtJQUNqQjs7OztPQUlHO0lBQ0gscUNBQW9CLENBQUE7SUFDcEI7Ozs7T0FJRztJQUNILCtDQUF5QixDQUFBO0lBQ3pCOzs7O09BSUc7SUFDSCx5REFBOEIsQ0FBQTtJQUM5Qjs7Ozs7T0FLRztJQUNILDZFQUF3QyxDQUFBO0lBQ3hDOzs7O09BSUc7SUFDSCxvQ0FBbUIsQ0FBQTtJQUNuQjs7OztPQUlHO0lBQ0gsOERBQWdDLENBQUE7SUFDaEM7Ozs7T0FJRztJQUNILDBEQUE4QixDQUFBO0lBQzlCOzs7O09BSUc7SUFDSCxpRUFBaUMsQ0FBQTtJQUNqQzs7OztPQUlHO0lBQ0gsMkNBQXNCLENBQUE7SUFDdEI7Ozs7T0FJRztJQUNILCtDQUF3QixDQUFBO0lBQ3hCOzs7O09BSUc7SUFDSCx3Q0FBb0IsQ0FBQTtJQUNwQjs7OztPQUlHO0lBQ0gsOENBQXVCLENBQUE7SUFDdkI7Ozs7T0FJRztJQUNILDhDQUF3QixDQUFBO0lBQ3hCOzs7O09BSUc7SUFDSCxzQ0FBb0IsQ0FBQTtJQUNwQjs7OztPQUlHO0lBQ0gsaURBQXlCLENBQUE7SUFDekI7Ozs7T0FJRztJQUNILG1DQUFrQixDQUFBO0lBQ2xCOzs7O09BSUc7SUFDSCxpREFBeUIsQ0FBQTtJQUN6Qjs7OztPQUlHO0lBQ0gsa0NBQWlCLENBQUE7QUFDbEIsQ0FBQyxFQXBIVyxJQUFJLEtBQUosSUFBSSxRQW9IZjtBQUVELE1BQU0sQ0FBTixJQUFZLEtBb0JYO0FBcEJELFdBQVksS0FBSztJQUViLDBCQUFpQixDQUFBO0lBQ2pCLDBCQUFpQixDQUFBO0lBQ2pCLDRCQUFtQixDQUFBO0lBQ25CLHNCQUFhLENBQUE7SUFDYixnQ0FBdUIsQ0FBQTtJQUN2Qiw4QkFBcUIsQ0FBQTtJQUNyQixvQkFBVyxDQUFBO0lBQ1gsaUNBQXdCLENBQUE7SUFDeEIsd0JBQWUsQ0FBQTtJQUNmLDBCQUFpQixDQUFBO0lBQ2pCLHdCQUFlLENBQUE7SUFDZiwwQkFBaUIsQ0FBQTtJQUNqQixnQ0FBdUIsQ0FBQTtJQUN2QixnQ0FBdUIsQ0FBQTtJQUN2QixnQ0FBdUIsQ0FBQTtJQUN2QixrREFBeUMsQ0FBQTtJQUN6Qyw4QkFBcUIsQ0FBQTtJQUNyQixnQ0FBdUIsQ0FBQTtBQUMzQixDQUFDLEVBcEJXLEtBQUssS0FBTCxLQUFLLFFBb0JoQiJ9
|
||||
1
packages/commons/dist/shemas/types.js.map
vendored
1
packages/commons/dist/shemas/types.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/shemas/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,IAoHX;AApHD,WAAY,IAAI;IACf;;;;OAIG;IACH,+BAAiB,CAAA;IACjB;;;;OAIG;IACH,qCAAoB,CAAA;IACpB;;;;OAIG;IACH,+CAAyB,CAAA;IACzB;;;;OAIG;IACH,yDAA8B,CAAA;IAC9B;;;;;OAKG;IACH,6EAAwC,CAAA;IACxC;;;;OAIG;IACH,oCAAmB,CAAA;IACnB;;;;OAIG;IACH,8DAAgC,CAAA;IAChC;;;;OAIG;IACH,0DAA8B,CAAA;IAC9B;;;;OAIG;IACH,iEAAiC,CAAA;IACjC;;;;OAIG;IACH,2CAAsB,CAAA;IACtB;;;;OAIG;IACH,+CAAwB,CAAA;IACxB;;;;OAIG;IACH,wCAAoB,CAAA;IACpB;;;;OAIG;IACH,8CAAuB,CAAA;IACvB;;;;OAIG;IACH,8CAAwB,CAAA;IACxB;;;;OAIG;IACH,sCAAoB,CAAA;IACpB;;;;OAIG;IACH,iDAAyB,CAAA;IACzB;;;;OAIG;IACH,mCAAkB,CAAA;IAClB;;;;OAIG;IACH,iDAAyB,CAAA;IACzB;;;;OAIG;IACH,kCAAiB,CAAA;AAClB,CAAC,EApHW,IAAI,GAAJ,IAAI,KAAJ,IAAI,QAoHf;AAED,MAAM,CAAN,IAAY,KAoBX;AApBD,WAAY,KAAK;IAEb,0BAAiB,CAAA;IACjB,0BAAiB,CAAA;IACjB,4BAAmB,CAAA;IACnB,sBAAa,CAAA;IACb,gCAAuB,CAAA;IACvB,8BAAqB,CAAA;IACrB,oBAAW,CAAA;IACX,iCAAwB,CAAA;IACxB,wBAAe,CAAA;IACf,0BAAiB,CAAA;IACjB,wBAAe,CAAA;IACf,0BAAiB,CAAA;IACjB,gCAAuB,CAAA;IACvB,gCAAuB,CAAA;IACvB,gCAAuB,CAAA;IACvB,kDAAyC,CAAA;IACzC,8BAAqB,CAAA;IACrB,gCAAuB,CAAA;AAC3B,CAAC,EApBW,KAAK,GAAL,KAAK,KAAL,KAAK,QAoBhB"}
|
||||
1
packages/commons/dist/shemas/vfs.d.ts
vendored
1
packages/commons/dist/shemas/vfs.d.ts
vendored
@ -1 +0,0 @@
|
||||
export {};
|
||||
3
packages/commons/dist/shemas/vfs.js
vendored
3
packages/commons/dist/shemas/vfs.js
vendored
@ -1,3 +0,0 @@
|
||||
export {};
|
||||
//import { zodToJsonSchema } from "zod-to-json-schema"
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmZzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoZW1hcy92ZnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHNEQUFzRCJ9
|
||||
1
packages/commons/dist/shemas/vfs.js.map
vendored
1
packages/commons/dist/shemas/vfs.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"vfs.js","sourceRoot":"","sources":["../../src/shemas/vfs.ts"],"names":[],"mappings":";AAAA,sDAAsD"}
|
||||
46
packages/commons/dist/shemas/zod_map.d.ts
vendored
46
packages/commons/dist/shemas/zod_map.d.ts
vendored
@ -1,46 +0,0 @@
|
||||
import { ZodObject, ZodTypeAny } from 'zod';
|
||||
/**
|
||||
* Manages a collection of Zod schema properties
|
||||
* and combines them into a single Zod object schema.
|
||||
*
|
||||
* @template MetaType The type of metadata you want to store for each field.
|
||||
* Defaults to Record<string, unknown> if not provided.
|
||||
*/
|
||||
export declare class ZodMetaMap<MetaType = Record<string, unknown>> {
|
||||
private fieldMap;
|
||||
/**
|
||||
* Adds a Zod schema under a specific key (property name),
|
||||
* optionally attaching typed metadata.
|
||||
*
|
||||
* @param key - The name of the property in the root object.
|
||||
* @param schema - The Zod schema for that property.
|
||||
* @param metadata - Optional metadata object (type MetaType).
|
||||
*/
|
||||
add<T extends ZodTypeAny>(key: string, schema: T, metadata?: MetaType): this;
|
||||
/**
|
||||
* Builds and returns a root Zod object
|
||||
* that combines all properties which were added.
|
||||
*/
|
||||
root(): ZodObject<Record<string, ZodTypeAny>>;
|
||||
/**
|
||||
* Retrieves the metadata for a specific key, if any.
|
||||
*/
|
||||
getMetadata(key: string): MetaType | undefined;
|
||||
/**
|
||||
* Static factory method: creates a SchemaMetaManager
|
||||
* while letting you optionally specify the MetaType.
|
||||
*
|
||||
* Usage:
|
||||
* const manager = SchemaMetaManager.create<MyFieldMeta>();
|
||||
*/
|
||||
static create<MT = Record<string, unknown>>(): ZodMetaMap<MT>;
|
||||
/**
|
||||
* Returns a basic UiSchema object that RJSF can use to render form controls.
|
||||
*
|
||||
* - Adds a top-level "ui:submitButtonOptions" (example).
|
||||
* - For each field, we set `ui:title` (uppercase key),
|
||||
* `ui:description` (from Zod's .describe() if available),
|
||||
* and a naive placeholder from the default value (if parse(undefined) succeeds).
|
||||
*/
|
||||
getUISchema(): Record<string, unknown>;
|
||||
}
|
||||
99
packages/commons/dist/shemas/zod_map.js
vendored
99
packages/commons/dist/shemas/zod_map.js
vendored
@ -1,99 +0,0 @@
|
||||
import { z } from 'zod';
|
||||
/**
|
||||
* Manages a collection of Zod schema properties
|
||||
* and combines them into a single Zod object schema.
|
||||
*
|
||||
* @template MetaType The type of metadata you want to store for each field.
|
||||
* Defaults to Record<string, unknown> if not provided.
|
||||
*/
|
||||
export class ZodMetaMap {
|
||||
fieldMap = new Map();
|
||||
/**
|
||||
* Adds a Zod schema under a specific key (property name),
|
||||
* optionally attaching typed metadata.
|
||||
*
|
||||
* @param key - The name of the property in the root object.
|
||||
* @param schema - The Zod schema for that property.
|
||||
* @param metadata - Optional metadata object (type MetaType).
|
||||
*/
|
||||
add(key, schema, metadata) {
|
||||
this.fieldMap.set(key, { schema, metadata });
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Builds and returns a root Zod object
|
||||
* that combines all properties which were added.
|
||||
*/
|
||||
root() {
|
||||
const shape = {};
|
||||
for (const [key, { schema }] of this.fieldMap.entries()) {
|
||||
shape[key] = schema;
|
||||
}
|
||||
return z.object(shape);
|
||||
}
|
||||
/**
|
||||
* Retrieves the metadata for a specific key, if any.
|
||||
*/
|
||||
getMetadata(key) {
|
||||
return this.fieldMap.get(key)?.metadata;
|
||||
}
|
||||
/**
|
||||
* Static factory method: creates a SchemaMetaManager
|
||||
* while letting you optionally specify the MetaType.
|
||||
*
|
||||
* Usage:
|
||||
* const manager = SchemaMetaManager.create<MyFieldMeta>();
|
||||
*/
|
||||
static create() {
|
||||
return new ZodMetaMap();
|
||||
}
|
||||
/**
|
||||
* Returns a basic UiSchema object that RJSF can use to render form controls.
|
||||
*
|
||||
* - Adds a top-level "ui:submitButtonOptions" (example).
|
||||
* - For each field, we set `ui:title` (uppercase key),
|
||||
* `ui:description` (from Zod's .describe() if available),
|
||||
* and a naive placeholder from the default value (if parse(undefined) succeeds).
|
||||
*/
|
||||
getUISchema() {
|
||||
// Start with some top-level UI schema config (optional)
|
||||
const uiSchema = {
|
||||
'ui:submitButtonOptions': {
|
||||
props: {
|
||||
disabled: false,
|
||||
className: 'btn btn-info',
|
||||
},
|
||||
norender: false,
|
||||
submitText: 'Submit',
|
||||
},
|
||||
};
|
||||
for (const [key, { schema }] of this.fieldMap.entries()) {
|
||||
let fieldUi = {};
|
||||
// Use the Zod description if available
|
||||
// (Accessing `._def.description` is private/hacky, but commonly done.)
|
||||
const sAny = schema;
|
||||
if (sAny?._def?.description) {
|
||||
fieldUi['ui:description'] = sAny._def.description;
|
||||
}
|
||||
// RJSF usually reads 'title' from JSON schema. But if you want
|
||||
// to override it in UI schema, you can do so:
|
||||
fieldUi['ui:title'] = key[0].toUpperCase() + key.substr(1).toLowerCase();
|
||||
// If the Zod schema allows a default, we can parse(undefined) to get it.
|
||||
try {
|
||||
const defaultVal = schema.parse(undefined);
|
||||
// There's no official 'ui:default' in RJSF, but you could do a placeholder:
|
||||
fieldUi['ui:placeholder'] = defaultVal;
|
||||
}
|
||||
catch {
|
||||
// no default
|
||||
}
|
||||
fieldUi = {
|
||||
...fieldUi,
|
||||
...this.getMetadata(key),
|
||||
};
|
||||
uiSchema[key] = fieldUi;
|
||||
}
|
||||
return uiSchema;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiem9kX21hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaGVtYXMvem9kX21hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsQ0FBQyxFQUF5QixNQUFNLEtBQUssQ0F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O2dCQUNWLEdBQUcsSUFBSSxDQUFDLFdBQVcsQ0FBQyxHQUFHLENBQUM7YUFDM0IsQ0FBQTtZQUNELFFBQVEsQ0FBQyxHQUFHLENBQUMsR0FBRyxPQUFPLENBQUM7UUFDNUIsQ0FBQztRQUNELE9BQU8sUUFBUSxDQUFDO0lBQ3BCLENBQUM7Q0FDSiJ9
|
||||
1
packages/commons/dist/shemas/zod_map.js.map
vendored
1
packages/commons/dist/shemas/zod_map.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"zod_map.js","sourceRoot":"","sources":["../../src/shemas/zod_map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAyB,MAAM,KAAK,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,OAAO,UAAU;IACX,QAAQ,GAAG,IAAI,GAAG,EAGvB,CAAC;IAEJ;;;;;;;OAOG;IACH,GAAG,CAAuB,GAAW,EAAE,MAAS,EAAE,QAAmB;QACjE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,IAAI;QACA,MAAM,KAAK,GAA+B,EAAE,CAAC;QAC7C,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE;YACrD,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;SACvB;QACD,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,MAAM;QACT,OAAO,IAAI,UAAU,EAAM,CAAC;IAChC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too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user