@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,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PAGINATION_SCHEMA, paginate } from "../pagination.js";
|
|
3
|
+
import { FORMAT_SCHEMA, pageResponse, columnsOf } from "../format.js";
|
|
4
|
+
import { ChoreItemSchema } from "../schemas/items.js";
|
|
5
|
+
import { READ_ONLY } from "../annotations.js";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
import { pageShapeFor } from "../schemas/common.js";
|
|
8
|
+
export const registerListChores = defineTool({
|
|
9
|
+
name: "tm1_list_chores",
|
|
10
|
+
description: [
|
|
11
|
+
"List chores in the TM1 server with schedule and assigned processes. compact=true replaces processes[] with processCount; processNameContains filters by referenced process.",
|
|
12
|
+
"Paginated (default 50/page).",
|
|
13
|
+
],
|
|
14
|
+
annotations: READ_ONLY,
|
|
15
|
+
output: pageShapeFor(ChoreItemSchema),
|
|
16
|
+
input: {
|
|
17
|
+
...PAGINATION_SCHEMA,
|
|
18
|
+
...FORMAT_SCHEMA,
|
|
19
|
+
compact: z
|
|
20
|
+
.boolean()
|
|
21
|
+
.optional()
|
|
22
|
+
.default(false)
|
|
23
|
+
.describe("Replace processes[] with processCount (default: false)."),
|
|
24
|
+
processNameContains: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Return only chores whose steps reference a process name containing this substring (case-insensitive)."),
|
|
28
|
+
},
|
|
29
|
+
handler: async ({ limit, offset, fetchAll, format, compact, processNameContains }, tm1Client) => {
|
|
30
|
+
const chores = await tm1Client.chores.list();
|
|
31
|
+
const filtered = (() => {
|
|
32
|
+
if (processNameContains === undefined || processNameContains.length === 0)
|
|
33
|
+
return chores;
|
|
34
|
+
const needle = processNameContains.toLowerCase();
|
|
35
|
+
return chores.filter((c) => c.processes.some((p) => p.name.toLowerCase().includes(needle)));
|
|
36
|
+
})();
|
|
37
|
+
const projected = compact
|
|
38
|
+
? filtered.map((c) => ({
|
|
39
|
+
name: c.name,
|
|
40
|
+
active: c.active,
|
|
41
|
+
startTime: c.startTime,
|
|
42
|
+
frequency: c.frequency,
|
|
43
|
+
processCount: c.processes.length,
|
|
44
|
+
}))
|
|
45
|
+
: filtered;
|
|
46
|
+
const page = paginate(projected, limit, offset, fetchAll);
|
|
47
|
+
const columns = columnsOf([
|
|
48
|
+
"name",
|
|
49
|
+
"active",
|
|
50
|
+
"startTime",
|
|
51
|
+
"frequency",
|
|
52
|
+
{
|
|
53
|
+
header: "processes",
|
|
54
|
+
get: (c) => "processes" in c
|
|
55
|
+
? c.processes.map((p) => p.name).join(", ")
|
|
56
|
+
: `${c.processCount} (compact)`,
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
return pageResponse(page, format, { title: "Chores", columns });
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=list-chores.js.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { compileUserRegex } from "../../lib/safe-regex.js";
|
|
3
|
+
import { compareByName } from "../../tm1-client/services/odata-page.js";
|
|
4
|
+
import { defineTool } from "../define-tool.js";
|
|
5
|
+
import { READ_ONLY } from "../annotations.js";
|
|
6
|
+
import { pageShapeFor } from "../schemas/common.js";
|
|
7
|
+
import { CubeItemSchema } from "../schemas/items.js";
|
|
8
|
+
import { PAGINATION_SCHEMA, paginate, pageFromServer, } from "../pagination.js";
|
|
9
|
+
import { FORMAT_SCHEMA, pageResponse, columnsOf, } from "../format.js";
|
|
10
|
+
export const registerListCubes = defineTool({
|
|
11
|
+
name: "tm1_list_cubes",
|
|
12
|
+
description: [
|
|
13
|
+
"List cubes in the TM1 server. Control cubes ('}'-prefixed) excluded unless includeControl=true.",
|
|
14
|
+
"Combinable name filters (nameExact/nameContains/nameRegex) and projection toggles (includeDimensions, includeRules) trim payload on wide models.",
|
|
15
|
+
"Paginated (default 50/page).",
|
|
16
|
+
],
|
|
17
|
+
annotations: READ_ONLY,
|
|
18
|
+
output: pageShapeFor(CubeItemSchema),
|
|
19
|
+
input: {
|
|
20
|
+
...PAGINATION_SCHEMA,
|
|
21
|
+
...FORMAT_SCHEMA,
|
|
22
|
+
includeControl: z
|
|
23
|
+
.boolean()
|
|
24
|
+
.optional()
|
|
25
|
+
.default(false)
|
|
26
|
+
.describe("Include TM1 control cubes whose names start with '}' (default: false)."),
|
|
27
|
+
includeDimensions: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.optional()
|
|
30
|
+
.default(true)
|
|
31
|
+
.describe("Include the dimensions[] array per cube (default: true). Set false for compact output on wide cubes."),
|
|
32
|
+
includeRules: z
|
|
33
|
+
.boolean()
|
|
34
|
+
.optional()
|
|
35
|
+
.default(false)
|
|
36
|
+
.describe("Include hasRules:boolean per cube (default: false). Triggers one extra OData $select=Rules; useful for audits to skip cubes without rules."),
|
|
37
|
+
nameExact: z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Return only the cube whose name matches exactly (case-sensitive). Fast-path for known cube names; overrides nameContains/nameRegex when set."),
|
|
41
|
+
nameContains: z
|
|
42
|
+
.string()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("Case-insensitive substring filter on cube name."),
|
|
45
|
+
nameRegex: z
|
|
46
|
+
.string()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("JS regex (case-insensitive) on cube name. Invalid patterns return an error."),
|
|
49
|
+
},
|
|
50
|
+
handler: async ({ limit, offset, fetchAll, format, includeControl, includeDimensions, includeRules, nameExact, nameContains, nameRegex, }, tm1Client) => {
|
|
51
|
+
const project = (list) => list.map((c) => {
|
|
52
|
+
const out = { name: c.name };
|
|
53
|
+
if (includeDimensions)
|
|
54
|
+
out.dimensions = c.dimensions;
|
|
55
|
+
if (includeRules)
|
|
56
|
+
out.hasRules = c.hasRules ?? false;
|
|
57
|
+
return out;
|
|
58
|
+
});
|
|
59
|
+
const fullScan = async () => {
|
|
60
|
+
let cubes = await tm1Client.cubes.list({ includeRules });
|
|
61
|
+
if (!includeControl) {
|
|
62
|
+
cubes = cubes.filter((c) => !c.name.startsWith("}"));
|
|
63
|
+
}
|
|
64
|
+
if (nameExact !== undefined) {
|
|
65
|
+
cubes = cubes.filter((c) => c.name === nameExact);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
if (nameContains !== undefined && nameContains.length > 0) {
|
|
69
|
+
const needle = nameContains.toLowerCase();
|
|
70
|
+
cubes = cubes.filter((c) => c.name.toLowerCase().includes(needle));
|
|
71
|
+
}
|
|
72
|
+
if (nameRegex !== undefined && nameRegex.length > 0) {
|
|
73
|
+
const re = compileUserRegex(nameRegex, "i", "nameRegex");
|
|
74
|
+
cubes = cubes.filter((c) => re.test(c.name));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Match the pushed-down path's $orderby=Name so a given offset means
|
|
78
|
+
// the same row whichever path served it.
|
|
79
|
+
return project(cubes.sort(compareByName));
|
|
80
|
+
};
|
|
81
|
+
// nameRegex has no OData equivalent, so it must run client-side — and a
|
|
82
|
+
// client-side filter makes @odata.count count rows the caller can never
|
|
83
|
+
// reach. nameExact takes precedence over nameContains/nameRegex
|
|
84
|
+
// (documented), so when it is set the others are not active filters.
|
|
85
|
+
const usesNameRegex = nameExact === undefined &&
|
|
86
|
+
nameRegex !== undefined &&
|
|
87
|
+
nameRegex.length > 0;
|
|
88
|
+
const canPushDown = !fetchAll && limit > 0 && !usesNameRegex;
|
|
89
|
+
let page;
|
|
90
|
+
if (canPushDown) {
|
|
91
|
+
const { items, total } = await tm1Client.cubes.list({
|
|
92
|
+
includeRules,
|
|
93
|
+
includeControl,
|
|
94
|
+
...(nameExact !== undefined
|
|
95
|
+
? { nameExact }
|
|
96
|
+
: nameContains !== undefined
|
|
97
|
+
? { nameContains }
|
|
98
|
+
: {}),
|
|
99
|
+
page: { top: limit, skip: offset },
|
|
100
|
+
});
|
|
101
|
+
// No @odata.count means no honest total, so redo it as a full scan
|
|
102
|
+
// rather than invent one.
|
|
103
|
+
page =
|
|
104
|
+
total === undefined
|
|
105
|
+
? paginate(await fullScan(), limit, offset, fetchAll)
|
|
106
|
+
: pageFromServer(project(items), total, offset);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
page = paginate(await fullScan(), limit, offset, fetchAll);
|
|
110
|
+
}
|
|
111
|
+
const columns = columnsOf([
|
|
112
|
+
"name",
|
|
113
|
+
// `?? []` would be redundant: an absent array and an empty one both
|
|
114
|
+
// render as an empty cell.
|
|
115
|
+
...(includeDimensions ? ["dimensions"] : []),
|
|
116
|
+
...(includeRules
|
|
117
|
+
? [
|
|
118
|
+
{
|
|
119
|
+
header: "hasRules",
|
|
120
|
+
get: (c) => c.hasRules ?? false,
|
|
121
|
+
},
|
|
122
|
+
]
|
|
123
|
+
: []),
|
|
124
|
+
]);
|
|
125
|
+
return pageResponse(page, format, { title: "Cubes", columns });
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=list-cubes.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { decodeTm1Timestamp, normalizeChangedSince, } from "../../tm1-client/services/dimension-service.js";
|
|
3
|
+
import { compareByName } from "../../tm1-client/services/odata-page.js";
|
|
4
|
+
import { PAGINATION_SCHEMA, paginate, pageFromServer } from "../pagination.js";
|
|
5
|
+
import { FORMAT_SCHEMA, pageResponse, columnsOf, } from "../format.js";
|
|
6
|
+
import { DimensionItemSchema } from "../schemas/items.js";
|
|
7
|
+
import { READ_ONLY } from "../annotations.js";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
import { pageShapeFor } from "../schemas/common.js";
|
|
10
|
+
export const registerListDimensions = defineTool({
|
|
11
|
+
name: "tm1_list_dimensions",
|
|
12
|
+
description: [
|
|
13
|
+
"List dimensions (with their hierarchy names) in the TM1 server. Control dimensions ('}'-prefixed) excluded unless includeControl=true.",
|
|
14
|
+
"Optional per-dimension enrichment: includeElementCount/includeElementStats (sizing + per-type breakdown for orphan/double-hierarchy audits), includeLastUpdated/changedSince (schema-change stamp — bumped on metadata edits, NOT on data writes).",
|
|
15
|
+
"Paginated (default 50/page).",
|
|
16
|
+
],
|
|
17
|
+
annotations: READ_ONLY,
|
|
18
|
+
output: pageShapeFor(DimensionItemSchema),
|
|
19
|
+
input: {
|
|
20
|
+
...PAGINATION_SCHEMA,
|
|
21
|
+
...FORMAT_SCHEMA,
|
|
22
|
+
includeControl: z
|
|
23
|
+
.boolean()
|
|
24
|
+
.optional()
|
|
25
|
+
.default(false)
|
|
26
|
+
.describe("Include TM1 control dimensions whose names start with '}' (default: false)"),
|
|
27
|
+
includeElementCount: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.optional()
|
|
30
|
+
.default(false)
|
|
31
|
+
.describe("Attach `elementCounts: { hierarchyName: number }` per dimension via OData $count. Single extra server-side aggregation, no N+1. Default false."),
|
|
32
|
+
includeElementStats: z
|
|
33
|
+
.boolean()
|
|
34
|
+
.optional()
|
|
35
|
+
.default(false)
|
|
36
|
+
.describe("Attach `elementStats: { hierarchyName: { total, numeric, consolidated, string, maxLevel } }` per dimension. Single round-trip, payload scales with total element count. Use for double-hierarchy audits and orphan detection. Overrides includeElementCount when set. Default false."),
|
|
37
|
+
includeLastUpdated: z
|
|
38
|
+
.boolean()
|
|
39
|
+
.optional()
|
|
40
|
+
.default(false)
|
|
41
|
+
.describe("Attach `lastUpdated` (server-local ISO, no Z) per dimension from }DimensionProperties.LAST_TIME_UPDATED — a schema-change stamp. One extra MDX round-trip. Default false."),
|
|
42
|
+
changedSince: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Return only dimensions modified at/after this date or datetime (server-local, e.g. '2026-04-01' or '2026-04-01T08:30:00'). Implies includeLastUpdated. Needs at least a full date."),
|
|
46
|
+
},
|
|
47
|
+
handler: async ({ limit, offset, fetchAll, format, includeControl, includeElementCount, includeElementStats, includeLastUpdated, changedSince, }, tm1Client) => {
|
|
48
|
+
// changedSince filters against }DimensionProperties client-side, so with
|
|
49
|
+
// it active @odata.count would count dimensions the caller never sees.
|
|
50
|
+
// includeLastUpdated alone only enriches rows and drops none, so it stays
|
|
51
|
+
// eligible — the stamp lookup is by name and works on a page just as well.
|
|
52
|
+
const canPushDown = !fetchAll && limit > 0 && changedSince === undefined;
|
|
53
|
+
const paged = canPushDown
|
|
54
|
+
? await tm1Client.dimensions.list({
|
|
55
|
+
includeElementCount,
|
|
56
|
+
includeElementStats,
|
|
57
|
+
includeControl,
|
|
58
|
+
page: { top: limit, skip: offset },
|
|
59
|
+
})
|
|
60
|
+
: undefined;
|
|
61
|
+
const serverTotal = paged?.total;
|
|
62
|
+
// Ineligible, or the server omitted @odata.count: fall back to the full
|
|
63
|
+
// scan rather than report a total we cannot stand behind.
|
|
64
|
+
let dimensions = paged !== undefined && serverTotal !== undefined
|
|
65
|
+
? paged.items
|
|
66
|
+
: (await tm1Client.dimensions.list({
|
|
67
|
+
includeElementCount,
|
|
68
|
+
includeElementStats,
|
|
69
|
+
}))
|
|
70
|
+
.filter((d) => includeControl || !d.name.startsWith("}"))
|
|
71
|
+
// Match the pushed-down path's $orderby=Name so a given offset
|
|
72
|
+
// means the same row whichever path served it.
|
|
73
|
+
.sort(compareByName);
|
|
74
|
+
const wantLastUpdated = includeLastUpdated || changedSince !== undefined;
|
|
75
|
+
if (wantLastUpdated) {
|
|
76
|
+
// Invalid changedSince throws TM1Error(VALIDATION_ERROR); the index.ts
|
|
77
|
+
// proxy formats it into the uniform error envelope.
|
|
78
|
+
const since = changedSince !== undefined
|
|
79
|
+
? normalizeChangedSince(changedSince)
|
|
80
|
+
: undefined;
|
|
81
|
+
// }DimensionProperties is a control cube — a caller without read rights
|
|
82
|
+
// gets a security error. When changedSince was requested the filter
|
|
83
|
+
// can't be honoured, so surface it; when only includeLastUpdated was
|
|
84
|
+
// asked, degrade to lastUpdated:null so the base dimension list survives.
|
|
85
|
+
let stamps;
|
|
86
|
+
try {
|
|
87
|
+
stamps = await tm1Client.dimensions.getLastUpdatedMap();
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
if (since !== undefined)
|
|
91
|
+
throw err;
|
|
92
|
+
stamps = new Map();
|
|
93
|
+
}
|
|
94
|
+
dimensions = dimensions.map((d) => ({
|
|
95
|
+
...d,
|
|
96
|
+
lastUpdated: decodeTm1Timestamp(stamps.get(d.name) ?? null),
|
|
97
|
+
}));
|
|
98
|
+
if (since !== undefined) {
|
|
99
|
+
dimensions = dimensions.filter((d) => {
|
|
100
|
+
const raw = stamps.get(d.name);
|
|
101
|
+
return raw !== undefined && raw >= since;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const page = serverTotal !== undefined
|
|
106
|
+
? pageFromServer(dimensions, serverTotal, offset)
|
|
107
|
+
: paginate(dimensions, limit, offset, fetchAll);
|
|
108
|
+
const columns = columnsOf([
|
|
109
|
+
"name",
|
|
110
|
+
"hierarchies",
|
|
111
|
+
...(includeElementStats
|
|
112
|
+
? [
|
|
113
|
+
{
|
|
114
|
+
header: "elementStats",
|
|
115
|
+
get: (d) => d.elementStats ?? {},
|
|
116
|
+
},
|
|
117
|
+
]
|
|
118
|
+
: includeElementCount
|
|
119
|
+
? [
|
|
120
|
+
{
|
|
121
|
+
header: "elementCounts",
|
|
122
|
+
get: (d) => d.elementCounts ?? {},
|
|
123
|
+
},
|
|
124
|
+
]
|
|
125
|
+
: []),
|
|
126
|
+
...(wantLastUpdated ? ["lastUpdated"] : []),
|
|
127
|
+
]);
|
|
128
|
+
return pageResponse(page, format, { title: "Dimensions", columns });
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
//# sourceMappingURL=list-dimensions.js.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { compileUserRegex } from "../../lib/safe-regex.js";
|
|
3
|
+
import { FORMAT_SCHEMA, payloadResponse, renderTable, columnsOf, } from "../format.js";
|
|
4
|
+
import { ProcessesGroupedResultSchema } from "../schemas/items.js";
|
|
5
|
+
import { READ_ONLY } from "../annotations.js";
|
|
6
|
+
import { defineTool } from "../define-tool.js";
|
|
7
|
+
export const registerListProcessesGrouped = defineTool({
|
|
8
|
+
name: "tm1_list_processes_grouped",
|
|
9
|
+
description: [
|
|
10
|
+
"Group TI processes by name prefix to give a structural overview without listing every process.",
|
|
11
|
+
"Returns groups sorted by count descending. Use tm1_list_processes(nameContains=...) to drill into a group.",
|
|
12
|
+
"prefixSegments controls how many '_'-delimited segments form the group key (default 1: '020_Parameter_...' → '020').",
|
|
13
|
+
"Set includeNames=true to get the full process list per group for targeted follow-up.",
|
|
14
|
+
],
|
|
15
|
+
annotations: READ_ONLY,
|
|
16
|
+
output: ProcessesGroupedResultSchema,
|
|
17
|
+
input: {
|
|
18
|
+
...FORMAT_SCHEMA,
|
|
19
|
+
includeControl: z
|
|
20
|
+
.boolean()
|
|
21
|
+
.optional()
|
|
22
|
+
.default(false)
|
|
23
|
+
.describe("Include control processes ('}'-prefixed). Default: false."),
|
|
24
|
+
prefixSegments: z
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.min(1)
|
|
28
|
+
.max(5)
|
|
29
|
+
.optional()
|
|
30
|
+
.default(1)
|
|
31
|
+
.describe("Number of '_'-delimited segments to use as group key. Default 1: '020_Param_Load' → '020'. Use 2 for '020_Param'."),
|
|
32
|
+
includeNames: z
|
|
33
|
+
.boolean()
|
|
34
|
+
.optional()
|
|
35
|
+
.default(false)
|
|
36
|
+
.describe("Add processes[] array of names to each group. Default false — summary only."),
|
|
37
|
+
minCount: z
|
|
38
|
+
.number()
|
|
39
|
+
.int()
|
|
40
|
+
.min(1)
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Only return groups with at least this many processes. Useful to hide one-off processes."),
|
|
43
|
+
excludePattern: z
|
|
44
|
+
.string()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("JS-compatible regex (case-insensitive) — drop processes whose name matches before grouping. E.g. '^Bedrock\\.' to hide Bedrock utility processes."),
|
|
47
|
+
},
|
|
48
|
+
handler: async ({ format, includeControl, prefixSegments, includeNames, minCount, excludePattern, }, tm1Client) => {
|
|
49
|
+
let processes = await tm1Client.processes.list();
|
|
50
|
+
if (!includeControl)
|
|
51
|
+
processes = processes.filter((p) => !p.name.startsWith("}"));
|
|
52
|
+
if (excludePattern) {
|
|
53
|
+
const re = compileUserRegex(excludePattern, "i", "excludePattern");
|
|
54
|
+
processes = processes.filter((p) => !re.test(p.name));
|
|
55
|
+
}
|
|
56
|
+
const groupMap = new Map();
|
|
57
|
+
for (const p of processes) {
|
|
58
|
+
const segments = p.name.split("_");
|
|
59
|
+
const prefix = segments.slice(0, prefixSegments).join("_");
|
|
60
|
+
const group = groupMap.get(prefix);
|
|
61
|
+
if (group)
|
|
62
|
+
group.push(p.name);
|
|
63
|
+
else
|
|
64
|
+
groupMap.set(prefix, [p.name]);
|
|
65
|
+
}
|
|
66
|
+
let groups = Array.from(groupMap.entries())
|
|
67
|
+
.map(([prefix, names]) => ({
|
|
68
|
+
prefix,
|
|
69
|
+
count: names.length,
|
|
70
|
+
...(includeNames ? { processes: names.sort() } : {}),
|
|
71
|
+
}))
|
|
72
|
+
.sort((a, b) => b.count - a.count);
|
|
73
|
+
if (minCount !== undefined)
|
|
74
|
+
groups = groups.filter((g) => g.count >= minCount);
|
|
75
|
+
const payload = {
|
|
76
|
+
totalProcesses: processes.length,
|
|
77
|
+
groupCount: groups.length,
|
|
78
|
+
prefixSegments,
|
|
79
|
+
groups,
|
|
80
|
+
};
|
|
81
|
+
const columns = columnsOf([
|
|
82
|
+
"prefix",
|
|
83
|
+
"count",
|
|
84
|
+
...(includeNames
|
|
85
|
+
? [
|
|
86
|
+
{
|
|
87
|
+
header: "processes",
|
|
88
|
+
get: (g) => ("processes" in g ? g.processes : []),
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
: []),
|
|
92
|
+
]);
|
|
93
|
+
return payloadResponse(payload, format, (p) => `## Processes grouped by prefix\n\n${p.totalProcesses} processes · ${p.groupCount} groups · prefixSegments=${p.prefixSegments}\n\n${renderTable(p.groups, columns)}`);
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=list-processes-grouped.js.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { compileUserRegex } from "../../lib/safe-regex.js";
|
|
3
|
+
import { compareByName } from "../../tm1-client/services/odata-page.js";
|
|
4
|
+
import { PAGINATION_SCHEMA, paginate, pageFromServer, } from "../pagination.js";
|
|
5
|
+
import { FORMAT_SCHEMA, pageResponse, columnsOf } from "../format.js";
|
|
6
|
+
import { ProcessItemSchema } from "../schemas/items.js";
|
|
7
|
+
import { READ_ONLY } from "../annotations.js";
|
|
8
|
+
import { defineTool } from "../define-tool.js";
|
|
9
|
+
import { pageShapeFor } from "../schemas/common.js";
|
|
10
|
+
export const registerListProcesses = defineTool({
|
|
11
|
+
name: "tm1_list_processes",
|
|
12
|
+
description: [
|
|
13
|
+
"List TurboIntegrator processes (with parameters) in the TM1 server. Control processes ('}'-prefixed) excluded unless includeControl=true.",
|
|
14
|
+
"Name filters (nameContains/nameRegex/nameNotContains/excludePattern) and fields=['name'] projection trim payload on large models.",
|
|
15
|
+
"Paginated (default 50/page).",
|
|
16
|
+
],
|
|
17
|
+
annotations: READ_ONLY,
|
|
18
|
+
output: pageShapeFor(ProcessItemSchema),
|
|
19
|
+
input: {
|
|
20
|
+
...PAGINATION_SCHEMA,
|
|
21
|
+
...FORMAT_SCHEMA,
|
|
22
|
+
includeControl: z
|
|
23
|
+
.boolean()
|
|
24
|
+
.optional()
|
|
25
|
+
.default(false)
|
|
26
|
+
.describe("Include TM1 control processes whose names start with '}' (default: false)"),
|
|
27
|
+
nameContains: z
|
|
28
|
+
.string()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe("Case-insensitive substring filter on process name."),
|
|
31
|
+
nameRegex: z
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("JS-compatible regex tested against process name (case-insensitive)."),
|
|
35
|
+
nameNotContains: z
|
|
36
|
+
.string()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Case-insensitive substring filter — drop processes whose name contains this substring (e.g. 'TEST', '###NSCH')."),
|
|
39
|
+
excludePattern: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("JS-compatible regex (case-insensitive) — drop processes whose name matches. Useful for separator dummies and test patterns, e.g. '^[#-]|^Bedrock\\\\.'."),
|
|
43
|
+
fields: z
|
|
44
|
+
.array(z.enum(["name", "parameters"]))
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Projection. Default: all fields. Use ['name'] to skip parameters[] and shrink payload ~10x."),
|
|
47
|
+
},
|
|
48
|
+
handler: async ({ limit, offset, fetchAll, format, includeControl, nameContains, nameRegex, nameNotContains, excludePattern, fields, }, tm1Client) => {
|
|
49
|
+
const project = (list) => fields && !fields.includes("parameters")
|
|
50
|
+
? list.map((p) => ({ name: p.name }))
|
|
51
|
+
: list;
|
|
52
|
+
const fullScan = async () => {
|
|
53
|
+
let processes = await tm1Client.processes.list();
|
|
54
|
+
if (!includeControl)
|
|
55
|
+
processes = processes.filter((p) => !p.name.startsWith("}"));
|
|
56
|
+
if (nameContains) {
|
|
57
|
+
const needle = nameContains.toLowerCase();
|
|
58
|
+
processes = processes.filter((p) => p.name.toLowerCase().includes(needle));
|
|
59
|
+
}
|
|
60
|
+
if (nameRegex) {
|
|
61
|
+
const re = compileUserRegex(nameRegex, "i", "nameRegex");
|
|
62
|
+
processes = processes.filter((p) => re.test(p.name));
|
|
63
|
+
}
|
|
64
|
+
if (nameNotContains) {
|
|
65
|
+
const needle = nameNotContains.toLowerCase();
|
|
66
|
+
processes = processes.filter((p) => !p.name.toLowerCase().includes(needle));
|
|
67
|
+
}
|
|
68
|
+
if (excludePattern) {
|
|
69
|
+
const re = compileUserRegex(excludePattern, "i", "excludePattern");
|
|
70
|
+
processes = processes.filter((p) => !re.test(p.name));
|
|
71
|
+
}
|
|
72
|
+
// Match the pushed-down path's $orderby=Name so a given offset means
|
|
73
|
+
// the same row whichever path served it.
|
|
74
|
+
return project(processes.sort(compareByName));
|
|
75
|
+
};
|
|
76
|
+
// Regex filters have no OData equivalent and must run client-side, which
|
|
77
|
+
// would make @odata.count count rows the caller can never reach.
|
|
78
|
+
const canPushDown = !fetchAll && limit > 0 && !nameRegex && !excludePattern;
|
|
79
|
+
let page;
|
|
80
|
+
if (canPushDown) {
|
|
81
|
+
const { items, total } = await tm1Client.processes.list({
|
|
82
|
+
includeControl,
|
|
83
|
+
...(nameContains ? { nameContains } : {}),
|
|
84
|
+
...(nameNotContains ? { nameNotContains } : {}),
|
|
85
|
+
page: { top: limit, skip: offset },
|
|
86
|
+
});
|
|
87
|
+
// No @odata.count means no honest total, so redo it as a full scan.
|
|
88
|
+
page =
|
|
89
|
+
total === undefined
|
|
90
|
+
? paginate(await fullScan(), limit, offset, fetchAll)
|
|
91
|
+
: pageFromServer(project(items), total, offset);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
page = paginate(await fullScan(), limit, offset, fetchAll);
|
|
95
|
+
}
|
|
96
|
+
const columns = columnsOf([
|
|
97
|
+
"name",
|
|
98
|
+
{
|
|
99
|
+
header: "parameters",
|
|
100
|
+
get: (p) => "parameters" in p
|
|
101
|
+
? (p.parameters?.map((x) => x.name).join(", ") ?? "")
|
|
102
|
+
: "—",
|
|
103
|
+
},
|
|
104
|
+
]);
|
|
105
|
+
return pageResponse(page, format, { title: "Processes", columns });
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=list-processes.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TM1Error, TM1ErrorCode } from "../../types.js";
|
|
3
|
+
import { DefaultMembersBulkResultSchema } from "../schemas/items.js";
|
|
4
|
+
import { READ_ONLY } from "../annotations.js";
|
|
5
|
+
import { defineTool } from "../define-tool.js";
|
|
6
|
+
export const registerResolveDefaultMembers = defineTool({
|
|
7
|
+
name: "tm1_resolve_default_members",
|
|
8
|
+
description: [
|
|
9
|
+
"Resolve N hierarchies' effective default members in parallel from one tool call; pass items:[{dimensionName}] with a single entry for a one-off lookup.",
|
|
10
|
+
"Designed for view-construction workflows where 8+ slicer dimensions previously required dozens of sequential round-trips.",
|
|
11
|
+
"Each result carries its own source/confidence/alternatives so callers can audit per-dimension reliability.",
|
|
12
|
+
"Per-item failures surface as result entries with an `error` field instead of `resolved`; the call itself does not fail unless input is empty/invalid.",
|
|
13
|
+
],
|
|
14
|
+
annotations: READ_ONLY,
|
|
15
|
+
output: DefaultMembersBulkResultSchema,
|
|
16
|
+
input: {
|
|
17
|
+
items: z
|
|
18
|
+
.array(z.object({
|
|
19
|
+
dimensionName: z.string(),
|
|
20
|
+
hierarchyName: z.string().optional(),
|
|
21
|
+
}))
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(64)
|
|
24
|
+
.describe("List of {dimensionName, hierarchyName?} pairs. Capped at 64 per call to bound parallelism."),
|
|
25
|
+
},
|
|
26
|
+
handler: async ({ items }, tm1Client) => {
|
|
27
|
+
const settled = await Promise.allSettled(items.map((it) => tm1Client.dimensions.resolveDefaultMember(it.dimensionName, it.hierarchyName)));
|
|
28
|
+
const results = settled.map((s, i) => {
|
|
29
|
+
if (s.status === "fulfilled")
|
|
30
|
+
return s.value;
|
|
31
|
+
const err = s.reason;
|
|
32
|
+
const item = items[i]; // settled.length === items.length
|
|
33
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
34
|
+
const code = err instanceof TM1Error ? err.code : TM1ErrorCode.TM1_ERROR;
|
|
35
|
+
return {
|
|
36
|
+
dimension: item.dimensionName,
|
|
37
|
+
hierarchy: item.hierarchyName ?? item.dimensionName,
|
|
38
|
+
error: { code, message },
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
content: [{ type: "text", text: JSON.stringify({ results }) }],
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=resolve-default-members.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { READ_ONLY } from "../annotations.js";
|
|
3
|
+
import { defineTool } from "../define-tool.js";
|
|
4
|
+
import { RULES_SOURCE_SCHEMA, resolveRulesText } from "./rules-source.js";
|
|
5
|
+
export const registerCheckCubeRule = defineTool({
|
|
6
|
+
name: "tm1_check_cube_rule",
|
|
7
|
+
description: [
|
|
8
|
+
"Validate the syntax of a TM1 cube rule WITHOUT applying it.",
|
|
9
|
+
"Returns 'valid' or a list of syntax errors with line numbers.",
|
|
10
|
+
"Takes the same sources as tm1_set_cube_rules — rules, edits or filePath — and checks the full resulting text, so an edits patch is validated exactly as it would be installed. tm1_set_cube_rules runs this check itself before writing.",
|
|
11
|
+
],
|
|
12
|
+
annotations: READ_ONLY,
|
|
13
|
+
output: {
|
|
14
|
+
ok: z.boolean(),
|
|
15
|
+
cube: z.string(),
|
|
16
|
+
lineCount: z.number().int(),
|
|
17
|
+
errorCount: z.number().int(),
|
|
18
|
+
errors: z.array(z.object({
|
|
19
|
+
lineNumber: z.number().int().optional(),
|
|
20
|
+
message: z.string(),
|
|
21
|
+
})),
|
|
22
|
+
},
|
|
23
|
+
input: {
|
|
24
|
+
cubeName: z.string().describe("Cube name (case-sensitive)"),
|
|
25
|
+
...RULES_SOURCE_SCHEMA,
|
|
26
|
+
},
|
|
27
|
+
handler: async ({ cubeName, rules, edits, filePath }, tm1Client) => {
|
|
28
|
+
const { text } = await resolveRulesText(tm1Client, cubeName, {
|
|
29
|
+
rules,
|
|
30
|
+
edits,
|
|
31
|
+
filePath,
|
|
32
|
+
});
|
|
33
|
+
const errors = await tm1Client.cubes.checkRule(cubeName, text);
|
|
34
|
+
const ok = errors.length === 0;
|
|
35
|
+
const payload = {
|
|
36
|
+
ok,
|
|
37
|
+
cube: cubeName,
|
|
38
|
+
lineCount: text.split("\n").length,
|
|
39
|
+
errorCount: errors.length,
|
|
40
|
+
errors: errors.map((e) => ({
|
|
41
|
+
lineNumber: e.lineNumber,
|
|
42
|
+
message: e.message,
|
|
43
|
+
})),
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
isError: !ok || undefined,
|
|
47
|
+
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=check-cube-rule.js.map
|