@ryanstark24/sfgraph-core 1.1.0
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/analyze/__tests__/cross-org-two-store.test.d.ts +2 -0
- package/dist/analyze/__tests__/cross-org-two-store.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/cross-org-two-store.test.js +68 -0
- package/dist/analyze/__tests__/cross-org-two-store.test.js.map +1 -0
- package/dist/analyze/__tests__/dead-code-confidence.test.d.ts +2 -0
- package/dist/analyze/__tests__/dead-code-confidence.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/dead-code-confidence.test.js +66 -0
- package/dist/analyze/__tests__/dead-code-confidence.test.js.map +1 -0
- package/dist/analyze/__tests__/deployment-manifest.test.d.ts +2 -0
- package/dist/analyze/__tests__/deployment-manifest.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/deployment-manifest.test.js +66 -0
- package/dist/analyze/__tests__/deployment-manifest.test.js.map +1 -0
- package/dist/analyze/__tests__/governor-risks-detection.test.d.ts +2 -0
- package/dist/analyze/__tests__/governor-risks-detection.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/governor-risks-detection.test.js +70 -0
- package/dist/analyze/__tests__/governor-risks-detection.test.js.map +1 -0
- package/dist/analyze/__tests__/populate.test.d.ts +2 -0
- package/dist/analyze/__tests__/populate.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/populate.test.js +129 -0
- package/dist/analyze/__tests__/populate.test.js.map +1 -0
- package/dist/analyze/__tests__/traversal-caps.test.d.ts +2 -0
- package/dist/analyze/__tests__/traversal-caps.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/traversal-caps.test.js +129 -0
- package/dist/analyze/__tests__/traversal-caps.test.js.map +1 -0
- package/dist/analyze/__tests__/wip-impact.test.d.ts +2 -0
- package/dist/analyze/__tests__/wip-impact.test.d.ts.map +1 -0
- package/dist/analyze/__tests__/wip-impact.test.js +134 -0
- package/dist/analyze/__tests__/wip-impact.test.js.map +1 -0
- package/dist/analyze/cross-org.d.ts +42 -0
- package/dist/analyze/cross-org.d.ts.map +1 -0
- package/dist/analyze/cross-org.js +64 -0
- package/dist/analyze/cross-org.js.map +1 -0
- package/dist/analyze/dead-code.d.ts +8 -0
- package/dist/analyze/dead-code.d.ts.map +1 -0
- package/dist/analyze/dead-code.js +21 -0
- package/dist/analyze/dead-code.js.map +1 -0
- package/dist/analyze/dependencies.d.ts +5 -0
- package/dist/analyze/dependencies.d.ts.map +1 -0
- package/dist/analyze/dependencies.js +40 -0
- package/dist/analyze/dependencies.js.map +1 -0
- package/dist/analyze/dependents.d.ts +19 -0
- package/dist/analyze/dependents.d.ts.map +1 -0
- package/dist/analyze/dependents.js +47 -0
- package/dist/analyze/dependents.js.map +1 -0
- package/dist/analyze/deployment-manifest/generate.d.ts +22 -0
- package/dist/analyze/deployment-manifest/generate.d.ts.map +1 -0
- package/dist/analyze/deployment-manifest/generate.js +91 -0
- package/dist/analyze/deployment-manifest/generate.js.map +1 -0
- package/dist/analyze/deployment-manifest/member-name-formatters.d.ts +8 -0
- package/dist/analyze/deployment-manifest/member-name-formatters.d.ts.map +1 -0
- package/dist/analyze/deployment-manifest/member-name-formatters.js +57 -0
- package/dist/analyze/deployment-manifest/member-name-formatters.js.map +1 -0
- package/dist/analyze/deployment-manifest/member-types.d.ts +6 -0
- package/dist/analyze/deployment-manifest/member-types.d.ts.map +1 -0
- package/dist/analyze/deployment-manifest/member-types.js +47 -0
- package/dist/analyze/deployment-manifest/member-types.js.map +1 -0
- package/dist/analyze/freshness.d.ts +9 -0
- package/dist/analyze/freshness.d.ts.map +1 -0
- package/dist/analyze/freshness.js +31 -0
- package/dist/analyze/freshness.js.map +1 -0
- package/dist/analyze/git-diff.d.ts +6 -0
- package/dist/analyze/git-diff.d.ts.map +1 -0
- package/dist/analyze/git-diff.js +38 -0
- package/dist/analyze/git-diff.js.map +1 -0
- package/dist/analyze/governor.d.ts +14 -0
- package/dist/analyze/governor.d.ts.map +1 -0
- package/dist/analyze/governor.js +28 -0
- package/dist/analyze/governor.js.map +1 -0
- package/dist/analyze/index.d.ts +14 -0
- package/dist/analyze/index.d.ts.map +1 -0
- package/dist/analyze/index.js +14 -0
- package/dist/analyze/index.js.map +1 -0
- package/dist/analyze/path-to-qname.d.ts +3 -0
- package/dist/analyze/path-to-qname.d.ts.map +1 -0
- package/dist/analyze/path-to-qname.js +32 -0
- package/dist/analyze/path-to-qname.js.map +1 -0
- package/dist/analyze/populate.d.ts +15 -0
- package/dist/analyze/populate.d.ts.map +1 -0
- package/dist/analyze/populate.js +188 -0
- package/dist/analyze/populate.js.map +1 -0
- package/dist/analyze/security.d.ts +25 -0
- package/dist/analyze/security.d.ts.map +1 -0
- package/dist/analyze/security.js +70 -0
- package/dist/analyze/security.js.map +1 -0
- package/dist/analyze/test-coverage.d.ts +6 -0
- package/dist/analyze/test-coverage.d.ts.map +1 -0
- package/dist/analyze/test-coverage.js +15 -0
- package/dist/analyze/test-coverage.js.map +1 -0
- package/dist/analyze/wip-impact.d.ts +30 -0
- package/dist/analyze/wip-impact.d.ts.map +1 -0
- package/dist/analyze/wip-impact.js +314 -0
- package/dist/analyze/wip-impact.js.map +1 -0
- package/dist/domain/edge-fact.d.ts +12 -0
- package/dist/domain/edge-fact.d.ts.map +1 -0
- package/dist/domain/edge-fact.js +2 -0
- package/dist/domain/edge-fact.js.map +1 -0
- package/dist/domain/index.d.ts +7 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/index.js +7 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/metadata-category.d.ts +57 -0
- package/dist/domain/metadata-category.d.ts.map +1 -0
- package/dist/domain/metadata-category.js +57 -0
- package/dist/domain/metadata-category.js.map +1 -0
- package/dist/domain/node-fact.d.ts +12 -0
- package/dist/domain/node-fact.d.ts.map +1 -0
- package/dist/domain/node-fact.js +2 -0
- package/dist/domain/node-fact.js.map +1 -0
- package/dist/domain/org.d.ts +10 -0
- package/dist/domain/org.d.ts.map +1 -0
- package/dist/domain/org.js +2 -0
- package/dist/domain/org.js.map +1 -0
- package/dist/domain/rel-types.d.ts +89 -0
- package/dist/domain/rel-types.d.ts.map +1 -0
- package/dist/domain/rel-types.js +99 -0
- package/dist/domain/rel-types.js.map +1 -0
- package/dist/domain/snapshot.d.ts +9 -0
- package/dist/domain/snapshot.d.ts.map +1 -0
- package/dist/domain/snapshot.js +2 -0
- package/dist/domain/snapshot.js.map +1 -0
- package/dist/embedding/__tests__/queue.test.d.ts +2 -0
- package/dist/embedding/__tests__/queue.test.d.ts.map +1 -0
- package/dist/embedding/__tests__/queue.test.js +64 -0
- package/dist/embedding/__tests__/queue.test.js.map +1 -0
- package/dist/embedding/index.d.ts +4 -0
- package/dist/embedding/index.d.ts.map +1 -0
- package/dist/embedding/index.js +3 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/pool.d.ts +10 -0
- package/dist/embedding/pool.d.ts.map +1 -0
- package/dist/embedding/pool.js +10 -0
- package/dist/embedding/pool.js.map +1 -0
- package/dist/embedding/queue.d.ts +39 -0
- package/dist/embedding/queue.d.ts.map +1 -0
- package/dist/embedding/queue.js +122 -0
- package/dist/embedding/queue.js.map +1 -0
- package/dist/embedding/worker.d.ts +7 -0
- package/dist/embedding/worker.d.ts.map +1 -0
- package/dist/embedding/worker.js +7 -0
- package/dist/embedding/worker.js.map +1 -0
- package/dist/extractors/__tests__/network-egress.test.d.ts +2 -0
- package/dist/extractors/__tests__/network-egress.test.d.ts.map +1 -0
- package/dist/extractors/__tests__/network-egress.test.js +32 -0
- package/dist/extractors/__tests__/network-egress.test.js.map +1 -0
- package/dist/extractors/filesystem/__tests__/filesystem.test.d.ts +2 -0
- package/dist/extractors/filesystem/__tests__/filesystem.test.d.ts.map +1 -0
- package/dist/extractors/filesystem/__tests__/filesystem.test.js +96 -0
- package/dist/extractors/filesystem/__tests__/filesystem.test.js.map +1 -0
- package/dist/extractors/filesystem/index.d.ts +20 -0
- package/dist/extractors/filesystem/index.d.ts.map +1 -0
- package/dist/extractors/filesystem/index.js +378 -0
- package/dist/extractors/filesystem/index.js.map +1 -0
- package/dist/extractors/interfaces/metadata-source.d.ts +21 -0
- package/dist/extractors/interfaces/metadata-source.d.ts.map +1 -0
- package/dist/extractors/interfaces/metadata-source.js +2 -0
- package/dist/extractors/interfaces/metadata-source.js.map +1 -0
- package/dist/extractors/live-org/__tests__/_jsforce-mock.d.ts +38 -0
- package/dist/extractors/live-org/__tests__/_jsforce-mock.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/_jsforce-mock.js +96 -0
- package/dist/extractors/live-org/__tests__/_jsforce-mock.js.map +1 -0
- package/dist/extractors/live-org/__tests__/auth.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/auth.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/auth.test.js +85 -0
- package/dist/extractors/live-org/__tests__/auth.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/bulk-retrieve.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/bulk-retrieve.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/bulk-retrieve.test.js +150 -0
- package/dist/extractors/live-org/__tests__/bulk-retrieve.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/capabilities.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/capabilities.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/capabilities.test.js +54 -0
- package/dist/extractors/live-org/__tests__/capabilities.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/discovery.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/discovery.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/discovery.test.js +55 -0
- package/dist/extractors/live-org/__tests__/discovery.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/dispatch.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/dispatch.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/dispatch.test.js +68 -0
- package/dist/extractors/live-org/__tests__/dispatch.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/extractor-enrichment.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/extractor-enrichment.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/extractor-enrichment.test.js +312 -0
- package/dist/extractors/live-org/__tests__/extractor-enrichment.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/pools.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/pools.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/pools.test.js +75 -0
- package/dist/extractors/live-org/__tests__/pools.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/rate-limit.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/rate-limit.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/rate-limit.test.js +33 -0
- package/dist/extractors/live-org/__tests__/rate-limit.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/read-only-proxy.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/read-only-proxy.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/read-only-proxy.test.js +376 -0
- package/dist/extractors/live-org/__tests__/read-only-proxy.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/source-member.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/source-member.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/source-member.test.js +84 -0
- package/dist/extractors/live-org/__tests__/source-member.test.js.map +1 -0
- package/dist/extractors/live-org/__tests__/vlocity-runner.test.d.ts +2 -0
- package/dist/extractors/live-org/__tests__/vlocity-runner.test.d.ts.map +1 -0
- package/dist/extractors/live-org/__tests__/vlocity-runner.test.js +88 -0
- package/dist/extractors/live-org/__tests__/vlocity-runner.test.js.map +1 -0
- package/dist/extractors/live-org/auth.d.ts +37 -0
- package/dist/extractors/live-org/auth.d.ts.map +1 -0
- package/dist/extractors/live-org/auth.js +124 -0
- package/dist/extractors/live-org/auth.js.map +1 -0
- package/dist/extractors/live-org/bulk-retrieve.d.ts +51 -0
- package/dist/extractors/live-org/bulk-retrieve.d.ts.map +1 -0
- package/dist/extractors/live-org/bulk-retrieve.js +416 -0
- package/dist/extractors/live-org/bulk-retrieve.js.map +1 -0
- package/dist/extractors/live-org/capabilities.d.ts +18 -0
- package/dist/extractors/live-org/capabilities.d.ts.map +1 -0
- package/dist/extractors/live-org/capabilities.js +72 -0
- package/dist/extractors/live-org/capabilities.js.map +1 -0
- package/dist/extractors/live-org/discovery.d.ts +14 -0
- package/dist/extractors/live-org/discovery.d.ts.map +1 -0
- package/dist/extractors/live-org/discovery.js +22 -0
- package/dist/extractors/live-org/discovery.js.map +1 -0
- package/dist/extractors/live-org/dispatch.d.ts +20 -0
- package/dist/extractors/live-org/dispatch.d.ts.map +1 -0
- package/dist/extractors/live-org/dispatch.js +52 -0
- package/dist/extractors/live-org/dispatch.js.map +1 -0
- package/dist/extractors/live-org/errors.d.ts +2 -0
- package/dist/extractors/live-org/errors.d.ts.map +1 -0
- package/dist/extractors/live-org/errors.js +2 -0
- package/dist/extractors/live-org/errors.js.map +1 -0
- package/dist/extractors/live-org/extractors/apex.d.ts +5 -0
- package/dist/extractors/live-org/extractors/apex.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/apex.js +105 -0
- package/dist/extractors/live-org/extractors/apex.js.map +1 -0
- package/dist/extractors/live-org/extractors/flow.d.ts +9 -0
- package/dist/extractors/live-org/extractors/flow.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/flow.js +65 -0
- package/dist/extractors/live-org/extractors/flow.js.map +1 -0
- package/dist/extractors/live-org/extractors/generic-metadata.d.ts +20 -0
- package/dist/extractors/live-org/extractors/generic-metadata.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/generic-metadata.js +114 -0
- package/dist/extractors/live-org/extractors/generic-metadata.js.map +1 -0
- package/dist/extractors/live-org/extractors/generic-sobject.d.ts +7 -0
- package/dist/extractors/live-org/extractors/generic-sobject.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/generic-sobject.js +31 -0
- package/dist/extractors/live-org/extractors/generic-sobject.js.map +1 -0
- package/dist/extractors/live-org/extractors/integration.d.ts +3 -0
- package/dist/extractors/live-org/extractors/integration.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/integration.js +65 -0
- package/dist/extractors/live-org/extractors/integration.js.map +1 -0
- package/dist/extractors/live-org/extractors/lwc.d.ts +3 -0
- package/dist/extractors/live-org/extractors/lwc.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/lwc.js +107 -0
- package/dist/extractors/live-org/extractors/lwc.js.map +1 -0
- package/dist/extractors/live-org/extractors/object.d.ts +13 -0
- package/dist/extractors/live-org/extractors/object.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/object.js +617 -0
- package/dist/extractors/live-org/extractors/object.js.map +1 -0
- package/dist/extractors/live-org/extractors/omnistudio.d.ts +3 -0
- package/dist/extractors/live-org/extractors/omnistudio.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/omnistudio.js +141 -0
- package/dist/extractors/live-org/extractors/omnistudio.js.map +1 -0
- package/dist/extractors/live-org/extractors/security.d.ts +3 -0
- package/dist/extractors/live-org/extractors/security.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/security.js +76 -0
- package/dist/extractors/live-org/extractors/security.js.map +1 -0
- package/dist/extractors/live-org/extractors/vlocity.d.ts +2 -0
- package/dist/extractors/live-org/extractors/vlocity.d.ts.map +1 -0
- package/dist/extractors/live-org/extractors/vlocity.js +2 -0
- package/dist/extractors/live-org/extractors/vlocity.js.map +1 -0
- package/dist/extractors/live-org/index.d.ts +21 -0
- package/dist/extractors/live-org/index.d.ts.map +1 -0
- package/dist/extractors/live-org/index.js +17 -0
- package/dist/extractors/live-org/index.js.map +1 -0
- package/dist/extractors/live-org/rate-limit.d.ts +114 -0
- package/dist/extractors/live-org/rate-limit.d.ts.map +1 -0
- package/dist/extractors/live-org/rate-limit.js +251 -0
- package/dist/extractors/live-org/rate-limit.js.map +1 -0
- package/dist/extractors/live-org/read-only-proxy.d.ts +2 -0
- package/dist/extractors/live-org/read-only-proxy.d.ts.map +1 -0
- package/dist/extractors/live-org/read-only-proxy.js +299 -0
- package/dist/extractors/live-org/read-only-proxy.js.map +1 -0
- package/dist/extractors/live-org/reports.d.ts +4 -0
- package/dist/extractors/live-org/reports.d.ts.map +1 -0
- package/dist/extractors/live-org/reports.js +10 -0
- package/dist/extractors/live-org/reports.js.map +1 -0
- package/dist/extractors/live-org/source-member.d.ts +8 -0
- package/dist/extractors/live-org/source-member.d.ts.map +1 -0
- package/dist/extractors/live-org/source-member.js +47 -0
- package/dist/extractors/live-org/source-member.js.map +1 -0
- package/dist/extractors/live-org/vlocity/query-definitions.yml +153 -0
- package/dist/extractors/live-org/vlocity/runner.d.ts +21 -0
- package/dist/extractors/live-org/vlocity/runner.d.ts.map +1 -0
- package/dist/extractors/live-org/vlocity/runner.js +214 -0
- package/dist/extractors/live-org/vlocity/runner.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/__tests__/full-sync-deletion.test.d.ts +2 -0
- package/dist/ingest/__tests__/full-sync-deletion.test.d.ts.map +1 -0
- package/dist/ingest/__tests__/full-sync-deletion.test.js +200 -0
- package/dist/ingest/__tests__/full-sync-deletion.test.js.map +1 -0
- package/dist/ingest/__tests__/incremental-deletion.test.d.ts +2 -0
- package/dist/ingest/__tests__/incremental-deletion.test.d.ts.map +1 -0
- package/dist/ingest/__tests__/incremental-deletion.test.js +92 -0
- package/dist/ingest/__tests__/incremental-deletion.test.js.map +1 -0
- package/dist/ingest/__tests__/live-ingest.test.d.ts +2 -0
- package/dist/ingest/__tests__/live-ingest.test.d.ts.map +1 -0
- package/dist/ingest/__tests__/live-ingest.test.js +155 -0
- package/dist/ingest/__tests__/live-ingest.test.js.map +1 -0
- package/dist/ingest/__tests__/multi-org-orchestrator.test.d.ts +2 -0
- package/dist/ingest/__tests__/multi-org-orchestrator.test.d.ts.map +1 -0
- package/dist/ingest/__tests__/multi-org-orchestrator.test.js +101 -0
- package/dist/ingest/__tests__/multi-org-orchestrator.test.js.map +1 -0
- package/dist/ingest/__tests__/read-only-wrapping.test.d.ts +2 -0
- package/dist/ingest/__tests__/read-only-wrapping.test.d.ts.map +1 -0
- package/dist/ingest/__tests__/read-only-wrapping.test.js +62 -0
- package/dist/ingest/__tests__/read-only-wrapping.test.js.map +1 -0
- package/dist/ingest/index.d.ts +5 -0
- package/dist/ingest/index.d.ts.map +1 -0
- package/dist/ingest/index.js +3 -0
- package/dist/ingest/index.js.map +1 -0
- package/dist/ingest/live-ingest.d.ts +59 -0
- package/dist/ingest/live-ingest.d.ts.map +1 -0
- package/dist/ingest/live-ingest.js +611 -0
- package/dist/ingest/live-ingest.js.map +1 -0
- package/dist/ingest/multi-org.d.ts +43 -0
- package/dist/ingest/multi-org.d.ts.map +1 -0
- package/dist/ingest/multi-org.js +93 -0
- package/dist/ingest/multi-org.js.map +1 -0
- package/dist/parsers/__tests__/_harness.d.ts +13 -0
- package/dist/parsers/__tests__/_harness.d.ts.map +1 -0
- package/dist/parsers/__tests__/_harness.js +84 -0
- package/dist/parsers/__tests__/_harness.js.map +1 -0
- package/dist/parsers/__tests__/apex.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/apex.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/apex.golden.test.js +28 -0
- package/dist/parsers/__tests__/apex.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/cross-flavor.test.d.ts +2 -0
- package/dist/parsers/__tests__/cross-flavor.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/cross-flavor.test.js +56 -0
- package/dist/parsers/__tests__/cross-flavor.test.js.map +1 -0
- package/dist/parsers/__tests__/flow.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/flow.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/flow.golden.test.js +17 -0
- package/dist/parsers/__tests__/flow.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/integration.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/integration.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/integration.golden.test.js +31 -0
- package/dist/parsers/__tests__/integration.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/long-tail.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/long-tail.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/long-tail.golden.test.js +115 -0
- package/dist/parsers/__tests__/long-tail.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/lwc.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/lwc.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/lwc.golden.test.js +16 -0
- package/dist/parsers/__tests__/lwc.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/object-inline-fields.test.d.ts +2 -0
- package/dist/parsers/__tests__/object-inline-fields.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/object-inline-fields.test.js +115 -0
- package/dist/parsers/__tests__/object-inline-fields.test.js.map +1 -0
- package/dist/parsers/__tests__/object.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/object.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/object.golden.test.js +33 -0
- package/dist/parsers/__tests__/object.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/omnistudio.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/omnistudio.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/omnistudio.golden.test.js +6 -0
- package/dist/parsers/__tests__/omnistudio.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/registry.test.d.ts +2 -0
- package/dist/parsers/__tests__/registry.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/registry.test.js +23 -0
- package/dist/parsers/__tests__/registry.test.js.map +1 -0
- package/dist/parsers/__tests__/security.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/security.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/security.golden.test.js +31 -0
- package/dist/parsers/__tests__/security.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/vlocity.golden.test.d.ts +2 -0
- package/dist/parsers/__tests__/vlocity.golden.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/vlocity.golden.test.js +8 -0
- package/dist/parsers/__tests__/vlocity.golden.test.js.map +1 -0
- package/dist/parsers/__tests__/worker-pool.test.d.ts +2 -0
- package/dist/parsers/__tests__/worker-pool.test.d.ts.map +1 -0
- package/dist/parsers/__tests__/worker-pool.test.js +48 -0
- package/dist/parsers/__tests__/worker-pool.test.js.map +1 -0
- package/dist/parsers/_xml-helpers.d.ts +5 -0
- package/dist/parsers/_xml-helpers.d.ts.map +1 -0
- package/dist/parsers/_xml-helpers.js +12 -0
- package/dist/parsers/_xml-helpers.js.map +1 -0
- package/dist/parsers/apex/class.d.ts +13 -0
- package/dist/parsers/apex/class.d.ts.map +1 -0
- package/dist/parsers/apex/class.js +325 -0
- package/dist/parsers/apex/class.js.map +1 -0
- package/dist/parsers/apex/common.d.ts +11 -0
- package/dist/parsers/apex/common.d.ts.map +1 -0
- package/dist/parsers/apex/common.js +55 -0
- package/dist/parsers/apex/common.js.map +1 -0
- package/dist/parsers/apex/index.d.ts +6 -0
- package/dist/parsers/apex/index.d.ts.map +1 -0
- package/dist/parsers/apex/index.js +9 -0
- package/dist/parsers/apex/index.js.map +1 -0
- package/dist/parsers/apex/trigger.d.ts +12 -0
- package/dist/parsers/apex/trigger.d.ts.map +1 -0
- package/dist/parsers/apex/trigger.js +36 -0
- package/dist/parsers/apex/trigger.js.map +1 -0
- package/dist/parsers/apex/visitor.d.ts +2 -0
- package/dist/parsers/apex/visitor.d.ts.map +1 -0
- package/dist/parsers/apex/visitor.js +4 -0
- package/dist/parsers/apex/visitor.js.map +1 -0
- package/dist/parsers/common.d.ts +7 -0
- package/dist/parsers/common.d.ts.map +1 -0
- package/dist/parsers/common.js +37 -0
- package/dist/parsers/common.js.map +1 -0
- package/dist/parsers/contract.d.ts +31 -0
- package/dist/parsers/contract.d.ts.map +1 -0
- package/dist/parsers/contract.js +18 -0
- package/dist/parsers/contract.js.map +1 -0
- package/dist/parsers/cross-flavor-resolver.d.ts +18 -0
- package/dist/parsers/cross-flavor-resolver.d.ts.map +1 -0
- package/dist/parsers/cross-flavor-resolver.js +73 -0
- package/dist/parsers/cross-flavor-resolver.js.map +1 -0
- package/dist/parsers/experience/index.d.ts +2 -0
- package/dist/parsers/experience/index.d.ts.map +1 -0
- package/dist/parsers/experience/index.js +3 -0
- package/dist/parsers/experience/index.js.map +1 -0
- package/dist/parsers/flow/element-visitors.d.ts +2 -0
- package/dist/parsers/flow/element-visitors.d.ts.map +1 -0
- package/dist/parsers/flow/element-visitors.js +3 -0
- package/dist/parsers/flow/element-visitors.js.map +1 -0
- package/dist/parsers/flow/index.d.ts +4 -0
- package/dist/parsers/flow/index.d.ts.map +1 -0
- package/dist/parsers/flow/index.js +6 -0
- package/dist/parsers/flow/index.js.map +1 -0
- package/dist/parsers/flow/parser.d.ts +11 -0
- package/dist/parsers/flow/parser.d.ts.map +1 -0
- package/dist/parsers/flow/parser.js +101 -0
- package/dist/parsers/flow/parser.js.map +1 -0
- package/dist/parsers/genai/index.d.ts +2 -0
- package/dist/parsers/genai/index.d.ts.map +1 -0
- package/dist/parsers/genai/index.js +3 -0
- package/dist/parsers/genai/index.js.map +1 -0
- package/dist/parsers/generic/index.d.ts +4 -0
- package/dist/parsers/generic/index.d.ts.map +1 -0
- package/dist/parsers/generic/index.js +6 -0
- package/dist/parsers/generic/index.js.map +1 -0
- package/dist/parsers/generic/opaque-node-parser.d.ts +16 -0
- package/dist/parsers/generic/opaque-node-parser.d.ts.map +1 -0
- package/dist/parsers/generic/opaque-node-parser.js +18 -0
- package/dist/parsers/generic/opaque-node-parser.js.map +1 -0
- package/dist/parsers/index.d.ts +22 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +23 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/integration/index.d.ts +2 -0
- package/dist/parsers/integration/index.d.ts.map +1 -0
- package/dist/parsers/integration/index.js +3 -0
- package/dist/parsers/integration/index.js.map +1 -0
- package/dist/parsers/lwc/bundle.d.ts +11 -0
- package/dist/parsers/lwc/bundle.d.ts.map +1 -0
- package/dist/parsers/lwc/bundle.js +54 -0
- package/dist/parsers/lwc/bundle.js.map +1 -0
- package/dist/parsers/lwc/html-visitor.d.ts +8 -0
- package/dist/parsers/lwc/html-visitor.d.ts.map +1 -0
- package/dist/parsers/lwc/html-visitor.js +57 -0
- package/dist/parsers/lwc/html-visitor.js.map +1 -0
- package/dist/parsers/lwc/index.d.ts +4 -0
- package/dist/parsers/lwc/index.d.ts.map +1 -0
- package/dist/parsers/lwc/index.js +6 -0
- package/dist/parsers/lwc/index.js.map +1 -0
- package/dist/parsers/lwc/js-visitor.d.ts +8 -0
- package/dist/parsers/lwc/js-visitor.d.ts.map +1 -0
- package/dist/parsers/lwc/js-visitor.js +93 -0
- package/dist/parsers/lwc/js-visitor.js.map +1 -0
- package/dist/parsers/lwc/xml-meta.d.ts +2 -0
- package/dist/parsers/lwc/xml-meta.d.ts.map +1 -0
- package/dist/parsers/lwc/xml-meta.js +21 -0
- package/dist/parsers/lwc/xml-meta.js.map +1 -0
- package/dist/parsers/object/field.d.ts +9 -0
- package/dist/parsers/object/field.d.ts.map +1 -0
- package/dist/parsers/object/field.js +14 -0
- package/dist/parsers/object/field.js.map +1 -0
- package/dist/parsers/object/index.d.ts +7 -0
- package/dist/parsers/object/index.d.ts.map +1 -0
- package/dist/parsers/object/index.js +9 -0
- package/dist/parsers/object/index.js.map +1 -0
- package/dist/parsers/object/object.d.ts +14 -0
- package/dist/parsers/object/object.d.ts.map +1 -0
- package/dist/parsers/object/object.js +188 -0
- package/dist/parsers/object/object.js.map +1 -0
- package/dist/parsers/object/record-type.d.ts +7 -0
- package/dist/parsers/object/record-type.d.ts.map +1 -0
- package/dist/parsers/object/record-type.js +12 -0
- package/dist/parsers/object/record-type.js.map +1 -0
- package/dist/parsers/object/validation-rule.d.ts +8 -0
- package/dist/parsers/object/validation-rule.d.ts.map +1 -0
- package/dist/parsers/object/validation-rule.js +13 -0
- package/dist/parsers/object/validation-rule.js.map +1 -0
- package/dist/parsers/omnistudio/data-transform.d.ts +11 -0
- package/dist/parsers/omnistudio/data-transform.d.ts.map +1 -0
- package/dist/parsers/omnistudio/data-transform.js +29 -0
- package/dist/parsers/omnistudio/data-transform.js.map +1 -0
- package/dist/parsers/omnistudio/index.d.ts +10 -0
- package/dist/parsers/omnistudio/index.d.ts.map +1 -0
- package/dist/parsers/omnistudio/index.js +15 -0
- package/dist/parsers/omnistudio/index.js.map +1 -0
- package/dist/parsers/omnistudio/integration-procedure.d.ts +11 -0
- package/dist/parsers/omnistudio/integration-procedure.d.ts.map +1 -0
- package/dist/parsers/omnistudio/integration-procedure.js +44 -0
- package/dist/parsers/omnistudio/integration-procedure.js.map +1 -0
- package/dist/parsers/omnistudio/process.d.ts +11 -0
- package/dist/parsers/omnistudio/process.d.ts.map +1 -0
- package/dist/parsers/omnistudio/process.js +49 -0
- package/dist/parsers/omnistudio/process.js.map +1 -0
- package/dist/parsers/omnistudio/ui-card.d.ts +11 -0
- package/dist/parsers/omnistudio/ui-card.d.ts.map +1 -0
- package/dist/parsers/omnistudio/ui-card.js +44 -0
- package/dist/parsers/omnistudio/ui-card.js.map +1 -0
- package/dist/parsers/presentation/index.d.ts +2 -0
- package/dist/parsers/presentation/index.d.ts.map +1 -0
- package/dist/parsers/presentation/index.js +3 -0
- package/dist/parsers/presentation/index.js.map +1 -0
- package/dist/parsers/registry.d.ts +13 -0
- package/dist/parsers/registry.d.ts.map +1 -0
- package/dist/parsers/registry.js +25 -0
- package/dist/parsers/registry.js.map +1 -0
- package/dist/parsers/reporting/index.d.ts +2 -0
- package/dist/parsers/reporting/index.d.ts.map +1 -0
- package/dist/parsers/reporting/index.js +3 -0
- package/dist/parsers/reporting/index.js.map +1 -0
- package/dist/parsers/rules/__tests__/applies-to.test.d.ts +2 -0
- package/dist/parsers/rules/__tests__/applies-to.test.d.ts.map +1 -0
- package/dist/parsers/rules/__tests__/applies-to.test.js +31 -0
- package/dist/parsers/rules/__tests__/applies-to.test.js.map +1 -0
- package/dist/parsers/rules/__tests__/applies-to.test.ts +40 -0
- package/dist/parsers/rules/__tests__/engine.test.d.ts +2 -0
- package/dist/parsers/rules/__tests__/engine.test.d.ts.map +1 -0
- package/dist/parsers/rules/__tests__/engine.test.js +127 -0
- package/dist/parsers/rules/__tests__/engine.test.js.map +1 -0
- package/dist/parsers/rules/__tests__/engine.test.ts +138 -0
- package/dist/parsers/rules/__tests__/loader.test.d.ts +2 -0
- package/dist/parsers/rules/__tests__/loader.test.d.ts.map +1 -0
- package/dist/parsers/rules/__tests__/loader.test.js +31 -0
- package/dist/parsers/rules/__tests__/loader.test.js.map +1 -0
- package/dist/parsers/rules/__tests__/loader.test.ts +37 -0
- package/dist/parsers/rules/__tests__/schema.test.d.ts +2 -0
- package/dist/parsers/rules/__tests__/schema.test.d.ts.map +1 -0
- package/dist/parsers/rules/__tests__/schema.test.js +33 -0
- package/dist/parsers/rules/__tests__/schema.test.js.map +1 -0
- package/dist/parsers/rules/__tests__/schema.test.ts +37 -0
- package/dist/parsers/rules/__tests__/selectors.test.d.ts +2 -0
- package/dist/parsers/rules/__tests__/selectors.test.d.ts.map +1 -0
- package/dist/parsers/rules/__tests__/selectors.test.js +51 -0
- package/dist/parsers/rules/__tests__/selectors.test.js.map +1 -0
- package/dist/parsers/rules/__tests__/selectors.test.ts +62 -0
- package/dist/parsers/rules/_engine.d.ts +18 -0
- package/dist/parsers/rules/_engine.d.ts.map +1 -0
- package/dist/parsers/rules/_engine.js +159 -0
- package/dist/parsers/rules/_engine.js.map +1 -0
- package/dist/parsers/rules/_engine.ts +171 -0
- package/dist/parsers/rules/_generic-opaque.d.ts +13 -0
- package/dist/parsers/rules/_generic-opaque.d.ts.map +1 -0
- package/dist/parsers/rules/_generic-opaque.js +15 -0
- package/dist/parsers/rules/_generic-opaque.js.map +1 -0
- package/dist/parsers/rules/_generic-opaque.ts +16 -0
- package/dist/parsers/rules/_loader.d.ts +17 -0
- package/dist/parsers/rules/_loader.d.ts.map +1 -0
- package/dist/parsers/rules/_loader.js +58 -0
- package/dist/parsers/rules/_loader.js.map +1 -0
- package/dist/parsers/rules/_loader.ts +65 -0
- package/dist/parsers/rules/_schema.d.ts +143 -0
- package/dist/parsers/rules/_schema.d.ts.map +1 -0
- package/dist/parsers/rules/_schema.js +44 -0
- package/dist/parsers/rules/_schema.js.map +1 -0
- package/dist/parsers/rules/_schema.ts +54 -0
- package/dist/parsers/rules/_selectors.d.ts +37 -0
- package/dist/parsers/rules/_selectors.d.ts.map +1 -0
- package/dist/parsers/rules/_selectors.js +445 -0
- package/dist/parsers/rules/_selectors.js.map +1 -0
- package/dist/parsers/rules/_selectors.ts +416 -0
- package/dist/parsers/rules/apex-component.yml +26 -0
- package/dist/parsers/rules/apex-page.yml +32 -0
- package/dist/parsers/rules/approval-process.yml +25 -0
- package/dist/parsers/rules/custom-labels.yml +16 -0
- package/dist/parsers/rules/custom-metadata-type.yml +26 -0
- package/dist/parsers/rules/dashboard.yml +20 -0
- package/dist/parsers/rules/duplicate-rule.yml +20 -0
- package/dist/parsers/rules/external-service-registration.yml +20 -0
- package/dist/parsers/rules/gen-ai-planner.yml +19 -0
- package/dist/parsers/rules/gen-ai-plugin.yml +19 -0
- package/dist/parsers/rules/layout.yml +20 -0
- package/dist/parsers/rules/lightning-page.yml +21 -0
- package/dist/parsers/rules/named-credential.yml +15 -0
- package/dist/parsers/rules/network.yml +26 -0
- package/dist/parsers/rules/permission-set-group.yml +20 -0
- package/dist/parsers/rules/permission-set.yml +40 -0
- package/dist/parsers/rules/platform-event.yml +15 -0
- package/dist/parsers/rules/profile.yml +55 -0
- package/dist/parsers/rules/report.yml +25 -0
- package/dist/parsers/rules/sharing-rule.yml +78 -0
- package/dist/parsers/rules/workflow.yml +37 -0
- package/dist/parsers/security/index.d.ts +2 -0
- package/dist/parsers/security/index.d.ts.map +1 -0
- package/dist/parsers/security/index.js +5 -0
- package/dist/parsers/security/index.js.map +1 -0
- package/dist/parsers/sf-misc/index.d.ts +4 -0
- package/dist/parsers/sf-misc/index.d.ts.map +1 -0
- package/dist/parsers/sf-misc/index.js +6 -0
- package/dist/parsers/sf-misc/index.js.map +1 -0
- package/dist/parsers/sf-misc/matching-rule.d.ts +11 -0
- package/dist/parsers/sf-misc/matching-rule.d.ts.map +1 -0
- package/dist/parsers/sf-misc/matching-rule.js +17 -0
- package/dist/parsers/sf-misc/matching-rule.js.map +1 -0
- package/dist/parsers/vf/index.d.ts +2 -0
- package/dist/parsers/vf/index.d.ts.map +1 -0
- package/dist/parsers/vf/index.js +3 -0
- package/dist/parsers/vf/index.js.map +1 -0
- package/dist/parsers/vlocity/common.d.ts +26 -0
- package/dist/parsers/vlocity/common.d.ts.map +1 -0
- package/dist/parsers/vlocity/common.js +66 -0
- package/dist/parsers/vlocity/common.js.map +1 -0
- package/dist/parsers/vlocity/data-raptor.d.ts +11 -0
- package/dist/parsers/vlocity/data-raptor.d.ts.map +1 -0
- package/dist/parsers/vlocity/data-raptor.js +46 -0
- package/dist/parsers/vlocity/data-raptor.js.map +1 -0
- package/dist/parsers/vlocity/fallback.d.ts +7 -0
- package/dist/parsers/vlocity/fallback.d.ts.map +1 -0
- package/dist/parsers/vlocity/fallback.js +8 -0
- package/dist/parsers/vlocity/fallback.js.map +1 -0
- package/dist/parsers/vlocity/index.d.ts +7 -0
- package/dist/parsers/vlocity/index.d.ts.map +1 -0
- package/dist/parsers/vlocity/index.js +10 -0
- package/dist/parsers/vlocity/index.js.map +1 -0
- package/dist/parsers/vlocity/integration-procedure.d.ts +11 -0
- package/dist/parsers/vlocity/integration-procedure.d.ts.map +1 -0
- package/dist/parsers/vlocity/integration-procedure.js +53 -0
- package/dist/parsers/vlocity/integration-procedure.js.map +1 -0
- package/dist/parsers/vlocity/omni-script.d.ts +11 -0
- package/dist/parsers/vlocity/omni-script.d.ts.map +1 -0
- package/dist/parsers/vlocity/omni-script.js +50 -0
- package/dist/parsers/vlocity/omni-script.js.map +1 -0
- package/dist/parsers/vlocity/registry.d.ts +3 -0
- package/dist/parsers/vlocity/registry.d.ts.map +1 -0
- package/dist/parsers/vlocity/registry.js +11 -0
- package/dist/parsers/vlocity/registry.js.map +1 -0
- package/dist/parsers/vlocity/vlocity-card.d.ts +11 -0
- package/dist/parsers/vlocity/vlocity-card.d.ts.map +1 -0
- package/dist/parsers/vlocity/vlocity-card.js +55 -0
- package/dist/parsers/vlocity/vlocity-card.js.map +1 -0
- package/dist/parsers/worker-pool.d.ts +30 -0
- package/dist/parsers/worker-pool.d.ts.map +1 -0
- package/dist/parsers/worker-pool.js +57 -0
- package/dist/parsers/worker-pool.js.map +1 -0
- package/dist/render/mermaid/__tests__/mermaid.test.d.ts +2 -0
- package/dist/render/mermaid/__tests__/mermaid.test.d.ts.map +1 -0
- package/dist/render/mermaid/__tests__/mermaid.test.js +74 -0
- package/dist/render/mermaid/__tests__/mermaid.test.js.map +1 -0
- package/dist/render/mermaid/dependency-graph.d.ts +15 -0
- package/dist/render/mermaid/dependency-graph.d.ts.map +1 -0
- package/dist/render/mermaid/dependency-graph.js +43 -0
- package/dist/render/mermaid/dependency-graph.js.map +1 -0
- package/dist/render/mermaid/diff.d.ts +12 -0
- package/dist/render/mermaid/diff.d.ts.map +1 -0
- package/dist/render/mermaid/diff.js +22 -0
- package/dist/render/mermaid/diff.js.map +1 -0
- package/dist/render/mermaid/flow.d.ts +18 -0
- package/dist/render/mermaid/flow.d.ts.map +1 -0
- package/dist/render/mermaid/flow.js +23 -0
- package/dist/render/mermaid/flow.js.map +1 -0
- package/dist/render/mermaid/index.d.ts +6 -0
- package/dist/render/mermaid/index.d.ts.map +1 -0
- package/dist/render/mermaid/index.js +6 -0
- package/dist/render/mermaid/index.js.map +1 -0
- package/dist/render/mermaid/sequence.d.ts +16 -0
- package/dist/render/mermaid/sequence.d.ts.map +1 -0
- package/dist/render/mermaid/sequence.js +20 -0
- package/dist/render/mermaid/sequence.js.map +1 -0
- package/dist/render/mermaid/shared.d.ts +22 -0
- package/dist/render/mermaid/shared.d.ts.map +1 -0
- package/dist/render/mermaid/shared.js +47 -0
- package/dist/render/mermaid/shared.js.map +1 -0
- package/dist/storage/__tests__/analysis-tables-migration.test.d.ts +2 -0
- package/dist/storage/__tests__/analysis-tables-migration.test.d.ts.map +1 -0
- package/dist/storage/__tests__/analysis-tables-migration.test.js +44 -0
- package/dist/storage/__tests__/analysis-tables-migration.test.js.map +1 -0
- package/dist/storage/__tests__/graph-store.test.d.ts +2 -0
- package/dist/storage/__tests__/graph-store.test.d.ts.map +1 -0
- package/dist/storage/__tests__/graph-store.test.js +132 -0
- package/dist/storage/__tests__/graph-store.test.js.map +1 -0
- package/dist/storage/__tests__/identifier.test.d.ts +2 -0
- package/dist/storage/__tests__/identifier.test.d.ts.map +1 -0
- package/dist/storage/__tests__/identifier.test.js +35 -0
- package/dist/storage/__tests__/identifier.test.js.map +1 -0
- package/dist/storage/__tests__/load-better-sqlite3.test.d.ts +2 -0
- package/dist/storage/__tests__/load-better-sqlite3.test.d.ts.map +1 -0
- package/dist/storage/__tests__/load-better-sqlite3.test.js +65 -0
- package/dist/storage/__tests__/load-better-sqlite3.test.js.map +1 -0
- package/dist/storage/__tests__/migrations.test.d.ts +2 -0
- package/dist/storage/__tests__/migrations.test.d.ts.map +1 -0
- package/dist/storage/__tests__/migrations.test.js +93 -0
- package/dist/storage/__tests__/migrations.test.js.map +1 -0
- package/dist/storage/__tests__/perf-50k.test.d.ts +2 -0
- package/dist/storage/__tests__/perf-50k.test.d.ts.map +1 -0
- package/dist/storage/__tests__/perf-50k.test.js +67 -0
- package/dist/storage/__tests__/perf-50k.test.js.map +1 -0
- package/dist/storage/__tests__/snapshot-store.test.d.ts +2 -0
- package/dist/storage/__tests__/snapshot-store.test.d.ts.map +1 -0
- package/dist/storage/__tests__/snapshot-store.test.js +117 -0
- package/dist/storage/__tests__/snapshot-store.test.js.map +1 -0
- package/dist/storage/__tests__/snippets.test.d.ts +2 -0
- package/dist/storage/__tests__/snippets.test.d.ts.map +1 -0
- package/dist/storage/__tests__/snippets.test.js +88 -0
- package/dist/storage/__tests__/snippets.test.js.map +1 -0
- package/dist/storage/__tests__/vector-store-load-failure.test.d.ts +2 -0
- package/dist/storage/__tests__/vector-store-load-failure.test.d.ts.map +1 -0
- package/dist/storage/__tests__/vector-store-load-failure.test.js +42 -0
- package/dist/storage/__tests__/vector-store-load-failure.test.js.map +1 -0
- package/dist/storage/__tests__/vector-store.test.d.ts +2 -0
- package/dist/storage/__tests__/vector-store.test.d.ts.map +1 -0
- package/dist/storage/__tests__/vector-store.test.js +87 -0
- package/dist/storage/__tests__/vector-store.test.js.map +1 -0
- package/dist/storage/identifier.d.ts +5 -0
- package/dist/storage/identifier.d.ts.map +1 -0
- package/dist/storage/identifier.js +21 -0
- package/dist/storage/identifier.js.map +1 -0
- package/dist/storage/index.d.ts +12 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +8 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/interfaces.d.ts +101 -0
- package/dist/storage/interfaces.d.ts.map +1 -0
- package/dist/storage/interfaces.js +2 -0
- package/dist/storage/interfaces.js.map +1 -0
- package/dist/storage/sqlite/graph-store.d.ts +62 -0
- package/dist/storage/sqlite/graph-store.d.ts.map +1 -0
- package/dist/storage/sqlite/graph-store.js +533 -0
- package/dist/storage/sqlite/graph-store.js.map +1 -0
- package/dist/storage/sqlite/load-better-sqlite3.d.ts +50 -0
- package/dist/storage/sqlite/load-better-sqlite3.d.ts.map +1 -0
- package/dist/storage/sqlite/load-better-sqlite3.js +188 -0
- package/dist/storage/sqlite/load-better-sqlite3.js.map +1 -0
- package/dist/storage/sqlite/migrations.d.ts +18 -0
- package/dist/storage/sqlite/migrations.d.ts.map +1 -0
- package/dist/storage/sqlite/migrations.js +291 -0
- package/dist/storage/sqlite/migrations.js.map +1 -0
- package/dist/storage/sqlite/snapshot-store.d.ts +31 -0
- package/dist/storage/sqlite/snapshot-store.d.ts.map +1 -0
- package/dist/storage/sqlite/snapshot-store.js +255 -0
- package/dist/storage/sqlite/snapshot-store.js.map +1 -0
- package/dist/storage/sqlite/vector-store.d.ts +28 -0
- package/dist/storage/sqlite/vector-store.d.ts.map +1 -0
- package/dist/storage/sqlite/vector-store.js +174 -0
- package/dist/storage/sqlite/vector-store.js.map +1 -0
- package/dist/telemetry/__tests__/event-schema.test.d.ts +2 -0
- package/dist/telemetry/__tests__/event-schema.test.d.ts.map +1 -0
- package/dist/telemetry/__tests__/event-schema.test.js +56 -0
- package/dist/telemetry/__tests__/event-schema.test.js.map +1 -0
- package/dist/telemetry/__tests__/machine-id.test.d.ts +2 -0
- package/dist/telemetry/__tests__/machine-id.test.d.ts.map +1 -0
- package/dist/telemetry/__tests__/machine-id.test.js +33 -0
- package/dist/telemetry/__tests__/machine-id.test.js.map +1 -0
- package/dist/telemetry/__tests__/pipeline.test.d.ts +2 -0
- package/dist/telemetry/__tests__/pipeline.test.d.ts.map +1 -0
- package/dist/telemetry/__tests__/pipeline.test.js +68 -0
- package/dist/telemetry/__tests__/pipeline.test.js.map +1 -0
- package/dist/telemetry/__tests__/sanitizer.test.d.ts +2 -0
- package/dist/telemetry/__tests__/sanitizer.test.d.ts.map +1 -0
- package/dist/telemetry/__tests__/sanitizer.test.js +143 -0
- package/dist/telemetry/__tests__/sanitizer.test.js.map +1 -0
- package/dist/telemetry/event-schema.d.ts +47 -0
- package/dist/telemetry/event-schema.d.ts.map +1 -0
- package/dist/telemetry/event-schema.js +64 -0
- package/dist/telemetry/event-schema.js.map +1 -0
- package/dist/telemetry/index.d.ts +6 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +6 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/machine-id.d.ts +7 -0
- package/dist/telemetry/machine-id.d.ts.map +1 -0
- package/dist/telemetry/machine-id.js +30 -0
- package/dist/telemetry/machine-id.js.map +1 -0
- package/dist/telemetry/pipeline.d.ts +17 -0
- package/dist/telemetry/pipeline.d.ts.map +1 -0
- package/dist/telemetry/pipeline.js +33 -0
- package/dist/telemetry/pipeline.js.map +1 -0
- package/dist/telemetry/sanitizer.d.ts +9 -0
- package/dist/telemetry/sanitizer.d.ts.map +1 -0
- package/dist/telemetry/sanitizer.js +87 -0
- package/dist/telemetry/sanitizer.js.map +1 -0
- package/dist/telemetry/sinks.d.ts +22 -0
- package/dist/telemetry/sinks.d.ts.map +1 -0
- package/dist/telemetry/sinks.js +40 -0
- package/dist/telemetry/sinks.js.map +1 -0
- package/dist/tools/types.d.ts +7 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { XMLParser } from "fast-xml-parser";
|
|
3
|
+
import {
|
|
4
|
+
type EdgeFact,
|
|
5
|
+
METADATA_CATEGORY,
|
|
6
|
+
type MetadataCategory,
|
|
7
|
+
type NodeFact,
|
|
8
|
+
type RelType,
|
|
9
|
+
} from "../../domain/index.js";
|
|
10
|
+
import { makeEdge, makeNode } from "../common.js";
|
|
11
|
+
import type { ParseContext, ParseResult, Parser } from "../contract.js";
|
|
12
|
+
import type { EdgeRule, NodeRule, Rule } from "./_schema.js";
|
|
13
|
+
import { type EvalCtx, evaluatePredicate, evaluateRaw, evaluateString } from "./_selectors.js";
|
|
14
|
+
|
|
15
|
+
const xmlParser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
16
|
+
|
|
17
|
+
function sha256(s: string): string {
|
|
18
|
+
return createHash("sha256").update(s).digest("hex");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function toArr<T>(v: T | T[] | undefined | null): T[] {
|
|
22
|
+
if (v === undefined || v === null) return [];
|
|
23
|
+
return Array.isArray(v) ? v : [v];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class RuleBasedParser implements Parser<unknown> {
|
|
27
|
+
constructor(private readonly rule: Rule) {}
|
|
28
|
+
|
|
29
|
+
get type(): string {
|
|
30
|
+
return this.rule.type;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get category(): MetadataCategory {
|
|
34
|
+
// The rule files use the same string constants as METADATA_CATEGORY values.
|
|
35
|
+
return this.rule.category as MetadataCategory;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async parse(input: unknown, ctx: ParseContext): Promise<ParseResult> {
|
|
39
|
+
const record = this.coerceInput(input);
|
|
40
|
+
const caps = (ctx as unknown as { caps?: Record<string, unknown> }).caps ?? {};
|
|
41
|
+
const evalCtx: EvalCtx = {
|
|
42
|
+
record,
|
|
43
|
+
item: null,
|
|
44
|
+
ns: ctx.namespace,
|
|
45
|
+
caps,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const nodes: NodeFact[] = [];
|
|
49
|
+
const edges: EdgeFact[] = [];
|
|
50
|
+
// Source hash derived from input string when available (parity with old parsers).
|
|
51
|
+
const sourceHashSeed = this.deriveSourceText(input);
|
|
52
|
+
const hashBase = sourceHashSeed ? sha256(sourceHashSeed) : "";
|
|
53
|
+
|
|
54
|
+
for (const n of this.rule.nodes) {
|
|
55
|
+
this.emitNode(n, evalCtx, ctx, hashBase, nodes);
|
|
56
|
+
}
|
|
57
|
+
for (const e of this.rule.edges) {
|
|
58
|
+
this.emitEdge(e, evalCtx, ctx, edges);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return { nodes, edges };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private emitNode(
|
|
65
|
+
n: NodeRule,
|
|
66
|
+
evalCtx: EvalCtx,
|
|
67
|
+
ctx: ParseContext,
|
|
68
|
+
hashBase: string,
|
|
69
|
+
out: NodeFact[],
|
|
70
|
+
): void {
|
|
71
|
+
const items: unknown[] = n.iterate ? toArr(evaluateRaw(n.iterate, evalCtx)) : [null];
|
|
72
|
+
for (const item of items) {
|
|
73
|
+
const subCtx: EvalCtx = { ...evalCtx, item };
|
|
74
|
+
if (n.when && !evaluatePredicate(n.when, subCtx)) continue;
|
|
75
|
+
const qnameVal = evaluateString(n.qname, subCtx);
|
|
76
|
+
if (qnameVal === undefined || qnameVal === null || qnameVal === "") continue;
|
|
77
|
+
const qname = String(qnameVal);
|
|
78
|
+
const props = this.materializeProps(n.props, subCtx);
|
|
79
|
+
out.push(makeNode(ctx, n.label, qname, props, hashBase));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private emitEdge(e: EdgeRule, evalCtx: EvalCtx, ctx: ParseContext, out: EdgeFact[]): void {
|
|
84
|
+
const items: unknown[] = e.iterate ? toArr(evaluateRaw(e.iterate, evalCtx)) : [null];
|
|
85
|
+
for (const item of items) {
|
|
86
|
+
const subCtx: EvalCtx = { ...evalCtx, item };
|
|
87
|
+
if (e.when && !evaluatePredicate(e.when, subCtx)) continue;
|
|
88
|
+
const src = evaluateString(e.src, subCtx);
|
|
89
|
+
const dst = evaluateString(e.dst, subCtx);
|
|
90
|
+
if (!src || !dst) continue;
|
|
91
|
+
const props = this.materializeProps(e.props, subCtx);
|
|
92
|
+
// relType is a string union at runtime; rule authors must use canonical names.
|
|
93
|
+
out.push(makeEdge(ctx, String(src), e.relType as RelType, String(dst), props));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private materializeProps(
|
|
98
|
+
props: Record<string, unknown> | undefined,
|
|
99
|
+
evalCtx: EvalCtx,
|
|
100
|
+
): Record<string, unknown> {
|
|
101
|
+
if (!props) return {};
|
|
102
|
+
const out: Record<string, unknown> = {};
|
|
103
|
+
for (const [k, v] of Object.entries(props)) {
|
|
104
|
+
if (typeof v === "string") {
|
|
105
|
+
const evaluated = evaluateString(v, evalCtx);
|
|
106
|
+
out[k] = evaluated === undefined ? null : evaluated;
|
|
107
|
+
} else {
|
|
108
|
+
out[k] = v;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private coerceInput(input: unknown): unknown {
|
|
115
|
+
if (this.rule.input === "object") return input;
|
|
116
|
+
if (this.rule.input === "json") {
|
|
117
|
+
return typeof input === "string" ? JSON.parse(input) : input;
|
|
118
|
+
}
|
|
119
|
+
if (this.rule.input === "xml-string") {
|
|
120
|
+
// Inputs in this codebase pass `{ name, xml }` objects (or similar).
|
|
121
|
+
// Parse the xml field and merge any sibling keys into the record so
|
|
122
|
+
// they're addressable as ${record.<key>}.
|
|
123
|
+
const obj = input as Record<string, unknown> | null;
|
|
124
|
+
const xml = typeof obj?.xml === "string" ? (obj.xml as string) : "";
|
|
125
|
+
let parsed: unknown = {};
|
|
126
|
+
if (xml) parsed = xmlParser.parse(xml);
|
|
127
|
+
const rootKey = this.rule.root;
|
|
128
|
+
const root = rootKey ? ((parsed as Record<string, unknown>)?.[rootKey] ?? {}) : parsed;
|
|
129
|
+
const merged: Record<string, unknown> = {
|
|
130
|
+
...(typeof root === "object" && root !== null ? (root as Record<string, unknown>) : {}),
|
|
131
|
+
};
|
|
132
|
+
// Promote sibling keys (name, object, body, etc.) into the record.
|
|
133
|
+
if (obj && typeof obj === "object") {
|
|
134
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
135
|
+
if (k === "xml") continue;
|
|
136
|
+
merged[k] = v;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return merged;
|
|
140
|
+
}
|
|
141
|
+
return input;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private deriveSourceText(input: unknown): string {
|
|
145
|
+
if (typeof input === "string") return input;
|
|
146
|
+
if (input && typeof input === "object") {
|
|
147
|
+
const obj = input as Record<string, unknown>;
|
|
148
|
+
if (typeof obj.xml === "string") return obj.xml;
|
|
149
|
+
if (typeof obj.body === "string") return obj.body;
|
|
150
|
+
}
|
|
151
|
+
return "";
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function appliesTo(rule: Rule, caps: Record<string, unknown>): boolean {
|
|
156
|
+
return matchWhen(rule.applies_when, caps);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function matchWhen(w: unknown, caps: Record<string, unknown>): boolean {
|
|
160
|
+
if (!w || typeof w !== "object") return false;
|
|
161
|
+
const obj = w as Record<string, unknown>;
|
|
162
|
+
if ("always" in obj) return true;
|
|
163
|
+
if ("capability" in obj) return Boolean(caps[obj.capability as string]);
|
|
164
|
+
if ("not" in obj) return !matchWhen(obj.not, caps);
|
|
165
|
+
if ("any_of" in obj) return (obj.any_of as unknown[]).some((x) => matchWhen(x, caps));
|
|
166
|
+
if ("all_of" in obj) return (obj.all_of as unknown[]).every((x) => matchWhen(x, caps));
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Re-export METADATA_CATEGORY for rule author convenience (unused but stable).
|
|
171
|
+
export { METADATA_CATEGORY };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ParseContext, ParseResult, Parser } from "../contract.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fallback rule-style parser that emits one opaque NodeFact for any unknown type.
|
|
4
|
+
* Thin wrapper around the existing OpaqueNodeParser, exported so callers can
|
|
5
|
+
* locate the fallback alongside the rule engine.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GenericOpaqueParser implements Parser<unknown> {
|
|
8
|
+
private readonly inner;
|
|
9
|
+
readonly category: "OpaqueMetadata";
|
|
10
|
+
readonly type = "OpaqueMetadata";
|
|
11
|
+
parse(input: unknown, ctx: ParseContext): Promise<ParseResult>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=_generic-opaque.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_generic-opaque.d.ts","sourceRoot":"","sources":["../../../src/parsers/rules/_generic-opaque.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxE;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,MAAM,CAAC,OAAO,CAAC;IACzD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;IAChD,QAAQ,CAAC,QAAQ,mBAAuB;IACxC,QAAQ,CAAC,IAAI,oBAAoB;IACjC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;CAG/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OpaqueNodeParser } from "../generic/opaque-node-parser.js";
|
|
2
|
+
/**
|
|
3
|
+
* Fallback rule-style parser that emits one opaque NodeFact for any unknown type.
|
|
4
|
+
* Thin wrapper around the existing OpaqueNodeParser, exported so callers can
|
|
5
|
+
* locate the fallback alongside the rule engine.
|
|
6
|
+
*/
|
|
7
|
+
export class GenericOpaqueParser {
|
|
8
|
+
inner = new OpaqueNodeParser();
|
|
9
|
+
category = this.inner.category;
|
|
10
|
+
type = "OpaqueMetadata";
|
|
11
|
+
parse(input, ctx) {
|
|
12
|
+
return this.inner.parse(input, ctx);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=_generic-opaque.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_generic-opaque.js","sourceRoot":"","sources":["../../../src/parsers/rules/_generic-opaque.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IACb,KAAK,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACvC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC/B,IAAI,GAAG,gBAAgB,CAAC;IACjC,KAAK,CAAC,KAAc,EAAE,GAAiB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAA4D,EAAE,GAAG,CAAC,CAAC;IAC7F,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ParseContext, ParseResult, Parser } from "../contract.js";
|
|
2
|
+
import { OpaqueNodeParser } from "../generic/opaque-node-parser.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Fallback rule-style parser that emits one opaque NodeFact for any unknown type.
|
|
6
|
+
* Thin wrapper around the existing OpaqueNodeParser, exported so callers can
|
|
7
|
+
* locate the fallback alongside the rule engine.
|
|
8
|
+
*/
|
|
9
|
+
export class GenericOpaqueParser implements Parser<unknown> {
|
|
10
|
+
private readonly inner = new OpaqueNodeParser();
|
|
11
|
+
readonly category = this.inner.category;
|
|
12
|
+
readonly type = "OpaqueMetadata";
|
|
13
|
+
parse(input: unknown, ctx: ParseContext): Promise<ParseResult> {
|
|
14
|
+
return this.inner.parse(input as { metadataType: string; name: string; raw: string }, ctx);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RuleBasedParser } from "./_engine.js";
|
|
2
|
+
export interface LoadResult {
|
|
3
|
+
loaded: string[];
|
|
4
|
+
parsers: RuleBasedParser[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Load all rule YAML files from the given directory (defaults to this module's dir)
|
|
8
|
+
* and register each with the parser registry.
|
|
9
|
+
*
|
|
10
|
+
* Files prefixed with `_` are treated as engine internals and skipped.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadAllRules(opts?: {
|
|
13
|
+
dir?: string;
|
|
14
|
+
/** When true, do not register globally — return parsers only. */
|
|
15
|
+
skipRegister?: boolean;
|
|
16
|
+
}): Promise<LoadResult>;
|
|
17
|
+
//# sourceMappingURL=_loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_loader.d.ts","sourceRoot":"","sources":["../../../src/parsers/rules/_loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,GAAG,OAAO,CAAC,UAAU,CAAC,CAyCtB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { parse as parseYaml } from "yaml";
|
|
5
|
+
import { parserRegistry } from "../registry.js";
|
|
6
|
+
import { RuleBasedParser } from "./_engine.js";
|
|
7
|
+
import { RuleSchema } from "./_schema.js";
|
|
8
|
+
/**
|
|
9
|
+
* Load all rule YAML files from the given directory (defaults to this module's dir)
|
|
10
|
+
* and register each with the parser registry.
|
|
11
|
+
*
|
|
12
|
+
* Files prefixed with `_` are treated as engine internals and skipped.
|
|
13
|
+
*/
|
|
14
|
+
export async function loadAllRules(opts) {
|
|
15
|
+
const here = opts?.dir ?? dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const entries = await readdir(here, { withFileTypes: true }).catch(() => []);
|
|
17
|
+
const loaded = [];
|
|
18
|
+
const parsers = [];
|
|
19
|
+
const seenTypes = new Map();
|
|
20
|
+
for (const ent of entries) {
|
|
21
|
+
if (!ent.isFile())
|
|
22
|
+
continue;
|
|
23
|
+
if (!ent.name.endsWith(".yml") && !ent.name.endsWith(".yaml"))
|
|
24
|
+
continue;
|
|
25
|
+
if (ent.name.startsWith("_"))
|
|
26
|
+
continue;
|
|
27
|
+
const fp = join(here, ent.name);
|
|
28
|
+
const text = await readFile(fp, "utf8");
|
|
29
|
+
let raw;
|
|
30
|
+
try {
|
|
31
|
+
raw = parseYaml(text);
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
throw new Error(`Invalid YAML in rule file ${ent.name}: ${err.message}`);
|
|
35
|
+
}
|
|
36
|
+
const parsed = RuleSchema.safeParse(raw);
|
|
37
|
+
if (!parsed.success) {
|
|
38
|
+
throw new Error(`Invalid rule file ${ent.name}: ${parsed.error.message}`);
|
|
39
|
+
}
|
|
40
|
+
const rule = parsed.data;
|
|
41
|
+
const prior = seenTypes.get(rule.type);
|
|
42
|
+
if (prior) {
|
|
43
|
+
throw new Error(`Duplicate parser type "${rule.type}" in ${ent.name} (already registered by ${prior})`);
|
|
44
|
+
}
|
|
45
|
+
seenTypes.set(rule.type, ent.name);
|
|
46
|
+
const parser = new RuleBasedParser(rule);
|
|
47
|
+
if (!opts?.skipRegister) {
|
|
48
|
+
// Tolerate already-registered (idempotent re-load in tests).
|
|
49
|
+
if (!parserRegistry.for(rule.type)) {
|
|
50
|
+
parserRegistry.register(parser);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
loaded.push(ent.name);
|
|
54
|
+
parsers.push(parser);
|
|
55
|
+
}
|
|
56
|
+
return { loaded, parsers };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=_loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_loader.js","sourceRoot":"","sources":["../../../src/parsers/rules/_loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAa,UAAU,EAAE,MAAM,cAAc,CAAC;AAOrD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAIlC;IACC,MAAM,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,SAAS;QACxE,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QACvC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACxC,IAAI,GAAY,CAAC;QACjB,IAAI,CAAC;YACH,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,CAAC,IAAI,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,IAAI,GAAS,MAAM,CAAC,IAAI,CAAC;QAC/B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,0BAA0B,IAAI,CAAC,IAAI,QAAQ,GAAG,CAAC,IAAI,2BAA2B,KAAK,GAAG,CACvF,CAAC;QACJ,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC;YACxB,6DAA6D;YAC7D,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { parse as parseYaml } from "yaml";
|
|
5
|
+
import { parserRegistry } from "../registry.js";
|
|
6
|
+
import { RuleBasedParser } from "./_engine.js";
|
|
7
|
+
import { type Rule, RuleSchema } from "./_schema.js";
|
|
8
|
+
|
|
9
|
+
export interface LoadResult {
|
|
10
|
+
loaded: string[];
|
|
11
|
+
parsers: RuleBasedParser[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Load all rule YAML files from the given directory (defaults to this module's dir)
|
|
16
|
+
* and register each with the parser registry.
|
|
17
|
+
*
|
|
18
|
+
* Files prefixed with `_` are treated as engine internals and skipped.
|
|
19
|
+
*/
|
|
20
|
+
export async function loadAllRules(opts?: {
|
|
21
|
+
dir?: string;
|
|
22
|
+
/** When true, do not register globally — return parsers only. */
|
|
23
|
+
skipRegister?: boolean;
|
|
24
|
+
}): Promise<LoadResult> {
|
|
25
|
+
const here = opts?.dir ?? dirname(fileURLToPath(import.meta.url));
|
|
26
|
+
const entries = await readdir(here, { withFileTypes: true }).catch(() => []);
|
|
27
|
+
const loaded: string[] = [];
|
|
28
|
+
const parsers: RuleBasedParser[] = [];
|
|
29
|
+
const seenTypes = new Map<string, string>();
|
|
30
|
+
for (const ent of entries) {
|
|
31
|
+
if (!ent.isFile()) continue;
|
|
32
|
+
if (!ent.name.endsWith(".yml") && !ent.name.endsWith(".yaml")) continue;
|
|
33
|
+
if (ent.name.startsWith("_")) continue;
|
|
34
|
+
const fp = join(here, ent.name);
|
|
35
|
+
const text = await readFile(fp, "utf8");
|
|
36
|
+
let raw: unknown;
|
|
37
|
+
try {
|
|
38
|
+
raw = parseYaml(text);
|
|
39
|
+
} catch (err) {
|
|
40
|
+
throw new Error(`Invalid YAML in rule file ${ent.name}: ${(err as Error).message}`);
|
|
41
|
+
}
|
|
42
|
+
const parsed = RuleSchema.safeParse(raw);
|
|
43
|
+
if (!parsed.success) {
|
|
44
|
+
throw new Error(`Invalid rule file ${ent.name}: ${parsed.error.message}`);
|
|
45
|
+
}
|
|
46
|
+
const rule: Rule = parsed.data;
|
|
47
|
+
const prior = seenTypes.get(rule.type);
|
|
48
|
+
if (prior) {
|
|
49
|
+
throw new Error(
|
|
50
|
+
`Duplicate parser type "${rule.type}" in ${ent.name} (already registered by ${prior})`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
seenTypes.set(rule.type, ent.name);
|
|
54
|
+
const parser = new RuleBasedParser(rule);
|
|
55
|
+
if (!opts?.skipRegister) {
|
|
56
|
+
// Tolerate already-registered (idempotent re-load in tests).
|
|
57
|
+
if (!parserRegistry.for(rule.type)) {
|
|
58
|
+
parserRegistry.register(parser);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
loaded.push(ent.name);
|
|
62
|
+
parsers.push(parser);
|
|
63
|
+
}
|
|
64
|
+
return { loaded, parsers };
|
|
65
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WhenSchema: z.ZodType<unknown>;
|
|
3
|
+
declare const NodeRuleSchema: z.ZodObject<{
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
qname: z.ZodString;
|
|
6
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>>;
|
|
7
|
+
/** When set, repeats the node per element of the iterated array. */
|
|
8
|
+
iterate: z.ZodOptional<z.ZodString>;
|
|
9
|
+
/** Conditional emit; evaluated against ctx (item bound when iterating). */
|
|
10
|
+
when: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strict", z.ZodTypeAny, {
|
|
12
|
+
label: string;
|
|
13
|
+
qname: string;
|
|
14
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
15
|
+
iterate?: string | undefined;
|
|
16
|
+
when?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
label: string;
|
|
19
|
+
qname: string;
|
|
20
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
21
|
+
iterate?: string | undefined;
|
|
22
|
+
when?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
declare const EdgeRuleSchema: z.ZodObject<{
|
|
25
|
+
relType: z.ZodString;
|
|
26
|
+
iterate: z.ZodOptional<z.ZodString>;
|
|
27
|
+
when: z.ZodOptional<z.ZodString>;
|
|
28
|
+
src: z.ZodString;
|
|
29
|
+
dst: z.ZodString;
|
|
30
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>>;
|
|
31
|
+
}, "strict", z.ZodTypeAny, {
|
|
32
|
+
relType: string;
|
|
33
|
+
src: string;
|
|
34
|
+
dst: string;
|
|
35
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
36
|
+
iterate?: string | undefined;
|
|
37
|
+
when?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
relType: string;
|
|
40
|
+
src: string;
|
|
41
|
+
dst: string;
|
|
42
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
43
|
+
iterate?: string | undefined;
|
|
44
|
+
when?: string | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const RuleSchema: z.ZodObject<{
|
|
47
|
+
type: z.ZodString;
|
|
48
|
+
category: z.ZodString;
|
|
49
|
+
input: z.ZodEnum<["object", "json", "xml-string"]>;
|
|
50
|
+
/** Optional dot-path to the root element after XML parsing (e.g. "Profile"). */
|
|
51
|
+
root: z.ZodOptional<z.ZodString>;
|
|
52
|
+
applies_when: z.ZodDefault<z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
53
|
+
nodes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
54
|
+
label: z.ZodString;
|
|
55
|
+
qname: z.ZodString;
|
|
56
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>>;
|
|
57
|
+
/** When set, repeats the node per element of the iterated array. */
|
|
58
|
+
iterate: z.ZodOptional<z.ZodString>;
|
|
59
|
+
/** Conditional emit; evaluated against ctx (item bound when iterating). */
|
|
60
|
+
when: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strict", z.ZodTypeAny, {
|
|
62
|
+
label: string;
|
|
63
|
+
qname: string;
|
|
64
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
65
|
+
iterate?: string | undefined;
|
|
66
|
+
when?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
label: string;
|
|
69
|
+
qname: string;
|
|
70
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
71
|
+
iterate?: string | undefined;
|
|
72
|
+
when?: string | undefined;
|
|
73
|
+
}>, "many">>;
|
|
74
|
+
edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
75
|
+
relType: z.ZodString;
|
|
76
|
+
iterate: z.ZodOptional<z.ZodString>;
|
|
77
|
+
when: z.ZodOptional<z.ZodString>;
|
|
78
|
+
src: z.ZodString;
|
|
79
|
+
dst: z.ZodString;
|
|
80
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull]>>>;
|
|
81
|
+
}, "strict", z.ZodTypeAny, {
|
|
82
|
+
relType: string;
|
|
83
|
+
src: string;
|
|
84
|
+
dst: string;
|
|
85
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
86
|
+
iterate?: string | undefined;
|
|
87
|
+
when?: string | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
relType: string;
|
|
90
|
+
src: string;
|
|
91
|
+
dst: string;
|
|
92
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
93
|
+
iterate?: string | undefined;
|
|
94
|
+
when?: string | undefined;
|
|
95
|
+
}>, "many">>;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
category: string;
|
|
98
|
+
type: string;
|
|
99
|
+
nodes: {
|
|
100
|
+
label: string;
|
|
101
|
+
qname: string;
|
|
102
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
103
|
+
iterate?: string | undefined;
|
|
104
|
+
when?: string | undefined;
|
|
105
|
+
}[];
|
|
106
|
+
edges: {
|
|
107
|
+
relType: string;
|
|
108
|
+
src: string;
|
|
109
|
+
dst: string;
|
|
110
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
111
|
+
iterate?: string | undefined;
|
|
112
|
+
when?: string | undefined;
|
|
113
|
+
}[];
|
|
114
|
+
input: "object" | "json" | "xml-string";
|
|
115
|
+
root?: string | undefined;
|
|
116
|
+
applies_when?: unknown;
|
|
117
|
+
}, {
|
|
118
|
+
category: string;
|
|
119
|
+
type: string;
|
|
120
|
+
input: "object" | "json" | "xml-string";
|
|
121
|
+
nodes?: {
|
|
122
|
+
label: string;
|
|
123
|
+
qname: string;
|
|
124
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
125
|
+
iterate?: string | undefined;
|
|
126
|
+
when?: string | undefined;
|
|
127
|
+
}[] | undefined;
|
|
128
|
+
edges?: {
|
|
129
|
+
relType: string;
|
|
130
|
+
src: string;
|
|
131
|
+
dst: string;
|
|
132
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
133
|
+
iterate?: string | undefined;
|
|
134
|
+
when?: string | undefined;
|
|
135
|
+
}[] | undefined;
|
|
136
|
+
root?: string | undefined;
|
|
137
|
+
applies_when?: unknown;
|
|
138
|
+
}>;
|
|
139
|
+
export type Rule = z.infer<typeof RuleSchema>;
|
|
140
|
+
export type NodeRule = z.infer<typeof NodeRuleSchema>;
|
|
141
|
+
export type EdgeRule = z.infer<typeof EdgeRuleSchema>;
|
|
142
|
+
export {};
|
|
143
|
+
//# sourceMappingURL=_schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_schema.d.ts","sourceRoot":"","sources":["../../../src/parsers/rules/_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAQzC,CAAC;AAIF,QAAA,MAAM,cAAc;;;;IAKhB,oEAAoE;;IAEpE,2EAA2E;;;;;;;;;;;;;;EAGpE,CAAC;AAEZ,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAST,CAAC;AAEZ,eAAO,MAAM,UAAU;;;;IAKnB,gFAAgF;;;;;;;QAvBhF,oEAAoE;;QAEpE,2EAA2E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BpE,CAAC;AAEZ,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Recursive `applies_when` predicate.
|
|
3
|
+
export const WhenSchema = z.lazy(() => z.union([
|
|
4
|
+
z.object({ always: z.literal(true) }).strict(),
|
|
5
|
+
z.object({ capability: z.string() }).strict(),
|
|
6
|
+
z.object({ not: WhenSchema }).strict(),
|
|
7
|
+
z.object({ any_of: z.array(WhenSchema) }).strict(),
|
|
8
|
+
z.object({ all_of: z.array(WhenSchema) }).strict(),
|
|
9
|
+
]));
|
|
10
|
+
const PropValueSchema = z.union([z.string(), z.boolean(), z.number(), z.null()]);
|
|
11
|
+
const NodeRuleSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
label: z.string(),
|
|
14
|
+
qname: z.string(),
|
|
15
|
+
props: z.record(PropValueSchema).optional(),
|
|
16
|
+
/** When set, repeats the node per element of the iterated array. */
|
|
17
|
+
iterate: z.string().optional(),
|
|
18
|
+
/** Conditional emit; evaluated against ctx (item bound when iterating). */
|
|
19
|
+
when: z.string().optional(),
|
|
20
|
+
})
|
|
21
|
+
.strict();
|
|
22
|
+
const EdgeRuleSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
relType: z.string(),
|
|
25
|
+
iterate: z.string().optional(),
|
|
26
|
+
when: z.string().optional(),
|
|
27
|
+
src: z.string(),
|
|
28
|
+
dst: z.string(),
|
|
29
|
+
props: z.record(PropValueSchema).optional(),
|
|
30
|
+
})
|
|
31
|
+
.strict();
|
|
32
|
+
export const RuleSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
type: z.string(),
|
|
35
|
+
category: z.string(),
|
|
36
|
+
input: z.enum(["object", "json", "xml-string"]),
|
|
37
|
+
/** Optional dot-path to the root element after XML parsing (e.g. "Profile"). */
|
|
38
|
+
root: z.string().optional(),
|
|
39
|
+
applies_when: WhenSchema.default({ always: true }),
|
|
40
|
+
nodes: z.array(NodeRuleSchema).default([]),
|
|
41
|
+
edges: z.array(EdgeRuleSchema).default([]),
|
|
42
|
+
})
|
|
43
|
+
.strict();
|
|
44
|
+
//# sourceMappingURL=_schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_schema.js","sourceRoot":"","sources":["../../../src/parsers/rules/_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,MAAM,CAAC,MAAM,UAAU,GAAuB,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACxD,CAAC,CAAC,KAAK,CAAC;IACN,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9C,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IAC7C,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IAClD,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;CACnD,CAAC,CACH,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEjF,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAC3C,oEAAoE;IACpE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,2EAA2E;IAC3E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC;KACxB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC/C,gFAAgF;IAChF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,YAAY,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3C,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
// Recursive `applies_when` predicate.
|
|
4
|
+
export const WhenSchema: z.ZodType<unknown> = z.lazy(() =>
|
|
5
|
+
z.union([
|
|
6
|
+
z.object({ always: z.literal(true) }).strict(),
|
|
7
|
+
z.object({ capability: z.string() }).strict(),
|
|
8
|
+
z.object({ not: WhenSchema }).strict(),
|
|
9
|
+
z.object({ any_of: z.array(WhenSchema) }).strict(),
|
|
10
|
+
z.object({ all_of: z.array(WhenSchema) }).strict(),
|
|
11
|
+
]),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const PropValueSchema = z.union([z.string(), z.boolean(), z.number(), z.null()]);
|
|
15
|
+
|
|
16
|
+
const NodeRuleSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
label: z.string(),
|
|
19
|
+
qname: z.string(),
|
|
20
|
+
props: z.record(PropValueSchema).optional(),
|
|
21
|
+
/** When set, repeats the node per element of the iterated array. */
|
|
22
|
+
iterate: z.string().optional(),
|
|
23
|
+
/** Conditional emit; evaluated against ctx (item bound when iterating). */
|
|
24
|
+
when: z.string().optional(),
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
|
|
28
|
+
const EdgeRuleSchema = z
|
|
29
|
+
.object({
|
|
30
|
+
relType: z.string(),
|
|
31
|
+
iterate: z.string().optional(),
|
|
32
|
+
when: z.string().optional(),
|
|
33
|
+
src: z.string(),
|
|
34
|
+
dst: z.string(),
|
|
35
|
+
props: z.record(PropValueSchema).optional(),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
|
|
39
|
+
export const RuleSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
type: z.string(),
|
|
42
|
+
category: z.string(),
|
|
43
|
+
input: z.enum(["object", "json", "xml-string"]),
|
|
44
|
+
/** Optional dot-path to the root element after XML parsing (e.g. "Profile"). */
|
|
45
|
+
root: z.string().optional(),
|
|
46
|
+
applies_when: WhenSchema.default({ always: true }),
|
|
47
|
+
nodes: z.array(NodeRuleSchema).default([]),
|
|
48
|
+
edges: z.array(EdgeRuleSchema).default([]),
|
|
49
|
+
})
|
|
50
|
+
.strict();
|
|
51
|
+
|
|
52
|
+
export type Rule = z.infer<typeof RuleSchema>;
|
|
53
|
+
export type NodeRule = z.infer<typeof NodeRuleSchema>;
|
|
54
|
+
export type EdgeRule = z.infer<typeof EdgeRuleSchema>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny selector evaluator for rule files.
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* ${path.to.field} — interpolation, namespace-stripped if ns is set
|
|
6
|
+
* ${path.to.field | raw} — interpolation without namespace strip
|
|
7
|
+
* ${path.to.field || other.field} — OR fallback
|
|
8
|
+
* ${a == 'foo'} / ${a != 'foo'} — equality with string literal
|
|
9
|
+
* ${!a} — negation
|
|
10
|
+
* ${stripNs(record.x)} — explicit stripNs helper
|
|
11
|
+
* ${split(record.x,'-')[0]} — split + index helper
|
|
12
|
+
*
|
|
13
|
+
* Context binds:
|
|
14
|
+
* record — parsed input object
|
|
15
|
+
* item — current iteration element (or null)
|
|
16
|
+
* ns — namespace string or null
|
|
17
|
+
* caps — capability bag
|
|
18
|
+
*
|
|
19
|
+
* Undefined-safe: missing fields evaluate to '' in interpolations, false in conditionals.
|
|
20
|
+
* Pure non-string primitives flow through (so a boolean prop value stays boolean).
|
|
21
|
+
*/
|
|
22
|
+
export interface EvalCtx {
|
|
23
|
+
record: unknown;
|
|
24
|
+
item: unknown;
|
|
25
|
+
ns: string | null;
|
|
26
|
+
caps: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/** Evaluate a template string like "Profile:${record.fullName}".
|
|
29
|
+
* Returns a string when the template has any literal chars or multiple refs.
|
|
30
|
+
* Returns the raw underlying value when the template is a single bare `${...}`
|
|
31
|
+
* (so booleans / numbers / null flow through unmodified). */
|
|
32
|
+
export declare function evaluateString(template: string, ctx: EvalCtx): unknown;
|
|
33
|
+
/** Evaluate a predicate (boolean) expression. Used for `when`. */
|
|
34
|
+
export declare function evaluatePredicate(expr: string, ctx: EvalCtx): boolean;
|
|
35
|
+
/** Evaluate an expression, returning the raw value (for `iterate`). */
|
|
36
|
+
export declare function evaluateRaw(expr: string, ctx: EvalCtx): unknown;
|
|
37
|
+
//# sourceMappingURL=_selectors.d.ts.map
|