tm1npm 1.0.1 → 1.1.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/README.md +10 -0
- package/lib/objects/Application.d.ts +74 -40
- package/lib/objects/Application.d.ts.map +1 -1
- package/lib/objects/Application.js +214 -59
- package/lib/objects/Axis.d.ts +2 -2
- package/lib/objects/Axis.d.ts.map +1 -1
- package/lib/objects/Axis.js +2 -2
- package/lib/objects/Chore.d.ts +4 -0
- package/lib/objects/Chore.d.ts.map +1 -1
- package/lib/objects/Chore.js +44 -0
- package/lib/objects/ChoreStartTime.d.ts +1 -0
- package/lib/objects/ChoreStartTime.d.ts.map +1 -1
- package/lib/objects/ChoreStartTime.js +17 -11
- package/lib/objects/ChoreTask.d.ts +1 -0
- package/lib/objects/ChoreTask.d.ts.map +1 -1
- package/lib/objects/ChoreTask.js +3 -0
- package/lib/services/ApplicationService.d.ts +13 -6
- package/lib/services/ApplicationService.d.ts.map +1 -1
- package/lib/services/ApplicationService.js +171 -179
- package/lib/services/AuditLogService.d.ts +1 -0
- package/lib/services/AuditLogService.d.ts.map +1 -1
- package/lib/services/AuditLogService.js +21 -9
- package/lib/services/CellService.d.ts +255 -3
- package/lib/services/CellService.d.ts.map +1 -1
- package/lib/services/CellService.js +845 -14
- package/lib/services/ChoreService.d.ts +20 -0
- package/lib/services/ChoreService.d.ts.map +1 -1
- package/lib/services/ChoreService.js +183 -44
- package/lib/services/ConfigurationService.d.ts +10 -8
- package/lib/services/ConfigurationService.d.ts.map +1 -1
- package/lib/services/ConfigurationService.js +41 -35
- package/lib/services/CubeService.d.ts +5 -0
- package/lib/services/CubeService.d.ts.map +1 -1
- package/lib/services/CubeService.js +37 -0
- package/lib/services/DimensionService.d.ts +5 -0
- package/lib/services/DimensionService.d.ts.map +1 -1
- package/lib/services/DimensionService.js +49 -0
- package/lib/services/ElementService.d.ts +102 -9
- package/lib/services/ElementService.d.ts.map +1 -1
- package/lib/services/ElementService.js +248 -82
- package/lib/services/FileService.d.ts +23 -1
- package/lib/services/FileService.d.ts.map +1 -1
- package/lib/services/FileService.js +228 -40
- package/lib/services/GitService.d.ts +1 -0
- package/lib/services/GitService.d.ts.map +1 -1
- package/lib/services/GitService.js +33 -16
- package/lib/services/JobService.d.ts +3 -0
- package/lib/services/JobService.d.ts.map +1 -1
- package/lib/services/JobService.js +10 -0
- package/lib/services/LoggerService.d.ts +0 -1
- package/lib/services/LoggerService.d.ts.map +1 -1
- package/lib/services/LoggerService.js +0 -9
- package/lib/services/MessageLogService.d.ts +6 -0
- package/lib/services/MessageLogService.d.ts.map +1 -1
- package/lib/services/MessageLogService.js +45 -18
- package/lib/services/MonitoringService.d.ts.map +1 -1
- package/lib/services/MonitoringService.js +22 -0
- package/lib/services/ObjectService.d.ts +17 -1
- package/lib/services/ObjectService.d.ts.map +1 -1
- package/lib/services/ObjectService.js +73 -6
- package/lib/services/PowerBiService.d.ts.map +1 -1
- package/lib/services/PowerBiService.js +20 -1
- package/lib/services/RestService.d.ts +172 -1
- package/lib/services/RestService.d.ts.map +1 -1
- package/lib/services/RestService.js +574 -7
- package/lib/services/SandboxService.d.ts +6 -6
- package/lib/services/SandboxService.d.ts.map +1 -1
- package/lib/services/SandboxService.js +50 -118
- package/lib/services/SecurityService.d.ts +6 -1
- package/lib/services/SecurityService.d.ts.map +1 -1
- package/lib/services/SecurityService.js +46 -12
- package/lib/services/SessionService.d.ts +1 -1
- package/lib/services/SessionService.d.ts.map +1 -1
- package/lib/services/SessionService.js +15 -0
- package/lib/services/SubsetService.d.ts +12 -2
- package/lib/services/SubsetService.d.ts.map +1 -1
- package/lib/services/SubsetService.js +94 -13
- package/lib/services/ThreadService.d.ts +0 -1
- package/lib/services/ThreadService.d.ts.map +1 -1
- package/lib/services/ThreadService.js +4 -2
- package/lib/services/TransactionLogService.d.ts +1 -0
- package/lib/services/TransactionLogService.d.ts.map +1 -1
- package/lib/services/TransactionLogService.js +21 -15
- package/lib/services/ViewService.d.ts +2 -1
- package/lib/services/ViewService.d.ts.map +1 -1
- package/lib/services/ViewService.js +45 -10
- package/lib/tests/elementService.comprehensive.test.js +44 -29
- package/lib/tests/enhancedCellService.test.js +144 -9
- package/lib/tests/enhancedElementService.test.js +21 -15
- package/lib/tests/integrationTests.test.js +7 -5
- package/lib/tests/securityService.comprehensive.test.js +6 -0
- package/lib/utils/Utils.d.ts +21 -0
- package/lib/utils/Utils.d.ts.map +1 -1
- package/lib/utils/Utils.js +161 -9
- package/package.json +1 -1
- package/src/objects/Application.ts +241 -73
- package/src/objects/Axis.ts +2 -2
- package/src/objects/Chore.ts +51 -0
- package/src/objects/ChoreStartTime.ts +26 -11
- package/src/objects/ChoreTask.ts +4 -0
- package/src/objects/NativeView.ts +2 -2
- package/src/services/ApplicationService.ts +269 -201
- package/src/services/AuditLogService.ts +34 -31
- package/src/services/CellService.ts +1271 -97
- package/src/services/ChoreService.ts +215 -45
- package/src/services/ConfigurationService.ts +42 -38
- package/src/services/CubeService.ts +48 -2
- package/src/services/DimensionService.ts +63 -1
- package/src/services/ElementService.ts +415 -150
- package/src/services/FileService.ts +318 -39
- package/src/services/GitService.ts +37 -27
- package/src/services/JobService.ts +14 -1
- package/src/services/LoggerService.ts +1 -10
- package/src/services/MessageLogService.ts +61 -39
- package/src/services/MonitoringService.ts +4 -1
- package/src/services/ObjectService.ts +86 -8
- package/src/services/PowerBiService.ts +29 -4
- package/src/services/RestService.ts +662 -10
- package/src/services/SandboxService.ts +59 -122
- package/src/services/SecurityService.ts +58 -16
- package/src/services/SessionService.ts +4 -3
- package/src/services/SubsetService.ts +253 -21
- package/src/services/ThreadService.ts +2 -5
- package/src/services/TransactionLogService.ts +28 -29
- package/src/services/ViewService.ts +76 -10
- package/src/tests/elementService.comprehensive.test.ts +54 -34
- package/src/tests/enhancedCellService.test.ts +200 -12
- package/src/tests/enhancedElementService.test.ts +22 -18
- package/src/tests/integrationTests.test.ts +7 -5
- package/src/tests/securityService.comprehensive.test.ts +9 -0
- package/src/utils/Utils.ts +187 -13
package/README.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# tm1npm
|
|
2
2
|
|
|
3
|
+
<pre>
|
|
4
|
+
████████╗███╗ ███╗ ██╗███╗ ██╗██████╗ ███╗ ███╗
|
|
5
|
+
╚══██╔══╝████╗ ████║███║████╗ ██║██╔══██╗████╗ ████║
|
|
6
|
+
██║ ██╔████╔██║╚██║██╔██╗ ██║██████╔╝██╔████╔██║
|
|
7
|
+
██║ ██║╚██╔╝██║ ██║██║╚██╗██║██╔═══╝ ██║╚██╔╝██║
|
|
8
|
+
██║ ██║ ╚═╝ ██║ ██║██║ ╚████║██║ ██║ ╚═╝ ██║
|
|
9
|
+
╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝
|
|
10
|
+
|
|
11
|
+
🚀 TM1 Integration for Node.js - Build powerful TM1 applications
|
|
12
|
+
</pre>
|
|
3
13
|
tm1npm is the Node.js/TypeScript package for IBM Planning Analytics (TM1), providing a comprehensive interface to the TM1 REST API.
|
|
4
14
|
|
|
5
15
|
By wrapping the IBM Planning Analytics (TM1) REST API in a concise TypeScript framework, tm1npm facilitates Node.js developments for TM1.
|
|
@@ -1,67 +1,101 @@
|
|
|
1
1
|
import { TM1Object } from './TM1Object';
|
|
2
2
|
export declare enum ApplicationTypes {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
CHORE = "CHORE",
|
|
4
|
+
CUBE = "CUBE",
|
|
5
|
+
DIMENSION = "DIMENSION",
|
|
6
|
+
DOCUMENT = "DOCUMENT",
|
|
7
|
+
FOLDER = "FOLDER",
|
|
8
|
+
LINK = "LINK",
|
|
9
|
+
PROCESS = "PROCESS",
|
|
10
|
+
SUBSET = "SUBSET",
|
|
11
|
+
VIEW = "VIEW"
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
export declare class Application extends TM1Object {
|
|
25
|
-
private _name;
|
|
26
|
-
private _path;
|
|
27
|
-
private _documented;
|
|
28
|
-
private _type;
|
|
29
|
-
constructor(name: string, path?: string, documented?: boolean, type?: string);
|
|
13
|
+
interface ApplicationTypeMetadata {
|
|
14
|
+
suffix: string;
|
|
15
|
+
odataType: string;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class Application extends TM1Object {
|
|
18
|
+
protected _name: string;
|
|
19
|
+
protected _path: string;
|
|
20
|
+
protected _documented: boolean;
|
|
21
|
+
protected readonly _applicationType: ApplicationTypes;
|
|
22
|
+
constructor(path: string, name: string, applicationType: ApplicationTypes, documented?: boolean);
|
|
30
23
|
get name(): string;
|
|
31
24
|
set name(name: string);
|
|
32
25
|
get path(): string;
|
|
33
26
|
set path(path: string);
|
|
34
27
|
get documented(): boolean;
|
|
35
28
|
set documented(documented: boolean);
|
|
36
|
-
get
|
|
29
|
+
get applicationType(): ApplicationTypes;
|
|
30
|
+
get applicationId(): string;
|
|
31
|
+
get bodyAsDict(): Record<string, any>;
|
|
37
32
|
get body(): string;
|
|
38
|
-
|
|
33
|
+
}
|
|
34
|
+
export declare class ChoreApplication extends Application {
|
|
35
|
+
private readonly _choreName;
|
|
36
|
+
constructor(path: string, name: string, choreName: string);
|
|
37
|
+
get choreName(): string;
|
|
38
|
+
get bodyAsDict(): Record<string, any>;
|
|
39
39
|
}
|
|
40
40
|
export declare class CubeApplication extends Application {
|
|
41
|
-
|
|
41
|
+
private readonly _cubeName;
|
|
42
|
+
constructor(path: string, name: string, cubeName: string);
|
|
43
|
+
get cubeName(): string;
|
|
44
|
+
get bodyAsDict(): Record<string, any>;
|
|
42
45
|
}
|
|
43
46
|
export declare class DimensionApplication extends Application {
|
|
44
|
-
|
|
47
|
+
private readonly _dimensionName;
|
|
48
|
+
constructor(path: string, name: string, dimensionName: string);
|
|
49
|
+
get dimensionName(): string;
|
|
50
|
+
get bodyAsDict(): Record<string, any>;
|
|
45
51
|
}
|
|
46
52
|
export declare class ProcessApplication extends Application {
|
|
47
|
-
|
|
53
|
+
private readonly _processName;
|
|
54
|
+
constructor(path: string, name: string, processName: string);
|
|
55
|
+
get processName(): string;
|
|
56
|
+
get bodyAsDict(): Record<string, any>;
|
|
48
57
|
}
|
|
49
|
-
export declare class
|
|
50
|
-
|
|
58
|
+
export declare class SubsetApplication extends Application {
|
|
59
|
+
private readonly _dimensionName;
|
|
60
|
+
private readonly _hierarchyName;
|
|
61
|
+
private readonly _subsetName;
|
|
62
|
+
constructor(path: string, name: string, dimensionName: string, hierarchyName: string, subsetName: string);
|
|
63
|
+
get dimensionName(): string;
|
|
64
|
+
get hierarchyName(): string;
|
|
65
|
+
get subsetName(): string;
|
|
66
|
+
get bodyAsDict(): Record<string, any>;
|
|
51
67
|
}
|
|
52
68
|
export declare class ViewApplication extends Application {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
69
|
+
private readonly _cubeName;
|
|
70
|
+
private readonly _viewName;
|
|
71
|
+
constructor(path: string, name: string, cubeName: string, viewName: string);
|
|
72
|
+
get cubeName(): string;
|
|
73
|
+
get viewName(): string;
|
|
74
|
+
get bodyAsDict(): Record<string, any>;
|
|
57
75
|
}
|
|
58
76
|
export declare class DocumentApplication extends Application {
|
|
59
|
-
|
|
77
|
+
private _content?;
|
|
78
|
+
private _fileId?;
|
|
79
|
+
private _fileName?;
|
|
80
|
+
private _lastUpdated?;
|
|
81
|
+
constructor(path: string, name: string, content?: Buffer, fileId?: string, fileName?: string, lastUpdated?: string);
|
|
82
|
+
get content(): Buffer | undefined;
|
|
83
|
+
set content(value: Buffer | undefined);
|
|
84
|
+
get fileId(): string | undefined;
|
|
85
|
+
get fileName(): string | undefined;
|
|
86
|
+
get lastUpdated(): string | undefined;
|
|
87
|
+
toFile(pathToFile: string): Promise<void>;
|
|
88
|
+
toXlsx(pathToFile: string): Promise<void>;
|
|
60
89
|
}
|
|
61
90
|
export declare class FolderApplication extends Application {
|
|
62
|
-
constructor(
|
|
91
|
+
constructor(path: string, name: string);
|
|
63
92
|
}
|
|
64
93
|
export declare class LinkApplication extends Application {
|
|
65
|
-
|
|
94
|
+
private readonly _url;
|
|
95
|
+
constructor(path: string, name: string, url: string);
|
|
96
|
+
get url(): string;
|
|
97
|
+
get bodyAsDict(): Record<string, any>;
|
|
66
98
|
}
|
|
99
|
+
export declare function getApplicationMetadata(applicationType: ApplicationTypes): ApplicationTypeMetadata;
|
|
100
|
+
export {};
|
|
67
101
|
//# sourceMappingURL=Application.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../src/objects/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../../src/objects/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,oBAAY,gBAAgB;IACxB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;CAChB;AAED,UAAU,uBAAuB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACrB;AAcD,8BAAsB,WAAY,SAAQ,SAAS;IAC/C,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,QAAQ,CAAC,g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inding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LinkApplication = exports.FolderApplication = exports.DocumentApplication = exports.
|
|
36
|
+
exports.LinkApplication = exports.FolderApplication = exports.DocumentApplication = exports.ViewApplication = exports.SubsetApplication = exports.ProcessApplication = exports.DimensionApplication = exports.CubeApplication = exports.ChoreApplication = exports.Application = exports.ApplicationTypes = void 0;
|
|
37
|
+
exports.getApplicationMetadata = getApplicationMetadata;
|
|
4
38
|
const TM1Object_1 = require("./TM1Object");
|
|
39
|
+
const Utils_1 = require("../utils/Utils");
|
|
5
40
|
var ApplicationTypes;
|
|
6
41
|
(function (ApplicationTypes) {
|
|
7
|
-
ApplicationTypes["
|
|
8
|
-
ApplicationTypes["
|
|
9
|
-
ApplicationTypes["
|
|
10
|
-
ApplicationTypes["
|
|
11
|
-
ApplicationTypes["
|
|
12
|
-
ApplicationTypes["
|
|
13
|
-
ApplicationTypes["
|
|
14
|
-
ApplicationTypes["
|
|
15
|
-
ApplicationTypes["
|
|
42
|
+
ApplicationTypes["CHORE"] = "CHORE";
|
|
43
|
+
ApplicationTypes["CUBE"] = "CUBE";
|
|
44
|
+
ApplicationTypes["DIMENSION"] = "DIMENSION";
|
|
45
|
+
ApplicationTypes["DOCUMENT"] = "DOCUMENT";
|
|
46
|
+
ApplicationTypes["FOLDER"] = "FOLDER";
|
|
47
|
+
ApplicationTypes["LINK"] = "LINK";
|
|
48
|
+
ApplicationTypes["PROCESS"] = "PROCESS";
|
|
49
|
+
ApplicationTypes["SUBSET"] = "SUBSET";
|
|
50
|
+
ApplicationTypes["VIEW"] = "VIEW";
|
|
16
51
|
})(ApplicationTypes || (exports.ApplicationTypes = ApplicationTypes = {}));
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Link: ApplicationTypes.LINK
|
|
52
|
+
const APPLICATION_METADATA = {
|
|
53
|
+
[ApplicationTypes.CHORE]: { suffix: '.chore', odataType: 'tm1.ChoreReference' },
|
|
54
|
+
[ApplicationTypes.CUBE]: { suffix: '.cube', odataType: 'tm1.CubeReference' },
|
|
55
|
+
[ApplicationTypes.DIMENSION]: { suffix: '.dimension', odataType: 'tm1.DimensionReference' },
|
|
56
|
+
[ApplicationTypes.DOCUMENT]: { suffix: '.blob', odataType: '#ibm.tm1.api.v1.Document' },
|
|
57
|
+
[ApplicationTypes.FOLDER]: { suffix: '', odataType: '#ibm.tm1.api.v1.Folder' },
|
|
58
|
+
[ApplicationTypes.LINK]: { suffix: '.extr', odataType: '#ibm.tm1.api.v1.Link' },
|
|
59
|
+
[ApplicationTypes.PROCESS]: { suffix: '.process', odataType: 'tm1.ProcessReference' },
|
|
60
|
+
[ApplicationTypes.SUBSET]: { suffix: '.subset', odataType: 'tm1.SubsetReference' },
|
|
61
|
+
[ApplicationTypes.VIEW]: { suffix: '.view', odataType: 'tm1.ViewReference' }
|
|
28
62
|
};
|
|
29
63
|
class Application extends TM1Object_1.TM1Object {
|
|
30
|
-
constructor(name,
|
|
64
|
+
constructor(path, name, applicationType, documented = false) {
|
|
31
65
|
super();
|
|
32
|
-
|
|
66
|
+
const metadata = APPLICATION_METADATA[applicationType];
|
|
33
67
|
this._path = path;
|
|
68
|
+
if (metadata.suffix && name.endsWith(metadata.suffix)) {
|
|
69
|
+
this._name = name.slice(0, -metadata.suffix.length);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this._name = name;
|
|
73
|
+
}
|
|
74
|
+
this._applicationType = applicationType;
|
|
34
75
|
this._documented = documented;
|
|
35
|
-
this._type = type;
|
|
36
76
|
}
|
|
37
77
|
get name() {
|
|
38
78
|
return this._name;
|
|
@@ -52,74 +92,189 @@ class Application extends TM1Object_1.TM1Object {
|
|
|
52
92
|
set documented(documented) {
|
|
53
93
|
this._documented = documented;
|
|
54
94
|
}
|
|
55
|
-
get
|
|
56
|
-
return this.
|
|
95
|
+
get applicationType() {
|
|
96
|
+
return this._applicationType;
|
|
57
97
|
}
|
|
58
|
-
get
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Documented: this._documented,
|
|
63
|
-
Type: this._type
|
|
64
|
-
});
|
|
98
|
+
get applicationId() {
|
|
99
|
+
const metadata = APPLICATION_METADATA[this._applicationType];
|
|
100
|
+
const suffix = metadata.suffix || '';
|
|
101
|
+
return `${this._path}${this._path ? '/' : ''}${this._name}${suffix}`.replace('//', '/');
|
|
65
102
|
}
|
|
66
|
-
|
|
67
|
-
|
|
103
|
+
get bodyAsDict() {
|
|
104
|
+
const metadata = APPLICATION_METADATA[this._applicationType];
|
|
105
|
+
const body = {
|
|
106
|
+
'@odata.type': metadata.odataType,
|
|
107
|
+
Name: this._name
|
|
108
|
+
};
|
|
109
|
+
if (this._documented) {
|
|
110
|
+
body.Documented = true;
|
|
111
|
+
}
|
|
112
|
+
return body;
|
|
113
|
+
}
|
|
114
|
+
get body() {
|
|
115
|
+
return JSON.stringify(this.bodyAsDict);
|
|
68
116
|
}
|
|
69
117
|
}
|
|
70
118
|
exports.Application = Application;
|
|
119
|
+
class ChoreApplication extends Application {
|
|
120
|
+
constructor(path, name, choreName) {
|
|
121
|
+
super(path, name, ApplicationTypes.CHORE);
|
|
122
|
+
this._choreName = choreName;
|
|
123
|
+
}
|
|
124
|
+
get choreName() {
|
|
125
|
+
return this._choreName;
|
|
126
|
+
}
|
|
127
|
+
get bodyAsDict() {
|
|
128
|
+
const body = super.bodyAsDict;
|
|
129
|
+
body['Chore@odata.bind'] = (0, Utils_1.formatUrl)("Chores('{}')", this._choreName);
|
|
130
|
+
return body;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.ChoreApplication = ChoreApplication;
|
|
71
134
|
class CubeApplication extends Application {
|
|
72
|
-
constructor(name,
|
|
73
|
-
super(
|
|
135
|
+
constructor(path, name, cubeName) {
|
|
136
|
+
super(path, name, ApplicationTypes.CUBE);
|
|
137
|
+
this._cubeName = cubeName;
|
|
138
|
+
}
|
|
139
|
+
get cubeName() {
|
|
140
|
+
return this._cubeName;
|
|
141
|
+
}
|
|
142
|
+
get bodyAsDict() {
|
|
143
|
+
const body = super.bodyAsDict;
|
|
144
|
+
body['Cube@odata.bind'] = (0, Utils_1.formatUrl)("Cubes('{}')", this._cubeName);
|
|
145
|
+
return body;
|
|
74
146
|
}
|
|
75
147
|
}
|
|
76
148
|
exports.CubeApplication = CubeApplication;
|
|
77
149
|
class DimensionApplication extends Application {
|
|
78
|
-
constructor(name,
|
|
79
|
-
super(
|
|
150
|
+
constructor(path, name, dimensionName) {
|
|
151
|
+
super(path, name, ApplicationTypes.DIMENSION);
|
|
152
|
+
this._dimensionName = dimensionName;
|
|
153
|
+
}
|
|
154
|
+
get dimensionName() {
|
|
155
|
+
return this._dimensionName;
|
|
156
|
+
}
|
|
157
|
+
get bodyAsDict() {
|
|
158
|
+
const body = super.bodyAsDict;
|
|
159
|
+
body['Dimension@odata.bind'] = (0, Utils_1.formatUrl)("Dimensions('{}')", this._dimensionName);
|
|
160
|
+
return body;
|
|
80
161
|
}
|
|
81
162
|
}
|
|
82
163
|
exports.DimensionApplication = DimensionApplication;
|
|
83
164
|
class ProcessApplication extends Application {
|
|
84
|
-
constructor(name,
|
|
85
|
-
super(
|
|
165
|
+
constructor(path, name, processName) {
|
|
166
|
+
super(path, name, ApplicationTypes.PROCESS);
|
|
167
|
+
this._processName = processName;
|
|
168
|
+
}
|
|
169
|
+
get processName() {
|
|
170
|
+
return this._processName;
|
|
171
|
+
}
|
|
172
|
+
get bodyAsDict() {
|
|
173
|
+
const body = super.bodyAsDict;
|
|
174
|
+
body['Process@odata.bind'] = (0, Utils_1.formatUrl)("Processes('{}')", this._processName);
|
|
175
|
+
return body;
|
|
86
176
|
}
|
|
87
177
|
}
|
|
88
178
|
exports.ProcessApplication = ProcessApplication;
|
|
89
|
-
class
|
|
90
|
-
constructor(name,
|
|
91
|
-
super(
|
|
179
|
+
class SubsetApplication extends Application {
|
|
180
|
+
constructor(path, name, dimensionName, hierarchyName, subsetName) {
|
|
181
|
+
super(path, name, ApplicationTypes.SUBSET);
|
|
182
|
+
this._dimensionName = dimensionName;
|
|
183
|
+
this._hierarchyName = hierarchyName;
|
|
184
|
+
this._subsetName = subsetName;
|
|
185
|
+
}
|
|
186
|
+
get dimensionName() {
|
|
187
|
+
return this._dimensionName;
|
|
188
|
+
}
|
|
189
|
+
get hierarchyName() {
|
|
190
|
+
return this._hierarchyName;
|
|
191
|
+
}
|
|
192
|
+
get subsetName() {
|
|
193
|
+
return this._subsetName;
|
|
194
|
+
}
|
|
195
|
+
get bodyAsDict() {
|
|
196
|
+
const body = super.bodyAsDict;
|
|
197
|
+
body['Subset@odata.bind'] = (0, Utils_1.formatUrl)("Dimensions('{}')/Hierarchies('{}')/Subsets('{}')", this._dimensionName, this._hierarchyName, this._subsetName);
|
|
198
|
+
return body;
|
|
92
199
|
}
|
|
93
200
|
}
|
|
94
|
-
exports.
|
|
201
|
+
exports.SubsetApplication = SubsetApplication;
|
|
95
202
|
class ViewApplication extends Application {
|
|
96
|
-
constructor(name,
|
|
97
|
-
super(
|
|
203
|
+
constructor(path, name, cubeName, viewName) {
|
|
204
|
+
super(path, name, ApplicationTypes.VIEW);
|
|
205
|
+
this._cubeName = cubeName;
|
|
206
|
+
this._viewName = viewName;
|
|
98
207
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
208
|
+
get cubeName() {
|
|
209
|
+
return this._cubeName;
|
|
210
|
+
}
|
|
211
|
+
get viewName() {
|
|
212
|
+
return this._viewName;
|
|
213
|
+
}
|
|
214
|
+
get bodyAsDict() {
|
|
215
|
+
const body = super.bodyAsDict;
|
|
216
|
+
body['View@odata.bind'] = (0, Utils_1.formatUrl)("Cubes('{}')/Views('{}')", this._cubeName, this._viewName);
|
|
217
|
+
return body;
|
|
104
218
|
}
|
|
105
219
|
}
|
|
106
|
-
exports.
|
|
220
|
+
exports.ViewApplication = ViewApplication;
|
|
107
221
|
class DocumentApplication extends Application {
|
|
108
|
-
constructor(name,
|
|
109
|
-
super(
|
|
222
|
+
constructor(path, name, content, fileId, fileName, lastUpdated) {
|
|
223
|
+
super(path, name, ApplicationTypes.DOCUMENT, true);
|
|
224
|
+
this._content = content;
|
|
225
|
+
this._fileId = fileId;
|
|
226
|
+
this._fileName = fileName;
|
|
227
|
+
this._lastUpdated = lastUpdated;
|
|
228
|
+
}
|
|
229
|
+
get content() {
|
|
230
|
+
return this._content;
|
|
231
|
+
}
|
|
232
|
+
set content(value) {
|
|
233
|
+
this._content = value;
|
|
234
|
+
}
|
|
235
|
+
get fileId() {
|
|
236
|
+
return this._fileId;
|
|
237
|
+
}
|
|
238
|
+
get fileName() {
|
|
239
|
+
return this._fileName;
|
|
240
|
+
}
|
|
241
|
+
get lastUpdated() {
|
|
242
|
+
return this._lastUpdated;
|
|
243
|
+
}
|
|
244
|
+
async toFile(pathToFile) {
|
|
245
|
+
if (!this._content) {
|
|
246
|
+
throw new Error('Document content is empty');
|
|
247
|
+
}
|
|
248
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
249
|
+
await fs.writeFile(pathToFile, this._content);
|
|
250
|
+
}
|
|
251
|
+
async toXlsx(pathToFile) {
|
|
252
|
+
await this.toFile(pathToFile);
|
|
110
253
|
}
|
|
111
254
|
}
|
|
112
255
|
exports.DocumentApplication = DocumentApplication;
|
|
113
256
|
class FolderApplication extends Application {
|
|
114
|
-
constructor(
|
|
115
|
-
super(
|
|
257
|
+
constructor(path, name) {
|
|
258
|
+
super(path, name, ApplicationTypes.FOLDER);
|
|
116
259
|
}
|
|
117
260
|
}
|
|
118
261
|
exports.FolderApplication = FolderApplication;
|
|
119
262
|
class LinkApplication extends Application {
|
|
120
|
-
constructor(name,
|
|
121
|
-
super(
|
|
263
|
+
constructor(path, name, url) {
|
|
264
|
+
super(path, name, ApplicationTypes.LINK);
|
|
265
|
+
this._url = url;
|
|
266
|
+
}
|
|
267
|
+
get url() {
|
|
268
|
+
return this._url;
|
|
269
|
+
}
|
|
270
|
+
get bodyAsDict() {
|
|
271
|
+
const body = super.bodyAsDict;
|
|
272
|
+
body['URL'] = this._url;
|
|
273
|
+
return body;
|
|
122
274
|
}
|
|
123
275
|
}
|
|
124
276
|
exports.LinkApplication = LinkApplication;
|
|
277
|
+
function getApplicationMetadata(applicationType) {
|
|
278
|
+
return APPLICATION_METADATA[applicationType];
|
|
279
|
+
}
|
|
125
280
|
//# sourceMappingURL=Application.js.map
|
package/lib/objects/Axis.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class ViewAxisSelection extends TM1Object {
|
|
|
12
12
|
get hierarchyName(): string;
|
|
13
13
|
get body(): string;
|
|
14
14
|
get bodyAsDict(): Record<string, any>;
|
|
15
|
-
static fromDict(
|
|
15
|
+
static fromDict(_data: Record<string, any>): ViewAxisSelection;
|
|
16
16
|
private constructBody;
|
|
17
17
|
}
|
|
18
18
|
export declare class ViewTitleSelection {
|
|
@@ -30,7 +30,7 @@ export declare class ViewTitleSelection {
|
|
|
30
30
|
get selected(): string;
|
|
31
31
|
get body(): string;
|
|
32
32
|
get bodyAsDict(): Record<string, any>;
|
|
33
|
-
static fromDict(
|
|
33
|
+
static fromDict(_data: Record<string, any>): ViewTitleSelection;
|
|
34
34
|
private constructBody;
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=Axis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Axis.d.ts","sourceRoot":"","sources":["../../src/objects/Axis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGnD,qBAAa,iBAAkB,SAAQ,SAAS;IAC5C;OACG;IAEH,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAAS;gBAEnB,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe;IAYnE,IAAW,MAAM,IAAI,MAAM,GAAG,eAAe,CAE5C;IAED,IAAW,aAAa,IAAI,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CAEjC;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAE3C;WAEa,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,kBAAkB;IAKtE,OAAO,CAAC,aAAa;CA6BxB"}
|
package/lib/objects/Axis.js
CHANGED
|
@@ -31,7 +31,7 @@ class ViewAxisSelection extends TM1Object_1.TM1Object {
|
|
|
31
31
|
get bodyAsDict() {
|
|
32
32
|
return this.constructBody();
|
|
33
33
|
}
|
|
34
|
-
static fromDict(
|
|
34
|
+
static fromDict(_data) {
|
|
35
35
|
// Basic implementation - would need actual data structure
|
|
36
36
|
return new ViewAxisSelection('', new Subset_1.AnonymousSubset('', ''));
|
|
37
37
|
}
|
|
@@ -77,7 +77,7 @@ class ViewTitleSelection {
|
|
|
77
77
|
get bodyAsDict() {
|
|
78
78
|
return this.constructBody();
|
|
79
79
|
}
|
|
80
|
-
static fromDict(
|
|
80
|
+
static fromDict(_data) {
|
|
81
81
|
// Basic implementation - would need actual data structure
|
|
82
82
|
return new ViewTitleSelection('', new Subset_1.AnonymousSubset('', ''), '');
|
|
83
83
|
}
|
package/lib/objects/Chore.d.ts
CHANGED
|
@@ -39,5 +39,9 @@ export declare class Chore extends TM1Object {
|
|
|
39
39
|
reschedule(frequency: ChoreFrequency, startTime?: ChoreStartTime): void;
|
|
40
40
|
activate(): void;
|
|
41
41
|
deactivate(): void;
|
|
42
|
+
insertTask(newTask: ChoreTask, step?: number): void;
|
|
43
|
+
get executionPath(): Record<string, string[]>;
|
|
44
|
+
rescheduleByTime(days?: number, hours?: number, minutes?: number, seconds?: number): void;
|
|
45
|
+
static fromJson(choreAsJson: string): Chore;
|
|
42
46
|
}
|
|
43
47
|
//# sourceMappingURL=Chore.d.ts.map
|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AE,MAAM,EAAE,CAAC,CASnD;IAEM,gBAAgB,CAAC,IAAI,GAAE,MAAU,EAAE,KAAK,GAAE,MAAU,EAAE,OAAO,GAAE,MAAU,EAAE,OAAO,GAAE,MAAU,GAAG,IAAI;WAkB9F,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK;CAOrD"}
|
package/lib/objects/Chore.js
CHANGED
|
@@ -119,6 +119,50 @@ class Chore extends TM1Object_1.TM1Object {
|
|
|
119
119
|
*/
|
|
120
120
|
this._active = false;
|
|
121
121
|
}
|
|
122
|
+
insertTask(newTask, step) {
|
|
123
|
+
/** Insert a task at a specific position and reorder subsequent tasks
|
|
124
|
+
* :param new_task: ChoreTask instance to insert
|
|
125
|
+
* :param step: Position to insert at (0-based index). If not provided, adds at the end.
|
|
126
|
+
*/
|
|
127
|
+
const insertIndex = step !== undefined ? step : this._tasks.length;
|
|
128
|
+
this._tasks.splice(insertIndex, 0, newTask);
|
|
129
|
+
// Update step numbers for all tasks
|
|
130
|
+
this._tasks.forEach((task, index) => {
|
|
131
|
+
task.step = index;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
get executionPath() {
|
|
135
|
+
/** Get execution path mapping chore name to list of process names
|
|
136
|
+
* :return: Dictionary mapping chore name to process names
|
|
137
|
+
*/
|
|
138
|
+
const processNames = this._tasks
|
|
139
|
+
.filter(task => task.processName)
|
|
140
|
+
.map(task => task.processName);
|
|
141
|
+
return { [this._name]: processNames };
|
|
142
|
+
}
|
|
143
|
+
rescheduleByTime(days = 0, hours = 0, minutes = 0, seconds = 0) {
|
|
144
|
+
/** Programmatically reschedule a chore by adding time to current start time
|
|
145
|
+
* :param days: Days to add
|
|
146
|
+
* :param hours: Hours to add
|
|
147
|
+
* :param minutes: Minutes to add
|
|
148
|
+
* :param seconds: Seconds to add
|
|
149
|
+
*/
|
|
150
|
+
if (this._startTime.datetime) {
|
|
151
|
+
const newDateTime = new Date(this._startTime.datetime);
|
|
152
|
+
newDateTime.setDate(newDateTime.getDate() + days);
|
|
153
|
+
newDateTime.setHours(newDateTime.getHours() + hours);
|
|
154
|
+
newDateTime.setMinutes(newDateTime.getMinutes() + minutes);
|
|
155
|
+
newDateTime.setSeconds(newDateTime.getSeconds() + seconds);
|
|
156
|
+
this._startTime = new ChoreStartTime_1.ChoreStartTime(newDateTime, this._startTime.tz);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
static fromJson(choreAsJson) {
|
|
160
|
+
/** Alternative constructor from JSON string
|
|
161
|
+
* :param chore_as_json: JSON string representation of chore
|
|
162
|
+
* :return: Chore instance
|
|
163
|
+
*/
|
|
164
|
+
return Chore.fromJSON(choreAsJson);
|
|
165
|
+
}
|
|
122
166
|
}
|
|
123
167
|
exports.Chore = Chore;
|
|
124
168
|
/** Abstraction of TM1 Chore
|
|
@@ -4,6 +4,7 @@ export declare class ChoreStartTime {
|
|
|
4
4
|
private _datetime;
|
|
5
5
|
tz?: string;
|
|
6
6
|
constructor(year: number, month: number, day: number, hour: number, minute: number, second: number, tz?: string);
|
|
7
|
+
constructor(datetime: Date, tz?: string);
|
|
7
8
|
static fromString(startTimeString: string): ChoreStartTime;
|
|
8
9
|
get startTimeString(): string;
|
|
9
10
|
get datetime(): Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoreStartTime.d.ts","sourceRoot":"","sources":["../../src/objects/ChoreStartTime.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACvB;OACG;IAEH,OAAO,CAAC,SAAS,CAAO;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"ChoreStartTime.d.ts","sourceRoot":"","sources":["../../src/objects/ChoreStartT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