@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,138 @@
|
|
|
1
|
+
import { ConsoleLogger } from "@ryanstark24/sfgraph-shared";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import type { ParseContext } from "../../contract.js";
|
|
4
|
+
import { RuleBasedParser } from "../_engine.js";
|
|
5
|
+
import { RuleSchema } from "../_schema.js";
|
|
6
|
+
|
|
7
|
+
function makeCtx(): ParseContext {
|
|
8
|
+
return {
|
|
9
|
+
orgId: "org_test",
|
|
10
|
+
sourceUri: "test://uri",
|
|
11
|
+
parseTimestamp: "2026-01-01T00:00:00Z",
|
|
12
|
+
namespace: null,
|
|
13
|
+
logger: new ConsoleLogger("error"),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function build(rule: unknown): RuleBasedParser {
|
|
18
|
+
return new RuleBasedParser(RuleSchema.parse(rule));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
describe("RuleBasedParser engine", () => {
|
|
22
|
+
it("emits zero output for an empty rule", async () => {
|
|
23
|
+
const p = build({
|
|
24
|
+
type: "Empty",
|
|
25
|
+
category: "Profile",
|
|
26
|
+
input: "object",
|
|
27
|
+
applies_when: { always: true },
|
|
28
|
+
});
|
|
29
|
+
const r = await p.parse({}, makeCtx());
|
|
30
|
+
expect(r.nodes).toEqual([]);
|
|
31
|
+
expect(r.edges).toEqual([]);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("emits a single node with materialized props", async () => {
|
|
35
|
+
const p = build({
|
|
36
|
+
type: "Foo",
|
|
37
|
+
category: "Profile",
|
|
38
|
+
input: "object",
|
|
39
|
+
applies_when: { always: true },
|
|
40
|
+
nodes: [
|
|
41
|
+
{ label: "Foo", qname: "Foo:${record.id}", props: { id: "${record.id}", active: true } },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
const r = await p.parse({ id: "abc" }, makeCtx());
|
|
45
|
+
expect(r.nodes.length).toBe(1);
|
|
46
|
+
const n = r.nodes[0];
|
|
47
|
+
expect(n?.label).toBe("Foo");
|
|
48
|
+
expect(String(n?.qualifiedName)).toBe("Foo:abc");
|
|
49
|
+
expect(n?.attributes?.id).toBe("abc");
|
|
50
|
+
expect(n?.attributes?.active).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("iterates and produces N edges", async () => {
|
|
54
|
+
const p = build({
|
|
55
|
+
type: "Bar",
|
|
56
|
+
category: "Profile",
|
|
57
|
+
input: "object",
|
|
58
|
+
applies_when: { always: true },
|
|
59
|
+
nodes: [{ label: "Bar", qname: "Bar:${record.id}" }],
|
|
60
|
+
edges: [
|
|
61
|
+
{
|
|
62
|
+
relType: "REFERENCES",
|
|
63
|
+
iterate: "${record.children}",
|
|
64
|
+
src: "Bar:${record.id}",
|
|
65
|
+
dst: "Child:${item.name}",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
const r = await p.parse({ id: "x", children: [{ name: "a" }, { name: "b" }] }, makeCtx());
|
|
70
|
+
expect(r.edges.length).toBe(2);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("filters edges via `when`", async () => {
|
|
74
|
+
const p = build({
|
|
75
|
+
type: "Filt",
|
|
76
|
+
category: "Profile",
|
|
77
|
+
input: "object",
|
|
78
|
+
applies_when: { always: true },
|
|
79
|
+
edges: [
|
|
80
|
+
{
|
|
81
|
+
relType: "REFERENCES",
|
|
82
|
+
iterate: "${record.items}",
|
|
83
|
+
when: "${item.keep}",
|
|
84
|
+
src: "X:1",
|
|
85
|
+
dst: "Y:${item.name}",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
});
|
|
89
|
+
const r = await p.parse(
|
|
90
|
+
{
|
|
91
|
+
items: [
|
|
92
|
+
{ name: "a", keep: true },
|
|
93
|
+
{ name: "b", keep: false },
|
|
94
|
+
{ name: "c", keep: true },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
makeCtx(),
|
|
98
|
+
);
|
|
99
|
+
expect(r.edges.length).toBe(2);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("missing iterate produces zero edges (no throw)", async () => {
|
|
103
|
+
const p = build({
|
|
104
|
+
type: "Miss",
|
|
105
|
+
category: "Profile",
|
|
106
|
+
input: "object",
|
|
107
|
+
applies_when: { always: true },
|
|
108
|
+
edges: [
|
|
109
|
+
{
|
|
110
|
+
relType: "REFERENCES",
|
|
111
|
+
iterate: "${record.nothing}",
|
|
112
|
+
src: "A:1",
|
|
113
|
+
dst: "B:${item.x}",
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
});
|
|
117
|
+
const r = await p.parse({}, makeCtx());
|
|
118
|
+
expect(r.edges).toEqual([]);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it("coerces primitives through props (boolean stays boolean)", async () => {
|
|
122
|
+
const p = build({
|
|
123
|
+
type: "Coerce",
|
|
124
|
+
category: "Profile",
|
|
125
|
+
input: "object",
|
|
126
|
+
applies_when: { always: true },
|
|
127
|
+
nodes: [
|
|
128
|
+
{
|
|
129
|
+
label: "Coerce",
|
|
130
|
+
qname: "Coerce:1",
|
|
131
|
+
props: { flag: "${record.flag}" },
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
});
|
|
135
|
+
const r = await p.parse({ flag: true }, makeCtx());
|
|
136
|
+
expect(r.nodes[0]?.attributes?.flag).toBe(true);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.test.d.ts","sourceRoot":"","sources":["../../../../src/parsers/rules/__tests__/loader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { loadAllRules } from "../_loader.js";
|
|
6
|
+
describe("rule loader", () => {
|
|
7
|
+
it("loads at least 20 parsers from the canonical rules directory", async () => {
|
|
8
|
+
const out = await loadAllRules({ skipRegister: true });
|
|
9
|
+
expect(out.loaded.length).toBeGreaterThanOrEqual(20);
|
|
10
|
+
expect(out.parsers.length).toBe(out.loaded.length);
|
|
11
|
+
});
|
|
12
|
+
it("throws a clear error for an invalid rule file", async () => {
|
|
13
|
+
const dir = mkdtempSync(path.join(tmpdir(), "rules-bad-"));
|
|
14
|
+
writeFileSync(path.join(dir, "bad.yml"), "type: 123\nnot_valid: yes\n", "utf8");
|
|
15
|
+
await expect(loadAllRules({ dir, skipRegister: true })).rejects.toThrow(/Invalid rule file/);
|
|
16
|
+
});
|
|
17
|
+
it("rejects duplicate type across two rule files", async () => {
|
|
18
|
+
const dir = mkdtempSync(path.join(tmpdir(), "rules-dup-"));
|
|
19
|
+
const body = "type: Dupe\ncategory: Profile\ninput: object\napplies_when:\n always: true\nnodes: []\nedges: []\n";
|
|
20
|
+
writeFileSync(path.join(dir, "a.yml"), body, "utf8");
|
|
21
|
+
writeFileSync(path.join(dir, "b.yml"), body, "utf8");
|
|
22
|
+
await expect(loadAllRules({ dir, skipRegister: true })).rejects.toThrow(/Duplicate parser type/);
|
|
23
|
+
});
|
|
24
|
+
it("skips files prefixed with _", async () => {
|
|
25
|
+
const dir = mkdtempSync(path.join(tmpdir(), "rules-skip-"));
|
|
26
|
+
writeFileSync(path.join(dir, "_engine.yml"), "this: should\nbe: skipped\n", "utf8");
|
|
27
|
+
const out = await loadAllRules({ dir, skipRegister: true });
|
|
28
|
+
expect(out.loaded).toEqual([]);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=loader.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.test.js","sourceRoot":"","sources":["../../../../src/parsers/rules/__tests__/loader.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,8DAA8D,EAAE,KAAK,IAAI,EAAE;QAC5E,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;QACrD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK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G,MAAM,YAAY,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { loadAllRules } from "../_loader.js";
|
|
6
|
+
|
|
7
|
+
describe("rule loader", () => {
|
|
8
|
+
it("loads at least 20 parsers from the canonical rules directory", async () => {
|
|
9
|
+
const out = await loadAllRules({ skipRegister: true });
|
|
10
|
+
expect(out.loaded.length).toBeGreaterThanOrEqual(20);
|
|
11
|
+
expect(out.parsers.length).toBe(out.loaded.length);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it("throws a clear error for an invalid rule file", async () => {
|
|
15
|
+
const dir = mkdtempSync(path.join(tmpdir(), "rules-bad-"));
|
|
16
|
+
writeFileSync(path.join(dir, "bad.yml"), "type: 123\nnot_valid: yes\n", "utf8");
|
|
17
|
+
await expect(loadAllRules({ dir, skipRegister: true })).rejects.toThrow(/Invalid rule file/);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("rejects duplicate type across two rule files", async () => {
|
|
21
|
+
const dir = mkdtempSync(path.join(tmpdir(), "rules-dup-"));
|
|
22
|
+
const body =
|
|
23
|
+
"type: Dupe\ncategory: Profile\ninput: object\napplies_when:\n always: true\nnodes: []\nedges: []\n";
|
|
24
|
+
writeFileSync(path.join(dir, "a.yml"), body, "utf8");
|
|
25
|
+
writeFileSync(path.join(dir, "b.yml"), body, "utf8");
|
|
26
|
+
await expect(loadAllRules({ dir, skipRegister: true })).rejects.toThrow(
|
|
27
|
+
/Duplicate parser type/,
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("skips files prefixed with _", async () => {
|
|
32
|
+
const dir = mkdtempSync(path.join(tmpdir(), "rules-skip-"));
|
|
33
|
+
writeFileSync(path.join(dir, "_engine.yml"), "this: should\nbe: skipped\n", "utf8");
|
|
34
|
+
const out = await loadAllRules({ dir, skipRegister: true });
|
|
35
|
+
expect(out.loaded).toEqual([]);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.d.ts","sourceRoot":"","sources":["../../../../src/parsers/rules/__tests__/schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { RuleSchema } from "../_schema.js";
|
|
3
|
+
describe("rule schema", () => {
|
|
4
|
+
it("parses a minimal valid rule", () => {
|
|
5
|
+
const out = RuleSchema.parse({
|
|
6
|
+
type: "Foo",
|
|
7
|
+
category: "Profile",
|
|
8
|
+
input: "object",
|
|
9
|
+
applies_when: { always: true },
|
|
10
|
+
});
|
|
11
|
+
expect(out.nodes).toEqual([]);
|
|
12
|
+
expect(out.edges).toEqual([]);
|
|
13
|
+
});
|
|
14
|
+
it("defaults nodes + edges to empty arrays", () => {
|
|
15
|
+
const out = RuleSchema.parse({
|
|
16
|
+
type: "Foo",
|
|
17
|
+
category: "Profile",
|
|
18
|
+
input: "object",
|
|
19
|
+
applies_when: { always: true },
|
|
20
|
+
});
|
|
21
|
+
expect(out.nodes).toEqual([]);
|
|
22
|
+
expect(out.edges).toEqual([]);
|
|
23
|
+
});
|
|
24
|
+
it("rejects unknown applies_when shape", () => {
|
|
25
|
+
expect(() => RuleSchema.parse({
|
|
26
|
+
type: "Foo",
|
|
27
|
+
category: "Profile",
|
|
28
|
+
input: "object",
|
|
29
|
+
applies_when: { bogus: true },
|
|
30
|
+
})).toThrow();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=schema.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.test.js","sourceRoot":"","sources":["../../../../src/parsers/rules/__tests__/schema.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC;YAC3B,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,QAAQ;YACf,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC;YAC3B,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,QAAQ;YACf,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SAC/B,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,EAAE,CACV,UAAU,CAAC,KAAK,CAAC;YACf,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,QAAQ;YACf,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;SAC9B,CAAC,CACH,CAAC,OAAO,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { RuleSchema } from "../_schema.js";
|
|
3
|
+
|
|
4
|
+
describe("rule schema", () => {
|
|
5
|
+
it("parses a minimal valid rule", () => {
|
|
6
|
+
const out = RuleSchema.parse({
|
|
7
|
+
type: "Foo",
|
|
8
|
+
category: "Profile",
|
|
9
|
+
input: "object",
|
|
10
|
+
applies_when: { always: true },
|
|
11
|
+
});
|
|
12
|
+
expect(out.nodes).toEqual([]);
|
|
13
|
+
expect(out.edges).toEqual([]);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("defaults nodes + edges to empty arrays", () => {
|
|
17
|
+
const out = RuleSchema.parse({
|
|
18
|
+
type: "Foo",
|
|
19
|
+
category: "Profile",
|
|
20
|
+
input: "object",
|
|
21
|
+
applies_when: { always: true },
|
|
22
|
+
});
|
|
23
|
+
expect(out.nodes).toEqual([]);
|
|
24
|
+
expect(out.edges).toEqual([]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("rejects unknown applies_when shape", () => {
|
|
28
|
+
expect(() =>
|
|
29
|
+
RuleSchema.parse({
|
|
30
|
+
type: "Foo",
|
|
31
|
+
category: "Profile",
|
|
32
|
+
input: "object",
|
|
33
|
+
applies_when: { bogus: true },
|
|
34
|
+
}),
|
|
35
|
+
).toThrow();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.test.d.ts","sourceRoot":"","sources":["../../../../src/parsers/rules/__tests__/selectors.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { evaluatePredicate, evaluateRaw, evaluateString } from "../_selectors.js";
|
|
3
|
+
const ctx = (overrides = {}) => ({
|
|
4
|
+
record: {},
|
|
5
|
+
item: null,
|
|
6
|
+
ns: null,
|
|
7
|
+
caps: {},
|
|
8
|
+
...overrides,
|
|
9
|
+
});
|
|
10
|
+
describe("rule selectors", () => {
|
|
11
|
+
it("interpolates a simple field", () => {
|
|
12
|
+
expect(evaluateString("${record.x}", ctx({ record: { x: "hi" } }))).toBe("hi");
|
|
13
|
+
});
|
|
14
|
+
it("walks nested paths", () => {
|
|
15
|
+
expect(evaluateString("${record.a.b.c}", ctx({ record: { a: { b: { c: 42 } } } }))).toBe(42);
|
|
16
|
+
});
|
|
17
|
+
it("supports || fallback in predicates", () => {
|
|
18
|
+
expect(evaluatePredicate("${item.x || item.y}", ctx({ item: { y: true } }))).toBe(true);
|
|
19
|
+
expect(evaluatePredicate("${item.x || item.y}", ctx({ item: {} }))).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
it("compares string literals with ==", () => {
|
|
22
|
+
expect(evaluatePredicate("${item.x == 'foo'}", ctx({ item: { x: "foo" } }))).toBe(true);
|
|
23
|
+
expect(evaluatePredicate("${item.x == 'foo'}", ctx({ item: { x: "bar" } }))).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
it("negates with !", () => {
|
|
26
|
+
expect(evaluatePredicate("${!item.x}", ctx({ item: { x: false } }))).toBe(true);
|
|
27
|
+
expect(evaluatePredicate("${!item.x}", ctx({ item: { x: "y" } }))).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
it("is undefined-safe", () => {
|
|
30
|
+
expect(evaluateString("${record.missing.deep}", ctx())).toBe(undefined);
|
|
31
|
+
expect(evaluatePredicate("${record.missing}", ctx())).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it("flattens .* nested array iteration via evaluateRaw", () => {
|
|
34
|
+
const data = {
|
|
35
|
+
sections: [
|
|
36
|
+
{ cols: [{ items: [{ field: "A" }, { field: "B" }] }] },
|
|
37
|
+
{ cols: [{ items: [{ field: "C" }] }] },
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
const out = evaluateRaw("${record.sections.*.cols.*.items}", ctx({ record: data }));
|
|
41
|
+
expect(Array.isArray(out)).toBe(true);
|
|
42
|
+
expect(out.length).toBe(3);
|
|
43
|
+
});
|
|
44
|
+
it("supports stripNs() helper", () => {
|
|
45
|
+
expect(evaluateString("${stripNs(record.x)}", ctx({ record: { x: "ns__Foo" }, ns: "ns" }))).toBe("Foo");
|
|
46
|
+
});
|
|
47
|
+
it("supports split() helper with index", () => {
|
|
48
|
+
expect(evaluateString("${split(record.x,'-')[0]}", ctx({ record: { x: "a-b-c" } }))).toBe("a");
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=selectors.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.test.js","sourceRoot":"","sources":["../../../../src/parsers/rules/__tests__/selectors.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElF,MAAM,GAAG,GAAG,CAAC,YAA2D,EAAE,EAAE,EAAE,CAAC,CAAC;IAC9E,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,IAAI;IACV,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,EAAE;IACR,GAAG,SAAS;CACb,CAAC,CAAC;AAEH,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EA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AAI,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,CACJ,cAAc,CAAC,sBAAsB,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CACpF,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,cAAc,CAAC,2BAA2B,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { evaluatePredicate, evaluateRaw, evaluateString } from "../_selectors.js";
|
|
3
|
+
|
|
4
|
+
const ctx = (overrides: Partial<Parameters<typeof evaluateString>[1]> = {}) => ({
|
|
5
|
+
record: {},
|
|
6
|
+
item: null,
|
|
7
|
+
ns: null,
|
|
8
|
+
caps: {},
|
|
9
|
+
...overrides,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe("rule selectors", () => {
|
|
13
|
+
it("interpolates a simple field", () => {
|
|
14
|
+
expect(evaluateString("${record.x}", ctx({ record: { x: "hi" } }))).toBe("hi");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("walks nested paths", () => {
|
|
18
|
+
expect(evaluateString("${record.a.b.c}", ctx({ record: { a: { b: { c: 42 } } } }))).toBe(42);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("supports || fallback in predicates", () => {
|
|
22
|
+
expect(evaluatePredicate("${item.x || item.y}", ctx({ item: { y: true } }))).toBe(true);
|
|
23
|
+
expect(evaluatePredicate("${item.x || item.y}", ctx({ item: {} }))).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("compares string literals with ==", () => {
|
|
27
|
+
expect(evaluatePredicate("${item.x == 'foo'}", ctx({ item: { x: "foo" } }))).toBe(true);
|
|
28
|
+
expect(evaluatePredicate("${item.x == 'foo'}", ctx({ item: { x: "bar" } }))).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("negates with !", () => {
|
|
32
|
+
expect(evaluatePredicate("${!item.x}", ctx({ item: { x: false } }))).toBe(true);
|
|
33
|
+
expect(evaluatePredicate("${!item.x}", ctx({ item: { x: "y" } }))).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("is undefined-safe", () => {
|
|
37
|
+
expect(evaluateString("${record.missing.deep}", ctx())).toBe(undefined);
|
|
38
|
+
expect(evaluatePredicate("${record.missing}", ctx())).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("flattens .* nested array iteration via evaluateRaw", () => {
|
|
42
|
+
const data = {
|
|
43
|
+
sections: [
|
|
44
|
+
{ cols: [{ items: [{ field: "A" }, { field: "B" }] }] },
|
|
45
|
+
{ cols: [{ items: [{ field: "C" }] }] },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
const out = evaluateRaw("${record.sections.*.cols.*.items}", ctx({ record: data }));
|
|
49
|
+
expect(Array.isArray(out)).toBe(true);
|
|
50
|
+
expect((out as unknown[]).length).toBe(3);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("supports stripNs() helper", () => {
|
|
54
|
+
expect(
|
|
55
|
+
evaluateString("${stripNs(record.x)}", ctx({ record: { x: "ns__Foo" }, ns: "ns" })),
|
|
56
|
+
).toBe("Foo");
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("supports split() helper with index", () => {
|
|
60
|
+
expect(evaluateString("${split(record.x,'-')[0]}", ctx({ record: { x: "a-b-c" } }))).toBe("a");
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { METADATA_CATEGORY, type MetadataCategory } from "../../domain/index.js";
|
|
2
|
+
import type { ParseContext, ParseResult, Parser } from "../contract.js";
|
|
3
|
+
import type { Rule } from "./_schema.js";
|
|
4
|
+
export declare class RuleBasedParser implements Parser<unknown> {
|
|
5
|
+
private readonly rule;
|
|
6
|
+
constructor(rule: Rule);
|
|
7
|
+
get type(): string;
|
|
8
|
+
get category(): MetadataCategory;
|
|
9
|
+
parse(input: unknown, ctx: ParseContext): Promise<ParseResult>;
|
|
10
|
+
private emitNode;
|
|
11
|
+
private emitEdge;
|
|
12
|
+
private materializeProps;
|
|
13
|
+
private coerceInput;
|
|
14
|
+
private deriveSourceText;
|
|
15
|
+
}
|
|
16
|
+
export declare function appliesTo(rule: Rule, caps: Record<string, unknown>): boolean;
|
|
17
|
+
export { METADATA_CATEGORY };
|
|
18
|
+
//# sourceMappingURL=_engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_engine.d.ts","sourceRoot":"","sources":["../../../src/parsers/rules/_engine.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,iBAAiB,EACjB,KAAK,gBAAgB,EAGtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,KAAK,EAAsB,IAAI,EAAE,MAAM,cAAc,CAAC;AAc7D,qBAAa,eAAgB,YAAW,MAAM,CAAC,OAAO,CAAC;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,IAAI;IAEvC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,QAAQ,IAAI,gBAAgB,CAG/B;IAEK,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IA0BpE,OAAO,CAAC,QAAQ;IAmBhB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,WAAW;IA8BnB,OAAO,CAAC,gBAAgB;CASzB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAE5E;AAcD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { XMLParser } from "fast-xml-parser";
|
|
3
|
+
import { METADATA_CATEGORY, } from "../../domain/index.js";
|
|
4
|
+
import { makeEdge, makeNode } from "../common.js";
|
|
5
|
+
import { evaluatePredicate, evaluateRaw, evaluateString } from "./_selectors.js";
|
|
6
|
+
const xmlParser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@_" });
|
|
7
|
+
function sha256(s) {
|
|
8
|
+
return createHash("sha256").update(s).digest("hex");
|
|
9
|
+
}
|
|
10
|
+
function toArr(v) {
|
|
11
|
+
if (v === undefined || v === null)
|
|
12
|
+
return [];
|
|
13
|
+
return Array.isArray(v) ? v : [v];
|
|
14
|
+
}
|
|
15
|
+
export class RuleBasedParser {
|
|
16
|
+
rule;
|
|
17
|
+
constructor(rule) {
|
|
18
|
+
this.rule = rule;
|
|
19
|
+
}
|
|
20
|
+
get type() {
|
|
21
|
+
return this.rule.type;
|
|
22
|
+
}
|
|
23
|
+
get category() {
|
|
24
|
+
// The rule files use the same string constants as METADATA_CATEGORY values.
|
|
25
|
+
return this.rule.category;
|
|
26
|
+
}
|
|
27
|
+
async parse(input, ctx) {
|
|
28
|
+
const record = this.coerceInput(input);
|
|
29
|
+
const caps = ctx.caps ?? {};
|
|
30
|
+
const evalCtx = {
|
|
31
|
+
record,
|
|
32
|
+
item: null,
|
|
33
|
+
ns: ctx.namespace,
|
|
34
|
+
caps,
|
|
35
|
+
};
|
|
36
|
+
const nodes = [];
|
|
37
|
+
const edges = [];
|
|
38
|
+
// Source hash derived from input string when available (parity with old parsers).
|
|
39
|
+
const sourceHashSeed = this.deriveSourceText(input);
|
|
40
|
+
const hashBase = sourceHashSeed ? sha256(sourceHashSeed) : "";
|
|
41
|
+
for (const n of this.rule.nodes) {
|
|
42
|
+
this.emitNode(n, evalCtx, ctx, hashBase, nodes);
|
|
43
|
+
}
|
|
44
|
+
for (const e of this.rule.edges) {
|
|
45
|
+
this.emitEdge(e, evalCtx, ctx, edges);
|
|
46
|
+
}
|
|
47
|
+
return { nodes, edges };
|
|
48
|
+
}
|
|
49
|
+
emitNode(n, evalCtx, ctx, hashBase, out) {
|
|
50
|
+
const items = n.iterate ? toArr(evaluateRaw(n.iterate, evalCtx)) : [null];
|
|
51
|
+
for (const item of items) {
|
|
52
|
+
const subCtx = { ...evalCtx, item };
|
|
53
|
+
if (n.when && !evaluatePredicate(n.when, subCtx))
|
|
54
|
+
continue;
|
|
55
|
+
const qnameVal = evaluateString(n.qname, subCtx);
|
|
56
|
+
if (qnameVal === undefined || qnameVal === null || qnameVal === "")
|
|
57
|
+
continue;
|
|
58
|
+
const qname = String(qnameVal);
|
|
59
|
+
const props = this.materializeProps(n.props, subCtx);
|
|
60
|
+
out.push(makeNode(ctx, n.label, qname, props, hashBase));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
emitEdge(e, evalCtx, ctx, out) {
|
|
64
|
+
const items = e.iterate ? toArr(evaluateRaw(e.iterate, evalCtx)) : [null];
|
|
65
|
+
for (const item of items) {
|
|
66
|
+
const subCtx = { ...evalCtx, item };
|
|
67
|
+
if (e.when && !evaluatePredicate(e.when, subCtx))
|
|
68
|
+
continue;
|
|
69
|
+
const src = evaluateString(e.src, subCtx);
|
|
70
|
+
const dst = evaluateString(e.dst, subCtx);
|
|
71
|
+
if (!src || !dst)
|
|
72
|
+
continue;
|
|
73
|
+
const props = this.materializeProps(e.props, subCtx);
|
|
74
|
+
// relType is a string union at runtime; rule authors must use canonical names.
|
|
75
|
+
out.push(makeEdge(ctx, String(src), e.relType, String(dst), props));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
materializeProps(props, evalCtx) {
|
|
79
|
+
if (!props)
|
|
80
|
+
return {};
|
|
81
|
+
const out = {};
|
|
82
|
+
for (const [k, v] of Object.entries(props)) {
|
|
83
|
+
if (typeof v === "string") {
|
|
84
|
+
const evaluated = evaluateString(v, evalCtx);
|
|
85
|
+
out[k] = evaluated === undefined ? null : evaluated;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
out[k] = v;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
coerceInput(input) {
|
|
94
|
+
if (this.rule.input === "object")
|
|
95
|
+
return input;
|
|
96
|
+
if (this.rule.input === "json") {
|
|
97
|
+
return typeof input === "string" ? JSON.parse(input) : input;
|
|
98
|
+
}
|
|
99
|
+
if (this.rule.input === "xml-string") {
|
|
100
|
+
// Inputs in this codebase pass `{ name, xml }` objects (or similar).
|
|
101
|
+
// Parse the xml field and merge any sibling keys into the record so
|
|
102
|
+
// they're addressable as ${record.<key>}.
|
|
103
|
+
const obj = input;
|
|
104
|
+
const xml = typeof obj?.xml === "string" ? obj.xml : "";
|
|
105
|
+
let parsed = {};
|
|
106
|
+
if (xml)
|
|
107
|
+
parsed = xmlParser.parse(xml);
|
|
108
|
+
const rootKey = this.rule.root;
|
|
109
|
+
const root = rootKey ? (parsed?.[rootKey] ?? {}) : parsed;
|
|
110
|
+
const merged = {
|
|
111
|
+
...(typeof root === "object" && root !== null ? root : {}),
|
|
112
|
+
};
|
|
113
|
+
// Promote sibling keys (name, object, body, etc.) into the record.
|
|
114
|
+
if (obj && typeof obj === "object") {
|
|
115
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
116
|
+
if (k === "xml")
|
|
117
|
+
continue;
|
|
118
|
+
merged[k] = v;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return merged;
|
|
122
|
+
}
|
|
123
|
+
return input;
|
|
124
|
+
}
|
|
125
|
+
deriveSourceText(input) {
|
|
126
|
+
if (typeof input === "string")
|
|
127
|
+
return input;
|
|
128
|
+
if (input && typeof input === "object") {
|
|
129
|
+
const obj = input;
|
|
130
|
+
if (typeof obj.xml === "string")
|
|
131
|
+
return obj.xml;
|
|
132
|
+
if (typeof obj.body === "string")
|
|
133
|
+
return obj.body;
|
|
134
|
+
}
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export function appliesTo(rule, caps) {
|
|
139
|
+
return matchWhen(rule.applies_when, caps);
|
|
140
|
+
}
|
|
141
|
+
function matchWhen(w, caps) {
|
|
142
|
+
if (!w || typeof w !== "object")
|
|
143
|
+
return false;
|
|
144
|
+
const obj = w;
|
|
145
|
+
if ("always" in obj)
|
|
146
|
+
return true;
|
|
147
|
+
if ("capability" in obj)
|
|
148
|
+
return Boolean(caps[obj.capability]);
|
|
149
|
+
if ("not" in obj)
|
|
150
|
+
return !matchWhen(obj.not, caps);
|
|
151
|
+
if ("any_of" in obj)
|
|
152
|
+
return obj.any_of.some((x) => matchWhen(x, caps));
|
|
153
|
+
if ("all_of" in obj)
|
|
154
|
+
return obj.all_of.every((x) => matchWhen(x, caps));
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
// Re-export METADATA_CATEGORY for rule author convenience (unused but stable).
|
|
158
|
+
export { METADATA_CATEGORY };
|
|
159
|
+
//# sourceMappingURL=_engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_engine.js","sourceRoot":"","sources":["../../../src/parsers/rules/_engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAEL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