@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.
Files changed (475) hide show
  1. package/CHANGELOG.md +1211 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +34 -0
  4. package/README.md +276 -0
  5. package/dist/config.d.ts +35 -0
  6. package/dist/config.js +238 -0
  7. package/dist/http-transport.d.ts +8 -0
  8. package/dist/http-transport.js +132 -0
  9. package/dist/index.d.ts +18 -0
  10. package/dist/index.js +164 -0
  11. package/dist/lib/callgraph/callGraph.d.ts +124 -0
  12. package/dist/lib/callgraph/callGraph.js +334 -0
  13. package/dist/lib/callgraph/choreGraph.d.ts +23 -0
  14. package/dist/lib/callgraph/choreGraph.js +102 -0
  15. package/dist/lib/callgraph/dataFlow.d.ts +74 -0
  16. package/dist/lib/callgraph/dataFlow.js +271 -0
  17. package/dist/lib/callgraph/datasourceMembership.d.ts +31 -0
  18. package/dist/lib/callgraph/datasourceMembership.js +142 -0
  19. package/dist/lib/callgraph/lintTypes.d.ts +28 -0
  20. package/dist/lib/callgraph/lintTypes.js +2 -0
  21. package/dist/lib/callgraph/mdxMembers.d.ts +29 -0
  22. package/dist/lib/callgraph/mdxMembers.js +97 -0
  23. package/dist/lib/callgraph/referenceIndex.d.ts +179 -0
  24. package/dist/lib/callgraph/referenceIndex.js +584 -0
  25. package/dist/lib/callgraph/rulesLinter.d.ts +55 -0
  26. package/dist/lib/callgraph/rulesLinter.js +776 -0
  27. package/dist/lib/callgraph/rulesParser.d.ts +26 -0
  28. package/dist/lib/callgraph/rulesParser.js +71 -0
  29. package/dist/lib/callgraph/subsetUsage.d.ts +16 -0
  30. package/dist/lib/callgraph/subsetUsage.js +134 -0
  31. package/dist/lib/callgraph/tiParser.d.ts +21 -0
  32. package/dist/lib/callgraph/tiParser.js +672 -0
  33. package/dist/lib/callgraph/tiSignatures.d.ts +32 -0
  34. package/dist/lib/callgraph/tiSignatures.js +6185 -0
  35. package/dist/lib/callgraph/tm1-adapter.d.ts +32 -0
  36. package/dist/lib/callgraph/tm1-adapter.js +159 -0
  37. package/dist/lib/callgraph/types.d.ts +53 -0
  38. package/dist/lib/callgraph/types.js +2 -0
  39. package/dist/lib/callgraph/variableEnv.d.ts +86 -0
  40. package/dist/lib/callgraph/variableEnv.js +214 -0
  41. package/dist/lib/cell-address.d.ts +12 -0
  42. package/dist/lib/cell-address.js +71 -0
  43. package/dist/lib/complexity/antipatterns.d.ts +22 -0
  44. package/dist/lib/complexity/antipatterns.js +302 -0
  45. package/dist/lib/complexity/comment-classifier.d.ts +24 -0
  46. package/dist/lib/complexity/comment-classifier.js +43 -0
  47. package/dist/lib/complexity/cross-process.d.ts +78 -0
  48. package/dist/lib/complexity/cross-process.js +114 -0
  49. package/dist/lib/complexity/process-metrics.d.ts +78 -0
  50. package/dist/lib/complexity/process-metrics.js +278 -0
  51. package/dist/lib/complexity/rules-metrics.d.ts +31 -0
  52. package/dist/lib/complexity/rules-metrics.js +99 -0
  53. package/dist/lib/concurrency.d.ts +11 -0
  54. package/dist/lib/concurrency.js +27 -0
  55. package/dist/lib/control-name.d.ts +10 -0
  56. package/dist/lib/control-name.js +10 -0
  57. package/dist/lib/coordinate-error.d.ts +3 -0
  58. package/dist/lib/coordinate-error.js +29 -0
  59. package/dist/lib/credential-format.d.ts +23 -0
  60. package/dist/lib/credential-format.js +25 -0
  61. package/dist/lib/cube-stats/fetcher.d.ts +106 -0
  62. package/dist/lib/cube-stats/fetcher.js +194 -0
  63. package/dist/lib/feeders/brackets.d.ts +47 -0
  64. package/dist/lib/feeders/brackets.js +195 -0
  65. package/dist/lib/feeders/element-type-cache.d.ts +42 -0
  66. package/dist/lib/feeders/element-type-cache.js +86 -0
  67. package/dist/lib/feeders/static-heuristics.d.ts +101 -0
  68. package/dist/lib/feeders/static-heuristics.js +202 -0
  69. package/dist/lib/git-process.d.ts +67 -0
  70. package/dist/lib/git-process.js +243 -0
  71. package/dist/lib/mask-secrets.d.ts +10 -0
  72. package/dist/lib/mask-secrets.js +99 -0
  73. package/dist/lib/mdx.d.ts +3 -0
  74. package/dist/lib/mdx.js +13 -0
  75. package/dist/lib/naming/odata-filter.d.ts +15 -0
  76. package/dist/lib/naming/odata-filter.js +81 -0
  77. package/dist/lib/naming/rules.d.ts +34 -0
  78. package/dist/lib/naming/rules.js +215 -0
  79. package/dist/lib/pro-parser.d.ts +19 -0
  80. package/dist/lib/pro-parser.js +260 -0
  81. package/dist/lib/pro-serializer.d.ts +19 -0
  82. package/dist/lib/pro-serializer.js +170 -0
  83. package/dist/lib/process-parts-schema.d.ts +45 -0
  84. package/dist/lib/process-parts-schema.js +46 -0
  85. package/dist/lib/process-refs.d.ts +88 -0
  86. package/dist/lib/process-refs.js +441 -0
  87. package/dist/lib/rules-outline.d.ts +29 -0
  88. package/dist/lib/rules-outline.js +68 -0
  89. package/dist/lib/rules-patch.d.ts +6 -0
  90. package/dist/lib/rules-patch.js +59 -0
  91. package/dist/lib/safe-regex.d.ts +15 -0
  92. package/dist/lib/safe-regex.js +37 -0
  93. package/dist/lib/sample-cells.d.ts +48 -0
  94. package/dist/lib/sample-cells.js +146 -0
  95. package/dist/lib/slim-json-schema.d.ts +20 -0
  96. package/dist/lib/slim-json-schema.js +68 -0
  97. package/dist/lib/strip-comments.d.ts +23 -0
  98. package/dist/lib/strip-comments.js +61 -0
  99. package/dist/lib/tm1-events.d.ts +16 -0
  100. package/dist/lib/tm1-events.js +29 -0
  101. package/dist/lib/v12-compat/deprecated-ti.d.ts +17 -0
  102. package/dist/lib/v12-compat/deprecated-ti.js +257 -0
  103. package/dist/lib/v12-compat/scanner.d.ts +10 -0
  104. package/dist/lib/v12-compat/scanner.js +43 -0
  105. package/dist/lib/variables-ui-data.d.ts +26 -0
  106. package/dist/lib/variables-ui-data.js +77 -0
  107. package/dist/load-env.d.ts +2 -0
  108. package/dist/load-env.js +29 -0
  109. package/dist/logger.d.ts +4 -0
  110. package/dist/logger.js +60 -0
  111. package/dist/prompts/index.d.ts +3 -0
  112. package/dist/prompts/index.js +141 -0
  113. package/dist/resources/index.d.ts +5 -0
  114. package/dist/resources/index.js +237 -0
  115. package/dist/resources/list-handler.d.ts +40 -0
  116. package/dist/resources/list-handler.js +86 -0
  117. package/dist/resources/subscriptions.d.ts +19 -0
  118. package/dist/resources/subscriptions.js +80 -0
  119. package/dist/schemas/cells.d.ts +17 -0
  120. package/dist/schemas/cells.js +13 -0
  121. package/dist/schemas/common.d.ts +16 -0
  122. package/dist/schemas/common.js +14 -0
  123. package/dist/schemas/index.d.ts +10 -0
  124. package/dist/schemas/index.js +23 -0
  125. package/dist/schemas/metadata.d.ts +70 -0
  126. package/dist/schemas/metadata.js +47 -0
  127. package/dist/schemas/monitoring.d.ts +95 -0
  128. package/dist/schemas/monitoring.js +69 -0
  129. package/dist/schemas/processes.d.ts +74 -0
  130. package/dist/schemas/processes.js +66 -0
  131. package/dist/schemas/scheduling.d.ts +13 -0
  132. package/dist/schemas/scheduling.js +13 -0
  133. package/dist/schemas/security.d.ts +19 -0
  134. package/dist/schemas/security.js +16 -0
  135. package/dist/schemas/subsets.d.ts +12 -0
  136. package/dist/schemas/subsets.js +12 -0
  137. package/dist/schemas/views.d.ts +9 -0
  138. package/dist/schemas/views.js +9 -0
  139. package/dist/session-manager.d.ts +79 -0
  140. package/dist/session-manager.js +281 -0
  141. package/dist/tm1-client/connection/profile.d.ts +13 -0
  142. package/dist/tm1-client/connection/profile.js +99 -0
  143. package/dist/tm1-client/dispatcher.d.ts +5 -0
  144. package/dist/tm1-client/dispatcher.js +31 -0
  145. package/dist/tm1-client/http.d.ts +81 -0
  146. package/dist/tm1-client/http.js +547 -0
  147. package/dist/tm1-client/services/batch-service.d.ts +123 -0
  148. package/dist/tm1-client/services/batch-service.js +455 -0
  149. package/dist/tm1-client/services/cell-service.d.ts +71 -0
  150. package/dist/tm1-client/services/cell-service.js +333 -0
  151. package/dist/tm1-client/services/cellset-transform.d.ts +26 -0
  152. package/dist/tm1-client/services/cellset-transform.js +80 -0
  153. package/dist/tm1-client/services/chore-service.d.ts +68 -0
  154. package/dist/tm1-client/services/chore-service.js +179 -0
  155. package/dist/tm1-client/services/chore-status.d.ts +11 -0
  156. package/dist/tm1-client/services/chore-status.js +127 -0
  157. package/dist/tm1-client/services/cube-service.d.ts +134 -0
  158. package/dist/tm1-client/services/cube-service.js +294 -0
  159. package/dist/tm1-client/services/dimension-service.d.ts +118 -0
  160. package/dist/tm1-client/services/dimension-service.js +249 -0
  161. package/dist/tm1-client/services/element-service.d.ts +245 -0
  162. package/dist/tm1-client/services/element-service.js +809 -0
  163. package/dist/tm1-client/services/fallback.d.ts +44 -0
  164. package/dist/tm1-client/services/fallback.js +72 -0
  165. package/dist/tm1-client/services/file-service.d.ts +53 -0
  166. package/dist/tm1-client/services/file-service.js +218 -0
  167. package/dist/tm1-client/services/hierarchy-service.d.ts +129 -0
  168. package/dist/tm1-client/services/hierarchy-service.js +332 -0
  169. package/dist/tm1-client/services/monitoring-service.d.ts +34 -0
  170. package/dist/tm1-client/services/monitoring-service.js +123 -0
  171. package/dist/tm1-client/services/odata-page.d.ts +71 -0
  172. package/dist/tm1-client/services/odata-page.js +87 -0
  173. package/dist/tm1-client/services/process-service.d.ts +278 -0
  174. package/dist/tm1-client/services/process-service.js +874 -0
  175. package/dist/tm1-client/services/process-status.d.ts +21 -0
  176. package/dist/tm1-client/services/process-status.js +89 -0
  177. package/dist/tm1-client/services/security-service.d.ts +50 -0
  178. package/dist/tm1-client/services/security-service.js +93 -0
  179. package/dist/tm1-client/services/server-service.d.ts +116 -0
  180. package/dist/tm1-client/services/server-service.js +504 -0
  181. package/dist/tm1-client/services/subset-service.d.ts +37 -0
  182. package/dist/tm1-client/services/subset-service.js +122 -0
  183. package/dist/tm1-client/services/view-service.d.ts +46 -0
  184. package/dist/tm1-client/services/view-service.js +287 -0
  185. package/dist/tm1-client.d.ts +56 -0
  186. package/dist/tm1-client.js +126 -0
  187. package/dist/tools/analysis/analyze-callgraph.d.ts +28 -0
  188. package/dist/tools/analysis/analyze-callgraph.js +350 -0
  189. package/dist/tools/analysis/analyze-chore-graph.d.ts +2 -0
  190. package/dist/tools/analysis/analyze-chore-graph.js +148 -0
  191. package/dist/tools/analysis/analyze-object-usage.d.ts +2 -0
  192. package/dist/tools/analysis/analyze-object-usage.js +143 -0
  193. package/dist/tools/analysis/audit-complexity.d.ts +2 -0
  194. package/dist/tools/analysis/audit-complexity.js +255 -0
  195. package/dist/tools/analysis/audit-feeders.d.ts +2 -0
  196. package/dist/tools/analysis/audit-feeders.js +417 -0
  197. package/dist/tools/analysis/audit-naming.d.ts +2 -0
  198. package/dist/tools/analysis/audit-naming.js +379 -0
  199. package/dist/tools/analysis/check-v12-readiness.d.ts +2 -0
  200. package/dist/tools/analysis/check-v12-readiness.js +136 -0
  201. package/dist/tools/analysis/find-orphan-dimensions.d.ts +2 -0
  202. package/dist/tools/analysis/find-orphan-dimensions.js +55 -0
  203. package/dist/tools/analysis/invalidate-callgraph-cache.d.ts +2 -0
  204. package/dist/tools/analysis/invalidate-callgraph-cache.js +40 -0
  205. package/dist/tools/analysis/trace-data-flow.d.ts +2 -0
  206. package/dist/tools/analysis/trace-data-flow.js +138 -0
  207. package/dist/tools/annotations.d.ts +12 -0
  208. package/dist/tools/annotations.js +61 -0
  209. package/dist/tools/celldata/check-feeders.d.ts +2 -0
  210. package/dist/tools/celldata/check-feeders.js +48 -0
  211. package/dist/tools/celldata/check-writable-coords.d.ts +2 -0
  212. package/dist/tools/celldata/check-writable-coords.js +126 -0
  213. package/dist/tools/celldata/execute-mdx.d.ts +17 -0
  214. package/dist/tools/celldata/execute-mdx.js +126 -0
  215. package/dist/tools/celldata/get-cell-value.d.ts +2 -0
  216. package/dist/tools/celldata/get-cell-value.js +30 -0
  217. package/dist/tools/celldata/get-view-definition.d.ts +2 -0
  218. package/dist/tools/celldata/get-view-definition.js +29 -0
  219. package/dist/tools/celldata/get-view.d.ts +2 -0
  220. package/dist/tools/celldata/get-view.js +55 -0
  221. package/dist/tools/celldata/sample-cells.d.ts +2 -0
  222. package/dist/tools/celldata/sample-cells.js +101 -0
  223. package/dist/tools/celldata/trace-cell-calculation.d.ts +2 -0
  224. package/dist/tools/celldata/trace-cell-calculation.js +53 -0
  225. package/dist/tools/celldata/trace-feeders.d.ts +2 -0
  226. package/dist/tools/celldata/trace-feeders.js +44 -0
  227. package/dist/tools/celldata/write-cells.d.ts +2 -0
  228. package/dist/tools/celldata/write-cells.js +65 -0
  229. package/dist/tools/confirm.d.ts +10 -0
  230. package/dist/tools/confirm.js +64 -0
  231. package/dist/tools/define-tool.d.ts +51 -0
  232. package/dist/tools/define-tool.js +49 -0
  233. package/dist/tools/dimension-management/bulk-upsert-elements.d.ts +2 -0
  234. package/dist/tools/dimension-management/bulk-upsert-elements.js +103 -0
  235. package/dist/tools/dimension-management/create-dimension.d.ts +2 -0
  236. package/dist/tools/dimension-management/create-dimension.js +22 -0
  237. package/dist/tools/dimension-management/create-element-attribute.d.ts +2 -0
  238. package/dist/tools/dimension-management/create-element-attribute.js +26 -0
  239. package/dist/tools/dimension-management/create-element.d.ts +2 -0
  240. package/dist/tools/dimension-management/create-element.js +31 -0
  241. package/dist/tools/dimension-management/create-hierarchy.d.ts +2 -0
  242. package/dist/tools/dimension-management/create-hierarchy.js +22 -0
  243. package/dist/tools/dimension-management/delete-dimension.d.ts +2 -0
  244. package/dist/tools/dimension-management/delete-dimension.js +25 -0
  245. package/dist/tools/dimension-management/delete-element.d.ts +2 -0
  246. package/dist/tools/dimension-management/delete-element.js +26 -0
  247. package/dist/tools/dimension-management/delete-elements.d.ts +2 -0
  248. package/dist/tools/dimension-management/delete-elements.js +44 -0
  249. package/dist/tools/dimension-management/delete-hierarchy.d.ts +2 -0
  250. package/dist/tools/dimension-management/delete-hierarchy.js +35 -0
  251. package/dist/tools/dimension-management/get-element-attribute-values.d.ts +2 -0
  252. package/dist/tools/dimension-management/get-element-attribute-values.js +77 -0
  253. package/dist/tools/dimension-management/list-element-attributes.d.ts +2 -0
  254. package/dist/tools/dimension-management/list-element-attributes.js +31 -0
  255. package/dist/tools/dimension-management/move-element.d.ts +2 -0
  256. package/dist/tools/dimension-management/move-element.js +28 -0
  257. package/dist/tools/dimension-management/update-element-attribute-value.d.ts +2 -0
  258. package/dist/tools/dimension-management/update-element-attribute-value.js +80 -0
  259. package/dist/tools/dimension-management/update-element.d.ts +2 -0
  260. package/dist/tools/dimension-management/update-element.js +35 -0
  261. package/dist/tools/error-format.d.ts +22 -0
  262. package/dist/tools/error-format.js +130 -0
  263. package/dist/tools/fileops/delete-file.d.ts +2 -0
  264. package/dist/tools/fileops/delete-file.js +32 -0
  265. package/dist/tools/fileops/get-file-content.d.ts +2 -0
  266. package/dist/tools/fileops/get-file-content.js +76 -0
  267. package/dist/tools/fileops/list-files.d.ts +2 -0
  268. package/dist/tools/fileops/list-files.js +43 -0
  269. package/dist/tools/fileops/search-files.d.ts +2 -0
  270. package/dist/tools/fileops/search-files.js +76 -0
  271. package/dist/tools/fileops/upload-file.d.ts +2 -0
  272. package/dist/tools/fileops/upload-file.js +69 -0
  273. package/dist/tools/format.d.ts +57 -0
  274. package/dist/tools/format.js +157 -0
  275. package/dist/tools/hierarchy.d.ts +6 -0
  276. package/dist/tools/hierarchy.js +27 -0
  277. package/dist/tools/index.d.ts +4 -0
  278. package/dist/tools/index.js +263 -0
  279. package/dist/tools/local-file.d.ts +16 -0
  280. package/dist/tools/local-file.js +88 -0
  281. package/dist/tools/metadata/get-ancestors.d.ts +2 -0
  282. package/dist/tools/metadata/get-ancestors.js +36 -0
  283. package/dist/tools/metadata/get-descendants.d.ts +2 -0
  284. package/dist/tools/metadata/get-descendants.js +64 -0
  285. package/dist/tools/metadata/get-hierarchy.d.ts +2 -0
  286. package/dist/tools/metadata/get-hierarchy.js +130 -0
  287. package/dist/tools/metadata/list-chores.d.ts +2 -0
  288. package/dist/tools/metadata/list-chores.js +62 -0
  289. package/dist/tools/metadata/list-cubes.d.ts +2 -0
  290. package/dist/tools/metadata/list-cubes.js +128 -0
  291. package/dist/tools/metadata/list-dimensions.d.ts +2 -0
  292. package/dist/tools/metadata/list-dimensions.js +131 -0
  293. package/dist/tools/metadata/list-processes-grouped.d.ts +2 -0
  294. package/dist/tools/metadata/list-processes-grouped.js +96 -0
  295. package/dist/tools/metadata/list-processes.d.ts +2 -0
  296. package/dist/tools/metadata/list-processes.js +108 -0
  297. package/dist/tools/metadata/resolve-default-members.d.ts +2 -0
  298. package/dist/tools/metadata/resolve-default-members.js +46 -0
  299. package/dist/tools/model-building/check-cube-rule.d.ts +2 -0
  300. package/dist/tools/model-building/check-cube-rule.js +51 -0
  301. package/dist/tools/model-building/clear-cube.d.ts +2 -0
  302. package/dist/tools/model-building/clear-cube.js +46 -0
  303. package/dist/tools/model-building/create-cube.d.ts +2 -0
  304. package/dist/tools/model-building/create-cube.js +34 -0
  305. package/dist/tools/model-building/delete-cube.d.ts +2 -0
  306. package/dist/tools/model-building/delete-cube.js +27 -0
  307. package/dist/tools/model-building/get-all-cube-rules.d.ts +2 -0
  308. package/dist/tools/model-building/get-all-cube-rules.js +149 -0
  309. package/dist/tools/model-building/get-cube-rules.d.ts +2 -0
  310. package/dist/tools/model-building/get-cube-rules.js +69 -0
  311. package/dist/tools/model-building/rules-source.d.ts +21 -0
  312. package/dist/tools/model-building/rules-source.js +49 -0
  313. package/dist/tools/model-building/search-rules.d.ts +2 -0
  314. package/dist/tools/model-building/search-rules.js +132 -0
  315. package/dist/tools/model-building/set-cube-rules.d.ts +2 -0
  316. package/dist/tools/model-building/set-cube-rules.js +81 -0
  317. package/dist/tools/model-building/unload-cube.d.ts +2 -0
  318. package/dist/tools/model-building/unload-cube.js +23 -0
  319. package/dist/tools/operations/diagnose-process-error.d.ts +2 -0
  320. package/dist/tools/operations/diagnose-process-error.js +178 -0
  321. package/dist/tools/operations/error-log-helpers.d.ts +25 -0
  322. package/dist/tools/operations/error-log-helpers.js +57 -0
  323. package/dist/tools/operations/get-audit-log.d.ts +2 -0
  324. package/dist/tools/operations/get-audit-log.js +70 -0
  325. package/dist/tools/operations/get-cube-stats.d.ts +2 -0
  326. package/dist/tools/operations/get-cube-stats.js +107 -0
  327. package/dist/tools/operations/get-error-log-content.d.ts +2 -0
  328. package/dist/tools/operations/get-error-log-content.js +164 -0
  329. package/dist/tools/operations/get-jobs.d.ts +3 -0
  330. package/dist/tools/operations/get-jobs.js +51 -0
  331. package/dist/tools/operations/get-message-log.d.ts +2 -0
  332. package/dist/tools/operations/get-message-log.js +63 -0
  333. package/dist/tools/operations/get-server-info.d.ts +2 -0
  334. package/dist/tools/operations/get-server-info.js +180 -0
  335. package/dist/tools/operations/get-server-state.d.ts +2 -0
  336. package/dist/tools/operations/get-server-state.js +129 -0
  337. package/dist/tools/operations/get-sessions.d.ts +2 -0
  338. package/dist/tools/operations/get-sessions.js +76 -0
  339. package/dist/tools/operations/get-threads.d.ts +3 -0
  340. package/dist/tools/operations/get-threads.js +50 -0
  341. package/dist/tools/operations/get-transaction-log.d.ts +2 -0
  342. package/dist/tools/operations/get-transaction-log.js +63 -0
  343. package/dist/tools/operations/list-error-logs.d.ts +8 -0
  344. package/dist/tools/operations/list-error-logs.js +157 -0
  345. package/dist/tools/operations/save-data.d.ts +2 -0
  346. package/dist/tools/operations/save-data.js +50 -0
  347. package/dist/tools/pagination.d.ts +32 -0
  348. package/dist/tools/pagination.js +116 -0
  349. package/dist/tools/scheduling/create-chore.d.ts +2 -0
  350. package/dist/tools/scheduling/create-chore.js +93 -0
  351. package/dist/tools/scheduling/delete-chore.d.ts +2 -0
  352. package/dist/tools/scheduling/delete-chore.js +22 -0
  353. package/dist/tools/scheduling/execute-chore.d.ts +2 -0
  354. package/dist/tools/scheduling/execute-chore.js +52 -0
  355. package/dist/tools/scheduling/toggle-chore.d.ts +2 -0
  356. package/dist/tools/scheduling/toggle-chore.js +22 -0
  357. package/dist/tools/scheduling/update-chore.d.ts +2 -0
  358. package/dist/tools/scheduling/update-chore.js +71 -0
  359. package/dist/tools/schemas/common.d.ts +10 -0
  360. package/dist/tools/schemas/common.js +23 -0
  361. package/dist/tools/schemas/items-analysis.d.ts +394 -0
  362. package/dist/tools/schemas/items-analysis.js +419 -0
  363. package/dist/tools/schemas/items-cells.d.ts +70 -0
  364. package/dist/tools/schemas/items-cells.js +65 -0
  365. package/dist/tools/schemas/items-common.d.ts +18 -0
  366. package/dist/tools/schemas/items-common.js +39 -0
  367. package/dist/tools/schemas/items-fileops.d.ts +11 -0
  368. package/dist/tools/schemas/items-fileops.js +13 -0
  369. package/dist/tools/schemas/items-metadata.d.ts +262 -0
  370. package/dist/tools/schemas/items-metadata.js +184 -0
  371. package/dist/tools/schemas/items-monitoring.d.ts +79 -0
  372. package/dist/tools/schemas/items-monitoring.js +78 -0
  373. package/dist/tools/schemas/items-processes.d.ts +279 -0
  374. package/dist/tools/schemas/items-processes.js +235 -0
  375. package/dist/tools/schemas/items-scheduling.d.ts +25 -0
  376. package/dist/tools/schemas/items-scheduling.js +26 -0
  377. package/dist/tools/schemas/items-security.d.ts +19 -0
  378. package/dist/tools/schemas/items-security.js +12 -0
  379. package/dist/tools/schemas/items-subsets.d.ts +2 -0
  380. package/dist/tools/schemas/items-subsets.js +4 -0
  381. package/dist/tools/schemas/items-views.d.ts +38 -0
  382. package/dist/tools/schemas/items-views.js +26 -0
  383. package/dist/tools/schemas/items.d.ts +12 -0
  384. package/dist/tools/schemas/items.js +23 -0
  385. package/dist/tools/schemas/markdown-capable.d.ts +21 -0
  386. package/dist/tools/schemas/markdown-capable.js +58 -0
  387. package/dist/tools/schemas/output-schema.d.ts +24 -0
  388. package/dist/tools/schemas/output-schema.js +25 -0
  389. package/dist/tools/security/assign-client-group.d.ts +2 -0
  390. package/dist/tools/security/assign-client-group.js +20 -0
  391. package/dist/tools/security/create-client.d.ts +2 -0
  392. package/dist/tools/security/create-client.js +28 -0
  393. package/dist/tools/security/delete-client.d.ts +2 -0
  394. package/dist/tools/security/delete-client.js +22 -0
  395. package/dist/tools/security/get-client.d.ts +2 -0
  396. package/dist/tools/security/get-client.js +20 -0
  397. package/dist/tools/security/list-clients.d.ts +2 -0
  398. package/dist/tools/security/list-clients.js +86 -0
  399. package/dist/tools/security/list-groups.d.ts +2 -0
  400. package/dist/tools/security/list-groups.js +43 -0
  401. package/dist/tools/security/remove-client-group.d.ts +2 -0
  402. package/dist/tools/security/remove-client-group.js +27 -0
  403. package/dist/tools/security/update-client.d.ts +2 -0
  404. package/dist/tools/security/update-client.js +22 -0
  405. package/dist/tools/subsets/create-subset.d.ts +2 -0
  406. package/dist/tools/subsets/create-subset.js +44 -0
  407. package/dist/tools/subsets/delete-subset.d.ts +2 -0
  408. package/dist/tools/subsets/delete-subset.js +26 -0
  409. package/dist/tools/subsets/get-subset.d.ts +2 -0
  410. package/dist/tools/subsets/get-subset.js +29 -0
  411. package/dist/tools/subsets/list-subsets.d.ts +2 -0
  412. package/dist/tools/subsets/list-subsets.js +36 -0
  413. package/dist/tools/subsets/update-subset.d.ts +2 -0
  414. package/dist/tools/subsets/update-subset.js +33 -0
  415. package/dist/tools/ti-development/check-process-code.d.ts +2 -0
  416. package/dist/tools/ti-development/check-process-code.js +96 -0
  417. package/dist/tools/ti-development/compile-process.d.ts +2 -0
  418. package/dist/tools/ti-development/compile-process.js +32 -0
  419. package/dist/tools/ti-development/copy-process.d.ts +2 -0
  420. package/dist/tools/ti-development/copy-process.js +32 -0
  421. package/dist/tools/ti-development/delete-process.d.ts +2 -0
  422. package/dist/tools/ti-development/delete-process.js +26 -0
  423. package/dist/tools/ti-development/diff-process-with-file.d.ts +2 -0
  424. package/dist/tools/ti-development/diff-process-with-file.js +208 -0
  425. package/dist/tools/ti-development/diff-processes.d.ts +2 -0
  426. package/dist/tools/ti-development/diff-processes.js +312 -0
  427. package/dist/tools/ti-development/execute-process.d.ts +8 -0
  428. package/dist/tools/ti-development/execute-process.js +109 -0
  429. package/dist/tools/ti-development/export-process-to-git.d.ts +2 -0
  430. package/dist/tools/ti-development/export-process-to-git.js +113 -0
  431. package/dist/tools/ti-development/export-process-to-pro.d.ts +2 -0
  432. package/dist/tools/ti-development/export-process-to-pro.js +117 -0
  433. package/dist/tools/ti-development/get-all-processes-code.d.ts +2 -0
  434. package/dist/tools/ti-development/get-all-processes-code.js +131 -0
  435. package/dist/tools/ti-development/get-process-code.d.ts +2 -0
  436. package/dist/tools/ti-development/get-process-code.js +100 -0
  437. package/dist/tools/ti-development/get-process-datasource.d.ts +2 -0
  438. package/dist/tools/ti-development/get-process-datasource.js +20 -0
  439. package/dist/tools/ti-development/get-process-parameters.d.ts +2 -0
  440. package/dist/tools/ti-development/get-process-parameters.js +25 -0
  441. package/dist/tools/ti-development/get-process-variables.d.ts +2 -0
  442. package/dist/tools/ti-development/get-process-variables.js +38 -0
  443. package/dist/tools/ti-development/get-process.d.ts +2 -0
  444. package/dist/tools/ti-development/get-process.js +163 -0
  445. package/dist/tools/ti-development/import-pro-file.d.ts +2 -0
  446. package/dist/tools/ti-development/import-pro-file.js +153 -0
  447. package/dist/tools/ti-development/import-process-from-git.d.ts +2 -0
  448. package/dist/tools/ti-development/import-process-from-git.js +198 -0
  449. package/dist/tools/ti-development/install-pro-bundle.d.ts +2 -0
  450. package/dist/tools/ti-development/install-pro-bundle.js +288 -0
  451. package/dist/tools/ti-development/preflight.d.ts +39 -0
  452. package/dist/tools/ti-development/preflight.js +56 -0
  453. package/dist/tools/ti-development/process-backup.d.ts +29 -0
  454. package/dist/tools/ti-development/process-backup.js +118 -0
  455. package/dist/tools/ti-development/search-code.d.ts +2 -0
  456. package/dist/tools/ti-development/search-code.js +208 -0
  457. package/dist/tools/ti-development/upsert-process.d.ts +2 -0
  458. package/dist/tools/ti-development/upsert-process.js +167 -0
  459. package/dist/tools/ti-development/validate-process-refs.d.ts +2 -0
  460. package/dist/tools/ti-development/validate-process-refs.js +73 -0
  461. package/dist/tools/views/create-mdx-view.d.ts +2 -0
  462. package/dist/tools/views/create-mdx-view.js +21 -0
  463. package/dist/tools/views/create-native-view.d.ts +2 -0
  464. package/dist/tools/views/create-native-view.js +81 -0
  465. package/dist/tools/views/delete-view.d.ts +2 -0
  466. package/dist/tools/views/delete-view.js +23 -0
  467. package/dist/tools/views/list-views.d.ts +2 -0
  468. package/dist/tools/views/list-views.js +32 -0
  469. package/dist/tools/with-annotations.d.ts +6 -0
  470. package/dist/tools/with-annotations.js +339 -0
  471. package/dist/types.d.ts +409 -0
  472. package/dist/types.js +91 -0
  473. package/dist/version.d.ts +4 -0
  474. package/dist/version.js +18 -0
  475. package/package.json +107 -0
@@ -0,0 +1,409 @@
1
+ export declare const TM1ErrorCode: {
2
+ readonly CONNECTION_FAILED: "CONNECTION_FAILED";
3
+ readonly LOCK_TIMEOUT: "LOCK_TIMEOUT";
4
+ readonly AUTH_FAILED: "AUTH_FAILED";
5
+ readonly PERMISSION_DENIED: "PERMISSION_DENIED";
6
+ readonly NOT_FOUND: "NOT_FOUND";
7
+ readonly CONFLICT: "CONFLICT";
8
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
9
+ readonly TM1_ERROR: "TM1_ERROR";
10
+ readonly UNSUPPORTED_OPERATION: "UNSUPPORTED_OPERATION";
11
+ readonly RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE";
12
+ };
13
+ export type TM1ErrorCode = (typeof TM1ErrorCode)[keyof typeof TM1ErrorCode];
14
+ export declare class TM1Error extends Error {
15
+ readonly code: TM1ErrorCode;
16
+ readonly httpStatus?: number | undefined;
17
+ readonly endpoint?: string | undefined;
18
+ readonly details?: string | undefined;
19
+ hintOverride?: string | undefined;
20
+ constructor(opts: {
21
+ code: TM1ErrorCode;
22
+ message: string;
23
+ httpStatus?: number | undefined;
24
+ endpoint?: string | undefined;
25
+ details?: string | undefined;
26
+ hint?: string | undefined;
27
+ });
28
+ get hint(): string;
29
+ toErrorPayload(): {
30
+ code: TM1ErrorCode;
31
+ message: string;
32
+ httpStatus?: number | undefined;
33
+ endpoint?: string | undefined;
34
+ details?: string | undefined;
35
+ hint: string;
36
+ };
37
+ }
38
+ export declare function hintForCode(code: TM1ErrorCode | string): string;
39
+ import type { AuditLogDetail, CellValue, Chore, Client, Cube, DataSource, Dimension, ElementAttributeValue, ElementStats, ErrorLogFile, FedCellDescriptor, Group, Hierarchy, HierarchyElement, IgnoredColumn, Job, JobSession, JobWaitingOn, MdxAxis, MessageLogEntry, Process, ProcessCode, ProcessParameter, ProcessVariable, Session, Subset, Thread, TransactionLogEntry, ViewAxisSubsetRef } from "./schemas/index.js";
40
+ export type { AuditLogDetail, CellValue, Chore, Client, Cube, DataSource, Dimension, ElementAttributeValue, ElementStats, ErrorLogFile, FedCellDescriptor, Group, Hierarchy, HierarchyElement, IgnoredColumn, Job, JobSession, JobWaitingOn, MdxAxis, MessageLogEntry, Process, ProcessCode, ProcessParameter, ProcessVariable, Session, Subset, Thread, TransactionLogEntry, ViewAxisSubsetRef, };
41
+ export interface MdxResult {
42
+ cells: Array<{
43
+ value: CellValue;
44
+ formattedValue: string;
45
+ }>;
46
+ axes: MdxAxis[];
47
+ totalCellCount: number;
48
+ }
49
+ export interface FeederTraceResult {
50
+ fedCells: FedCellDescriptor[];
51
+ statements: string[];
52
+ }
53
+ export interface CalculationTraceNode {
54
+ type?: string;
55
+ status?: string;
56
+ value: CellValue;
57
+ cube?: string;
58
+ tuple?: string[];
59
+ statements?: string[];
60
+ components?: CalculationTraceNode[];
61
+ /** Set when children were cut off by maxDepth / maxComponents. */
62
+ truncated?: boolean;
63
+ }
64
+ export interface ViewResult {
65
+ cubeName: string;
66
+ viewName: string;
67
+ cells: Array<{
68
+ value: CellValue;
69
+ formattedValue: string;
70
+ }>;
71
+ axes: MdxAxis[];
72
+ totalCellCount: number;
73
+ }
74
+ export interface ViewTitleRef extends ViewAxisSubsetRef {
75
+ selectedElement?: string | undefined;
76
+ }
77
+ export interface NativeViewDefinition {
78
+ titles: ViewTitleRef[];
79
+ columns: ViewAxisSubsetRef[];
80
+ rows: ViewAxisSubsetRef[];
81
+ }
82
+ /**
83
+ * Axis spec for creating a native view. Exactly one subset source per axis:
84
+ * a registered subset name, an MDX expression, or an explicit element list.
85
+ */
86
+ export interface NativeViewAxisSpec {
87
+ dimension: string;
88
+ /** Defaults to the dimension name (same-named hierarchy). */
89
+ hierarchy?: string | undefined;
90
+ subset?: string | undefined;
91
+ expression?: string | undefined;
92
+ elements?: string[] | undefined;
93
+ }
94
+ export interface NativeViewTitleSpec extends NativeViewAxisSpec {
95
+ /**
96
+ * Title element shown as selected; must be in the subset. Required by TM1 —
97
+ * createNative() rejects title specs without it (optional here only so the
98
+ * validation is reachable).
99
+ */
100
+ selected?: string | undefined;
101
+ }
102
+ export interface NativeViewCreate {
103
+ columns: NativeViewAxisSpec[];
104
+ rows: NativeViewAxisSpec[];
105
+ titles?: NativeViewTitleSpec[] | undefined;
106
+ suppressEmptyColumns?: boolean | undefined;
107
+ suppressEmptyRows?: boolean | undefined;
108
+ formatString?: string | undefined;
109
+ }
110
+ export interface ViewDefinition {
111
+ cubeName: string;
112
+ viewName: string;
113
+ private: boolean;
114
+ type: "MDX" | "Native";
115
+ mdx?: string;
116
+ native?: NativeViewDefinition;
117
+ }
118
+ /**
119
+ * What a TI run is known to have done. The axis that matters to a caller is not
120
+ * "did TM1 like it" but **was anything committed** — TM1's
121
+ * `tm1.ExecuteWithReturn` answers HTTP 200 for every one of these.
122
+ *
123
+ * `ProcessExecuteStatusCode` has exactly six members (read from the `$metadata`
124
+ * of both a v11 11.8 and a v12 12.5.9 server — identical, no version drift):
125
+ * `CompletedSuccessfully`=0, `Aborted`=1, `HasMinorErrors`=2, `QuitCalled`=3,
126
+ * `CompletedWithMessages`=4, `RollbackCalled`=5. They fall into three groups,
127
+ * measured live on 11.8 through `ExecuteWithReturn` by writing a marker cell in
128
+ * the Prolog, taking each exit path, and reading the cell back:
129
+ *
130
+ * - `succeeded` — `CompletedSuccessfully`. Marker written.
131
+ * - `completed_with_errors` — `CompletedWithMessages` (`ItemReject`),
132
+ * `QuitCalled` (`ProcessQuit`) and `HasMinorErrors` all left the marker cell
133
+ * **written**: the process ran and **its changes WERE COMMITTED**. Treat a
134
+ * blind retry as UNSAFE — the run already wrote data, so re-running can
135
+ * double-post it. All three are measured; on `HasMinorErrors` note that the
136
+ * DOCUMENTED path to it is per-record failures in the Metadata/Data tabs,
137
+ * which need a data source. It was reached here without one, from a pure
138
+ * Prolog, by writing to a consolidated element — same status code, and the
139
+ * earlier leaf write committed.
140
+ * - `rolled_back` — `Aborted` (`ProcessError`, or a `CellPutN` into a
141
+ * cube that does not exist) and `RollbackCalled` (`ProcessRollback`) both
142
+ * left the marker cell **rolled back**: the process ran, nothing was
143
+ * committed. Retrying is safe as far as commit state goes.
144
+ * - `indeterminate` — no `ProcessExecuteStatusCode` at all, a status
145
+ * code THIS BUILD DOES NOT KNOW (a seventh member added by a future TM1 must
146
+ * not be silently absorbed into a group whose commit semantics we never
147
+ * measured), or a call that errored before any status was reported. The run
148
+ * may have completed, partially completed, or never started. Defaulting this
149
+ * to `CompletedSuccessfully` (T-4) reported unverified runs as clean ones.
150
+ *
151
+ * Everything but `succeeded` travels with `success: false`, so the fail-closed
152
+ * `isError` flags on `tm1_execute_process` / `tm1_save_data` keep firing;
153
+ * `outcome` is what tells the three apart.
154
+ */
155
+ export type ProcessOutcome = "succeeded" | "completed_with_errors" | "rolled_back" | "indeterminate";
156
+ /**
157
+ * Result of a TI execution. A discriminated union rather than a flat record so
158
+ * the states the server cannot actually be in are not expressible: before this,
159
+ * `{success: true, processErrorStatus: "Aborted"}` typechecked, and nothing but
160
+ * a code comment kept `success` and the status in agreement.
161
+ *
162
+ * `success` and `outcome` are literal-typed per variant, so they cannot drift
163
+ * apart; either one narrows the union.
164
+ */
165
+ export type ProcessResult = {
166
+ success: true;
167
+ outcome: "succeeded";
168
+ /**
169
+ * Pinned: the only status a successful run can carry.
170
+ *
171
+ * NOT a guarantee that the process reached its intended end. `ProcessBreak`
172
+ * also comes back as `CompletedSuccessfully` (verified live on 11.8), so a
173
+ * run that bailed out of its data loop halfway is indistinguishable here.
174
+ * TM1 gives us nothing to detect it with; read this as "TM1 raised no
175
+ * objection and committed", not as "the process did all its work".
176
+ */
177
+ processErrorStatus: "CompletedSuccessfully";
178
+ errorLogFile?: string | undefined;
179
+ } | {
180
+ success: false;
181
+ outcome: "completed_with_errors";
182
+ /**
183
+ * TM1's status code: `CompletedWithMessages`, `QuitCalled` or
184
+ * `HasMinorErrors`. **The changes this run made were COMMITTED** — do not
185
+ * retry blindly; check what it already wrote first.
186
+ */
187
+ processErrorStatus: string;
188
+ errorLogFile?: string | undefined;
189
+ } | {
190
+ success: false;
191
+ outcome: "rolled_back";
192
+ /** TM1's status code: `Aborted` or `RollbackCalled`. Nothing was committed. */
193
+ processErrorStatus: string;
194
+ errorLogFile?: string | undefined;
195
+ } | {
196
+ success: false;
197
+ outcome: "indeterminate";
198
+ /** Says why the outcome is unknown — the only channel for that here. */
199
+ processErrorStatus: string;
200
+ errorLogFile?: string | undefined;
201
+ };
202
+ /**
203
+ * Status text used when TM1 answers an execution without a
204
+ * `ProcessExecuteStatusCode`. Carries its own guidance because `ProcessResult`
205
+ * has no hint field and this string is what reaches the model.
206
+ */
207
+ export declare const PROCESS_STATUS_UNKNOWN = "Unknown: TM1 returned no ProcessExecuteStatusCode \u2014 the run may have completed, partially completed, or never started. Verify server state (error logs, target cube) before re-running.";
208
+ /**
209
+ * Outcome of a CHORE run. Deliberately the same four words as
210
+ * `ProcessOutcome`, because the question is the same one — was anything
211
+ * committed — but the mapping behind them is NOT the process mapping and must
212
+ * never be reused across the two. Measured on 12.5.9; see
213
+ * `tm1-client/services/chore-status.ts` for the table.
214
+ *
215
+ * The headline: a step that calls `ProcessError` COMMITS its writes when it
216
+ * runs inside a chore, while the identical process run on its own rolls them
217
+ * back. Anyone who assumes the process semantics carry over gets that backwards.
218
+ */
219
+ export type ChoreOutcome = "succeeded" | "completed_with_errors" | "rolled_back" | "indeterminate";
220
+ /**
221
+ * Result of a chore run. Same discriminated-union shape as `ProcessResult` so
222
+ * neither `success` nor `outcome` can drift from the status.
223
+ *
224
+ * `statusUnavailable` is the one field with no `ProcessResult` counterpart: on
225
+ * a server without `tm1.ExecuteWithReturn` on Chore (v11 entirely, and v12
226
+ * before 12.5.0) the chore still RUNS, but the API reports nothing back. That
227
+ * is not a failure and not a success — it is the absence of an answer, and it
228
+ * has to be distinguishable from both.
229
+ */
230
+ export type ChoreResult = {
231
+ success: true;
232
+ outcome: "succeeded";
233
+ /** Pinned: the only status a clean chore run carries. */
234
+ choreErrorStatus: "CompletedSuccessfully";
235
+ /**
236
+ * Always present on v12 — a chore writes a `ChoreLog_*.jsonl` even when
237
+ * nothing went wrong, so unlike a process's error log its PRESENCE says
238
+ * nothing about the outcome. Read the status, not this field.
239
+ */
240
+ errorLogFile?: string | undefined;
241
+ statusUnavailable?: false | undefined;
242
+ } | {
243
+ success: false;
244
+ outcome: "completed_with_errors";
245
+ /**
246
+ * TM1's status code, in practice `CompletedWithMessages`. **The chore's
247
+ * writes were COMMITTED, including those of the step that failed** —
248
+ * measured, and the opposite of what the same TI does standalone. Do not
249
+ * re-run blindly.
250
+ */
251
+ choreErrorStatus: string;
252
+ errorLogFile?: string | undefined;
253
+ statusUnavailable?: false | undefined;
254
+ } | {
255
+ success: false;
256
+ outcome: "rolled_back";
257
+ /**
258
+ * TM1's status code, in practice `ProcessRollbackCalled`. HOW MUCH was
259
+ * discarded depends on the chore's `ExecutionMode`: `SingleCommit`
260
+ * discards everything the chore had written up to that point,
261
+ * `MultipleCommit` only the rolling-back step. Later steps still run and
262
+ * still commit under both.
263
+ */
264
+ choreErrorStatus: string;
265
+ errorLogFile?: string | undefined;
266
+ statusUnavailable?: false | undefined;
267
+ } | {
268
+ success: false;
269
+ outcome: "indeterminate";
270
+ /** Says why the outcome is unknown — the only channel for that here. */
271
+ choreErrorStatus: string;
272
+ errorLogFile?: string | undefined;
273
+ /**
274
+ * true = this server cannot report chore status at all (no
275
+ * `tm1.ExecuteWithReturn` on Chore). The chore ran; nothing is known
276
+ * about how it ended. Distinct from "ran and the answer was unreadable".
277
+ */
278
+ statusUnavailable?: boolean | undefined;
279
+ };
280
+ /**
281
+ * Status text for a chore that ran on a server which cannot report back.
282
+ */
283
+ export declare const CHORE_STATUS_UNAVAILABLE = "Unknown: this TM1 build has no tm1.ExecuteWithReturn on Chore (v11, and v12 before 12.5.0), so the chore was started and no status was returned. It may have completed, partially completed, or failed. Check the chore's steps with tm1_get_message_log (v11) or the target cubes before re-running.";
284
+ /**
285
+ * Status text used when a server that DOES support the action answers without
286
+ * a `ChoreExecuteStatusCode`.
287
+ */
288
+ export declare const CHORE_STATUS_UNKNOWN = "Unknown: TM1 returned no ChoreExecuteStatusCode \u2014 the chore may have completed, partially completed, or never started. Verify server state before re-running.";
289
+ export interface ElementCreate {
290
+ name: string;
291
+ type: "Numeric" | "String" | "Consolidated";
292
+ components?: Array<{
293
+ name: string;
294
+ weight: number;
295
+ }> | undefined;
296
+ }
297
+ export interface ElementUpdate {
298
+ newName?: string | undefined;
299
+ type?: "Numeric" | "String" | "Consolidated" | undefined;
300
+ components?: Array<{
301
+ name: string;
302
+ weight: number;
303
+ }> | undefined;
304
+ }
305
+ export interface RuleSyntaxError {
306
+ message: string;
307
+ lineNumber?: number;
308
+ }
309
+ /** One /AuditLogEntries row; details present only when expanded. */
310
+ export interface AuditLogEntry extends AuditLogDetail {
311
+ details?: AuditLogDetail[] | undefined;
312
+ }
313
+ export interface CubeRules {
314
+ cubeName: string;
315
+ rulesText: string;
316
+ skipCheck: boolean;
317
+ /**
318
+ * Ordered dimension names. Only present when the rules were fetched with
319
+ * `withDimensions` — otherwise the caller never asked and the server never
320
+ * expanded them.
321
+ */
322
+ dimensions?: string[];
323
+ }
324
+ export interface ChoreStep {
325
+ process: string;
326
+ parameters: Array<{
327
+ name: string;
328
+ value: string | number;
329
+ }>;
330
+ }
331
+ export interface ChoreCreate {
332
+ name: string;
333
+ startTime: string;
334
+ dstSensitive: boolean;
335
+ active: boolean;
336
+ executionMode: "SingleCommit" | "MultipleCommit";
337
+ frequency: {
338
+ days: number;
339
+ hours: number;
340
+ minutes: number;
341
+ seconds: number;
342
+ };
343
+ steps: ChoreStep[];
344
+ }
345
+ export interface ToolResult {
346
+ content: Array<{
347
+ type: "text";
348
+ text: string;
349
+ }>;
350
+ isError?: boolean;
351
+ }
352
+ export interface ServerInfo {
353
+ serverName: string;
354
+ productVersion: string;
355
+ productEdition?: string | undefined;
356
+ adminHost?: string | undefined;
357
+ dataDirectory?: string | undefined;
358
+ timeZoneId?: string | undefined;
359
+ integratedSecurityMode?: string | undefined;
360
+ extra: Record<string, unknown>;
361
+ }
362
+ export interface CompileResult {
363
+ success: boolean;
364
+ errors: Array<{
365
+ lineNumber?: number | undefined;
366
+ procedure?: string | undefined;
367
+ message: string;
368
+ }>;
369
+ }
370
+ export interface ProcessCheckInput {
371
+ name?: string;
372
+ prolog?: string;
373
+ metadata?: string;
374
+ data?: string;
375
+ epilog?: string;
376
+ parameters?: ProcessParameter[];
377
+ variables?: ProcessVariable[];
378
+ dataSource?: DataSource;
379
+ }
380
+ export interface CubeView {
381
+ name: string;
382
+ mdx?: string | undefined;
383
+ private: boolean;
384
+ }
385
+ export interface TransactionLogResult {
386
+ entries: TransactionLogEntry[];
387
+ /** partial = stopped because `top` filled (older rows may exist); complete = span exhausted. */
388
+ coverage: "complete" | "partial";
389
+ /** Earliest timestamp actually scanned (floor of the walk / the `since` bound). */
390
+ scannedFrom: string;
391
+ }
392
+ export interface SubsetCreate {
393
+ name: string;
394
+ expression?: string | undefined;
395
+ elements?: string[] | undefined;
396
+ alias?: string | undefined;
397
+ }
398
+ export interface ClientCreate {
399
+ name: string;
400
+ password?: string | undefined;
401
+ friendlyName?: string | undefined;
402
+ groups?: string[] | undefined;
403
+ }
404
+ export interface ClientUpdate {
405
+ password?: string | undefined;
406
+ friendlyName?: string | undefined;
407
+ enabled?: boolean | undefined;
408
+ }
409
+ //# sourceMappingURL=types.d.ts.map
package/dist/types.js ADDED
@@ -0,0 +1,91 @@
1
+ // ── Error codes ──────────────────────────────────────────────────────────────
2
+ export const TM1ErrorCode = {
3
+ CONNECTION_FAILED: "CONNECTION_FAILED",
4
+ LOCK_TIMEOUT: "LOCK_TIMEOUT",
5
+ AUTH_FAILED: "AUTH_FAILED",
6
+ PERMISSION_DENIED: "PERMISSION_DENIED",
7
+ NOT_FOUND: "NOT_FOUND",
8
+ CONFLICT: "CONFLICT",
9
+ VALIDATION_ERROR: "VALIDATION_ERROR",
10
+ TM1_ERROR: "TM1_ERROR",
11
+ UNSUPPORTED_OPERATION: "UNSUPPORTED_OPERATION",
12
+ RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE",
13
+ };
14
+ // ── TM1Error ─────────────────────────────────────────────────────────────────
15
+ export class TM1Error extends Error {
16
+ code;
17
+ httpStatus;
18
+ endpoint;
19
+ details;
20
+ // Optional tool-context override. When set, takes precedence over
21
+ // hintForCode(). Tools attach this via attachHint() to provide
22
+ // operation-specific next steps (G4 from MCP best-practices review).
23
+ hintOverride;
24
+ constructor(opts) {
25
+ super(opts.message);
26
+ this.name = "TM1Error";
27
+ this.code = opts.code;
28
+ this.httpStatus = opts.httpStatus;
29
+ this.endpoint = opts.endpoint;
30
+ this.details = opts.details;
31
+ this.hintOverride = opts.hint;
32
+ }
33
+ // Actionable next-step suggestion for an LLM agent. Tool-context override
34
+ // wins over the generic code-derived hint.
35
+ get hint() {
36
+ return this.hintOverride ?? hintForCode(this.code);
37
+ }
38
+ toErrorPayload() {
39
+ return {
40
+ code: this.code,
41
+ message: this.message,
42
+ ...(this.httpStatus !== undefined && { httpStatus: this.httpStatus }),
43
+ ...(this.endpoint !== undefined && { endpoint: this.endpoint }),
44
+ ...(this.details !== undefined && { details: this.details }),
45
+ hint: this.hint,
46
+ };
47
+ }
48
+ }
49
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -- accepts known codes + arbitrary strings for extensibility
50
+ export function hintForCode(code) {
51
+ switch (code) {
52
+ case TM1ErrorCode.AUTH_FAILED:
53
+ return "Re-check TM1_USER/TM1_PASSWORD env vars; call tm1_get_server_info to verify reach.";
54
+ case TM1ErrorCode.PERMISSION_DENIED:
55
+ return "Caller lacks rights for this object/operation. Inspect membership via tm1_list_groups and assign with tm1_assign_client_group.";
56
+ case TM1ErrorCode.NOT_FOUND:
57
+ return "Object does not exist. Use the matching list_* or get_* tool to enumerate available names before retrying.";
58
+ case TM1ErrorCode.CONFLICT:
59
+ return "Object already exists or version mismatch. Fetch current state with the matching get_* tool, then retry.";
60
+ case TM1ErrorCode.VALIDATION_ERROR:
61
+ return "Input failed validation. Inspect the `details` field for the offending value and correct it.";
62
+ case TM1ErrorCode.UNSUPPORTED_OPERATION:
63
+ return "TM1 server version may not support this. Call tm1_get_server_info to check the version.";
64
+ case TM1ErrorCode.CONNECTION_FAILED:
65
+ return "TM1 server unreachable. Verify TM1_BASE_URL/TM1_HOST/TM1_PORT and that the service is running.";
66
+ case TM1ErrorCode.LOCK_TIMEOUT:
67
+ return "Request timed out — TM1 server may be waiting on an exclusive lock held by another session. Use tm1_list_threads to diagnose. Retry after the blocking operation completes.";
68
+ case TM1ErrorCode.RESPONSE_TOO_LARGE:
69
+ return "The result exceeds the response limit (TM1_MAX_RESPONSE_CHARS). Re-issue a narrower call: page with offset/limit, filter, or use the tool's summary mode.";
70
+ case TM1ErrorCode.TM1_ERROR:
71
+ return "Generic TM1 error. Inspect `details` for the raw server message.";
72
+ default:
73
+ return "Unexpected error. Inspect `message`/`details` and retry with corrected input.";
74
+ }
75
+ }
76
+ /**
77
+ * Status text used when TM1 answers an execution without a
78
+ * `ProcessExecuteStatusCode`. Carries its own guidance because `ProcessResult`
79
+ * has no hint field and this string is what reaches the model.
80
+ */
81
+ export const PROCESS_STATUS_UNKNOWN = "Unknown: TM1 returned no ProcessExecuteStatusCode — the run may have completed, partially completed, or never started. Verify server state (error logs, target cube) before re-running.";
82
+ /**
83
+ * Status text for a chore that ran on a server which cannot report back.
84
+ */
85
+ export const CHORE_STATUS_UNAVAILABLE = "Unknown: this TM1 build has no tm1.ExecuteWithReturn on Chore (v11, and v12 before 12.5.0), so the chore was started and no status was returned. It may have completed, partially completed, or failed. Check the chore's steps with tm1_get_message_log (v11) or the target cubes before re-running.";
86
+ /**
87
+ * Status text used when a server that DOES support the action answers without
88
+ * a `ChoreExecuteStatusCode`.
89
+ */
90
+ export const CHORE_STATUS_UNKNOWN = "Unknown: TM1 returned no ChoreExecuteStatusCode — the chore may have completed, partially completed, or never started. Verify server state before re-running.";
91
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,4 @@
1
+ export declare const VERSION: string;
2
+ export declare const NAME: string;
3
+ export declare const PRODUCT: string;
4
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { fileURLToPath } from "node:url";
3
+ import { dirname, join } from "node:path";
4
+ const here = dirname(fileURLToPath(import.meta.url));
5
+ const pkgPath = join(here, "..", "package.json");
6
+ let pkg;
7
+ try {
8
+ pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
9
+ }
10
+ catch {
11
+ pkg = { name: "tm1-mcp-server", version: "unknown" };
12
+ }
13
+ export const VERSION = pkg.version;
14
+ export const NAME = pkg.name;
15
+ // NAME without its npm scope: an HTTP User-Agent product token may not
16
+ // contain "@" or "/".
17
+ export const PRODUCT = NAME.replace(/^@[^/]+\//, "");
18
+ //# sourceMappingURL=version.js.map
package/package.json ADDED
@@ -0,0 +1,107 @@
1
+ {
2
+ "name": "@ffschrattenecker/tm1-mcp-server",
3
+ "version": "6.0.0",
4
+ "description": "MCP server for IBM Planning Analytics / TM1 — full model lifecycle via REST API",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/ffschrattenecker/tm1-mcp-server.git"
8
+ },
9
+ "author": "ffschrattenecker",
10
+ "contributors": [
11
+ "flameY3T1 (original author)"
12
+ ],
13
+ "type": "module",
14
+ "main": "dist/index.js",
15
+ "bin": {
16
+ "tm1-mcp-server": "dist/index.js"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "!dist/**/*.map",
21
+ "NOTICE",
22
+ "CHANGELOG.md"
23
+ ],
24
+ "prettier": {
25
+ "semi": true,
26
+ "singleQuote": false,
27
+ "trailingComma": "all",
28
+ "printWidth": 80,
29
+ "tabWidth": 2,
30
+ "arrowParens": "always",
31
+ "endOfLine": "lf"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc",
35
+ "prepare": "npm run build",
36
+ "prepack": "rm -rf dist && npm run build",
37
+ "prepublishOnly": "npm run verify",
38
+ "start": "node dist/index.js",
39
+ "dev": "tsx src/index.ts",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest",
42
+ "test:unit": "vitest run tests/unit",
43
+ "test:property": "vitest run tests/property",
44
+ "test:live": "vitest run --config vitest.live.config.ts",
45
+ "test:live:nightly": "node scripts/run-live-nightly.mjs",
46
+ "contracts:record": "node scripts/record-wire-contracts.mjs",
47
+ "contracts:verify": "node scripts/record-wire-contracts.mjs tm1-test --verify",
48
+ "smoke:tarball": "node scripts/smoke-tarball.mjs",
49
+ "test:coverage": "vitest run --coverage",
50
+ "coverage:check": "vitest run --coverage && node scripts/check-coverage-ratchet.mjs",
51
+ "coverage:ratchet": "node scripts/check-coverage-ratchet.mjs",
52
+ "typecheck": "tsc --noEmit",
53
+ "typecheck:tests": "tsc -p tsconfig.test.json",
54
+ "lint": "tsc --noEmit && eslint .",
55
+ "lint:no-flat-api": "node scripts/check-no-flat-tm1-methods.mjs",
56
+ "lint:output-schema-budget": "node scripts/check-output-schema-budget.mjs",
57
+ "lint:tool-registration": "node scripts/check-tool-registration.mjs",
58
+ "lint:input-naming": "node scripts/check-no-bare-name-input.mjs",
59
+ "lint:mutation-envelope": "node scripts/check-mutation-envelope.mjs",
60
+ "lint:format": "prettier --check .",
61
+ "format": "prettier --write .",
62
+ "verify": "npm run typecheck && npm run typecheck:tests && npm run lint:no-flat-api && npm run lint:output-schema-budget && npm run lint:tool-registration && npm run lint:input-naming && npm run lint:mutation-envelope && npm run lint:format && npm run lint:eslint && npm run coverage:check",
63
+ "tools:list": "node scripts/gen-tool-list.mjs",
64
+ "tools:update-readme": "node scripts/gen-tool-list.mjs --write-readme",
65
+ "lint:eslint": "eslint ."
66
+ },
67
+ "keywords": [
68
+ "mcp",
69
+ "tm1",
70
+ "planning-analytics",
71
+ "ibm"
72
+ ],
73
+ "license": "MIT",
74
+ "engines": {
75
+ "node": ">=20.0.0"
76
+ },
77
+ "overrides": {
78
+ "fast-uri": "^3.1.5",
79
+ "ip-address": "^10.4.0"
80
+ },
81
+ "dependencies": {
82
+ "@modelcontextprotocol/sdk": "1.30.0",
83
+ "dotenv": "^17.4.1",
84
+ "pino": "^10.3.1",
85
+ "safe-regex": "^2.1.1",
86
+ "undici": "^7.29.0",
87
+ "zod": "4.4.3"
88
+ },
89
+ "devDependencies": {
90
+ "@eslint/js": "^10.0.1",
91
+ "@types/node": "^26.1.1",
92
+ "@types/safe-regex": "^1.1.6",
93
+ "@vitest/coverage-v8": "^4.1.10",
94
+ "eslint": "^10.8.0",
95
+ "fast-check": "^4.9.0",
96
+ "pino-pretty": "^13.1.3",
97
+ "prettier": "^3.9.6",
98
+ "tsx": "^4.21.0",
99
+ "typescript": "^6.0.3",
100
+ "typescript-eslint": "^8.65.0",
101
+ "vitest": "^4.1.10"
102
+ },
103
+ "publishConfig": {
104
+ "access": "public",
105
+ "provenance": true
106
+ }
107
+ }