@ffschrattenecker/tm1-mcp-server 6.0.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/CHANGELOG.md +1211 -0
- package/LICENSE +21 -0
- package/NOTICE +34 -0
- package/README.md +276 -0
- package/dist/config.d.ts +35 -0
- package/dist/config.js +238 -0
- package/dist/http-transport.d.ts +8 -0
- package/dist/http-transport.js +132 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +164 -0
- package/dist/lib/callgraph/callGraph.d.ts +124 -0
- package/dist/lib/callgraph/callGraph.js +334 -0
- package/dist/lib/callgraph/choreGraph.d.ts +23 -0
- package/dist/lib/callgraph/choreGraph.js +102 -0
- package/dist/lib/callgraph/dataFlow.d.ts +74 -0
- package/dist/lib/callgraph/dataFlow.js +271 -0
- package/dist/lib/callgraph/datasourceMembership.d.ts +31 -0
- package/dist/lib/callgraph/datasourceMembership.js +142 -0
- package/dist/lib/callgraph/lintTypes.d.ts +28 -0
- package/dist/lib/callgraph/lintTypes.js +2 -0
- package/dist/lib/callgraph/mdxMembers.d.ts +29 -0
- package/dist/lib/callgraph/mdxMembers.js +97 -0
- package/dist/lib/callgraph/referenceIndex.d.ts +179 -0
- package/dist/lib/callgraph/referenceIndex.js +584 -0
- package/dist/lib/callgraph/rulesLinter.d.ts +55 -0
- package/dist/lib/callgraph/rulesLinter.js +776 -0
- package/dist/lib/callgraph/rulesParser.d.ts +26 -0
- package/dist/lib/callgraph/rulesParser.js +71 -0
- package/dist/lib/callgraph/subsetUsage.d.ts +16 -0
- package/dist/lib/callgraph/subsetUsage.js +134 -0
- package/dist/lib/callgraph/tiParser.d.ts +21 -0
- package/dist/lib/callgraph/tiParser.js +672 -0
- package/dist/lib/callgraph/tiSignatures.d.ts +32 -0
- package/dist/lib/callgraph/tiSignatures.js +6185 -0
- package/dist/lib/callgraph/tm1-adapter.d.ts +32 -0
- package/dist/lib/callgraph/tm1-adapter.js +159 -0
- package/dist/lib/callgraph/types.d.ts +53 -0
- package/dist/lib/callgraph/types.js +2 -0
- package/dist/lib/callgraph/variableEnv.d.ts +86 -0
- package/dist/lib/callgraph/variableEnv.js +214 -0
- package/dist/lib/cell-address.d.ts +12 -0
- package/dist/lib/cell-address.js +71 -0
- package/dist/lib/complexity/antipatterns.d.ts +22 -0
- package/dist/lib/complexity/antipatterns.js +302 -0
- package/dist/lib/complexity/comment-classifier.d.ts +24 -0
- package/dist/lib/complexity/comment-classifier.js +43 -0
- package/dist/lib/complexity/cross-process.d.ts +78 -0
- package/dist/lib/complexity/cross-process.js +114 -0
- package/dist/lib/complexity/process-metrics.d.ts +78 -0
- package/dist/lib/complexity/process-metrics.js +278 -0
- package/dist/lib/complexity/rules-metrics.d.ts +31 -0
- package/dist/lib/complexity/rules-metrics.js +99 -0
- package/dist/lib/concurrency.d.ts +11 -0
- package/dist/lib/concurrency.js +27 -0
- package/dist/lib/control-name.d.ts +10 -0
- package/dist/lib/control-name.js +10 -0
- package/dist/lib/coordinate-error.d.ts +3 -0
- package/dist/lib/coordinate-error.js +29 -0
- package/dist/lib/credential-format.d.ts +23 -0
- package/dist/lib/credential-format.js +25 -0
- package/dist/lib/cube-stats/fetcher.d.ts +106 -0
- package/dist/lib/cube-stats/fetcher.js +194 -0
- package/dist/lib/feeders/brackets.d.ts +47 -0
- package/dist/lib/feeders/brackets.js +195 -0
- package/dist/lib/feeders/element-type-cache.d.ts +42 -0
- package/dist/lib/feeders/element-type-cache.js +86 -0
- package/dist/lib/feeders/static-heuristics.d.ts +101 -0
- package/dist/lib/feeders/static-heuristics.js +202 -0
- package/dist/lib/git-process.d.ts +67 -0
- package/dist/lib/git-process.js +243 -0
- package/dist/lib/mask-secrets.d.ts +10 -0
- package/dist/lib/mask-secrets.js +99 -0
- package/dist/lib/mdx.d.ts +3 -0
- package/dist/lib/mdx.js +13 -0
- package/dist/lib/naming/odata-filter.d.ts +15 -0
- package/dist/lib/naming/odata-filter.js +81 -0
- package/dist/lib/naming/rules.d.ts +34 -0
- package/dist/lib/naming/rules.js +215 -0
- package/dist/lib/pro-parser.d.ts +19 -0
- package/dist/lib/pro-parser.js +260 -0
- package/dist/lib/pro-serializer.d.ts +19 -0
- package/dist/lib/pro-serializer.js +170 -0
- package/dist/lib/process-parts-schema.d.ts +45 -0
- package/dist/lib/process-parts-schema.js +46 -0
- package/dist/lib/process-refs.d.ts +88 -0
- package/dist/lib/process-refs.js +441 -0
- package/dist/lib/rules-outline.d.ts +29 -0
- package/dist/lib/rules-outline.js +68 -0
- package/dist/lib/rules-patch.d.ts +6 -0
- package/dist/lib/rules-patch.js +59 -0
- package/dist/lib/safe-regex.d.ts +15 -0
- package/dist/lib/safe-regex.js +37 -0
- package/dist/lib/sample-cells.d.ts +48 -0
- package/dist/lib/sample-cells.js +146 -0
- package/dist/lib/slim-json-schema.d.ts +20 -0
- package/dist/lib/slim-json-schema.js +68 -0
- package/dist/lib/strip-comments.d.ts +23 -0
- package/dist/lib/strip-comments.js +61 -0
- package/dist/lib/tm1-events.d.ts +16 -0
- package/dist/lib/tm1-events.js +29 -0
- package/dist/lib/v12-compat/deprecated-ti.d.ts +17 -0
- package/dist/lib/v12-compat/deprecated-ti.js +257 -0
- package/dist/lib/v12-compat/scanner.d.ts +10 -0
- package/dist/lib/v12-compat/scanner.js +43 -0
- package/dist/lib/variables-ui-data.d.ts +26 -0
- package/dist/lib/variables-ui-data.js +77 -0
- package/dist/load-env.d.ts +2 -0
- package/dist/load-env.js +29 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +60 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.js +141 -0
- package/dist/resources/index.d.ts +5 -0
- package/dist/resources/index.js +237 -0
- package/dist/resources/list-handler.d.ts +40 -0
- package/dist/resources/list-handler.js +86 -0
- package/dist/resources/subscriptions.d.ts +19 -0
- package/dist/resources/subscriptions.js +80 -0
- package/dist/schemas/cells.d.ts +17 -0
- package/dist/schemas/cells.js +13 -0
- package/dist/schemas/common.d.ts +16 -0
- package/dist/schemas/common.js +14 -0
- package/dist/schemas/index.d.ts +10 -0
- package/dist/schemas/index.js +23 -0
- package/dist/schemas/metadata.d.ts +70 -0
- package/dist/schemas/metadata.js +47 -0
- package/dist/schemas/monitoring.d.ts +95 -0
- package/dist/schemas/monitoring.js +69 -0
- package/dist/schemas/processes.d.ts +74 -0
- package/dist/schemas/processes.js +66 -0
- package/dist/schemas/scheduling.d.ts +13 -0
- package/dist/schemas/scheduling.js +13 -0
- package/dist/schemas/security.d.ts +19 -0
- package/dist/schemas/security.js +16 -0
- package/dist/schemas/subsets.d.ts +12 -0
- package/dist/schemas/subsets.js +12 -0
- package/dist/schemas/views.d.ts +9 -0
- package/dist/schemas/views.js +9 -0
- package/dist/session-manager.d.ts +79 -0
- package/dist/session-manager.js +281 -0
- package/dist/tm1-client/connection/profile.d.ts +13 -0
- package/dist/tm1-client/connection/profile.js +99 -0
- package/dist/tm1-client/dispatcher.d.ts +5 -0
- package/dist/tm1-client/dispatcher.js +31 -0
- package/dist/tm1-client/http.d.ts +81 -0
- package/dist/tm1-client/http.js +547 -0
- package/dist/tm1-client/services/batch-service.d.ts +123 -0
- package/dist/tm1-client/services/batch-service.js +455 -0
- package/dist/tm1-client/services/cell-service.d.ts +71 -0
- package/dist/tm1-client/services/cell-service.js +333 -0
- package/dist/tm1-client/services/cellset-transform.d.ts +26 -0
- package/dist/tm1-client/services/cellset-transform.js +80 -0
- package/dist/tm1-client/services/chore-service.d.ts +68 -0
- package/dist/tm1-client/services/chore-service.js +179 -0
- package/dist/tm1-client/services/chore-status.d.ts +11 -0
- package/dist/tm1-client/services/chore-status.js +127 -0
- package/dist/tm1-client/services/cube-service.d.ts +134 -0
- package/dist/tm1-client/services/cube-service.js +294 -0
- package/dist/tm1-client/services/dimension-service.d.ts +118 -0
- package/dist/tm1-client/services/dimension-service.js +249 -0
- package/dist/tm1-client/services/element-service.d.ts +245 -0
- package/dist/tm1-client/services/element-service.js +809 -0
- package/dist/tm1-client/services/fallback.d.ts +44 -0
- package/dist/tm1-client/services/fallback.js +72 -0
- package/dist/tm1-client/services/file-service.d.ts +53 -0
- package/dist/tm1-client/services/file-service.js +218 -0
- package/dist/tm1-client/services/hierarchy-service.d.ts +129 -0
- package/dist/tm1-client/services/hierarchy-service.js +332 -0
- package/dist/tm1-client/services/monitoring-service.d.ts +34 -0
- package/dist/tm1-client/services/monitoring-service.js +123 -0
- package/dist/tm1-client/services/odata-page.d.ts +71 -0
- package/dist/tm1-client/services/odata-page.js +87 -0
- package/dist/tm1-client/services/process-service.d.ts +278 -0
- package/dist/tm1-client/services/process-service.js +874 -0
- package/dist/tm1-client/services/process-status.d.ts +21 -0
- package/dist/tm1-client/services/process-status.js +89 -0
- package/dist/tm1-client/services/security-service.d.ts +50 -0
- package/dist/tm1-client/services/security-service.js +93 -0
- package/dist/tm1-client/services/server-service.d.ts +116 -0
- package/dist/tm1-client/services/server-service.js +504 -0
- package/dist/tm1-client/services/subset-service.d.ts +37 -0
- package/dist/tm1-client/services/subset-service.js +122 -0
- package/dist/tm1-client/services/view-service.d.ts +46 -0
- package/dist/tm1-client/services/view-service.js +287 -0
- package/dist/tm1-client.d.ts +56 -0
- package/dist/tm1-client.js +126 -0
- package/dist/tools/analysis/analyze-callgraph.d.ts +28 -0
- package/dist/tools/analysis/analyze-callgraph.js +350 -0
- package/dist/tools/analysis/analyze-chore-graph.d.ts +2 -0
- package/dist/tools/analysis/analyze-chore-graph.js +148 -0
- package/dist/tools/analysis/analyze-object-usage.d.ts +2 -0
- package/dist/tools/analysis/analyze-object-usage.js +143 -0
- package/dist/tools/analysis/audit-complexity.d.ts +2 -0
- package/dist/tools/analysis/audit-complexity.js +255 -0
- package/dist/tools/analysis/audit-feeders.d.ts +2 -0
- package/dist/tools/analysis/audit-feeders.js +417 -0
- package/dist/tools/analysis/audit-naming.d.ts +2 -0
- package/dist/tools/analysis/audit-naming.js +379 -0
- package/dist/tools/analysis/check-v12-readiness.d.ts +2 -0
- package/dist/tools/analysis/check-v12-readiness.js +136 -0
- package/dist/tools/analysis/find-orphan-dimensions.d.ts +2 -0
- package/dist/tools/analysis/find-orphan-dimensions.js +55 -0
- package/dist/tools/analysis/invalidate-callgraph-cache.d.ts +2 -0
- package/dist/tools/analysis/invalidate-callgraph-cache.js +40 -0
- package/dist/tools/analysis/trace-data-flow.d.ts +2 -0
- package/dist/tools/analysis/trace-data-flow.js +138 -0
- package/dist/tools/annotations.d.ts +12 -0
- package/dist/tools/annotations.js +61 -0
- package/dist/tools/celldata/check-feeders.d.ts +2 -0
- package/dist/tools/celldata/check-feeders.js +48 -0
- package/dist/tools/celldata/check-writable-coords.d.ts +2 -0
- package/dist/tools/celldata/check-writable-coords.js +126 -0
- package/dist/tools/celldata/execute-mdx.d.ts +17 -0
- package/dist/tools/celldata/execute-mdx.js +126 -0
- package/dist/tools/celldata/get-cell-value.d.ts +2 -0
- package/dist/tools/celldata/get-cell-value.js +30 -0
- package/dist/tools/celldata/get-view-definition.d.ts +2 -0
- package/dist/tools/celldata/get-view-definition.js +29 -0
- package/dist/tools/celldata/get-view.d.ts +2 -0
- package/dist/tools/celldata/get-view.js +55 -0
- package/dist/tools/celldata/sample-cells.d.ts +2 -0
- package/dist/tools/celldata/sample-cells.js +101 -0
- package/dist/tools/celldata/trace-cell-calculation.d.ts +2 -0
- package/dist/tools/celldata/trace-cell-calculation.js +53 -0
- package/dist/tools/celldata/trace-feeders.d.ts +2 -0
- package/dist/tools/celldata/trace-feeders.js +44 -0
- package/dist/tools/celldata/write-cells.d.ts +2 -0
- package/dist/tools/celldata/write-cells.js +65 -0
- package/dist/tools/confirm.d.ts +10 -0
- package/dist/tools/confirm.js +64 -0
- package/dist/tools/define-tool.d.ts +51 -0
- package/dist/tools/define-tool.js +49 -0
- package/dist/tools/dimension-management/bulk-upsert-elements.d.ts +2 -0
- package/dist/tools/dimension-management/bulk-upsert-elements.js +103 -0
- package/dist/tools/dimension-management/create-dimension.d.ts +2 -0
- package/dist/tools/dimension-management/create-dimension.js +22 -0
- package/dist/tools/dimension-management/create-element-attribute.d.ts +2 -0
- package/dist/tools/dimension-management/create-element-attribute.js +26 -0
- package/dist/tools/dimension-management/create-element.d.ts +2 -0
- package/dist/tools/dimension-management/create-element.js +31 -0
- package/dist/tools/dimension-management/create-hierarchy.d.ts +2 -0
- package/dist/tools/dimension-management/create-hierarchy.js +22 -0
- package/dist/tools/dimension-management/delete-dimension.d.ts +2 -0
- package/dist/tools/dimension-management/delete-dimension.js +25 -0
- package/dist/tools/dimension-management/delete-element.d.ts +2 -0
- package/dist/tools/dimension-management/delete-element.js +26 -0
- package/dist/tools/dimension-management/delete-elements.d.ts +2 -0
- package/dist/tools/dimension-management/delete-elements.js +44 -0
- package/dist/tools/dimension-management/delete-hierarchy.d.ts +2 -0
- package/dist/tools/dimension-management/delete-hierarchy.js +35 -0
- package/dist/tools/dimension-management/get-element-attribute-values.d.ts +2 -0
- package/dist/tools/dimension-management/get-element-attribute-values.js +77 -0
- package/dist/tools/dimension-management/list-element-attributes.d.ts +2 -0
- package/dist/tools/dimension-management/list-element-attributes.js +31 -0
- package/dist/tools/dimension-management/move-element.d.ts +2 -0
- package/dist/tools/dimension-management/move-element.js +28 -0
- package/dist/tools/dimension-management/update-element-attribute-value.d.ts +2 -0
- package/dist/tools/dimension-management/update-element-attribute-value.js +80 -0
- package/dist/tools/dimension-management/update-element.d.ts +2 -0
- package/dist/tools/dimension-management/update-element.js +35 -0
- package/dist/tools/error-format.d.ts +22 -0
- package/dist/tools/error-format.js +130 -0
- package/dist/tools/fileops/delete-file.d.ts +2 -0
- package/dist/tools/fileops/delete-file.js +32 -0
- package/dist/tools/fileops/get-file-content.d.ts +2 -0
- package/dist/tools/fileops/get-file-content.js +76 -0
- package/dist/tools/fileops/list-files.d.ts +2 -0
- package/dist/tools/fileops/list-files.js +43 -0
- package/dist/tools/fileops/search-files.d.ts +2 -0
- package/dist/tools/fileops/search-files.js +76 -0
- package/dist/tools/fileops/upload-file.d.ts +2 -0
- package/dist/tools/fileops/upload-file.js +69 -0
- package/dist/tools/format.d.ts +57 -0
- package/dist/tools/format.js +157 -0
- package/dist/tools/hierarchy.d.ts +6 -0
- package/dist/tools/hierarchy.js +27 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.js +263 -0
- package/dist/tools/local-file.d.ts +16 -0
- package/dist/tools/local-file.js +88 -0
- package/dist/tools/metadata/get-ancestors.d.ts +2 -0
- package/dist/tools/metadata/get-ancestors.js +36 -0
- package/dist/tools/metadata/get-descendants.d.ts +2 -0
- package/dist/tools/metadata/get-descendants.js +64 -0
- package/dist/tools/metadata/get-hierarchy.d.ts +2 -0
- package/dist/tools/metadata/get-hierarchy.js +130 -0
- package/dist/tools/metadata/list-chores.d.ts +2 -0
- package/dist/tools/metadata/list-chores.js +62 -0
- package/dist/tools/metadata/list-cubes.d.ts +2 -0
- package/dist/tools/metadata/list-cubes.js +128 -0
- package/dist/tools/metadata/list-dimensions.d.ts +2 -0
- package/dist/tools/metadata/list-dimensions.js +131 -0
- package/dist/tools/metadata/list-processes-grouped.d.ts +2 -0
- package/dist/tools/metadata/list-processes-grouped.js +96 -0
- package/dist/tools/metadata/list-processes.d.ts +2 -0
- package/dist/tools/metadata/list-processes.js +108 -0
- package/dist/tools/metadata/resolve-default-members.d.ts +2 -0
- package/dist/tools/metadata/resolve-default-members.js +46 -0
- package/dist/tools/model-building/check-cube-rule.d.ts +2 -0
- package/dist/tools/model-building/check-cube-rule.js +51 -0
- package/dist/tools/model-building/clear-cube.d.ts +2 -0
- package/dist/tools/model-building/clear-cube.js +46 -0
- package/dist/tools/model-building/create-cube.d.ts +2 -0
- package/dist/tools/model-building/create-cube.js +34 -0
- package/dist/tools/model-building/delete-cube.d.ts +2 -0
- package/dist/tools/model-building/delete-cube.js +27 -0
- package/dist/tools/model-building/get-all-cube-rules.d.ts +2 -0
- package/dist/tools/model-building/get-all-cube-rules.js +149 -0
- package/dist/tools/model-building/get-cube-rules.d.ts +2 -0
- package/dist/tools/model-building/get-cube-rules.js +69 -0
- package/dist/tools/model-building/rules-source.d.ts +21 -0
- package/dist/tools/model-building/rules-source.js +49 -0
- package/dist/tools/model-building/search-rules.d.ts +2 -0
- package/dist/tools/model-building/search-rules.js +132 -0
- package/dist/tools/model-building/set-cube-rules.d.ts +2 -0
- package/dist/tools/model-building/set-cube-rules.js +81 -0
- package/dist/tools/model-building/unload-cube.d.ts +2 -0
- package/dist/tools/model-building/unload-cube.js +23 -0
- package/dist/tools/operations/diagnose-process-error.d.ts +2 -0
- package/dist/tools/operations/diagnose-process-error.js +178 -0
- package/dist/tools/operations/error-log-helpers.d.ts +25 -0
- package/dist/tools/operations/error-log-helpers.js +57 -0
- package/dist/tools/operations/get-audit-log.d.ts +2 -0
- package/dist/tools/operations/get-audit-log.js +70 -0
- package/dist/tools/operations/get-cube-stats.d.ts +2 -0
- package/dist/tools/operations/get-cube-stats.js +107 -0
- package/dist/tools/operations/get-error-log-content.d.ts +2 -0
- package/dist/tools/operations/get-error-log-content.js +164 -0
- package/dist/tools/operations/get-jobs.d.ts +3 -0
- package/dist/tools/operations/get-jobs.js +51 -0
- package/dist/tools/operations/get-message-log.d.ts +2 -0
- package/dist/tools/operations/get-message-log.js +63 -0
- package/dist/tools/operations/get-server-info.d.ts +2 -0
- package/dist/tools/operations/get-server-info.js +180 -0
- package/dist/tools/operations/get-server-state.d.ts +2 -0
- package/dist/tools/operations/get-server-state.js +129 -0
- package/dist/tools/operations/get-sessions.d.ts +2 -0
- package/dist/tools/operations/get-sessions.js +76 -0
- package/dist/tools/operations/get-threads.d.ts +3 -0
- package/dist/tools/operations/get-threads.js +50 -0
- package/dist/tools/operations/get-transaction-log.d.ts +2 -0
- package/dist/tools/operations/get-transaction-log.js +63 -0
- package/dist/tools/operations/list-error-logs.d.ts +8 -0
- package/dist/tools/operations/list-error-logs.js +157 -0
- package/dist/tools/operations/save-data.d.ts +2 -0
- package/dist/tools/operations/save-data.js +50 -0
- package/dist/tools/pagination.d.ts +32 -0
- package/dist/tools/pagination.js +116 -0
- package/dist/tools/scheduling/create-chore.d.ts +2 -0
- package/dist/tools/scheduling/create-chore.js +93 -0
- package/dist/tools/scheduling/delete-chore.d.ts +2 -0
- package/dist/tools/scheduling/delete-chore.js +22 -0
- package/dist/tools/scheduling/execute-chore.d.ts +2 -0
- package/dist/tools/scheduling/execute-chore.js +52 -0
- package/dist/tools/scheduling/toggle-chore.d.ts +2 -0
- package/dist/tools/scheduling/toggle-chore.js +22 -0
- package/dist/tools/scheduling/update-chore.d.ts +2 -0
- package/dist/tools/scheduling/update-chore.js +71 -0
- package/dist/tools/schemas/common.d.ts +10 -0
- package/dist/tools/schemas/common.js +23 -0
- package/dist/tools/schemas/items-analysis.d.ts +394 -0
- package/dist/tools/schemas/items-analysis.js +419 -0
- package/dist/tools/schemas/items-cells.d.ts +70 -0
- package/dist/tools/schemas/items-cells.js +65 -0
- package/dist/tools/schemas/items-common.d.ts +18 -0
- package/dist/tools/schemas/items-common.js +39 -0
- package/dist/tools/schemas/items-fileops.d.ts +11 -0
- package/dist/tools/schemas/items-fileops.js +13 -0
- package/dist/tools/schemas/items-metadata.d.ts +262 -0
- package/dist/tools/schemas/items-metadata.js +184 -0
- package/dist/tools/schemas/items-monitoring.d.ts +79 -0
- package/dist/tools/schemas/items-monitoring.js +78 -0
- package/dist/tools/schemas/items-processes.d.ts +279 -0
- package/dist/tools/schemas/items-processes.js +235 -0
- package/dist/tools/schemas/items-scheduling.d.ts +25 -0
- package/dist/tools/schemas/items-scheduling.js +26 -0
- package/dist/tools/schemas/items-security.d.ts +19 -0
- package/dist/tools/schemas/items-security.js +12 -0
- package/dist/tools/schemas/items-subsets.d.ts +2 -0
- package/dist/tools/schemas/items-subsets.js +4 -0
- package/dist/tools/schemas/items-views.d.ts +38 -0
- package/dist/tools/schemas/items-views.js +26 -0
- package/dist/tools/schemas/items.d.ts +12 -0
- package/dist/tools/schemas/items.js +23 -0
- package/dist/tools/schemas/markdown-capable.d.ts +21 -0
- package/dist/tools/schemas/markdown-capable.js +58 -0
- package/dist/tools/schemas/output-schema.d.ts +24 -0
- package/dist/tools/schemas/output-schema.js +25 -0
- package/dist/tools/security/assign-client-group.d.ts +2 -0
- package/dist/tools/security/assign-client-group.js +20 -0
- package/dist/tools/security/create-client.d.ts +2 -0
- package/dist/tools/security/create-client.js +28 -0
- package/dist/tools/security/delete-client.d.ts +2 -0
- package/dist/tools/security/delete-client.js +22 -0
- package/dist/tools/security/get-client.d.ts +2 -0
- package/dist/tools/security/get-client.js +20 -0
- package/dist/tools/security/list-clients.d.ts +2 -0
- package/dist/tools/security/list-clients.js +86 -0
- package/dist/tools/security/list-groups.d.ts +2 -0
- package/dist/tools/security/list-groups.js +43 -0
- package/dist/tools/security/remove-client-group.d.ts +2 -0
- package/dist/tools/security/remove-client-group.js +27 -0
- package/dist/tools/security/update-client.d.ts +2 -0
- package/dist/tools/security/update-client.js +22 -0
- package/dist/tools/subsets/create-subset.d.ts +2 -0
- package/dist/tools/subsets/create-subset.js +44 -0
- package/dist/tools/subsets/delete-subset.d.ts +2 -0
- package/dist/tools/subsets/delete-subset.js +26 -0
- package/dist/tools/subsets/get-subset.d.ts +2 -0
- package/dist/tools/subsets/get-subset.js +29 -0
- package/dist/tools/subsets/list-subsets.d.ts +2 -0
- package/dist/tools/subsets/list-subsets.js +36 -0
- package/dist/tools/subsets/update-subset.d.ts +2 -0
- package/dist/tools/subsets/update-subset.js +33 -0
- package/dist/tools/ti-development/check-process-code.d.ts +2 -0
- package/dist/tools/ti-development/check-process-code.js +96 -0
- package/dist/tools/ti-development/compile-process.d.ts +2 -0
- package/dist/tools/ti-development/compile-process.js +32 -0
- package/dist/tools/ti-development/copy-process.d.ts +2 -0
- package/dist/tools/ti-development/copy-process.js +32 -0
- package/dist/tools/ti-development/delete-process.d.ts +2 -0
- package/dist/tools/ti-development/delete-process.js +26 -0
- package/dist/tools/ti-development/diff-process-with-file.d.ts +2 -0
- package/dist/tools/ti-development/diff-process-with-file.js +208 -0
- package/dist/tools/ti-development/diff-processes.d.ts +2 -0
- package/dist/tools/ti-development/diff-processes.js +312 -0
- package/dist/tools/ti-development/execute-process.d.ts +8 -0
- package/dist/tools/ti-development/execute-process.js +109 -0
- package/dist/tools/ti-development/export-process-to-git.d.ts +2 -0
- package/dist/tools/ti-development/export-process-to-git.js +113 -0
- package/dist/tools/ti-development/export-process-to-pro.d.ts +2 -0
- package/dist/tools/ti-development/export-process-to-pro.js +117 -0
- package/dist/tools/ti-development/get-all-processes-code.d.ts +2 -0
- package/dist/tools/ti-development/get-all-processes-code.js +131 -0
- package/dist/tools/ti-development/get-process-code.d.ts +2 -0
- package/dist/tools/ti-development/get-process-code.js +100 -0
- package/dist/tools/ti-development/get-process-datasource.d.ts +2 -0
- package/dist/tools/ti-development/get-process-datasource.js +20 -0
- package/dist/tools/ti-development/get-process-parameters.d.ts +2 -0
- package/dist/tools/ti-development/get-process-parameters.js +25 -0
- package/dist/tools/ti-development/get-process-variables.d.ts +2 -0
- package/dist/tools/ti-development/get-process-variables.js +38 -0
- package/dist/tools/ti-development/get-process.d.ts +2 -0
- package/dist/tools/ti-development/get-process.js +163 -0
- package/dist/tools/ti-development/import-pro-file.d.ts +2 -0
- package/dist/tools/ti-development/import-pro-file.js +153 -0
- package/dist/tools/ti-development/import-process-from-git.d.ts +2 -0
- package/dist/tools/ti-development/import-process-from-git.js +198 -0
- package/dist/tools/ti-development/install-pro-bundle.d.ts +2 -0
- package/dist/tools/ti-development/install-pro-bundle.js +288 -0
- package/dist/tools/ti-development/preflight.d.ts +39 -0
- package/dist/tools/ti-development/preflight.js +56 -0
- package/dist/tools/ti-development/process-backup.d.ts +29 -0
- package/dist/tools/ti-development/process-backup.js +118 -0
- package/dist/tools/ti-development/search-code.d.ts +2 -0
- package/dist/tools/ti-development/search-code.js +208 -0
- package/dist/tools/ti-development/upsert-process.d.ts +2 -0
- package/dist/tools/ti-development/upsert-process.js +167 -0
- package/dist/tools/ti-development/validate-process-refs.d.ts +2 -0
- package/dist/tools/ti-development/validate-process-refs.js +73 -0
- package/dist/tools/views/create-mdx-view.d.ts +2 -0
- package/dist/tools/views/create-mdx-view.js +21 -0
- package/dist/tools/views/create-native-view.d.ts +2 -0
- package/dist/tools/views/create-native-view.js +81 -0
- package/dist/tools/views/delete-view.d.ts +2 -0
- package/dist/tools/views/delete-view.js +23 -0
- package/dist/tools/views/list-views.d.ts +2 -0
- package/dist/tools/views/list-views.js +32 -0
- package/dist/tools/with-annotations.d.ts +6 -0
- package/dist/tools/with-annotations.js +339 -0
- package/dist/types.d.ts +409 -0
- package/dist/types.js +91 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.js +18 -0
- package/package.json +107 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { lookupReferences } from "./referenceIndex.js";
|
|
2
|
+
function lc(s) {
|
|
3
|
+
return s.toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
/** Build outgoing call edges for a given process (what it calls). */
|
|
6
|
+
function outgoingCalls(index, process) {
|
|
7
|
+
const refs = index.bySourceProcess.get(lc(process)) ?? [];
|
|
8
|
+
const edges = [];
|
|
9
|
+
for (const r of refs) {
|
|
10
|
+
if (r.targetKind !== "process") {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (!r.funcName) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
edges.push(refToEdge(r));
|
|
17
|
+
}
|
|
18
|
+
return edges;
|
|
19
|
+
}
|
|
20
|
+
/** Build incoming call edges (callers of this process). */
|
|
21
|
+
function incomingCalls(index, process) {
|
|
22
|
+
const refs = index.byProcess.get(lc(process)) ?? [];
|
|
23
|
+
const edges = [];
|
|
24
|
+
for (const r of refs) {
|
|
25
|
+
if (r.sourceKind !== "process") {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (!r.funcName) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
edges.push(refToEdge(r));
|
|
32
|
+
}
|
|
33
|
+
return edges;
|
|
34
|
+
}
|
|
35
|
+
function refToEdge(r) {
|
|
36
|
+
return {
|
|
37
|
+
caller: r.sourceName,
|
|
38
|
+
callee: r.targetName,
|
|
39
|
+
section: r.section,
|
|
40
|
+
line: r.line,
|
|
41
|
+
funcName: r.funcName ?? "ExecuteProcess",
|
|
42
|
+
snippet: r.snippet,
|
|
43
|
+
params: r.params ?? [],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// ─── Env resolution ──────────────────────────────────────────────────────────
|
|
47
|
+
/**
|
|
48
|
+
* Resolve one call-site CallParamResolution against the parent node's env.
|
|
49
|
+
* - literal stays literal
|
|
50
|
+
* - passthrough → look up the named caller-param in parent env:
|
|
51
|
+
* known literal → propagate; unknown → mark unknown; dynamic → dynamic
|
|
52
|
+
* - dynamic stays dynamic
|
|
53
|
+
*/
|
|
54
|
+
export function resolveEdgeParam(res, parentEnv) {
|
|
55
|
+
switch (res.kind) {
|
|
56
|
+
case "literal":
|
|
57
|
+
return { kind: "literal", value: res.value };
|
|
58
|
+
case "dynamic":
|
|
59
|
+
return { kind: "dynamic" };
|
|
60
|
+
case "passthrough": {
|
|
61
|
+
const up = parentEnv.get(res.paramName.toLowerCase());
|
|
62
|
+
if (!up) {
|
|
63
|
+
return { kind: "unknown", viaParam: res.paramName };
|
|
64
|
+
}
|
|
65
|
+
if (up.kind === "literal") {
|
|
66
|
+
return up;
|
|
67
|
+
}
|
|
68
|
+
if (up.kind === "unknown") {
|
|
69
|
+
return { kind: "unknown", viaParam: up.viaParam };
|
|
70
|
+
}
|
|
71
|
+
return { kind: "dynamic" };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Initial env for a process: its declared params, filled with defaults if known, else unknown. */
|
|
76
|
+
function buildInitialEnv(procName, index) {
|
|
77
|
+
const env = new Map();
|
|
78
|
+
const params = index.processParams.get(lc(procName)) ?? [];
|
|
79
|
+
const defaults = index.processDefaults.get(lc(procName));
|
|
80
|
+
for (const p of params) {
|
|
81
|
+
const def = defaults?.get(p);
|
|
82
|
+
env.set(lc(p), def !== undefined
|
|
83
|
+
? { kind: "literal", value: def }
|
|
84
|
+
: { kind: "unknown", viaParam: p });
|
|
85
|
+
}
|
|
86
|
+
return env;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Derive child's env from parent's env + edge params.
|
|
90
|
+
* Start from child's initial env (its own params + defaults), then overwrite
|
|
91
|
+
* anything the caller passed explicitly at this call site.
|
|
92
|
+
*/
|
|
93
|
+
function deriveChildEnv(childProc, edge, parentEnv, index) {
|
|
94
|
+
const env = buildInitialEnv(childProc, index);
|
|
95
|
+
const effectiveParams = [];
|
|
96
|
+
for (const cp of edge.params) {
|
|
97
|
+
const eff = resolveEdgeParam(cp.resolution, parentEnv);
|
|
98
|
+
env.set(lc(cp.name), eff);
|
|
99
|
+
effectiveParams.push({
|
|
100
|
+
name: cp.name,
|
|
101
|
+
effective: eff,
|
|
102
|
+
valueRaw: cp.valueRaw,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
edge.effectiveParams = effectiveParams;
|
|
106
|
+
return env;
|
|
107
|
+
}
|
|
108
|
+
function unresolvedFor(index, process, direction) {
|
|
109
|
+
if (direction !== "downstream") {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const u = index.unresolvedCallsBySourceProcess.get(lc(process));
|
|
113
|
+
return u && u.length > 0 ? u : undefined;
|
|
114
|
+
}
|
|
115
|
+
// ─── Graph construction ─────────────────────────────────────────────────────
|
|
116
|
+
/**
|
|
117
|
+
* Recursively build the call graph starting from `start`.
|
|
118
|
+
*
|
|
119
|
+
* downstream: children = processes that THIS process calls (with env-propagation)
|
|
120
|
+
* upstream: children = processes that CALL this process (no env-propagation)
|
|
121
|
+
*
|
|
122
|
+
* Cycle detection uses the ancestor chain: if a candidate child is already
|
|
123
|
+
* on the path from the root, `cycle = true` and children are empty.
|
|
124
|
+
*
|
|
125
|
+
* Duplicate edges (same caller→callee, different lines/sections) are kept
|
|
126
|
+
* as separate nodes — each represents a distinct call site.
|
|
127
|
+
*/
|
|
128
|
+
export function buildCallGraph(index, start, opts) {
|
|
129
|
+
const maxDepth = opts.maxDepth ?? 20;
|
|
130
|
+
const includeSystem = opts.includeSystem ?? true;
|
|
131
|
+
const rootEnv = opts.direction === "downstream" ? buildInitialEnv(start, index) : undefined;
|
|
132
|
+
const root = {
|
|
133
|
+
process: start,
|
|
134
|
+
incomingEdge: null,
|
|
135
|
+
env: rootEnv,
|
|
136
|
+
children: [],
|
|
137
|
+
cycle: false,
|
|
138
|
+
unresolvedCalls: unresolvedFor(index, start, opts.direction),
|
|
139
|
+
};
|
|
140
|
+
const visit = (node, ancestors, depth) => {
|
|
141
|
+
if (depth >= maxDepth) {
|
|
142
|
+
node.depthLimitReached = true;
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const edges = opts.direction === "downstream"
|
|
146
|
+
? outgoingCalls(index, node.process)
|
|
147
|
+
: incomingCalls(index, node.process);
|
|
148
|
+
edges.sort((a, b) => (opts.direction === "downstream"
|
|
149
|
+
? a.callee.localeCompare(b.callee)
|
|
150
|
+
: a.caller.localeCompare(b.caller)) || a.line - b.line);
|
|
151
|
+
for (const edge of edges) {
|
|
152
|
+
const nextProc = opts.direction === "downstream" ? edge.callee : edge.caller;
|
|
153
|
+
if (!includeSystem && nextProc.startsWith("}")) {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
const childEnv = opts.direction === "downstream" && node.env
|
|
157
|
+
? deriveChildEnv(nextProc, edge, node.env, index)
|
|
158
|
+
: undefined;
|
|
159
|
+
const childNode = {
|
|
160
|
+
process: nextProc,
|
|
161
|
+
incomingEdge: edge,
|
|
162
|
+
env: childEnv,
|
|
163
|
+
children: [],
|
|
164
|
+
cycle: ancestors.has(lc(nextProc)),
|
|
165
|
+
unresolvedCalls: unresolvedFor(index, nextProc, opts.direction),
|
|
166
|
+
};
|
|
167
|
+
node.children.push(childNode);
|
|
168
|
+
if (!childNode.cycle) {
|
|
169
|
+
const nextAncestors = new Set(ancestors);
|
|
170
|
+
nextAncestors.add(lc(nextProc));
|
|
171
|
+
visit(childNode, nextAncestors, depth + 1);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const initialAncestors = new Set([lc(start)]);
|
|
176
|
+
visit(root, initialAncestors, 0);
|
|
177
|
+
return root;
|
|
178
|
+
}
|
|
179
|
+
// ─── Cube / Dimension usage ─────────────────────────────────────────────────
|
|
180
|
+
// Functions that write cell/attribute data into a cube.
|
|
181
|
+
const WRITE_FUNCS = new Set([
|
|
182
|
+
"cellputn",
|
|
183
|
+
"cellputs",
|
|
184
|
+
"cellincrementn",
|
|
185
|
+
"batchcellincrement",
|
|
186
|
+
"cellputproportionalspread",
|
|
187
|
+
"viewzeroout",
|
|
188
|
+
"cubecleardata",
|
|
189
|
+
"cubeprocessfeeders",
|
|
190
|
+
// Cube attribute value writes (target the }CubeAttributes control cube).
|
|
191
|
+
"cubeattrputn",
|
|
192
|
+
"cubeattrputs",
|
|
193
|
+
// Element/dimension attribute value writes (target the }ElementAttributes_<dim>
|
|
194
|
+
// control cube; classified as a write on the dimension).
|
|
195
|
+
"attrputn",
|
|
196
|
+
"attrputs",
|
|
197
|
+
"elementattrputn",
|
|
198
|
+
"elementattrputs",
|
|
199
|
+
]);
|
|
200
|
+
// Functions that read cell/attribute data from a cube.
|
|
201
|
+
const READ_FUNCS = new Set([
|
|
202
|
+
"cellgetn",
|
|
203
|
+
"cellgets",
|
|
204
|
+
"cellexists",
|
|
205
|
+
"cellisrule",
|
|
206
|
+
"cellisundefined",
|
|
207
|
+
"cellisupdateable",
|
|
208
|
+
// Cube attribute value reads (locale form; CubeAttrN/S base form is not a real TI fn).
|
|
209
|
+
"cubeattrnl",
|
|
210
|
+
"cubeattrsl",
|
|
211
|
+
// Element/dimension attribute value reads (classified as a read on the dimension).
|
|
212
|
+
"attrn",
|
|
213
|
+
"attrs",
|
|
214
|
+
"attrnl",
|
|
215
|
+
"attrsl",
|
|
216
|
+
"elementattrn",
|
|
217
|
+
"elementattrs",
|
|
218
|
+
"elementattrnl",
|
|
219
|
+
"elementattrsl",
|
|
220
|
+
"db", // cube rule DB() reference
|
|
221
|
+
]);
|
|
222
|
+
export function classifyAccess(funcName, sourceKind) {
|
|
223
|
+
// Rule bracket-refs and DB() are always reads.
|
|
224
|
+
if (sourceKind === "rule")
|
|
225
|
+
return "read";
|
|
226
|
+
if (!funcName)
|
|
227
|
+
return "other";
|
|
228
|
+
const lc = funcName.toLowerCase();
|
|
229
|
+
if (WRITE_FUNCS.has(lc))
|
|
230
|
+
return "write";
|
|
231
|
+
if (READ_FUNCS.has(lc))
|
|
232
|
+
return "read";
|
|
233
|
+
return "other";
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Collect all references to a cube or dimension as a flat list, sorted by
|
|
237
|
+
* source name and line. Self-references (a cube's own rules reading from the
|
|
238
|
+
* cube itself via DB()/`[...]`) are filtered out to avoid noise — the rule
|
|
239
|
+
* editor already shows them inline.
|
|
240
|
+
*/
|
|
241
|
+
export function buildCubeOrDimUsages(index, kind, name, opts = {}) {
|
|
242
|
+
const includeSystem = opts.includeSystem ?? true;
|
|
243
|
+
const accessMode = opts.accessMode ?? "all";
|
|
244
|
+
const refs = lookupReferences(index, kind, name);
|
|
245
|
+
const result = [];
|
|
246
|
+
const nameLc = name.toLowerCase();
|
|
247
|
+
for (const r of refs) {
|
|
248
|
+
// Skip self-refs: a cube's own rules referencing itself via DB()/`[...]`
|
|
249
|
+
if (kind === "cube" &&
|
|
250
|
+
r.sourceKind === "rule" &&
|
|
251
|
+
r.sourceName.toLowerCase() === nameLc) {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (!includeSystem && r.sourceName.startsWith("}")) {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
const accessType = classifyAccess(r.funcName, r.sourceKind);
|
|
258
|
+
if (accessMode !== "all" && accessType !== accessMode) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
result.push({
|
|
262
|
+
sourceKind: r.sourceKind,
|
|
263
|
+
sourceName: r.sourceName,
|
|
264
|
+
section: r.section,
|
|
265
|
+
line: r.line,
|
|
266
|
+
funcName: r.funcName,
|
|
267
|
+
snippet: r.snippet,
|
|
268
|
+
accessType,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
result.sort((a, b) => a.sourceName.localeCompare(b.sourceName) || a.line - b.line);
|
|
272
|
+
return result;
|
|
273
|
+
}
|
|
274
|
+
/** Flattens the tree depth-first for simple list rendering. */
|
|
275
|
+
export function flattenCallGraph(root) {
|
|
276
|
+
const out = [];
|
|
277
|
+
const walk = (n, depth) => {
|
|
278
|
+
out.push({ node: n, depth });
|
|
279
|
+
for (const c of n.children) {
|
|
280
|
+
walk(c, depth + 1);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
walk(root, 0);
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
// ─── Formatting helpers ─────────────────────────────────────────────────────
|
|
287
|
+
function formatEffective(eff, valueRaw) {
|
|
288
|
+
switch (eff.kind) {
|
|
289
|
+
case "literal": {
|
|
290
|
+
const wasQuoted = valueRaw.trim().startsWith("'");
|
|
291
|
+
return wasQuoted ? `'${eff.value}'` : eff.value;
|
|
292
|
+
}
|
|
293
|
+
case "unknown":
|
|
294
|
+
return `«${eff.viaParam}»`;
|
|
295
|
+
case "dynamic":
|
|
296
|
+
return "?";
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Human-readable param summary using effective values (env-propagated).
|
|
301
|
+
* Falls back to raw resolution if no effective values are available (upstream mode).
|
|
302
|
+
* pRegion='UK', pYear=2026, pSource=«pCaller», pDate=?
|
|
303
|
+
*/
|
|
304
|
+
export function formatEdgeParams(edge) {
|
|
305
|
+
if (edge.effectiveParams) {
|
|
306
|
+
if (edge.effectiveParams.length === 0) {
|
|
307
|
+
return "";
|
|
308
|
+
}
|
|
309
|
+
return edge.effectiveParams
|
|
310
|
+
.map((ep) => `${ep.name}=${formatEffective(ep.effective, ep.valueRaw)}`)
|
|
311
|
+
.join(", ");
|
|
312
|
+
}
|
|
313
|
+
// Upstream (no env): show resolution directly
|
|
314
|
+
if (edge.params.length === 0) {
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
return edge.params
|
|
318
|
+
.map((p) => {
|
|
319
|
+
switch (p.resolution.kind) {
|
|
320
|
+
case "literal": {
|
|
321
|
+
const wasQuoted = p.valueRaw.trim().startsWith("'");
|
|
322
|
+
return wasQuoted
|
|
323
|
+
? `${p.name}='${p.resolution.value}'`
|
|
324
|
+
: `${p.name}=${p.resolution.value}`;
|
|
325
|
+
}
|
|
326
|
+
case "passthrough":
|
|
327
|
+
return `${p.name}=«${p.resolution.paramName}»`;
|
|
328
|
+
case "dynamic":
|
|
329
|
+
return `${p.name}=?`;
|
|
330
|
+
}
|
|
331
|
+
})
|
|
332
|
+
.join(", ");
|
|
333
|
+
}
|
|
334
|
+
//# sourceMappingURL=callGraph.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReferenceIndex, ChoreTaskRef } from "./referenceIndex.js";
|
|
2
|
+
import type { CallGraphNode } from "./callGraph.js";
|
|
3
|
+
export interface ChoreTaskTree {
|
|
4
|
+
step: number;
|
|
5
|
+
processName: string;
|
|
6
|
+
choreParams: ChoreTaskRef["params"];
|
|
7
|
+
tree: CallGraphNode;
|
|
8
|
+
}
|
|
9
|
+
export interface ChoreGraph {
|
|
10
|
+
choreName: string;
|
|
11
|
+
tasks: ChoreTaskTree[];
|
|
12
|
+
}
|
|
13
|
+
export interface BuildChoreGraphOptions {
|
|
14
|
+
/** Mirrors the call-graph option — filters }-prefixed sub-processes. Default: true. */
|
|
15
|
+
includeSystem?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Build one downstream tree per chore task. Task params are seeded into the
|
|
19
|
+
* task-process's root env as literals and re-propagated down the tree.
|
|
20
|
+
* Returns null if the chore is not indexed.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildChoreGraph(index: ReferenceIndex, choreName: string, opts?: BuildChoreGraphOptions): ChoreGraph | null;
|
|
23
|
+
//# sourceMappingURL=choreGraph.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { buildCallGraph } from "./callGraph.js";
|
|
2
|
+
/**
|
|
3
|
+
* Build one downstream tree per chore task. Task params are seeded into the
|
|
4
|
+
* task-process's root env as literals and re-propagated down the tree.
|
|
5
|
+
* Returns null if the chore is not indexed.
|
|
6
|
+
*/
|
|
7
|
+
export function buildChoreGraph(index, choreName, opts = {}) {
|
|
8
|
+
const tasks = index.choreTasks.get(choreName.toLowerCase());
|
|
9
|
+
if (!tasks) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const includeSystem = opts.includeSystem ?? true;
|
|
13
|
+
const taskTrees = tasks.map((t) => {
|
|
14
|
+
const tree = buildCallGraph(index, t.processName, {
|
|
15
|
+
direction: "downstream",
|
|
16
|
+
includeSystem,
|
|
17
|
+
});
|
|
18
|
+
if (tree.env) {
|
|
19
|
+
for (const p of t.params) {
|
|
20
|
+
tree.env.set(p.name.toLowerCase(), { kind: "literal", value: p.value });
|
|
21
|
+
}
|
|
22
|
+
propagateNewRootEnv(tree, index);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
step: t.step,
|
|
26
|
+
processName: t.processName,
|
|
27
|
+
choreParams: t.params,
|
|
28
|
+
tree,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return { choreName, tasks: taskTrees };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Re-derive `effectiveParams` on each edge below the root after the chore has
|
|
35
|
+
* overwritten the root's env. We can't reuse `buildCallGraph` because we must
|
|
36
|
+
* keep the same tree instance; instead we re-resolve per child.
|
|
37
|
+
*/
|
|
38
|
+
function propagateNewRootEnv(root, index) {
|
|
39
|
+
const walk = (node, env) => {
|
|
40
|
+
for (const child of node.children) {
|
|
41
|
+
const edge = child.incomingEdge;
|
|
42
|
+
if (!edge) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const childEnv = buildInitialEnv(child.process, index);
|
|
46
|
+
const effective = [];
|
|
47
|
+
for (const cp of edge.params) {
|
|
48
|
+
const eff = resolveEdgeParam(cp.resolution, env);
|
|
49
|
+
childEnv.set(cp.name.toLowerCase(), eff);
|
|
50
|
+
effective.push({
|
|
51
|
+
name: cp.name,
|
|
52
|
+
effective: eff,
|
|
53
|
+
valueRaw: cp.valueRaw,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
edge.effectiveParams = effective;
|
|
57
|
+
child.env = childEnv;
|
|
58
|
+
if (!child.cycle) {
|
|
59
|
+
walk(child, childEnv);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
if (root.env) {
|
|
64
|
+
walk(root, root.env);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Local copies of two helpers from callGraph.ts — keeps the module free of
|
|
68
|
+
// new exports and preserves the existing public surface. Small and stable.
|
|
69
|
+
function buildInitialEnv(procName, index) {
|
|
70
|
+
const env = new Map();
|
|
71
|
+
const params = index.processParams.get(procName.toLowerCase()) ?? [];
|
|
72
|
+
const defaults = index.processDefaults.get(procName.toLowerCase());
|
|
73
|
+
for (const p of params) {
|
|
74
|
+
const def = defaults?.get(p);
|
|
75
|
+
env.set(p.toLowerCase(), def !== undefined
|
|
76
|
+
? { kind: "literal", value: def }
|
|
77
|
+
: { kind: "unknown", viaParam: p });
|
|
78
|
+
}
|
|
79
|
+
return env;
|
|
80
|
+
}
|
|
81
|
+
function resolveEdgeParam(res, parentEnv) {
|
|
82
|
+
switch (res.kind) {
|
|
83
|
+
case "literal":
|
|
84
|
+
return { kind: "literal", value: res.value };
|
|
85
|
+
case "dynamic":
|
|
86
|
+
return { kind: "dynamic" };
|
|
87
|
+
case "passthrough": {
|
|
88
|
+
const up = parentEnv.get(res.paramName.toLowerCase());
|
|
89
|
+
if (!up) {
|
|
90
|
+
return { kind: "unknown", viaParam: res.paramName };
|
|
91
|
+
}
|
|
92
|
+
if (up.kind === "literal") {
|
|
93
|
+
return up;
|
|
94
|
+
}
|
|
95
|
+
if (up.kind === "unknown") {
|
|
96
|
+
return { kind: "unknown", viaParam: up.viaParam };
|
|
97
|
+
}
|
|
98
|
+
return { kind: "dynamic" };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=choreGraph.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ReferenceIndex } from "./referenceIndex.js";
|
|
2
|
+
import type { DatasourceMembership, MembershipVia } from "./datasourceMembership.js";
|
|
3
|
+
/** How a process touches a traced element (from in-code subset usage + datasource join). */
|
|
4
|
+
export type AccessKind = "source" | "write" | "zero-out" | "indeterminate";
|
|
5
|
+
export interface DataSourceEntry {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
sourceName?: string | undefined;
|
|
9
|
+
view?: string | undefined;
|
|
10
|
+
subset?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export type Direction = "upstream" | "downstream" | "both";
|
|
13
|
+
export interface UpstreamWriter {
|
|
14
|
+
process: string;
|
|
15
|
+
/** Cubes this writer reads from (code reads + a TM1CubeView datasource cube). */
|
|
16
|
+
sourceCubes: string[];
|
|
17
|
+
/** This writer's datasource type (where it pulls rows from). */
|
|
18
|
+
datasourceType: string;
|
|
19
|
+
/** For non-cube datasources (ASCII/ODBC/TM1Process/subset): a short source label. */
|
|
20
|
+
externalSource?: string;
|
|
21
|
+
/** In-code subset-membership elements this process manipulates (SubsetElementInsert/Add/Delete). */
|
|
22
|
+
elements?: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface DownstreamReader {
|
|
25
|
+
process: string;
|
|
26
|
+
/** Cubes this reader writes into. */
|
|
27
|
+
targetCubes: string[];
|
|
28
|
+
/** How the reader accesses the cube: code CellGet, a view datasource, or both. */
|
|
29
|
+
readsVia: "code" | "datasource" | "both";
|
|
30
|
+
/** In-code subset-membership elements this process manipulates (SubsetElementInsert/Add/Delete). */
|
|
31
|
+
elements?: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface DataFlowResult {
|
|
34
|
+
cube: string;
|
|
35
|
+
direction: Direction;
|
|
36
|
+
upstream?: UpstreamWriter[];
|
|
37
|
+
downstream?: DownstreamReader[];
|
|
38
|
+
/** Present only when an element filter was supplied — processes that touch element (dimension, name). */
|
|
39
|
+
element?: {
|
|
40
|
+
dimension: string;
|
|
41
|
+
name: string;
|
|
42
|
+
processes: Array<{
|
|
43
|
+
process: string;
|
|
44
|
+
funcNames: string[];
|
|
45
|
+
access: AccessKind[];
|
|
46
|
+
via?: MembershipVia[];
|
|
47
|
+
}>;
|
|
48
|
+
/** Processes where this dimension has an UNRESOLVED element arg (element identity not statically known). */
|
|
49
|
+
unresolvedInProcesses?: string[];
|
|
50
|
+
/** Count of touching processes hidden because their only access classification was 'indeterminate' (opts.elementAccess default excludes it). */
|
|
51
|
+
suppressedIndeterminate?: number;
|
|
52
|
+
/** Processes whose datasource scopes elements via a computed selector (element identity not literally verifiable). */
|
|
53
|
+
computedInProcesses?: string[];
|
|
54
|
+
/** Honesty marker: what element resolution this result covers. */
|
|
55
|
+
resolution: string;
|
|
56
|
+
};
|
|
57
|
+
counts: {
|
|
58
|
+
upstream?: number;
|
|
59
|
+
downstream?: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Trace data flow into/out of a cube. Case-insensitive cube matching; output
|
|
64
|
+
* preserves original casing. Lists are sorted by process name.
|
|
65
|
+
*/
|
|
66
|
+
export declare function traceDataFlow(index: ReferenceIndex, dsList: DataSourceEntry[], cubeName: string, direction: Direction, opts?: {
|
|
67
|
+
element?: {
|
|
68
|
+
dimension: string;
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
elementAccess?: AccessKind[];
|
|
72
|
+
datasourceMembership?: DatasourceMembership;
|
|
73
|
+
}): DataFlowResult;
|
|
74
|
+
//# sourceMappingURL=dataFlow.d.ts.map
|