@power-plant/core 0.0.2 → 0.0.3

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.
Files changed (133) hide show
  1. package/README.md +220 -0
  2. package/dist/base-BKbfgxno.d.cts +28 -0
  3. package/dist/base-BKbfgxno.d.cts.map +1 -0
  4. package/dist/base-BKbfgxno.d.mts +28 -0
  5. package/dist/base-BKbfgxno.d.mts.map +1 -0
  6. package/dist/create-B14Jt6Iu.d.mts +17 -0
  7. package/dist/create-B14Jt6Iu.d.mts.map +1 -0
  8. package/dist/create-Cfgth9sz.d.cts +19 -0
  9. package/dist/create-Cfgth9sz.d.cts.map +1 -0
  10. package/dist/create-D32Jusq_.d.cts +17 -0
  11. package/dist/create-D32Jusq_.d.cts.map +1 -0
  12. package/dist/create-DVpg-3po.d.mts +19 -0
  13. package/dist/create-DVpg-3po.d.mts.map +1 -0
  14. package/dist/create-DoyLue8r.d.cts +17 -0
  15. package/dist/create-DoyLue8r.d.cts.map +1 -0
  16. package/dist/create-vgEDsShD.d.mts +17 -0
  17. package/dist/create-vgEDsShD.d.mts.map +1 -0
  18. package/dist/define-DEe-HPar.d.cts +38 -0
  19. package/dist/define-DEe-HPar.d.cts.map +1 -0
  20. package/dist/define-RneysDu1.d.mts +38 -0
  21. package/dist/define-RneysDu1.d.mts.map +1 -0
  22. package/dist/generator/create.cjs +1 -0
  23. package/dist/generator/create.d.cts +2 -0
  24. package/dist/generator/create.d.mts +2 -0
  25. package/dist/generator/create.mjs +2 -0
  26. package/dist/generator/create.mjs.map +1 -0
  27. package/dist/generator/helpers.cjs +1 -0
  28. package/dist/generator/helpers.d.cts +6 -0
  29. package/dist/generator/helpers.d.cts.map +1 -0
  30. package/dist/generator/helpers.d.mts +6 -0
  31. package/dist/generator/helpers.d.mts.map +1 -0
  32. package/dist/generator/helpers.mjs +2 -0
  33. package/dist/generator/helpers.mjs.map +1 -0
  34. package/dist/generator/index.cjs +1 -1
  35. package/dist/generator/index.d.cts +2 -20
  36. package/dist/generator/index.d.mts +2 -20
  37. package/dist/generator/index.mjs +1 -2
  38. package/dist/{generator-C5O_C4RV.d.cts → generator-C1_Q-QAb.d.cts} +15 -12
  39. package/dist/generator-C1_Q-QAb.d.cts.map +1 -0
  40. package/dist/{generator-DZI01B4_.d.mts → generator-MC25UERM.d.mts} +15 -12
  41. package/dist/generator-MC25UERM.d.mts.map +1 -0
  42. package/dist/index-BVVgDSdq.d.cts +1 -0
  43. package/dist/index-BVVgDSdq.d.mts +1 -0
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.d.cts +8 -8
  46. package/dist/index.d.mts +8 -8
  47. package/dist/index.mjs +1 -1
  48. package/dist/metadata-Cb6iMZqW.cjs +1 -0
  49. package/dist/metadata-Dmhrb3Kv.mjs +2 -0
  50. package/dist/metadata-Dmhrb3Kv.mjs.map +1 -0
  51. package/dist/sink/create.cjs +1 -0
  52. package/dist/sink/create.d.cts +2 -0
  53. package/dist/sink/create.d.mts +2 -0
  54. package/dist/sink/create.mjs +2 -0
  55. package/dist/sink/create.mjs.map +1 -0
  56. package/dist/sink/define.cjs +1 -0
  57. package/dist/sink/define.d.cts +37 -0
  58. package/dist/sink/define.d.cts.map +1 -0
  59. package/dist/sink/define.d.mts +37 -0
  60. package/dist/sink/define.d.mts.map +1 -0
  61. package/dist/sink/define.mjs +2 -0
  62. package/dist/sink/define.mjs.map +1 -0
  63. package/dist/sink/helpers.cjs +1 -0
  64. package/dist/sink/helpers.d.cts +13 -0
  65. package/dist/sink/helpers.d.cts.map +1 -0
  66. package/dist/sink/helpers.d.mts +13 -0
  67. package/dist/sink/helpers.d.mts.map +1 -0
  68. package/dist/sink/helpers.mjs +2 -0
  69. package/dist/sink/helpers.mjs.map +1 -0
  70. package/dist/sink/index.cjs +1 -1
  71. package/dist/sink/index.d.cts +2 -15
  72. package/dist/sink/index.d.mts +2 -15
  73. package/dist/sink/index.mjs +1 -1
  74. package/dist/sink-CAWlC7am.d.mts +58 -0
  75. package/dist/sink-CAWlC7am.d.mts.map +1 -0
  76. package/dist/sink-CTx7UtqU.d.cts +58 -0
  77. package/dist/sink-CTx7UtqU.d.cts.map +1 -0
  78. package/dist/source/create.cjs +1 -0
  79. package/dist/source/create.d.cts +2 -0
  80. package/dist/source/create.d.mts +2 -0
  81. package/dist/source/create.mjs +2 -0
  82. package/dist/source/create.mjs.map +1 -0
  83. package/dist/source/define.cjs +1 -0
  84. package/dist/source/define.d.cts +2 -0
  85. package/dist/source/define.d.mts +2 -0
  86. package/dist/source/define.mjs +2 -0
  87. package/dist/source/define.mjs.map +1 -0
  88. package/dist/source/helpers.cjs +1 -0
  89. package/dist/source/helpers.d.cts +13 -0
  90. package/dist/source/helpers.d.cts.map +1 -0
  91. package/dist/source/helpers.d.mts +13 -0
  92. package/dist/source/helpers.d.mts.map +1 -0
  93. package/dist/source/helpers.mjs +2 -0
  94. package/dist/source/helpers.mjs.map +1 -0
  95. package/dist/source/index.cjs +1 -1
  96. package/dist/source/index.d.cts +3 -16
  97. package/dist/source/index.d.mts +3 -16
  98. package/dist/source/index.mjs +1 -1
  99. package/dist/source-B3tctCZE.d.cts +57 -0
  100. package/dist/source-B3tctCZE.d.cts.map +1 -0
  101. package/dist/source-DjKhYXZ6.d.mts +57 -0
  102. package/dist/source-DjKhYXZ6.d.mts.map +1 -0
  103. package/package.json +127 -27
  104. package/dist/config.cjs +0 -0
  105. package/dist/config.d.cts +0 -10
  106. package/dist/config.d.cts.map +0 -1
  107. package/dist/config.d.mts +0 -10
  108. package/dist/config.d.mts.map +0 -1
  109. package/dist/config.mjs +0 -2
  110. package/dist/config.mjs.map +0 -1
  111. package/dist/extract-BzZLelb2.mjs +0 -2
  112. package/dist/extract-BzZLelb2.mjs.map +0 -1
  113. package/dist/extract-DUwG1ZUO.cjs +0 -1
  114. package/dist/extract-FkKA9g1K.cjs +0 -1
  115. package/dist/extract-ZIpZAKsq.mjs +0 -2
  116. package/dist/extract-ZIpZAKsq.mjs.map +0 -1
  117. package/dist/generator/index.d.cts.map +0 -1
  118. package/dist/generator/index.d.mts.map +0 -1
  119. package/dist/generator/index.mjs.map +0 -1
  120. package/dist/generator-C5O_C4RV.d.cts.map +0 -1
  121. package/dist/generator-DZI01B4_.d.mts.map +0 -1
  122. package/dist/sink/index.d.cts.map +0 -1
  123. package/dist/sink/index.d.mts.map +0 -1
  124. package/dist/source/index.d.cts.map +0 -1
  125. package/dist/source/index.d.mts.map +0 -1
  126. package/dist/types-B2MtSxCp.d.cts +0 -47
  127. package/dist/types-B2MtSxCp.d.cts.map +0 -1
  128. package/dist/types-B2MtSxCp.d.mts +0 -47
  129. package/dist/types-B2MtSxCp.d.mts.map +0 -1
  130. package/dist/types-DJo-IRmS.d.cts +0 -47
  131. package/dist/types-DJo-IRmS.d.cts.map +0 -1
  132. package/dist/types-DJo-IRmS.d.mts +0 -47
  133. package/dist/types-DJo-IRmS.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers.cjs");function t(t){return e.isSourceInputObject(t)?t:{source:t}}exports.defineSource=t;
@@ -0,0 +1,2 @@
1
+ import { t as defineSource } from "../define-DEe-HPar.cjs";
2
+ export { defineSource };
@@ -0,0 +1,2 @@
1
+ import { t as defineSource } from "../define-RneysDu1.mjs";
2
+ export { defineSource };
@@ -0,0 +1,2 @@
1
+ import{isSourceInputObject as e}from"./helpers.mjs";function t(t){return e(t)?t:{source:t}}export{t as defineSource};
2
+ //# sourceMappingURL=define.mjs.map
@@ -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)&&`source`in t&&t.source!==void 0}exports.isSourceInputObject=t;
@@ -0,0 +1,13 @@
1
+ import { a as SourceInputObject } from "../source-B3tctCZE.cjs";
2
+
3
+ //#region src/source/helpers.d.ts
4
+ /**
5
+ * Checks if the provided input is a {@link SourceInputObject}.
6
+ *
7
+ * @param input - The input to check.
8
+ * @returns True if the input is a {@link SourceInputObject}, false otherwise.
9
+ */
10
+ declare function isSourceInputObject<TSpec, TOptions extends object>(input: unknown): input is SourceInputObject<TSpec, TOptions>;
11
+ //#endregion
12
+ export { isSourceInputObject };
13
+ //# sourceMappingURL=helpers.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.cts","names":[],"sources":["../../src/source/helpers.ts"],"mappings":";;;;;AA2BA;;;;iBAAgB,mBAAA,iCACd,KAAA,YACC,KAAA,IAAS,iBAAA,CAAkB,KAAA,EAAO,QAAA"}
@@ -0,0 +1,13 @@
1
+ import { a as SourceInputObject } from "../source-DjKhYXZ6.mjs";
2
+
3
+ //#region src/source/helpers.d.ts
4
+ /**
5
+ * Checks if the provided input is a {@link SourceInputObject}.
6
+ *
7
+ * @param input - The input to check.
8
+ * @returns True if the input is a {@link SourceInputObject}, false otherwise.
9
+ */
10
+ declare function isSourceInputObject<TSpec, TOptions extends object>(input: unknown): input is SourceInputObject<TSpec, TOptions>;
11
+ //#endregion
12
+ export { isSourceInputObject };
13
+ //# sourceMappingURL=helpers.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.mts","names":[],"sources":["../../src/source/helpers.ts"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{isSetObject as e}from"@stryke/type-checks/is-set-object";function t(t){return e(t)&&`source`in t&&t.source!==void 0}export{t as isSourceInputObject};
2
+ //# sourceMappingURL=helpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../extract-FkKA9g1K.cjs");exports.VALID_SOURCE_FILE_EXTENSIONS=e.n,exports.extractSource=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./create.cjs"),t=require("./define.cjs");exports.createSource=e.createSource,exports.defineSource=t.defineSource,exports.extractSourceMeta=e.extractSourceMeta;
@@ -1,16 +1,3 @@
1
- import { a as SourceMeta, i as SourceInputWithMeta, n as SourceFunction, o as SourceValue, r as SourceInput, t as Source } from "../types-DJo-IRmS.cjs";
2
- import { SchemaOf } from "@power-plant/schema/types";
3
- import { ResolveOptions } from "@power-plant/schema/resolve";
4
-
5
- //#region src/source/constants.d.ts
6
- declare const VALID_SOURCE_FILE_EXTENSIONS: string[];
7
- //#endregion
8
- //#region src/source/extract.d.ts
9
- type SourceResolvedInput<TSpec, TOptions = never> = TSpec | Promise<TSpec> | SourceFunction<TSpec, TOptions>;
10
- /**
11
- * Normalizes any accepted source input into a concrete source descriptor.
12
- */
13
- declare function extractSource<TSpec, TOptions = never>(schema: SchemaOf<TSpec>, input: SourceInput<TSpec, TOptions>, options?: ResolveOptions): Promise<Source<TSpec, TOptions>>;
14
- //#endregion
15
- export { type Source, type SourceFunction, type SourceInput, type SourceInputWithMeta, type SourceMeta, SourceResolvedInput, type SourceValue, VALID_SOURCE_FILE_EXTENSIONS, extractSource };
16
- //# sourceMappingURL=index.d.cts.map
1
+ import { n as extractSourceMeta, t as createSource } from "../create-DoyLue8r.cjs";
2
+ import { t as defineSource } from "../define-DEe-HPar.cjs";
3
+ export { createSource, defineSource, extractSourceMeta };
@@ -1,16 +1,3 @@
1
- import { a as SourceMeta, i as SourceInputWithMeta, n as SourceFunction, o as SourceValue, r as SourceInput, t as Source } from "../types-DJo-IRmS.mjs";
2
- import { ResolveOptions } from "@power-plant/schema/resolve";
3
- import { SchemaOf } from "@power-plant/schema/types";
4
-
5
- //#region src/source/constants.d.ts
6
- declare const VALID_SOURCE_FILE_EXTENSIONS: string[];
7
- //#endregion
8
- //#region src/source/extract.d.ts
9
- type SourceResolvedInput<TSpec, TOptions = never> = TSpec | Promise<TSpec> | SourceFunction<TSpec, TOptions>;
10
- /**
11
- * Normalizes any accepted source input into a concrete source descriptor.
12
- */
13
- declare function extractSource<TSpec, TOptions = never>(schema: SchemaOf<TSpec>, input: SourceInput<TSpec, TOptions>, options?: ResolveOptions): Promise<Source<TSpec, TOptions>>;
14
- //#endregion
15
- export { type Source, type SourceFunction, type SourceInput, type SourceInputWithMeta, type SourceMeta, SourceResolvedInput, type SourceValue, VALID_SOURCE_FILE_EXTENSIONS, extractSource };
16
- //# sourceMappingURL=index.d.mts.map
1
+ import { n as extractSourceMeta, t as createSource } from "../create-vgEDsShD.mjs";
2
+ import { t as defineSource } from "../define-RneysDu1.mjs";
3
+ export { createSource, defineSource, extractSourceMeta };
@@ -1 +1 @@
1
- import{n as e,t}from"../extract-BzZLelb2.mjs";export{e as VALID_SOURCE_FILE_EXTENSIONS,t as extractSource};
1
+ import{createSource as e,extractSourceMeta as t}from"./create.mjs";import{defineSource as n}from"./define.mjs";export{e as createSource,n as defineSource,t as extractSourceMeta};
@@ -0,0 +1,57 @@
1
+ import { t as MaybePromise } from "./base-BKbfgxno.cjs";
2
+ import { InferLoadOptions, LoadInput } from "@stryke/resolve/types";
3
+ import { Meta, MetaInput, SchemaInput, SchemaOf } from "@power-plant/schema/types";
4
+
5
+ //#region src/types/source.d.ts
6
+ type SourceFunction<TSpec, TOptions extends object> = (options: TOptions) => MaybePromise<TSpec>;
7
+ interface SourceMetaInput<TSpec, TOptions extends object> extends MetaInput<TSpec> {
8
+ /**
9
+ * A string that describes how the specification will be extracted/generated. This property can provide context about the source of the specification, such as whether it is derived from a file, a database, an API, or any other source. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
10
+ */
11
+ input?: string;
12
+ }
13
+ interface SourceMeta<TSpec, TOptions extends object> extends Meta<TSpec> {
14
+ /**
15
+ * A string that describes how the specification will be extracted/generated. This property can provide context about the source of the specification, such as whether it is derived from a file, a database, an API, or any other source. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
16
+ */
17
+ input?: string;
18
+ }
19
+ interface SourceInputObject<TSpec, TOptions extends object> {
20
+ /**
21
+ * The schema that defines the structure of the specification input for the generator. This schema is used to validate the input specification and ensure that it conforms to the expected format before being processed by the generator.
22
+ */
23
+ schema?: SchemaInput<TSpec>;
24
+ /**
25
+ * The source implementation, either as a callable function, a static value, or a file reference.
26
+ */
27
+ source: TSpec | SourceFunction<TSpec, TOptions> | LoadInput;
28
+ /**
29
+ * Optional metadata that provides contextual information for the source.
30
+ */
31
+ meta?: SourceMetaInput<TSpec, TOptions>;
32
+ }
33
+ type SourceInput<TSpec, TOptions extends object> = LoadInput | TSpec | SourceFunction<TSpec, TOptions> | SourceInputObject<TSpec, TOptions>;
34
+ type InferCreateSourceOptions<T extends SourceInput<any, any>> = T extends LoadInput ? InferLoadOptions<T> : {};
35
+ interface Source<TSpec, TOptions extends object> {
36
+ /**
37
+ * The schema that defines the structure of the specification input for the generator. This schema is used to validate the input specification and ensure that it conforms to the expected format before being processed by the generator.
38
+ */
39
+ schema: SchemaOf<TSpec>;
40
+ /**
41
+ * Optional metadata that provides contextual information for the source.
42
+ */
43
+ meta?: SourceMeta<TSpec, TOptions>;
44
+ /**
45
+ * 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.
46
+ *
47
+ * @remarks
48
+ * The `source` property can be either a static value of type `TSpec` or a function that takes the specification object and returns a value of type `TSpec` or a promise that resolves to `TSpec`. This allows for flexibility in how the generator retrieves its input data, enabling both synchronous and asynchronous data retrieval based on the specification.
49
+ *
50
+ * @param options - The options object that can be used to influence the generation process.
51
+ * @returns A value or a promise that resolves to a value, which will be used as the input data for the generator.
52
+ */
53
+ source: TSpec | SourceFunction<TSpec, TOptions>;
54
+ }
55
+ //#endregion
56
+ export { SourceInputObject as a, SourceInput as i, Source as n, SourceMeta as o, SourceFunction as r, SourceMetaInput as s, InferCreateSourceOptions as t };
57
+ //# sourceMappingURL=source-B3tctCZE.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-B3tctCZE.d.cts","names":[],"sources":["../src/types/source.ts"],"mappings":";;;;;KA2BY,cAAA,oCACV,OAAA,EAAS,QAAA,KACN,YAAA,CAAa,KAAA;AAAA,UAED,eAAA,yCAIP,SAAS,CAAC,KAAA;EARR;;;EAYV,KAAA;AAAA;AAAA,UAGe,UAAA,yCAIP,IAAI,CAAC,KAAA;EAjBE;;;EAqBf,KAAA;AAAA;AAAA,UAGe,iBAAA;EAxBZ;;;EA4BH,MAAA,GAAS,WAAA,CAAY,KAAA;EA1BN;;;EA+Bf,MAAA,EAAQ,KAAA,GAAQ,cAAA,CAAe,KAAA,EAAO,QAAA,IAAY,SAAA;EA9BlD;;;EAmCA,IAAA,GAAO,eAAA,CAAgB,KAAA,EAAO,QAAA;AAAA;AAAA,KAGpB,WAAA,mCACR,SAAA,GACA,KAAA,GACA,cAAA,CAAe,KAAA,EAAO,QAAA,IACtB,iBAAA,CAAkB,KAAA,EAAO,QAAA;AAAA,KAEjB,wBAAA,WAAmC,WAAA,cAC7C,CAAA,SAAU,SAAA,GACN,gBAAA,CAAiB,CAAA;AAAA,UAIN,MAAA;EAxCU;;;EA4CzB,MAAA,EAAQ,QAAA,CAAS,KAAA;EAzCjB;;;EA8CA,IAAA,GAAO,UAAA,CAAW,KAAA,EAAO,QAAA;EAzCpB;AAAA;AAGP;;;;;;;EAiDE,MAAA,EAAQ,KAAA,GAAQ,cAAA,CAAe,KAAA,EAAO,QAAA;AAAA"}
@@ -0,0 +1,57 @@
1
+ import { t as MaybePromise } from "./base-BKbfgxno.mjs";
2
+ import { InferLoadOptions, LoadInput } from "@stryke/resolve/types";
3
+ import { Meta, MetaInput, SchemaInput, SchemaOf } from "@power-plant/schema/types";
4
+
5
+ //#region src/types/source.d.ts
6
+ type SourceFunction<TSpec, TOptions extends object> = (options: TOptions) => MaybePromise<TSpec>;
7
+ interface SourceMetaInput<TSpec, TOptions extends object> extends MetaInput<TSpec> {
8
+ /**
9
+ * A string that describes how the specification will be extracted/generated. This property can provide context about the source of the specification, such as whether it is derived from a file, a database, an API, or any other source. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
10
+ */
11
+ input?: string;
12
+ }
13
+ interface SourceMeta<TSpec, TOptions extends object> extends Meta<TSpec> {
14
+ /**
15
+ * A string that describes how the specification will be extracted/generated. This property can provide context about the source of the specification, such as whether it is derived from a file, a database, an API, or any other source. The presence of this property does not affect the validation behavior of the schema itself, but it can provide additional context or information about the expected data when used in conjunction with compatible tools.
16
+ */
17
+ input?: string;
18
+ }
19
+ interface SourceInputObject<TSpec, TOptions extends object> {
20
+ /**
21
+ * The schema that defines the structure of the specification input for the generator. This schema is used to validate the input specification and ensure that it conforms to the expected format before being processed by the generator.
22
+ */
23
+ schema?: SchemaInput<TSpec>;
24
+ /**
25
+ * The source implementation, either as a callable function, a static value, or a file reference.
26
+ */
27
+ source: TSpec | SourceFunction<TSpec, TOptions> | LoadInput;
28
+ /**
29
+ * Optional metadata that provides contextual information for the source.
30
+ */
31
+ meta?: SourceMetaInput<TSpec, TOptions>;
32
+ }
33
+ type SourceInput<TSpec, TOptions extends object> = LoadInput | TSpec | SourceFunction<TSpec, TOptions> | SourceInputObject<TSpec, TOptions>;
34
+ type InferCreateSourceOptions<T extends SourceInput<any, any>> = T extends LoadInput ? InferLoadOptions<T> : {};
35
+ interface Source<TSpec, TOptions extends object> {
36
+ /**
37
+ * The schema that defines the structure of the specification input for the generator. This schema is used to validate the input specification and ensure that it conforms to the expected format before being processed by the generator.
38
+ */
39
+ schema: SchemaOf<TSpec>;
40
+ /**
41
+ * Optional metadata that provides contextual information for the source.
42
+ */
43
+ meta?: SourceMeta<TSpec, TOptions>;
44
+ /**
45
+ * 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.
46
+ *
47
+ * @remarks
48
+ * The `source` property can be either a static value of type `TSpec` or a function that takes the specification object and returns a value of type `TSpec` or a promise that resolves to `TSpec`. This allows for flexibility in how the generator retrieves its input data, enabling both synchronous and asynchronous data retrieval based on the specification.
49
+ *
50
+ * @param options - The options object that can be used to influence the generation process.
51
+ * @returns A value or a promise that resolves to a value, which will be used as the input data for the generator.
52
+ */
53
+ source: TSpec | SourceFunction<TSpec, TOptions>;
54
+ }
55
+ //#endregion
56
+ export { SourceInputObject as a, SourceInput as i, Source as n, SourceMeta as o, SourceFunction as r, SourceMetaInput as s, InferCreateSourceOptions as t };
57
+ //# sourceMappingURL=source-DjKhYXZ6.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-DjKhYXZ6.d.mts","names":[],"sources":["../src/types/source.ts"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@power-plant/core",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "description": "Core package for Power Plant",
6
6
  "keywords": ["power-plant", "powerlines", "storm-software"],
@@ -12,7 +12,7 @@
12
12
  "repository": {
13
13
  "type": "github",
14
14
  "url": "https://github.com/storm-software/power-plant.git",
15
- "directory": "packages/core"
15
+ "directory": "packages/base/core"
16
16
  },
17
17
  "funding": {
18
18
  "type": "github",
@@ -54,20 +54,6 @@
54
54
  "default": "./dist/index.mjs"
55
55
  }
56
56
  },
57
- "./config": {
58
- "require": {
59
- "types": "./dist/config.d.cts",
60
- "default": "./dist/config.cjs"
61
- },
62
- "import": {
63
- "types": "./dist/config.d.mts",
64
- "default": "./dist/config.mjs"
65
- },
66
- "default": {
67
- "types": "./dist/config.d.mts",
68
- "default": "./dist/config.mjs"
69
- }
70
- },
71
57
  "./generator": {
72
58
  "require": {
73
59
  "types": "./dist/generator/index.d.cts",
@@ -82,6 +68,34 @@
82
68
  "default": "./dist/generator/index.mjs"
83
69
  }
84
70
  },
71
+ "./generator/create": {
72
+ "require": {
73
+ "types": "./dist/generator/create.d.cts",
74
+ "default": "./dist/generator/create.cjs"
75
+ },
76
+ "import": {
77
+ "types": "./dist/generator/create.d.mts",
78
+ "default": "./dist/generator/create.mjs"
79
+ },
80
+ "default": {
81
+ "types": "./dist/generator/create.d.mts",
82
+ "default": "./dist/generator/create.mjs"
83
+ }
84
+ },
85
+ "./generator/helpers": {
86
+ "require": {
87
+ "types": "./dist/generator/helpers.d.cts",
88
+ "default": "./dist/generator/helpers.cjs"
89
+ },
90
+ "import": {
91
+ "types": "./dist/generator/helpers.d.mts",
92
+ "default": "./dist/generator/helpers.mjs"
93
+ },
94
+ "default": {
95
+ "types": "./dist/generator/helpers.d.mts",
96
+ "default": "./dist/generator/helpers.mjs"
97
+ }
98
+ },
85
99
  "./package.json": "./package.json",
86
100
  "./sink": {
87
101
  "require": {
@@ -97,6 +111,48 @@
97
111
  "default": "./dist/sink/index.mjs"
98
112
  }
99
113
  },
114
+ "./sink/create": {
115
+ "require": {
116
+ "types": "./dist/sink/create.d.cts",
117
+ "default": "./dist/sink/create.cjs"
118
+ },
119
+ "import": {
120
+ "types": "./dist/sink/create.d.mts",
121
+ "default": "./dist/sink/create.mjs"
122
+ },
123
+ "default": {
124
+ "types": "./dist/sink/create.d.mts",
125
+ "default": "./dist/sink/create.mjs"
126
+ }
127
+ },
128
+ "./sink/define": {
129
+ "require": {
130
+ "types": "./dist/sink/define.d.cts",
131
+ "default": "./dist/sink/define.cjs"
132
+ },
133
+ "import": {
134
+ "types": "./dist/sink/define.d.mts",
135
+ "default": "./dist/sink/define.mjs"
136
+ },
137
+ "default": {
138
+ "types": "./dist/sink/define.d.mts",
139
+ "default": "./dist/sink/define.mjs"
140
+ }
141
+ },
142
+ "./sink/helpers": {
143
+ "require": {
144
+ "types": "./dist/sink/helpers.d.cts",
145
+ "default": "./dist/sink/helpers.cjs"
146
+ },
147
+ "import": {
148
+ "types": "./dist/sink/helpers.d.mts",
149
+ "default": "./dist/sink/helpers.mjs"
150
+ },
151
+ "default": {
152
+ "types": "./dist/sink/helpers.d.mts",
153
+ "default": "./dist/sink/helpers.mjs"
154
+ }
155
+ },
100
156
  "./source": {
101
157
  "require": {
102
158
  "types": "./dist/source/index.d.cts",
@@ -110,6 +166,48 @@
110
166
  "types": "./dist/source/index.d.mts",
111
167
  "default": "./dist/source/index.mjs"
112
168
  }
169
+ },
170
+ "./source/create": {
171
+ "require": {
172
+ "types": "./dist/source/create.d.cts",
173
+ "default": "./dist/source/create.cjs"
174
+ },
175
+ "import": {
176
+ "types": "./dist/source/create.d.mts",
177
+ "default": "./dist/source/create.mjs"
178
+ },
179
+ "default": {
180
+ "types": "./dist/source/create.d.mts",
181
+ "default": "./dist/source/create.mjs"
182
+ }
183
+ },
184
+ "./source/define": {
185
+ "require": {
186
+ "types": "./dist/source/define.d.cts",
187
+ "default": "./dist/source/define.cjs"
188
+ },
189
+ "import": {
190
+ "types": "./dist/source/define.d.mts",
191
+ "default": "./dist/source/define.mjs"
192
+ },
193
+ "default": {
194
+ "types": "./dist/source/define.d.mts",
195
+ "default": "./dist/source/define.mjs"
196
+ }
197
+ },
198
+ "./source/helpers": {
199
+ "require": {
200
+ "types": "./dist/source/helpers.d.cts",
201
+ "default": "./dist/source/helpers.cjs"
202
+ },
203
+ "import": {
204
+ "types": "./dist/source/helpers.d.mts",
205
+ "default": "./dist/source/helpers.mjs"
206
+ },
207
+ "default": {
208
+ "types": "./dist/source/helpers.d.mts",
209
+ "default": "./dist/source/helpers.mjs"
210
+ }
113
211
  }
114
212
  },
115
213
  "main": "./dist/index.cjs",
@@ -121,30 +219,32 @@
121
219
  "@alloy-js/core": "^0.23.1",
122
220
  "@alloy-js/markdown": "^0.23.0",
123
221
  "@alloy-js/typescript": "^0.23.0",
124
- "@power-plant/schema": "^0.0.2",
222
+ "@power-plant/schema": "^0.0.3",
125
223
  "@powerlines/core": "^0.48.60",
126
224
  "@powerlines/engine": "^0.49.62",
127
225
  "@powerlines/plugin-alloy": "^0.26.232",
128
226
  "@powerlines/plugin-automd": "^0.1.600",
129
- "@stryke/convert": "^0.7.16",
130
- "@stryke/fs": "^0.33.86",
131
- "@stryke/helpers": "^0.10.25",
132
- "@stryke/json": "^0.15.9",
133
- "@stryke/path": "^0.29.12",
134
- "@stryke/string-format": "^0.17.27",
135
- "@stryke/type-checks": "^0.6.18",
136
- "@stryke/types": "^0.12.13",
227
+ "@stryke/convert": "^0.7.23",
228
+ "@stryke/fs": "^0.33.93",
229
+ "@stryke/helpers": "^0.10.32",
230
+ "@stryke/json": "^0.15.16",
231
+ "@stryke/path": "^0.29.19",
232
+ "@stryke/resolve": "^0.0.8",
233
+ "@stryke/string-format": "^0.17.34",
234
+ "@stryke/type-checks": "^0.6.25",
137
235
  "automd": "^0.4.3",
138
236
  "defu": "^6.1.7",
139
237
  "jiti": "^2.7.0",
140
- "powerlines": "^0.47.139",
238
+ "powerlines": "0.47.139",
141
239
  "tsdown": "^0.22.3"
142
240
  },
143
241
  "devDependencies": {
144
242
  "@powerlines/plugin-tsdown": "^0.1.540",
243
+ "@stryke/types": "^0.12.20",
145
244
  "@types/node": "^25.9.4",
146
245
  "typescript": "^6.0.3"
147
246
  },
148
247
  "publishConfig": { "access": "public" },
149
- "gitHead": "fed188fe5551ef432c38014dcc714161e4cb812d"
248
+ "inlinedDependencies": { "@stryke/types": "0.12.20" },
249
+ "gitHead": "43169e6b829afa991d5a0a3ea05a49b800aa9d44"
150
250
  }
package/dist/config.cjs DELETED
File without changes
package/dist/config.d.cts DELETED
@@ -1,10 +0,0 @@
1
- import { t as Generator } from "./generator-C5O_C4RV.cjs";
2
-
3
- //#region src/types/config.d.ts
4
- interface UserConfig<TSpec extends object> {
5
- spec: TSpec;
6
- generate: Generator<TSpec> | Generator<TSpec>[] | { [key in keyof TSpec]: Generator<TSpec[key]> | Generator<TSpec[key]>[] };
7
- }
8
- //#endregion
9
- export type { UserConfig };
10
- //# sourceMappingURL=config.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.cts","names":[],"sources":["../src/types/config.ts"],"mappings":";;;UAoBiB,UAAA;EACf,IAAA,EAAM,KAAA;EACN,QAAA,EACI,SAAA,CAAU,KAAA,IACV,SAAA,CAAU,KAAA,sBAEM,KAAA,GAAQ,SAAA,CAAU,KAAA,CAAM,GAAA,KAAQ,SAAA,CAAU,KAAA,CAAM,GAAA;AAAA"}
package/dist/config.d.mts DELETED
@@ -1,10 +0,0 @@
1
- import { t as Generator } from "./generator-DZI01B4_.mjs";
2
-
3
- //#region src/types/config.d.ts
4
- interface UserConfig<TSpec extends object> {
5
- spec: TSpec;
6
- generate: Generator<TSpec> | Generator<TSpec>[] | { [key in keyof TSpec]: Generator<TSpec[key]> | Generator<TSpec[key]>[] };
7
- }
8
- //#endregion
9
- export type { UserConfig };
10
- //# sourceMappingURL=config.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.mts","names":[],"sources":["../src/types/config.ts"],"mappings":""}
package/dist/config.mjs DELETED
@@ -1,2 +0,0 @@
1
- export{};
2
- //# sourceMappingURL=config.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{extractFileReference as e}from"@stryke/convert/extract-file-reference";import{findFileExtensionSafe as t}from"@stryke/path/find";import{existsSync as n}from"node:fs";import{resolveSafe as r}from"@power-plant/schema/resolve";import{createJiti as i}from"jiti";const a=[`ts`,`cts`,`mts`,`tsx`,`js`,`cjs`,`mjs`,`jsx`,`json`,`jsonc`,`json5`,`yaml`,`yml`,`toml`];function o(e){return typeof e==`object`&&!!e&&`file`in e&&typeof e.file==`string`}function s(e){if(typeof e==`string`){if(e.includes(`:`)||e.includes(`#`)||e.includes(`;`))return!0;let r=t(e);return!r||!a.includes(r)?!1:n(e)}return o(e)}function c(e){return typeof e==`object`&&!!e&&!o(e)&&`source`in e}async function l(n,o,l={}){let u=c(o)?o:{source:o,meta:void 0},d=u.source;if(s(d)){let o=e(d);if(!o)throw Error(`Failed to extract a file reference from the provided source input ${JSON.stringify(d)}.`);let s=t(o.file);if(s&&!a.includes(s))throw Error(`The provided source file input "${o.file}" has an invalid file extension (.${s}). Please ensure that the file has one of the following extensions: ${a.join(`, `)}.`);let c=await r(o,l);if(c===void 0){let e=await i(l.cwd??process.cwd()).import(o.file),t=o.export;t||=`default`,c=e[t]??e[`__Ω${t}`]??(t==="default"?e.default:void 0)}if(c===void 0)throw Error(`Failed to resolve source input from file reference "${o.file}".`);if(c instanceof Promise&&(c=await c),!c)throw Error(`Resolved source input from file reference "${o.file}" is invalid: ${JSON.stringify(c)}.`);return{schema:n,source:c,meta:u.meta}}return d instanceof Promise?{schema:n,source:await d,meta:u.meta}:{schema:n,source:d,meta:u.meta}}export{a as n,l as t};
2
- //# sourceMappingURL=extract-BzZLelb2.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-BzZLelb2.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +0,0 @@
1
- let e=require("@stryke/type-checks/is-function"),t=require("@power-plant/schema"),n=require("@stryke/convert/extract-file-reference"),r=require("@stryke/path/find"),i=require("node:fs");const a=[`ts`,`cts`,`mts`,`tsx`,`js`,`cjs`,`mjs`,`jsx`];function o(e){return typeof e==`object`&&!!e&&`file`in e&&typeof e.file==`string`}function s(e){if(typeof e==`string`){if(e.includes(`:`)||e.includes(`#`)||e.includes(`;`))return!0;let t=(0,r.findFileExtensionSafe)(e);return!t||!a.includes(t)?!1:(0,i.existsSync)(e)}return o(e)}function c(e){return typeof e==`object`&&!!e&&`sink`in e}async function l(i,o,l={}){let u=c(o)?o:{sink:o,meta:void 0},d=u.sink;if(s(d)){let o=(0,n.extractFileReference)(d);if(!o)throw Error(`Failed to extract a file reference from the provided sink input ${JSON.stringify(d)}.`);let s=(0,r.findFileExtensionSafe)(o.file);if(s&&!a.includes(s))throw Error(`The provided sink file input "${o.file}" has an invalid file extension (.${s}). Please ensure that the file has one of the following extensions: ${a.join(`, `)}.`);let c=await(0,t.resolve)(o,l);if(!(0,e.isFunction)(c))throw TypeError(`Resolved sink input from file reference "${o.file}" is invalid: ${JSON.stringify(c)}.`);return{schema:i,sink:c,meta:u.meta}}return{schema:i,sink:d,meta:u.meta}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -1 +0,0 @@
1
- let e=require("@stryke/convert/extract-file-reference"),t=require("@stryke/path/find"),n=require("node:fs"),r=require("@power-plant/schema/resolve"),i=require("jiti");const a=[`ts`,`cts`,`mts`,`tsx`,`js`,`cjs`,`mjs`,`jsx`,`json`,`jsonc`,`json5`,`yaml`,`yml`,`toml`];function o(e){return typeof e==`object`&&!!e&&`file`in e&&typeof e.file==`string`}function s(e){if(typeof e==`string`){if(e.includes(`:`)||e.includes(`#`)||e.includes(`;`))return!0;let r=(0,t.findFileExtensionSafe)(e);return!r||!a.includes(r)?!1:(0,n.existsSync)(e)}return o(e)}function c(e){return typeof e==`object`&&!!e&&!o(e)&&`source`in e}async function l(n,o,l={}){let u=c(o)?o:{source:o,meta:void 0},d=u.source;if(s(d)){let o=(0,e.extractFileReference)(d);if(!o)throw Error(`Failed to extract a file reference from the provided source input ${JSON.stringify(d)}.`);let s=(0,t.findFileExtensionSafe)(o.file);if(s&&!a.includes(s))throw Error(`The provided source file input "${o.file}" has an invalid file extension (.${s}). Please ensure that the file has one of the following extensions: ${a.join(`, `)}.`);let c=await(0,r.resolveSafe)(o,l);if(c===void 0){let e=await(0,i.createJiti)(l.cwd??process.cwd()).import(o.file),t=o.export;t||=`default`,c=e[t]??e[`__Ω${t}`]??(t==="default"?e.default:void 0)}if(c===void 0)throw Error(`Failed to resolve source input from file reference "${o.file}".`);if(c instanceof Promise&&(c=await c),!c)throw Error(`Resolved source input from file reference "${o.file}" is invalid: ${JSON.stringify(c)}.`);return{schema:n,source:c,meta:u.meta}}return d instanceof Promise?{schema:n,source:await d,meta:u.meta}:{schema:n,source:d,meta:u.meta}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
@@ -1,2 +0,0 @@
1
- import{isFunction as e}from"@stryke/type-checks/is-function";import{resolve as t}from"@power-plant/schema";import{extractFileReference as n}from"@stryke/convert/extract-file-reference";import{findFileExtensionSafe as r}from"@stryke/path/find";import{existsSync as i}from"node:fs";const a=[`ts`,`cts`,`mts`,`tsx`,`js`,`cjs`,`mjs`,`jsx`];function o(e){return typeof e==`object`&&!!e&&`file`in e&&typeof e.file==`string`}function s(e){if(typeof e==`string`){if(e.includes(`:`)||e.includes(`#`)||e.includes(`;`))return!0;let t=r(e);return!t||!a.includes(t)?!1:i(e)}return o(e)}function c(e){return typeof e==`object`&&!!e&&`sink`in e}async function l(i,o,l={}){let u=c(o)?o:{sink:o,meta:void 0},d=u.sink;if(s(d)){let o=n(d);if(!o)throw Error(`Failed to extract a file reference from the provided sink input ${JSON.stringify(d)}.`);let s=r(o.file);if(s&&!a.includes(s))throw Error(`The provided sink file input "${o.file}" has an invalid file extension (.${s}). Please ensure that the file has one of the following extensions: ${a.join(`, `)}.`);let c=await t(o,l);if(!e(c))throw TypeError(`Resolved sink input from file reference "${o.file}" is invalid: ${JSON.stringify(c)}.`);return{schema:i,sink:c,meta:u.meta}}return{schema:i,sink:d,meta:u.meta}}export{a as n,l as t};
2
- //# sourceMappingURL=extract-ZIpZAKsq.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extract-ZIpZAKsq.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/generator/generator.ts"],"mappings":";;;;;;AAqCA;;;;;;;;;;iBAAsB,eAAA,wBACpB,KAAA,EAAO,cAAA,CAAe,KAAA,EAAO,QAAA,GAC7B,OAAA,GAAU,cAAA,GACT,OAAA,CAAQ,SAAA,CAAU,KAAA,EAAO,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/generator/generator.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator-C5O_C4RV.d.cts","names":[],"sources":["../src/types/generator.ts"],"mappings":";;;;;UAsBiB,aAAA;;AAAjB;;EAIE,WAAA,cAAyB,IAAA,EAAM,KAAK;AAAA;AAAA,UAGrB,cAAA;EAHf;;;EAOA,IAAA,GAAO,aAAA,CAAc,KAAA;EAPe;AAGtC;;EASE,MAAA,EAAQ,WAAA,CAAY,KAAA;EALC;;;EAUrB,MAAA,EAAQ,WAAA,CAAY,KAAA,EAAO,QAAA;EAAP;;;EAKpB,IAAA,EAAM,SAAA,CAAU,KAAA,EAAO,QAAA;AAAA;AAAA,UAGR,SAAA;EAHA;;;EAOf,IAAA,GAAO,aAAA,CAAc,KAAA;EAtBrB;;;EA2BA,MAAA,EAAQ,QAAA,CAAS,KAAA;EAtBT;;;EA2BR,MAAA,EAAQ,MAAA,CAAO,KAAA,EAAO,QAAA;EAtBF;;;EA2BpB,IAAA,EAAM,IAAA,CAAK,KAAA,EAAO,QAAA;EAtBF;;;AAAe;AAGjC;;EA2BE,QAAA,GAAW,OAAA,EAAS,QAAA,KAAa,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator-DZI01B4_.d.mts","names":[],"sources":["../src/types/generator.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/sink/constants.ts","../../src/sink/extract.ts"],"mappings":";;;;;cAkBa,0BAAA;;;;;AAAb;iBC8CsB,WAAA,0BACpB,MAAA,EAAQ,QAAA,CAAS,KAAA,GACjB,KAAA,EAAO,SAAA,CAAU,KAAA,EAAO,QAAA,GACxB,OAAA,GAAS,cAAA,GACR,OAAA,CAAQ,IAAA,CAAK,KAAA,EAAO,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/sink/constants.ts","../../src/sink/extract.ts"],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/source/constants.ts","../../src/source/extract.ts"],"mappings":";;;;;cAkBa,4BAAA;;;KCgBD,mBAAA,4BACR,KAAA,GACA,OAAA,CAAQ,KAAA,IACR,cAAA,CAAe,KAAA,EAAO,QAAA;;ADnB1B;;iBC6DsB,aAAA,0BACpB,MAAA,EAAQ,QAAA,CAAS,KAAA,GACjB,KAAA,EAAO,WAAA,CAAY,KAAA,EAAO,QAAA,GAC1B,OAAA,GAAS,cAAA,GACR,OAAA,CAAQ,MAAA,CAAO,KAAA,EAAO,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/source/constants.ts","../../src/source/extract.ts"],"mappings":""}
@@ -1,47 +0,0 @@
1
- import { SchemaOf } from "@power-plant/schema/types";
2
- import { MaybePromise } from "@stryke/types/base";
3
- import { FileReferenceInput } from "@stryke/types/configuration";
4
-
5
- //#region src/sink/types.d.ts
6
- type SinkFunction<TSpec, TOptions = never> = TOptions extends never ? (spec: TSpec) => MaybePromise<TSpec> : (spec: TSpec, options: TOptions) => MaybePromise<void>;
7
- interface SinkMeta<TSpec, TOptions = never> {
8
- /**
9
- * A string description (or a function that returns a string) of the eventual output of the sink.
10
- */
11
- description?: string | (TOptions extends never ? (spec: TSpec) => string : (spec: TSpec, options: TOptions) => string);
12
- }
13
- interface SinkInputWithMeta<TSpec, TOptions = never> {
14
- /**
15
- * The sink implementation, either as a callable function or a file reference.
16
- */
17
- sink: SinkFunction<TSpec, TOptions> | FileReferenceInput;
18
- /**
19
- * Optional metadata that provides contextual information for the schema.
20
- */
21
- meta?: SinkMeta<TSpec, TOptions>;
22
- }
23
- type SinkInput<TSpec, TOptions = never> = FileReferenceInput | SinkFunction<TSpec, TOptions> | SinkInputWithMeta<TSpec, TOptions>;
24
- interface Sink<TSpec, TOptions = never> {
25
- /**
26
- * The schema that defines the structure of the specification input for the generator. This schema is used to validate the input specification and ensure that it conforms to the expected format before being processed by the generator.
27
- */
28
- schema: SchemaOf<TSpec>;
29
- /**
30
- * Optional metadata that provides contextual information for the schema.
31
- */
32
- meta?: SinkMeta<TSpec, TOptions>;
33
- /**
34
- * 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.
35
- *
36
- * @remarks
37
- * The `sink` property is defined as a function that takes the specification object and any additional parameters, and returns a value or a promise that resolves to a value. This allows for flexibility in how the generator sends its output data, enabling both synchronous and asynchronous data handling based on the specification.
38
- *
39
- * @param spec - The specification object that conforms to the defined schema input.
40
- * @param params - Additional parameters that may be needed for the sink function to process the output data.
41
- * @returns A value or a promise that resolves to a value, which will be used as the output data for the generator.
42
- */
43
- sink: SinkFunction<TSpec, TOptions>;
44
- }
45
- //#endregion
46
- export { SinkMeta as a, SinkInputWithMeta as i, SinkFunction as n, SinkInput as r, Sink as t };
47
- //# sourceMappingURL=types-B2MtSxCp.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-B2MtSxCp.d.cts","names":[],"sources":["../src/sink/types.ts"],"mappings":";;;;;KAsBY,YAAA,4BAAwC,QAAA,kBAC/C,IAAA,EAAM,KAAA,KAAU,YAAA,CAAa,KAAA,KAC7B,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,QAAA,KAAa,YAAA;AAAA,UAEvB,QAAA;EAJL;;;EAQV,WAAA,aAEK,QAAA,kBACI,IAAA,EAAM,KAAA,eACN,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,QAAA;AAAA;AAAA,UAGhB,iBAAA;EAdI;;;EAkBnB,IAAA,EAAM,YAAA,CAAa,KAAA,EAAO,QAAA,IAAY,kBAAA;EAjBY;;;EAsBlD,IAAA,GAAO,QAAA,CAAS,KAAA,EAAO,QAAA;AAAA;AAAA,KAGb,SAAA,4BACR,kBAAA,GACA,YAAA,CAAa,KAAA,EAAO,QAAA,IACpB,iBAAA,CAAkB,KAAA,EAAO,QAAA;AAAA,UAEZ,IAAA;EA/BI;;;EAmCnB,MAAA,EAAQ,QAAA,CAAS,KAAA;EAlCQ;;;EAuCzB,IAAA,GAAO,QAAA,CAAS,KAAA,EAAO,QAAA;EAvC2B;AAEpD;;;;;;;;;EAiDE,IAAA,EAAM,YAAA,CAAa,KAAA,EAAO,QAAA;AAAA"}