@auto-engineer/narrative 0.11.11
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/.turbo/turbo-build.log +9 -0
- package/.turbo/turbo-format.log +4 -0
- package/.turbo/turbo-lint.log +4 -0
- package/.turbo/turbo-test.log +14 -0
- package/.turbo/turbo-type-check.log +4 -0
- package/CHANGELOG.md +691 -0
- package/DEBUG.md +136 -0
- package/LICENSE +10 -0
- package/README.md +141 -0
- package/dist/scripts/build.d.ts +3 -0
- package/dist/scripts/build.d.ts.map +1 -0
- package/dist/scripts/build.js +71 -0
- package/dist/scripts/build.js.map +1 -0
- package/dist/scripts/convert-flow-exec.d.ts +3 -0
- package/dist/scripts/convert-flow-exec.d.ts.map +1 -0
- package/dist/scripts/convert-flow-exec.js +17 -0
- package/dist/scripts/convert-flow-exec.js.map +1 -0
- package/dist/scripts/convert-flow-helper.d.ts +3 -0
- package/dist/scripts/convert-flow-helper.d.ts.map +1 -0
- package/dist/scripts/convert-flow-helper.js +85 -0
- package/dist/scripts/convert-flow-helper.js.map +1 -0
- package/dist/scripts/convert-flow.d.ts +3 -0
- package/dist/scripts/convert-flow.d.ts.map +1 -0
- package/dist/scripts/convert-flow.js +108 -0
- package/dist/scripts/convert-flow.js.map +1 -0
- package/dist/scripts/print-schema.d.ts +2 -0
- package/dist/scripts/print-schema.d.ts.map +1 -0
- package/dist/scripts/print-schema.js +20 -0
- package/dist/scripts/print-schema.js.map +1 -0
- package/dist/src/commands/export-schema-helper.d.ts +2 -0
- package/dist/src/commands/export-schema-helper.d.ts.map +1 -0
- package/dist/src/commands/export-schema-helper.js +48 -0
- package/dist/src/commands/export-schema-helper.js.map +1 -0
- package/dist/src/commands/export-schema-runner.d.ts +3 -0
- package/dist/src/commands/export-schema-runner.d.ts.map +1 -0
- package/dist/src/commands/export-schema-runner.js +53 -0
- package/dist/src/commands/export-schema-runner.js.map +1 -0
- package/dist/src/commands/export-schema.d.ts +23 -0
- package/dist/src/commands/export-schema.d.ts.map +1 -0
- package/dist/src/commands/export-schema.js +124 -0
- package/dist/src/commands/export-schema.js.map +1 -0
- package/dist/src/commands/filestore.node.d.ts +3 -0
- package/dist/src/commands/filestore.node.d.ts.map +1 -0
- package/dist/src/commands/filestore.node.js +11 -0
- package/dist/src/commands/filestore.node.js.map +1 -0
- package/dist/src/data-flow-builders.d.ts +71 -0
- package/dist/src/data-flow-builders.d.ts.map +1 -0
- package/dist/src/data-flow-builders.js +326 -0
- package/dist/src/data-flow-builders.js.map +1 -0
- package/dist/src/data-narrative-builders.d.ts +71 -0
- package/dist/src/data-narrative-builders.d.ts.map +1 -0
- package/dist/src/data-narrative-builders.js +326 -0
- package/dist/src/data-narrative-builders.js.map +1 -0
- package/dist/src/flow-context.d.ts +25 -0
- package/dist/src/flow-context.d.ts.map +1 -0
- package/dist/src/flow-context.js +579 -0
- package/dist/src/flow-context.js.map +1 -0
- package/dist/src/flow-context.specs.d.ts +2 -0
- package/dist/src/flow-context.specs.d.ts.map +1 -0
- package/dist/src/flow-context.specs.js +185 -0
- package/dist/src/flow-context.specs.js.map +1 -0
- package/dist/src/flow-registry.d.ts +12 -0
- package/dist/src/flow-registry.d.ts.map +1 -0
- package/dist/src/flow-registry.js +46 -0
- package/dist/src/flow-registry.js.map +1 -0
- package/dist/src/flow.d.ts +49 -0
- package/dist/src/flow.d.ts.map +1 -0
- package/dist/src/flow.js +146 -0
- package/dist/src/flow.js.map +1 -0
- package/dist/src/fluent-builder.d.ts +35 -0
- package/dist/src/fluent-builder.d.ts.map +1 -0
- package/dist/src/fluent-builder.js +287 -0
- package/dist/src/fluent-builder.js.map +1 -0
- package/dist/src/fluent-builder.specs.d.ts +2 -0
- package/dist/src/fluent-builder.specs.d.ts.map +1 -0
- package/dist/src/fluent-builder.specs.js +28 -0
- package/dist/src/fluent-builder.specs.js.map +1 -0
- package/dist/src/getFlows.cache.specs.d.ts +2 -0
- package/dist/src/getFlows.cache.specs.d.ts.map +1 -0
- package/dist/src/getFlows.cache.specs.js +234 -0
- package/dist/src/getFlows.cache.specs.js.map +1 -0
- package/dist/src/getFlows.d.ts +21 -0
- package/dist/src/getFlows.d.ts.map +1 -0
- package/dist/src/getFlows.js +119 -0
- package/dist/src/getFlows.js.map +1 -0
- package/dist/src/getFlows.specs.d.ts +2 -0
- package/dist/src/getFlows.specs.d.ts.map +1 -0
- package/dist/src/getFlows.specs.js +1080 -0
- package/dist/src/getFlows.specs.js.map +1 -0
- package/dist/src/getNarratives.d.ts +21 -0
- package/dist/src/getNarratives.d.ts.map +1 -0
- package/dist/src/getNarratives.js +119 -0
- package/dist/src/getNarratives.js.map +1 -0
- package/dist/src/id/addAutoIds.d.ts +3 -0
- package/dist/src/id/addAutoIds.d.ts.map +1 -0
- package/dist/src/id/addAutoIds.js +47 -0
- package/dist/src/id/addAutoIds.js.map +1 -0
- package/dist/src/id/addAutoIds.specs.d.ts +2 -0
- package/dist/src/id/addAutoIds.specs.d.ts.map +1 -0
- package/dist/src/id/addAutoIds.specs.js +265 -0
- package/dist/src/id/addAutoIds.specs.js.map +1 -0
- package/dist/src/id/generators.d.ts +2 -0
- package/dist/src/id/generators.d.ts.map +1 -0
- package/dist/src/id/generators.js +5 -0
- package/dist/src/id/generators.js.map +1 -0
- package/dist/src/id/hasAllIds.d.ts +3 -0
- package/dist/src/id/hasAllIds.d.ts.map +1 -0
- package/dist/src/id/hasAllIds.js +19 -0
- package/dist/src/id/hasAllIds.js.map +1 -0
- package/dist/src/id/hasAllIds.specs.d.ts +2 -0
- package/dist/src/id/hasAllIds.specs.d.ts.map +1 -0
- package/dist/src/id/hasAllIds.specs.js +231 -0
- package/dist/src/id/hasAllIds.specs.js.map +1 -0
- package/dist/src/id/index.d.ts +3 -0
- package/dist/src/id/index.d.ts.map +1 -0
- package/dist/src/id/index.js +3 -0
- package/dist/src/id/index.js.map +1 -0
- package/dist/src/index.d.ts +45 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +31 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/integration-export-registry.d.ts +42 -0
- package/dist/src/integration-export-registry.d.ts.map +1 -0
- package/dist/src/integration-export-registry.js +74 -0
- package/dist/src/integration-export-registry.js.map +1 -0
- package/dist/src/integration-registry.d.ts +12 -0
- package/dist/src/integration-registry.d.ts.map +1 -0
- package/dist/src/integration-registry.js +42 -0
- package/dist/src/integration-registry.js.map +1 -0
- package/dist/src/loader/fs-path.d.ts +6 -0
- package/dist/src/loader/fs-path.d.ts.map +1 -0
- package/dist/src/loader/fs-path.js +28 -0
- package/dist/src/loader/fs-path.js.map +1 -0
- package/dist/src/loader/graph.d.ts +15 -0
- package/dist/src/loader/graph.d.ts.map +1 -0
- package/dist/src/loader/graph.js +292 -0
- package/dist/src/loader/graph.js.map +1 -0
- package/dist/src/loader/importmap.d.ts +2 -0
- package/dist/src/loader/importmap.d.ts.map +1 -0
- package/dist/src/loader/importmap.js +55 -0
- package/dist/src/loader/importmap.js.map +1 -0
- package/dist/src/loader/index.d.ts +9 -0
- package/dist/src/loader/index.d.ts.map +1 -0
- package/dist/src/loader/index.js +55 -0
- package/dist/src/loader/index.js.map +1 -0
- package/dist/src/loader/resolver.d.ts +4 -0
- package/dist/src/loader/resolver.d.ts.map +1 -0
- package/dist/src/loader/resolver.js +18 -0
- package/dist/src/loader/resolver.js.map +1 -0
- package/dist/src/loader/runtime-cjs.d.ts +3 -0
- package/dist/src/loader/runtime-cjs.d.ts.map +1 -0
- package/dist/src/loader/runtime-cjs.js +131 -0
- package/dist/src/loader/runtime-cjs.js.map +1 -0
- package/dist/src/loader/ts-utils.d.ts +39 -0
- package/dist/src/loader/ts-utils.d.ts.map +1 -0
- package/dist/src/loader/ts-utils.js +563 -0
- package/dist/src/loader/ts-utils.js.map +1 -0
- package/dist/src/loader/types.d.ts +23 -0
- package/dist/src/loader/types.d.ts.map +1 -0
- package/dist/src/loader/types.js +2 -0
- package/dist/src/loader/types.js.map +1 -0
- package/dist/src/loader/vfs-compiler-host.d.ts +5 -0
- package/dist/src/loader/vfs-compiler-host.d.ts.map +1 -0
- package/dist/src/loader/vfs-compiler-host.js +47 -0
- package/dist/src/loader/vfs-compiler-host.js.map +1 -0
- package/dist/src/model-to-flow.specs.d.ts +2 -0
- package/dist/src/model-to-flow.specs.d.ts.map +1 -0
- package/dist/src/model-to-flow.specs.js +1786 -0
- package/dist/src/model-to-flow.specs.js.map +1 -0
- package/dist/src/narrative-context.d.ts +25 -0
- package/dist/src/narrative-context.d.ts.map +1 -0
- package/dist/src/narrative-context.js +579 -0
- package/dist/src/narrative-context.js.map +1 -0
- package/dist/src/narrative-context.specs.d.ts +2 -0
- package/dist/src/narrative-context.specs.d.ts.map +1 -0
- package/dist/src/narrative-context.specs.js +185 -0
- package/dist/src/narrative-context.specs.js.map +1 -0
- package/dist/src/narrative-registry.d.ts +12 -0
- package/dist/src/narrative-registry.d.ts.map +1 -0
- package/dist/src/narrative-registry.js +46 -0
- package/dist/src/narrative-registry.js.map +1 -0
- package/dist/src/narrative.d.ts +49 -0
- package/dist/src/narrative.d.ts.map +1 -0
- package/dist/src/narrative.js +147 -0
- package/dist/src/narrative.js.map +1 -0
- package/dist/src/samples/items.flow.d.ts +2 -0
- package/dist/src/samples/items.flow.d.ts.map +1 -0
- package/dist/src/samples/items.flow.js +63 -0
- package/dist/src/samples/items.flow.js.map +1 -0
- package/dist/src/samples/mixed-given-types.flow.d.ts +2 -0
- package/dist/src/samples/mixed-given-types.flow.d.ts.map +1 -0
- package/dist/src/samples/mixed-given-types.flow.js +36 -0
- package/dist/src/samples/mixed-given-types.flow.js.map +1 -0
- package/dist/src/samples/place-order.flow.d.ts +25 -0
- package/dist/src/samples/place-order.flow.d.ts.map +1 -0
- package/dist/src/samples/place-order.flow.js +30 -0
- package/dist/src/samples/place-order.flow.js.map +1 -0
- package/dist/src/samples/questionnaires.flow.d.ts +2 -0
- package/dist/src/samples/questionnaires.flow.d.ts.map +1 -0
- package/dist/src/samples/questionnaires.flow.js +259 -0
- package/dist/src/samples/questionnaires.flow.js.map +1 -0
- package/dist/src/samples/seasonal-assistant.schema.json +737 -0
- package/dist/src/samples/test-with-ids.flow.d.ts +2 -0
- package/dist/src/samples/test-with-ids.flow.d.ts.map +1 -0
- package/dist/src/samples/test-with-ids.flow.js +80 -0
- package/dist/src/samples/test-with-ids.flow.js.map +1 -0
- package/dist/src/schema-test.d.ts +2 -0
- package/dist/src/schema-test.d.ts.map +1 -0
- package/dist/src/schema-test.js +57 -0
- package/dist/src/schema-test.js.map +1 -0
- package/dist/src/schema.d.ts +19393 -0
- package/dist/src/schema.d.ts.map +1 -0
- package/dist/src/schema.js +342 -0
- package/dist/src/schema.js.map +1 -0
- package/dist/src/slice-builder.d.ts +16 -0
- package/dist/src/slice-builder.d.ts.map +1 -0
- package/dist/src/slice-builder.js +72 -0
- package/dist/src/slice-builder.js.map +1 -0
- package/dist/src/testing.d.ts +32 -0
- package/dist/src/testing.d.ts.map +1 -0
- package/dist/src/testing.js +36 -0
- package/dist/src/testing.js.map +1 -0
- package/dist/src/transformers/flow-to-model/assemble.d.ts +3 -0
- package/dist/src/transformers/flow-to-model/assemble.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/assemble.js +9 -0
- package/dist/src/transformers/flow-to-model/assemble.js.map +1 -0
- package/dist/src/transformers/flow-to-model/debug.d.ts +3 -0
- package/dist/src/transformers/flow-to-model/debug.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/debug.js +6 -0
- package/dist/src/transformers/flow-to-model/debug.js.map +1 -0
- package/dist/src/transformers/flow-to-model/example-shapes.d.ts +6 -0
- package/dist/src/transformers/flow-to-model/example-shapes.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/example-shapes.js +60 -0
- package/dist/src/transformers/flow-to-model/example-shapes.js.map +1 -0
- package/dist/src/transformers/flow-to-model/guards.d.ts +15 -0
- package/dist/src/transformers/flow-to-model/guards.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/guards.js +18 -0
- package/dist/src/transformers/flow-to-model/guards.js.map +1 -0
- package/dist/src/transformers/flow-to-model/index.d.ts +4 -0
- package/dist/src/transformers/flow-to-model/index.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/index.js +193 -0
- package/dist/src/transformers/flow-to-model/index.js.map +1 -0
- package/dist/src/transformers/flow-to-model/inlining.d.ts +4 -0
- package/dist/src/transformers/flow-to-model/inlining.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/inlining.js +95 -0
- package/dist/src/transformers/flow-to-model/inlining.js.map +1 -0
- package/dist/src/transformers/flow-to-model/integrations.d.ts +36 -0
- package/dist/src/transformers/flow-to-model/integrations.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/integrations.js +147 -0
- package/dist/src/transformers/flow-to-model/integrations.js.map +1 -0
- package/dist/src/transformers/flow-to-model/messages.d.ts +5 -0
- package/dist/src/transformers/flow-to-model/messages.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/messages.js +88 -0
- package/dist/src/transformers/flow-to-model/messages.js.map +1 -0
- package/dist/src/transformers/flow-to-model/normalize.d.ts +3 -0
- package/dist/src/transformers/flow-to-model/normalize.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/normalize.js +23 -0
- package/dist/src/transformers/flow-to-model/normalize.js.map +1 -0
- package/dist/src/transformers/flow-to-model/spec-processors.d.ts +34 -0
- package/dist/src/transformers/flow-to-model/spec-processors.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/spec-processors.js +395 -0
- package/dist/src/transformers/flow-to-model/spec-processors.js.map +1 -0
- package/dist/src/transformers/flow-to-model/strings.d.ts +2 -0
- package/dist/src/transformers/flow-to-model/strings.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/strings.js +11 -0
- package/dist/src/transformers/flow-to-model/strings.js.map +1 -0
- package/dist/src/transformers/flow-to-model/type-inference.d.ts +3 -0
- package/dist/src/transformers/flow-to-model/type-inference.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/type-inference.js +92 -0
- package/dist/src/transformers/flow-to-model/type-inference.js.map +1 -0
- package/dist/src/transformers/flow-to-model/type-inference.specs.d.ts +2 -0
- package/dist/src/transformers/flow-to-model/type-inference.specs.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/type-inference.specs.js +167 -0
- package/dist/src/transformers/flow-to-model/type-inference.specs.js.map +1 -0
- package/dist/src/transformers/flow-to-model/zod-adapter.d.ts +6 -0
- package/dist/src/transformers/flow-to-model/zod-adapter.d.ts.map +1 -0
- package/dist/src/transformers/flow-to-model/zod-adapter.js +101 -0
- package/dist/src/transformers/flow-to-model/zod-adapter.js.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/extract-flow.d.ts +2 -0
- package/dist/src/transformers/model-to-flow/analysis/extract-flow.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/extract-flow.js +22 -0
- package/dist/src/transformers/model-to-flow/analysis/extract-flow.js.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/lint-helpers.d.ts +18 -0
- package/dist/src/transformers/model-to-flow/analysis/lint-helpers.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/lint-helpers.js +78 -0
- package/dist/src/transformers/model-to-flow/analysis/lint-helpers.js.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/type-decls.d.ts +7 -0
- package/dist/src/transformers/model-to-flow/analysis/type-decls.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/type-decls.js +74 -0
- package/dist/src/transformers/model-to-flow/analysis/type-decls.js.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/usage.d.ts +9 -0
- package/dist/src/transformers/model-to-flow/analysis/usage.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/analysis/usage.js +90 -0
- package/dist/src/transformers/model-to-flow/analysis/usage.js.map +1 -0
- package/dist/src/transformers/model-to-flow/ast/emit-helpers.d.ts +18 -0
- package/dist/src/transformers/model-to-flow/ast/emit-helpers.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/ast/emit-helpers.js +159 -0
- package/dist/src/transformers/model-to-flow/ast/emit-helpers.js.map +1 -0
- package/dist/src/transformers/model-to-flow/formatting/prettier.d.ts +2 -0
- package/dist/src/transformers/model-to-flow/formatting/prettier.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/formatting/prettier.js +26 -0
- package/dist/src/transformers/model-to-flow/formatting/prettier.js.map +1 -0
- package/dist/src/transformers/model-to-flow/formatting/sort-types.d.ts +6 -0
- package/dist/src/transformers/model-to-flow/formatting/sort-types.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/formatting/sort-types.js +17 -0
- package/dist/src/transformers/model-to-flow/formatting/sort-types.js.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/compose.d.ts +6 -0
- package/dist/src/transformers/model-to-flow/generators/compose.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/compose.js +79 -0
- package/dist/src/transformers/model-to-flow/generators/compose.js.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/flow.d.ts +15 -0
- package/dist/src/transformers/model-to-flow/generators/flow.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/flow.js +316 -0
- package/dist/src/transformers/model-to-flow/generators/flow.js.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/gwt.d.ts +57 -0
- package/dist/src/transformers/model-to-flow/generators/gwt.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/gwt.js +186 -0
- package/dist/src/transformers/model-to-flow/generators/gwt.js.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/imports.d.ts +16 -0
- package/dist/src/transformers/model-to-flow/generators/imports.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/imports.js +57 -0
- package/dist/src/transformers/model-to-flow/generators/imports.js.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/types.d.ts +13 -0
- package/dist/src/transformers/model-to-flow/generators/types.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/generators/types.js +22 -0
- package/dist/src/transformers/model-to-flow/generators/types.js.map +1 -0
- package/dist/src/transformers/model-to-flow/index.d.ts +13 -0
- package/dist/src/transformers/model-to-flow/index.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/index.js +25 -0
- package/dist/src/transformers/model-to-flow/index.js.map +1 -0
- package/dist/src/transformers/model-to-flow/utils/integration-extractor.d.ts +12 -0
- package/dist/src/transformers/model-to-flow/utils/integration-extractor.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/utils/integration-extractor.js +64 -0
- package/dist/src/transformers/model-to-flow/utils/integration-extractor.js.map +1 -0
- package/dist/src/transformers/model-to-flow/utils/strings.d.ts +9 -0
- package/dist/src/transformers/model-to-flow/utils/strings.d.ts.map +1 -0
- package/dist/src/transformers/model-to-flow/utils/strings.js +11 -0
- package/dist/src/transformers/model-to-flow/utils/strings.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/extract-flow.d.ts +2 -0
- package/dist/src/transformers/model-to-narrative/analysis/extract-flow.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/extract-flow.js +22 -0
- package/dist/src/transformers/model-to-narrative/analysis/extract-flow.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.d.ts +18 -0
- package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.js +78 -0
- package/dist/src/transformers/model-to-narrative/analysis/lint-helpers.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/type-decls.d.ts +7 -0
- package/dist/src/transformers/model-to-narrative/analysis/type-decls.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/type-decls.js +74 -0
- package/dist/src/transformers/model-to-narrative/analysis/type-decls.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/usage.d.ts +9 -0
- package/dist/src/transformers/model-to-narrative/analysis/usage.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/analysis/usage.js +90 -0
- package/dist/src/transformers/model-to-narrative/analysis/usage.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/ast/emit-helpers.d.ts +18 -0
- package/dist/src/transformers/model-to-narrative/ast/emit-helpers.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/ast/emit-helpers.js +159 -0
- package/dist/src/transformers/model-to-narrative/ast/emit-helpers.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/formatting/prettier.d.ts +2 -0
- package/dist/src/transformers/model-to-narrative/formatting/prettier.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/formatting/prettier.js +26 -0
- package/dist/src/transformers/model-to-narrative/formatting/prettier.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/formatting/sort-types.d.ts +6 -0
- package/dist/src/transformers/model-to-narrative/formatting/sort-types.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/formatting/sort-types.js +17 -0
- package/dist/src/transformers/model-to-narrative/formatting/sort-types.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/compose.d.ts +6 -0
- package/dist/src/transformers/model-to-narrative/generators/compose.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/compose.js +79 -0
- package/dist/src/transformers/model-to-narrative/generators/compose.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/flow.d.ts +15 -0
- package/dist/src/transformers/model-to-narrative/generators/flow.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/flow.js +316 -0
- package/dist/src/transformers/model-to-narrative/generators/flow.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.d.ts +57 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.js +186 -0
- package/dist/src/transformers/model-to-narrative/generators/gwt.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/imports.d.ts +16 -0
- package/dist/src/transformers/model-to-narrative/generators/imports.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/imports.js +57 -0
- package/dist/src/transformers/model-to-narrative/generators/imports.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/types.d.ts +13 -0
- package/dist/src/transformers/model-to-narrative/generators/types.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/generators/types.js +22 -0
- package/dist/src/transformers/model-to-narrative/generators/types.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/index.d.ts +13 -0
- package/dist/src/transformers/model-to-narrative/index.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/index.js +25 -0
- package/dist/src/transformers/model-to-narrative/index.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/utils/integration-extractor.d.ts +12 -0
- package/dist/src/transformers/model-to-narrative/utils/integration-extractor.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/utils/integration-extractor.js +64 -0
- package/dist/src/transformers/model-to-narrative/utils/integration-extractor.js.map +1 -0
- package/dist/src/transformers/model-to-narrative/utils/strings.d.ts +9 -0
- package/dist/src/transformers/model-to-narrative/utils/strings.d.ts.map +1 -0
- package/dist/src/transformers/model-to-narrative/utils/strings.js +11 -0
- package/dist/src/transformers/model-to-narrative/utils/strings.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/assemble.d.ts +3 -0
- package/dist/src/transformers/narrative-to-model/assemble.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/assemble.js +9 -0
- package/dist/src/transformers/narrative-to-model/assemble.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/debug.d.ts +3 -0
- package/dist/src/transformers/narrative-to-model/debug.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/debug.js +6 -0
- package/dist/src/transformers/narrative-to-model/debug.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/example-shapes.d.ts +6 -0
- package/dist/src/transformers/narrative-to-model/example-shapes.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/example-shapes.js +60 -0
- package/dist/src/transformers/narrative-to-model/example-shapes.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/guards.d.ts +15 -0
- package/dist/src/transformers/narrative-to-model/guards.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/guards.js +18 -0
- package/dist/src/transformers/narrative-to-model/guards.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/index.d.ts +4 -0
- package/dist/src/transformers/narrative-to-model/index.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/index.js +193 -0
- package/dist/src/transformers/narrative-to-model/index.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/inlining.d.ts +4 -0
- package/dist/src/transformers/narrative-to-model/inlining.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/inlining.js +95 -0
- package/dist/src/transformers/narrative-to-model/inlining.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/integrations.d.ts +36 -0
- package/dist/src/transformers/narrative-to-model/integrations.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/integrations.js +147 -0
- package/dist/src/transformers/narrative-to-model/integrations.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/messages.d.ts +5 -0
- package/dist/src/transformers/narrative-to-model/messages.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/messages.js +88 -0
- package/dist/src/transformers/narrative-to-model/messages.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/normalize.d.ts +3 -0
- package/dist/src/transformers/narrative-to-model/normalize.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/normalize.js +23 -0
- package/dist/src/transformers/narrative-to-model/normalize.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/spec-processors.d.ts +34 -0
- package/dist/src/transformers/narrative-to-model/spec-processors.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/spec-processors.js +395 -0
- package/dist/src/transformers/narrative-to-model/spec-processors.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/strings.d.ts +2 -0
- package/dist/src/transformers/narrative-to-model/strings.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/strings.js +11 -0
- package/dist/src/transformers/narrative-to-model/strings.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/type-inference.d.ts +3 -0
- package/dist/src/transformers/narrative-to-model/type-inference.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/type-inference.js +92 -0
- package/dist/src/transformers/narrative-to-model/type-inference.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/type-inference.specs.d.ts +2 -0
- package/dist/src/transformers/narrative-to-model/type-inference.specs.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/type-inference.specs.js +167 -0
- package/dist/src/transformers/narrative-to-model/type-inference.specs.js.map +1 -0
- package/dist/src/transformers/narrative-to-model/zod-adapter.d.ts +6 -0
- package/dist/src/transformers/narrative-to-model/zod-adapter.d.ts.map +1 -0
- package/dist/src/transformers/narrative-to-model/zod-adapter.js +101 -0
- package/dist/src/transformers/narrative-to-model/zod-adapter.js.map +1 -0
- package/dist/src/types.d.ts +143 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +36 -0
- package/dist/src/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eslint.config.ts +12 -0
- package/package.json +50 -0
- package/scripts/build.ts +84 -0
- package/scripts/convert-flow-exec.ts +17 -0
- package/scripts/convert-flow-helper.ts +93 -0
- package/scripts/convert-flow.ts +128 -0
- package/scripts/print-schema.ts +30 -0
- package/src/commands/export-schema-helper.ts +76 -0
- package/src/commands/export-schema-runner.ts +72 -0
- package/src/commands/export-schema.ts +157 -0
- package/src/commands/filestore.node.ts +12 -0
- package/src/data-narrative-builders.ts +418 -0
- package/src/fluent-builder.specs.ts +36 -0
- package/src/fluent-builder.ts +382 -0
- package/src/getFlows.cache.specs.ts +287 -0
- package/src/getFlows.specs.ts +1246 -0
- package/src/getNarratives.ts +186 -0
- package/src/id/addAutoIds.specs.ts +296 -0
- package/src/id/addAutoIds.ts +53 -0
- package/src/id/generators.ts +5 -0
- package/src/id/hasAllIds.specs.ts +267 -0
- package/src/id/hasAllIds.ts +23 -0
- package/src/id/index.ts +2 -0
- package/src/index.ts +131 -0
- package/src/integration-export-registry.ts +83 -0
- package/src/integration-registry.ts +53 -0
- package/src/loader/fs-path.ts +29 -0
- package/src/loader/graph.ts +379 -0
- package/src/loader/importmap.ts +68 -0
- package/src/loader/index.ts +81 -0
- package/src/loader/resolver.ts +22 -0
- package/src/loader/runtime-cjs.ts +151 -0
- package/src/loader/ts-utils.ts +770 -0
- package/src/loader/types.ts +20 -0
- package/src/loader/vfs-compiler-host.ts +51 -0
- package/src/model-to-flow.specs.ts +1822 -0
- package/src/narrative-context.specs.ts +226 -0
- package/src/narrative-context.ts +708 -0
- package/src/narrative-registry.ts +65 -0
- package/src/narrative.ts +236 -0
- package/src/samples/items.flow.ts +90 -0
- package/src/samples/mixed-given-types.flow.ts +70 -0
- package/src/samples/place-order.flow.ts +57 -0
- package/src/samples/questionnaires.flow.ts +359 -0
- package/src/samples/seasonal-assistant.schema.json +737 -0
- package/src/samples/test-with-ids.flow.ts +109 -0
- package/src/schema-test.ts +67 -0
- package/src/schema.ts +398 -0
- package/src/slice-builder.ts +100 -0
- package/src/testing.ts +40 -0
- package/src/transformers/model-to-narrative/analysis/extract-flow.ts +26 -0
- package/src/transformers/model-to-narrative/analysis/lint-helpers.ts +98 -0
- package/src/transformers/model-to-narrative/analysis/type-decls.ts +94 -0
- package/src/transformers/model-to-narrative/analysis/usage.ts +111 -0
- package/src/transformers/model-to-narrative/ast/emit-helpers.ts +199 -0
- package/src/transformers/model-to-narrative/formatting/prettier.ts +30 -0
- package/src/transformers/model-to-narrative/formatting/sort-types.ts +19 -0
- package/src/transformers/model-to-narrative/generators/compose.ts +124 -0
- package/src/transformers/model-to-narrative/generators/flow.ts +570 -0
- package/src/transformers/model-to-narrative/generators/gwt.ts +335 -0
- package/src/transformers/model-to-narrative/generators/imports.ts +110 -0
- package/src/transformers/model-to-narrative/generators/types.ts +48 -0
- package/src/transformers/model-to-narrative/index.ts +27 -0
- package/src/transformers/model-to-narrative/utils/integration-extractor.ts +67 -0
- package/src/transformers/model-to-narrative/utils/strings.ts +10 -0
- package/src/transformers/narrative-to-model/assemble.ts +10 -0
- package/src/transformers/narrative-to-model/debug.ts +6 -0
- package/src/transformers/narrative-to-model/example-shapes.ts +66 -0
- package/src/transformers/narrative-to-model/guards.ts +24 -0
- package/src/transformers/narrative-to-model/index.ts +274 -0
- package/src/transformers/narrative-to-model/inlining.ts +106 -0
- package/src/transformers/narrative-to-model/integrations.ts +201 -0
- package/src/transformers/narrative-to-model/messages.ts +104 -0
- package/src/transformers/narrative-to-model/normalize.ts +27 -0
- package/src/transformers/narrative-to-model/spec-processors.ts +648 -0
- package/src/transformers/narrative-to-model/strings.ts +11 -0
- package/src/transformers/narrative-to-model/type-inference.specs.ts +176 -0
- package/src/transformers/narrative-to-model/type-inference.ts +127 -0
- package/src/transformers/narrative-to-model/zod-adapter.ts +110 -0
- package/src/types.ts +226 -0
- package/tsconfig.json +11 -0
- package/tsconfig.test.json +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-to-flow.specs.js","sourceRoot":"","sources":["../../src/model-to-flow.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,MAAM,MAAM,0CAA0C,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC1D,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,MAAe,CAAC,CAAC;QAErD,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CACR,KAAK,EAAE,CAAC,6BAA6B,CAAC;iCACvC;6BACF;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,UAAU,EAAE,2BAA2B;oBACvC,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,sBAAsB;4BAC5B,EAAE,EAAE,gBAAgB;4BACpB,IAAI,EAAE,YAAY;4BAClB,MAAM,EAAE;gCACN,KAAK,EAAE;oCACL,IAAI,EAAE,EAAE;oCACR,KAAK,EAAE,CAAC,iCAAiC,CAAC;iCAC3C;6BACF;yBACF;qBACF;iBACF;aACF;YACD,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,EAAE;SACjB,CAAC;QAEF,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,gCAAgC,CAAC,CAAC;QAEtE,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DataItem } from './types';
|
|
2
|
+
import type { GivenTypeInfo } from './loader/ts-utils';
|
|
3
|
+
import { Narrative, Slice } from './index';
|
|
4
|
+
export declare function setGivenTypesByFile(types: Map<string, GivenTypeInfo[]>): void;
|
|
5
|
+
export declare function startNarrative(name: string, id?: string): Narrative;
|
|
6
|
+
export declare function getCurrentNarrative(): Narrative | null;
|
|
7
|
+
export declare function clearCurrentNarrative(): void;
|
|
8
|
+
export declare function getCurrentSlice(): Slice | null;
|
|
9
|
+
export declare function addSlice(slice: Slice): void;
|
|
10
|
+
export declare function startClientBlock(slice: Slice, description?: string): void;
|
|
11
|
+
export declare function endClientBlock(): void;
|
|
12
|
+
export declare function startServerBlock(slice: Slice, description?: string): void;
|
|
13
|
+
export declare function endServerBlock(): void;
|
|
14
|
+
export declare function pushSpec(description: string): void;
|
|
15
|
+
export declare function recordShouldBlock(description?: string): void;
|
|
16
|
+
export declare function setQueryRequest(request: string): void;
|
|
17
|
+
export declare function setSliceData(data: DataItem[]): void;
|
|
18
|
+
export declare function recordRule(description: string, id?: string): void;
|
|
19
|
+
export declare function recordExample(description: string): void;
|
|
20
|
+
export declare function recordGivenData(data: unknown[], contextParam?: Partial<Record<string, string>>): void;
|
|
21
|
+
export declare function recordAndGivenData(data: unknown[], contextParam?: Partial<Record<string, string>>): void;
|
|
22
|
+
export declare function recordWhenData(data: unknown, contextParam?: Partial<Record<string, string>>): void;
|
|
23
|
+
export declare function recordThenData(data: unknown[], contextParam?: Record<string, string>): void;
|
|
24
|
+
export declare function recordAndThenData(data: unknown[], contextParam?: Partial<Record<string, string>>): void;
|
|
25
|
+
//# sourceMappingURL=narrative-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narrative-context.d.ts","sourceRoot":"","sources":["../../src/narrative-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgC,QAAQ,EAAwB,MAAM,SAAS,CAAC;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAW,MAAM,SAAS,CAAC;AAgCpD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,GAAG,IAAI,CAU7E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAsBnE;AAED,wBAAgB,mBAAmB,IAAI,SAAS,GAAG,IAAI,CAEtD;AAED,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,wBAAgB,eAAe,IAAI,KAAK,GAAG,IAAI,CAG9C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAI3C;AAuDD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,GAAE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AE,OAAO,EAAE,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAiBvG"}
|
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import createDebug from 'debug';
|
|
2
|
+
function normalizeContext(context) {
|
|
3
|
+
if (!context)
|
|
4
|
+
return undefined;
|
|
5
|
+
const filtered = {};
|
|
6
|
+
for (const [key, value] of Object.entries(context)) {
|
|
7
|
+
if (value !== undefined) {
|
|
8
|
+
filtered[key] = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return Object.keys(filtered).length > 0 ? filtered : undefined;
|
|
12
|
+
}
|
|
13
|
+
const debug = createDebug('auto:narrative:context:given-types');
|
|
14
|
+
let context = null;
|
|
15
|
+
let givenTypesByFile = new Map();
|
|
16
|
+
let whenTypesByFile = new Map();
|
|
17
|
+
const givenCallCounters = new Map();
|
|
18
|
+
const whenCallCounters = new Map();
|
|
19
|
+
export function setGivenTypesByFile(types) {
|
|
20
|
+
const whenTypes = types.get('__whenTypes');
|
|
21
|
+
if (whenTypes) {
|
|
22
|
+
whenTypesByFile = whenTypes;
|
|
23
|
+
types.delete('__whenTypes');
|
|
24
|
+
}
|
|
25
|
+
givenTypesByFile = types;
|
|
26
|
+
givenCallCounters.clear();
|
|
27
|
+
whenCallCounters.clear();
|
|
28
|
+
}
|
|
29
|
+
export function startNarrative(name, id) {
|
|
30
|
+
const sourceFile = globalThis.__aeCurrentModulePath;
|
|
31
|
+
if (sourceFile !== null && sourceFile !== undefined && sourceFile !== '') {
|
|
32
|
+
givenCallCounters.set(sourceFile, 0);
|
|
33
|
+
whenCallCounters.set(sourceFile, 0);
|
|
34
|
+
}
|
|
35
|
+
const narrative = {
|
|
36
|
+
name,
|
|
37
|
+
id,
|
|
38
|
+
slices: [],
|
|
39
|
+
...(typeof sourceFile === 'string' ? { sourceFile } : {}),
|
|
40
|
+
};
|
|
41
|
+
context = {
|
|
42
|
+
narrative,
|
|
43
|
+
currentSliceIndex: null,
|
|
44
|
+
currentSpecTarget: null,
|
|
45
|
+
currentSpecIndex: null,
|
|
46
|
+
currentRuleIndex: null,
|
|
47
|
+
currentExampleIndex: null,
|
|
48
|
+
};
|
|
49
|
+
return narrative;
|
|
50
|
+
}
|
|
51
|
+
export function getCurrentNarrative() {
|
|
52
|
+
return context?.narrative ?? null;
|
|
53
|
+
}
|
|
54
|
+
export function clearCurrentNarrative() {
|
|
55
|
+
context = null;
|
|
56
|
+
}
|
|
57
|
+
export function getCurrentSlice() {
|
|
58
|
+
if (!context || context.currentSliceIndex === null)
|
|
59
|
+
return null;
|
|
60
|
+
return context.narrative.slices[context.currentSliceIndex] ?? null;
|
|
61
|
+
}
|
|
62
|
+
export function addSlice(slice) {
|
|
63
|
+
if (!context)
|
|
64
|
+
throw new Error('No active narrative');
|
|
65
|
+
context.narrative.slices.push(slice);
|
|
66
|
+
context.currentSliceIndex = context.narrative.slices.length - 1;
|
|
67
|
+
}
|
|
68
|
+
function getClientSpecs(slice) {
|
|
69
|
+
if (slice.type === 'command' || slice.type === 'query') {
|
|
70
|
+
return slice.client.specs;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
function getServerSpecs(slice) {
|
|
75
|
+
if ('server' in slice) {
|
|
76
|
+
return slice.server?.specs;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
function getCurrentSpecs(slice) {
|
|
81
|
+
if (!context?.currentSpecTarget)
|
|
82
|
+
return undefined;
|
|
83
|
+
switch (context.currentSpecTarget) {
|
|
84
|
+
case 'client':
|
|
85
|
+
return getClientSpecs(slice);
|
|
86
|
+
case 'server':
|
|
87
|
+
return getServerSpecs(slice);
|
|
88
|
+
default:
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function getCurrentExample(slice) {
|
|
93
|
+
if (!context ||
|
|
94
|
+
context.currentSpecIndex === null ||
|
|
95
|
+
context.currentRuleIndex === null ||
|
|
96
|
+
context.currentExampleIndex === null) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
const spec = getCurrentSpecs(slice);
|
|
100
|
+
if (!spec)
|
|
101
|
+
return undefined;
|
|
102
|
+
// Only server specs have object rules with examples
|
|
103
|
+
if (context.currentSpecTarget === 'server') {
|
|
104
|
+
const objectRules = spec.rules;
|
|
105
|
+
return objectRules[context.currentRuleIndex]?.examples[context.currentExampleIndex];
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
export function startClientBlock(slice, description = '') {
|
|
110
|
+
if (!context)
|
|
111
|
+
throw new Error('No active flow context');
|
|
112
|
+
if (slice.type === 'command' || slice.type === 'query') {
|
|
113
|
+
slice.client = {
|
|
114
|
+
description,
|
|
115
|
+
specs: undefined,
|
|
116
|
+
};
|
|
117
|
+
context.currentSpecTarget = 'client';
|
|
118
|
+
}
|
|
119
|
+
else if (slice.type === 'experience') {
|
|
120
|
+
slice.client = {
|
|
121
|
+
description: description || undefined,
|
|
122
|
+
specs: undefined,
|
|
123
|
+
};
|
|
124
|
+
context.currentSpecTarget = 'client';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function endClientBlock() {
|
|
128
|
+
if (context) {
|
|
129
|
+
context.currentSpecTarget = null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export function startServerBlock(slice, description = '') {
|
|
133
|
+
if (!context)
|
|
134
|
+
throw new Error('No active flow context');
|
|
135
|
+
if (slice.type === 'command') {
|
|
136
|
+
slice.server = {
|
|
137
|
+
description,
|
|
138
|
+
specs: { name: '', rules: [] },
|
|
139
|
+
data: undefined,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
else if (slice.type === 'query') {
|
|
143
|
+
slice.server = {
|
|
144
|
+
description,
|
|
145
|
+
specs: { name: '', rules: [] },
|
|
146
|
+
data: undefined,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
else if (slice.type === 'react') {
|
|
150
|
+
slice.server = {
|
|
151
|
+
description: description || undefined,
|
|
152
|
+
specs: { name: '', rules: [] },
|
|
153
|
+
data: undefined,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
context.currentSpecTarget = 'server';
|
|
157
|
+
}
|
|
158
|
+
export function endServerBlock() {
|
|
159
|
+
if (context) {
|
|
160
|
+
context.currentSpecTarget = null;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
function initializeClientSpecs(slice, description) {
|
|
164
|
+
if (slice.type === 'command' || slice.type === 'query') {
|
|
165
|
+
slice.client.specs = {
|
|
166
|
+
name: description,
|
|
167
|
+
rules: [],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
else if (slice.type === 'experience') {
|
|
171
|
+
if (slice.client == null) {
|
|
172
|
+
slice.client = { description: '', specs: undefined };
|
|
173
|
+
}
|
|
174
|
+
slice.client.specs = {
|
|
175
|
+
name: description,
|
|
176
|
+
rules: [],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function initializeServerSpecs(slice, description) {
|
|
181
|
+
if ('server' in slice && slice.server != null) {
|
|
182
|
+
slice.server.specs = {
|
|
183
|
+
name: description,
|
|
184
|
+
rules: [],
|
|
185
|
+
};
|
|
186
|
+
if (context)
|
|
187
|
+
context.currentSpecIndex = 0;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
export function pushSpec(description) {
|
|
191
|
+
if (!context || !context.currentSpecTarget)
|
|
192
|
+
throw new Error('No active spec target');
|
|
193
|
+
const slice = getCurrentSlice();
|
|
194
|
+
if (!slice)
|
|
195
|
+
throw new Error('No active slice');
|
|
196
|
+
switch (context.currentSpecTarget) {
|
|
197
|
+
case 'client':
|
|
198
|
+
initializeClientSpecs(slice, description);
|
|
199
|
+
break;
|
|
200
|
+
case 'server':
|
|
201
|
+
initializeServerSpecs(slice, description);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
export function recordShouldBlock(description) {
|
|
206
|
+
if (typeof description === 'string' && context?.currentSpecTarget === 'client') {
|
|
207
|
+
const slice = getCurrentSlice();
|
|
208
|
+
if (slice && (slice.type === 'command' || slice.type === 'query' || slice.type === 'experience')) {
|
|
209
|
+
if (!slice.client.specs) {
|
|
210
|
+
slice.client.specs = {
|
|
211
|
+
name: '',
|
|
212
|
+
rules: [],
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
slice.client.specs.rules.push(description);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
export function setQueryRequest(request) {
|
|
220
|
+
const slice = getCurrentSlice();
|
|
221
|
+
if (!slice || slice.type !== 'query')
|
|
222
|
+
throw new Error('Request can only be set on query slices');
|
|
223
|
+
slice.request = request;
|
|
224
|
+
}
|
|
225
|
+
export function setSliceData(data) {
|
|
226
|
+
const slice = getCurrentSlice();
|
|
227
|
+
if (!slice)
|
|
228
|
+
throw new Error('No active slice');
|
|
229
|
+
const sinks = data.filter((item) => item.__type === 'sink');
|
|
230
|
+
const sources = data.filter((item) => item.__type === 'source');
|
|
231
|
+
if (slice.type === 'command') {
|
|
232
|
+
// Command slices only have sinks in their data
|
|
233
|
+
slice.server.data = sinks.length > 0 ? sinks : undefined;
|
|
234
|
+
}
|
|
235
|
+
else if (slice.type === 'query') {
|
|
236
|
+
// Query slices only have sources in their data
|
|
237
|
+
slice.server.data = sources.length > 0 ? sources : undefined;
|
|
238
|
+
}
|
|
239
|
+
else if (slice.type === 'react') {
|
|
240
|
+
slice.server.data = data.length > 0 ? stripTypeDiscriminator(data) : undefined;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function stripTypeDiscriminator(items) {
|
|
244
|
+
return items.map((item) => {
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
246
|
+
const { __type, ...rest } = item;
|
|
247
|
+
return rest;
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
export function recordRule(description, id) {
|
|
251
|
+
if (!context || context.currentSpecIndex === null)
|
|
252
|
+
throw new Error('No active spec context');
|
|
253
|
+
const slice = getCurrentSlice();
|
|
254
|
+
if (!slice)
|
|
255
|
+
throw new Error('No active slice');
|
|
256
|
+
const spec = getCurrentSpecs(slice);
|
|
257
|
+
if (!spec)
|
|
258
|
+
throw new Error('No active specs for current slice');
|
|
259
|
+
// Only server specs have object rules with examples
|
|
260
|
+
if (context.currentSpecTarget === 'server') {
|
|
261
|
+
const objectRules = spec.rules;
|
|
262
|
+
objectRules.push({
|
|
263
|
+
id,
|
|
264
|
+
description,
|
|
265
|
+
examples: [],
|
|
266
|
+
});
|
|
267
|
+
context.currentRuleIndex = objectRules.length - 1;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
export function recordExample(description) {
|
|
271
|
+
if (!context || context.currentSpecIndex === null || context.currentRuleIndex === null) {
|
|
272
|
+
throw new Error('No active rule context');
|
|
273
|
+
}
|
|
274
|
+
const slice = getCurrentSlice();
|
|
275
|
+
if (!slice)
|
|
276
|
+
throw new Error('No active slice');
|
|
277
|
+
const spec = getCurrentSpecs(slice);
|
|
278
|
+
if (!spec)
|
|
279
|
+
throw new Error('No active specs for current slice');
|
|
280
|
+
// Only server specs have object rules with examples
|
|
281
|
+
if (context.currentSpecTarget === 'server') {
|
|
282
|
+
const objectRules = spec.rules;
|
|
283
|
+
const rule = objectRules[context.currentRuleIndex];
|
|
284
|
+
rule.examples.push({
|
|
285
|
+
description,
|
|
286
|
+
when: { commandRef: '', exampleData: {} }, // Default, will be updated
|
|
287
|
+
then: [],
|
|
288
|
+
});
|
|
289
|
+
context.currentExampleIndex = rule.examples.length - 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function processItemWithASTMatch(item, matchingType, contextParam) {
|
|
293
|
+
const refType = getRefTypeFromClassification(matchingType.classification);
|
|
294
|
+
return {
|
|
295
|
+
[refType]: matchingType.typeName,
|
|
296
|
+
exampleData: ensureMessageFormat(item).data,
|
|
297
|
+
...(contextParam && { context: contextParam }),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function processGivenItems(data, contextParam) {
|
|
301
|
+
const sourceFile = context?.narrative.sourceFile;
|
|
302
|
+
return data.map((item) => {
|
|
303
|
+
if (sourceFile !== null && sourceFile !== undefined && sourceFile !== '') {
|
|
304
|
+
const currentCount = givenCallCounters.get(sourceFile) ?? 0;
|
|
305
|
+
givenCallCounters.set(sourceFile, currentCount + 1);
|
|
306
|
+
// Look up AST-extracted type info by ordinal position
|
|
307
|
+
const givenTypes = givenTypesByFile.get(sourceFile) || [];
|
|
308
|
+
const matchingType = givenTypes[currentCount];
|
|
309
|
+
if (matchingType !== null && matchingType !== undefined) {
|
|
310
|
+
debug('AST match for %s at ordinal %d: %s', sourceFile, currentCount, matchingType.typeName);
|
|
311
|
+
return processItemWithASTMatch(item, matchingType, contextParam);
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
debug('No AST match for %s at ordinal %d, item: %o', sourceFile, currentCount, item);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
// Fallback: emit explicit InferredType for downstream processing
|
|
318
|
+
return {
|
|
319
|
+
eventRef: 'InferredType',
|
|
320
|
+
exampleData: ensureMessageFormat(item).data,
|
|
321
|
+
...(contextParam && { context: contextParam }),
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
export function recordGivenData(data, contextParam) {
|
|
326
|
+
if (!context ||
|
|
327
|
+
context.currentSpecIndex === null ||
|
|
328
|
+
context.currentRuleIndex === null ||
|
|
329
|
+
context.currentExampleIndex === null) {
|
|
330
|
+
throw new Error('No active example context');
|
|
331
|
+
}
|
|
332
|
+
const slice = getCurrentSlice();
|
|
333
|
+
if (!slice)
|
|
334
|
+
throw new Error('No active slice');
|
|
335
|
+
const example = getCurrentExample(slice);
|
|
336
|
+
if (!example)
|
|
337
|
+
throw new Error('No active example for current slice');
|
|
338
|
+
const items = processGivenItems(data, normalizeContext(contextParam));
|
|
339
|
+
example.given = items;
|
|
340
|
+
}
|
|
341
|
+
export function recordAndGivenData(data, contextParam) {
|
|
342
|
+
if (!context ||
|
|
343
|
+
context.currentSpecIndex === null ||
|
|
344
|
+
context.currentRuleIndex === null ||
|
|
345
|
+
context.currentExampleIndex === null) {
|
|
346
|
+
throw new Error('No active example context');
|
|
347
|
+
}
|
|
348
|
+
const slice = getCurrentSlice();
|
|
349
|
+
if (!slice)
|
|
350
|
+
throw new Error('No active slice');
|
|
351
|
+
const example = getCurrentExample(slice);
|
|
352
|
+
if (!example)
|
|
353
|
+
throw new Error('No active example for current slice');
|
|
354
|
+
const items = processGivenItems(data, normalizeContext(contextParam));
|
|
355
|
+
if (example.given && Array.isArray(example.given)) {
|
|
356
|
+
example.given.push(...items);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
example.given = items;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function updateExampleWhen(example, data, sliceType, contextParam) {
|
|
363
|
+
const ordinal = incrementWhenCounter();
|
|
364
|
+
if (typeof data === 'object' && data !== null && Object.keys(data).length === 0) {
|
|
365
|
+
if (sliceType === 'query') {
|
|
366
|
+
example.when = { eventRef: '', exampleData: {} };
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
example.when = { commandRef: '', exampleData: {} };
|
|
370
|
+
}
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
if (sliceType === 'react' || (sliceType === 'query' && Array.isArray(data))) {
|
|
374
|
+
// For react slices and query slices with array input, when is an array of events
|
|
375
|
+
const eventsArray = Array.isArray(data) ? data : [data];
|
|
376
|
+
example.when = eventsArray.map((item) => convertToEventExample(item, contextParam));
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
example.when = convertToCommandOrEventExample(data, contextParam, ordinal);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
export function recordWhenData(data, contextParam) {
|
|
383
|
+
if (!context ||
|
|
384
|
+
context.currentSpecIndex === null ||
|
|
385
|
+
context.currentRuleIndex === null ||
|
|
386
|
+
context.currentExampleIndex === null) {
|
|
387
|
+
throw new Error('No active example context');
|
|
388
|
+
}
|
|
389
|
+
const slice = getCurrentSlice();
|
|
390
|
+
if (!slice)
|
|
391
|
+
throw new Error('No active slice');
|
|
392
|
+
const example = getCurrentExample(slice);
|
|
393
|
+
if (!example)
|
|
394
|
+
throw new Error('No active example for current slice');
|
|
395
|
+
updateExampleWhen(example, data, slice.type, normalizeContext(contextParam));
|
|
396
|
+
}
|
|
397
|
+
export function recordThenData(data, contextParam) {
|
|
398
|
+
if (!context ||
|
|
399
|
+
context.currentSpecIndex === null ||
|
|
400
|
+
context.currentRuleIndex === null ||
|
|
401
|
+
context.currentExampleIndex === null) {
|
|
402
|
+
throw new Error('No active example context');
|
|
403
|
+
}
|
|
404
|
+
const slice = getCurrentSlice();
|
|
405
|
+
if (!slice)
|
|
406
|
+
throw new Error('No active slice');
|
|
407
|
+
const example = getCurrentExample(slice);
|
|
408
|
+
if (!example)
|
|
409
|
+
throw new Error('No active example for current slice');
|
|
410
|
+
const outcomes = data.map((item) => convertToOutcomeExample(item, slice.type, normalizeContext(contextParam)));
|
|
411
|
+
example.then = outcomes;
|
|
412
|
+
}
|
|
413
|
+
export function recordAndThenData(data, contextParam) {
|
|
414
|
+
if (!context ||
|
|
415
|
+
context.currentSpecIndex === null ||
|
|
416
|
+
context.currentRuleIndex === null ||
|
|
417
|
+
context.currentExampleIndex === null) {
|
|
418
|
+
throw new Error('No active example context');
|
|
419
|
+
}
|
|
420
|
+
const slice = getCurrentSlice();
|
|
421
|
+
if (!slice)
|
|
422
|
+
throw new Error('No active slice');
|
|
423
|
+
const example = getCurrentExample(slice);
|
|
424
|
+
if (!example)
|
|
425
|
+
throw new Error('No active example for current slice');
|
|
426
|
+
const outcomes = data.map((item) => convertToOutcomeExample(item, slice.type, normalizeContext(contextParam)));
|
|
427
|
+
example.then.push(...outcomes);
|
|
428
|
+
}
|
|
429
|
+
function convertToEventExample(item, contextParam) {
|
|
430
|
+
const message = ensureMessageFormat(item);
|
|
431
|
+
return {
|
|
432
|
+
eventRef: message.type,
|
|
433
|
+
exampleData: message.data,
|
|
434
|
+
...(contextParam && { context: contextParam }),
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function getRefTypeFromClassification(classification) {
|
|
438
|
+
if (classification === 'event')
|
|
439
|
+
return 'eventRef';
|
|
440
|
+
if (classification === 'command')
|
|
441
|
+
return 'commandRef';
|
|
442
|
+
return 'stateRef';
|
|
443
|
+
}
|
|
444
|
+
function isValidSourceFile(sourceFile) {
|
|
445
|
+
return sourceFile !== null && sourceFile !== undefined && sourceFile !== '';
|
|
446
|
+
}
|
|
447
|
+
function isValidMatchingType(matchingType) {
|
|
448
|
+
return matchingType !== null && matchingType !== undefined && matchingType.typeName !== '';
|
|
449
|
+
}
|
|
450
|
+
function incrementWhenCounter() {
|
|
451
|
+
const sourceFile = context?.narrative.sourceFile;
|
|
452
|
+
if (!isValidSourceFile(sourceFile)) {
|
|
453
|
+
return -1;
|
|
454
|
+
}
|
|
455
|
+
const currentCount = whenCallCounters.get(sourceFile) ?? 0;
|
|
456
|
+
whenCallCounters.set(sourceFile, currentCount + 1);
|
|
457
|
+
debug('[when-counter] incremented counter for %s to %d', sourceFile, currentCount + 1);
|
|
458
|
+
return currentCount;
|
|
459
|
+
}
|
|
460
|
+
function tryGetWhenTypeFromAST(item, ordinal) {
|
|
461
|
+
const sourceFile = context?.narrative.sourceFile;
|
|
462
|
+
debug('[when-ast] tryGetWhenTypeFromAST called, sourceFile=%s, ordinal=%d', sourceFile, ordinal);
|
|
463
|
+
debug('[when-ast] whenTypesByFile has %d files', whenTypesByFile.size);
|
|
464
|
+
debug('[when-ast] whenTypesByFile keys: %o', [...whenTypesByFile.keys()]);
|
|
465
|
+
if (!isValidSourceFile(sourceFile)) {
|
|
466
|
+
debug('[when-ast] sourceFile is null/undefined/empty, returning null');
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
const whenTypes = whenTypesByFile.get(sourceFile) || [];
|
|
470
|
+
debug('[when-ast] sourceFile=%s, ordinal=%d, whenTypes.length=%d', sourceFile, ordinal, whenTypes.length);
|
|
471
|
+
if (whenTypes.length > 0) {
|
|
472
|
+
debug('[when-ast] available types: %o', whenTypes.map((t) => ({ typeName: t.typeName, classification: t.classification })));
|
|
473
|
+
}
|
|
474
|
+
const matchingType = whenTypes[ordinal];
|
|
475
|
+
if (!isValidMatchingType(matchingType)) {
|
|
476
|
+
debug('[when-ast] No valid AST match for when at %s ordinal %d, falling back', sourceFile, ordinal);
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
const refType = getRefTypeFromClassification(matchingType.classification);
|
|
480
|
+
debug('[when-ast] ✅ AST match for when at %s ordinal %d: %s -> %s', sourceFile, ordinal, matchingType.typeName, refType);
|
|
481
|
+
return {
|
|
482
|
+
[refType]: matchingType.typeName,
|
|
483
|
+
exampleData: ensureMessageFormat(item).data,
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function convertToCommandOrEventExample(item, contextParam, ordinal) {
|
|
487
|
+
if (ordinal !== undefined && ordinal >= 0) {
|
|
488
|
+
const astResult = tryGetWhenTypeFromAST(item, ordinal);
|
|
489
|
+
if (astResult)
|
|
490
|
+
return astResult;
|
|
491
|
+
}
|
|
492
|
+
// Fallback to the original logic
|
|
493
|
+
const message = ensureMessageFormat(item);
|
|
494
|
+
return {
|
|
495
|
+
commandRef: message.type,
|
|
496
|
+
exampleData: message.data,
|
|
497
|
+
...(contextParam && { context: contextParam }),
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
function convertToOutcomeExample(item, sliceType, contextParam) {
|
|
501
|
+
const message = ensureMessageFormat(item);
|
|
502
|
+
// Check if it's an error
|
|
503
|
+
if (message.type === 'Error' || 'errorType' in message.data) {
|
|
504
|
+
return {
|
|
505
|
+
errorType: message.data.errorType || 'IllegalStateError',
|
|
506
|
+
message: message.data.message,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
if (sliceType === 'command') {
|
|
510
|
+
return {
|
|
511
|
+
eventRef: message.type,
|
|
512
|
+
exampleData: message.data,
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
else if (sliceType === 'query') {
|
|
516
|
+
return {
|
|
517
|
+
stateRef: message.type,
|
|
518
|
+
exampleData: message.data,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
else if (sliceType === 'react') {
|
|
522
|
+
return {
|
|
523
|
+
commandRef: message.type,
|
|
524
|
+
exampleData: message.data,
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
return {
|
|
528
|
+
eventRef: message.type,
|
|
529
|
+
exampleData: message.data,
|
|
530
|
+
...(contextParam && { context: contextParam }),
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
function ensureMessageFormat(item) {
|
|
534
|
+
if (typeof item !== 'object' || item === null) {
|
|
535
|
+
throw new Error('Invalid message format');
|
|
536
|
+
}
|
|
537
|
+
const obj = item;
|
|
538
|
+
if ('type' in obj && typeof obj.type === 'string') {
|
|
539
|
+
return parseMessageObject(obj);
|
|
540
|
+
}
|
|
541
|
+
// Handle enhanced DSL format - pure data objects without type field
|
|
542
|
+
// The type will be inferred during schema processing from the TypeScript types
|
|
543
|
+
return {
|
|
544
|
+
type: 'InferredType', // Placeholder - will be resolved during schema generation
|
|
545
|
+
data: obj,
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
function parseMessageObject(obj) {
|
|
549
|
+
// Handle direct type/data structure
|
|
550
|
+
if (hasValidDataProperty(obj)) {
|
|
551
|
+
return { type: obj.type, data: obj.data };
|
|
552
|
+
}
|
|
553
|
+
// Handle builder format with __messageCategory
|
|
554
|
+
if ('__messageCategory' in obj) {
|
|
555
|
+
return parseBuilderFormat(obj);
|
|
556
|
+
}
|
|
557
|
+
// Handle legacy format where properties are at top level
|
|
558
|
+
return parseLegacyFormat(obj);
|
|
559
|
+
}
|
|
560
|
+
function hasValidDataProperty(obj) {
|
|
561
|
+
return 'data' in obj && typeof obj.data === 'object' && obj.data !== null;
|
|
562
|
+
}
|
|
563
|
+
function parseBuilderFormat(obj) {
|
|
564
|
+
const data = 'data' in obj
|
|
565
|
+
? obj.data
|
|
566
|
+
: Object.fromEntries(Object.entries(obj).filter(([key]) => key !== 'type' && key !== '__messageCategory'));
|
|
567
|
+
return {
|
|
568
|
+
type: obj.type,
|
|
569
|
+
data,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
function parseLegacyFormat(obj) {
|
|
573
|
+
const data = Object.fromEntries(Object.entries(obj).filter(([key]) => key !== 'type'));
|
|
574
|
+
return {
|
|
575
|
+
type: obj.type,
|
|
576
|
+
data,
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
//# sourceMappingURL=narrative-context.js.map
|