@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,333 @@
|
|
|
1
|
+
// Cell domain service. Owns single-cell reads, MDX cellset execution, and
|
|
2
|
+
// cell writes via the cellset PATCH path. Cube-shape lookups (resolving
|
|
3
|
+
// dimension order for getValue) go through the request layer directly rather
|
|
4
|
+
// than CubeService to avoid a CubeService → CellService cycle later.
|
|
5
|
+
//
|
|
6
|
+
// See docs/ARCHITECTURE.md for the layering.
|
|
7
|
+
import { TM1Error, TM1ErrorCode } from "../../types.js";
|
|
8
|
+
import { escapeMdxName } from "../../lib/mdx.js";
|
|
9
|
+
import { dimensionCountMismatch } from "../../lib/coordinate-error.js";
|
|
10
|
+
import { freeCellset, transformCellsetResponse } from "./cellset-transform.js";
|
|
11
|
+
// OData key encoder: double ' per OData literal rules, then percent-encode.
|
|
12
|
+
const enc = (s) => encodeURIComponent(String(s).replace(/'/g, "''"));
|
|
13
|
+
// Build a fully-qualified MDX member reference for a write coordinate.
|
|
14
|
+
// A caller may pass a pre-qualified ref to target an ALTERNATE hierarchy
|
|
15
|
+
// (`[Dim].[AltHier].[Elem]`, or `[Dim].[Elem]` for the default) — passed
|
|
16
|
+
// through unchanged (caller owns escaping). A bare element defaults the
|
|
17
|
+
// hierarchy to the dimension name (`[Dim].[Dim].[Elem]`); every bare name
|
|
18
|
+
// component is `]`-escaped so a `]` in a name cannot mis-address the cell.
|
|
19
|
+
function qualifyWriteMember(dim, element) {
|
|
20
|
+
const d = escapeMdxName(dim);
|
|
21
|
+
if (element.startsWith("[") && element.includes("].["))
|
|
22
|
+
return element;
|
|
23
|
+
if (element.startsWith("[") && element.endsWith("]"))
|
|
24
|
+
return `[${d}].[${d}].${element}`;
|
|
25
|
+
return `[${d}].[${d}].[${escapeMdxName(element)}]`;
|
|
26
|
+
}
|
|
27
|
+
export class CellService {
|
|
28
|
+
http;
|
|
29
|
+
constructor(http) {
|
|
30
|
+
this.http = http;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a single cell value via a 1-tuple MDX query.
|
|
34
|
+
*
|
|
35
|
+
* TM1 11.8 returns 0 cells for `SELECT {} ON COLUMNS WHERE (...)` — the
|
|
36
|
+
* empty axis collapses the cellset. Put the first element on COLUMNS and
|
|
37
|
+
* the rest in WHERE to force a 1-cell cellset. Each element is qualified
|
|
38
|
+
* with its dimension to avoid name collisions in control cubes.
|
|
39
|
+
*/
|
|
40
|
+
async getValue(cubeName, elements) {
|
|
41
|
+
if (elements.length === 0) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
const cubePath = `/api/v1/Cubes('${enc(cubeName)}')?$expand=Dimensions($select=Name)`;
|
|
45
|
+
const cubeMeta = await this.http.request("GET", cubePath);
|
|
46
|
+
const dims = cubeMeta.Dimensions.map((d) => d.Name);
|
|
47
|
+
if (elements.length !== dims.length) {
|
|
48
|
+
throw dimensionCountMismatch(cubeName, dims, elements);
|
|
49
|
+
}
|
|
50
|
+
const qualify = (dim, element) => {
|
|
51
|
+
const d = escapeMdxName(dim);
|
|
52
|
+
// Pre-qualified MDX member reference — pass through (caller owns escaping).
|
|
53
|
+
if (element.startsWith("[") && element.includes("].["))
|
|
54
|
+
return element;
|
|
55
|
+
// Single bracketed member like `[Foo]` — prepend dimension.
|
|
56
|
+
if (element.startsWith("[") && element.endsWith("]"))
|
|
57
|
+
return `[${d}].${element}`;
|
|
58
|
+
return `[${d}].[${escapeMdxName(element)}]`;
|
|
59
|
+
};
|
|
60
|
+
const qualified = dims.map((d, i) => qualify(d, elements[i]));
|
|
61
|
+
const cube = escapeMdxName(cubeName);
|
|
62
|
+
const colMember = qualified[0];
|
|
63
|
+
const whereParts = qualified.slice(1);
|
|
64
|
+
const mdx = whereParts.length === 0
|
|
65
|
+
? `SELECT {${colMember}} ON COLUMNS FROM [${cube}]`
|
|
66
|
+
: `SELECT {${colMember}} ON COLUMNS FROM [${cube}] WHERE (${whereParts.join(",")})`;
|
|
67
|
+
const cellsetResponse = await this.http.request("POST", "/api/v1/ExecuteMDX?$expand=Cells($select=Value,FormattedValue)", { MDX: mdx });
|
|
68
|
+
try {
|
|
69
|
+
if (cellsetResponse.Cells && cellsetResponse.Cells.length > 0) {
|
|
70
|
+
return cellsetResponse.Cells[0].Value;
|
|
71
|
+
}
|
|
72
|
+
// The MDX selects exactly one member, so a resolvable coordinate always
|
|
73
|
+
// yields one cell — an empty one comes back as a cell with a null Value.
|
|
74
|
+
// No cell at all means a member did not resolve. v11 refuses that MDX
|
|
75
|
+
// outright ("member not found (rte 81)"); v12 answers 200 with an empty
|
|
76
|
+
// cellset, and returning null there reported "this cell is empty" for a
|
|
77
|
+
// coordinate that does not exist. Both versions now fail the same way.
|
|
78
|
+
throw new TM1Error({
|
|
79
|
+
code: TM1ErrorCode.NOT_FOUND,
|
|
80
|
+
message: `No cell resolved for cube '${cubeName}' at (${elements.join(", ")}). At least one element name does not exist in its dimension — check spelling and case with tm1_get_descendants or tm1_list_element_attributes.`,
|
|
81
|
+
endpoint: "/api/v1/ExecuteMDX",
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
// Free the session-scoped cellset best-effort so single-value reads don't
|
|
86
|
+
// leak TM1 server memory while keep-alive holds the session open.
|
|
87
|
+
await freeCellset(this.http, cellsetResponse.ID);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Execute an MDX query and return structured cells + axes. Supports
|
|
92
|
+
* pagination via top/skip on the Cells expand. opts.timeoutMs overrides the
|
|
93
|
+
* 30s default for heavy queries.
|
|
94
|
+
* POST /api/v1/ExecuteMDX
|
|
95
|
+
*/
|
|
96
|
+
async executeMdx(mdx, top, skip, opts) {
|
|
97
|
+
let cellsExpand = "Cells($select=Value,FormattedValue";
|
|
98
|
+
if (top !== undefined) {
|
|
99
|
+
cellsExpand += `;$top=${top}`;
|
|
100
|
+
}
|
|
101
|
+
if (skip !== undefined) {
|
|
102
|
+
cellsExpand += `;$skip=${skip}`;
|
|
103
|
+
}
|
|
104
|
+
cellsExpand += ")";
|
|
105
|
+
const axesExpand = "Axes($expand=Tuples($expand=Members($select=Name;$expand=Hierarchy($select=Name))))";
|
|
106
|
+
const path = `/api/v1/ExecuteMDX?$expand=${cellsExpand},${axesExpand}`;
|
|
107
|
+
const response = await this.http.request("POST", path, { MDX: mdx }, opts);
|
|
108
|
+
try {
|
|
109
|
+
return transformCellsetResponse(response);
|
|
110
|
+
}
|
|
111
|
+
finally {
|
|
112
|
+
// Cellsets are session-scoped and never auto-expire while keep-alive holds
|
|
113
|
+
// the session open, so a read that leaves them behind leaks TM1 server
|
|
114
|
+
// memory indefinitely. Free it best-effort (mirrors TM1py's delete_cellset).
|
|
115
|
+
await freeCellset(this.http, response.ID, opts);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Write multiple cells via the cellset PATCH path.
|
|
120
|
+
*
|
|
121
|
+
* TM1 11.8's Cube /tm1.Update action rejects every documented payload
|
|
122
|
+
* variant ("Invalid CellDescriptor property" / "Unexpected entity reference
|
|
123
|
+
* type" / "Expecting Object or EntityBind"). The cellset PATCH path is the
|
|
124
|
+
* supported route in 11.8:
|
|
125
|
+
* 1. POST /api/v1/ExecuteMDX with a slice MDX over the target cell
|
|
126
|
+
* 2. PATCH /api/v1/Cellsets('{id}')/Cells(0) with {Value}
|
|
127
|
+
* 3. DELETE /api/v1/Cellsets('{id}')
|
|
128
|
+
*
|
|
129
|
+
* Values can be numeric (for N-cubes) or strings (for string cells). Writes
|
|
130
|
+
* to consolidated cells are rejected by TM1.
|
|
131
|
+
*
|
|
132
|
+
* Prefer TI processes for reproducible data loads. Use this REST path only
|
|
133
|
+
* for ad-hoc / debugging writes.
|
|
134
|
+
*/
|
|
135
|
+
async writeCells(cubeName, dimensions, cells) {
|
|
136
|
+
if (cells.length === 0)
|
|
137
|
+
return;
|
|
138
|
+
for (const c of cells) {
|
|
139
|
+
if (c.elements.length !== dimensions.length) {
|
|
140
|
+
throw dimensionCountMismatch(cubeName, dimensions, c.elements);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const cube = escapeMdxName(cubeName);
|
|
144
|
+
const tupleOf = (c) => {
|
|
145
|
+
const refs = c.elements.map((e, idx) => qualifyWriteMember(dimensions[idx], e));
|
|
146
|
+
return refs.length === 1 ? refs[0] : `(${refs.join(",")})`;
|
|
147
|
+
};
|
|
148
|
+
// One cell at a time cost three requests each — cellset, PATCH, delete —
|
|
149
|
+
// which measured 120 requests for 40 cells. TM1py (and tm1npm, which ports
|
|
150
|
+
// it) build ONE cellset over every target coordinate and PATCH the whole
|
|
151
|
+
// cell array once; verified against 11.8 at 40 cells in 3 requests, 9 ms.
|
|
152
|
+
//
|
|
153
|
+
// The array goes out BARE. `{Cells: [...]}` — what tm1npm sends — is
|
|
154
|
+
// refused with "Invalid CellsetCell property encountered in payload".
|
|
155
|
+
//
|
|
156
|
+
// Ordinals are positional, and TM1 does not collapse a repeated tuple in a
|
|
157
|
+
// set (verified), so cells[i] stays ordinal i even when a caller sends the
|
|
158
|
+
// same coordinate twice.
|
|
159
|
+
const writeOne = async (c) => {
|
|
160
|
+
const mdx = `SELECT {${tupleOf(c)}} ON COLUMNS FROM [${cube}]`;
|
|
161
|
+
const cellset = await this.http.request("POST", "/api/v1/ExecuteMDX", { MDX: mdx });
|
|
162
|
+
const id = cellset.ID;
|
|
163
|
+
try {
|
|
164
|
+
await this.http.request("PATCH", `/api/v1/Cellsets('${enc(id)}')/Cells(0)`, { Value: c.value });
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
try {
|
|
168
|
+
await this.http.request("DELETE", `/api/v1/Cellsets('${enc(id)}')`);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// cleanup best-effort
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
// Chunked because the MDX carries one tuple per cell: 2000 tuples measured
|
|
176
|
+
// at 194 KB and 90 ms, so this stays far inside what the server and any
|
|
177
|
+
// proxy in front of it accept.
|
|
178
|
+
const CHUNK = 500;
|
|
179
|
+
let written = 0;
|
|
180
|
+
for (let i = 0; i < cells.length; i += CHUNK) {
|
|
181
|
+
const chunk = cells.slice(i, i + CHUNK);
|
|
182
|
+
const mdx = `SELECT {${chunk.map(tupleOf).join(",")}} ON COLUMNS FROM [${cube}]`;
|
|
183
|
+
let bulkFailed = false;
|
|
184
|
+
const cellset = await this.http.request("POST", "/api/v1/ExecuteMDX", { MDX: mdx });
|
|
185
|
+
try {
|
|
186
|
+
await this.http.request("PATCH", `/api/v1/Cellsets('${enc(cellset.ID)}')/Cells`, chunk.map((c, ordinal) => ({ Ordinal: ordinal, Value: c.value })));
|
|
187
|
+
written += chunk.length;
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// A chunk holding one non-writable cell is refused WHOLE — nothing
|
|
191
|
+
// lands, not even the writable cells (measured:
|
|
192
|
+
// CubeCellWriteStatusElementIsConsolidated). The error names the
|
|
193
|
+
// status, never the coordinate, so the only way to tell the caller
|
|
194
|
+
// WHICH cell was refused is to re-walk this chunk one cell at a time.
|
|
195
|
+
// That is the old cost, paid only on the failing path.
|
|
196
|
+
bulkFailed = true;
|
|
197
|
+
}
|
|
198
|
+
finally {
|
|
199
|
+
try {
|
|
200
|
+
await this.http.request("DELETE", `/api/v1/Cellsets('${enc(cellset.ID)}')`);
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// cleanup best-effort
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (!bulkFailed)
|
|
207
|
+
continue;
|
|
208
|
+
const results = await Promise.allSettled(chunk.map(writeOne));
|
|
209
|
+
const failed = [];
|
|
210
|
+
results.forEach((r, j) => {
|
|
211
|
+
if (r.status === "fulfilled") {
|
|
212
|
+
written++;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
failed.push({
|
|
216
|
+
elements: chunk[j].elements,
|
|
217
|
+
error: r.reason instanceof Error ? r.reason.message : String(r.reason),
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
if (failed.length > 0) {
|
|
222
|
+
const notAttempted = cells.length - (i + chunk.length);
|
|
223
|
+
throw new TM1Error({
|
|
224
|
+
code: TM1ErrorCode.TM1_ERROR,
|
|
225
|
+
message: `write_cells partially applied to '${cubeName}': ${written} written, ` +
|
|
226
|
+
`${failed.length} failed, ${notAttempted} not attempted. ` +
|
|
227
|
+
`Earlier writes are committed and will NOT be rolled back.`,
|
|
228
|
+
details: JSON.stringify({ written, failed, notAttempted }),
|
|
229
|
+
hint: "Inspect `details` for the failed coordinates. Successful cells are already committed — " +
|
|
230
|
+
"retry ONLY the failed + notAttempted coords (re-sending written cells is harmless but wasteful). " +
|
|
231
|
+
"Validate targets first with tm1_check_writable_coords.",
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Resolve the cube's dimension order and build Tuple@odata.bind paths for
|
|
238
|
+
* the cell-bound trace actions. Elements address the default hierarchy
|
|
239
|
+
* (same name as the dimension) — alternate hierarchies are not supported
|
|
240
|
+
* by these diagnostics tools.
|
|
241
|
+
*/
|
|
242
|
+
async tupleBinds(cubeName, elements) {
|
|
243
|
+
const cubeMeta = await this.http.request("GET", `/api/v1/Cubes('${enc(cubeName)}')?$expand=Dimensions($select=Name)`);
|
|
244
|
+
const dims = cubeMeta.Dimensions.map((d) => d.Name);
|
|
245
|
+
if (elements.length !== dims.length) {
|
|
246
|
+
throw new TM1Error({
|
|
247
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
248
|
+
message: `Cube '${cubeName}' has ${dims.length} dimension(s) (${dims.join(", ")}) but ${elements.length} element(s) were given`,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
return dims.map((d, i) => `Dimensions('${enc(d)}')/Hierarchies('${enc(d)}')/Elements('${enc(elements[i])}')`);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Check the feeders of a cell: returns the cells fed by this cell with a
|
|
255
|
+
* Fed flag per target — Fed=false marks a broken/missing feeder. v11 only.
|
|
256
|
+
* POST /api/v1/Cubes('{cube}')/tm1.CheckFeeders
|
|
257
|
+
*/
|
|
258
|
+
async checkFeeders(cubeName, elements, opts) {
|
|
259
|
+
const binds = await this.tupleBinds(cubeName, elements);
|
|
260
|
+
const response = await this.http.request("POST", `/api/v1/Cubes('${enc(cubeName)}')/tm1.CheckFeeders?$expand=Cube($select=Name),Tuple($select=Name)`, { "Tuple@odata.bind": binds }, opts);
|
|
261
|
+
return (response.value ?? []).map(mapFedCell);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Trace the feeders of a cell: returns the cells this cell feeds plus the
|
|
265
|
+
* feeder statements involved. v11 only.
|
|
266
|
+
* POST /api/v1/Cubes('{cube}')/tm1.TraceFeeders
|
|
267
|
+
*/
|
|
268
|
+
async traceFeeders(cubeName, elements, opts) {
|
|
269
|
+
const binds = await this.tupleBinds(cubeName, elements);
|
|
270
|
+
const response = await this.http.request("POST", `/api/v1/Cubes('${enc(cubeName)}')/tm1.TraceFeeders?$expand=FedCells/Cube($select=Name),FedCells/Tuple($select=Name)`, { "Tuple@odata.bind": binds }, opts);
|
|
271
|
+
return {
|
|
272
|
+
fedCells: (response.FedCells ?? []).map(mapFedCell),
|
|
273
|
+
statements: response.Statements ?? [],
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Trace how a cell value is calculated: recursive component tree with
|
|
278
|
+
* per-component type (consolidation/rule), status, value, and rule
|
|
279
|
+
* statements. The server returns the full tree; maxDepth/maxComponents
|
|
280
|
+
* truncate client-side to keep responses bounded. v11 only.
|
|
281
|
+
* POST /api/v1/Cubes('{cube}')/tm1.TraceCellCalculation
|
|
282
|
+
*/
|
|
283
|
+
async traceCellCalculation(cubeName, elements, maxDepth = 3, maxComponents = 20, opts) {
|
|
284
|
+
const binds = await this.tupleBinds(cubeName, elements);
|
|
285
|
+
// Components is a complex-type collection — nested nav-prop expand uses
|
|
286
|
+
// the path form (Components/Tuple); ($levels=...) is rejected by 11.8.
|
|
287
|
+
// Each path segment covers exactly one tree level, so emit one
|
|
288
|
+
// Components/.../{Tuple,Cube} pair per requested depth — without them,
|
|
289
|
+
// deeper nodes carry values but no coordinates (and no cube for
|
|
290
|
+
// cross-cube DB() components), making drill-down impossible.
|
|
291
|
+
const expandParts = ["Tuple($select=Name)"];
|
|
292
|
+
for (let level = 1; level <= maxDepth; level++) {
|
|
293
|
+
const prefix = "Components/".repeat(level);
|
|
294
|
+
expandParts.push(`${prefix}Tuple($select=Name)`, `${prefix}Cube($select=Name)`);
|
|
295
|
+
}
|
|
296
|
+
const response = await this.http.request("POST", `/api/v1/Cubes('${enc(cubeName)}')/tm1.TraceCellCalculation?$expand=${expandParts.join(",")}`, { "Tuple@odata.bind": binds }, opts);
|
|
297
|
+
return mapCalcComponent(response, maxDepth, maxComponents);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function mapFedCell(raw) {
|
|
301
|
+
return {
|
|
302
|
+
cube: raw.Cube?.Name ?? "",
|
|
303
|
+
tuple: (raw.Tuple ?? []).map((t) => t.Name ?? ""),
|
|
304
|
+
fed: raw.Fed === true,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function mapCalcComponent(raw, depthLeft, maxComponents) {
|
|
308
|
+
const node = { value: raw.Value ?? null };
|
|
309
|
+
if (raw.Type !== undefined)
|
|
310
|
+
node.type = raw.Type;
|
|
311
|
+
if (raw.Status !== undefined)
|
|
312
|
+
node.status = raw.Status;
|
|
313
|
+
if (raw.Cube?.Name !== undefined)
|
|
314
|
+
node.cube = raw.Cube.Name;
|
|
315
|
+
if (raw.Tuple !== undefined)
|
|
316
|
+
node.tuple = raw.Tuple.map((t) => t.Name ?? "");
|
|
317
|
+
if (raw.Statements !== undefined && raw.Statements.length > 0)
|
|
318
|
+
node.statements = raw.Statements;
|
|
319
|
+
const children = raw.Components ?? [];
|
|
320
|
+
if (children.length > 0) {
|
|
321
|
+
if (depthLeft <= 0) {
|
|
322
|
+
node.truncated = true;
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
const kept = children.slice(0, maxComponents);
|
|
326
|
+
node.components = kept.map((c) => mapCalcComponent(c, depthLeft - 1, maxComponents));
|
|
327
|
+
if (children.length > maxComponents)
|
|
328
|
+
node.truncated = true;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return node;
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=cell-service.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CellValue, MdxAxis, MdxResult } from "../../types.js";
|
|
2
|
+
import type { RequestOptions, TM1HttpClient } from "../http.js";
|
|
3
|
+
export declare function freeCellset(http: TM1HttpClient, id: string | undefined, opts?: RequestOptions): Promise<void>;
|
|
4
|
+
interface RawCellsetResponse {
|
|
5
|
+
Cells: Array<{
|
|
6
|
+
Value: CellValue;
|
|
7
|
+
FormattedValue: string;
|
|
8
|
+
}>;
|
|
9
|
+
Axes: Array<{
|
|
10
|
+
Tuples: Array<{
|
|
11
|
+
Members: Array<{
|
|
12
|
+
Name: string;
|
|
13
|
+
Hierarchy: {
|
|
14
|
+
Name: string;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export declare function clipAxesToWindow(axes: MdxAxis[], cellCount: number, skip: number): {
|
|
21
|
+
axes: MdxAxis[];
|
|
22
|
+
clipped: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function transformCellsetResponse(response: RawCellsetResponse): MdxResult;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=cellset-transform.d.ts.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// TM1 escaping: `]` inside a bracketed identifier is doubled. Cellset IDs are
|
|
2
|
+
// server-generated GUIDs so this is defensive, but keeps the pattern uniform.
|
|
3
|
+
function encId(id) {
|
|
4
|
+
return id.replace(/]/g, "]]");
|
|
5
|
+
}
|
|
6
|
+
// Best-effort DELETE of a read-path cellset. Cellsets are session-scoped and
|
|
7
|
+
// never auto-expire while keep-alive holds the session open, so a read that
|
|
8
|
+
// leaves one behind leaks TM1 server memory indefinitely (mirrors TM1py's
|
|
9
|
+
// delete_cellset). Never throws: cleanup failure must not turn a successful
|
|
10
|
+
// read into an error.
|
|
11
|
+
export async function freeCellset(http, id, opts) {
|
|
12
|
+
if (!id)
|
|
13
|
+
return;
|
|
14
|
+
try {
|
|
15
|
+
await http.request("DELETE", `/api/v1/Cellsets('${encId(id)}')`, undefined, opts);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// cleanup best-effort
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Clip each axis to just the tuples the returned cell window actually
|
|
22
|
+
// addresses, so a paginated read over a huge view doesn't ship the whole
|
|
23
|
+
// (e.g. 200k-row) tuple list alongside its capped cells.
|
|
24
|
+
//
|
|
25
|
+
// TM1 orders cells so axis 0 varies fastest: cell ordinal `ord` decomposes as
|
|
26
|
+
// idx_k = floor(ord / stride_k) mod L_k, stride_0 = 1, stride_k = product of
|
|
27
|
+
// lower axis lengths. The returned cells span the contiguous ordinal range
|
|
28
|
+
// [skip, skip+count). An axis is safe to shrink to `maxIdx+1` tuples ONLY when
|
|
29
|
+
// its quotient never wraps past its length within that range
|
|
30
|
+
// (qmax = floor(maxOrd/stride) < L) — that holds exactly for the slowest
|
|
31
|
+
// partially-referenced axis and every axis above it, never for a fully-cycled
|
|
32
|
+
// fast axis whose stride the higher axes decode through. Because those fast
|
|
33
|
+
// axes stay at full length, stride_k is preserved for every clipped axis and
|
|
34
|
+
// the consumer's positional decode (offset+i over the returned tuple counts)
|
|
35
|
+
// stays valid; axes above the pivot collapse to a single tuple (idx always 0,
|
|
36
|
+
// decoded via `mod 1`). totalCellCount is computed from the FULL axes, so the
|
|
37
|
+
// caller still sees the true cell total.
|
|
38
|
+
export function clipAxesToWindow(axes, cellCount, skip) {
|
|
39
|
+
if (axes.length === 0 || cellCount === 0)
|
|
40
|
+
return { axes, clipped: false };
|
|
41
|
+
const maxOrd = skip + cellCount - 1;
|
|
42
|
+
let stride = 1;
|
|
43
|
+
let clipped = false;
|
|
44
|
+
const out = axes.map((axis) => {
|
|
45
|
+
const len = axis.tuples.length;
|
|
46
|
+
const qmax = len > 0 ? Math.floor(maxOrd / stride) : 0;
|
|
47
|
+
stride *= len; // next axis's stride uses this axis's ORIGINAL length
|
|
48
|
+
if (len > 0 && qmax < len) {
|
|
49
|
+
const keep = qmax + 1;
|
|
50
|
+
if (keep < len) {
|
|
51
|
+
clipped = true;
|
|
52
|
+
return { tuples: axis.tuples.slice(0, keep) };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return axis;
|
|
56
|
+
});
|
|
57
|
+
return { axes: out, clipped };
|
|
58
|
+
}
|
|
59
|
+
export function transformCellsetResponse(response) {
|
|
60
|
+
const cells = (response.Cells ?? []).map((c) => ({
|
|
61
|
+
value: c.Value,
|
|
62
|
+
formattedValue: c.FormattedValue,
|
|
63
|
+
}));
|
|
64
|
+
const axes = (response.Axes ?? []).map((axis) => ({
|
|
65
|
+
tuples: axis.Tuples.map((tuple) => ({
|
|
66
|
+
members: tuple.Members.map((m) => ({
|
|
67
|
+
name: m.Name,
|
|
68
|
+
hierarchyName: m.Hierarchy.Name,
|
|
69
|
+
})),
|
|
70
|
+
})),
|
|
71
|
+
}));
|
|
72
|
+
// totalCellCount: product of tuple counts across all axes, or cell count if
|
|
73
|
+
// no axes. Always the FULL count; axis clipping (clipAxesToWindow) is applied
|
|
74
|
+
// by the paginating tool layer, which keeps totalCellCount intact.
|
|
75
|
+
const totalCellCount = axes.length > 0
|
|
76
|
+
? axes.reduce((acc, axis) => acc * axis.tuples.length, 1)
|
|
77
|
+
: cells.length;
|
|
78
|
+
return { cells, axes, totalCellCount };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=cellset-transform.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Chore, ChoreCreate, ChoreResult } from "../../types.js";
|
|
2
|
+
import type { RequestOptions, TM1HttpClient } from "../http.js";
|
|
3
|
+
export declare class ChoreService {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: TM1HttpClient);
|
|
6
|
+
/**
|
|
7
|
+
* Connection-scoped verdict on `tm1.ExecuteWithReturn` for chores: null until
|
|
8
|
+
* the first run has told us, then sticky. Only ever set to false by the
|
|
9
|
+
* proof described in `execute()` — never by a version guess.
|
|
10
|
+
*/
|
|
11
|
+
private withReturnSupported;
|
|
12
|
+
/**
|
|
13
|
+
* List all chores with their tasks (process + parameters per step).
|
|
14
|
+
* GET /api/v1/Chores?$expand=Tasks($expand=Process($select=Name))
|
|
15
|
+
*/
|
|
16
|
+
list(): Promise<Chore[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Activate or deactivate a chore.
|
|
19
|
+
* PATCH /api/v1/Chores('{name}') with { Active: bool }
|
|
20
|
+
*/
|
|
21
|
+
toggleActive(choreName: string, active: boolean): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Execute a chore immediately (bypass its schedule), and report how it ended.
|
|
24
|
+
* opts.timeoutMs overrides the 30s default for chores that run long TI chains.
|
|
25
|
+
*
|
|
26
|
+
* Both actions here are SYNCHRONOUS — the POST returns when the chore is
|
|
27
|
+
* done, which is why the tool exposes a timeout ceiling of an hour. Using
|
|
28
|
+
* `tm1.ExecuteWithReturn` therefore costs no extra waiting; it only stops us
|
|
29
|
+
* throwing the status away.
|
|
30
|
+
*
|
|
31
|
+
* POST /api/v1/Chores('{name}')/tm1.ExecuteWithReturn?$expand=ErrorLogFile
|
|
32
|
+
* — v12 12.5.0 and up. `$expand` is REQUIRED: ErrorLogFile is a navigation
|
|
33
|
+
* property on ChoreExecuteResult, so without it the filename is silently
|
|
34
|
+
* absent (the same trap as ProcessService.execute).
|
|
35
|
+
* POST /api/v1/Chores('{name}')/tm1.Execute
|
|
36
|
+
* — everywhere else. Returns 204, so no status exists to report.
|
|
37
|
+
*/
|
|
38
|
+
execute(choreName: string, opts?: RequestOptions): Promise<ChoreResult>;
|
|
39
|
+
/**
|
|
40
|
+
* The statusless path: run the chore, report that nothing is known about how
|
|
41
|
+
* it ended. Deliberately NOT `{success: true}` — that claim is what this
|
|
42
|
+
* whole change exists to remove.
|
|
43
|
+
*/
|
|
44
|
+
private executeWithoutStatus;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new chore.
|
|
47
|
+
* POST /api/v1/Chores
|
|
48
|
+
*/
|
|
49
|
+
create(chore: ChoreCreate): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Update an existing chore (partial update).
|
|
52
|
+
* PATCH /api/v1/Chores('{name}')
|
|
53
|
+
*/
|
|
54
|
+
update(choreName: string, updates: {
|
|
55
|
+
startTime?: string | undefined;
|
|
56
|
+
active?: boolean | undefined;
|
|
57
|
+
dstSensitive?: boolean | undefined;
|
|
58
|
+
executionMode?: "SingleCommit" | "MultipleCommit" | undefined;
|
|
59
|
+
frequency?: ChoreCreate["frequency"] | undefined;
|
|
60
|
+
steps?: ChoreCreate["steps"] | undefined;
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Delete a chore.
|
|
64
|
+
* DELETE /api/v1/Chores('{name}')
|
|
65
|
+
*/
|
|
66
|
+
delete(choreName: string): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=chore-service.d.ts.map
|