@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,379 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { checkName, parseMajorVersion, } from "../../lib/naming/rules.js";
|
|
3
|
+
import { elementViolationFilter } from "../../lib/naming/odata-filter.js";
|
|
4
|
+
import { isControlName } from "../../lib/control-name.js";
|
|
5
|
+
import { AuditNamingResultSchema } from "../schemas/items.js";
|
|
6
|
+
import { READ_ONLY } from "../annotations.js";
|
|
7
|
+
import { defineTool } from "../define-tool.js";
|
|
8
|
+
const SCOPE_VALUES = [
|
|
9
|
+
"cubes",
|
|
10
|
+
"dimensions",
|
|
11
|
+
"hierarchies",
|
|
12
|
+
"elements",
|
|
13
|
+
"processes",
|
|
14
|
+
"processVariables",
|
|
15
|
+
"chores",
|
|
16
|
+
"views",
|
|
17
|
+
"subsets",
|
|
18
|
+
];
|
|
19
|
+
const SCOPE_DEFAULT = [
|
|
20
|
+
"cubes",
|
|
21
|
+
"dimensions",
|
|
22
|
+
"hierarchies",
|
|
23
|
+
"elements",
|
|
24
|
+
"processes",
|
|
25
|
+
"chores",
|
|
26
|
+
];
|
|
27
|
+
export const registerAuditNaming = defineTool({
|
|
28
|
+
name: "tm1_audit_naming",
|
|
29
|
+
description: "Bulk-scan TM1 objects against IBM PA 2.0/3.1 naming conventions; reports hard violations only " +
|
|
30
|
+
"(reserved chars, control-prefix misuse, 256-char limit, element leading +/-, TAB in element names, " +
|
|
31
|
+
"invalid process-variable identifiers). Auto-detects TM1 version; element scan paginated per hierarchy " +
|
|
32
|
+
"(default cap 100k, oversized hierarchies reported in elementsTruncated).",
|
|
33
|
+
annotations: READ_ONLY,
|
|
34
|
+
output: AuditNamingResultSchema,
|
|
35
|
+
input: {
|
|
36
|
+
scope: z
|
|
37
|
+
.array(z.enum(SCOPE_VALUES))
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Object kinds to audit. Default: cubes, dimensions, hierarchies, elements, " +
|
|
40
|
+
"processes, chores. Element scan is per (dimension, hierarchy), paginated via " +
|
|
41
|
+
"$top/$skip; oversized hierarchies are truncated at maxElementsPerDim and " +
|
|
42
|
+
"reported in elementsTruncated. 'processVariables' triggers per-process variable " +
|
|
43
|
+
"scans; 'views'/'subsets' do per-cube/per-hier listings."),
|
|
44
|
+
includeControl: z
|
|
45
|
+
.boolean()
|
|
46
|
+
.optional()
|
|
47
|
+
.default(false)
|
|
48
|
+
.describe("Include control objects ('}'-prefix). Default false."),
|
|
49
|
+
maxFindings: z
|
|
50
|
+
.number()
|
|
51
|
+
.int()
|
|
52
|
+
.min(1)
|
|
53
|
+
.max(10000)
|
|
54
|
+
.optional()
|
|
55
|
+
.default(500)
|
|
56
|
+
.describe("Cap on returned findings (default 500). Summary counters reflect the full scan."),
|
|
57
|
+
versionOverride: z
|
|
58
|
+
.enum(["11", "12"])
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Override the auto-detected TM1 major version in the report (detectedMajor stays as " +
|
|
61
|
+
"found, appliedMajor follows this). No naming rule currently differs by version, so " +
|
|
62
|
+
"this does not change which names are flagged."),
|
|
63
|
+
elementsPageSize: z
|
|
64
|
+
.number()
|
|
65
|
+
.int()
|
|
66
|
+
.min(1000)
|
|
67
|
+
.max(100000)
|
|
68
|
+
.optional()
|
|
69
|
+
.default(25000)
|
|
70
|
+
.describe("Page size for paging through violating elements. Bounded to keep each response " +
|
|
71
|
+
"well below the V8 string limit (~512 MB). Default 25000."),
|
|
72
|
+
maxElementsPerDim: z
|
|
73
|
+
.number()
|
|
74
|
+
.int()
|
|
75
|
+
.min(1)
|
|
76
|
+
.optional()
|
|
77
|
+
.default(100000)
|
|
78
|
+
.describe("Per-(dimension, hierarchy) cap on VIOLATING elements returned. The server checks " +
|
|
79
|
+
"every element against the rules, so the whole hierarchy is always examined; this " +
|
|
80
|
+
"bounds how many offenders come back. A hit of the cap is reported under " +
|
|
81
|
+
"`elementsTruncated`. Default 100000."),
|
|
82
|
+
summary: z
|
|
83
|
+
.boolean()
|
|
84
|
+
.optional()
|
|
85
|
+
.default(false)
|
|
86
|
+
.describe("Aggregate findings instead of returning per-object detail. When true, " +
|
|
87
|
+
"swaps the `findings` array for `findingsByGroup` — one entry per " +
|
|
88
|
+
"(objectKind, parent) group with `ruleBreakdown`, `sampleNames` (up to 3), " +
|
|
89
|
+
"and `totalCount`. Recommended for audit reports on large models (e.g. dims " +
|
|
90
|
+
"with thousands of element findings) where per-object detail is not needed " +
|
|
91
|
+
"and `maxFindings`-capped output would be misleading. `truncated` is " +
|
|
92
|
+
"always false in summary mode since no findings are dropped."),
|
|
93
|
+
},
|
|
94
|
+
handler: async ({ scope, includeControl, maxFindings, versionOverride, elementsPageSize, maxElementsPerDim, summary, }, tm1Client) => {
|
|
95
|
+
const activeScope = scope && scope.length > 0 ? scope : SCOPE_DEFAULT;
|
|
96
|
+
const want = (s) => activeScope.includes(s);
|
|
97
|
+
const serverInfo = await tm1Client.server.getInfo();
|
|
98
|
+
const detectedMajor = parseMajorVersion(serverInfo.productVersion);
|
|
99
|
+
const major = versionOverride
|
|
100
|
+
? Number(versionOverride)
|
|
101
|
+
: detectedMajor;
|
|
102
|
+
const findings = [];
|
|
103
|
+
const scanned = {
|
|
104
|
+
cubes: 0,
|
|
105
|
+
dimensions: 0,
|
|
106
|
+
hierarchies: 0,
|
|
107
|
+
elements: 0,
|
|
108
|
+
processes: 0,
|
|
109
|
+
processVariables: 0,
|
|
110
|
+
chores: 0,
|
|
111
|
+
views: 0,
|
|
112
|
+
subsets: 0,
|
|
113
|
+
};
|
|
114
|
+
const addIfInvalid = (name, kind, parent) => {
|
|
115
|
+
const violations = checkName(name, kind);
|
|
116
|
+
if (violations.length === 0)
|
|
117
|
+
return;
|
|
118
|
+
const f = { objectKind: kind, objectName: name, violations };
|
|
119
|
+
if (parent !== undefined)
|
|
120
|
+
f.parent = parent;
|
|
121
|
+
findings.push(f);
|
|
122
|
+
};
|
|
123
|
+
// ── Cubes ──────────────────────────────────────────────────────────
|
|
124
|
+
if (want("cubes")) {
|
|
125
|
+
const cubes = await tm1Client.cubes.list();
|
|
126
|
+
const filtered = includeControl
|
|
127
|
+
? cubes
|
|
128
|
+
: cubes.filter((c) => !isControlName(c.name));
|
|
129
|
+
scanned.cubes = filtered.length;
|
|
130
|
+
for (const c of filtered)
|
|
131
|
+
addIfInvalid(c.name, "cube");
|
|
132
|
+
}
|
|
133
|
+
// ── Dimensions + Hierarchies + (later) Elements/Subsets ───────────
|
|
134
|
+
const needDims = want("dimensions") ||
|
|
135
|
+
want("hierarchies") ||
|
|
136
|
+
want("elements") ||
|
|
137
|
+
want("subsets");
|
|
138
|
+
let dimensionsForChildren;
|
|
139
|
+
if (needDims) {
|
|
140
|
+
// With elements in scope, ask for the per-hierarchy element totals in
|
|
141
|
+
// this same request. TM1 answers a nested $count without listing the
|
|
142
|
+
// elements, so the scope figures cost nothing here — versus one probe
|
|
143
|
+
// request per hierarchy, which on a 107-hierarchy model was 107 round
|
|
144
|
+
// trips for a number the list could have carried.
|
|
145
|
+
const dims = await tm1Client.dimensions.list(want("elements") ? { includeElementCount: true } : {});
|
|
146
|
+
const filtered = includeControl
|
|
147
|
+
? dims
|
|
148
|
+
: dims.filter((d) => !isControlName(d.name));
|
|
149
|
+
// Always reflect dims we fetched/traversed — even when "dimensions" is
|
|
150
|
+
// not in scope, the hierarchy / element / subset walk visited them, so
|
|
151
|
+
// reporting 0 would understate the scan footprint.
|
|
152
|
+
scanned.dimensions = filtered.length;
|
|
153
|
+
if (want("dimensions")) {
|
|
154
|
+
for (const d of filtered)
|
|
155
|
+
addIfInvalid(d.name, "dimension");
|
|
156
|
+
}
|
|
157
|
+
if (want("hierarchies")) {
|
|
158
|
+
let hierCount = 0;
|
|
159
|
+
for (const d of filtered) {
|
|
160
|
+
for (const h of d.hierarchies) {
|
|
161
|
+
hierCount++;
|
|
162
|
+
addIfInvalid(h, "hierarchy", d.name);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
scanned.hierarchies = hierCount;
|
|
166
|
+
}
|
|
167
|
+
dimensionsForChildren = filtered.map((d) => ({
|
|
168
|
+
name: d.name,
|
|
169
|
+
hierarchies: d.hierarchies,
|
|
170
|
+
elementCounts: d.elementCounts,
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
// ── Elements (per-dim/per-hierarchy, filtered server-side) ─────────
|
|
174
|
+
// Every element rule is character-based, so TM1 evaluates them: the
|
|
175
|
+
// scan asks for the names that MIGHT violate one and checks only those
|
|
176
|
+
// (see src/lib/naming/odata-filter.ts). Downloading every name cost
|
|
177
|
+
// 15.2 MB on a single 171k-element dimension and 66 MB across a real
|
|
178
|
+
// model, and capped the audit at maxElementsPerDim — beyond which it
|
|
179
|
+
// examined a prefix of the dimension and said so. Now the server looks
|
|
180
|
+
// at all of them, and the cap bounds the number of REPORTED violations
|
|
181
|
+
// instead of the number examined.
|
|
182
|
+
//
|
|
183
|
+
// The filter is a prefilter, never the verdict: checkName still decides
|
|
184
|
+
// on every candidate, so an over-wide filter costs rows and nothing
|
|
185
|
+
// more. Its soundness — never omitting a name checkName would flag — is
|
|
186
|
+
// pinned by tests/unit/naming-odata-filter.test.ts and by the live
|
|
187
|
+
// suite, which plants a violating element and expects it back.
|
|
188
|
+
const elementsTruncated = [];
|
|
189
|
+
let totalElementsInScope = 0;
|
|
190
|
+
if (want("elements") && dimensionsForChildren) {
|
|
191
|
+
let elemCount = 0;
|
|
192
|
+
for (const d of dimensionsForChildren) {
|
|
193
|
+
for (const h of d.hierarchies) {
|
|
194
|
+
const { names, total, scanned: scannedHere, truncated, } = await tm1Client.elements.scanElementNames(d.name, h, {
|
|
195
|
+
pageSize: elementsPageSize,
|
|
196
|
+
maxScan: maxElementsPerDim,
|
|
197
|
+
filter: elementViolationFilter(),
|
|
198
|
+
...(d.elementCounts?.[h] !== undefined
|
|
199
|
+
? { scopeTotal: d.elementCounts[h] }
|
|
200
|
+
: {}),
|
|
201
|
+
});
|
|
202
|
+
totalElementsInScope += total;
|
|
203
|
+
// `scanned` counts what was EXAMINED, which is now the whole
|
|
204
|
+
// hierarchy — the server applied the rules to every element and
|
|
205
|
+
// returned the candidates. Counting the candidates instead would
|
|
206
|
+
// report "5 elements scanned" for a 171k dimension with 5
|
|
207
|
+
// offenders.
|
|
208
|
+
elemCount += scannedHere;
|
|
209
|
+
for (const name of names) {
|
|
210
|
+
addIfInvalid(name, "element", `${d.name} / ${h}`);
|
|
211
|
+
}
|
|
212
|
+
if (truncated) {
|
|
213
|
+
elementsTruncated.push({
|
|
214
|
+
dimension: d.name,
|
|
215
|
+
hierarchy: h,
|
|
216
|
+
elementCount: total,
|
|
217
|
+
scannedCount: scannedHere,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
scanned.elements = elemCount;
|
|
223
|
+
}
|
|
224
|
+
// ── Subsets (per dim/hier list) ────────────────────────────────────
|
|
225
|
+
if (want("subsets") && dimensionsForChildren) {
|
|
226
|
+
let count = 0;
|
|
227
|
+
for (const d of dimensionsForChildren) {
|
|
228
|
+
for (const h of d.hierarchies) {
|
|
229
|
+
const subs = await tm1Client.subsets.list(d.name, h);
|
|
230
|
+
for (const s of subs) {
|
|
231
|
+
if (!includeControl && isControlName(s.name))
|
|
232
|
+
continue;
|
|
233
|
+
count++;
|
|
234
|
+
addIfInvalid(s.name, "subset", `${d.name} / ${h}`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
scanned.subsets = count;
|
|
239
|
+
}
|
|
240
|
+
// ── Processes + (optional) variables ───────────────────────────────
|
|
241
|
+
let processNames = [];
|
|
242
|
+
if (want("processes") || want("processVariables")) {
|
|
243
|
+
const procs = await tm1Client.processes.list();
|
|
244
|
+
processNames = (includeControl ? procs : procs.filter((p) => !isControlName(p.name))).map((p) => p.name);
|
|
245
|
+
}
|
|
246
|
+
if (want("processes")) {
|
|
247
|
+
scanned.processes = processNames.length;
|
|
248
|
+
for (const p of processNames)
|
|
249
|
+
addIfInvalid(p, "process");
|
|
250
|
+
}
|
|
251
|
+
if (want("processVariables")) {
|
|
252
|
+
let count = 0;
|
|
253
|
+
for (const p of processNames) {
|
|
254
|
+
const vars = await tm1Client.processes.getVariables(p);
|
|
255
|
+
for (const v of vars) {
|
|
256
|
+
count++;
|
|
257
|
+
addIfInvalid(v.name, "processVariable", p);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
scanned.processVariables = count;
|
|
261
|
+
}
|
|
262
|
+
// ── Chores ─────────────────────────────────────────────────────────
|
|
263
|
+
if (want("chores")) {
|
|
264
|
+
const chores = await tm1Client.chores.list();
|
|
265
|
+
const filtered = includeControl
|
|
266
|
+
? chores
|
|
267
|
+
: chores.filter((c) => !isControlName(c.name));
|
|
268
|
+
scanned.chores = filtered.length;
|
|
269
|
+
for (const c of filtered)
|
|
270
|
+
addIfInvalid(c.name, "chore");
|
|
271
|
+
}
|
|
272
|
+
// ── Views (per-cube) ───────────────────────────────────────────────
|
|
273
|
+
if (want("views")) {
|
|
274
|
+
const cubes = await tm1Client.cubes.list();
|
|
275
|
+
const filteredCubes = includeControl
|
|
276
|
+
? cubes
|
|
277
|
+
: cubes.filter((c) => !isControlName(c.name));
|
|
278
|
+
let count = 0;
|
|
279
|
+
for (const c of filteredCubes) {
|
|
280
|
+
const views = await tm1Client.views.list(c.name);
|
|
281
|
+
for (const v of views) {
|
|
282
|
+
if (!includeControl && isControlName(v.name))
|
|
283
|
+
continue;
|
|
284
|
+
count++;
|
|
285
|
+
addIfInvalid(v.name, "view", c.name);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
scanned.views = count;
|
|
289
|
+
}
|
|
290
|
+
// ── Aggregate + sort ───────────────────────────────────────────────
|
|
291
|
+
const byKind = {};
|
|
292
|
+
const byRule = {};
|
|
293
|
+
for (const f of findings) {
|
|
294
|
+
byKind[f.objectKind] = (byKind[f.objectKind] ?? 0) + 1;
|
|
295
|
+
for (const v of f.violations)
|
|
296
|
+
byRule[v.rule] = (byRule[v.rule] ?? 0) + 1;
|
|
297
|
+
}
|
|
298
|
+
findings.sort((a, b) => {
|
|
299
|
+
if (a.objectKind !== b.objectKind)
|
|
300
|
+
return a.objectKind.localeCompare(b.objectKind);
|
|
301
|
+
return a.objectName.localeCompare(b.objectName);
|
|
302
|
+
});
|
|
303
|
+
const truncated = !summary && findings.length > maxFindings;
|
|
304
|
+
const trimmed = findings.slice(0, maxFindings);
|
|
305
|
+
const totalScanned = Object.values(scanned).reduce((a, b) => a + b, 0);
|
|
306
|
+
const status = findings.length === 0 ? "pass" : "fail";
|
|
307
|
+
const findingsByGroup = summary
|
|
308
|
+
? buildFindingsByGroup(findings)
|
|
309
|
+
: undefined;
|
|
310
|
+
const payload = {
|
|
311
|
+
status,
|
|
312
|
+
productVersion: serverInfo.productVersion,
|
|
313
|
+
detectedMajor,
|
|
314
|
+
appliedMajor: major,
|
|
315
|
+
scope: activeScope,
|
|
316
|
+
includeControl,
|
|
317
|
+
scanned,
|
|
318
|
+
totalScanned,
|
|
319
|
+
invalidCount: findings.length,
|
|
320
|
+
summary: { byKind, byRule },
|
|
321
|
+
truncated,
|
|
322
|
+
elementsTruncated,
|
|
323
|
+
totalElementsInScope,
|
|
324
|
+
rulesetSource: "IBM PA naming-conventions (2.0 + 3.1) — hard rules only (server-reserved chars, control prefix, length 256, element leading +/-, TAB in element names, process-var identifier).",
|
|
325
|
+
};
|
|
326
|
+
if (summary) {
|
|
327
|
+
payload.findingsByGroup = findingsByGroup;
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
payload.findings = trimmed;
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
content: [
|
|
334
|
+
{
|
|
335
|
+
type: "text",
|
|
336
|
+
text: JSON.stringify(payload),
|
|
337
|
+
},
|
|
338
|
+
],
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
});
|
|
342
|
+
const SAMPLE_SIZE = 3;
|
|
343
|
+
function buildFindingsByGroup(findings) {
|
|
344
|
+
const groups = new Map();
|
|
345
|
+
for (const f of findings) {
|
|
346
|
+
const key = `${f.objectKind}\0${f.parent ?? ""}`;
|
|
347
|
+
let g = groups.get(key);
|
|
348
|
+
if (!g) {
|
|
349
|
+
g = {
|
|
350
|
+
objectKind: f.objectKind,
|
|
351
|
+
ruleBreakdown: {},
|
|
352
|
+
sampleNames: [],
|
|
353
|
+
totalCount: 0,
|
|
354
|
+
};
|
|
355
|
+
if (f.parent !== undefined) {
|
|
356
|
+
g.parent = f.parent;
|
|
357
|
+
// Element/subset parent format is "Dim / Hier"; split for caller convenience.
|
|
358
|
+
const split = f.parent.split(" / ");
|
|
359
|
+
if (split.length === 2) {
|
|
360
|
+
g.dimension = split[0];
|
|
361
|
+
g.hierarchy = split[1];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
groups.set(key, g);
|
|
365
|
+
}
|
|
366
|
+
g.totalCount++;
|
|
367
|
+
for (const v of f.violations) {
|
|
368
|
+
g.ruleBreakdown[v.rule] = (g.ruleBreakdown[v.rule] ?? 0) + 1;
|
|
369
|
+
}
|
|
370
|
+
if (g.sampleNames.length < SAMPLE_SIZE)
|
|
371
|
+
g.sampleNames.push(f.objectName);
|
|
372
|
+
}
|
|
373
|
+
return Array.from(groups.values()).sort((a, b) => {
|
|
374
|
+
if (a.objectKind !== b.objectKind)
|
|
375
|
+
return a.objectKind.localeCompare(b.objectKind);
|
|
376
|
+
return (a.parent ?? "").localeCompare(b.parent ?? "");
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
//# sourceMappingURL=audit-naming.js.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { scanForDeprecatedTi, } from "../../lib/v12-compat/scanner.js";
|
|
3
|
+
import { READ_ONLY, withVersion } from "../annotations.js";
|
|
4
|
+
import { V12ReadinessResultSchema } from "../schemas/items.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
const RULESET_SOURCE = "vscode-tm1-ti@cf73b93 / tiSignatures.ts (synced 2026-05-12)";
|
|
7
|
+
function toFinding(hit, objectKind, objectName, section) {
|
|
8
|
+
return {
|
|
9
|
+
severity: hit.severity,
|
|
10
|
+
category: "deprecated_ti_function",
|
|
11
|
+
objectKind,
|
|
12
|
+
objectName,
|
|
13
|
+
section,
|
|
14
|
+
line: hit.line,
|
|
15
|
+
function: hit.function,
|
|
16
|
+
snippet: hit.snippet,
|
|
17
|
+
issue: hit.issue,
|
|
18
|
+
suggestion: hit.suggestion,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export const registerCheckV12Readiness = defineTool({
|
|
22
|
+
name: "tm1_check_v12_readiness",
|
|
23
|
+
description: [
|
|
24
|
+
"Static gap-analysis against the TM1 / Planning Analytics v12 (Cloud Native) deprecation list.",
|
|
25
|
+
"Scans every TI process section (prolog/metadata/data/epilog) and every cube rule for functions removed in v12, returning findings with severity, location, and migration hint per occurrence.",
|
|
26
|
+
"Read-only, two bulk REST calls. Not exhaustive: covers syntactic deprecations only (runtime/semantic differences require manual review).",
|
|
27
|
+
],
|
|
28
|
+
annotations: withVersion(READ_ONLY, "v11"),
|
|
29
|
+
output: V12ReadinessResultSchema,
|
|
30
|
+
input: {
|
|
31
|
+
scope: z
|
|
32
|
+
.enum(["processes", "rules", "all"])
|
|
33
|
+
.optional()
|
|
34
|
+
.default("all")
|
|
35
|
+
.describe("Restrict scan to TI processes, cube rules, or both (default 'all')."),
|
|
36
|
+
includeControl: z
|
|
37
|
+
.boolean()
|
|
38
|
+
.optional()
|
|
39
|
+
.default(false)
|
|
40
|
+
.describe("Include control objects ('}'-prefix names). Default false."),
|
|
41
|
+
maxFindings: z
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.min(1)
|
|
45
|
+
.max(5000)
|
|
46
|
+
.optional()
|
|
47
|
+
.default(500)
|
|
48
|
+
.describe("Cap on returned findings (default 500). Summary counters still reflect the full scan."),
|
|
49
|
+
},
|
|
50
|
+
handler: async ({ scope, includeControl, maxFindings }, tm1Client) => {
|
|
51
|
+
const findings = [];
|
|
52
|
+
let scannedProcesses = 0;
|
|
53
|
+
let scannedCubes = 0;
|
|
54
|
+
const wantProcesses = scope === "all" || scope === "processes";
|
|
55
|
+
const wantRules = scope === "all" || scope === "rules";
|
|
56
|
+
const [procCodes, cubeRules] = await Promise.all([
|
|
57
|
+
wantProcesses
|
|
58
|
+
? tm1Client.processes.getAllCode(includeControl)
|
|
59
|
+
: Promise.resolve([]),
|
|
60
|
+
wantRules
|
|
61
|
+
? tm1Client.cubes.getAllRules(includeControl)
|
|
62
|
+
: Promise.resolve([]),
|
|
63
|
+
]);
|
|
64
|
+
if (wantProcesses) {
|
|
65
|
+
scannedProcesses = procCodes.length;
|
|
66
|
+
for (const p of procCodes) {
|
|
67
|
+
const sections = [
|
|
68
|
+
["prolog", p.prolog],
|
|
69
|
+
["metadata", p.metadata],
|
|
70
|
+
["data", p.data],
|
|
71
|
+
["epilog", p.epilog],
|
|
72
|
+
];
|
|
73
|
+
for (const [section, body] of sections) {
|
|
74
|
+
for (const hit of scanForDeprecatedTi(body)) {
|
|
75
|
+
findings.push(toFinding(hit, "process", p.name, section));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (wantRules) {
|
|
81
|
+
scannedCubes = cubeRules.length;
|
|
82
|
+
for (const r of cubeRules) {
|
|
83
|
+
for (const hit of scanForDeprecatedTi(r.rulesText)) {
|
|
84
|
+
findings.push(toFinding(hit, "cube", r.cubeName, "rules"));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Aggregations across the FULL finding set, before truncation.
|
|
89
|
+
const bySeverity = {};
|
|
90
|
+
const byCategory = {};
|
|
91
|
+
const fnCounts = new Map();
|
|
92
|
+
for (const f of findings) {
|
|
93
|
+
bySeverity[f.severity] = (bySeverity[f.severity] ?? 0) + 1;
|
|
94
|
+
byCategory[f.category] = (byCategory[f.category] ?? 0) + 1;
|
|
95
|
+
fnCounts.set(f.function, (fnCounts.get(f.function) ?? 0) + 1);
|
|
96
|
+
}
|
|
97
|
+
const topFunctions = Array.from(fnCounts.entries())
|
|
98
|
+
.sort((a, b) => b[1] - a[1])
|
|
99
|
+
.slice(0, 10)
|
|
100
|
+
.map(([fn, count]) => ({ function: fn, count }));
|
|
101
|
+
const errorCount = bySeverity.error ?? 0;
|
|
102
|
+
const warningCount = bySeverity.warning ?? 0;
|
|
103
|
+
const readinessScore = errorCount === 0 && warningCount === 0
|
|
104
|
+
? "ready"
|
|
105
|
+
: errorCount > 0
|
|
106
|
+
? "blocked"
|
|
107
|
+
: "needs-work";
|
|
108
|
+
findings.sort((a, b) => {
|
|
109
|
+
if (a.severity !== b.severity)
|
|
110
|
+
return a.severity === "error" ? -1 : 1;
|
|
111
|
+
if (a.objectName !== b.objectName)
|
|
112
|
+
return a.objectName.localeCompare(b.objectName);
|
|
113
|
+
return a.line - b.line;
|
|
114
|
+
});
|
|
115
|
+
const trimmed = findings.slice(0, maxFindings);
|
|
116
|
+
return {
|
|
117
|
+
content: [
|
|
118
|
+
{
|
|
119
|
+
type: "text",
|
|
120
|
+
text: JSON.stringify({
|
|
121
|
+
scope,
|
|
122
|
+
includeControl,
|
|
123
|
+
scannedProcesses,
|
|
124
|
+
scannedCubes,
|
|
125
|
+
findingsCount: findings.length,
|
|
126
|
+
readinessScore,
|
|
127
|
+
summary: { byCategory, bySeverity, topFunctions },
|
|
128
|
+
findings: trimmed,
|
|
129
|
+
rulesetSource: RULESET_SOURCE,
|
|
130
|
+
}, null, 2),
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=check-v12-readiness.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FORMAT_SCHEMA, wrappedPageResponse, columnsOf } from "../format.js";
|
|
3
|
+
import { PAGINATION_SCHEMA, paginate } from "../pagination.js";
|
|
4
|
+
import { FindOrphanDimensionsResultSchema } from "../schemas/items.js";
|
|
5
|
+
import { READ_ONLY } from "../annotations.js";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
export const registerFindOrphanDimensions = defineTool({
|
|
8
|
+
name: "tm1_find_orphan_dimensions",
|
|
9
|
+
description: [
|
|
10
|
+
"Identify dimensions not referenced by any cube — a model-hygiene check. Computes the used-dimension set across all cubes (one OData call) and diffs against the full dimension list.",
|
|
11
|
+
"Control dimensions ('}'-prefixed) excluded unless includeControl=true. Paginated (default 50/page). Inspect a hit with tm1_get_hierarchy or remove via tm1_delete_dimension.",
|
|
12
|
+
],
|
|
13
|
+
annotations: READ_ONLY,
|
|
14
|
+
output: FindOrphanDimensionsResultSchema,
|
|
15
|
+
input: {
|
|
16
|
+
includeControl: z
|
|
17
|
+
.boolean()
|
|
18
|
+
.optional()
|
|
19
|
+
.default(false)
|
|
20
|
+
.describe("Include control dimensions whose names start with '}' (default: false)."),
|
|
21
|
+
...PAGINATION_SCHEMA,
|
|
22
|
+
...FORMAT_SCHEMA,
|
|
23
|
+
},
|
|
24
|
+
handler: async ({ includeControl, limit, offset, fetchAll, format }, tm1Client) => {
|
|
25
|
+
const [cubes, dimensions] = await Promise.all([
|
|
26
|
+
tm1Client.cubes.list(),
|
|
27
|
+
tm1Client.dimensions.list(),
|
|
28
|
+
]);
|
|
29
|
+
const usedDims = new Set();
|
|
30
|
+
for (const c of cubes) {
|
|
31
|
+
for (const d of c.dimensions ?? [])
|
|
32
|
+
usedDims.add(d);
|
|
33
|
+
}
|
|
34
|
+
const candidates = includeControl
|
|
35
|
+
? dimensions
|
|
36
|
+
: dimensions.filter((d) => !d.name.startsWith("}"));
|
|
37
|
+
const orphans = candidates
|
|
38
|
+
.filter((d) => !usedDims.has(d.name))
|
|
39
|
+
.map((d) => ({ name: d.name, hierarchies: d.hierarchies }));
|
|
40
|
+
const page = paginate(orphans, limit, offset, fetchAll);
|
|
41
|
+
const wrapper = {
|
|
42
|
+
totalDimensions: candidates.length,
|
|
43
|
+
totalCubes: cubes.length,
|
|
44
|
+
orphanCount: orphans.length,
|
|
45
|
+
includeControl,
|
|
46
|
+
...page,
|
|
47
|
+
};
|
|
48
|
+
const columns = columnsOf(["name", "hierarchies"]);
|
|
49
|
+
return wrappedPageResponse(wrapper, page, format, {
|
|
50
|
+
title: "Orphan dimensions",
|
|
51
|
+
columns,
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=find-orphan-dimensions.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineTool } from "../define-tool.js";
|
|
2
|
+
import { READ_ONLY } from "../annotations.js";
|
|
3
|
+
import { InvalidateCallgraphCacheResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { invalidateCallgraphCache, getCallgraphCacheStats, } from "../../lib/callgraph/tm1-adapter.js";
|
|
5
|
+
export const registerInvalidateCallgraphCache = defineTool({
|
|
6
|
+
name: "tm1_invalidate_callgraph_cache",
|
|
7
|
+
description: "Drop the in-memory ReferenceIndex cache used by tm1_analyze_callgraph / tm1_analyze_object_usage / tm1_analyze_chore_graph. Rarely needed: every successful mutating call through this server already drops it. Use it only after changes made outside this server (Workspace, TI, another client). The next analysis call rebuilds the index (single bulk fetch). Touches no TM1 object, so it is available in readonly mode.",
|
|
8
|
+
annotations: READ_ONLY,
|
|
9
|
+
output: InvalidateCallgraphCacheResultSchema,
|
|
10
|
+
// Takes no arguments: the cache is process-wide.
|
|
11
|
+
input: {},
|
|
12
|
+
handler: () => {
|
|
13
|
+
try {
|
|
14
|
+
const before = getCallgraphCacheStats();
|
|
15
|
+
const { cleared } = invalidateCallgraphCache();
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
type: "text",
|
|
20
|
+
text: JSON.stringify({ cleared, entriesBefore: before }),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return {
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: "text",
|
|
30
|
+
text: JSON.stringify({
|
|
31
|
+
error: error.message ?? String(error),
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=invalidate-callgraph-cache.js.map
|