@modernlock/common 1.0.47 → 1.0.49
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/build/events/queues.d.ts +1 -2
- package/build/events/queues.js +1 -2
- package/build/events/routing-keys.d.ts +1 -2
- package/build/events/routing-keys.js +2 -3
- package/build/events/send-notification-publisher.d.ts +25 -0
- package/build/events/{Group-notification-publisher.js → send-notification-publisher.js} +5 -5
- package/build/index.d.ts +2 -2
- package/build/index.js +2 -2
- package/build/things/commands.d.ts +105 -0
- package/build/things/commands.js +126 -0
- package/package.json +1 -1
- package/build/events/Group-notification-publisher.d.ts +0 -10
- package/build/events/single-notification-publisher.d.ts +0 -10
- package/build/events/single-notification-publisher.js +0 -17
package/build/events/queues.d.ts
CHANGED
|
@@ -14,8 +14,7 @@ export declare enum Queues {
|
|
|
14
14
|
deviceCommandQueue = "deviceCommandQueue",
|
|
15
15
|
FileRemoveQeueu = "FileRemoveQeueu",
|
|
16
16
|
createLogQueue = "createLogQueue",
|
|
17
|
-
|
|
18
|
-
groupNotificationsQeueu = "groupNotificationsQeueu",
|
|
17
|
+
sendNotificationQueue = "sendNotificationQueue",
|
|
19
18
|
chatNotificationsQueue = "chatNotificationsQueue",
|
|
20
19
|
notificationAppQueue = "notificationAppQueue",
|
|
21
20
|
groupNotificationAppQueue = "groupNotificationAppQueue",
|
package/build/events/queues.js
CHANGED
|
@@ -25,8 +25,7 @@ var Queues;
|
|
|
25
25
|
// Log server queue
|
|
26
26
|
Queues["createLogQueue"] = "createLogQueue";
|
|
27
27
|
// notification service queues
|
|
28
|
-
Queues["
|
|
29
|
-
Queues["groupNotificationsQeueu"] = "groupNotificationsQeueu";
|
|
28
|
+
Queues["sendNotificationQueue"] = "sendNotificationQueue";
|
|
30
29
|
Queues["chatNotificationsQueue"] = "chatNotificationsQueue";
|
|
31
30
|
// app workers queue
|
|
32
31
|
Queues["notificationAppQueue"] = "notificationAppQueue";
|
|
@@ -17,9 +17,8 @@ export declare enum RoutingKeys {
|
|
|
17
17
|
severalUsersCreated = "severalUsers:created",
|
|
18
18
|
fileConfirmed = "file:confirmed",
|
|
19
19
|
fileRemoved = "file:removed",
|
|
20
|
-
groupNotification = "notification:groupNotification",
|
|
21
|
-
singleNotification = "notification:singleNotification",
|
|
22
20
|
chatNotification = "notification:chatNotification",
|
|
21
|
+
sendNotification = "notification:sendNotification",
|
|
23
22
|
notificationEmailWorkers = "notification:email-workers",
|
|
24
23
|
groupNotificationEmailWorkers = "groupNotification:email-workers",
|
|
25
24
|
chatNotificationEmailWorkers = "chatNotification:email-workers",
|
|
@@ -26,10 +26,9 @@ var RoutingKeys;
|
|
|
26
26
|
RoutingKeys["severalUsersCreated"] = "severalUsers:created";
|
|
27
27
|
RoutingKeys["fileConfirmed"] = "file:confirmed";
|
|
28
28
|
RoutingKeys["fileRemoved"] = "file:removed";
|
|
29
|
-
// notification service routing
|
|
30
|
-
RoutingKeys["groupNotification"] = "notification:groupNotification";
|
|
31
|
-
RoutingKeys["singleNotification"] = "notification:singleNotification";
|
|
29
|
+
// notification service routing key
|
|
32
30
|
RoutingKeys["chatNotification"] = "notification:chatNotification";
|
|
31
|
+
RoutingKeys["sendNotification"] = "notification:sendNotification";
|
|
33
32
|
// Email workers routing keys
|
|
34
33
|
RoutingKeys["notificationEmailWorkers"] = "notification:email-workers";
|
|
35
34
|
RoutingKeys["groupNotificationEmailWorkers"] = "groupNotification:email-workers";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RoutingKeys } from './routing-keys';
|
|
2
|
+
import { ExchangeTypes } from './exchange-types';
|
|
3
|
+
import { Exchanges } from './exchanges';
|
|
4
|
+
import { Producer } from './base-producer';
|
|
5
|
+
interface NotificationEvent {
|
|
6
|
+
data: {
|
|
7
|
+
userId: string;
|
|
8
|
+
isRead?: boolean;
|
|
9
|
+
level: string;
|
|
10
|
+
domain: string;
|
|
11
|
+
title: string;
|
|
12
|
+
message: string;
|
|
13
|
+
data?: any;
|
|
14
|
+
actions?: {
|
|
15
|
+
label: string;
|
|
16
|
+
url: string;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare class SendNotificationPublisher extends Producer<NotificationEvent> {
|
|
21
|
+
exchange: Exchanges.mainExchange;
|
|
22
|
+
exchangeType: ExchangeTypes.direct;
|
|
23
|
+
routingKey: RoutingKeys.sendNotification;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SendNotificationPublisher = void 0;
|
|
4
|
+
const routing_keys_1 = require("./routing-keys");
|
|
4
5
|
const exchange_types_1 = require("./exchange-types");
|
|
5
6
|
const exchanges_1 = require("./exchanges");
|
|
6
|
-
const routing_keys_1 = require("./routing-keys");
|
|
7
7
|
const base_producer_1 = require("./base-producer");
|
|
8
|
-
class
|
|
8
|
+
class SendNotificationPublisher extends base_producer_1.Producer {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.exchange = exchanges_1.Exchanges.mainExchange;
|
|
12
12
|
this.exchangeType = exchange_types_1.ExchangeTypes.direct;
|
|
13
|
-
this.routingKey = routing_keys_1.RoutingKeys.
|
|
13
|
+
this.routingKey = routing_keys_1.RoutingKeys.sendNotification;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.
|
|
16
|
+
exports.SendNotificationPublisher = SendNotificationPublisher;
|
|
17
17
|
;
|
package/build/index.d.ts
CHANGED
|
@@ -6,8 +6,7 @@ export * from "./events/queues";
|
|
|
6
6
|
export * from "./events/routing-keys";
|
|
7
7
|
export * from "./events/rabbitmq-wrapper";
|
|
8
8
|
export * from "./events/templates";
|
|
9
|
-
export * from "./events/
|
|
10
|
-
export * from "./events/Group-notification-publisher";
|
|
9
|
+
export * from "./events/send-notification-publisher";
|
|
11
10
|
export * from "./events/chat-notification-publisher";
|
|
12
11
|
export * from "./events/events";
|
|
13
12
|
export * from "./events/mappings";
|
|
@@ -34,3 +33,4 @@ export * from "./config/elasticsearchConnection";
|
|
|
34
33
|
export * from "./interfaces/reservation";
|
|
35
34
|
export * from "./things/events";
|
|
36
35
|
export * from "./mqtt/topics";
|
|
36
|
+
export * from "./things/commands";
|
package/build/index.js
CHANGED
|
@@ -22,8 +22,7 @@ __exportStar(require("./events/queues"), exports);
|
|
|
22
22
|
__exportStar(require("./events/routing-keys"), exports);
|
|
23
23
|
__exportStar(require("./events/rabbitmq-wrapper"), exports);
|
|
24
24
|
__exportStar(require("./events/templates"), exports);
|
|
25
|
-
__exportStar(require("./events/
|
|
26
|
-
__exportStar(require("./events/Group-notification-publisher"), exports);
|
|
25
|
+
__exportStar(require("./events/send-notification-publisher"), exports);
|
|
27
26
|
__exportStar(require("./events/chat-notification-publisher"), exports);
|
|
28
27
|
__exportStar(require("./events/events"), exports);
|
|
29
28
|
__exportStar(require("./events/mappings"), exports);
|
|
@@ -50,3 +49,4 @@ __exportStar(require("./config/elasticsearchConnection"), exports);
|
|
|
50
49
|
__exportStar(require("./interfaces/reservation"), exports);
|
|
51
50
|
__exportStar(require("./things/events"), exports);
|
|
52
51
|
__exportStar(require("./mqtt/topics"), exports);
|
|
52
|
+
__exportStar(require("./things/commands"), exports);
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export declare const commandsDictionary: {
|
|
2
|
+
smart_lock: {
|
|
3
|
+
set_lock_state: {
|
|
4
|
+
command: string;
|
|
5
|
+
logoUrl: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
thermostat: {
|
|
14
|
+
set_temperature: {
|
|
15
|
+
command: string;
|
|
16
|
+
logoUrl: string;
|
|
17
|
+
parameters: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
label: string;
|
|
21
|
+
min: number;
|
|
22
|
+
max: number;
|
|
23
|
+
unit: string;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
set_mode: {
|
|
27
|
+
command: string;
|
|
28
|
+
logoUrl: string;
|
|
29
|
+
parameters: {
|
|
30
|
+
name: string;
|
|
31
|
+
type: string;
|
|
32
|
+
label: string;
|
|
33
|
+
options: string[];
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
set_fan_mode: {
|
|
37
|
+
command: string;
|
|
38
|
+
logoUrl: string;
|
|
39
|
+
parameters: {
|
|
40
|
+
name: string;
|
|
41
|
+
type: string;
|
|
42
|
+
label: string;
|
|
43
|
+
options: string[];
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
46
|
+
set_humidity: {
|
|
47
|
+
command: string;
|
|
48
|
+
logoUrl: string;
|
|
49
|
+
parameters: {
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
label: string;
|
|
53
|
+
min: number;
|
|
54
|
+
max: number;
|
|
55
|
+
unit: string;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
light_bulb: {
|
|
60
|
+
on: {
|
|
61
|
+
command: string;
|
|
62
|
+
logoUrl: string;
|
|
63
|
+
parameters: {
|
|
64
|
+
name: string;
|
|
65
|
+
type: string;
|
|
66
|
+
label: string;
|
|
67
|
+
min: number;
|
|
68
|
+
max: number;
|
|
69
|
+
unit: string;
|
|
70
|
+
}[];
|
|
71
|
+
};
|
|
72
|
+
off: {
|
|
73
|
+
command: string;
|
|
74
|
+
logoUrl: string;
|
|
75
|
+
parameters: {
|
|
76
|
+
name: string;
|
|
77
|
+
type: string;
|
|
78
|
+
label: string;
|
|
79
|
+
min: number;
|
|
80
|
+
max: number;
|
|
81
|
+
unit: string;
|
|
82
|
+
}[];
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
window_sensor: {
|
|
86
|
+
open: {
|
|
87
|
+
command: string;
|
|
88
|
+
logoUrl: string;
|
|
89
|
+
parameters: {
|
|
90
|
+
name: string;
|
|
91
|
+
type: string;
|
|
92
|
+
label: string;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
close: {
|
|
96
|
+
command: string;
|
|
97
|
+
logoUrl: string;
|
|
98
|
+
parameters: {
|
|
99
|
+
name: string;
|
|
100
|
+
type: string;
|
|
101
|
+
label: string;
|
|
102
|
+
}[];
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandsDictionary = void 0;
|
|
4
|
+
exports.commandsDictionary = {
|
|
5
|
+
"smart_lock": {
|
|
6
|
+
"set_lock_state": {
|
|
7
|
+
"command": "set_lock_state",
|
|
8
|
+
"logoUrl": "logoUrl",
|
|
9
|
+
"parameters": [
|
|
10
|
+
{
|
|
11
|
+
"name": "locked",
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"label": "Lock State"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"thermostat": {
|
|
19
|
+
"set_temperature": {
|
|
20
|
+
"command": "set_temperature",
|
|
21
|
+
"logoUrl": "logoUrl",
|
|
22
|
+
"parameters": [
|
|
23
|
+
{
|
|
24
|
+
"name": "targetTemp",
|
|
25
|
+
"type": "number",
|
|
26
|
+
"label": "Target Temperature",
|
|
27
|
+
"min": 16,
|
|
28
|
+
"max": 30,
|
|
29
|
+
"unit": "°C"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"set_mode": {
|
|
34
|
+
"command": "set_mode",
|
|
35
|
+
"logoUrl": "logoUrl",
|
|
36
|
+
"parameters": [
|
|
37
|
+
{
|
|
38
|
+
"name": "mode",
|
|
39
|
+
"type": "enum",
|
|
40
|
+
"label": "Mode",
|
|
41
|
+
"options": ["cool", "heat", "fan_only", "off"]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"set_fan_mode": {
|
|
46
|
+
"command": "set_fan_mode",
|
|
47
|
+
"logoUrl": "logoUrl",
|
|
48
|
+
"parameters": [
|
|
49
|
+
{
|
|
50
|
+
"name": "fan_mode",
|
|
51
|
+
"type": "enum",
|
|
52
|
+
"label": "Fan Mode",
|
|
53
|
+
"options": ["auto", "on", "off"]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"set_humidity": {
|
|
58
|
+
"command": "set_humidity",
|
|
59
|
+
"logoUrl": "logoUrl",
|
|
60
|
+
"parameters": [
|
|
61
|
+
{
|
|
62
|
+
"name": "humidity",
|
|
63
|
+
"type": "number",
|
|
64
|
+
"label": "Humidity",
|
|
65
|
+
"min": 0,
|
|
66
|
+
"max": 100,
|
|
67
|
+
"unit": "%"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"light_bulb": {
|
|
73
|
+
"on": {
|
|
74
|
+
"command": "on",
|
|
75
|
+
"logoUrl": "logoUrl",
|
|
76
|
+
"parameters": [
|
|
77
|
+
{
|
|
78
|
+
"name": "brightness",
|
|
79
|
+
"type": "number",
|
|
80
|
+
"label": "Brightness",
|
|
81
|
+
"min": 0,
|
|
82
|
+
"max": 100,
|
|
83
|
+
"unit": "%"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"off": {
|
|
88
|
+
"command": "off",
|
|
89
|
+
"logoUrl": "logoUrl",
|
|
90
|
+
"parameters": [
|
|
91
|
+
{
|
|
92
|
+
"name": "brightness",
|
|
93
|
+
"type": "number",
|
|
94
|
+
"label": "Brightness",
|
|
95
|
+
"min": 0,
|
|
96
|
+
"max": 100,
|
|
97
|
+
"unit": "%"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"window_sensor": {
|
|
103
|
+
"open": {
|
|
104
|
+
"command": "open",
|
|
105
|
+
"logoUrl": "logoUrl",
|
|
106
|
+
"parameters": [
|
|
107
|
+
{
|
|
108
|
+
"name": "open",
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"label": "Open"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"close": {
|
|
115
|
+
"command": "close",
|
|
116
|
+
"logoUrl": "logoUrl",
|
|
117
|
+
"parameters": [
|
|
118
|
+
{
|
|
119
|
+
"name": "close",
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"label": "Close"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ExchangeTypes } from './exchange-types';
|
|
2
|
-
import { Exchanges } from './exchanges';
|
|
3
|
-
import { RoutingKeys } from "./routing-keys";
|
|
4
|
-
import { GroupNotificationEvent } from "./events";
|
|
5
|
-
import { Producer } from "./base-producer";
|
|
6
|
-
export declare class GroupNotificationPublisher extends Producer<GroupNotificationEvent> {
|
|
7
|
-
exchange: Exchanges.mainExchange;
|
|
8
|
-
exchangeType: ExchangeTypes.direct;
|
|
9
|
-
routingKey: RoutingKeys.groupNotification;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ExchangeTypes } from './exchange-types';
|
|
2
|
-
import { Exchanges } from './exchanges';
|
|
3
|
-
import { RoutingKeys } from "./routing-keys";
|
|
4
|
-
import { SingleNotificationEvent } from "./events";
|
|
5
|
-
import { Producer } from "./base-producer";
|
|
6
|
-
export declare class SingleNotificationPublisher extends Producer<SingleNotificationEvent> {
|
|
7
|
-
exchange: Exchanges.mainExchange;
|
|
8
|
-
exchangeType: ExchangeTypes.direct;
|
|
9
|
-
routingKey: RoutingKeys.singleNotification;
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SingleNotificationPublisher = void 0;
|
|
4
|
-
const exchange_types_1 = require("./exchange-types");
|
|
5
|
-
const exchanges_1 = require("./exchanges");
|
|
6
|
-
const routing_keys_1 = require("./routing-keys");
|
|
7
|
-
const base_producer_1 = require("./base-producer");
|
|
8
|
-
class SingleNotificationPublisher extends base_producer_1.Producer {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.exchange = exchanges_1.Exchanges.mainExchange;
|
|
12
|
-
this.exchangeType = exchange_types_1.ExchangeTypes.direct;
|
|
13
|
-
this.routingKey = routing_keys_1.RoutingKeys.singleNotification;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.SingleNotificationPublisher = SingleNotificationPublisher;
|
|
17
|
-
;
|