@inflector/aura 0.2.7 → 0.2.8
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/bin.d.ts.map +1 -1
- package/dist/bin.js +15 -2
- package/package.json +1 -1
package/dist/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AA+KA,wBAAgB,KAAK,CAAC,MAAM,UAAQ,
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AA+KA,wBAAgB,KAAK,CAAC,MAAM,UAAQ,QA0CnC;AAyaD,wBAAsB,GAAG,kBAsExB"}
|
package/dist/bin.js
CHANGED
|
@@ -159,8 +159,21 @@ export function build(silent = false) {
|
|
|
159
159
|
try {
|
|
160
160
|
const folder = join(process.cwd(), "Aura", "Functions");
|
|
161
161
|
const structure = scanFolderWithTypes(folder);
|
|
162
|
-
const
|
|
163
|
-
|
|
162
|
+
const header = `
|
|
163
|
+
import type { SSEHandler } from "@inflector/aura";
|
|
164
|
+
|
|
165
|
+
export type SSEStream<T> = {
|
|
166
|
+
onMessage(cb: SSEHandler<T>): Promise<void>;
|
|
167
|
+
abort(): void;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export type FnResult<TJson, TSse = never> =
|
|
171
|
+
TSse extends never
|
|
172
|
+
? Promise<TJson>
|
|
173
|
+
: Promise<TJson> | SSEStream<TSse>;
|
|
174
|
+
`.trimStart();
|
|
175
|
+
const body = objectToTypeWithReturn("AuraFunctions", structure);
|
|
176
|
+
const tsType = header + "\n\n" + body;
|
|
164
177
|
const generatedDir = join(process.cwd(), "Aura", ".generated");
|
|
165
178
|
if (!fs.existsSync(generatedDir)) {
|
|
166
179
|
fs.mkdirSync(generatedDir, { recursive: true });
|