@power-plant/core 0.0.2 → 0.0.4
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 +220 -0
- package/dist/create-23iLtMb_.cjs +1 -0
- package/dist/create-BR4IeVl4.mjs +2 -0
- package/dist/create-BR4IeVl4.mjs.map +1 -0
- package/dist/create-BqRl9d7m.d.cts +19 -0
- package/dist/create-BqRl9d7m.d.cts.map +1 -0
- package/dist/create-C-rR8nuY.d.mts +23 -0
- package/dist/create-C-rR8nuY.d.mts.map +1 -0
- package/dist/create-Cz9qVT4m.d.cts +23 -0
- package/dist/create-Cz9qVT4m.d.cts.map +1 -0
- package/dist/create-DAGPeYVI.d.cts +25 -0
- package/dist/create-DAGPeYVI.d.cts.map +1 -0
- package/dist/create-DEe398aQ.d.mts +25 -0
- package/dist/create-DEe398aQ.d.mts.map +1 -0
- package/dist/create-DUt-efk7.d.cts +25 -0
- package/dist/create-DUt-efk7.d.cts.map +1 -0
- package/dist/create-DcCu_zM3.d.mts +19 -0
- package/dist/create-DcCu_zM3.d.mts.map +1 -0
- package/dist/create-Qxy2mq7r.d.mts +25 -0
- package/dist/create-Qxy2mq7r.d.mts.map +1 -0
- package/dist/define-BPfeEA9Z.d.cts +14 -0
- package/dist/define-BPfeEA9Z.d.cts.map +1 -0
- package/dist/define-CQZ042K5.d.mts +14 -0
- package/dist/define-CQZ042K5.d.mts.map +1 -0
- package/dist/define-Dw8JgVQ1.d.mts +38 -0
- package/dist/define-Dw8JgVQ1.d.mts.map +1 -0
- package/dist/define-aWeW6VVo.d.cts +38 -0
- package/dist/define-aWeW6VVo.d.cts.map +1 -0
- package/dist/generator/create.cjs +1 -0
- package/dist/generator/create.d.cts +2 -0
- package/dist/generator/create.d.mts +2 -0
- package/dist/generator/create.mjs +2 -0
- package/dist/generator/create.mjs.map +1 -0
- package/dist/generator/helpers.cjs +1 -0
- package/dist/generator/helpers.d.cts +6 -0
- package/dist/generator/helpers.d.cts.map +1 -0
- package/dist/generator/helpers.d.mts +6 -0
- package/dist/generator/helpers.d.mts.map +1 -0
- package/dist/generator/helpers.mjs +2 -0
- package/dist/generator/helpers.mjs.map +1 -0
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.cts +2 -20
- package/dist/generator/index.d.mts +2 -20
- package/dist/generator/index.mjs +1 -2
- package/dist/{generator-C5O_C4RV.d.cts → generator-BGkKE8HQ.d.mts} +18 -14
- package/dist/generator-BGkKE8HQ.d.mts.map +1 -0
- package/dist/{generator-DZI01B4_.d.mts → generator-Dq0PL5w6.d.cts} +18 -14
- package/dist/generator-Dq0PL5w6.d.cts.map +1 -0
- package/dist/helpers-BqnQPaP5.d.cts +13 -0
- package/dist/helpers-BqnQPaP5.d.cts.map +1 -0
- package/dist/helpers-CgXgqnVu.d.mts +13 -0
- package/dist/helpers-CgXgqnVu.d.mts.map +1 -0
- package/dist/index-BVVgDSdq.d.cts +1 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -8
- package/dist/index.d.mts +12 -8
- package/dist/index.mjs +1 -1
- package/dist/schema/create.cjs +1 -0
- package/dist/schema/create.d.cts +2 -0
- package/dist/schema/create.d.mts +2 -0
- package/dist/schema/create.mjs +1 -0
- package/dist/schema/define.cjs +1 -0
- package/dist/schema/define.d.cts +2 -0
- package/dist/schema/define.d.mts +2 -0
- package/dist/schema/define.mjs +2 -0
- package/dist/schema/define.mjs.map +1 -0
- package/dist/schema/helpers.cjs +1 -0
- package/dist/schema/helpers.d.cts +2 -0
- package/dist/schema/helpers.d.mts +2 -0
- package/dist/schema/helpers.mjs +2 -0
- package/dist/schema/helpers.mjs.map +1 -0
- package/dist/schema/index.cjs +1 -0
- package/dist/schema/index.d.cts +4 -0
- package/dist/schema/index.d.mts +4 -0
- package/dist/schema/index.mjs +1 -0
- package/dist/schema-xFkmOyE6.d.cts +205 -0
- package/dist/schema-xFkmOyE6.d.cts.map +1 -0
- package/dist/schema-xFkmOyE6.d.mts +205 -0
- package/dist/schema-xFkmOyE6.d.mts.map +1 -0
- package/dist/sink/create.cjs +1 -0
- package/dist/sink/create.d.cts +2 -0
- package/dist/sink/create.d.mts +2 -0
- package/dist/sink/create.mjs +2 -0
- package/dist/sink/create.mjs.map +1 -0
- package/dist/sink/define.cjs +1 -0
- package/dist/sink/define.d.cts +37 -0
- package/dist/sink/define.d.cts.map +1 -0
- package/dist/sink/define.d.mts +37 -0
- package/dist/sink/define.d.mts.map +1 -0
- package/dist/sink/define.mjs +2 -0
- package/dist/sink/define.mjs.map +1 -0
- package/dist/sink/helpers.cjs +1 -0
- package/dist/sink/helpers.d.cts +13 -0
- package/dist/sink/helpers.d.cts.map +1 -0
- package/dist/sink/helpers.d.mts +13 -0
- package/dist/sink/helpers.d.mts.map +1 -0
- package/dist/sink/helpers.mjs +2 -0
- package/dist/sink/helpers.mjs.map +1 -0
- package/dist/sink/index.cjs +1 -1
- package/dist/sink/index.d.cts +2 -15
- package/dist/sink/index.d.mts +2 -15
- package/dist/sink/index.mjs +1 -1
- package/dist/sink-CHQncb8H.d.mts +58 -0
- package/dist/sink-CHQncb8H.d.mts.map +1 -0
- package/dist/sink-DHpx94GM.d.cts +58 -0
- package/dist/sink-DHpx94GM.d.cts.map +1 -0
- package/dist/source/create.cjs +1 -0
- package/dist/source/create.d.cts +2 -0
- package/dist/source/create.d.mts +2 -0
- package/dist/source/create.mjs +2 -0
- package/dist/source/create.mjs.map +1 -0
- package/dist/source/define.cjs +1 -0
- package/dist/source/define.d.cts +2 -0
- package/dist/source/define.d.mts +2 -0
- package/dist/source/define.mjs +2 -0
- package/dist/source/define.mjs.map +1 -0
- package/dist/source/helpers.cjs +1 -0
- package/dist/source/helpers.d.cts +13 -0
- package/dist/source/helpers.d.cts.map +1 -0
- package/dist/source/helpers.d.mts +13 -0
- package/dist/source/helpers.d.mts.map +1 -0
- package/dist/source/helpers.mjs +2 -0
- package/dist/source/helpers.mjs.map +1 -0
- package/dist/source/index.cjs +1 -1
- package/dist/source/index.d.cts +3 -16
- package/dist/source/index.d.mts +3 -16
- package/dist/source/index.mjs +1 -1
- package/dist/source-BiOs3_-8.d.mts +57 -0
- package/dist/source-BiOs3_-8.d.mts.map +1 -0
- package/dist/source-txi0ZuzR.d.cts +57 -0
- package/dist/source-txi0ZuzR.d.cts.map +1 -0
- package/package.json +187 -27
- package/dist/config.cjs +0 -0
- package/dist/config.d.cts +0 -10
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts +0 -10
- package/dist/config.d.mts.map +0 -1
- package/dist/config.mjs +0 -2
- package/dist/config.mjs.map +0 -1
- package/dist/extract-BzZLelb2.mjs +0 -2
- package/dist/extract-BzZLelb2.mjs.map +0 -1
- package/dist/extract-DUwG1ZUO.cjs +0 -1
- package/dist/extract-FkKA9g1K.cjs +0 -1
- package/dist/extract-ZIpZAKsq.mjs +0 -2
- package/dist/extract-ZIpZAKsq.mjs.map +0 -1
- package/dist/generator/index.d.cts.map +0 -1
- package/dist/generator/index.d.mts.map +0 -1
- package/dist/generator/index.mjs.map +0 -1
- package/dist/generator-C5O_C4RV.d.cts.map +0 -1
- package/dist/generator-DZI01B4_.d.mts.map +0 -1
- package/dist/sink/index.d.cts.map +0 -1
- package/dist/sink/index.d.mts.map +0 -1
- package/dist/source/index.d.cts.map +0 -1
- package/dist/source/index.d.mts.map +0 -1
- package/dist/types-B2MtSxCp.d.cts +0 -47
- package/dist/types-B2MtSxCp.d.cts.map +0 -1
- package/dist/types-B2MtSxCp.d.mts +0 -47
- package/dist/types-B2MtSxCp.d.mts.map +0 -1
- package/dist/types-DJo-IRmS.d.cts +0 -47
- package/dist/types-DJo-IRmS.d.cts.map +0 -1
- package/dist/types-DJo-IRmS.d.mts +0 -47
- package/dist/types-DJo-IRmS.d.mts.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"../create-BR4IeVl4.mjs";import{createSink as t}from"../sink/create.mjs";import{createSource as n}from"../source/create.mjs";import{isGeneratorInputObject as r}from"./helpers.mjs";import{load as i}from"@stryke/resolve/load";import{isFunction as a}from"@stryke/type-checks/is-function";async function o(o,s={}){let c;c=r(o)?o:await i(o,s);let l=await e(c.schema,s),[u,d]=await Promise.all([n(l,c.source,s),t(l,c.sink,s)]);return{meta:c.meta,schema:l,source:u,sink:d,generate:async e=>{let t=a(u.source)?await u.source(e):u.source,n=typeof c.meta?.description==`function`?c.meta.description(t):c.meta?.description;return n&&console.log(`Generating ${n}...`),d.sink(t,e)}}}export{o as createGenerator};
|
|
2
|
+
//# sourceMappingURL=create.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@stryke/type-checks/is-set-object");function t(t){return(0,e.isSetObject)(t)&&`schema`in t&&`source`in t&&`sink`in t}exports.isGeneratorInputObject=t;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { r as GeneratorInputObject } from "../generator-Dq0PL5w6.cjs";
|
|
2
|
+
//#region src/generator/helpers.d.ts
|
|
3
|
+
declare function isGeneratorInputObject<TSpec, TOptions extends object, TReturns = void>(input: unknown): input is GeneratorInputObject<TSpec, TOptions, TReturns>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { isGeneratorInputObject };
|
|
6
|
+
//# sourceMappingURL=helpers.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.cts","names":[],"sources":["../../src/generator/helpers.ts"],"mappings":";;iBAqBgB,sBAAA,kDAId,KAAA,YAAiB,KAAA,IAAS,oBAAA,CAAqB,KAAA,EAAO,QAAA,EAAU,QAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { r as GeneratorInputObject } from "../generator-BGkKE8HQ.mjs";
|
|
2
|
+
//#region src/generator/helpers.d.ts
|
|
3
|
+
declare function isGeneratorInputObject<TSpec, TOptions extends object, TReturns = void>(input: unknown): input is GeneratorInputObject<TSpec, TOptions, TReturns>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { isGeneratorInputObject };
|
|
6
|
+
//# sourceMappingURL=helpers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/generator/helpers.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/generator/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("./create.cjs");exports.createGenerator=e.createGenerator;
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/generator/generator.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Creates a generator from raw schema/source/sink inputs and resolves all descriptors.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* This function is used to create a generator from raw schema, source, and sink inputs. It resolves all descriptors and returns a fully constructed generator that can be used to generate output based on the provided schema and options.
|
|
10
|
-
*
|
|
11
|
-
* @template TSpec - The type of the specification that the generator will produce.
|
|
12
|
-
* @template TOptions - The type of the options that will be passed to the generator during generation.
|
|
13
|
-
* @param input - The generator input containing schema, source, sink, and optional meta information.
|
|
14
|
-
* @param options - Optional extraction options for schema, source, and sink.
|
|
15
|
-
* @returns A promise that resolves to a fully constructed generator.
|
|
16
|
-
*/
|
|
17
|
-
declare function createGenerator<TSpec, TOptions = any>(input: GeneratorInput<TSpec, TOptions>, options?: ExtractOptions): Promise<Generator<TSpec, TOptions>>;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { createGenerator };
|
|
20
|
-
//# sourceMappingURL=index.d.cts.map
|
|
1
|
+
import { t as createGenerator } from "../create-BqRl9d7m.cjs";
|
|
2
|
+
export { createGenerator };
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region src/generator/generator.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Creates a generator from raw schema/source/sink inputs and resolves all descriptors.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* This function is used to create a generator from raw schema, source, and sink inputs. It resolves all descriptors and returns a fully constructed generator that can be used to generate output based on the provided schema and options.
|
|
10
|
-
*
|
|
11
|
-
* @template TSpec - The type of the specification that the generator will produce.
|
|
12
|
-
* @template TOptions - The type of the options that will be passed to the generator during generation.
|
|
13
|
-
* @param input - The generator input containing schema, source, sink, and optional meta information.
|
|
14
|
-
* @param options - Optional extraction options for schema, source, and sink.
|
|
15
|
-
* @returns A promise that resolves to a fully constructed generator.
|
|
16
|
-
*/
|
|
17
|
-
declare function createGenerator<TSpec, TOptions = any>(input: GeneratorInput<TSpec, TOptions>, options?: ExtractOptions): Promise<Generator<TSpec, TOptions>>;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { createGenerator };
|
|
20
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { t as createGenerator } from "../create-DcCu_zM3.mjs";
|
|
2
|
+
export { createGenerator };
|
package/dist/generator/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import{createGenerator as e}from"./create.mjs";export{e as createGenerator};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { s as SchemaOf } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
import { i as SinkInput, n as Sink } from "./sink-CHQncb8H.mjs";
|
|
3
|
+
import { i as SourceInput, n as Source } from "./source-BiOs3_-8.mjs";
|
|
4
|
+
import { SchemaInput } from "@power-plant/schema";
|
|
5
|
+
import { InferLoadOptions, LoadInput } from "@stryke/resolve/types";
|
|
4
6
|
|
|
5
7
|
//#region src/types/generator.d.ts
|
|
6
|
-
interface GeneratorMeta<TSpec> {
|
|
8
|
+
interface GeneratorMeta<TSpec, TOptions extends object> {
|
|
7
9
|
/**
|
|
8
10
|
* A string description (or a function that returns a string) outlining the purpose or behavior of the generator.
|
|
9
11
|
*/
|
|
10
12
|
description?: string | ((spec: TSpec) => string);
|
|
11
13
|
}
|
|
12
|
-
interface
|
|
14
|
+
interface GeneratorInputObject<TSpec, TOptions extends object, TReturns = void> {
|
|
13
15
|
/**
|
|
14
16
|
* Optional metadata about the generator, such as a description of the output it produces.
|
|
15
17
|
*/
|
|
16
|
-
meta?: GeneratorMeta<TSpec>;
|
|
18
|
+
meta?: GeneratorMeta<TSpec, TOptions>;
|
|
17
19
|
/**
|
|
18
20
|
* The schema input that defines the structure of the specification object for this generator.
|
|
19
21
|
*/
|
|
@@ -25,17 +27,19 @@ interface GeneratorInput<TSpec, TOptions = never> {
|
|
|
25
27
|
/**
|
|
26
28
|
* The sink input that consumes generated output.
|
|
27
29
|
*/
|
|
28
|
-
sink: SinkInput<TSpec, TOptions>;
|
|
30
|
+
sink: SinkInput<TSpec, TOptions, TReturns>;
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
type GeneratorInput<TSpec, TOptions extends object, TReturns = void> = LoadInput | GeneratorInputObject<TSpec, TOptions, TReturns>;
|
|
33
|
+
type InferCreateGeneratorOptions<T extends GeneratorInput<any, any, any>> = T extends LoadInput ? InferLoadOptions<T> : {};
|
|
34
|
+
interface Generator<TSpec, TOptions extends object, TReturns = void> {
|
|
31
35
|
/**
|
|
32
36
|
* Optional metadata about the generator, such as a description of the output it produces.
|
|
33
37
|
*/
|
|
34
|
-
meta?: GeneratorMeta<TSpec>;
|
|
38
|
+
meta?: GeneratorMeta<TSpec, TOptions>;
|
|
35
39
|
/**
|
|
36
40
|
* The schema input that defines the structure of the specification object for this generator.
|
|
37
41
|
*/
|
|
38
|
-
schema: SchemaOf<TSpec>;
|
|
42
|
+
schema: SchemaOf<TSpec, TOptions>;
|
|
39
43
|
/**
|
|
40
44
|
* The source of the generator, which can be used to specify where the generator retrieves its input data from. This can be defined as a function that takes the specification and returns a value, or it can be a static value.
|
|
41
45
|
*/
|
|
@@ -43,15 +47,15 @@ interface Generator<TSpec, TOptions = never> {
|
|
|
43
47
|
/**
|
|
44
48
|
* The sink of the generator, which can be used to specify where the generator sends its output data. This can be defined as a function that takes the specification and returns a value, or it can be a static value.
|
|
45
49
|
*/
|
|
46
|
-
sink: Sink<TSpec, TOptions>;
|
|
50
|
+
sink: Sink<TSpec, TOptions, TReturns>;
|
|
47
51
|
/**
|
|
48
52
|
* The generate function that executes the generator logic, taking in options and producing output based on the source and sink definitions.
|
|
49
53
|
*
|
|
50
54
|
* @param options - The options to be passed to the generator, which can be used to influence the generation process.
|
|
51
55
|
* @returns A promise that resolves when the generation process is complete.
|
|
52
56
|
*/
|
|
53
|
-
generate: (options: TOptions) => Promise<
|
|
57
|
+
generate: (options: TOptions) => Promise<TReturns>;
|
|
54
58
|
}
|
|
55
59
|
//#endregion
|
|
56
|
-
export { GeneratorInput as n,
|
|
57
|
-
//# sourceMappingURL=generator-
|
|
60
|
+
export { InferCreateGeneratorOptions as a, GeneratorMeta as i, GeneratorInput as n, GeneratorInputObject as r, Generator as t };
|
|
61
|
+
//# sourceMappingURL=generator-BGkKE8HQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-BGkKE8HQ.d.mts","names":[],"sources":["../src/types/generator.ts"],"mappings":""}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { s as SchemaOf } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
import { i as SinkInput, n as Sink } from "./sink-DHpx94GM.cjs";
|
|
3
|
+
import { i as SourceInput, n as Source } from "./source-txi0ZuzR.cjs";
|
|
4
|
+
import { SchemaInput } from "@power-plant/schema";
|
|
5
|
+
import { InferLoadOptions, LoadInput } from "@stryke/resolve/types";
|
|
4
6
|
|
|
5
7
|
//#region src/types/generator.d.ts
|
|
6
|
-
interface GeneratorMeta<TSpec> {
|
|
8
|
+
interface GeneratorMeta<TSpec, TOptions extends object> {
|
|
7
9
|
/**
|
|
8
10
|
* A string description (or a function that returns a string) outlining the purpose or behavior of the generator.
|
|
9
11
|
*/
|
|
10
12
|
description?: string | ((spec: TSpec) => string);
|
|
11
13
|
}
|
|
12
|
-
interface
|
|
14
|
+
interface GeneratorInputObject<TSpec, TOptions extends object, TReturns = void> {
|
|
13
15
|
/**
|
|
14
16
|
* Optional metadata about the generator, such as a description of the output it produces.
|
|
15
17
|
*/
|
|
16
|
-
meta?: GeneratorMeta<TSpec>;
|
|
18
|
+
meta?: GeneratorMeta<TSpec, TOptions>;
|
|
17
19
|
/**
|
|
18
20
|
* The schema input that defines the structure of the specification object for this generator.
|
|
19
21
|
*/
|
|
@@ -25,17 +27,19 @@ interface GeneratorInput<TSpec, TOptions = never> {
|
|
|
25
27
|
/**
|
|
26
28
|
* The sink input that consumes generated output.
|
|
27
29
|
*/
|
|
28
|
-
sink: SinkInput<TSpec, TOptions>;
|
|
30
|
+
sink: SinkInput<TSpec, TOptions, TReturns>;
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
type GeneratorInput<TSpec, TOptions extends object, TReturns = void> = LoadInput | GeneratorInputObject<TSpec, TOptions, TReturns>;
|
|
33
|
+
type InferCreateGeneratorOptions<T extends GeneratorInput<any, any, any>> = T extends LoadInput ? InferLoadOptions<T> : {};
|
|
34
|
+
interface Generator<TSpec, TOptions extends object, TReturns = void> {
|
|
31
35
|
/**
|
|
32
36
|
* Optional metadata about the generator, such as a description of the output it produces.
|
|
33
37
|
*/
|
|
34
|
-
meta?: GeneratorMeta<TSpec>;
|
|
38
|
+
meta?: GeneratorMeta<TSpec, TOptions>;
|
|
35
39
|
/**
|
|
36
40
|
* The schema input that defines the structure of the specification object for this generator.
|
|
37
41
|
*/
|
|
38
|
-
schema: SchemaOf<TSpec>;
|
|
42
|
+
schema: SchemaOf<TSpec, TOptions>;
|
|
39
43
|
/**
|
|
40
44
|
* The source of the generator, which can be used to specify where the generator retrieves its input data from. This can be defined as a function that takes the specification and returns a value, or it can be a static value.
|
|
41
45
|
*/
|
|
@@ -43,15 +47,15 @@ interface Generator<TSpec, TOptions = never> {
|
|
|
43
47
|
/**
|
|
44
48
|
* The sink of the generator, which can be used to specify where the generator sends its output data. This can be defined as a function that takes the specification and returns a value, or it can be a static value.
|
|
45
49
|
*/
|
|
46
|
-
sink: Sink<TSpec, TOptions>;
|
|
50
|
+
sink: Sink<TSpec, TOptions, TReturns>;
|
|
47
51
|
/**
|
|
48
52
|
* The generate function that executes the generator logic, taking in options and producing output based on the source and sink definitions.
|
|
49
53
|
*
|
|
50
54
|
* @param options - The options to be passed to the generator, which can be used to influence the generation process.
|
|
51
55
|
* @returns A promise that resolves when the generation process is complete.
|
|
52
56
|
*/
|
|
53
|
-
generate: (options: TOptions) => Promise<
|
|
57
|
+
generate: (options: TOptions) => Promise<TReturns>;
|
|
54
58
|
}
|
|
55
59
|
//#endregion
|
|
56
|
-
export { GeneratorInput as n,
|
|
57
|
-
//# sourceMappingURL=generator-
|
|
60
|
+
export { InferCreateGeneratorOptions as a, GeneratorMeta as i, GeneratorInput as n, GeneratorInputObject as r, Generator as t };
|
|
61
|
+
//# sourceMappingURL=generator-Dq0PL5w6.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-Dq0PL5w6.d.cts","names":[],"sources":["../src/types/generator.ts"],"mappings":";;;;;;;UAyBiB,aAAA;;AAAjB;;EAIE,WAAA,cAAyB,IAAA,EAAM,KAAK;AAAA;AAAA,UAGrB,oBAAA;EAPqB;;;EAepC,IAAA,GAAO,aAAA,CAAc,KAAA,EAAO,QAAA;EAXQ;AAAA;AAGtC;EAaE,MAAA,EAAQ,WAAA,CAAY,KAAA;EAbe;;;EAkBnC,MAAA,EAAQ,WAAA,CAAY,KAAA,EAAO,QAAA;EALP;;;EAUpB,IAAA,EAAM,SAAA,CAAU,KAAA,EAAO,QAAA,EAAU,QAAA;AAAA;AAAA,KAGvB,cAAA,oDACR,SAAA,GACA,oBAAA,CAAqB,KAAA,EAAO,QAAA,EAAU,QAAA;AAAA,KAE9B,2BAAA,WACA,cAAA,mBACR,CAAA,SAAU,SAAA,GACV,gBAAA,CAAiB,CAAA;AAAA,UAIJ,SAAA;EAdT;;;EAkBN,IAAA,GAAO,aAAA,CAAc,KAAA,EAAO,QAAA;EAvC5B;;;EA4CA,MAAA,EAAQ,QAAA,CAAS,KAAA,EAAO,QAAA;EAtCH;;;EA2CrB,MAAA,EAAQ,MAAA,CAAO,KAAA,EAAO,QAAA;EAtCF;;;EA2CpB,IAAA,EAAM,IAAA,CAAK,KAAA,EAAO,QAAA,EAAU,QAAA;EAtCD;;;;;;EA8C3B,QAAA,GAAW,OAAA,EAAS,QAAA,KAAa,OAAA,CAAQ,QAAA;AAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { r as SchemaInputObject } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/schema/helpers.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the provided input is a {@link SchemaInputObject}.
|
|
6
|
+
*
|
|
7
|
+
* @param input - The input to check.
|
|
8
|
+
* @returns True if the input is a {@link SchemaInputObject}, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
declare function isSchemaInputObject<TSpec, TOptions extends object>(input: unknown): input is SchemaInputObject<TSpec, TOptions>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isSchemaInputObject as t };
|
|
13
|
+
//# sourceMappingURL=helpers-BqnQPaP5.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers-BqnQPaP5.d.cts","names":[],"sources":["../src/schema/helpers.ts"],"mappings":";;;;;AA2BA;;;;iBAAgB,mBAAA,iCACd,KAAA,YACC,KAAA,IAAS,iBAAA,CAAkB,KAAA,EAAO,QAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { r as SchemaInputObject } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/schema/helpers.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the provided input is a {@link SchemaInputObject}.
|
|
6
|
+
*
|
|
7
|
+
* @param input - The input to check.
|
|
8
|
+
* @returns True if the input is a {@link SchemaInputObject}, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
declare function isSchemaInputObject<TSpec, TOptions extends object>(input: unknown): input is SchemaInputObject<TSpec, TOptions>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { isSchemaInputObject as t };
|
|
13
|
+
//# sourceMappingURL=helpers-CgXgqnVu.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers-CgXgqnVu.d.mts","names":[],"sources":["../src/schema/helpers.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./create-23iLtMb_.cjs"),t=require("./schema/helpers.cjs"),n=require("./sink/create.cjs"),r=require("./source/create.cjs"),i=require("./generator/create.cjs");require("./generator/index.cjs");const a=require("./schema/define.cjs");require("./schema/index.cjs"),require("./sink/index.cjs");const o=require("./source/define.cjs");require("./source/index.cjs"),exports.createGenerator=i.createGenerator,exports.createSchema=e.t,exports.createSink=n.createSink,exports.createSource=r.createSource,exports.defineSchema=a.defineSchema,exports.defineSource=o.defineSource,exports.extractSchemaMeta=e.n,exports.extractSinkMeta=n.extractSinkMeta,exports.extractSourceMeta=r.extractSourceMeta,exports.isSchemaInputObject=t.isSchemaInputObject;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { createGenerator } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { a as SchemaMetaExample, c as Meta, d as MetaLink, f as MetaValue, i as SchemaMeta, l as MetaDeprecated, n as Schema, o as SchemaMetaInput, r as SchemaInputObject, s as SchemaOf, t as InferCreateSchemaOptions, u as MetaInput } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
import { a as SinkInputObject, i as SinkInput, n as Sink, o as SinkMeta, r as SinkFunction, s as SinkMetaInput, t as InferCreateSinkOptions } from "./sink-DHpx94GM.cjs";
|
|
3
|
+
import { a as SourceInputObject, i as SourceInput, n as Source, o as SourceMeta, r as SourceFunction, s as SourceMetaInput, t as InferCreateSourceOptions } from "./source-txi0ZuzR.cjs";
|
|
4
|
+
import { a as InferCreateGeneratorOptions, i as GeneratorMeta, n as GeneratorInput, r as GeneratorInputObject, t as Generator } from "./generator-Dq0PL5w6.cjs";
|
|
5
|
+
import { t as createGenerator } from "./create-BqRl9d7m.cjs";
|
|
6
|
+
import { n as extractSchemaMeta, t as createSchema } from "./create-Cz9qVT4m.cjs";
|
|
7
|
+
import { t as defineSchema } from "./define-BPfeEA9Z.cjs";
|
|
8
|
+
import { t as isSchemaInputObject } from "./helpers-BqnQPaP5.cjs";
|
|
9
|
+
import { n as extractSinkMeta, t as createSink } from "./create-DAGPeYVI.cjs";
|
|
10
|
+
import { n as extractSourceMeta, t as createSource } from "./create-DUt-efk7.cjs";
|
|
11
|
+
import { t as defineSource } from "./define-aWeW6VVo.cjs";
|
|
12
|
+
export { type Generator, type GeneratorInput, type GeneratorInputObject, type GeneratorMeta, type InferCreateGeneratorOptions, type InferCreateSchemaOptions, type InferCreateSinkOptions, type InferCreateSourceOptions, type Meta, type MetaDeprecated, type MetaInput, type MetaLink, type MetaValue, type Schema, type SchemaInputObject, type SchemaMeta, type SchemaMetaExample, type SchemaMetaInput, type SchemaOf, type Sink, type SinkFunction, type SinkInput, type SinkInputObject, type SinkMeta, type SinkMetaInput, type Source, type SourceFunction, type SourceInput, type SourceInputObject, type SourceMeta, type SourceMetaInput, createGenerator, createSchema, createSink, createSource, defineSchema, defineSource, extractSchemaMeta, extractSinkMeta, extractSourceMeta, isSchemaInputObject };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import { createGenerator } from "./
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { a as SchemaMetaExample, c as Meta, d as MetaLink, f as MetaValue, i as SchemaMeta, l as MetaDeprecated, n as Schema, o as SchemaMetaInput, r as SchemaInputObject, s as SchemaOf, t as InferCreateSchemaOptions, u as MetaInput } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
import { a as SinkInputObject, i as SinkInput, n as Sink, o as SinkMeta, r as SinkFunction, s as SinkMetaInput, t as InferCreateSinkOptions } from "./sink-CHQncb8H.mjs";
|
|
3
|
+
import { a as SourceInputObject, i as SourceInput, n as Source, o as SourceMeta, r as SourceFunction, s as SourceMetaInput, t as InferCreateSourceOptions } from "./source-BiOs3_-8.mjs";
|
|
4
|
+
import { a as InferCreateGeneratorOptions, i as GeneratorMeta, n as GeneratorInput, r as GeneratorInputObject, t as Generator } from "./generator-BGkKE8HQ.mjs";
|
|
5
|
+
import { t as createGenerator } from "./create-DcCu_zM3.mjs";
|
|
6
|
+
import { n as extractSchemaMeta, t as createSchema } from "./create-C-rR8nuY.mjs";
|
|
7
|
+
import { t as defineSchema } from "./define-CQZ042K5.mjs";
|
|
8
|
+
import { t as isSchemaInputObject } from "./helpers-CgXgqnVu.mjs";
|
|
9
|
+
import { n as extractSinkMeta, t as createSink } from "./create-DEe398aQ.mjs";
|
|
10
|
+
import { n as extractSourceMeta, t as createSource } from "./create-Qxy2mq7r.mjs";
|
|
11
|
+
import { t as defineSource } from "./define-Dw8JgVQ1.mjs";
|
|
12
|
+
export { type Generator, type GeneratorInput, type GeneratorInputObject, type GeneratorMeta, type InferCreateGeneratorOptions, type InferCreateSchemaOptions, type InferCreateSinkOptions, type InferCreateSourceOptions, type Meta, type MetaDeprecated, type MetaInput, type MetaLink, type MetaValue, type Schema, type SchemaInputObject, type SchemaMeta, type SchemaMetaExample, type SchemaMetaInput, type SchemaOf, type Sink, type SinkFunction, type SinkInput, type SinkInputObject, type SinkMeta, type SinkMetaInput, type Source, type SourceFunction, type SourceInput, type SourceInputObject, type SourceMeta, type SourceMetaInput, createGenerator, createSchema, createSink, createSource, defineSchema, defineSource, extractSchemaMeta, extractSinkMeta, extractSourceMeta, isSchemaInputObject };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./
|
|
1
|
+
import{n as e,t}from"./create-BR4IeVl4.mjs";import{isSchemaInputObject as n}from"./schema/helpers.mjs";import{createSink as r,extractSinkMeta as i}from"./sink/create.mjs";import{createSource as a,extractSourceMeta as o}from"./source/create.mjs";import{createGenerator as s}from"./generator/create.mjs";import"./generator/index.mjs";import{defineSchema as c}from"./schema/define.mjs";import"./schema/index.mjs";import"./sink/index.mjs";import{defineSource as l}from"./source/define.mjs";import"./source/index.mjs";export{s as createGenerator,t as createSchema,r as createSink,a as createSource,c as defineSchema,l as defineSource,e as extractSchemaMeta,i as extractSinkMeta,o as extractSourceMeta,n as isSchemaInputObject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../create-23iLtMb_.cjs");exports.createSchema=e.t,exports.extractSchemaMeta=e.n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"../create-BR4IeVl4.mjs";export{t as createSchema,e as extractSchemaMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers.cjs");function t(t){return e.isSchemaInputObject(t)?t:{schema:t}}exports.defineSchema=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@stryke/type-checks/is-set-object");function t(t){return(0,e.isSetObject)(t)&&`schema`in t&&t.schema!==void 0}exports.isSchemaInputObject=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../create-23iLtMb_.cjs"),t=require("./helpers.cjs"),n=require("./define.cjs");exports.createSchema=e.t,exports.defineSchema=n.defineSchema,exports.extractSchemaMeta=e.n,exports.isSchemaInputObject=t.isSchemaInputObject;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { n as extractSchemaMeta, t as createSchema } from "../create-Cz9qVT4m.cjs";
|
|
2
|
+
import { t as defineSchema } from "../define-BPfeEA9Z.cjs";
|
|
3
|
+
import { t as isSchemaInputObject } from "../helpers-BqnQPaP5.cjs";
|
|
4
|
+
export { createSchema, defineSchema, extractSchemaMeta, isSchemaInputObject };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { n as extractSchemaMeta, t as createSchema } from "../create-C-rR8nuY.mjs";
|
|
2
|
+
import { t as defineSchema } from "../define-CQZ042K5.mjs";
|
|
3
|
+
import { t as isSchemaInputObject } from "../helpers-CgXgqnVu.mjs";
|
|
4
|
+
export { createSchema, defineSchema, extractSchemaMeta, isSchemaInputObject };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"../create-BR4IeVl4.mjs";import{isSchemaInputObject as n}from"./helpers.mjs";import{defineSchema as r}from"./define.mjs";export{t as createSchema,r as defineSchema,e as extractSchemaMeta,n as isSchemaInputObject};
|