@power-plant/core 0.0.41 → 0.0.43
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/dist/helpers/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { formatMetaVersion, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion } from "./meta.cjs";
|
|
2
2
|
import { isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject } from "./type-checks.cjs";
|
|
3
3
|
export { formatMetaVersion, isGeneratorConfigObject, isInputConfigObject, isOutputConfigObject, isSchemaConfigObject, resolveMeta, resolveMetaDescription, resolveMetaExample, resolveMetaId, resolveMetaLinks, resolveMetaName, resolveMetaTitle, resolveMetaVersion };
|
package/dist/helpers/meta.d.cts
CHANGED
|
@@ -1,2 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ExtractedSchemaEnvelope, JsonSchema } from "@power-plant/schema";
|
|
2
|
+
import { MetaConfig, MetaLink, SchemaMetaConfig, SchemaMetaExample, SchemaOf } from "@power-plant/core";
|
|
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.cts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "☢️ Generate anything from a specification",
|
|
6
6
|
"keywords": ["power-plant", "storm-software"],
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"typings": "dist/index.d.mts",
|
|
161
161
|
"files": ["dist"],
|
|
162
162
|
"dependencies": {
|
|
163
|
-
"@power-plant/schema": "^0.0.
|
|
163
|
+
"@power-plant/schema": "^0.0.42",
|
|
164
164
|
"@stryke/string-format": "^0.17.40",
|
|
165
165
|
"@stryke/type-checks": "^0.6.31",
|
|
166
166
|
"@stryke/types": "^0.12.26",
|
|
@@ -179,10 +179,10 @@
|
|
|
179
179
|
"unstorage": "^1.17.5"
|
|
180
180
|
},
|
|
181
181
|
"devDependencies": {
|
|
182
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
182
|
+
"@powerlines/plugin-tsdown": "^0.1.563",
|
|
183
183
|
"@types/node": "^25.9.5",
|
|
184
184
|
"typescript": "^6.0.3"
|
|
185
185
|
},
|
|
186
186
|
"publishConfig": { "access": "public" },
|
|
187
|
-
"gitHead": "
|
|
187
|
+
"gitHead": "2979c126773f62e500d2a9b634ed71c0ec8442b4"
|
|
188
188
|
}
|
package/dist/meta-DAeqzHmR.d.cts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { DeepPartial, MaybePromise } from "@stryke/types/base";
|
|
2
|
-
import { Storage } from "unstorage";
|
|
3
|
-
import { BaseExtractOptions, 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-DAeqzHmR.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta-DAeqzHmR.d.cts","names":[],"sources":["config-DS1cj7j6.d.cts","config.d.cts","execution-vXX_IEkO.d.cts","context-DSkOqDWy.d.cts","context.d.cts","define.d.cts","execute.d.cts","index-DWiKtHVE.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"}
|