@power-plant/core 0.0.15 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{config-D3-0eTEI.d.cts → config-BpNybJZY.d.cts} +56 -244
- package/dist/config-BpNybJZY.d.cts.map +1 -0
- package/dist/{config-D3-0eTEI.d.mts → config-C9Hp8wTC.d.mts} +58 -246
- package/dist/config-C9Hp8wTC.d.mts.map +1 -0
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/context-BU2q1sN5.d.cts +105 -0
- package/dist/context-BU2q1sN5.d.cts.map +1 -0
- package/dist/context-BUNCX0E-.d.mts +105 -0
- package/dist/context-BUNCX0E-.d.mts.map +1 -0
- package/dist/context.cjs +1 -1
- package/dist/context.d.cts +34 -2
- package/dist/context.d.cts.map +1 -1
- package/dist/context.d.mts +34 -2
- package/dist/context.mjs +1 -1
- package/dist/define.cjs +1 -1
- package/dist/define.d.cts +2 -2
- package/dist/define.d.cts.map +1 -1
- package/dist/define.d.mts +2 -2
- package/dist/define.mjs +1 -1
- package/dist/execute-8tWWCCpu.mjs +2 -0
- package/dist/execute-8tWWCCpu.mjs.map +1 -0
- package/dist/execute-D7rill1C.cjs +1 -0
- package/dist/execute.cjs +1 -0
- package/dist/execute.d.cts +87 -0
- package/dist/execute.d.cts.map +1 -0
- package/dist/execute.d.mts +87 -0
- package/dist/execute.d.mts.map +1 -0
- package/dist/execute.mjs +1 -0
- package/dist/execution-BAm3omij.d.cts +61 -0
- package/dist/execution-BAm3omij.d.cts.map +1 -0
- package/dist/execution-d10Z7Dih.d.mts +61 -0
- package/dist/execution-d10Z7Dih.d.mts.map +1 -0
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/index.d.cts +3 -0
- package/dist/helpers/index.d.mts +3 -0
- package/dist/helpers/index.mjs +1 -0
- package/dist/helpers/meta.cjs +1 -0
- package/dist/helpers/meta.d.cts +2 -0
- package/dist/helpers/meta.d.cts.map +1 -0
- package/dist/helpers/meta.d.mts +77 -0
- package/dist/helpers/meta.d.mts.map +1 -0
- package/dist/helpers/meta.mjs +2 -0
- package/dist/helpers/meta.mjs.map +1 -0
- package/dist/{type-checks-DBObymgE.d.cts → helpers/type-checks.d.cts} +6 -6
- package/dist/helpers/type-checks.d.cts.map +1 -0
- package/dist/{type-checks-DX_sqZhk.d.mts → helpers/type-checks.d.mts} +6 -6
- package/dist/helpers/type-checks.d.mts.map +1 -0
- package/dist/index-DY4xQ_iJ.d.mts +3 -0
- package/dist/index-it9jCi4L.d.cts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +1 -1
- package/dist/meta-CiPl-8rq.d.cts +82 -0
- package/dist/meta-CiPl-8rq.d.cts.map +1 -0
- package/package.json +60 -21
- package/dist/config-D3-0eTEI.d.cts.map +0 -1
- package/dist/config-D3-0eTEI.d.mts.map +0 -1
- package/dist/context-B4h787Dd.d.mts +0 -185
- package/dist/context-B4h787Dd.d.mts.map +0 -1
- package/dist/context-DYvyeLgC.d.cts +0 -185
- package/dist/context-DYvyeLgC.d.cts.map +0 -1
- package/dist/type-checks-DBObymgE.d.cts.map +0 -1
- package/dist/type-checks-DX_sqZhk.d.mts.map +0 -1
- package/dist/type-checks.d.cts +0 -2
- package/dist/type-checks.d.mts +0 -2
- package/dist/types/__internal.cjs +0 -0
- package/dist/types/__internal.d.cts +0 -13
- package/dist/types/__internal.d.cts.map +0 -1
- package/dist/types/__internal.d.mts +0 -13
- package/dist/types/__internal.d.mts.map +0 -1
- package/dist/types/__internal.mjs +0 -1
- /package/dist/{type-checks.cjs → helpers/type-checks.cjs} +0 -0
- /package/dist/{type-checks.mjs → helpers/type-checks.mjs} +0 -0
- /package/dist/{type-checks.mjs.map → helpers/type-checks.mjs.map} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { U as MetaConfig, _ as GeneratorConfig, m as GeneratedDocument, t as UserConfig, z as SchemaMetaConfig } from "./config-BpNybJZY.cjs";
|
|
2
|
+
import { InferLoadOptions, LoadReference } from "@stryke/resolve/types";
|
|
3
|
+
//#region src/types/execution.d.ts
|
|
4
|
+
interface ExecutionMeta<TSpec> extends MetaConfig {
|
|
5
|
+
/**
|
|
6
|
+
* A unique identifier for the execution, typically used by the backend systems.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This value will be in the UUID format, which is a 128-bit number represented as a string of hexadecimal digits. It is used to uniquely identify the execution in the backend systems and can be used for tracking and auditing purposes.
|
|
10
|
+
*/
|
|
11
|
+
executionId: string;
|
|
12
|
+
/**
|
|
13
|
+
* The date and time when the execution was performed.
|
|
14
|
+
*/
|
|
15
|
+
executedAt: Date;
|
|
16
|
+
/**
|
|
17
|
+
* The user who performed the execution.
|
|
18
|
+
*/
|
|
19
|
+
executedBy: string;
|
|
20
|
+
/**
|
|
21
|
+
* The specification used to generate the source code during the execution.
|
|
22
|
+
*/
|
|
23
|
+
spec: TSpec;
|
|
24
|
+
/**
|
|
25
|
+
* The metadata of the schema used to generate the source code during the execution.
|
|
26
|
+
*/
|
|
27
|
+
schema: SchemaMetaConfig<TSpec>;
|
|
28
|
+
/**
|
|
29
|
+
* The metadata of the input used to generate the source code during the execution.
|
|
30
|
+
*/
|
|
31
|
+
input: MetaConfig;
|
|
32
|
+
/**
|
|
33
|
+
* The metadata of the output used to generate the source code during the execution.
|
|
34
|
+
*/
|
|
35
|
+
output: MetaConfig;
|
|
36
|
+
/**
|
|
37
|
+
* The metadata of the generator used to execute the source code during the execution.
|
|
38
|
+
*/
|
|
39
|
+
generator: MetaConfig;
|
|
40
|
+
}
|
|
41
|
+
interface Execution<TSpec> {
|
|
42
|
+
/**
|
|
43
|
+
* The documents of the execution, indexed by the document path.
|
|
44
|
+
*/
|
|
45
|
+
documents: Record<string, GeneratedDocument>;
|
|
46
|
+
/**
|
|
47
|
+
* The metadata of the execution.
|
|
48
|
+
*/
|
|
49
|
+
meta: ExecutionMeta<TSpec>;
|
|
50
|
+
}
|
|
51
|
+
type ExecutionResult<TReturns = void> = GeneratedDocument & {
|
|
52
|
+
/**
|
|
53
|
+
* The returned value of the generator function.
|
|
54
|
+
*/
|
|
55
|
+
returns?: TReturns;
|
|
56
|
+
};
|
|
57
|
+
type InferEngineOptions<TGeneratorConfig extends GeneratorConfig<any, any, any>> = TGeneratorConfig extends LoadReference ? InferLoadOptions<TGeneratorConfig> & UserConfig : UserConfig;
|
|
58
|
+
type ExecuteFunction = <TSpec, TOptions extends object, TReturns = void>(generatorConfig: GeneratorConfig<TSpec, TOptions, TReturns>, options: InferEngineOptions<typeof generatorConfig> & TOptions) => Promise<TReturns>;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { InferEngineOptions as a, ExecutionResult as i, Execution as n, ExecutionMeta as r, ExecuteFunction as t };
|
|
61
|
+
//# sourceMappingURL=execution-BAm3omij.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-BAm3omij.d.cts","names":[],"sources":["../src/types/execution.ts"],"mappings":";;;UAwBiB,cAAc,eAAe;;;;;;;EAO5C;;;;EAKA,YAAY;;;;EAKZ;;;;EAKA,MAAM;;;;EAKN,QAAQ,iBAAiB;;;;EAKzB,OAAO;;;;EAKP,QAAQ;;;;EAKR,WAAW;;UAGI,UAAU;;;;EAIzB,WAAW,eAAe;;;;EAK1B,MAAM,cAAc;;KAGV,gBAAgB,mBAAmB;;;;EAI7C,UAAU;;KAGA,mBACV,yBAAyB,kCACvB,yBAAyB,gBACzB,iBAAiB,oBAAoB,aACrC;KAEQ,mBAAmB,OAAO,yBAAyB,iBAC7D,iBAAiB,gBAAgB,OAAO,UAAU,WAClD,SAAS,0BAA0B,mBAAmB,aACnD,QAAQ"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { U as MetaConfig, _ as GeneratorConfig, m as GeneratedDocument, t as UserConfig, z as SchemaMetaConfig } from "./config-C9Hp8wTC.mjs";
|
|
2
|
+
import { InferLoadOptions, LoadReference } from "@stryke/resolve/types";
|
|
3
|
+
//#region src/types/execution.d.ts
|
|
4
|
+
interface ExecutionMeta<TSpec> extends MetaConfig {
|
|
5
|
+
/**
|
|
6
|
+
* A unique identifier for the execution, typically used by the backend systems.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This value will be in the UUID format, which is a 128-bit number represented as a string of hexadecimal digits. It is used to uniquely identify the execution in the backend systems and can be used for tracking and auditing purposes.
|
|
10
|
+
*/
|
|
11
|
+
executionId: string;
|
|
12
|
+
/**
|
|
13
|
+
* The date and time when the execution was performed.
|
|
14
|
+
*/
|
|
15
|
+
executedAt: Date;
|
|
16
|
+
/**
|
|
17
|
+
* The user who performed the execution.
|
|
18
|
+
*/
|
|
19
|
+
executedBy: string;
|
|
20
|
+
/**
|
|
21
|
+
* The specification used to generate the source code during the execution.
|
|
22
|
+
*/
|
|
23
|
+
spec: TSpec;
|
|
24
|
+
/**
|
|
25
|
+
* The metadata of the schema used to generate the source code during the execution.
|
|
26
|
+
*/
|
|
27
|
+
schema: SchemaMetaConfig<TSpec>;
|
|
28
|
+
/**
|
|
29
|
+
* The metadata of the input used to generate the source code during the execution.
|
|
30
|
+
*/
|
|
31
|
+
input: MetaConfig;
|
|
32
|
+
/**
|
|
33
|
+
* The metadata of the output used to generate the source code during the execution.
|
|
34
|
+
*/
|
|
35
|
+
output: MetaConfig;
|
|
36
|
+
/**
|
|
37
|
+
* The metadata of the generator used to execute the source code during the execution.
|
|
38
|
+
*/
|
|
39
|
+
generator: MetaConfig;
|
|
40
|
+
}
|
|
41
|
+
interface Execution<TSpec> {
|
|
42
|
+
/**
|
|
43
|
+
* The documents of the execution, indexed by the document path.
|
|
44
|
+
*/
|
|
45
|
+
documents: Record<string, GeneratedDocument>;
|
|
46
|
+
/**
|
|
47
|
+
* The metadata of the execution.
|
|
48
|
+
*/
|
|
49
|
+
meta: ExecutionMeta<TSpec>;
|
|
50
|
+
}
|
|
51
|
+
type ExecutionResult<TReturns = void> = GeneratedDocument & {
|
|
52
|
+
/**
|
|
53
|
+
* The returned value of the generator function.
|
|
54
|
+
*/
|
|
55
|
+
returns?: TReturns;
|
|
56
|
+
};
|
|
57
|
+
type InferEngineOptions<TGeneratorConfig extends GeneratorConfig<any, any, any>> = TGeneratorConfig extends LoadReference ? InferLoadOptions<TGeneratorConfig> & UserConfig : UserConfig;
|
|
58
|
+
type ExecuteFunction = <TSpec, TOptions extends object, TReturns = void>(generatorConfig: GeneratorConfig<TSpec, TOptions, TReturns>, options: InferEngineOptions<typeof generatorConfig> & TOptions) => Promise<TReturns>;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { InferEngineOptions as a, ExecutionResult as i, Execution as n, ExecutionMeta as r, ExecuteFunction as t };
|
|
61
|
+
//# sourceMappingURL=execution-d10Z7Dih.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-d10Z7Dih.d.mts","names":[],"sources":["../src/types/execution.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./type-checks.cjs"),t=require("./meta.cjs");exports.formatMetaVersion=t.formatMetaVersion,exports.isGeneratorConfigObject=e.isGeneratorConfigObject,exports.isInputConfigObject=e.isInputConfigObject,exports.isOutputConfigObject=e.isOutputConfigObject,exports.isSchemaConfigObject=e.isSchemaConfigObject,exports.resolveMeta=t.resolveMeta,exports.resolveMetaDescription=t.resolveMetaDescription,exports.resolveMetaExample=t.resolveMetaExample,exports.resolveMetaId=t.resolveMetaId,exports.resolveMetaLinks=t.resolveMetaLinks,exports.resolveMetaName=t.resolveMetaName,exports.resolveMetaTitle=t.resolveMetaTitle,exports.resolveMetaVersion=t.resolveMetaVersion;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as resolveMetaId, c as resolveMetaTitle, i as resolveMetaExample, l as resolveMetaVersion, n as resolveMeta, o as resolveMetaLinks, r as resolveMetaDescription, s as resolveMetaName, t as formatMetaVersion } from "../meta-CiPl-8rq.cjs";
|
|
2
|
+
import { isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject } from "./type-checks.cjs";
|
|
3
|
+
export { formatMetaVersion, isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { formatMetaVersion, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion } from "./meta.mjs";
|
|
2
|
+
import { isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject } from "./type-checks.mjs";
|
|
3
|
+
export { formatMetaVersion, isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isGeneratorConfigObject as e,isInputConfigObject as t,isOutputConfigObject as n,isSchemaConfigObject as r}from"./type-checks.mjs";import{formatMetaVersion as i,resolveMeta as a,resolveMetaDescription as o,resolveMetaExample as s,resolveMetaId as c,resolveMetaLinks as l,resolveMetaName as u,resolveMetaTitle as d,resolveMetaVersion as f}from"./meta.mjs";export{i as formatMetaVersion,e as isGeneratorConfigObject,t as isInputConfigObject,n as isOutputConfigObject,r as isSchemaConfigObject,a as resolveMeta,o as resolveMetaDescription,s as resolveMetaExample,c as resolveMetaId,l as resolveMetaLinks,u as resolveMetaName,d as resolveMetaTitle,f as resolveMetaVersion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@stryke/string-format/title-case"),t=require("@stryke/type-checks/is-set-object"),n=require("@stryke/unique-id/uuid"),r=require("@stryke/type-checks/is-set-string"),i=require("@power-plant/schema"),a=require("@power-plant/schema/codegen"),o=require("@stryke/convert/to-array"),s=require("@stryke/date/format"),c=require("@stryke/date/validate"),l=require("@stryke/helpers/get-unique"),u=require("@stryke/string-format/kebab-case"),d=require("@stryke/type-checks/is-date"),f=require("@stryke/type-checks/is-number");function p(e){return(0,d.isDate)(e)?(0,s.formatYYYYMMDD)(e):(0,f.isNumber)(e)?(0,c.isValidTimestamp)(e)&&e>1e9?(0,s.formatYYYYMMDD)(new Date(e)):e.toString():(0,r.isSetString)(e)?e:`1.0`}function m(e,t,n){return p(n??t?.version??e?.version)}function h(e,t,n){return n??t.name??((0,r.isSetString)(e?.name)?e.name:(0,r.isSetString)(e?.title)?e.title:e.$id?(0,u.kebabCase)(e.$id):(0,a.stringifyType)(e))}function g(e,t){let r=h(e,t),i=m(e,t);return r?`${(0,u.kebabCase)(r)}@${i}`:(0,n.uuid)()}function _(t,n,r){let i=r??n.title??t?.title;return i===void 0?(0,e.titleCase)(n.name??(0,a.stringifyType)(t)):i}function v(e,t,n,i){n.title??=_(t,n);let a=n.title??``,o=e.replaceAll(/\{\s*title\s*\}/g,a),s=i??n.description??t?.description;return(0,r.isSetString)(s)?s:o}function y(e,n,i){return(e=>e.map((e,n)=>(0,r.isSetString)(e)?{name:`example-${n+1}`,description:`Example Specification #${n+1}`,value:e}:(0,t.isSetObject)(e)&&`value`in e&&(0,r.isSetString)(e.value)?{name:`example-${n+1}`,description:e.description||`Example Specification #${n+1}`,value:e.value}:void 0).filter(Boolean))((0,o.toArray)(i??n.examples??e?.examples??[]))}function b(e,t,n){return(0,l.getUnique)((0,o.toArray)(n).concat(t.links??[]).concat(e?.docs??[]))}function x(e,t){let n=(0,i.isSchemaOf)(e)?e:e??{schema:{}},r={};return r.name=h(n.schema,r,t?.name),r.version=m(n?.schema,r,t?.version),r.title=_(n?.schema,r,t?.title),r.links=b(n?.schema,r,t?.links),t?.deprecated&&(r.deprecated=t?.deprecated),t?.usage&&(r.usage=t?.usage),t?.tags&&(r.tags=t?.tags),r}exports.formatMetaVersion=p,exports.resolveMeta=x,exports.resolveMetaDescription=v,exports.resolveMetaExample=y,exports.resolveMetaId=g,exports.resolveMetaLinks=b,exports.resolveMetaName=h,exports.resolveMetaTitle=_,exports.resolveMetaVersion=m;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as resolveMetaId, c as resolveMetaTitle, i as resolveMetaExample, l as resolveMetaVersion, n as resolveMeta, o as resolveMetaLinks, r as resolveMetaDescription, s as resolveMetaName, t as formatMetaVersion } from "../meta-CiPl-8rq.cjs";
|
|
2
|
+
export { formatMetaVersion, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.cts","names":[],"sources":["../../src/helpers/meta.ts"],"mappings":";;;iBAwCgB,kBAAkB,yBAAyB;;;;;;;iBAkB3C,mBACd,QAAQ,YACR,MAAM,QAAQ,aACd,0BAA0B;;;;;;;;;iBAeZ,gBACd,QAAQ,YACR,MAAM,QAAQ,aACd;;;;;;;;iBAsBc,cACd,QAAQ,YACR,MAAM,QAAQ;;;;;;;;;iBAgBA,iBACd,QAAQ,YACR,MAAM,QAAQ,aACd;;;;;;;;;;iBAmBc,uBACd,kBACA,QAAQ,YACR,MAAM,QAAQ,aACd;;;;;;;;;;iBAoBc,mBAAmB,OACjC,QAAQ,YACR,MAAM,QAAQ,iBAAiB,SAC/B,QAAQ,kBAAkB,SAAS,kBAAkB,WACpD,kBAAkB;;;;;;;;;iBAsCL,iBACd,QAAQ,YACR,MAAM,QAAQ,aACd,QAAQ,aACP;;;;;;;;iBAea,YAAY,OAC1B,QAAQ,wBAAwB,SAAS,SAAS,QAClD,SAAS,aACR"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { MetaConfig, MetaLink, SchemaMetaConfig, SchemaMetaExample, SchemaOf } from "@power-plant/core";
|
|
2
|
+
import { ExtractedSchemaEnvelope, JsonSchema } from "@power-plant/schema";
|
|
3
|
+
//#region src/helpers/meta.d.ts
|
|
4
|
+
declare function formatMetaVersion(value: string | number | Date): string;
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the version information from a given input, which can be a string, number, or Date object. The function returns a string representation of the version in the format "YYYYMMDD" for Date inputs, or as a string for valid timestamp numbers. If the input is a string, it is returned as-is. If the input is invalid or not provided, a default version of "1.0" is returned.
|
|
7
|
+
*
|
|
8
|
+
* @param input - The input from which to extract the version. It can be a string, number, undefined, or Date object.
|
|
9
|
+
* @returns A string representing the extracted version information.
|
|
10
|
+
*/
|
|
11
|
+
declare function resolveMetaVersion(schema: JsonSchema, meta: Partial<MetaConfig>, input?: string | number | Date): string;
|
|
12
|
+
/**
|
|
13
|
+
* Resolves a metadata name using explicit input, metadata, or schema fallbacks.
|
|
14
|
+
*
|
|
15
|
+
* @param schema - The JSON Schema fragment to read fallback values from.
|
|
16
|
+
* @param meta - Metadata values that may already include a name.
|
|
17
|
+
* @param input - An explicit name value to prioritize when provided.
|
|
18
|
+
* @returns The resolved metadata name.
|
|
19
|
+
*/
|
|
20
|
+
declare function resolveMetaName(schema: JsonSchema, meta: Partial<MetaConfig>, input?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves a stable metadata identifier in the format `<name>@<version>`.
|
|
23
|
+
*
|
|
24
|
+
* @param schema - The JSON Schema fragment used to infer fallback values.
|
|
25
|
+
* @param meta - Metadata values used to resolve name and version.
|
|
26
|
+
* @returns The resolved metadata identifier, or a generated id when no name is available.
|
|
27
|
+
*/
|
|
28
|
+
declare function resolveMetaId(schema: JsonSchema, meta: Partial<MetaConfig>): string;
|
|
29
|
+
/**
|
|
30
|
+
* Resolves a human-readable display name for metadata.
|
|
31
|
+
*
|
|
32
|
+
* @param schema - The JSON Schema fragment to read fallback display values from.
|
|
33
|
+
* @param meta - Metadata values that may already include a display name.
|
|
34
|
+
* @param input - An explicit display name value to prioritize when provided.
|
|
35
|
+
* @returns The resolved metadata display name.
|
|
36
|
+
*/
|
|
37
|
+
declare function resolveMetaTitle(schema: JsonSchema, meta: Partial<MetaConfig>, input?: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves a metadata description from explicit input, metadata, or schema values.
|
|
40
|
+
*
|
|
41
|
+
* @param template - A template string used to generate a default description when no explicit description is provided.
|
|
42
|
+
* @param schema - The JSON Schema fragment to read fallback description values from.
|
|
43
|
+
* @param meta - Metadata values that may already include a description.
|
|
44
|
+
* @param input - An explicit description value to prioritize when provided.
|
|
45
|
+
* @returns The resolved description, if available.
|
|
46
|
+
*/
|
|
47
|
+
declare function resolveMetaDescription(template: string, schema: JsonSchema, meta: Partial<MetaConfig>, input?: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Resolves and normalizes metadata examples into a consistent object format.
|
|
50
|
+
*
|
|
51
|
+
* @typeParam TSpec - The schema specification type associated with example values.
|
|
52
|
+
* @param schema - The JSON Schema fragment to read fallback examples from.
|
|
53
|
+
* @param meta - Metadata values that may already include examples.
|
|
54
|
+
* @param input - Explicit examples to prioritize when provided.
|
|
55
|
+
* @returns A normalized list of examples with generated descriptions when needed.
|
|
56
|
+
*/
|
|
57
|
+
declare function resolveMetaExample<TSpec>(schema: JsonSchema, meta: Partial<SchemaMetaConfig<TSpec>>, input?: SchemaMetaExample<TSpec> | SchemaMetaExample<TSpec>[]): SchemaMetaExample<TSpec>[];
|
|
58
|
+
/**
|
|
59
|
+
* Resolves and de-duplicates metadata links from input, metadata, and schema docs.
|
|
60
|
+
*
|
|
61
|
+
* @param schema - The JSON Schema fragment to read fallback documentation links from.
|
|
62
|
+
* @param meta - Metadata values that may already include links.
|
|
63
|
+
* @param input - Explicit links to prioritize when provided.
|
|
64
|
+
* @returns A unique list of metadata links.
|
|
65
|
+
*/
|
|
66
|
+
declare function resolveMetaLinks(schema: JsonSchema, meta: Partial<MetaConfig>, input?: MetaLink[]): MetaLink[];
|
|
67
|
+
/**
|
|
68
|
+
* Extracts and normalizes metadata for a specification based on the provided schema and optional configuration.
|
|
69
|
+
*
|
|
70
|
+
* @param schema - The schema that the specification is expected to conform to.
|
|
71
|
+
* @param config - Optional metadata configuration to extract and normalize.
|
|
72
|
+
* @returns The normalized specification metadata.
|
|
73
|
+
*/
|
|
74
|
+
declare function resolveMeta<TSpec>(schema: ExtractedSchemaEnvelope<TSpec> | SchemaOf<TSpec>, config?: MetaConfig): MetaConfig;
|
|
75
|
+
//#endregion
|
|
76
|
+
export { formatMetaVersion, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion };
|
|
77
|
+
//# sourceMappingURL=meta.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.mts","names":[],"sources":["../../src/helpers/meta.ts"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{titleCase as e}from"@stryke/string-format/title-case";import{isSetObject as t}from"@stryke/type-checks/is-set-object";import{uuid as n}from"@stryke/unique-id/uuid";import{isSetString as r}from"@stryke/type-checks/is-set-string";import{isSchemaOf as i}from"@power-plant/schema";import{stringifyType as a}from"@power-plant/schema/codegen";import{toArray as o}from"@stryke/convert/to-array";import{formatYYYYMMDD as s}from"@stryke/date/format";import{isValidTimestamp as c}from"@stryke/date/validate";import{getUnique as l}from"@stryke/helpers/get-unique";import{kebabCase as u}from"@stryke/string-format/kebab-case";import{isDate as d}from"@stryke/type-checks/is-date";import{isNumber as f}from"@stryke/type-checks/is-number";function p(e){return d(e)?s(e):f(e)?c(e)&&e>1e9?s(new Date(e)):e.toString():r(e)?e:`1.0`}function m(e,t,n){return p(n??t?.version??e?.version)}function h(e,t,n){return n??t.name??(r(e?.name)?e.name:r(e?.title)?e.title:e.$id?u(e.$id):a(e))}function g(e,t){let r=h(e,t),i=m(e,t);return r?`${u(r)}@${i}`:n()}function _(t,n,r){let i=r??n.title??t?.title;return i===void 0?e(n.name??a(t)):i}function v(e,t,n,i){n.title??=_(t,n);let a=n.title??``,o=e.replaceAll(/\{\s*title\s*\}/g,a),s=i??n.description??t?.description;return r(s)?s:o}function y(e,n,i){return(e=>e.map((e,n)=>r(e)?{name:`example-${n+1}`,description:`Example Specification #${n+1}`,value:e}:t(e)&&`value`in e&&r(e.value)?{name:`example-${n+1}`,description:e.description||`Example Specification #${n+1}`,value:e.value}:void 0).filter(Boolean))(o(i??n.examples??e?.examples??[]))}function b(e,t,n){return l(o(n).concat(t.links??[]).concat(e?.docs??[]))}function x(e,t){let n=i(e)?e:e??{schema:{}},r={};return r.name=h(n.schema,r,t?.name),r.version=m(n?.schema,r,t?.version),r.title=_(n?.schema,r,t?.title),r.links=b(n?.schema,r,t?.links),t?.deprecated&&(r.deprecated=t?.deprecated),t?.usage&&(r.usage=t?.usage),t?.tags&&(r.tags=t?.tags),r}export{p as formatMetaVersion,x as resolveMeta,v as resolveMetaDescription,y as resolveMetaExample,g as resolveMetaId,b as resolveMetaLinks,h as resolveMetaName,_ as resolveMetaTitle,m as resolveMetaVersion};
|
|
2
|
+
//# sourceMappingURL=meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
//#region src/type-checks.d.ts
|
|
1
|
+
import { N as InputConfigObject, R as SchemaConfigObject, f as OutputConfigObject, v as GeneratorConfigObject } from "../config-BpNybJZY.cjs";
|
|
2
|
+
import "../index-it9jCi4L.cjs";
|
|
3
|
+
//#region src/helpers/type-checks.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Checks if the provided configuration is a {@link GeneratorConfigObject}.
|
|
6
6
|
*
|
|
@@ -28,7 +28,7 @@ declare function isOutputConfigObject<TSpec, TOptions extends object, TReturns =
|
|
|
28
28
|
* @param config - The configuration to check.
|
|
29
29
|
* @returns True if the configuration is a {@link SchemaConfigObject}, false otherwise.
|
|
30
30
|
*/
|
|
31
|
-
declare function isSchemaConfigObject<TSpec
|
|
31
|
+
declare function isSchemaConfigObject<TSpec>(config: unknown): config is SchemaConfigObject<TSpec>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
34
|
-
//# sourceMappingURL=type-checks
|
|
33
|
+
export { isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject };
|
|
34
|
+
//# sourceMappingURL=type-checks.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-checks.d.cts","names":[],"sources":["../../src/helpers/type-checks.ts"],"mappings":";;;;;;;;;iBAgCgB,wBACd,OACA,yBACA,iBACA,kBAAkB,UAAU,sBAAsB,OAAO,UAAU;;;;;;;iBAcrD,oBAAoB,OAAO,yBACzC,iBACC,SAAS,kBAAkB,OAAO;;;;;;;iBAUrB,qBACd,OACA,yBACA,iBACA,kBAAkB,UAAU,mBAAmB,OAAO,UAAU;;;;;;;iBAYlD,qBAAqB,OACnC,kBACC,UAAU,mBAAmB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
//#region src/type-checks.d.ts
|
|
1
|
+
import { N as InputConfigObject, R as SchemaConfigObject, f as OutputConfigObject, v as GeneratorConfigObject } from "../config-C9Hp8wTC.mjs";
|
|
2
|
+
import "../index-DY4xQ_iJ.mjs";
|
|
3
|
+
//#region src/helpers/type-checks.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Checks if the provided configuration is a {@link GeneratorConfigObject}.
|
|
6
6
|
*
|
|
@@ -28,7 +28,7 @@ declare function isOutputConfigObject<TSpec, TOptions extends object, TReturns =
|
|
|
28
28
|
* @param config - The configuration to check.
|
|
29
29
|
* @returns True if the configuration is a {@link SchemaConfigObject}, false otherwise.
|
|
30
30
|
*/
|
|
31
|
-
declare function isSchemaConfigObject<TSpec
|
|
31
|
+
declare function isSchemaConfigObject<TSpec>(config: unknown): config is SchemaConfigObject<TSpec>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
34
|
-
//# sourceMappingURL=type-checks
|
|
33
|
+
export { isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject };
|
|
34
|
+
//# sourceMappingURL=type-checks.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-checks.d.mts","names":[],"sources":["../../src/helpers/type-checks.ts"],"mappings":""}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./execute-D7rill1C.cjs"),t=require("./config.cjs"),n=require("./context.cjs"),r=require("./define.cjs");exports.callAsyncExecution=n.callAsyncExecution,exports.callAsyncExecutionContext=n.callAsyncExecutionContext,exports.callAsyncSession=n.callAsyncSession,exports.callAsyncSessionContext=n.callAsyncSessionContext,exports.callExecution=n.callExecution,exports.callExecutionContext=n.callExecutionContext,exports.callSession=n.callSession,exports.callSessionContext=n.callSessionContext,exports.createExecute=e.t,exports.defineConfig=t.defineConfig,exports.defineGenerator=r.defineGenerator,exports.defineInput=r.defineInput,exports.defineOutput=r.defineOutput,exports.defineSchema=r.defineSchema,exports.execute=e.n,exports.executionAsyncLocalStorage=n.executionAsyncLocalStorage,exports.executionContext=n.executionContext,exports.sessionAsyncLocalStorage=n.sessionAsyncLocalStorage,exports.sessionContext=n.sessionContext,exports.tryUseExecution=n.tryUseExecution,exports.tryUseExecutionContext=n.tryUseExecutionContext,exports.tryUseSession=n.tryUseSession,exports.tryUseSessionContext=n.tryUseSessionContext,exports.useExecution=n.useExecution,exports.useExecutionContext=n.useExecutionContext,exports.useSession=n.useSession,exports.useSessionContext=n.useSessionContext;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as InferCreateInputOptions, B as SchemaMetaExample, C as InferGenerator, D as InferMeta, E as InferInputConfig, F as InputMetaConfig, G as MetaLink, H as BaseMetaConfig, I as InferCreateSchemaOptions, L as Schema, M as InputConfig, N as InputConfigObject, O as InferOutputConfig, P as InputFunction, R as SchemaConfigObject, S as InferCreateGeneratorOptions, T as InferGeneratorResult, U as MetaConfig, V as SchemaOf, W as MetaDeprecated, _ as GeneratorConfig, a as UserConfigFnPromise, b as GeneratorFunctionResult, c as Settings, d as OutputConfig, f as OutputConfigObject, g as Generator, h as GeneratedDocumentChunk, i as UserConfigFnObject, j as Input, k as InferSchemaConfig, l as InferCreateOutputOptions, m as GeneratedDocument, n as UserConfigExport, o as UserConfigParams, p as OutputFunction, r as UserConfigFn, s as Logger, t as UserConfig, u as Output, v as GeneratorConfigObject, w as InferGeneratorFunction, x as GeneratorResult, y as GeneratorFunction, z as SchemaMetaConfig } from "./config-BpNybJZY.cjs";
|
|
2
2
|
import { defineConfig } from "./config.cjs";
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
3
|
+
import { a as InferEngineOptions, i as ExecutionResult, n as Execution, r as ExecutionMeta, t as ExecuteFunction } from "./execution-BAm3omij.cjs";
|
|
4
|
+
import { a as Base, i as Session, n as LocalStore, r as SessionContext, t as ExecutionContext } from "./context-BU2q1sN5.cjs";
|
|
5
|
+
import { ContextStore, callAsyncExecution, callAsyncExecutionContext, callAsyncSession, callAsyncSessionContext, callExecution, callExecutionContext, callSession, callSessionContext, executionAsyncLocalStorage, executionContext, sessionAsyncLocalStorage, sessionContext, tryUseExecution, tryUseExecutionContext, tryUseSession, tryUseSessionContext, useExecution, useExecutionContext, useSession, useSessionContext } from "./context.cjs";
|
|
5
6
|
import { defineGenerator, defineInput, defineOutput, defineSchema } from "./define.cjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
7
|
+
import { createExecute, execute } from "./execute.cjs";
|
|
8
|
+
import "./index-it9jCi4L.cjs";
|
|
9
|
+
export { type Base, type BaseMetaConfig, ContextStore, type ExecuteFunction, type Execution, type ExecutionContext, type ExecutionMeta, type ExecutionResult, type GeneratedDocument, type GeneratedDocumentChunk, type Generator, type GeneratorConfig, type GeneratorConfigObject, type GeneratorFunction, type GeneratorFunctionResult, type GeneratorResult, type InferCreateGeneratorOptions, type InferCreateInputOptions, type InferCreateOutputOptions, type InferCreateSchemaOptions, type InferEngineOptions, type InferGenerator, type InferGeneratorFunction, type InferGeneratorResult, type InferInputConfig, type InferMeta, type InferOutputConfig, type InferSchemaConfig, type Input, type InputConfig, type InputConfigObject, type InputFunction, type InputMetaConfig, type LocalStore, type Logger, type MetaConfig, type MetaDeprecated, type MetaLink, type Output, type OutputConfig, type OutputConfigObject, type OutputFunction, type Schema, type SchemaConfigObject, type SchemaMetaConfig, type SchemaMetaExample, type SchemaOf, type Session, type SessionContext, type Settings, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type UserConfigParams, callAsyncExecution, callAsyncExecutionContext, callAsyncSession, callAsyncSessionContext, callExecution, callExecutionContext, callSession, callSessionContext, createExecute, defineConfig, defineGenerator, defineInput, defineOutput, defineSchema, execute, executionAsyncLocalStorage, executionContext, sessionAsyncLocalStorage, sessionContext, tryUseExecution, tryUseExecutionContext, tryUseSession, tryUseSessionContext, useExecution, useExecutionContext, useSession, useSessionContext };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as InferCreateInputOptions, B as SchemaMetaExample, C as InferGenerator, D as InferMeta, E as InferInputConfig, F as InputMetaConfig, G as MetaLink, H as BaseMetaConfig, I as InferCreateSchemaOptions, L as Schema, M as InputConfig, N as InputConfigObject, O as InferOutputConfig, P as InputFunction, R as SchemaConfigObject, S as InferCreateGeneratorOptions, T as InferGeneratorResult, U as MetaConfig, V as SchemaOf, W as MetaDeprecated, _ as GeneratorConfig, a as UserConfigFnPromise, b as GeneratorFunctionResult, c as Settings, d as OutputConfig, f as OutputConfigObject, g as Generator, h as GeneratedDocumentChunk, i as UserConfigFnObject, j as Input, k as InferSchemaConfig, l as InferCreateOutputOptions, m as GeneratedDocument, n as UserConfigExport, o as UserConfigParams, p as OutputFunction, r as UserConfigFn, s as Logger, t as UserConfig, u as Output, v as GeneratorConfigObject, w as InferGeneratorFunction, x as GeneratorResult, y as GeneratorFunction, z as SchemaMetaConfig } from "./config-C9Hp8wTC.mjs";
|
|
2
2
|
import { defineConfig } from "./config.mjs";
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
3
|
+
import { a as InferEngineOptions, i as ExecutionResult, n as Execution, r as ExecutionMeta, t as ExecuteFunction } from "./execution-d10Z7Dih.mjs";
|
|
4
|
+
import { a as Base, i as Session, n as LocalStore, r as SessionContext, t as ExecutionContext } from "./context-BUNCX0E-.mjs";
|
|
5
|
+
import { ContextStore, callAsyncExecution, callAsyncExecutionContext, callAsyncSession, callAsyncSessionContext, callExecution, callExecutionContext, callSession, callSessionContext, executionAsyncLocalStorage, executionContext, sessionAsyncLocalStorage, sessionContext, tryUseExecution, tryUseExecutionContext, tryUseSession, tryUseSessionContext, useExecution, useExecutionContext, useSession, useSessionContext } from "./context.mjs";
|
|
5
6
|
import { defineGenerator, defineInput, defineOutput, defineSchema } from "./define.mjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
7
|
+
import { createExecute, execute } from "./execute.mjs";
|
|
8
|
+
import "./index-DY4xQ_iJ.mjs";
|
|
9
|
+
export { type Base, type BaseMetaConfig, ContextStore, type ExecuteFunction, type Execution, type ExecutionContext, type ExecutionMeta, type ExecutionResult, type GeneratedDocument, type GeneratedDocumentChunk, type Generator, type GeneratorConfig, type GeneratorConfigObject, type GeneratorFunction, type GeneratorFunctionResult, type GeneratorResult, type InferCreateGeneratorOptions, type InferCreateInputOptions, type InferCreateOutputOptions, type InferCreateSchemaOptions, type InferEngineOptions, type InferGenerator, type InferGeneratorFunction, type InferGeneratorResult, type InferInputConfig, type InferMeta, type InferOutputConfig, type InferSchemaConfig, type Input, type InputConfig, type InputConfigObject, type InputFunction, type InputMetaConfig, type LocalStore, type Logger, type MetaConfig, type MetaDeprecated, type MetaLink, type Output, type OutputConfig, type OutputConfigObject, type OutputFunction, type Schema, type SchemaConfigObject, type SchemaMetaConfig, type SchemaMetaExample, type SchemaOf, type Session, type SessionContext, type Settings, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type UserConfigParams, callAsyncExecution, callAsyncExecutionContext, callAsyncSession, callAsyncSessionContext, callExecution, callExecutionContext, callSession, callSessionContext, createExecute, defineConfig, defineGenerator, defineInput, defineOutput, defineSchema, execute, executionAsyncLocalStorage, executionContext, sessionAsyncLocalStorage, sessionContext, tryUseExecution, tryUseExecutionContext, tryUseSession, tryUseSessionContext, useExecution, useExecutionContext, useSession, useSessionContext };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{defineConfig as e}from"./config.mjs";import{callAsyncExecution as t,callAsyncExecutionContext as n,callAsyncSession as r,callAsyncSessionContext as i,callExecution as a,callExecutionContext as o,callSession as s,callSessionContext as c,executionAsyncLocalStorage as l,executionContext as u,sessionAsyncLocalStorage as d,sessionContext as f,tryUseExecution as p,tryUseExecutionContext as m,tryUseSession as h,tryUseSessionContext as g,useExecution as _,useExecutionContext as v,useSession as y,useSessionContext as b}from"./context.mjs";import{defineGenerator as x,defineInput as S,defineOutput as C,defineSchema as w}from"./define.mjs";import{n as T,t as E}from"./execute-8tWWCCpu.mjs";export{t as callAsyncExecution,n as callAsyncExecutionContext,r as callAsyncSession,i as callAsyncSessionContext,a as callExecution,o as callExecutionContext,s as callSession,c as callSessionContext,E as createExecute,e as defineConfig,x as defineGenerator,S as defineInput,C as defineOutput,w as defineSchema,T as execute,l as executionAsyncLocalStorage,u as executionContext,d as sessionAsyncLocalStorage,f as sessionContext,p as tryUseExecution,m as tryUseExecutionContext,h as tryUseSession,g as tryUseSessionContext,_ as useExecution,v as useExecutionContext,y as useSession,b as useSessionContext};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DeepPartial, MaybePromise } from "@stryke/types/base";
|
|
2
|
+
import { Storage } from "unstorage";
|
|
3
|
+
import { ExtractedSchemaEnvelope, InferExtractOptions, JsonSchema, SchemaConfig, SchemaEnvelopeOf, SchemaSourceConfig } from "@power-plant/schema";
|
|
4
|
+
import { InferLoadOptions, LoadReference } from "@stryke/resolve/types";
|
|
5
|
+
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
6
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/helpers/meta.d.ts
|
|
9
|
+
declare function formatMetaVersion(value: string | number | Date): string;
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the version information from a given input, which can be a string, number, or Date object. The function returns a string representation of the version in the format "YYYYMMDD" for Date inputs, or as a string for valid timestamp numbers. If the input is a string, it is returned as-is. If the input is invalid or not provided, a default version of "1.0" is returned.
|
|
12
|
+
*
|
|
13
|
+
* @param input - The input from which to extract the version. It can be a string, number, undefined, or Date object.
|
|
14
|
+
* @returns A string representing the extracted version information.
|
|
15
|
+
*/
|
|
16
|
+
declare function resolveMetaVersion(schema: JsonSchema, meta: Partial<MetaConfig>, input?: string | number | Date): string;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves a metadata name using explicit input, metadata, or schema fallbacks.
|
|
19
|
+
*
|
|
20
|
+
* @param schema - The JSON Schema fragment to read fallback values from.
|
|
21
|
+
* @param meta - Metadata values that may already include a name.
|
|
22
|
+
* @param input - An explicit name value to prioritize when provided.
|
|
23
|
+
* @returns The resolved metadata name.
|
|
24
|
+
*/
|
|
25
|
+
declare function resolveMetaName(schema: JsonSchema, meta: Partial<MetaConfig>, input?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Resolves a stable metadata identifier in the format `<name>@<version>`.
|
|
28
|
+
*
|
|
29
|
+
* @param schema - The JSON Schema fragment used to infer fallback values.
|
|
30
|
+
* @param meta - Metadata values used to resolve name and version.
|
|
31
|
+
* @returns The resolved metadata identifier, or a generated id when no name is available.
|
|
32
|
+
*/
|
|
33
|
+
declare function resolveMetaId(schema: JsonSchema, meta: Partial<MetaConfig>): string;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves a human-readable display name for metadata.
|
|
36
|
+
*
|
|
37
|
+
* @param schema - The JSON Schema fragment to read fallback display values from.
|
|
38
|
+
* @param meta - Metadata values that may already include a display name.
|
|
39
|
+
* @param input - An explicit display name value to prioritize when provided.
|
|
40
|
+
* @returns The resolved metadata display name.
|
|
41
|
+
*/
|
|
42
|
+
declare function resolveMetaTitle(schema: JsonSchema, meta: Partial<MetaConfig>, input?: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Resolves a metadata description from explicit input, metadata, or schema values.
|
|
45
|
+
*
|
|
46
|
+
* @param template - A template string used to generate a default description when no explicit description is provided.
|
|
47
|
+
* @param schema - The JSON Schema fragment to read fallback description values from.
|
|
48
|
+
* @param meta - Metadata values that may already include a description.
|
|
49
|
+
* @param input - An explicit description value to prioritize when provided.
|
|
50
|
+
* @returns The resolved description, if available.
|
|
51
|
+
*/
|
|
52
|
+
declare function resolveMetaDescription(template: string, schema: JsonSchema, meta: Partial<MetaConfig>, input?: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Resolves and normalizes metadata examples into a consistent object format.
|
|
55
|
+
*
|
|
56
|
+
* @typeParam TSpec - The schema specification type associated with example values.
|
|
57
|
+
* @param schema - The JSON Schema fragment to read fallback examples from.
|
|
58
|
+
* @param meta - Metadata values that may already include examples.
|
|
59
|
+
* @param input - Explicit examples to prioritize when provided.
|
|
60
|
+
* @returns A normalized list of examples with generated descriptions when needed.
|
|
61
|
+
*/
|
|
62
|
+
declare function resolveMetaExample<TSpec>(schema: JsonSchema, meta: Partial<SchemaMetaConfig<TSpec>>, input?: SchemaMetaExample<TSpec> | SchemaMetaExample<TSpec>[]): SchemaMetaExample<TSpec>[];
|
|
63
|
+
/**
|
|
64
|
+
* Resolves and de-duplicates metadata links from input, metadata, and schema docs.
|
|
65
|
+
*
|
|
66
|
+
* @param schema - The JSON Schema fragment to read fallback documentation links from.
|
|
67
|
+
* @param meta - Metadata values that may already include links.
|
|
68
|
+
* @param input - Explicit links to prioritize when provided.
|
|
69
|
+
* @returns A unique list of metadata links.
|
|
70
|
+
*/
|
|
71
|
+
declare function resolveMetaLinks(schema: JsonSchema, meta: Partial<MetaConfig>, input?: MetaLink[]): MetaLink[];
|
|
72
|
+
/**
|
|
73
|
+
* Extracts and normalizes metadata for a specification based on the provided schema and optional configuration.
|
|
74
|
+
*
|
|
75
|
+
* @param schema - The schema that the specification is expected to conform to.
|
|
76
|
+
* @param config - Optional metadata configuration to extract and normalize.
|
|
77
|
+
* @returns The normalized specification metadata.
|
|
78
|
+
*/
|
|
79
|
+
declare function resolveMeta<TSpec>(schema: ExtractedSchemaEnvelope<TSpec> | SchemaOf<TSpec>, config?: MetaConfig): MetaConfig;
|
|
80
|
+
//#endregion
|
|
81
|
+
export { resolveMetaId as a, resolveMetaTitle as c, resolveMetaExample as i, resolveMetaVersion as l, resolveMeta as n, resolveMetaLinks as o, resolveMetaDescription as r, resolveMetaName as s, formatMetaVersion as t };
|
|
82
|
+
//# sourceMappingURL=meta-CiPl-8rq.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-CiPl-8rq.d.cts","names":[],"sources":["config-BpNybJZY.d.cts","config.d.cts","execution-BAm3omij.d.cts","context-BU2q1sN5.d.cts","context.d.cts","define.d.cts","execute.d.cts","index-it9jCi4L.d.cts","index.d.cts","../src/helpers/meta.ts"],"mappings":";;;;;;;;iBSwCgB,kBAAkB,yBAAyB;;;;;;;iBAkB3C,mBACd,QAAQ,YACR,MAAM,QAAQ,aACd,0BAA0B;;;;;;;;;iBAeZ,gBACd,QAAQ,YACR,MAAM,QAAQ,aACd;;;;;;;;iBAsBc,cACd,QAAQ,YACR,MAAM,QAAQ;;;;;;;;;iBAgBA,iBACd,QAAQ,YACR,MAAM,QAAQ,aACd;;;;;;;;;;iBAmBc,uBACd,kBACA,QAAQ,YACR,MAAM,QAAQ,aACd;;;;;;;;;;iBAoBc,mBAAmB,OACjC,QAAQ,YACR,MAAM,QAAQ,iBAAiB,SAC/B,QAAQ,kBAAkB,SAAS,kBAAkB,WACpD,kBAAkB;;;;;;;;;iBAsCL,iBACd,QAAQ,YACR,MAAM,QAAQ,aACd,QAAQ,aACP;;;;;;;;iBAea,YAAY,OAC1B,QAAQ,wBAAwB,SAAS,SAAS,QAClD,SAAS,aACR"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "☢️
|
|
5
|
+
"description": "☢️ Generate anything from a specification",
|
|
6
6
|
"keywords": ["power-plant", "storm-software"],
|
|
7
7
|
"homepage": "https://stormsoftware.com",
|
|
8
8
|
"bugs": {
|
|
@@ -96,35 +96,63 @@
|
|
|
96
96
|
"default": "./dist/define.mjs"
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
|
-
"./
|
|
100
|
-
"./type-checks": {
|
|
99
|
+
"./execute": {
|
|
101
100
|
"require": {
|
|
102
|
-
"types": "./dist/
|
|
103
|
-
"default": "./dist/
|
|
101
|
+
"types": "./dist/execute.d.cts",
|
|
102
|
+
"default": "./dist/execute.cjs"
|
|
104
103
|
},
|
|
105
104
|
"import": {
|
|
106
|
-
"types": "./dist/
|
|
107
|
-
"default": "./dist/
|
|
105
|
+
"types": "./dist/execute.d.mts",
|
|
106
|
+
"default": "./dist/execute.mjs"
|
|
108
107
|
},
|
|
109
108
|
"default": {
|
|
110
|
-
"types": "./dist/
|
|
111
|
-
"default": "./dist/
|
|
109
|
+
"types": "./dist/execute.d.mts",
|
|
110
|
+
"default": "./dist/execute.mjs"
|
|
112
111
|
}
|
|
113
112
|
},
|
|
114
|
-
"./
|
|
113
|
+
"./helpers": {
|
|
115
114
|
"require": {
|
|
116
|
-
"types": "./dist/
|
|
117
|
-
"default": "./dist/
|
|
115
|
+
"types": "./dist/helpers/index.d.cts",
|
|
116
|
+
"default": "./dist/helpers/index.cjs"
|
|
118
117
|
},
|
|
119
118
|
"import": {
|
|
120
|
-
"types": "./dist/
|
|
121
|
-
"default": "./dist/
|
|
119
|
+
"types": "./dist/helpers/index.d.mts",
|
|
120
|
+
"default": "./dist/helpers/index.mjs"
|
|
122
121
|
},
|
|
123
122
|
"default": {
|
|
124
|
-
"types": "./dist/
|
|
125
|
-
"default": "./dist/
|
|
123
|
+
"types": "./dist/helpers/index.d.mts",
|
|
124
|
+
"default": "./dist/helpers/index.mjs"
|
|
126
125
|
}
|
|
127
|
-
}
|
|
126
|
+
},
|
|
127
|
+
"./helpers/meta": {
|
|
128
|
+
"require": {
|
|
129
|
+
"types": "./dist/helpers/meta.d.cts",
|
|
130
|
+
"default": "./dist/helpers/meta.cjs"
|
|
131
|
+
},
|
|
132
|
+
"import": {
|
|
133
|
+
"types": "./dist/helpers/meta.d.mts",
|
|
134
|
+
"default": "./dist/helpers/meta.mjs"
|
|
135
|
+
},
|
|
136
|
+
"default": {
|
|
137
|
+
"types": "./dist/helpers/meta.d.mts",
|
|
138
|
+
"default": "./dist/helpers/meta.mjs"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"./helpers/type-checks": {
|
|
142
|
+
"require": {
|
|
143
|
+
"types": "./dist/helpers/type-checks.d.cts",
|
|
144
|
+
"default": "./dist/helpers/type-checks.cjs"
|
|
145
|
+
},
|
|
146
|
+
"import": {
|
|
147
|
+
"types": "./dist/helpers/type-checks.d.mts",
|
|
148
|
+
"default": "./dist/helpers/type-checks.mjs"
|
|
149
|
+
},
|
|
150
|
+
"default": {
|
|
151
|
+
"types": "./dist/helpers/type-checks.d.mts",
|
|
152
|
+
"default": "./dist/helpers/type-checks.mjs"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"./package.json": "./package.json"
|
|
128
156
|
},
|
|
129
157
|
"main": "./dist/index.cjs",
|
|
130
158
|
"module": "./dist/index.mjs",
|
|
@@ -132,18 +160,29 @@
|
|
|
132
160
|
"typings": "dist/index.d.mts",
|
|
133
161
|
"files": ["dist"],
|
|
134
162
|
"dependencies": {
|
|
135
|
-
"@power-plant/schema": "^0.0.
|
|
163
|
+
"@power-plant/schema": "^0.0.17",
|
|
136
164
|
"@stryke/string-format": "^0.17.37",
|
|
137
165
|
"@stryke/type-checks": "^0.6.28",
|
|
138
166
|
"@stryke/types": "^0.12.23",
|
|
167
|
+
"@stryke/convert": "^0.7.26",
|
|
168
|
+
"@stryke/date": "^0.0.7",
|
|
169
|
+
"@stryke/env": "^0.20.113",
|
|
170
|
+
"@stryke/fs": "^0.33.96",
|
|
171
|
+
"@stryke/helpers": "^0.10.35",
|
|
172
|
+
"@stryke/json": "^0.15.19",
|
|
173
|
+
"@stryke/path": "^0.29.22",
|
|
174
|
+
"@stryke/resolve": "^0.0.11",
|
|
175
|
+
"@stryke/unique-id": "^0.3.107",
|
|
176
|
+
"c12": "^3.3.4",
|
|
177
|
+
"jiti": "^2.7.0",
|
|
139
178
|
"defu": "^6.1.7",
|
|
140
179
|
"unstorage": "^1.17.5"
|
|
141
180
|
},
|
|
142
181
|
"devDependencies": {
|
|
143
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
182
|
+
"@powerlines/plugin-tsdown": "^0.1.545",
|
|
144
183
|
"@types/node": "^25.9.5",
|
|
145
184
|
"typescript": "^6.0.3"
|
|
146
185
|
},
|
|
147
186
|
"publishConfig": { "access": "public" },
|
|
148
|
-
"gitHead": "
|
|
187
|
+
"gitHead": "7346b39899095e30744680cd9994a6c229d4f16a"
|
|
149
188
|
}
|