@powerhousedao/vetra 6.0.0-dev.35 → 6.0.0-dev.37
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/processors/codegen/__tests__/codegen-processor-e2e.test.js +19 -2
- package/dist/processors/codegen/document-handlers/generators/constants.d.ts +1 -0
- package/dist/processors/codegen/document-handlers/generators/constants.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/constants.js +1 -0
- package/dist/processors/codegen/document-handlers/generators/processor-generator.d.ts.map +1 -1
- package/dist/processors/codegen/document-handlers/generators/processor-generator.js +9 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
|
@@ -290,7 +290,17 @@ describe("CodegenProcessorLegacy E2E Tests", () => {
|
|
|
290
290
|
};
|
|
291
291
|
await processor.onStrands([strand]);
|
|
292
292
|
await vi.runAllTimersAsync();
|
|
293
|
-
expect(generateProcessor).toHaveBeenCalledWith(
|
|
293
|
+
expect(generateProcessor).toHaveBeenCalledWith({
|
|
294
|
+
processorName: "Test Processor",
|
|
295
|
+
processorType: "analytics",
|
|
296
|
+
documentTypes: [
|
|
297
|
+
"powerhouse/document-model",
|
|
298
|
+
"powerhouse/budget-statement",
|
|
299
|
+
],
|
|
300
|
+
skipFormat: mockConfig.PH_CONFIG.skipFormat,
|
|
301
|
+
processorApp: "switchboard",
|
|
302
|
+
useTsMorph: USE_TS_MORPH,
|
|
303
|
+
});
|
|
294
304
|
});
|
|
295
305
|
it("should map relational type to relationalDb when processing processor strand", async () => {
|
|
296
306
|
const { generateProcessor } = await import("@powerhousedao/codegen");
|
|
@@ -309,7 +319,14 @@ describe("CodegenProcessorLegacy E2E Tests", () => {
|
|
|
309
319
|
};
|
|
310
320
|
await processor.onStrands([strand]);
|
|
311
321
|
await vi.runAllTimersAsync();
|
|
312
|
-
expect(generateProcessor).toHaveBeenCalledWith(
|
|
322
|
+
expect(generateProcessor).toHaveBeenCalledWith({
|
|
323
|
+
processorName: "Test Processor",
|
|
324
|
+
processorType: "relationalDb",
|
|
325
|
+
documentTypes: ["powerhouse/document-model"],
|
|
326
|
+
skipFormat: mockConfig.PH_CONFIG.skipFormat,
|
|
327
|
+
useTsMorph: USE_TS_MORPH,
|
|
328
|
+
processorApp: "switchboard",
|
|
329
|
+
});
|
|
313
330
|
});
|
|
314
331
|
it("should not call generateProcessor for unsupported processor type", async () => {
|
|
315
332
|
const { generateProcessor } = await import("@powerhousedao/codegen");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,eAAO,MAAM,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,OAAO,CAAC;AACjC,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,4BAA4B,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/processor-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,QAAQ,CAAC,sBAAsB,0BAA0B;IAEzD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO;IAsCnD,QAAQ,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"processor-generator.d.ts","sourceRoot":"","sources":["../../../../../processors/codegen/document-handlers/generators/processor-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,QAAQ,CAAC,sBAAsB,0BAA0B;IAEzD;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO;IAsCnD,QAAQ,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;CAoFjE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { generateProcessor } from "@powerhousedao/codegen";
|
|
2
2
|
import { logger } from "../../logger.js";
|
|
3
3
|
import { BaseDocumentGen } from "../base-document-gen.js";
|
|
4
|
-
import { USE_TS_MORPH } from "./constants.js";
|
|
4
|
+
import { TEMP_HARDCODED_PROCESSOR_APP, USE_TS_MORPH } from "./constants.js";
|
|
5
5
|
import { minimalBackupDocument } from "./utils.js";
|
|
6
6
|
/**
|
|
7
7
|
* Generator for processor documents
|
|
@@ -64,7 +64,14 @@ export class ProcessorGenerator extends BaseDocumentGen {
|
|
|
64
64
|
// Extract document types from the state
|
|
65
65
|
const documentTypes = state.documentTypes.map((dt) => dt.documentType);
|
|
66
66
|
// Generate the processor using the codegen function
|
|
67
|
-
await generateProcessor(
|
|
67
|
+
await generateProcessor({
|
|
68
|
+
processorName: state.name,
|
|
69
|
+
processorType,
|
|
70
|
+
documentTypes,
|
|
71
|
+
skipFormat: this.config.PH_CONFIG.skipFormat,
|
|
72
|
+
useTsMorph: USE_TS_MORPH,
|
|
73
|
+
processorApp: TEMP_HARDCODED_PROCESSOR_APP,
|
|
74
|
+
});
|
|
68
75
|
logger.info(`✅ Processor generation completed successfully for: ${state.name}`);
|
|
69
76
|
// Backup the document
|
|
70
77
|
await minimalBackupDocument({
|