@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,48 @@
|
|
|
1
|
+
import type { MdxResult, CellValue } from "../types.js";
|
|
2
|
+
export type SampleCellFilter = string | string[];
|
|
3
|
+
export interface SampleCellsBuildArgs {
|
|
4
|
+
cubeName: string;
|
|
5
|
+
/** Cube dimension names in declaration order (used for crossjoin layout). */
|
|
6
|
+
dimensions: string[];
|
|
7
|
+
/** Max rows after NON EMPTY. 0 = no HEAD (full result). */
|
|
8
|
+
maxCells: number;
|
|
9
|
+
/** Per-dimension filters: single string → WHERE; array → axis member set. */
|
|
10
|
+
filters?: Record<string, SampleCellFilter> | undefined;
|
|
11
|
+
/** Dimension placed on COLUMNS. Default: last cube dimension. */
|
|
12
|
+
axisDimension?: string | undefined;
|
|
13
|
+
/** If true, restrict unfiltered dims to leaf members (level 0). */
|
|
14
|
+
leavesOnly: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If true, sample string-valued cells: drop the NON EMPTY numeric suppression
|
|
17
|
+
* in favour of a `<> ""` FILTER, and include consolidations on unfiltered dims
|
|
18
|
+
* (overrides leavesOnly) because string values do not consolidate and may sit
|
|
19
|
+
* directly on C elements. Requires the column/measure to resolve to a single
|
|
20
|
+
* element. Default false (numeric NON EMPTY behaviour).
|
|
21
|
+
*/
|
|
22
|
+
includeStrings?: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface SampleCellsBuildResult {
|
|
25
|
+
mdx: string;
|
|
26
|
+
/** Dimensions pinned via WHERE (single-string filters). */
|
|
27
|
+
whereDims: string[];
|
|
28
|
+
/** Dimensions on the ROW crossjoin axis. */
|
|
29
|
+
rowDims: string[];
|
|
30
|
+
/** Dimension placed on COLUMNS. */
|
|
31
|
+
columnDim: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SampleCell {
|
|
34
|
+
coordinates: Record<string, string>;
|
|
35
|
+
value: CellValue;
|
|
36
|
+
formattedValue: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function buildSampleCellsMdx(args: SampleCellsBuildArgs): SampleCellsBuildResult;
|
|
39
|
+
export interface TransformArgs {
|
|
40
|
+
result: MdxResult;
|
|
41
|
+
whereCoords: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Convert flat MdxResult cells into self-describing {coordinates,value,formattedValue}.
|
|
45
|
+
* Assumes axes[0] = COLUMNS, axes[1] = ROWS (TM1 default ordering).
|
|
46
|
+
*/
|
|
47
|
+
export declare function transformSampleCells(args: TransformArgs): SampleCell[];
|
|
48
|
+
//# sourceMappingURL=sample-cells.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Pure helpers for tm1_sample_cells: MDX construction and cellset transformation.
|
|
2
|
+
// No I/O — kept pure for unit-testability.
|
|
3
|
+
import { TM1Error, TM1ErrorCode } from "../types.js";
|
|
4
|
+
import { escapeMdxName } from "./mdx.js";
|
|
5
|
+
const memberRef = (dim, elem) => {
|
|
6
|
+
// Pre-qualified pass-through (e.g. caller passes "[Dim].[Elem]").
|
|
7
|
+
if (elem.startsWith("[") && elem.includes("].["))
|
|
8
|
+
return elem;
|
|
9
|
+
return `[${escapeMdxName(dim)}].[${escapeMdxName(elem)}]`;
|
|
10
|
+
};
|
|
11
|
+
export function buildSampleCellsMdx(args) {
|
|
12
|
+
const { cubeName, dimensions, maxCells, filters = {}, leavesOnly, includeStrings = false, } = args;
|
|
13
|
+
if (dimensions.length === 0) {
|
|
14
|
+
throw new TM1Error({
|
|
15
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
16
|
+
message: `Cube '${cubeName}' has no dimensions`,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
// dimensions.length === 0 is guarded above; the fallback is always defined.
|
|
20
|
+
const columnDim = args.axisDimension ?? dimensions[dimensions.length - 1];
|
|
21
|
+
if (!dimensions.includes(columnDim)) {
|
|
22
|
+
throw new TM1Error({
|
|
23
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
24
|
+
message: `axisDimension '${columnDim}' is not a dimension of cube '${cubeName}' (dims: ${dimensions.join(", ")})`,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
for (const key of Object.keys(filters)) {
|
|
28
|
+
if (!dimensions.includes(key)) {
|
|
29
|
+
throw new TM1Error({
|
|
30
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
31
|
+
message: `Filter dimension '${key}' is not a dimension of cube '${cubeName}' (dims: ${dimensions.join(", ")})`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const whereDims = [];
|
|
36
|
+
const whereParts = [];
|
|
37
|
+
const rowDims = [];
|
|
38
|
+
const rowSets = [];
|
|
39
|
+
for (const dim of dimensions) {
|
|
40
|
+
if (dim === columnDim)
|
|
41
|
+
continue;
|
|
42
|
+
const f = filters[dim];
|
|
43
|
+
if (typeof f === "string") {
|
|
44
|
+
whereDims.push(dim);
|
|
45
|
+
whereParts.push(memberRef(dim, f));
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (Array.isArray(f) && f.length > 0) {
|
|
49
|
+
rowDims.push(dim);
|
|
50
|
+
rowSets.push(`{${f.map((e) => memberRef(dim, e)).join(",")}}`);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
rowDims.push(dim);
|
|
54
|
+
// String values can sit on consolidations and do not roll up, so includeStrings
|
|
55
|
+
// must scan all members (incl. C), overriding the leaf-only restriction.
|
|
56
|
+
rowSets.push(leavesOnly && !includeStrings
|
|
57
|
+
? `TM1FILTERBYLEVEL({TM1SUBSETALL([${escapeMdxName(dim)}])},0)`
|
|
58
|
+
: `{TM1SUBSETALL([${escapeMdxName(dim)}])}`);
|
|
59
|
+
}
|
|
60
|
+
const colFilter = filters[columnDim];
|
|
61
|
+
let columnMembers;
|
|
62
|
+
if (typeof colFilter === "string") {
|
|
63
|
+
columnMembers = [memberRef(columnDim, colFilter)];
|
|
64
|
+
}
|
|
65
|
+
else if (Array.isArray(colFilter) && colFilter.length > 0) {
|
|
66
|
+
columnMembers = colFilter.map((e) => memberRef(columnDim, e));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
columnMembers = [`[${escapeMdxName(columnDim)}].DefaultMember`];
|
|
70
|
+
}
|
|
71
|
+
const columnSet = `{${columnMembers.join(",")}}`;
|
|
72
|
+
let rowExpr;
|
|
73
|
+
if (rowSets.length === 0) {
|
|
74
|
+
rowExpr = `{[${escapeMdxName(columnDim)}].DefaultMember}`;
|
|
75
|
+
}
|
|
76
|
+
else if (rowSets.length === 1) {
|
|
77
|
+
rowExpr = rowSets[0];
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
rowExpr = rowSets.reduce((acc, s) => `CROSSJOIN(${acc},${s})`);
|
|
81
|
+
}
|
|
82
|
+
let rowAxisExpr;
|
|
83
|
+
if (includeStrings) {
|
|
84
|
+
// NON EMPTY suppression can hide string cells on some TM1 versions, and never
|
|
85
|
+
// surfaces strings on consolidations. Filter on a non-blank string value
|
|
86
|
+
// instead. Needs a single measure cell to reference.
|
|
87
|
+
if (columnMembers.length !== 1) {
|
|
88
|
+
throw new TM1Error({
|
|
89
|
+
code: TM1ErrorCode.VALIDATION_ERROR,
|
|
90
|
+
message: `includeStrings requires the column/measure to resolve to a single element; ` +
|
|
91
|
+
`pin it via filters['${columnDim}']='<element>' or axisDimension (got ${columnMembers.length} members).`,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const filterExpr = `FILTER(${rowExpr},[${escapeMdxName(cubeName)}].(${columnMembers[0]})<>"")`;
|
|
95
|
+
rowAxisExpr = maxCells > 0 ? `HEAD(${filterExpr},${maxCells})` : filterExpr;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// TM1's NONEMPTY(set, filterSet) is a set function. Plain "NON EMPTY <set>"
|
|
99
|
+
// is an axis modifier and is rejected as a syntax error inside HEAD().
|
|
100
|
+
const nonEmptyExpr = `NONEMPTY(${rowExpr},${columnSet})`;
|
|
101
|
+
rowAxisExpr =
|
|
102
|
+
maxCells > 0 ? `HEAD(${nonEmptyExpr},${maxCells})` : nonEmptyExpr;
|
|
103
|
+
}
|
|
104
|
+
const whereClause = whereParts.length > 0 ? ` WHERE (${whereParts.join(",")})` : "";
|
|
105
|
+
const mdx = `SELECT ${columnSet} ON COLUMNS, ${rowAxisExpr} ON ROWS FROM [${escapeMdxName(cubeName)}]${whereClause}`;
|
|
106
|
+
return { mdx, whereDims, rowDims, columnDim };
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Convert flat MdxResult cells into self-describing {coordinates,value,formattedValue}.
|
|
110
|
+
* Assumes axes[0] = COLUMNS, axes[1] = ROWS (TM1 default ordering).
|
|
111
|
+
*/
|
|
112
|
+
export function transformSampleCells(args) {
|
|
113
|
+
const { result, whereCoords } = args;
|
|
114
|
+
const axes = result.axes;
|
|
115
|
+
if (axes.length === 0)
|
|
116
|
+
return [];
|
|
117
|
+
const colAxis = axes[0];
|
|
118
|
+
const rowAxis = axes[1] ?? { tuples: [{ members: [] }] };
|
|
119
|
+
const colCount = colAxis.tuples.length;
|
|
120
|
+
if (colCount === 0)
|
|
121
|
+
return [];
|
|
122
|
+
const out = [];
|
|
123
|
+
for (let i = 0; i < result.cells.length; i++) {
|
|
124
|
+
const colIdx = i % colCount;
|
|
125
|
+
const rowIdx = Math.floor(i / colCount);
|
|
126
|
+
const colTuple = colAxis.tuples[colIdx];
|
|
127
|
+
const rowTuple = rowAxis.tuples[rowIdx];
|
|
128
|
+
if (!colTuple || !rowTuple)
|
|
129
|
+
continue;
|
|
130
|
+
const coords = { ...whereCoords };
|
|
131
|
+
for (const m of colTuple.members)
|
|
132
|
+
coords[m.hierarchyName] = m.name;
|
|
133
|
+
for (const m of rowTuple.members)
|
|
134
|
+
coords[m.hierarchyName] = m.name;
|
|
135
|
+
const c = result.cells[i];
|
|
136
|
+
if (!c)
|
|
137
|
+
continue;
|
|
138
|
+
out.push({
|
|
139
|
+
coordinates: coords,
|
|
140
|
+
value: c.value,
|
|
141
|
+
formattedValue: c.formattedValue,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=sample-cells.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip information-free noise from a serialized JSON Schema.
|
|
3
|
+
*
|
|
4
|
+
* Zod's JSON-Schema emitter spells `.int()` out as the JS safe-integer range
|
|
5
|
+
* (`minimum: -9007199254740991` / `maximum: 9007199254740991`) and stamps a
|
|
6
|
+
* `$schema` dialect header onto every root. Both ship on every `tools/list`
|
|
7
|
+
* response and tell a model exactly nothing — together they account for ~25KB
|
|
8
|
+
* across the tool surface. Removing them is lossless: runtime validation still
|
|
9
|
+
* happens against the Zod objects server-side, which are untouched.
|
|
10
|
+
*
|
|
11
|
+
* The strip is deliberately narrow. A `minimum`/`maximum` is dropped ONLY when
|
|
12
|
+
* its value is the exact sentinel, so real bounds (`limit` max 500, `offset`
|
|
13
|
+
* min 0) survive. And keyword rules are suspended inside name-keyed containers
|
|
14
|
+
* (`properties` & friends), where the keys are user-chosen field names — a tool
|
|
15
|
+
* with a field literally called `$schema` keeps its subschema.
|
|
16
|
+
*
|
|
17
|
+
* Pure: the input is never mutated, the result is a fresh deep clone.
|
|
18
|
+
*/
|
|
19
|
+
export declare function slimJsonSchema(schema: unknown): unknown;
|
|
20
|
+
//# sourceMappingURL=slim-json-schema.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip information-free noise from a serialized JSON Schema.
|
|
3
|
+
*
|
|
4
|
+
* Zod's JSON-Schema emitter spells `.int()` out as the JS safe-integer range
|
|
5
|
+
* (`minimum: -9007199254740991` / `maximum: 9007199254740991`) and stamps a
|
|
6
|
+
* `$schema` dialect header onto every root. Both ship on every `tools/list`
|
|
7
|
+
* response and tell a model exactly nothing — together they account for ~25KB
|
|
8
|
+
* across the tool surface. Removing them is lossless: runtime validation still
|
|
9
|
+
* happens against the Zod objects server-side, which are untouched.
|
|
10
|
+
*
|
|
11
|
+
* The strip is deliberately narrow. A `minimum`/`maximum` is dropped ONLY when
|
|
12
|
+
* its value is the exact sentinel, so real bounds (`limit` max 500, `offset`
|
|
13
|
+
* min 0) survive. And keyword rules are suspended inside name-keyed containers
|
|
14
|
+
* (`properties` & friends), where the keys are user-chosen field names — a tool
|
|
15
|
+
* with a field literally called `$schema` keeps its subschema.
|
|
16
|
+
*
|
|
17
|
+
* Pure: the input is never mutated, the result is a fresh deep clone.
|
|
18
|
+
*/
|
|
19
|
+
// Zod serializes `.int()` to the JS safe-integer range; these two exact values
|
|
20
|
+
// are the sentinel, anything else is a real, author-chosen bound.
|
|
21
|
+
const SAFE_INT_MIN = -9007199254740991; // Number.MIN_SAFE_INTEGER
|
|
22
|
+
const SAFE_INT_MAX = 9007199254740991; // Number.MAX_SAFE_INTEGER
|
|
23
|
+
// JSON-Schema containers whose immediate keys are field names, not keywords.
|
|
24
|
+
// Recursion must not apply the strip rules one level below these.
|
|
25
|
+
const NAME_KEYED_CONTAINERS = new Set([
|
|
26
|
+
"properties",
|
|
27
|
+
"patternProperties",
|
|
28
|
+
"definitions",
|
|
29
|
+
"$defs",
|
|
30
|
+
"dependentSchemas",
|
|
31
|
+
]);
|
|
32
|
+
export function slimJsonSchema(schema) {
|
|
33
|
+
return slimNode(schema, false);
|
|
34
|
+
}
|
|
35
|
+
// `nameKeyed` = this node is a map of field-name → subschema, so its own keys
|
|
36
|
+
// carry no keyword meaning and must be preserved verbatim.
|
|
37
|
+
function slimNode(node, nameKeyed) {
|
|
38
|
+
if (Array.isArray(node))
|
|
39
|
+
return node.map((entry) => slimNode(entry, false));
|
|
40
|
+
if (node === null || typeof node !== "object")
|
|
41
|
+
return node;
|
|
42
|
+
const out = {};
|
|
43
|
+
for (const [key, value] of Object.entries(node)) {
|
|
44
|
+
if (!nameKeyed) {
|
|
45
|
+
if (key === "$schema")
|
|
46
|
+
continue;
|
|
47
|
+
if (key === "minimum" && value === SAFE_INT_MIN)
|
|
48
|
+
continue;
|
|
49
|
+
if (key === "maximum" && value === SAFE_INT_MAX)
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const slimmed = slimNode(value, !nameKeyed && NAME_KEYED_CONTAINERS.has(key));
|
|
53
|
+
// A field named `__proto__` would otherwise mutate the prototype chain
|
|
54
|
+
// instead of becoming an own property.
|
|
55
|
+
if (key === "__proto__") {
|
|
56
|
+
Object.defineProperty(out, key, {
|
|
57
|
+
value: slimmed,
|
|
58
|
+
enumerable: true,
|
|
59
|
+
writable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
});
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
out[key] = slimmed;
|
|
65
|
+
}
|
|
66
|
+
return out;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=slim-json-schema.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Runs of this many or more consecutive full-comment lines are collapsed. */
|
|
2
|
+
export declare const COLLAPSE_MIN = 4;
|
|
3
|
+
export interface CommentStats {
|
|
4
|
+
totalLines: number;
|
|
5
|
+
commentLines: number;
|
|
6
|
+
}
|
|
7
|
+
/** Count total lines and full-line comments (non-destructive). */
|
|
8
|
+
export declare function commentStats(src: string): CommentStats;
|
|
9
|
+
export interface StripResult {
|
|
10
|
+
code: string;
|
|
11
|
+
/** Original comment lines removed (sum of collapsed run lengths). */
|
|
12
|
+
removedLines: number;
|
|
13
|
+
/** Number of collapsed blocks. */
|
|
14
|
+
collapsedBlocks: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Collapse runs of >= COLLAPSE_MIN consecutive full-line comments into a single
|
|
18
|
+
* `# [... N lines commented out ...]` marker. Shorter comment runs and inline
|
|
19
|
+
* trailing comments are kept verbatim (they are usually documentation, not dead
|
|
20
|
+
* code). Line endings are normalized to `\n` (read-only display).
|
|
21
|
+
*/
|
|
22
|
+
export declare function stripCommentBlocks(src: string, minRun?: number): StripResult;
|
|
23
|
+
//# sourceMappingURL=strip-comments.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Pure helpers for tm1_get_process_code's stripComments mode. No I/O.
|
|
2
|
+
//
|
|
3
|
+
// TM1 TI code uses only `#` line comments (no block comments); `#` starts a
|
|
4
|
+
// comment that runs to end of line. Grown models accumulate large blocks of
|
|
5
|
+
// commented-out dead code that waste an agent's context. These helpers collapse
|
|
6
|
+
// long runs of full-line comments and report comment density for discoverability.
|
|
7
|
+
/** A full-line comment is a line that is only a comment (optional indent + `#`). */
|
|
8
|
+
const isFullCommentLine = (line) => /^\s*#/.test(line);
|
|
9
|
+
/** Runs of this many or more consecutive full-comment lines are collapsed. */
|
|
10
|
+
export const COLLAPSE_MIN = 4;
|
|
11
|
+
/** Count total lines and full-line comments (non-destructive). */
|
|
12
|
+
export function commentStats(src) {
|
|
13
|
+
if (src === "")
|
|
14
|
+
return { totalLines: 0, commentLines: 0 };
|
|
15
|
+
const lines = src.split(/\r?\n/);
|
|
16
|
+
let commentLines = 0;
|
|
17
|
+
for (const line of lines) {
|
|
18
|
+
if (isFullCommentLine(line))
|
|
19
|
+
commentLines++;
|
|
20
|
+
}
|
|
21
|
+
return { totalLines: lines.length, commentLines };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Collapse runs of >= COLLAPSE_MIN consecutive full-line comments into a single
|
|
25
|
+
* `# [... N lines commented out ...]` marker. Shorter comment runs and inline
|
|
26
|
+
* trailing comments are kept verbatim (they are usually documentation, not dead
|
|
27
|
+
* code). Line endings are normalized to `\n` (read-only display).
|
|
28
|
+
*/
|
|
29
|
+
export function stripCommentBlocks(src, minRun = COLLAPSE_MIN) {
|
|
30
|
+
if (src === "")
|
|
31
|
+
return { code: "", removedLines: 0, collapsedBlocks: 0 };
|
|
32
|
+
const lines = src.split(/\r?\n/);
|
|
33
|
+
const out = [];
|
|
34
|
+
let removedLines = 0;
|
|
35
|
+
let collapsedBlocks = 0;
|
|
36
|
+
let i = 0;
|
|
37
|
+
while (i < lines.length) {
|
|
38
|
+
if (isFullCommentLine(lines[i])) {
|
|
39
|
+
let j = i;
|
|
40
|
+
while (j < lines.length && isFullCommentLine(lines[j]))
|
|
41
|
+
j++;
|
|
42
|
+
const runLength = j - i;
|
|
43
|
+
if (runLength >= minRun) {
|
|
44
|
+
out.push(`# [... ${runLength} lines commented out ...]`);
|
|
45
|
+
removedLines += runLength;
|
|
46
|
+
collapsedBlocks++;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
for (let k = i; k < j; k++)
|
|
50
|
+
out.push(lines[k]);
|
|
51
|
+
}
|
|
52
|
+
i = j;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
out.push(lines[i]);
|
|
56
|
+
i++;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { code: out.join("\n"), removedLines, collapsedBlocks };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=strip-comments.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventEmitter } from "node:events";
|
|
2
|
+
export interface Tm1MutationEvent {
|
|
3
|
+
method: string;
|
|
4
|
+
path: string;
|
|
5
|
+
}
|
|
6
|
+
interface Tm1Events {
|
|
7
|
+
mutation: (e: Tm1MutationEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
declare class TypedEmitter extends EventEmitter {
|
|
10
|
+
on<K extends keyof Tm1Events>(event: K, listener: Tm1Events[K]): this;
|
|
11
|
+
off<K extends keyof Tm1Events>(event: K, listener: Tm1Events[K]): this;
|
|
12
|
+
emit<K extends keyof Tm1Events>(event: K, ...args: Parameters<Tm1Events[K]>): boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const tm1Events: TypedEmitter;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=tm1-events.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// In-process event bus for cross-cutting TM1 events.
|
|
2
|
+
//
|
|
3
|
+
// Currently emits only `mutation` after any successful non-safe HTTP request
|
|
4
|
+
// (POST/PUT/PATCH/DELETE), used by R2-05 resource-subscription notifications
|
|
5
|
+
// and as a future hook for cache layers.
|
|
6
|
+
//
|
|
7
|
+
// Decoupled from the HTTP layer so the MCP-side subscription registry can
|
|
8
|
+
// listen without HTTP needing a reference to the MCP server.
|
|
9
|
+
import { EventEmitter } from "node:events";
|
|
10
|
+
// Typed event emitter via thin wrapper. Listeners registered for events
|
|
11
|
+
// outside this map are silently allowed by Node's EventEmitter but won't
|
|
12
|
+
// receive emit calls from this module.
|
|
13
|
+
class TypedEmitter extends EventEmitter {
|
|
14
|
+
on(event, listener) {
|
|
15
|
+
return super.on(event, listener);
|
|
16
|
+
}
|
|
17
|
+
off(event, listener) {
|
|
18
|
+
return super.off(event, listener);
|
|
19
|
+
}
|
|
20
|
+
emit(event, ...args) {
|
|
21
|
+
return super.emit(event, ...args);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const tm1Events = new TypedEmitter();
|
|
25
|
+
// Set a generous listener cap. Subscriptions are server-scoped (one listener
|
|
26
|
+
// per running server process), so the default 10 is fine for now; raise only
|
|
27
|
+
// if a workload registers many per-resource listeners.
|
|
28
|
+
tm1Events.setMaxListeners(20);
|
|
29
|
+
//# sourceMappingURL=tm1-events.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DeprecatedTiEntry {
|
|
2
|
+
/** Canonical name, original casing (e.g. "SaveDataAll"). */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Short rationale — surfaced as `issue` in findings. */
|
|
5
|
+
issue: string;
|
|
6
|
+
/** Migration hint or "remove without replacement" when no replacement exists. */
|
|
7
|
+
suggestion: string;
|
|
8
|
+
/** Severity bucket. "error" = removed, "warning" = behavior-changed/cloud-only. */
|
|
9
|
+
severity: "error" | "warning";
|
|
10
|
+
}
|
|
11
|
+
export declare const V12_DEPRECATED_TI: ReadonlyMap<string, DeprecatedTiEntry>;
|
|
12
|
+
/**
|
|
13
|
+
* Combined case-insensitive regex matching any deprecated function name
|
|
14
|
+
* followed by `(`. Used by the scanner for a single-pass-per-line match.
|
|
15
|
+
*/
|
|
16
|
+
export declare const V12_DEPRECATED_TI_REGEX: RegExp;
|
|
17
|
+
//# sourceMappingURL=deprecated-ti.d.ts.map
|