@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,271 @@
|
|
|
1
|
+
// Pure data-flow tracer for tm1_trace_data_flow. No I/O.
|
|
2
|
+
//
|
|
3
|
+
// Combines the reference index (code-level CellGet/CellPut/DB cube access,
|
|
4
|
+
// already classified read/write) with a per-process datasource list (to catch
|
|
5
|
+
// reads that flow through a TM1CubeView datasource and leave no CellGet in the
|
|
6
|
+
// code). Answers, for one cube:
|
|
7
|
+
// downstream — processes that READ it, and which cubes they WRITE to.
|
|
8
|
+
// upstream — processes that WRITE it, and where they SOURCE their data.
|
|
9
|
+
import { elementKey } from "./referenceIndex.js";
|
|
10
|
+
import { classifyAccess } from "./callGraph.js";
|
|
11
|
+
const lc = (s) => s.toLowerCase();
|
|
12
|
+
/** Build per-process cube read/write sets from the index + datasource list. */
|
|
13
|
+
function buildProcessIO(index, dsList, cubeOrig) {
|
|
14
|
+
const io = new Map();
|
|
15
|
+
const get = (name) => {
|
|
16
|
+
const key = lc(name);
|
|
17
|
+
let e = io.get(key);
|
|
18
|
+
if (!e) {
|
|
19
|
+
e = {
|
|
20
|
+
orig: name,
|
|
21
|
+
reads: new Set(),
|
|
22
|
+
writes: new Set(),
|
|
23
|
+
readsViaCode: false,
|
|
24
|
+
readsViaDatasource: false,
|
|
25
|
+
dsType: "None",
|
|
26
|
+
};
|
|
27
|
+
io.set(key, e);
|
|
28
|
+
}
|
|
29
|
+
return e;
|
|
30
|
+
};
|
|
31
|
+
// Datasource pass: every process, even ones with no cube code-refs.
|
|
32
|
+
for (const ds of dsList) {
|
|
33
|
+
const e = get(ds.name);
|
|
34
|
+
e.dsType = ds.type;
|
|
35
|
+
if (ds.type === "TM1CubeView" && ds.sourceName) {
|
|
36
|
+
const cubeLc = lc(ds.sourceName);
|
|
37
|
+
e.reads.add(cubeLc);
|
|
38
|
+
e.readsViaDatasource = true;
|
|
39
|
+
e.dsSourceCube = cubeLc;
|
|
40
|
+
if (!cubeOrig.has(cubeLc))
|
|
41
|
+
cubeOrig.set(cubeLc, ds.sourceName);
|
|
42
|
+
}
|
|
43
|
+
else if (ds.type === "ASCII") {
|
|
44
|
+
e.externalSource = "ASCII file";
|
|
45
|
+
}
|
|
46
|
+
else if (ds.type === "ODBC") {
|
|
47
|
+
e.externalSource = "ODBC";
|
|
48
|
+
}
|
|
49
|
+
else if (ds.type === "TM1Process" && ds.sourceName) {
|
|
50
|
+
e.externalSource = `process:${ds.sourceName}`;
|
|
51
|
+
}
|
|
52
|
+
else if (ds.type === "TM1DimensionSubset" && ds.sourceName) {
|
|
53
|
+
e.externalSource = `subset:${ds.sourceName}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Code pass: classified cube reads/writes from the reference index.
|
|
57
|
+
for (const r of index.all) {
|
|
58
|
+
if (r.sourceKind !== "process" || r.targetKind !== "cube")
|
|
59
|
+
continue;
|
|
60
|
+
const access = classifyAccess(r.funcName, "process");
|
|
61
|
+
if (access === "other")
|
|
62
|
+
continue;
|
|
63
|
+
const e = get(r.sourceName);
|
|
64
|
+
const cubeLc = lc(r.targetName);
|
|
65
|
+
if (!cubeOrig.has(cubeLc))
|
|
66
|
+
cubeOrig.set(cubeLc, r.targetName);
|
|
67
|
+
if (access === "read") {
|
|
68
|
+
e.reads.add(cubeLc);
|
|
69
|
+
e.readsViaCode = true;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
e.writes.add(cubeLc);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return io;
|
|
76
|
+
}
|
|
77
|
+
/** In-code subset-membership element names a process manipulates, sorted & de-duped. */
|
|
78
|
+
function elementsForProcess(index, processOrig) {
|
|
79
|
+
const refs = index.bySourceProcess.get(processOrig.toLowerCase()) ?? [];
|
|
80
|
+
const names = new Set();
|
|
81
|
+
for (const r of refs) {
|
|
82
|
+
if (r.targetKind === "element")
|
|
83
|
+
names.add(r.targetName);
|
|
84
|
+
}
|
|
85
|
+
return [...names].sort((a, b) => a.localeCompare(b));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Classify how a process accesses a traced element, joining in-code subset usage
|
|
89
|
+
* (view-assign / zero-out / loop, from subsetUsageByProcess) with the process's own
|
|
90
|
+
* datasource (dsList). `subsetsForElement` are the lowercased subset handles the
|
|
91
|
+
* element was inserted into, within this one process. 'indeterminate' means the
|
|
92
|
+
* subset was built but no downstream use could be classified — NOT proof of no use
|
|
93
|
+
* (stored view/subset MDX outside this process is Bucket B, not resolved here).
|
|
94
|
+
*/
|
|
95
|
+
function classifyElementAccess(usageForProcess, subsetsForElement, ds, tracedDimension) {
|
|
96
|
+
const kinds = new Set();
|
|
97
|
+
for (const subLc of subsetsForElement) {
|
|
98
|
+
const u = usageForProcess?.get(subLc);
|
|
99
|
+
if (ds?.type === "TM1DimensionSubset" &&
|
|
100
|
+
ds.subset?.toLowerCase() === subLc &&
|
|
101
|
+
ds.sourceName?.toLowerCase() === tracedDimension.toLowerCase())
|
|
102
|
+
kinds.add("source");
|
|
103
|
+
if (u) {
|
|
104
|
+
for (const v of u.views) {
|
|
105
|
+
if (v.zeroOut)
|
|
106
|
+
kinds.add("zero-out");
|
|
107
|
+
if (ds?.type === "TM1CubeView" &&
|
|
108
|
+
v.view &&
|
|
109
|
+
v.cube &&
|
|
110
|
+
ds.view?.toLowerCase() === v.view.toLowerCase() &&
|
|
111
|
+
ds.sourceName?.toLowerCase() === v.cube.toLowerCase())
|
|
112
|
+
kinds.add("source");
|
|
113
|
+
}
|
|
114
|
+
if (u.loopRead)
|
|
115
|
+
kinds.add("source");
|
|
116
|
+
if (u.loopZero)
|
|
117
|
+
kinds.add("zero-out");
|
|
118
|
+
else if (u.loopWrite)
|
|
119
|
+
kinds.add("write");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (kinds.size === 0)
|
|
123
|
+
kinds.add("indeterminate");
|
|
124
|
+
return [...kinds].sort((a, b) => a.localeCompare(b));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Trace data flow into/out of a cube. Case-insensitive cube matching; output
|
|
128
|
+
* preserves original casing. Lists are sorted by process name.
|
|
129
|
+
*/
|
|
130
|
+
export function traceDataFlow(index, dsList, cubeName, direction, opts) {
|
|
131
|
+
const cubeOrig = new Map();
|
|
132
|
+
const io = buildProcessIO(index, dsList, cubeOrig);
|
|
133
|
+
const targetLc = lc(cubeName);
|
|
134
|
+
const canonical = cubeOrig.get(targetLc) ?? cubeName;
|
|
135
|
+
const cubeLabel = (l) => cubeOrig.get(l) ?? l;
|
|
136
|
+
const result = { cube: canonical, direction, counts: {} };
|
|
137
|
+
if (direction === "downstream" || direction === "both") {
|
|
138
|
+
const readers = [];
|
|
139
|
+
for (const e of io.values()) {
|
|
140
|
+
if (!e.reads.has(targetLc))
|
|
141
|
+
continue;
|
|
142
|
+
const targetCubes = [...e.writes]
|
|
143
|
+
.filter((c) => c !== targetLc)
|
|
144
|
+
.map(cubeLabel)
|
|
145
|
+
.sort((a, b) => a.localeCompare(b));
|
|
146
|
+
const readsVia = e.readsViaCode && e.readsViaDatasource
|
|
147
|
+
? "both"
|
|
148
|
+
: e.readsViaCode
|
|
149
|
+
? "code"
|
|
150
|
+
: "datasource";
|
|
151
|
+
const elements = elementsForProcess(index, e.orig);
|
|
152
|
+
readers.push({
|
|
153
|
+
process: e.orig,
|
|
154
|
+
targetCubes,
|
|
155
|
+
readsVia,
|
|
156
|
+
...(elements.length ? { elements } : {}),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
readers.sort((a, b) => a.process.localeCompare(b.process));
|
|
160
|
+
result.downstream = readers;
|
|
161
|
+
result.counts.downstream = readers.length;
|
|
162
|
+
}
|
|
163
|
+
if (direction === "upstream" || direction === "both") {
|
|
164
|
+
const writers = [];
|
|
165
|
+
for (const e of io.values()) {
|
|
166
|
+
if (!e.writes.has(targetLc))
|
|
167
|
+
continue;
|
|
168
|
+
const sourceCubes = [...e.reads]
|
|
169
|
+
.filter((c) => c !== targetLc)
|
|
170
|
+
.map(cubeLabel)
|
|
171
|
+
.sort((a, b) => a.localeCompare(b));
|
|
172
|
+
const elements = elementsForProcess(index, e.orig);
|
|
173
|
+
writers.push({
|
|
174
|
+
process: e.orig,
|
|
175
|
+
sourceCubes,
|
|
176
|
+
datasourceType: e.dsType,
|
|
177
|
+
...(e.externalSource ? { externalSource: e.externalSource } : {}),
|
|
178
|
+
...(elements.length ? { elements } : {}),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
writers.sort((a, b) => a.process.localeCompare(b.process));
|
|
182
|
+
result.upstream = writers;
|
|
183
|
+
result.counts.upstream = writers.length;
|
|
184
|
+
}
|
|
185
|
+
if (opts?.element) {
|
|
186
|
+
const { dimension, name } = opts.element;
|
|
187
|
+
const key = elementKey(dimension, name);
|
|
188
|
+
const wanted = new Set(opts.elementAccess ?? ["source", "write", "zero-out"]);
|
|
189
|
+
// in-code (Phase 1/1.5): funcNames + subsets per process
|
|
190
|
+
const perProc = new Map();
|
|
191
|
+
for (const r of index.byElement.get(key) ?? []) {
|
|
192
|
+
const e = perProc.get(r.sourceName) ?? {
|
|
193
|
+
funcNames: new Set(),
|
|
194
|
+
subsets: new Set(),
|
|
195
|
+
};
|
|
196
|
+
if (r.funcName)
|
|
197
|
+
e.funcNames.add(r.funcName);
|
|
198
|
+
if (r.subset)
|
|
199
|
+
e.subsets.add(r.subset.toLowerCase());
|
|
200
|
+
perProc.set(r.sourceName, e);
|
|
201
|
+
}
|
|
202
|
+
// Bucket B: stored view/subset datasource membership → via tags per process (a datasource IS a read).
|
|
203
|
+
const dsVia = new Map();
|
|
204
|
+
for (const hit of opts.datasourceMembership?.byElement.get(key) ?? []) {
|
|
205
|
+
const set = dsVia.get(hit.process) ?? new Set();
|
|
206
|
+
set.add(hit.via);
|
|
207
|
+
dsVia.set(hit.process, set);
|
|
208
|
+
}
|
|
209
|
+
const dsByProc = new Map();
|
|
210
|
+
for (const d of dsList)
|
|
211
|
+
dsByProc.set(d.name.toLowerCase(), d);
|
|
212
|
+
const allProcs = new Set([...perProc.keys(), ...dsVia.keys()]);
|
|
213
|
+
let suppressedIndeterminate = 0;
|
|
214
|
+
const processes = [];
|
|
215
|
+
for (const process of allProcs) {
|
|
216
|
+
const e = perProc.get(process);
|
|
217
|
+
const usage = index.subsetUsageByProcess.get(process.toLowerCase());
|
|
218
|
+
const accessSet = new Set(e
|
|
219
|
+
? classifyElementAccess(usage, [...e.subsets], dsByProc.get(process.toLowerCase()), dimension)
|
|
220
|
+
: []);
|
|
221
|
+
const via = [...(dsVia.get(process) ?? [])].sort((a, b) => a.localeCompare(b));
|
|
222
|
+
if (via.length)
|
|
223
|
+
accessSet.add("source"); // stored view/subset datasource = read
|
|
224
|
+
if (accessSet.size === 0)
|
|
225
|
+
accessSet.add("indeterminate");
|
|
226
|
+
const access = [...accessSet].sort((a, b) => a.localeCompare(b));
|
|
227
|
+
if (!access.some((a) => wanted.has(a))) {
|
|
228
|
+
if (access.length === 1 && access[0] === "indeterminate")
|
|
229
|
+
suppressedIndeterminate++;
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const funcNames = [...(e?.funcNames ?? [])].sort((a, b) => a.localeCompare(b));
|
|
233
|
+
processes.push(via.length
|
|
234
|
+
? { process, funcNames, access, via }
|
|
235
|
+
: { process, funcNames, access });
|
|
236
|
+
}
|
|
237
|
+
processes.sort((a, b) => a.process.localeCompare(b.process));
|
|
238
|
+
const unresolvedInProcesses = [
|
|
239
|
+
...index.unresolvedElementRefsBySourceProcess.entries(),
|
|
240
|
+
]
|
|
241
|
+
.filter(([, list]) => list.some((u) => (u.dimension ?? "").toLowerCase() === dimension.toLowerCase()))
|
|
242
|
+
.map(([proc]) => proc)
|
|
243
|
+
.sort((a, b) => a.localeCompare(b));
|
|
244
|
+
// Scope to the traced dimension: a process is only noise-flagged if it has a computed
|
|
245
|
+
// selector on THIS dimension, or an unscoped ("*") one (whole-MDX-VIEW datasource, not
|
|
246
|
+
// tied to a single axis). Excludes processes whose computed selectors are on other axes
|
|
247
|
+
// (e.g. a computed [Time] selector must not surface while tracing a [Region] element).
|
|
248
|
+
const dimLc = dimension.toLowerCase();
|
|
249
|
+
const computedInProcesses = [
|
|
250
|
+
...(opts.datasourceMembership?.computedByProcess.entries() ?? []),
|
|
251
|
+
]
|
|
252
|
+
.filter(([, byDim]) => byDim.has(dimLc) || byDim.has("*"))
|
|
253
|
+
.map(([proc]) => proc)
|
|
254
|
+
.sort((a, b) => a.localeCompare(b));
|
|
255
|
+
const fetchErrorCount = opts.datasourceMembership?.fetchErrors.length ?? 0;
|
|
256
|
+
result.element = {
|
|
257
|
+
dimension,
|
|
258
|
+
name,
|
|
259
|
+
processes,
|
|
260
|
+
...(unresolvedInProcesses.length ? { unresolvedInProcesses } : {}),
|
|
261
|
+
...(suppressedIndeterminate ? { suppressedIndeterminate } : {}),
|
|
262
|
+
...(computedInProcesses.length ? { computedInProcesses } : {}),
|
|
263
|
+
resolution: "access from in-code subset usage (view-assign/zero-out/loop) + datasource; stored view/subset datasources resolved (native-title/static exact, MDX by literal member); computed selectors (TM1FILTERBY*/DESCENDANTS/…) flagged in computedInProcesses, not resolved; 'indeterminate' = built but not classifiable, not evidence the element goes untouched." +
|
|
264
|
+
(fetchErrorCount
|
|
265
|
+
? ` (${fetchErrorCount} datasource object(s) could not be fetched — results may be incomplete)`
|
|
266
|
+
: ""),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
return result;
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=dataFlow.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ViewDefinition, type Subset } from "../../types.js";
|
|
2
|
+
import type { DataSourceEntry } from "./dataFlow.js";
|
|
3
|
+
export type MembershipVia = "view-mdx" | "view-native-title" | "view-native-expr" | "view-native-computed" | "subset-static" | "subset-mdx";
|
|
4
|
+
export interface DatasourceMembership {
|
|
5
|
+
/** elementKey(dim, element) → processes that reach it through a datasource object. */
|
|
6
|
+
byElement: Map<string, Array<{
|
|
7
|
+
process: string;
|
|
8
|
+
via: MembershipVia;
|
|
9
|
+
}>>;
|
|
10
|
+
/**
|
|
11
|
+
* process → dimension (lowercased) → computed MDX selectors encountered
|
|
12
|
+
* (Bucket C boundary; element identity not literal). The dimension key is
|
|
13
|
+
* "*" when a selector cannot be tied to one axis/subset dimension (a
|
|
14
|
+
* whole-MDX-VIEW datasource) — callers should treat "*" as unscoped/matches-any.
|
|
15
|
+
*/
|
|
16
|
+
computedByProcess: Map<string, Map<string, Set<string>>>;
|
|
17
|
+
/** per-object fetch failures (non-systemic); systemic errors are re-thrown. */
|
|
18
|
+
fetchErrors: Array<{
|
|
19
|
+
process: string;
|
|
20
|
+
object: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface MembershipDeps {
|
|
25
|
+
getViewDefinition(cube: string, view: string): Promise<ViewDefinition>;
|
|
26
|
+
getSubset(dimension: string, hierarchy: string, subset: string): Promise<Subset>;
|
|
27
|
+
/** C1 (opt-in): resolve a computed axis set to its concrete member names, already scoped to `dimension`. */
|
|
28
|
+
evaluateSetExpression?(cube: string, dimension: string, mdxSet: string): Promise<string[]>;
|
|
29
|
+
}
|
|
30
|
+
export declare function buildDatasourceMembership(deps: MembershipDeps, dsList: DataSourceEntry[]): Promise<DatasourceMembership>;
|
|
31
|
+
//# sourceMappingURL=datasourceMembership.d.ts.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { TM1Error } from "../../types.js";
|
|
2
|
+
import { elementKey } from "./referenceIndex.js";
|
|
3
|
+
import { extractMdxMemberRefs } from "./mdxMembers.js";
|
|
4
|
+
import { rethrowIfSystemic } from "../../tm1-client/services/fallback.js";
|
|
5
|
+
export async function buildDatasourceMembership(deps, dsList) {
|
|
6
|
+
const byElement = new Map();
|
|
7
|
+
const computedByProcess = new Map();
|
|
8
|
+
const fetchErrors = [];
|
|
9
|
+
// C1: per-run cache keyed by (cube, lowercased expression) — avoids re-evaluating a shared axis
|
|
10
|
+
// (cosmetically-different-cased identical sets share the cache; members still added with real casing).
|
|
11
|
+
const evalCache = new Map();
|
|
12
|
+
const addMember = (process, dim, el, via) => {
|
|
13
|
+
const k = elementKey(dim, el);
|
|
14
|
+
const arr = byElement.get(k) ?? [];
|
|
15
|
+
if (!arr.some((e) => e.process === process && e.via === via))
|
|
16
|
+
arr.push({ process, via });
|
|
17
|
+
byElement.set(k, arr);
|
|
18
|
+
};
|
|
19
|
+
/** dim: owning dimension of the computed selector, or "*" when it cannot be tied to one axis (whole-MDX-VIEW). */
|
|
20
|
+
const addComputed = (process, dim, names) => {
|
|
21
|
+
if (names.length === 0)
|
|
22
|
+
return;
|
|
23
|
+
const dimLc = dim.toLowerCase();
|
|
24
|
+
const byDim = computedByProcess.get(process) ?? new Map();
|
|
25
|
+
const set = byDim.get(dimLc) ?? new Set();
|
|
26
|
+
for (const n of names)
|
|
27
|
+
set.add(n);
|
|
28
|
+
byDim.set(dimLc, set);
|
|
29
|
+
computedByProcess.set(process, byDim);
|
|
30
|
+
};
|
|
31
|
+
const addMdx = (process, mdx, via, dim) => {
|
|
32
|
+
const { members, computedSelectors } = extractMdxMemberRefs(mdx);
|
|
33
|
+
for (const ref of members)
|
|
34
|
+
addMember(process, ref.dimension, ref.element, via);
|
|
35
|
+
addComputed(process, dim, computedSelectors);
|
|
36
|
+
};
|
|
37
|
+
const applySubset = (process, sub) => {
|
|
38
|
+
if (sub.elements.length > 0) {
|
|
39
|
+
for (const el of sub.elements)
|
|
40
|
+
addMember(process, sub.dimensionName, el, "subset-static");
|
|
41
|
+
}
|
|
42
|
+
else if (sub.expression) {
|
|
43
|
+
addMdx(process, sub.expression, "subset-mdx", sub.dimensionName);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
for (const ds of dsList) {
|
|
47
|
+
try {
|
|
48
|
+
if (ds.type === "TM1CubeView" && ds.sourceName && ds.view) {
|
|
49
|
+
const def = await deps.getViewDefinition(ds.sourceName, ds.view);
|
|
50
|
+
if (def.type === "MDX" && def.mdx) {
|
|
51
|
+
// Whole-MDX-VIEW datasource: not tied to a single axis/dimension — unscoped sentinel.
|
|
52
|
+
addMdx(ds.name, def.mdx, "view-mdx", "*");
|
|
53
|
+
}
|
|
54
|
+
else if (def.type === "Native" && def.native) {
|
|
55
|
+
// Titles are pinned to exactly ONE member (selectedElement). TM1's
|
|
56
|
+
// getDefinition also populates a title's subsetName (the subset the
|
|
57
|
+
// pin was chosen from), but enumerating that subset would falsely
|
|
58
|
+
// report every non-selected element as read. So titles contribute
|
|
59
|
+
// ONLY the selected member — never expression/subsetName enumeration.
|
|
60
|
+
for (const title of def.native.titles) {
|
|
61
|
+
if (title.selectedElement && title.dimensionName) {
|
|
62
|
+
addMember(ds.name, title.dimensionName, title.selectedElement, "view-native-title");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Columns/rows iterate their full axis — every member is read.
|
|
66
|
+
const axes = [...def.native.columns, ...def.native.rows];
|
|
67
|
+
for (const ax of axes) {
|
|
68
|
+
if (ax.expression) {
|
|
69
|
+
const { members, computedSelectors } = extractMdxMemberRefs(ax.expression);
|
|
70
|
+
for (const ref of members)
|
|
71
|
+
addMember(ds.name, ref.dimension, ref.element, "view-native-expr");
|
|
72
|
+
addComputed(ds.name, ax.dimensionName ?? "*", computedSelectors);
|
|
73
|
+
// C1: if this axis is computed and a resolver is provided, resolve it exactly.
|
|
74
|
+
if (computedSelectors.length > 0 &&
|
|
75
|
+
deps.evaluateSetExpression &&
|
|
76
|
+
ax.dimensionName) {
|
|
77
|
+
const cacheKey = `${ds.sourceName.toLowerCase()} ${ax.expression.toLowerCase()}`;
|
|
78
|
+
let names = evalCache.get(cacheKey);
|
|
79
|
+
if (names === undefined) {
|
|
80
|
+
try {
|
|
81
|
+
names = await deps.evaluateSetExpression(ds.sourceName, ax.dimensionName, ax.expression);
|
|
82
|
+
evalCache.set(cacheKey, names);
|
|
83
|
+
}
|
|
84
|
+
catch (evalErr) {
|
|
85
|
+
if (evalErr instanceof TM1Error)
|
|
86
|
+
rethrowIfSystemic(evalErr);
|
|
87
|
+
fetchErrors.push({
|
|
88
|
+
process: ds.name,
|
|
89
|
+
object: `eval ${ds.sourceName}/${ax.dimensionName}`,
|
|
90
|
+
message: evalErr instanceof Error
|
|
91
|
+
? evalErr.message
|
|
92
|
+
: String(evalErr),
|
|
93
|
+
});
|
|
94
|
+
names = undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (names) {
|
|
98
|
+
for (const name of names)
|
|
99
|
+
addMember(ds.name, ax.dimensionName, name, "view-native-computed");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (ax.subsetName && ax.dimensionName) {
|
|
104
|
+
const sub = await deps.getSubset(ax.dimensionName, ax.hierarchyName ?? ax.dimensionName, ax.subsetName);
|
|
105
|
+
applySubset(ds.name, sub);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (ds.type === "TM1DimensionSubset" &&
|
|
111
|
+
ds.subset &&
|
|
112
|
+
ds.sourceName) {
|
|
113
|
+
const dim = ds.sourceName; // dataSourceNameForServer — the dimension (verify live, Task 4)
|
|
114
|
+
const sub = await deps.getSubset(dim, dim, ds.subset);
|
|
115
|
+
applySubset(ds.name, sub);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
// rethrowIfSystemic classifies AUTH_FAILED/CONNECTION_FAILED/LOCK_TIMEOUT
|
|
120
|
+
// TM1Errors as systemic (must propagate) and returns for expected
|
|
121
|
+
// handleable TM1Errors (e.g. NOT_FOUND). It also rethrows any
|
|
122
|
+
// non-TM1Error by design (fallback.ts: "programming errors, unexpected
|
|
123
|
+
// throws" must never be swallowed by generic REST-fallback call sites).
|
|
124
|
+
// Here the per-object fetch loop's contract is broader: ANY per-object
|
|
125
|
+
// failure (TM1Error or not) is recorded, not thrown — only genuinely
|
|
126
|
+
// systemic TM1Errors propagate. So only route TM1Error through the
|
|
127
|
+
// shared systemic guard; non-TM1Error falls straight to fetchErrors.
|
|
128
|
+
if (e instanceof TM1Error)
|
|
129
|
+
rethrowIfSystemic(e);
|
|
130
|
+
const object = ds.type === "TM1CubeView"
|
|
131
|
+
? `view ${ds.sourceName}/${ds.view}`
|
|
132
|
+
: `subset ${ds.sourceName}/${ds.subset}`;
|
|
133
|
+
fetchErrors.push({
|
|
134
|
+
process: ds.name,
|
|
135
|
+
object,
|
|
136
|
+
message: e instanceof Error ? e.message : String(e),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return { byElement, computedByProcess, fetchErrors };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=datasourceMembership.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Severity of a lint diagnostic */
|
|
2
|
+
export type LintSeverity = "error" | "warning" | "hint";
|
|
3
|
+
/** TM1 process section */
|
|
4
|
+
export type TiSection = "prolog" | "metadata" | "data" | "epilog";
|
|
5
|
+
/** All known rule IDs of the TI linter */
|
|
6
|
+
export type LintRuleId = "endless-loop" | "wrong-arg-count" | "string-compare-without-at" | "numeric-compare-with-at" | "type-mismatch-assignment" | "wrong-param-type" | "unused-variable" | "dead-store" | "empty-if" | "empty-while" | "cellput-no-error-handling" | "unknown-function" | "missing-semicolon" | "wrong-section" | "undefined-variable" | "v12-deprecated" | "ti-unknown-cube" | "ti-unknown-dimension" | "dead-code-condition" | "tm1-error-code" | "performance-hint";
|
|
7
|
+
/** A single lint diagnostic */
|
|
8
|
+
export interface LintDiagnose {
|
|
9
|
+
/** 1-based line number */
|
|
10
|
+
line: number;
|
|
11
|
+
/** Severity */
|
|
12
|
+
severity: LintSeverity;
|
|
13
|
+
/** Rule ID */
|
|
14
|
+
ruleId: LintRuleId;
|
|
15
|
+
/** Error message with rule-ID prefix: [rule-id] message */
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
/** Data type of a TI variable */
|
|
19
|
+
export type VariableType = "string" | "numeric";
|
|
20
|
+
/** Information about an inferred variable */
|
|
21
|
+
export interface VariableInfo {
|
|
22
|
+
type: VariableType;
|
|
23
|
+
/** Line of the first assignment */
|
|
24
|
+
firstAssignmentLine: number;
|
|
25
|
+
}
|
|
26
|
+
/** Key: variable name in lowercase */
|
|
27
|
+
export type VariableTypeMap = Map<string, VariableInfo>;
|
|
28
|
+
//# sourceMappingURL=lintTypes.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface MdxMemberRef {
|
|
2
|
+
dimension: string;
|
|
3
|
+
element: string;
|
|
4
|
+
}
|
|
5
|
+
export interface MdxExtractResult {
|
|
6
|
+
members: MdxMemberRef[];
|
|
7
|
+
computedSelectors: string[];
|
|
8
|
+
}
|
|
9
|
+
/** MDX set functions that compute membership without naming elements (Bucket C boundary). */
|
|
10
|
+
export declare const MDX_COMPUTED_FUNCS: ReadonlySet<string>;
|
|
11
|
+
export declare function extractMdxMemberRefs(mdx: string): MdxExtractResult;
|
|
12
|
+
/**
|
|
13
|
+
* Pure member-extraction step for a live executeMdx result: picks axis-0 tuple
|
|
14
|
+
* member names belonging to one dimension's hierarchy. Used by the C1
|
|
15
|
+
* (resolveComputed) path in tm1_trace_data_flow, which builds the
|
|
16
|
+
* `SELECT {expr} ON 0 FROM [cube]` MDX and calls executeMdx itself — this
|
|
17
|
+
* just filters/flattens the response so that glue stays inline at the call site.
|
|
18
|
+
*/
|
|
19
|
+
export declare function membersFromAxis(res: {
|
|
20
|
+
axes?: Array<{
|
|
21
|
+
tuples: Array<{
|
|
22
|
+
members: Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
hierarchyName?: string;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
}>;
|
|
28
|
+
}, dimension: string): string[];
|
|
29
|
+
//# sourceMappingURL=mdxMembers.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Pure MDX member extractor: pulls literally-named [Dim].[...].[El] member
|
|
2
|
+
// references out of an MDX string, and separately flags MDX set functions
|
|
3
|
+
// that scope elements WITHOUT naming them (e.g. all leaves under a
|
|
4
|
+
// dimension) so callers can report them as unresolved rather than imply
|
|
5
|
+
// "no elements".
|
|
6
|
+
/** MDX set functions that compute membership without naming elements (Bucket C boundary). */
|
|
7
|
+
export const MDX_COMPUTED_FUNCS = new Set([
|
|
8
|
+
"TM1FILTERBYLEVEL",
|
|
9
|
+
"TM1FILTERBYPATTERN",
|
|
10
|
+
"TM1SUBSETALL",
|
|
11
|
+
"TM1DRILLDOWNMEMBER",
|
|
12
|
+
"DESCENDANTS",
|
|
13
|
+
"ANCESTORS",
|
|
14
|
+
"ANCESTOR",
|
|
15
|
+
"CHILDREN",
|
|
16
|
+
"MEMBERS",
|
|
17
|
+
"HIERARCHIZE",
|
|
18
|
+
"FILTER",
|
|
19
|
+
"TOPCOUNT",
|
|
20
|
+
"BOTTOMCOUNT",
|
|
21
|
+
"ORDER",
|
|
22
|
+
"EXCEPT",
|
|
23
|
+
"GENERATE",
|
|
24
|
+
]);
|
|
25
|
+
// One bracketed segment: [ ... ] where ]] is an escaped ]. A chain of >=2
|
|
26
|
+
// segments separated by dots is a member path; a lone segment is a
|
|
27
|
+
// dimension/hierarchy ref.
|
|
28
|
+
const MEMBER_PATH_RE = /(\[(?:[^\]]|\]\])*\])(?:\s*\.\s*(\[(?:[^\]]|\]\])*\]))+/g;
|
|
29
|
+
const SEGMENT_RE = /\[((?:[^\]]|\]\])*)\]/g;
|
|
30
|
+
const FUNC_RE = /\b([A-Za-z_][A-Za-z0-9_]*)\s*\(/g;
|
|
31
|
+
function unbracket(seg) {
|
|
32
|
+
// strip outer [ ], unescape ]] -> ]
|
|
33
|
+
return seg.slice(1, -1).replace(/\]\]/g, "]");
|
|
34
|
+
}
|
|
35
|
+
export function extractMdxMemberRefs(mdx) {
|
|
36
|
+
const members = [];
|
|
37
|
+
const seen = new Set();
|
|
38
|
+
let m;
|
|
39
|
+
MEMBER_PATH_RE.lastIndex = 0;
|
|
40
|
+
while ((m = MEMBER_PATH_RE.exec(mdx)) !== null) {
|
|
41
|
+
const chain = m[0];
|
|
42
|
+
SEGMENT_RE.lastIndex = 0;
|
|
43
|
+
const segs = [];
|
|
44
|
+
let s;
|
|
45
|
+
while ((s = SEGMENT_RE.exec(chain)) !== null) {
|
|
46
|
+
segs.push(unbracket(s[0]));
|
|
47
|
+
}
|
|
48
|
+
if (segs.length < 2)
|
|
49
|
+
continue;
|
|
50
|
+
// segs.length >= 2 is guaranteed by the check above, so both indices exist.
|
|
51
|
+
const dimension = segs[0];
|
|
52
|
+
const element = segs[segs.length - 1];
|
|
53
|
+
const key = `${dimension.toLowerCase()} ${element.toLowerCase()}`;
|
|
54
|
+
if (!seen.has(key)) {
|
|
55
|
+
seen.add(key);
|
|
56
|
+
members.push({ dimension, element });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const computedSelectors = [];
|
|
60
|
+
const seenFuncs = new Set();
|
|
61
|
+
FUNC_RE.lastIndex = 0;
|
|
62
|
+
let f;
|
|
63
|
+
while ((f = FUNC_RE.exec(mdx)) !== null) {
|
|
64
|
+
// f[1] is always present: FUNC_RE's single capture group is not optional.
|
|
65
|
+
const name = f[1].toUpperCase();
|
|
66
|
+
if (MDX_COMPUTED_FUNCS.has(name) && !seenFuncs.has(name)) {
|
|
67
|
+
seenFuncs.add(name);
|
|
68
|
+
computedSelectors.push(name);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
members,
|
|
73
|
+
computedSelectors: [...computedSelectors].sort((a, b) => a.localeCompare(b)),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Pure member-extraction step for a live executeMdx result: picks axis-0 tuple
|
|
78
|
+
* member names belonging to one dimension's hierarchy. Used by the C1
|
|
79
|
+
* (resolveComputed) path in tm1_trace_data_flow, which builds the
|
|
80
|
+
* `SELECT {expr} ON 0 FROM [cube]` MDX and calls executeMdx itself — this
|
|
81
|
+
* just filters/flattens the response so that glue stays inline at the call site.
|
|
82
|
+
*/
|
|
83
|
+
export function membersFromAxis(res, dimension) {
|
|
84
|
+
const axis0 = res.axes?.[0];
|
|
85
|
+
if (!axis0)
|
|
86
|
+
return [];
|
|
87
|
+
const wantHier = dimension.toLowerCase();
|
|
88
|
+
const names = [];
|
|
89
|
+
for (const t of axis0.tuples) {
|
|
90
|
+
for (const mem of t.members) {
|
|
91
|
+
if (mem.hierarchyName?.toLowerCase() === wantHier)
|
|
92
|
+
names.push(mem.name);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return names;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=mdxMembers.js.map
|