homey-api 1.10.20 → 3.0.0-rc.10
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 +1 -1
- package/assets/types/homey-api.d.ts +54 -647
- package/assets/types/homey-api.private.d.ts +54 -707
- package/index.js +1 -1
- package/lib/APIErrorNotFound.js +20 -0
- package/lib/AthomCloudAPI/Homey.js +3 -1
- package/lib/EventEmitter.js +0 -6
- package/lib/HomeyAPI/HomeyAPI.js +53 -5
- package/lib/HomeyAPI/HomeyAPIErrorNotFound.js +21 -0
- package/lib/HomeyAPI/HomeyAPIV2/Manager.js +2 -575
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDevices/Capability.js +20 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDevices/Device.js +18 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDevices.js +6 -3
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDrivers/Driver.js +25 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDrivers/PairSession.js +20 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDrivers.js +46 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow/AdvancedFlow.js +30 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow/Flow.js +57 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow/FlowCardAction.js +25 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow/FlowCardCondition.js +25 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow/FlowCardTrigger.js +25 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow.js +127 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlowToken/FlowToken.js +24 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlowToken.js +29 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerInsights/Log.js +22 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerInsights.js +46 -0
- package/lib/HomeyAPI/HomeyAPIV2.js +12 -716
- package/lib/HomeyAPI/HomeyAPIV3/Item.js +186 -2
- package/lib/HomeyAPI/HomeyAPIV3/Manager.js +513 -3
- package/lib/HomeyAPI/{HomeyAPIV2 → HomeyAPIV3/ManagerApps}/App.js +1 -1
- package/lib/HomeyAPI/{HomeyAPIV2 → HomeyAPIV3}/ManagerApps.js +4 -3
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDevices/Capability.js +9 -0
- package/lib/HomeyAPI/{HomeyAPIV2 → HomeyAPIV3/ManagerDevices}/Device.js +82 -7
- package/lib/HomeyAPI/{HomeyAPIV2 → HomeyAPIV3/ManagerDevices}/DeviceCapability.js +4 -4
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDevices.js +17 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDrivers/Driver.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDrivers/PairSession.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDrivers.js +17 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/AdvancedFlow.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/Flow.js +17 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCard.js +17 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCardAction.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCardCondition.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCardTrigger.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow.js +12 -23
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlowToken/FlowToken.js +19 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlowToken.js +15 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerInsights/Log.js +23 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerInsights.js +15 -0
- package/lib/HomeyAPI/HomeyAPIV3.js +728 -4
- package/lib/HomeyAPI/HomeyAPIV3Cloud.js +1 -1
- package/lib/HomeyAPI/HomeyAPIV3Local.js +1 -1
- package/package.json +1 -1
- package/lib/HomeyAPI/HomeyAPIApp.js +0 -127
- package/lib/HomeyAPI/HomeyAPIV2/Item.js +0 -177
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ManagerDriversV3 = require('../HomeyAPIV3/ManagerDrivers');
|
|
4
|
+
const Driver = require('./ManagerDrivers/Driver');
|
|
5
|
+
const PairSession = require('./ManagerDrivers/PairSession');
|
|
6
|
+
|
|
7
|
+
class ManagerDrivers extends ManagerDriversV3 {
|
|
8
|
+
|
|
9
|
+
static CRUD = {
|
|
10
|
+
...super.CRUD,
|
|
11
|
+
Driver,
|
|
12
|
+
PairSession,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async getDriver({
|
|
16
|
+
$cache = true,
|
|
17
|
+
id,
|
|
18
|
+
}) {
|
|
19
|
+
if ($cache === true && this.__cache['driver'][id]) {
|
|
20
|
+
return this.__cache['driver'][id];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return this.__super__getDriver({
|
|
24
|
+
id: id.split(':').reverse()[0],
|
|
25
|
+
uri: id.split(':', 3).join(':'),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async createPairSession({
|
|
30
|
+
pairsession,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
if (pairsession.driverId) {
|
|
34
|
+
pairsession.driverUri = pairsession.driverId.split(':', 3).join(':');
|
|
35
|
+
pairsession.driverId = pairsession.driverId.split(':').reverse()[0];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return this.__super__createPairSession({
|
|
39
|
+
pairsession,
|
|
40
|
+
...props,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = ManagerDrivers;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const AdvancedFlowV3 = require('../../HomeyAPIV3/ManagerFlow/Flow');
|
|
4
|
+
|
|
5
|
+
class AdvancedFlow extends AdvancedFlowV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
if (item.cards) {
|
|
9
|
+
for (const card of Object.values(item.cards)) {
|
|
10
|
+
card.id = `${card.ownerUri}:${card.id}`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return item;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static transformSet(item) {
|
|
18
|
+
if (item.cards) {
|
|
19
|
+
for (const card of Object.values(item.cards)) {
|
|
20
|
+
card.ownerUri = card.id.split(':', 3).join(':');
|
|
21
|
+
card.id = card.id.split(':').reverse()[0];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return item;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = AdvancedFlow;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FlowV3 = require('../../HomeyAPIV3/ManagerFlow/Flow');
|
|
4
|
+
|
|
5
|
+
class Flow extends FlowV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
item = super.transformGet(item);
|
|
9
|
+
|
|
10
|
+
if (item.trigger) {
|
|
11
|
+
item.trigger.id = `${item.trigger.uri}:${item.trigger.id}`;
|
|
12
|
+
delete item.trigger.uri;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (Array.isArray(item.conditions)) {
|
|
16
|
+
item.conditions.forEach(card => {
|
|
17
|
+
card.id = `${card.uri}:${card.id}`;
|
|
18
|
+
delete card.uri;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (Array.isArray(item.actions)) {
|
|
23
|
+
item.actions.forEach(card => {
|
|
24
|
+
card.id = `${card.uri}:${card.id}`;
|
|
25
|
+
delete card.uri;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return item;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static transformSet(item) {
|
|
33
|
+
if (item.trigger) {
|
|
34
|
+
item.trigger.uri = item.trigger.id.split(':', 3).join(':');
|
|
35
|
+
item.trigger.id = item.trigger.id.split(':').reverse()[0];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (Array.isArray(item.conditions)) {
|
|
39
|
+
item.conditions.forEach(card => {
|
|
40
|
+
card.uri = card.id.split(':', 3).join(':');
|
|
41
|
+
card.id = card.id.split(':').reverse()[0];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (Array.isArray(item.actions)) {
|
|
46
|
+
item.actions.forEach(card => {
|
|
47
|
+
card.uri = card.id.split(':', 3).join(':');
|
|
48
|
+
card.id = card.id.split(':').reverse()[0];
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return item;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = Flow;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FlowCardActionV3 = require('../../HomeyAPIV3/ManagerFlow/FlowCardAction');
|
|
4
|
+
|
|
5
|
+
class FlowCardAction extends FlowCardActionV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
item = super.transformGet(item);
|
|
9
|
+
|
|
10
|
+
item.id = `${item.uri}:${item.id}`;
|
|
11
|
+
item.ownerUri = item.uri;
|
|
12
|
+
item.ownerId = item.uriObj.id;
|
|
13
|
+
item.ownerName = item.uriObj.name;
|
|
14
|
+
item.color = item.uriObj.color;
|
|
15
|
+
item.iconObj = item.uriObj.iconObj;
|
|
16
|
+
|
|
17
|
+
delete item.uri;
|
|
18
|
+
delete item.uriObj;
|
|
19
|
+
|
|
20
|
+
return item;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = FlowCardAction;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FlowCardConditionV3 = require('../../HomeyAPIV3/ManagerFlow/FlowCardCondition');
|
|
4
|
+
|
|
5
|
+
class FlowCardCondition extends FlowCardConditionV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
item = super.transformGet(item);
|
|
9
|
+
|
|
10
|
+
item.id = `${item.uri}:${item.id}`;
|
|
11
|
+
item.ownerUri = item.uri;
|
|
12
|
+
item.ownerId = item.uriObj.id;
|
|
13
|
+
item.ownerName = item.uriObj.name;
|
|
14
|
+
item.color = item.uriObj.color;
|
|
15
|
+
item.iconObj = item.uriObj.iconObj;
|
|
16
|
+
|
|
17
|
+
delete item.uri;
|
|
18
|
+
delete item.uriObj;
|
|
19
|
+
|
|
20
|
+
return item;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = FlowCardCondition;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FlowCardTriggerV3 = require('../../HomeyAPIV3/ManagerFlow/FlowCardTrigger');
|
|
4
|
+
|
|
5
|
+
class FlowCardTrigger extends FlowCardTriggerV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
item = super.transformGet(item);
|
|
9
|
+
|
|
10
|
+
item.id = `${item.uri}:${item.id}`;
|
|
11
|
+
item.ownerUri = item.uri;
|
|
12
|
+
item.ownerId = item.uriObj.id;
|
|
13
|
+
item.ownerName = item.uriObj.name;
|
|
14
|
+
item.color = item.uriObj.color;
|
|
15
|
+
item.iconObj = item.uriObj.iconObj;
|
|
16
|
+
|
|
17
|
+
delete item.uri;
|
|
18
|
+
delete item.uriObj;
|
|
19
|
+
|
|
20
|
+
return item;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = FlowCardTrigger;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const Manager = require('./Manager');
|
|
4
|
+
const Flow = require('./ManagerFlow/Flow');
|
|
5
|
+
const AdvancedFlow = require('./ManagerFlow/AdvancedFlow');
|
|
6
|
+
const FlowCardTrigger = require('./ManagerFlow/FlowCardTrigger');
|
|
7
|
+
const FlowCardCondition = require('./ManagerFlow/FlowCardCondition');
|
|
8
|
+
const FlowCardAction = require('./ManagerFlow/FlowCardAction');
|
|
9
|
+
|
|
10
|
+
class ManagerFlow extends Manager {
|
|
11
|
+
|
|
12
|
+
static CRUD = {
|
|
13
|
+
...super.CRUD,
|
|
14
|
+
Flow,
|
|
15
|
+
AdvancedFlow,
|
|
16
|
+
FlowCardTrigger,
|
|
17
|
+
FlowCardCondition,
|
|
18
|
+
FlowCardAction,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async createFlow({
|
|
22
|
+
flow,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return this.__super__.createFlow({
|
|
26
|
+
flow: Flow.transformSet(flow),
|
|
27
|
+
...props,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async updateFlow({
|
|
32
|
+
flow,
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
return this.__super__.updateFlow({
|
|
36
|
+
flow: Flow.transformSet(flow),
|
|
37
|
+
...props,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async createAdvancedFlow({
|
|
42
|
+
advancedflow,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
return this.__super__.createAdvancedFlow({
|
|
46
|
+
advancedflow: AdvancedFlow.transformSet(advancedflow),
|
|
47
|
+
...props,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async updateAdvancedFlow({
|
|
52
|
+
advancedflow,
|
|
53
|
+
...props
|
|
54
|
+
}) {
|
|
55
|
+
return this.__super__.updateAdvancedFlow({
|
|
56
|
+
advancedflow: AdvancedFlow.transformSet(advancedflow),
|
|
57
|
+
...props,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async getFlowCardTrigger({
|
|
62
|
+
$cache = true,
|
|
63
|
+
id,
|
|
64
|
+
}) {
|
|
65
|
+
if ($cache === true && this.__cache['flowcardtrigger'][id]) {
|
|
66
|
+
return this.__cache['flowcardtrigger'][id];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return this.__super__getFlowCardCondition({
|
|
70
|
+
id: id.split(':').reverse()[0],
|
|
71
|
+
uri: id.split(':', 3).join(':'),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async getFlowCardCondition({
|
|
76
|
+
$cache = true,
|
|
77
|
+
id,
|
|
78
|
+
}) {
|
|
79
|
+
if ($cache === true && this.__cache['flowcardcondition'][id]) {
|
|
80
|
+
return this.__cache['flowcardcondition'][id];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return this.__super__getFlowCardCondition({
|
|
84
|
+
id: id.split(':').reverse()[0],
|
|
85
|
+
uri: id.split(':', 3).join(':'),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async runFlowCardCondition({
|
|
90
|
+
id,
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
return this.__super__runFlowCardCondition({
|
|
94
|
+
id: id.split(':').reverse()[0],
|
|
95
|
+
uri: id.split(':', 3).join(':'),
|
|
96
|
+
...props,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async getFlowCardAction({
|
|
101
|
+
$cache = true,
|
|
102
|
+
id,
|
|
103
|
+
}) {
|
|
104
|
+
if ($cache === true && this.__cache['flowcardaction'][id]) {
|
|
105
|
+
return this.__cache['flowcardaction'][id];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return this.__super__getFlowCardAction({
|
|
109
|
+
id: id.split(':').reverse()[0],
|
|
110
|
+
uri: id.split(':', 3).join(':'),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async runFlowCardAction({
|
|
115
|
+
id,
|
|
116
|
+
...props
|
|
117
|
+
}) {
|
|
118
|
+
return this.__super__runFlowCardAction({
|
|
119
|
+
id: id.split(':').reverse()[0],
|
|
120
|
+
uri: id.split(':', 3).join(':'),
|
|
121
|
+
...props,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
module.exports = ManagerFlow;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FlowTokenV3 = require('../../HomeyAPIV3/ManagerFlowToken/FlowToken');
|
|
4
|
+
|
|
5
|
+
class FlowToken extends FlowTokenV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
// TODO: Remove FlowTokenV3.transform and uncomment this after front-end does not use FlowToken.uri|id|uriObj anymore!
|
|
9
|
+
// item = super.transformGet(item);
|
|
10
|
+
|
|
11
|
+
item.ownerUri = item.uri;
|
|
12
|
+
item.ownerId = item.id;
|
|
13
|
+
item.id = `${item.ownerUri}:${item.ownerId}`;
|
|
14
|
+
|
|
15
|
+
delete item.ownerName; // Prepare for back-end change
|
|
16
|
+
delete item.uri;
|
|
17
|
+
delete item.uriObj;
|
|
18
|
+
|
|
19
|
+
return item;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = FlowToken;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ManagerFlowTokenV3 = require('../HomeyAPIV3/ManagerFlowToken');
|
|
4
|
+
const FlowToken = require('./ManagerFlowToken/FlowToken');
|
|
5
|
+
|
|
6
|
+
class ManagerFlowToken extends ManagerFlowTokenV3 {
|
|
7
|
+
|
|
8
|
+
static CRUD = {
|
|
9
|
+
...super.CRUD,
|
|
10
|
+
FlowToken,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
async getFlowToken({
|
|
14
|
+
$cache = true,
|
|
15
|
+
id,
|
|
16
|
+
}) {
|
|
17
|
+
if ($cache === true && this.__cache['flowtoken'][id]) {
|
|
18
|
+
return this.__cache['flowtoken'][id];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return this.__super__getFlowToken({
|
|
22
|
+
id: id.split(':').reverse()[0],
|
|
23
|
+
uri: id.split(':', 3).join(':'),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = ManagerFlowToken;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const LogV3 = require('../../HomeyAPIV3/ManagerInsights/Log');
|
|
4
|
+
|
|
5
|
+
class Log extends LogV3 {
|
|
6
|
+
|
|
7
|
+
static transformGet(item) {
|
|
8
|
+
item = super.transformGet(item);
|
|
9
|
+
|
|
10
|
+
item.ownerId = item.id;
|
|
11
|
+
item.ownerUri = item.uri;
|
|
12
|
+
item.id = `${item.uri}:${item.id}`;
|
|
13
|
+
|
|
14
|
+
delete item.uri;
|
|
15
|
+
delete item.uriObj;
|
|
16
|
+
|
|
17
|
+
return item;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = Log;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ManagerInsightsV3 = require('../HomeyAPIV3/ManagerInsights');
|
|
4
|
+
const Log = require('./ManagerInsights/Log');
|
|
5
|
+
|
|
6
|
+
class ManagerInsights extends ManagerInsightsV3 {
|
|
7
|
+
|
|
8
|
+
static CRUD = {
|
|
9
|
+
...super.CRUD,
|
|
10
|
+
Log,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async getLog({
|
|
14
|
+
$cache = true,
|
|
15
|
+
id,
|
|
16
|
+
}) {
|
|
17
|
+
if ($cache === true && this.__cache['log'][id]) {
|
|
18
|
+
return this.__cache['log'][id];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return this.__super__getLog({
|
|
22
|
+
id: id.split(':').reverse()[0],
|
|
23
|
+
uri: id.split(':', 3).join(':'),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getLogEntries({ id }) {
|
|
28
|
+
return this.__super__getLogEntries({
|
|
29
|
+
id: id.split(':').reverse()[0],
|
|
30
|
+
uri: id.split(':', 3).join(':'),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async deleteLogEntries({ id }) {
|
|
35
|
+
return this.__super__deleteLogEntries({
|
|
36
|
+
id: id.split(':').reverse()[0],
|
|
37
|
+
uri: id.split(':', 3).join(':'),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// deleteLog
|
|
42
|
+
// updateLog
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = ManagerInsights;
|