tm1npm 1.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/.env.example +16 -0
- package/.eslintrc.js +28 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/ISSUE_TEMPLATE/question.md +24 -0
- package/.github/workflows/publish-npm.yml +53 -0
- package/.github/workflows/test-on-tag.yml +172 -0
- package/DEVELOPMENT_GUIDE.md +587 -0
- package/LICENSE +21 -0
- package/README.md +580 -0
- package/jest.ci.config.js +83 -0
- package/jest.config.js +68 -0
- package/lib/exceptions/TM1Exception.d.ts +17 -0
- package/lib/exceptions/TM1Exception.d.ts.map +1 -0
- package/lib/exceptions/TM1Exception.js +36 -0
- package/lib/exceptions/TM1RestException.d.ts +10 -0
- package/lib/exceptions/TM1RestException.d.ts.map +1 -0
- package/lib/exceptions/TM1RestException.js +17 -0
- package/lib/exceptions/TM1TimeoutException.d.ts +9 -0
- package/lib/exceptions/TM1TimeoutException.d.ts.map +1 -0
- package/lib/exceptions/TM1TimeoutException.js +16 -0
- package/lib/index.d.ts +41 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +132 -0
- package/lib/objects/Annotation.d.ts +36 -0
- package/lib/objects/Annotation.d.ts.map +1 -0
- package/lib/objects/Annotation.js +134 -0
- package/lib/objects/Application.d.ts +67 -0
- package/lib/objects/Application.d.ts.map +1 -0
- package/lib/objects/Application.js +125 -0
- package/lib/objects/Axis.d.ts +36 -0
- package/lib/objects/Axis.d.ts.map +1 -0
- package/lib/objects/Axis.js +103 -0
- package/lib/objects/Chore.d.ts +43 -0
- package/lib/objects/Chore.d.ts.map +1 -0
- package/lib/objects/Chore.js +129 -0
- package/lib/objects/ChoreFrequency.d.ts +23 -0
- package/lib/objects/ChoreFrequency.d.ts.map +1 -0
- package/lib/objects/ChoreFrequency.js +61 -0
- package/lib/objects/ChoreStartTime.d.ts +15 -0
- package/lib/objects/ChoreStartTime.d.ts.map +1 -0
- package/lib/objects/ChoreStartTime.js +85 -0
- package/lib/objects/ChoreTask.d.ts +28 -0
- package/lib/objects/ChoreTask.d.ts.map +1 -0
- package/lib/objects/ChoreTask.js +66 -0
- package/lib/objects/Cube.d.ts +26 -0
- package/lib/objects/Cube.d.ts.map +1 -0
- package/lib/objects/Cube.js +109 -0
- package/lib/objects/Dimension.d.ts +26 -0
- package/lib/objects/Dimension.d.ts.map +1 -0
- package/lib/objects/Dimension.js +86 -0
- package/lib/objects/Element.d.ts +35 -0
- package/lib/objects/Element.d.ts.map +1 -0
- package/lib/objects/Element.js +115 -0
- package/lib/objects/ElementAttribute.d.ts +28 -0
- package/lib/objects/ElementAttribute.d.ts.map +1 -0
- package/lib/objects/ElementAttribute.js +97 -0
- package/lib/objects/Git.d.ts +21 -0
- package/lib/objects/Git.d.ts.map +1 -0
- package/lib/objects/Git.js +49 -0
- package/lib/objects/GitCommit.d.ts +12 -0
- package/lib/objects/GitCommit.d.ts.map +1 -0
- package/lib/objects/GitCommit.js +26 -0
- package/lib/objects/GitPlan.d.ts +35 -0
- package/lib/objects/GitPlan.d.ts.map +1 -0
- package/lib/objects/GitPlan.js +78 -0
- package/lib/objects/GitRemote.d.ts +12 -0
- package/lib/objects/GitRemote.d.ts.map +1 -0
- package/lib/objects/GitRemote.js +26 -0
- package/lib/objects/Hierarchy.d.ts +47 -0
- package/lib/objects/Hierarchy.d.ts.map +1 -0
- package/lib/objects/Hierarchy.js +165 -0
- package/lib/objects/MDXView.d.ts +19 -0
- package/lib/objects/MDXView.d.ts.map +1 -0
- package/lib/objects/MDXView.js +67 -0
- package/lib/objects/NativeView.d.ts +39 -0
- package/lib/objects/NativeView.d.ts.map +1 -0
- package/lib/objects/NativeView.js +209 -0
- package/lib/objects/Process.d.ts +70 -0
- package/lib/objects/Process.d.ts.map +1 -0
- package/lib/objects/Process.js +210 -0
- package/lib/objects/ProcessDebugBreakpoint.d.ts +60 -0
- package/lib/objects/ProcessDebugBreakpoint.d.ts.map +1 -0
- package/lib/objects/ProcessDebugBreakpoint.js +168 -0
- package/lib/objects/ProcessParameter.d.ts +23 -0
- package/lib/objects/ProcessParameter.d.ts.map +1 -0
- package/lib/objects/ProcessParameter.js +55 -0
- package/lib/objects/ProcessVariable.d.ts +26 -0
- package/lib/objects/ProcessVariable.d.ts.map +1 -0
- package/lib/objects/ProcessVariable.js +63 -0
- package/lib/objects/Rules.d.ts +30 -0
- package/lib/objects/Rules.d.ts.map +1 -0
- package/lib/objects/Rules.js +103 -0
- package/lib/objects/Sandbox.d.ts +21 -0
- package/lib/objects/Sandbox.d.ts.map +1 -0
- package/lib/objects/Sandbox.js +64 -0
- package/lib/objects/Server.d.ts +27 -0
- package/lib/objects/Server.d.ts.map +1 -0
- package/lib/objects/Server.js +26 -0
- package/lib/objects/Subset.d.ts +44 -0
- package/lib/objects/Subset.d.ts.map +1 -0
- package/lib/objects/Subset.js +222 -0
- package/lib/objects/TM1Object.d.ts +8 -0
- package/lib/objects/TM1Object.d.ts.map +1 -0
- package/lib/objects/TM1Object.js +17 -0
- package/lib/objects/TM1Project.d.ts +74 -0
- package/lib/objects/TM1Project.d.ts.map +1 -0
- package/lib/objects/TM1Project.js +409 -0
- package/lib/objects/User.d.ts +42 -0
- package/lib/objects/User.d.ts.map +1 -0
- package/lib/objects/User.js +157 -0
- package/lib/objects/View.d.ts +19 -0
- package/lib/objects/View.d.ts.map +1 -0
- package/lib/objects/View.js +33 -0
- package/lib/objects/index.d.ts +30 -0
- package/lib/objects/index.d.ts.map +1 -0
- package/lib/objects/index.js +68 -0
- package/lib/services/AnnotationService.d.ts +17 -0
- package/lib/services/AnnotationService.d.ts.map +1 -0
- package/lib/services/AnnotationService.js +91 -0
- package/lib/services/ApplicationService.d.ts +21 -0
- package/lib/services/ApplicationService.d.ts.map +1 -0
- package/lib/services/ApplicationService.js +227 -0
- package/lib/services/AuditLogService.d.ts +15 -0
- package/lib/services/AuditLogService.d.ts.map +1 -0
- package/lib/services/AuditLogService.js +153 -0
- package/lib/services/CellService.d.ts +191 -0
- package/lib/services/CellService.d.ts.map +1 -0
- package/lib/services/CellService.js +597 -0
- package/lib/services/ChoreService.d.ts +24 -0
- package/lib/services/ChoreService.d.ts.map +1 -0
- package/lib/services/ChoreService.js +219 -0
- package/lib/services/ConfigurationService.d.ts +18 -0
- package/lib/services/ConfigurationService.d.ts.map +1 -0
- package/lib/services/ConfigurationService.js +60 -0
- package/lib/services/CubeService.d.ts +43 -0
- package/lib/services/CubeService.d.ts.map +1 -0
- package/lib/services/CubeService.js +296 -0
- package/lib/services/DimensionService.d.ts +21 -0
- package/lib/services/DimensionService.d.ts.map +1 -0
- package/lib/services/DimensionService.js +146 -0
- package/lib/services/ElementService.d.ts +132 -0
- package/lib/services/ElementService.d.ts.map +1 -0
- package/lib/services/ElementService.js +579 -0
- package/lib/services/FileService.d.ts +14 -0
- package/lib/services/FileService.d.ts.map +1 -0
- package/lib/services/FileService.js +65 -0
- package/lib/services/GitService.d.ts +23 -0
- package/lib/services/GitService.d.ts.map +1 -0
- package/lib/services/GitService.js +225 -0
- package/lib/services/HierarchyService.d.ts +32 -0
- package/lib/services/HierarchyService.d.ts.map +1 -0
- package/lib/services/HierarchyService.js +235 -0
- package/lib/services/JobService.d.ts +13 -0
- package/lib/services/JobService.d.ts.map +1 -0
- package/lib/services/JobService.js +83 -0
- package/lib/services/LoggerService.d.ts +16 -0
- package/lib/services/LoggerService.d.ts.map +1 -0
- package/lib/services/LoggerService.js +101 -0
- package/lib/services/ManageService.d.ts +47 -0
- package/lib/services/ManageService.d.ts.map +1 -0
- package/lib/services/ManageService.js +221 -0
- package/lib/services/MessageLogService.d.ts +13 -0
- package/lib/services/MessageLogService.d.ts.map +1 -0
- package/lib/services/MessageLogService.js +175 -0
- package/lib/services/MonitoringService.d.ts +29 -0
- package/lib/services/MonitoringService.d.ts.map +1 -0
- package/lib/services/MonitoringService.js +86 -0
- package/lib/services/ObjectService.d.ts +8 -0
- package/lib/services/ObjectService.d.ts.map +1 -0
- package/lib/services/ObjectService.js +20 -0
- package/lib/services/PowerBiService.d.ts +13 -0
- package/lib/services/PowerBiService.d.ts.map +1 -0
- package/lib/services/PowerBiService.js +52 -0
- package/lib/services/ProcessService.d.ts +57 -0
- package/lib/services/ProcessService.d.ts.map +1 -0
- package/lib/services/ProcessService.js +499 -0
- package/lib/services/RestService.d.ts +68 -0
- package/lib/services/RestService.d.ts.map +1 -0
- package/lib/services/RestService.js +166 -0
- package/lib/services/SandboxService.d.ts +28 -0
- package/lib/services/SandboxService.d.ts.map +1 -0
- package/lib/services/SandboxService.js +197 -0
- package/lib/services/SecurityService.d.ts +33 -0
- package/lib/services/SecurityService.d.ts.map +1 -0
- package/lib/services/SecurityService.js +249 -0
- package/lib/services/ServerService.d.ts +55 -0
- package/lib/services/ServerService.d.ts.map +1 -0
- package/lib/services/ServerService.js +247 -0
- package/lib/services/SessionService.d.ts +15 -0
- package/lib/services/SessionService.d.ts.map +1 -0
- package/lib/services/SessionService.js +68 -0
- package/lib/services/SubsetService.d.ts +13 -0
- package/lib/services/SubsetService.d.ts.map +1 -0
- package/lib/services/SubsetService.js +46 -0
- package/lib/services/TM1Service.d.ts +39 -0
- package/lib/services/TM1Service.d.ts.map +1 -0
- package/lib/services/TM1Service.js +94 -0
- package/lib/services/ThreadService.d.ts +15 -0
- package/lib/services/ThreadService.d.ts.map +1 -0
- package/lib/services/ThreadService.js +104 -0
- package/lib/services/TransactionLogService.d.ts +11 -0
- package/lib/services/TransactionLogService.d.ts.map +1 -0
- package/lib/services/TransactionLogService.js +124 -0
- package/lib/services/UserService.d.ts +14 -0
- package/lib/services/UserService.d.ts.map +1 -0
- package/lib/services/UserService.js +103 -0
- package/lib/services/ViewService.d.ts +30 -0
- package/lib/services/ViewService.d.ts.map +1 -0
- package/lib/services/ViewService.js +331 -0
- package/lib/services/index.d.ts +26 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +56 -0
- package/lib/tests/100PercentParityCheck.test.d.ts +6 -0
- package/lib/tests/100PercentParityCheck.test.d.ts.map +1 -0
- package/lib/tests/100PercentParityCheck.test.js +143 -0
- package/lib/tests/basic.test.d.ts +6 -0
- package/lib/tests/basic.test.d.ts.map +1 -0
- package/lib/tests/basic.test.js +52 -0
- package/lib/tests/cellService.test.d.ts +6 -0
- package/lib/tests/cellService.test.d.ts.map +1 -0
- package/lib/tests/cellService.test.js +311 -0
- package/lib/tests/ciSetup.d.ts +6 -0
- package/lib/tests/ciSetup.d.ts.map +1 -0
- package/lib/tests/ciSetup.js +23 -0
- package/lib/tests/comprehensive.service.test.d.ts +6 -0
- package/lib/tests/comprehensive.service.test.d.ts.map +1 -0
- package/lib/tests/comprehensive.service.test.js +507 -0
- package/lib/tests/connection.test.d.ts +6 -0
- package/lib/tests/connection.test.d.ts.map +1 -0
- package/lib/tests/connection.test.js +89 -0
- package/lib/tests/cubeService.test.d.ts +6 -0
- package/lib/tests/cubeService.test.d.ts.map +1 -0
- package/lib/tests/cubeService.test.js +368 -0
- package/lib/tests/dimensionService.comprehensive.test.d.ts +7 -0
- package/lib/tests/dimensionService.comprehensive.test.d.ts.map +1 -0
- package/lib/tests/dimensionService.comprehensive.test.js +614 -0
- package/lib/tests/dimensionService.test.d.ts +6 -0
- package/lib/tests/dimensionService.test.d.ts.map +1 -0
- package/lib/tests/dimensionService.test.js +293 -0
- package/lib/tests/edgeCases.test.d.ts +6 -0
- package/lib/tests/edgeCases.test.d.ts.map +1 -0
- package/lib/tests/edgeCases.test.js +301 -0
- package/lib/tests/elementService.comprehensive.test.d.ts +7 -0
- package/lib/tests/elementService.comprehensive.test.d.ts.map +1 -0
- package/lib/tests/elementService.comprehensive.test.js +846 -0
- package/lib/tests/elementService.test.d.ts +6 -0
- package/lib/tests/elementService.test.d.ts.map +1 -0
- package/lib/tests/elementService.test.js +350 -0
- package/lib/tests/enhancedCellService.test.d.ts +2 -0
- package/lib/tests/enhancedCellService.test.d.ts.map +1 -0
- package/lib/tests/enhancedCellService.test.js +152 -0
- package/lib/tests/enhancedCubeService.test.d.ts +2 -0
- package/lib/tests/enhancedCubeService.test.d.ts.map +1 -0
- package/lib/tests/enhancedCubeService.test.js +246 -0
- package/lib/tests/enhancedElementService.test.d.ts +2 -0
- package/lib/tests/enhancedElementService.test.d.ts.map +1 -0
- package/lib/tests/enhancedElementService.test.js +199 -0
- package/lib/tests/enhancedViewService.test.d.ts +2 -0
- package/lib/tests/enhancedViewService.test.d.ts.map +1 -0
- package/lib/tests/enhancedViewService.test.js +260 -0
- package/lib/tests/errorHandling.test.d.ts +6 -0
- package/lib/tests/errorHandling.test.d.ts.map +1 -0
- package/lib/tests/errorHandling.test.js +227 -0
- package/lib/tests/exceptions.test.d.ts +7 -0
- package/lib/tests/exceptions.test.d.ts.map +1 -0
- package/lib/tests/exceptions.test.js +257 -0
- package/lib/tests/hierarchyService.test.d.ts +6 -0
- package/lib/tests/hierarchyService.test.d.ts.map +1 -0
- package/lib/tests/hierarchyService.test.js +294 -0
- package/lib/tests/index.test.d.ts +6 -0
- package/lib/tests/index.test.d.ts.map +1 -0
- package/lib/tests/index.test.js +346 -0
- package/lib/tests/integration.test.d.ts +6 -0
- package/lib/tests/integration.test.d.ts.map +1 -0
- package/lib/tests/integration.test.js +302 -0
- package/lib/tests/integrationTests.test.d.ts +2 -0
- package/lib/tests/integrationTests.test.d.ts.map +1 -0
- package/lib/tests/integrationTests.test.js +252 -0
- package/lib/tests/mdx.advanced.test.d.ts +6 -0
- package/lib/tests/mdx.advanced.test.d.ts.map +1 -0
- package/lib/tests/mdx.advanced.test.js +437 -0
- package/lib/tests/objects.improved.test.d.ts +7 -0
- package/lib/tests/objects.improved.test.d.ts.map +1 -0
- package/lib/tests/objects.improved.test.js +302 -0
- package/lib/tests/performance.test.d.ts +6 -0
- package/lib/tests/performance.test.d.ts.map +1 -0
- package/lib/tests/performance.test.js +264 -0
- package/lib/tests/processService.comprehensive.test.d.ts +7 -0
- package/lib/tests/processService.comprehensive.test.d.ts.map +1 -0
- package/lib/tests/processService.comprehensive.test.js +656 -0
- package/lib/tests/processService.test.d.ts +6 -0
- package/lib/tests/processService.test.d.ts.map +1 -0
- package/lib/tests/processService.test.js +322 -0
- package/lib/tests/restService.test.d.ts +6 -0
- package/lib/tests/restService.test.d.ts.map +1 -0
- package/lib/tests/restService.test.js +177 -0
- package/lib/tests/security.advanced.test.d.ts +6 -0
- package/lib/tests/security.advanced.test.d.ts.map +1 -0
- package/lib/tests/security.advanced.test.js +407 -0
- package/lib/tests/security.test.d.ts +6 -0
- package/lib/tests/security.test.d.ts.map +1 -0
- package/lib/tests/security.test.js +204 -0
- package/lib/tests/securityService.comprehensive.test.d.ts +7 -0
- package/lib/tests/securityService.comprehensive.test.d.ts.map +1 -0
- package/lib/tests/securityService.comprehensive.test.js +457 -0
- package/lib/tests/setup.d.ts +4 -0
- package/lib/tests/setup.d.ts.map +1 -0
- package/lib/tests/setup.js +40 -0
- package/lib/tests/simpleCoverage.test.d.ts +6 -0
- package/lib/tests/simpleCoverage.test.d.ts.map +1 -0
- package/lib/tests/simpleCoverage.test.js +236 -0
- package/lib/tests/stress.performance.test.d.ts +6 -0
- package/lib/tests/stress.performance.test.d.ts.map +1 -0
- package/lib/tests/stress.performance.test.js +423 -0
- package/lib/tests/subsetService.test.d.ts +6 -0
- package/lib/tests/subsetService.test.d.ts.map +1 -0
- package/lib/tests/subsetService.test.js +271 -0
- package/lib/tests/testConfig.d.ts +18 -0
- package/lib/tests/testConfig.d.ts.map +1 -0
- package/lib/tests/testConfig.js +38 -0
- package/lib/tests/testUtils.d.ts +9 -0
- package/lib/tests/testUtils.d.ts.map +1 -0
- package/lib/tests/testUtils.js +100 -0
- package/lib/tests/tm1Service.test.d.ts +7 -0
- package/lib/tests/tm1Service.test.d.ts.map +1 -0
- package/lib/tests/tm1Service.test.js +290 -0
- package/lib/tests/viewService.test.d.ts +6 -0
- package/lib/tests/viewService.test.d.ts.map +1 -0
- package/lib/tests/viewService.test.js +240 -0
- package/lib/utils/Utils.d.ts +90 -0
- package/lib/utils/Utils.d.ts.map +1 -0
- package/lib/utils/Utils.js +379 -0
- package/package.json +81 -0
- package/run-all-tests.js +296 -0
- package/src/exceptions/TM1Exception.ts +38 -0
- package/src/exceptions/TM1RestException.ts +17 -0
- package/src/exceptions/TM1TimeoutException.ts +15 -0
- package/src/index.ts +94 -0
- package/src/objects/Annotation.ts +194 -0
- package/src/objects/Application.ts +146 -0
- package/src/objects/Axis.ts +149 -0
- package/src/objects/Chore.ts +174 -0
- package/src/objects/ChoreFrequency.ts +83 -0
- package/src/objects/ChoreStartTime.ts +111 -0
- package/src/objects/ChoreTask.ts +92 -0
- package/src/objects/Cube.ts +125 -0
- package/src/objects/Dimension.ts +107 -0
- package/src/objects/Element.ts +153 -0
- package/src/objects/ElementAttribute.ts +115 -0
- package/src/objects/Git.ts +86 -0
- package/src/objects/GitCommit.ts +31 -0
- package/src/objects/GitPlan.ts +121 -0
- package/src/objects/GitRemote.ts +31 -0
- package/src/objects/Hierarchy.ts +229 -0
- package/src/objects/MDXView.ts +91 -0
- package/src/objects/NativeView.ts +268 -0
- package/src/objects/Process.ts +320 -0
- package/src/objects/ProcessDebugBreakpoint.ts +239 -0
- package/src/objects/ProcessParameter.ts +76 -0
- package/src/objects/ProcessVariable.ts +89 -0
- package/src/objects/Rules.ts +117 -0
- package/src/objects/Sandbox.ts +90 -0
- package/src/objects/Server.ts +45 -0
- package/src/objects/Subset.ts +323 -0
- package/src/objects/TM1Object.ts +17 -0
- package/src/objects/TM1Project.ts +587 -0
- package/src/objects/User.ts +198 -0
- package/src/objects/View.ts +43 -0
- package/src/objects/index.ts +36 -0
- package/src/services/AnnotationService.ts +107 -0
- package/src/services/ApplicationService.ts +279 -0
- package/src/services/AuditLogService.ts +172 -0
- package/src/services/CellService.ts +814 -0
- package/src/services/ChoreService.ts +219 -0
- package/src/services/ConfigurationService.ts +69 -0
- package/src/services/CubeService.ts +338 -0
- package/src/services/DimensionService.ts +168 -0
- package/src/services/ElementService.ts +966 -0
- package/src/services/FileService.ts +67 -0
- package/src/services/GitService.ts +324 -0
- package/src/services/HierarchyService.ts +284 -0
- package/src/services/JobService.ts +59 -0
- package/src/services/LoggerService.ts +118 -0
- package/src/services/ManageService.ts +322 -0
- package/src/services/MessageLogService.ts +211 -0
- package/src/services/MonitoringService.ts +105 -0
- package/src/services/ObjectService.ts +21 -0
- package/src/services/PowerBiService.ts +85 -0
- package/src/services/ProcessService.ts +589 -0
- package/src/services/RestService.ts +224 -0
- package/src/services/SandboxService.ts +217 -0
- package/src/services/SecurityService.ts +284 -0
- package/src/services/ServerService.ts +313 -0
- package/src/services/SessionService.ts +81 -0
- package/src/services/SubsetService.ts +52 -0
- package/src/services/TM1Service.ts +133 -0
- package/src/services/ThreadService.ts +83 -0
- package/src/services/TransactionLogService.ts +148 -0
- package/src/services/UserService.ts +77 -0
- package/src/services/ViewService.ts +398 -0
- package/src/services/index.ts +28 -0
- package/src/tests/100PercentParityCheck.test.ts +166 -0
- package/src/tests/basic.test.ts +59 -0
- package/src/tests/cellService.test.ts +405 -0
- package/src/tests/ciSetup.ts +26 -0
- package/src/tests/comprehensive.service.test.ts +653 -0
- package/src/tests/config.ini.template +23 -0
- package/src/tests/connection.test.ts +90 -0
- package/src/tests/cubeService.test.ts +458 -0
- package/src/tests/dimensionService.comprehensive.test.ts +786 -0
- package/src/tests/dimensionService.test.ts +373 -0
- package/src/tests/edgeCases.test.ts +358 -0
- package/src/tests/elementService.comprehensive.test.ts +1190 -0
- package/src/tests/elementService.test.ts +472 -0
- package/src/tests/enhancedCellService.test.ts +237 -0
- package/src/tests/enhancedCubeService.test.ts +384 -0
- package/src/tests/enhancedElementService.test.ts +301 -0
- package/src/tests/enhancedViewService.test.ts +373 -0
- package/src/tests/errorHandling.test.ts +264 -0
- package/src/tests/exceptions.test.ts +313 -0
- package/src/tests/hierarchyService.test.ts +386 -0
- package/src/tests/index.test.ts +376 -0
- package/src/tests/integration.test.ts +333 -0
- package/src/tests/integrationTests.test.ts +302 -0
- package/src/tests/mdx.advanced.test.ts +513 -0
- package/src/tests/objects.improved.test.ts +385 -0
- package/src/tests/performance.test.ts +314 -0
- package/src/tests/processService.comprehensive.test.ts +933 -0
- package/src/tests/processService.test.ts +409 -0
- package/src/tests/restService.test.ts +218 -0
- package/src/tests/security.advanced.test.ts +464 -0
- package/src/tests/security.test.ts +233 -0
- package/src/tests/securityService.comprehensive.test.ts +582 -0
- package/src/tests/setup.ts +42 -0
- package/src/tests/simpleCoverage.test.ts +287 -0
- package/src/tests/stress.performance.test.ts +531 -0
- package/src/tests/subsetService.test.ts +350 -0
- package/src/tests/testConfig.ts +53 -0
- package/src/tests/testUtils.ts +94 -0
- package/src/tests/tm1Service.test.ts +361 -0
- package/src/tests/viewService.test.ts +324 -0
- package/src/utils/Utils.ts +395 -0
- package/tests/README.md +57 -0
- package/tests/connection/test-connection.ts +86 -0
- package/tests/edge-cases/edge-cases-test.ts +244 -0
- package/tests/integration/working-test.ts +193 -0
- package/tests/performance/performance-test.ts +133 -0
- package/tests/run-all-tests.sh +106 -0
- package/tests/security/security-test.ts +103 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { View } from './View';
|
|
2
|
+
import { ViewAxisSelection, ViewTitleSelection } from './Axis';
|
|
3
|
+
import { Subset, AnonymousSubset } from './Subset';
|
|
4
|
+
import { caseAndSpaceInsensitiveEquals, readObjectNameFromUrl } from '../utils/Utils';
|
|
5
|
+
|
|
6
|
+
export class NativeView extends View {
|
|
7
|
+
/** Abstraction of TM1 NativeView (classic cube view)
|
|
8
|
+
*
|
|
9
|
+
* :Notes:
|
|
10
|
+
* Complete, functional and tested
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
private _suppressEmptyColumns: boolean;
|
|
14
|
+
private _suppressEmptyRows: boolean;
|
|
15
|
+
private _formatString: string;
|
|
16
|
+
private _titles: ViewTitleSelection[];
|
|
17
|
+
private _columns: ViewAxisSelection[];
|
|
18
|
+
private _rows: ViewAxisSelection[];
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
cubeName: string,
|
|
22
|
+
viewName: string,
|
|
23
|
+
suppressEmptyColumns: boolean = false,
|
|
24
|
+
suppressEmptyRows: boolean = false,
|
|
25
|
+
formatString: string = "0.#########",
|
|
26
|
+
titles?: Iterable<ViewTitleSelection>,
|
|
27
|
+
columns?: Iterable<ViewAxisSelection>,
|
|
28
|
+
rows?: Iterable<ViewAxisSelection>
|
|
29
|
+
) {
|
|
30
|
+
super(cubeName, viewName);
|
|
31
|
+
this._suppressEmptyColumns = suppressEmptyColumns;
|
|
32
|
+
this._suppressEmptyRows = suppressEmptyRows;
|
|
33
|
+
this._formatString = formatString;
|
|
34
|
+
this._titles = titles ? Array.from(titles) : [];
|
|
35
|
+
this._columns = columns ? Array.from(columns) : [];
|
|
36
|
+
this._rows = rows ? Array.from(rows) : [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public get body(): string {
|
|
40
|
+
return this.constructBody();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public get rows(): ViewAxisSelection[] {
|
|
44
|
+
return this._rows;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public get columns(): ViewAxisSelection[] {
|
|
48
|
+
return this._columns;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public get titles(): ViewTitleSelection[] {
|
|
52
|
+
return this._titles;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public get mdx(): string {
|
|
56
|
+
return this.asMDX;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public get MDX(): string {
|
|
60
|
+
return this.asMDX;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public get asMDX(): string {
|
|
64
|
+
/** Build a valid MDX Query from an Existing cubeview.
|
|
65
|
+
* Takes Zero suppression into account.
|
|
66
|
+
* Throws an Exception when no elements are place on the columns.
|
|
67
|
+
* Subsets are referenced in the result-MDX through the TM1SubsetToSet Function
|
|
68
|
+
*
|
|
69
|
+
* :return: String, the MDX Query
|
|
70
|
+
*/
|
|
71
|
+
if (!this.columns || this.columns.length === 0) {
|
|
72
|
+
throw new Error("Column selection must not be empty");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Basic MDX construction - this would need a full MDX builder implementation
|
|
76
|
+
let mdx = "SELECT ";
|
|
77
|
+
|
|
78
|
+
// Build column axis
|
|
79
|
+
const columnSets: string[] = [];
|
|
80
|
+
for (const columnSelection of this.columns) {
|
|
81
|
+
const subset = columnSelection.subset;
|
|
82
|
+
if (subset instanceof AnonymousSubset) {
|
|
83
|
+
if (subset.expression) {
|
|
84
|
+
columnSets.push(subset.expression);
|
|
85
|
+
} else {
|
|
86
|
+
const members = subset.elements.map(e => `[${subset.dimensionName}].[${e}]`);
|
|
87
|
+
columnSets.push(`{${members.join(', ')}}`);
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
columnSets.push(`TM1SubsetToSet([${subset.dimensionName}], "${subset.name}")`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (this._suppressEmptyColumns) {
|
|
95
|
+
mdx += `NON EMPTY (${columnSets.join(' * ')}) ON COLUMNS`;
|
|
96
|
+
} else {
|
|
97
|
+
mdx += `(${columnSets.join(' * ')}) ON COLUMNS`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Build row axis if exists
|
|
101
|
+
if (this.rows && this.rows.length > 0) {
|
|
102
|
+
const rowSets: string[] = [];
|
|
103
|
+
for (const rowSelection of this.rows) {
|
|
104
|
+
const subset = rowSelection.subset;
|
|
105
|
+
if (subset instanceof AnonymousSubset) {
|
|
106
|
+
if (subset.expression) {
|
|
107
|
+
rowSets.push(subset.expression);
|
|
108
|
+
} else {
|
|
109
|
+
const members = subset.elements.map(e => `[${subset.dimensionName}].[${e}]`);
|
|
110
|
+
rowSets.push(`{${members.join(', ')}}`);
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
rowSets.push(`TM1SubsetToSet([${subset.dimensionName}], "${subset.name}")`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (this._suppressEmptyRows) {
|
|
118
|
+
mdx += `, NON EMPTY (${rowSets.join(' * ')}) ON ROWS`;
|
|
119
|
+
} else {
|
|
120
|
+
mdx += `, (${rowSets.join(' * ')}) ON ROWS`;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
mdx += ` FROM [${this.cube}]`;
|
|
125
|
+
|
|
126
|
+
// Add WHERE clause for titles
|
|
127
|
+
if (this.titles && this.titles.length > 0) {
|
|
128
|
+
const titleSelections: string[] = [];
|
|
129
|
+
for (const title of this.titles) {
|
|
130
|
+
if (title.selected && title.selected.length > 0) {
|
|
131
|
+
titleSelections.push(`[${title.dimensionName}].[${title.selected[0]}]`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (titleSelections.length > 0) {
|
|
135
|
+
mdx += ` WHERE (${titleSelections.join(', ')})`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return mdx;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public get suppressEmptyColumns(): boolean {
|
|
143
|
+
return this._suppressEmptyColumns;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
public set suppressEmptyColumns(value: boolean) {
|
|
147
|
+
this._suppressEmptyColumns = value;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
public get suppressEmptyRows(): boolean {
|
|
151
|
+
return this._suppressEmptyRows;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public set suppressEmptyRows(value: boolean) {
|
|
155
|
+
this._suppressEmptyRows = value;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public get formatString(): string {
|
|
159
|
+
return this._formatString;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
public set formatString(value: string) {
|
|
163
|
+
this._formatString = value;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public addTitle(title: ViewTitleSelection): void {
|
|
167
|
+
this._titles.push(title);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public addColumn(column: ViewAxisSelection): void {
|
|
171
|
+
this._columns.push(column);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public addRow(row: ViewAxisSelection): void {
|
|
175
|
+
this._rows.push(row);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
public removeTitle(dimensionName: string): boolean {
|
|
179
|
+
const index = this._titles.findIndex(t =>
|
|
180
|
+
caseAndSpaceInsensitiveEquals(t.dimensionName, dimensionName));
|
|
181
|
+
if (index !== -1) {
|
|
182
|
+
this._titles.splice(index, 1);
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public removeColumn(dimensionName: string): boolean {
|
|
189
|
+
const index = this._columns.findIndex(c =>
|
|
190
|
+
caseAndSpaceInsensitiveEquals(c.subset.dimensionName, dimensionName));
|
|
191
|
+
if (index !== -1) {
|
|
192
|
+
this._columns.splice(index, 1);
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public removeRow(dimensionName: string): boolean {
|
|
199
|
+
const index = this._rows.findIndex(r =>
|
|
200
|
+
caseAndSpaceInsensitiveEquals(r.subset.dimensionName, dimensionName));
|
|
201
|
+
if (index !== -1) {
|
|
202
|
+
this._rows.splice(index, 1);
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
public static fromJSON(viewAsJson: string, cubeName: string): NativeView {
|
|
209
|
+
const viewAsDict = JSON.parse(viewAsJson);
|
|
210
|
+
return NativeView.fromDict(viewAsDict, cubeName);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
public static fromDict(viewAsDict: any, cubeName: string): NativeView {
|
|
214
|
+
const view = new NativeView(
|
|
215
|
+
cubeName,
|
|
216
|
+
viewAsDict.Name,
|
|
217
|
+
viewAsDict.SuppressEmptyColumns || false,
|
|
218
|
+
viewAsDict.SuppressEmptyRows || false,
|
|
219
|
+
viewAsDict.FormatString || "0.#########"
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
// Parse titles
|
|
223
|
+
if (viewAsDict.Titles) {
|
|
224
|
+
for (const titleDict of viewAsDict.Titles) {
|
|
225
|
+
const title = ViewTitleSelection.fromDict(titleDict);
|
|
226
|
+
view.addTitle(title);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Parse columns
|
|
231
|
+
if (viewAsDict.Columns) {
|
|
232
|
+
for (const columnDict of viewAsDict.Columns) {
|
|
233
|
+
const column = ViewAxisSelection.fromDict(columnDict);
|
|
234
|
+
view.addColumn(column);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Parse rows
|
|
239
|
+
if (viewAsDict.Rows) {
|
|
240
|
+
for (const rowDict of viewAsDict.Rows) {
|
|
241
|
+
const row = ViewAxisSelection.fromDict(rowDict);
|
|
242
|
+
view.addRow(row);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return view;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
private constructBody(): string {
|
|
250
|
+
const viewAsDict: any = {};
|
|
251
|
+
viewAsDict['@odata.type'] = 'ibm.tm1.api.v1.NativeView';
|
|
252
|
+
viewAsDict['Name'] = this._name;
|
|
253
|
+
viewAsDict['SuppressEmptyColumns'] = this._suppressEmptyColumns;
|
|
254
|
+
viewAsDict['SuppressEmptyRows'] = this._suppressEmptyRows;
|
|
255
|
+
viewAsDict['FormatString'] = this._formatString;
|
|
256
|
+
|
|
257
|
+
// Add titles
|
|
258
|
+
viewAsDict['Titles'] = this._titles.map(title => title.bodyAsDict);
|
|
259
|
+
|
|
260
|
+
// Add columns
|
|
261
|
+
viewAsDict['Columns'] = this._columns.map(column => column.bodyAsDict);
|
|
262
|
+
|
|
263
|
+
// Add rows
|
|
264
|
+
viewAsDict['Rows'] = this._rows.map(row => row.bodyAsDict);
|
|
265
|
+
|
|
266
|
+
return JSON.stringify(viewAsDict);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { TM1Object } from './TM1Object';
|
|
2
|
+
import { verifyVersion } from '../utils/Utils';
|
|
3
|
+
|
|
4
|
+
export class Process extends TM1Object {
|
|
5
|
+
/** Abstraction of a TM1 Process.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT. doesn't work with Processes that were generated through the Wizard
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** the auto_generated_string code is required to be in all code-tabs. */
|
|
11
|
+
public static readonly BEGIN_GENERATED_STATEMENTS = "#****Begin: Generated Statements***";
|
|
12
|
+
public static readonly END_GENERATED_STATEMENTS = "#****End: Generated Statements****";
|
|
13
|
+
public static readonly AUTO_GENERATED_STATEMENTS = `${Process.BEGIN_GENERATED_STATEMENTS}\r\n${Process.END_GENERATED_STATEMENTS}\r\n`;
|
|
14
|
+
public static readonly MAX_STATEMENTS = 16_380;
|
|
15
|
+
public static readonly MAX_STATEMENTS_POST_11_8_015 = 100_000;
|
|
16
|
+
|
|
17
|
+
private _name: string;
|
|
18
|
+
private _hasSecurityAccess: boolean;
|
|
19
|
+
private _uiData: string;
|
|
20
|
+
private _parameters: any[];
|
|
21
|
+
private _variables: any[];
|
|
22
|
+
private _variablesUiData: any[];
|
|
23
|
+
private _prologProcedure: string;
|
|
24
|
+
private _metadataProcedure: string;
|
|
25
|
+
private _dataProcedure: string;
|
|
26
|
+
private _epilogProcedure: string;
|
|
27
|
+
private _datasourceType: string;
|
|
28
|
+
private _datasourceAsciiDecimalSeparator: string;
|
|
29
|
+
private _datasourceAsciiDelimiterChar: string;
|
|
30
|
+
private _datasourceAsciiDelimiterType: string;
|
|
31
|
+
private _datasourceAsciiHeaderRecords: number;
|
|
32
|
+
private _datasourceAsciiQuoteCharacter: string;
|
|
33
|
+
private _datasourceAsciiThousandSeparator: string;
|
|
34
|
+
private _datasourceDataSourceNameForClient: string;
|
|
35
|
+
private _datasourceDataSourceNameForServer: string;
|
|
36
|
+
private _datasourcePassword: string;
|
|
37
|
+
private _datasourceUserName: string;
|
|
38
|
+
private _datasourceQuery: string;
|
|
39
|
+
private _datasourceUsesUnicode: boolean;
|
|
40
|
+
private _datasourceView: string;
|
|
41
|
+
private _datasourceSubset: string;
|
|
42
|
+
private _datasourceJsonRootPointer: string;
|
|
43
|
+
private _datasourceJsonVariableMapping: string;
|
|
44
|
+
|
|
45
|
+
public static maxStatements(version: string): number {
|
|
46
|
+
if (verifyVersion("11.8.015", version)) {
|
|
47
|
+
return Process.MAX_STATEMENTS_POST_11_8_015;
|
|
48
|
+
}
|
|
49
|
+
return Process.MAX_STATEMENTS;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static addGeneratedStringToCode(code: string): string {
|
|
53
|
+
const pattern = /#\*\*\*\*Begin: Generated Statements[\s\S]*#\*\*\*\*End: Generated Statements\*\*\*\*/;
|
|
54
|
+
if (pattern.test(code)) {
|
|
55
|
+
return code;
|
|
56
|
+
} else {
|
|
57
|
+
return Process.AUTO_GENERATED_STATEMENTS + code;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
constructor(
|
|
62
|
+
name: string,
|
|
63
|
+
hasSecurityAccess: boolean = false,
|
|
64
|
+
uiData: string = "CubeAction=1511\fDataAction=1503\fCubeLogChanges=0\f",
|
|
65
|
+
parameters?: Iterable<any>,
|
|
66
|
+
variables?: Iterable<any>,
|
|
67
|
+
variablesUiData?: Iterable<any>,
|
|
68
|
+
prologProcedure: string = '',
|
|
69
|
+
metadataProcedure: string = '',
|
|
70
|
+
dataProcedure: string = '',
|
|
71
|
+
epilogProcedure: string = '',
|
|
72
|
+
datasourceType: string = 'None',
|
|
73
|
+
datasourceAsciiDecimalSeparator: string = '.',
|
|
74
|
+
datasourceAsciiDelimiterChar: string = ';',
|
|
75
|
+
datasourceAsciiDelimiterType: string = 'Character',
|
|
76
|
+
datasourceAsciiHeaderRecords: number = 1,
|
|
77
|
+
datasourceAsciiQuoteCharacter: string = '',
|
|
78
|
+
datasourceAsciiThousandSeparator: string = ',',
|
|
79
|
+
datasourceDataSourceNameForClient: string = '',
|
|
80
|
+
datasourceDataSourceNameForServer: string = '',
|
|
81
|
+
datasourcePassword: string = '',
|
|
82
|
+
datasourceUserName: string = '',
|
|
83
|
+
datasourceQuery: string = '',
|
|
84
|
+
datasourceUsesUnicode: boolean = true,
|
|
85
|
+
datasourceView: string = '',
|
|
86
|
+
datasourceSubset: string = '',
|
|
87
|
+
datasourceJsonRootPointer: string = '',
|
|
88
|
+
datasourceJsonVariableMapping: string = ''
|
|
89
|
+
) {
|
|
90
|
+
/** Default constructor
|
|
91
|
+
*
|
|
92
|
+
* :param name: name of the process - mandatory
|
|
93
|
+
* :param has_security_access:
|
|
94
|
+
* :param ui_data:
|
|
95
|
+
* :param parameters:
|
|
96
|
+
* :param variables:
|
|
97
|
+
* :param variables_ui_data:
|
|
98
|
+
* :param prolog_procedure:
|
|
99
|
+
* :param metadata_procedure:
|
|
100
|
+
* :param data_procedure:
|
|
101
|
+
* :param epilog_procedure:
|
|
102
|
+
* :param datasource_type:
|
|
103
|
+
* :param datasource_ascii_decimal_separator:
|
|
104
|
+
* :param datasource_ascii_delimiter_char:
|
|
105
|
+
* :param datasource_ascii_delimiter_type:
|
|
106
|
+
* :param datasource_ascii_header_records:
|
|
107
|
+
* :param datasource_ascii_quote_character:
|
|
108
|
+
* :param datasource_ascii_thousand_separator:
|
|
109
|
+
* :param datasource_data_source_name_for_client:
|
|
110
|
+
* :param datasource_data_source_name_for_server:
|
|
111
|
+
* :param datasource_password:
|
|
112
|
+
* :param datasource_user_name:
|
|
113
|
+
* :param datasource_query:
|
|
114
|
+
* :param datasource_uses_unicode:
|
|
115
|
+
* :param datasource_view:
|
|
116
|
+
* :param datasource_subset:
|
|
117
|
+
* :param datasource_json_root_pointer:
|
|
118
|
+
* :param datasource_json_variable_mapping:
|
|
119
|
+
*/
|
|
120
|
+
super();
|
|
121
|
+
this._name = name;
|
|
122
|
+
this._hasSecurityAccess = hasSecurityAccess;
|
|
123
|
+
this._uiData = uiData;
|
|
124
|
+
this._parameters = parameters ? Array.from(parameters) : [];
|
|
125
|
+
this._variables = variables ? Array.from(variables) : [];
|
|
126
|
+
this._variablesUiData = variablesUiData ? Array.from(variablesUiData) : [];
|
|
127
|
+
this._prologProcedure = prologProcedure;
|
|
128
|
+
this._metadataProcedure = metadataProcedure;
|
|
129
|
+
this._dataProcedure = dataProcedure;
|
|
130
|
+
this._epilogProcedure = epilogProcedure;
|
|
131
|
+
this._datasourceType = datasourceType;
|
|
132
|
+
this._datasourceAsciiDecimalSeparator = datasourceAsciiDecimalSeparator;
|
|
133
|
+
this._datasourceAsciiDelimiterChar = datasourceAsciiDelimiterChar;
|
|
134
|
+
this._datasourceAsciiDelimiterType = datasourceAsciiDelimiterType;
|
|
135
|
+
this._datasourceAsciiHeaderRecords = datasourceAsciiHeaderRecords;
|
|
136
|
+
this._datasourceAsciiQuoteCharacter = datasourceAsciiQuoteCharacter;
|
|
137
|
+
this._datasourceAsciiThousandSeparator = datasourceAsciiThousandSeparator;
|
|
138
|
+
this._datasourceDataSourceNameForClient = datasourceDataSourceNameForClient;
|
|
139
|
+
this._datasourceDataSourceNameForServer = datasourceDataSourceNameForServer;
|
|
140
|
+
this._datasourcePassword = datasourcePassword;
|
|
141
|
+
this._datasourceUserName = datasourceUserName;
|
|
142
|
+
this._datasourceQuery = datasourceQuery;
|
|
143
|
+
this._datasourceUsesUnicode = datasourceUsesUnicode;
|
|
144
|
+
this._datasourceView = datasourceView;
|
|
145
|
+
this._datasourceSubset = datasourceSubset;
|
|
146
|
+
this._datasourceJsonRootPointer = datasourceJsonRootPointer;
|
|
147
|
+
this._datasourceJsonVariableMapping = datasourceJsonVariableMapping;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
public get name(): string {
|
|
151
|
+
return this._name;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public set name(value: string) {
|
|
155
|
+
this._name = value;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public get hasSecurityAccess(): boolean {
|
|
159
|
+
return this._hasSecurityAccess;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
public set hasSecurityAccess(value: boolean) {
|
|
163
|
+
this._hasSecurityAccess = value;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public get uiData(): string {
|
|
167
|
+
return this._uiData;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public set uiData(value: string) {
|
|
171
|
+
this._uiData = value;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public get parameters(): any[] {
|
|
175
|
+
return this._parameters;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
public set parameters(value: any[]) {
|
|
179
|
+
this._parameters = value;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public get variables(): any[] {
|
|
183
|
+
return this._variables;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public set variables(value: any[]) {
|
|
187
|
+
this._variables = value;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
public get variablesUiData(): any[] {
|
|
191
|
+
return this._variablesUiData;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
public set variablesUiData(value: any[]) {
|
|
195
|
+
this._variablesUiData = value;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public get prologProcedure(): string {
|
|
199
|
+
return this._prologProcedure;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public set prologProcedure(value: string) {
|
|
203
|
+
this._prologProcedure = Process.addGeneratedStringToCode(value);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public get metadataProcedure(): string {
|
|
207
|
+
return this._metadataProcedure;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
public set metadataProcedure(value: string) {
|
|
211
|
+
this._metadataProcedure = Process.addGeneratedStringToCode(value);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
public get dataProcedure(): string {
|
|
215
|
+
return this._dataProcedure;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public set dataProcedure(value: string) {
|
|
219
|
+
this._dataProcedure = Process.addGeneratedStringToCode(value);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
public get epilogProcedure(): string {
|
|
223
|
+
return this._epilogProcedure;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
public set epilogProcedure(value: string) {
|
|
227
|
+
this._epilogProcedure = Process.addGeneratedStringToCode(value);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
public get datasourceType(): string {
|
|
231
|
+
return this._datasourceType;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
public set datasourceType(value: string) {
|
|
235
|
+
this._datasourceType = value;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
public static fromDict(processAsDict: any): Process {
|
|
239
|
+
/** Alternative constructor
|
|
240
|
+
*
|
|
241
|
+
* :param process_as_dict: process as dict
|
|
242
|
+
* :return: process, an instance of this class
|
|
243
|
+
*/
|
|
244
|
+
return new Process(
|
|
245
|
+
processAsDict.Name,
|
|
246
|
+
processAsDict.HasSecurityAccess || false,
|
|
247
|
+
processAsDict.UIData || "CubeAction=1511\fDataAction=1503\fCubeLogChanges=0\f",
|
|
248
|
+
processAsDict.Parameters || [],
|
|
249
|
+
processAsDict.Variables || [],
|
|
250
|
+
processAsDict.VariablesUIData || [],
|
|
251
|
+
processAsDict.PrologProcedure || '',
|
|
252
|
+
processAsDict.MetadataProcedure || '',
|
|
253
|
+
processAsDict.DataProcedure || '',
|
|
254
|
+
processAsDict.EpilogProcedure || '',
|
|
255
|
+
processAsDict.DataSource?.Type || 'None',
|
|
256
|
+
processAsDict.DataSource?.AsciiDecimalSeparator || '.',
|
|
257
|
+
processAsDict.DataSource?.AsciiDelimiterChar || ';',
|
|
258
|
+
processAsDict.DataSource?.AsciiDelimiterType || 'Character',
|
|
259
|
+
processAsDict.DataSource?.AsciiHeaderRecords || 1,
|
|
260
|
+
processAsDict.DataSource?.AsciiQuoteCharacter || '',
|
|
261
|
+
processAsDict.DataSource?.AsciiThousandSeparator || ',',
|
|
262
|
+
processAsDict.DataSource?.DataSourceNameForClient || '',
|
|
263
|
+
processAsDict.DataSource?.DataSourceNameForServer || '',
|
|
264
|
+
processAsDict.DataSource?.Password || '',
|
|
265
|
+
processAsDict.DataSource?.UserName || '',
|
|
266
|
+
processAsDict.DataSource?.Query || '',
|
|
267
|
+
processAsDict.DataSource?.UsesUnicode !== false,
|
|
268
|
+
processAsDict.DataSource?.View || '',
|
|
269
|
+
processAsDict.DataSource?.Subset || '',
|
|
270
|
+
processAsDict.DataSource?.JsonRootPointer || '',
|
|
271
|
+
processAsDict.DataSource?.JsonVariableMapping || ''
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
public get body(): string {
|
|
276
|
+
return JSON.stringify(this.constructBody());
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
public get bodyAsDict(): any {
|
|
280
|
+
return this.constructBody();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
private constructBody(): any {
|
|
284
|
+
const body: any = {
|
|
285
|
+
Name: this._name,
|
|
286
|
+
HasSecurityAccess: this._hasSecurityAccess,
|
|
287
|
+
UIData: this._uiData,
|
|
288
|
+
Parameters: this._parameters,
|
|
289
|
+
Variables: this._variables,
|
|
290
|
+
VariablesUIData: this._variablesUiData,
|
|
291
|
+
PrologProcedure: this._prologProcedure,
|
|
292
|
+
MetadataProcedure: this._metadataProcedure,
|
|
293
|
+
DataProcedure: this._dataProcedure,
|
|
294
|
+
EpilogProcedure: this._epilogProcedure
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// Add DataSource information
|
|
298
|
+
body.DataSource = {
|
|
299
|
+
Type: this._datasourceType,
|
|
300
|
+
AsciiDecimalSeparator: this._datasourceAsciiDecimalSeparator,
|
|
301
|
+
AsciiDelimiterChar: this._datasourceAsciiDelimiterChar,
|
|
302
|
+
AsciiDelimiterType: this._datasourceAsciiDelimiterType,
|
|
303
|
+
AsciiHeaderRecords: this._datasourceAsciiHeaderRecords,
|
|
304
|
+
AsciiQuoteCharacter: this._datasourceAsciiQuoteCharacter,
|
|
305
|
+
AsciiThousandSeparator: this._datasourceAsciiThousandSeparator,
|
|
306
|
+
DataSourceNameForClient: this._datasourceDataSourceNameForClient,
|
|
307
|
+
DataSourceNameForServer: this._datasourceDataSourceNameForServer,
|
|
308
|
+
Password: this._datasourcePassword,
|
|
309
|
+
UserName: this._datasourceUserName,
|
|
310
|
+
Query: this._datasourceQuery,
|
|
311
|
+
UsesUnicode: this._datasourceUsesUnicode,
|
|
312
|
+
View: this._datasourceView,
|
|
313
|
+
Subset: this._datasourceSubset,
|
|
314
|
+
JsonRootPointer: this._datasourceJsonRootPointer,
|
|
315
|
+
JsonVariableMapping: this._datasourceJsonVariableMapping
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
return body;
|
|
319
|
+
}
|
|
320
|
+
}
|