@pogodisco/zephyr 1.5.14 → 1.5.16
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.
|
@@ -43,7 +43,7 @@ export type ModuleContext<Reg extends ActionRegistry, WFReg extends Record<strin
|
|
|
43
43
|
export type ExposedWorkflows<Own extends ModuleShape, Use extends ModuleMap, Expose extends Record<string, keyof DepWorkflows<Use>> | undefined> = Own & (Expose extends Record<string, keyof DepWorkflows<Use>> ? {
|
|
44
44
|
[K in keyof Expose]: DepWorkflows<Use>[Expose[K]];
|
|
45
45
|
} : {});
|
|
46
|
-
export declare function createModuleFactory<S extends ServiceRegistry>(): <Reg extends ActionRegistry
|
|
46
|
+
export declare function createModuleFactory<S extends ServiceRegistry>(): <Reg extends ActionRegistry, Use extends ModuleMap, Own extends ModuleShape, Expose extends Record<string, keyof DepWorkflows<Use>> | undefined = undefined>(config: {
|
|
47
47
|
actionRegistry: Reg;
|
|
48
48
|
use?: Use;
|
|
49
49
|
expose?: Expose;
|
package/dist/workflow-module.js
CHANGED
|
@@ -315,6 +315,9 @@ function createModule(config) {
|
|
|
315
315
|
wf,
|
|
316
316
|
services: {},
|
|
317
317
|
});
|
|
318
|
+
function mergePublic(own, exposed) {
|
|
319
|
+
return { ...own, ...exposed };
|
|
320
|
+
}
|
|
318
321
|
function buildWorkflowMap() {
|
|
319
322
|
const depWFs = Object.fromEntries(Object.entries(deps).flatMap(([name, mod]) => Object.entries(mod.__public).map(([k, wf]) => [`${name}.${k}`, wf])));
|
|
320
323
|
const internalBase = { ...own, ...depWFs };
|
|
@@ -329,7 +332,12 @@ function createModule(config) {
|
|
|
329
332
|
...internalBase,
|
|
330
333
|
...exposed,
|
|
331
334
|
};
|
|
332
|
-
const publicMap = { ...own, ...exposed }
|
|
335
|
+
// const publicMap = { ...own, ...exposed } as ExposedWorkflows<
|
|
336
|
+
// Own,
|
|
337
|
+
// Use,
|
|
338
|
+
// Expose
|
|
339
|
+
// >;
|
|
340
|
+
const publicMap = mergePublic(own, exposed);
|
|
333
341
|
return { internal, publicMap };
|
|
334
342
|
}
|
|
335
343
|
const { internal, publicMap } = buildWorkflowMap();
|