@kohost/api-client 3.0.0-beta.7 → 3.0.0-beta.70
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 +71 -0
- package/dist/cjs/AMQPClient/index.js +298 -0
- package/dist/cjs/{Client.js → Client/index.js} +1535 -586
- package/dist/cjs/Commands/CheckInReservationCommand.js +19 -0
- package/dist/cjs/Commands/Command.js +34 -0
- package/dist/cjs/Commands/CreateImageUploadEndpointCommand.js +17 -0
- package/dist/cjs/Commands/CreateShortLinkCommand.js +20 -0
- package/dist/cjs/Commands/DiscoverCategoriesCommand.js +20 -0
- package/dist/cjs/Commands/DiscoverReservationSpaceCategoryAvailabilitiesCommand.js +20 -0
- package/dist/cjs/Commands/DiscoverReservationsCommand.js +20 -0
- package/dist/cjs/Commands/DiscoverRoomsCommand.js +37 -0
- package/dist/cjs/Commands/DiscoverUsersCommand.js +19 -0
- package/dist/cjs/Commands/GetMobileKeyCommand.js +24 -0
- package/dist/cjs/Commands/GetProductsCommand.js +17 -0
- package/dist/cjs/Commands/OCRDocumentCommand.js +15 -0
- package/dist/cjs/Commands/SellProductsCommand.js +17 -0
- package/dist/cjs/Commands/SendEmailCommand.js +24 -0
- package/dist/cjs/Commands/SendSMSCommand.js +21 -0
- package/dist/cjs/Commands/SetAlarmCommand.js +17 -0
- package/dist/cjs/Commands/SetCourtesyCommand.js +17 -0
- package/dist/cjs/Commands/SetDimmerCommand.js +17 -0
- package/dist/cjs/Commands/SetLockCommand.js +17 -0
- package/dist/cjs/Commands/SetMediaCommand.js +17 -0
- package/dist/cjs/Commands/SetSceneCommand.js +17 -0
- package/dist/cjs/Commands/SetSwitchCommand.js +17 -0
- package/dist/cjs/Commands/SetThermostatCommand.js +17 -0
- package/dist/cjs/Commands/SetWindowCoveringCommand.js +17 -0
- package/dist/cjs/Commands/UpdateReservationCommand.js +19 -0
- package/dist/cjs/Commands/UpdateUserCommand.js +41 -0
- package/dist/cjs/Commands/UploadImageCommand.js +17 -0
- package/dist/cjs/Commands/index.js +55 -0
- package/dist/cjs/Errors/AppError.js +8 -0
- package/dist/cjs/Errors/AuthenticationError.js +9 -0
- package/dist/cjs/Errors/AuthorizationError.js +9 -0
- package/dist/cjs/Errors/ConflictError.js +9 -0
- package/dist/cjs/Errors/DeviceCommError.js +9 -0
- package/dist/cjs/Errors/LoginError.js +9 -0
- package/dist/cjs/Errors/NotFoundError.js +9 -0
- package/dist/cjs/Errors/RequestError.js +9 -0
- package/dist/cjs/Errors/SystemCommError.js +9 -0
- package/dist/cjs/Errors/TokenExpiredError.js +9 -0
- package/dist/cjs/Errors/UnprocessableRequestError.js +9 -0
- package/dist/cjs/Errors/ValidationError.js +9 -0
- package/dist/cjs/Errors/index.js +16 -0
- package/dist/cjs/Events/ApplicationInUseEvent.js +21 -0
- package/dist/cjs/Events/ApplicationOutOfUseEvent.js +21 -0
- package/dist/cjs/Events/EmailEvent.js +18 -0
- package/dist/cjs/Events/Event.js +55 -0
- package/dist/cjs/Events/SMSEvent.js +18 -0
- package/dist/cjs/Events/SMSSentEvent.js +17 -0
- package/dist/cjs/Events/SceneSetEvent.js +17 -0
- package/dist/cjs/Events/ShortLinkCreatedEvent.js +17 -0
- package/dist/cjs/Events/SystemAlarmUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemCameraUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemCategoryUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemCourtesyUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemDimmerUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemGatewayUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemLockUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemMediaSourceUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemMotionSensorUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemProductUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemReservationUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemSceneControllerUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemSpaceUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemSwitchUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemThermostatUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemUserUpdatedEvent.js +17 -0
- package/dist/cjs/Events/SystemWindowCoveringUpdatedEvent.js +17 -0
- package/dist/cjs/Events/index.js +54 -0
- package/dist/cjs/Models/Alarm.js +35 -0
- package/dist/cjs/Models/Camera.js +35 -0
- package/dist/cjs/Models/Category.js +36 -0
- package/dist/cjs/Models/Courtesy.js +39 -0
- package/dist/cjs/Models/Credential.js +35 -0
- package/dist/cjs/Models/Dimmer.js +61 -0
- package/dist/cjs/Models/DiscoveredDevice.js +36 -0
- package/dist/cjs/Models/EmailMessage.js +35 -0
- package/dist/cjs/Models/EnergyReport.js +35 -0
- package/dist/cjs/Models/EnergyReportShard.js +35 -0
- package/dist/cjs/Models/Gateway.js +35 -0
- package/dist/cjs/Models/Identification.js +38 -0
- package/dist/cjs/Models/Kohost.js +96 -0
- package/dist/cjs/Models/Lock.js +39 -0
- package/dist/cjs/Models/MediaFile.js +48 -0
- package/dist/cjs/Models/MediaSource.js +35 -0
- package/dist/cjs/Models/MotionSensor.js +35 -0
- package/dist/cjs/Models/Notification.js +34 -0
- package/dist/cjs/Models/Order.js +97 -0
- package/dist/cjs/Models/Organization.js +34 -0
- package/dist/cjs/Models/Product.js +35 -0
- package/dist/cjs/Models/Property.js +34 -0
- package/dist/cjs/Models/Reservation.js +114 -0
- package/dist/cjs/Models/Room.js +218 -0
- package/dist/cjs/Models/Scene.js +169 -0
- package/dist/cjs/Models/ShortLink.js +35 -0
- package/dist/cjs/Models/SmsMessage.js +35 -0
- package/dist/cjs/Models/Space.js +97 -0
- package/dist/cjs/Models/Switch.js +39 -0
- package/dist/cjs/Models/SystemUser.js +55 -0
- package/dist/cjs/Models/Thermostat.js +86 -0
- package/dist/cjs/Models/Ticket.js +112 -0
- package/dist/cjs/Models/User.js +115 -0
- package/dist/cjs/Models/WindowCovering.js +55 -0
- package/dist/cjs/Models/index.js +72 -0
- package/dist/cjs/SocketIoClient/index.js +74 -0
- package/dist/cjs/defs/deviceTypes.js +15 -0
- package/dist/cjs/defs/formalDeviceTypes.js +6 -0
- package/dist/cjs/defs/index.js +11 -0
- package/dist/cjs/{index.cjs.js → index.js} +7 -1
- package/dist/cjs/schemas/AlarmSchema.d.ts +150 -0
- package/dist/cjs/schemas/CameraSchema.d.ts +142 -0
- package/dist/cjs/schemas/CategorySchema.d.ts +81 -0
- package/dist/cjs/schemas/CourtesySchema.d.ts +140 -0
- package/dist/cjs/schemas/CredentialSchema.d.ts +21 -0
- package/dist/cjs/schemas/DefinitionsSchema.d.ts +10 -0
- package/dist/cjs/schemas/DimmerSchema.d.ts +140 -0
- package/dist/cjs/schemas/DiscoveredDeviceSchema.d.ts +39 -0
- package/dist/cjs/schemas/EmailMessageSchema.d.ts +49 -0
- package/dist/cjs/schemas/EnergyReportSchema.d.ts +57 -0
- package/dist/cjs/schemas/EnergyReportShardSchema.d.ts +61 -0
- package/dist/cjs/schemas/GatewaySchema.d.ts +137 -0
- package/dist/cjs/schemas/IdentificationSchema.d.ts +45 -0
- package/dist/cjs/schemas/LockSchema.d.ts +140 -0
- package/dist/cjs/schemas/MediaFileSchema.d.ts +43 -0
- package/dist/cjs/schemas/MediaSourceSchema.d.ts +237 -0
- package/dist/cjs/schemas/MotionSensorSchema.d.ts +136 -0
- package/dist/cjs/schemas/NotificationSchema.d.ts +54 -0
- package/dist/cjs/schemas/OrderSchema.d.ts +91 -0
- package/dist/cjs/schemas/OrganizationSchema.d.ts +33 -0
- package/dist/cjs/schemas/PaymentSchema.d.ts +33 -0
- package/dist/cjs/schemas/ProductSchema.d.ts +65 -0
- package/dist/cjs/schemas/PropertySchema.d.ts +132 -0
- package/dist/cjs/schemas/ReservationSchema.d.ts +112 -0
- package/dist/cjs/schemas/RoomSchema.d.ts +1060 -0
- package/dist/cjs/schemas/SceneSchema.d.ts +57 -0
- package/dist/cjs/schemas/ShortLinkSchema.d.ts +20 -0
- package/dist/cjs/schemas/SmsMessageSchema.d.ts +40 -0
- package/dist/cjs/schemas/SpaceSchema.d.ts +58 -0
- package/dist/cjs/schemas/SwitchSchema.d.ts +140 -0
- package/dist/cjs/schemas/SystemUserSchema.d.ts +192 -0
- package/dist/cjs/schemas/ThermostatSchema.d.ts +171 -0
- package/dist/cjs/schemas/TicketSchema.d.ts +88 -0
- package/dist/cjs/schemas/UserSchema.d.ts +280 -0
- package/dist/cjs/schemas/WindowCoveringSchema.d.ts +139 -0
- package/dist/cjs/schemas/alarm.json +82 -0
- package/dist/cjs/schemas/camera.json +50 -0
- package/dist/cjs/schemas/category.json +42 -0
- package/dist/cjs/schemas/courtesy.json +49 -0
- package/dist/cjs/schemas/credential.json +37 -0
- package/dist/cjs/schemas/definitions.json +217 -0
- package/dist/cjs/schemas/dimmer.json +46 -0
- package/dist/cjs/schemas/discoveredDevice.json +31 -0
- package/dist/cjs/schemas/emailMessage.json +71 -0
- package/dist/cjs/schemas/energyReport.json +86 -0
- package/dist/cjs/schemas/energyReportShard.json +75 -0
- package/dist/cjs/schemas/gateway.json +35 -0
- package/dist/cjs/schemas/identification.json +61 -0
- package/dist/cjs/schemas/lock.json +45 -0
- package/dist/cjs/schemas/mediaFile.json +70 -0
- package/dist/cjs/schemas/mediaSource.json +187 -0
- package/dist/cjs/schemas/motionSensor.json +32 -0
- package/dist/cjs/schemas/notification.json +29 -0
- package/dist/cjs/schemas/order.json +182 -0
- package/dist/cjs/schemas/organization.json +36 -0
- package/dist/cjs/schemas/payment.json +47 -0
- package/dist/cjs/schemas/product.json +41 -0
- package/dist/cjs/schemas/property.json +346 -0
- package/dist/cjs/schemas/reservation.json +130 -0
- package/dist/cjs/schemas/room.json +98 -0
- package/dist/cjs/schemas/scene.json +121 -0
- package/dist/cjs/schemas/shortLink.json +30 -0
- package/dist/cjs/schemas/smsMessage.json +61 -0
- package/dist/cjs/schemas/space.json +118 -0
- package/dist/cjs/schemas/switch.json +45 -0
- package/dist/cjs/schemas/systemUser.json +98 -0
- package/dist/cjs/schemas/thermostat.json +150 -0
- package/dist/cjs/schemas/ticket.json +141 -0
- package/dist/cjs/schemas/user.json +170 -0
- package/dist/cjs/schemas/windowCovering.json +43 -0
- package/dist/cjs/utils/errorFactory.js +8 -0
- package/dist/cjs/utils/eventFactory.js +10 -0
- package/dist/cjs/utils/getDeviceTypes.js +7 -0
- package/dist/cjs/utils/getFormalDeviceType.js +5 -0
- package/dist/cjs/utils/index.js +11 -0
- package/dist/cjs/utils/schema.js +25 -0
- package/dist/esm/Client.js +1632 -627
- package/dist/esm/Client.js.map +4 -4
- package/dist/esm/Commands.js +521 -113
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Errors.js +73 -22
- package/dist/esm/Errors.js.map +3 -3
- package/dist/esm/Events.js +318 -73
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +3322 -1199
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +4846 -0
- package/dist/esm/SocketIoClient.js.map +7 -0
- package/dist/esm/defs.js +146 -101
- package/dist/esm/defs.js.map +4 -4
- package/dist/esm/index.js +17 -10
- package/dist/esm/utils.js +445 -73
- package/dist/esm/utils.js.map +3 -3
- package/dist/useCases/AdminUpdateCustomer.js +1 -1
- package/dist/useCases/AssignSpaceToReservation.js +32 -0
- package/dist/useCases/{AdminCreateProperty.js → BatchNotifyCheckIn.js} +2 -2
- package/dist/useCases/{AdminCreateCustomer.js → CreateCateory.js} +2 -2
- package/dist/useCases/CreateImageUploadEndpoint.js +32 -0
- package/dist/useCases/{DeleteIntegration.js → CreateMediaSource.js} +4 -4
- package/dist/useCases/{AdminListCustomers.js → CreateOrganization.js} +3 -3
- package/dist/useCases/{AdminLoginUser.js → CreateProperty.js} +2 -2
- package/dist/useCases/DeleteCategory.js +32 -0
- package/dist/useCases/DeleteMediaFile.js +32 -0
- package/dist/useCases/DeleteMediaSource.js +32 -0
- package/dist/useCases/{ListIntegrations.js → DescribeCategory.js} +3 -3
- package/dist/useCases/{DeleteSource.js → DescribeLockCredential.js} +3 -3
- package/dist/useCases/{AdminListAdminUsers.js → DescribeMediaSource.js} +3 -3
- package/dist/useCases/DescribeMyAccessCredentials.js +32 -0
- package/dist/useCases/{AdminCreateAdminUser.js → DescribeOrganization.js} +4 -4
- package/dist/useCases/{DescribeIntegration.js → DescribeProduct.js} +2 -2
- package/dist/useCases/{AdminDescribeCustomer.js → DescribeProperty.js} +2 -2
- package/dist/useCases/DescribeReservationEarlyCheckInProducts.js +32 -0
- package/dist/useCases/DescribeReservationLateCheckOutProducts.js +32 -0
- package/dist/useCases/{AdminDescribeProperty.js → DescribeReservationRoomUpgrades.js} +2 -2
- package/dist/useCases/ListCategories.js +32 -0
- package/dist/useCases/ListMediaSources.js +32 -0
- package/dist/useCases/{CreateSource.js → ListMyOrders.js} +4 -4
- package/dist/useCases/{AdminListProperties.js → ListMyTickets.js} +2 -2
- package/dist/useCases/ListOrders.js +32 -0
- package/dist/useCases/{AdminRefreshToken.js → ListOrganizations.js} +3 -3
- package/dist/useCases/ListProperties.js +32 -0
- package/dist/useCases/ListScenes.js +32 -0
- package/dist/useCases/ListTeam.js +32 -0
- package/dist/useCases/ListUserOrders.js +32 -0
- package/dist/useCases/ListUserSpaces.js +32 -0
- package/dist/useCases/LogoutUser.js +32 -0
- package/dist/useCases/PurchaseReservationEarlyCheckInProducts.js +32 -0
- package/dist/useCases/PurchaseReservationLateCheckOutProducts.js +32 -0
- package/dist/useCases/{CreateIntegrationDeviceMapEntry.js → PurchaseReservationRoomUpgrades.js} +2 -2
- package/dist/useCases/RequestLoginLink.js +1 -1
- package/dist/useCases/{CreateIntegration.js → RequestMyKeyToken.js} +2 -2
- package/dist/useCases/RequestPWAToken.js +32 -0
- package/dist/useCases/SendCheckInSMS.js +32 -0
- package/dist/useCases/{SetSource.js → SetDimmer.js} +2 -2
- package/dist/useCases/{DescribeSource.js → SetMediaSource.js} +3 -3
- package/dist/useCases/{UpdateSource.js → SetRoomScene.js} +3 -3
- package/dist/useCases/SetSpaceScene.js +32 -0
- package/dist/useCases/TipUser.js +32 -0
- package/dist/useCases/{AdminUpdateProperty.js → UpdateCategory.js} +2 -2
- package/dist/useCases/{UpdateIntegration.js → UpdateMediaSource.js} +3 -3
- package/dist/useCases/UpdateProperty.js +32 -0
- package/dist/useCases/UpdateReservationExpectedArrivalTime.js +32 -0
- package/dist/useCases/{ListSources.js → UploadImage.js} +4 -4
- package/package.json +36 -10
- package/dist/cjs/Commands.js +0 -585
- package/dist/cjs/Errors.js +0 -176
- package/dist/cjs/Events.js +0 -387
- package/dist/cjs/Models.js +0 -3612
- package/dist/cjs/defs.js +0 -178
- package/dist/cjs/utils.js +0 -250
- package/dist/useCases/AdminRequestLoginLink.js +0 -32
package/dist/esm/Commands.js
CHANGED
|
@@ -9,6 +9,9 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
9
9
|
var require_Command = __commonJS({
|
|
10
10
|
"src/Commands/Command.js"(exports, module) {
|
|
11
11
|
var Command = class {
|
|
12
|
+
static {
|
|
13
|
+
__name(this, "Command");
|
|
14
|
+
}
|
|
12
15
|
constructor(data) {
|
|
13
16
|
this.data = {};
|
|
14
17
|
if (!data)
|
|
@@ -31,23 +34,44 @@ var require_Command = __commonJS({
|
|
|
31
34
|
get exchange() {
|
|
32
35
|
return "Commands";
|
|
33
36
|
}
|
|
34
|
-
get replyTo() {
|
|
35
|
-
return "amq.rabbitmq.reply-to";
|
|
36
|
-
}
|
|
37
37
|
build() {
|
|
38
38
|
return { data: { ...this.data } };
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
__name(Command, "Command");
|
|
42
41
|
module.exports = Command;
|
|
43
42
|
}
|
|
44
43
|
});
|
|
45
44
|
|
|
45
|
+
// src/Commands/SetSceneCommand.js
|
|
46
|
+
var require_SetSceneCommand = __commonJS({
|
|
47
|
+
"src/Commands/SetSceneCommand.js"(exports, module) {
|
|
48
|
+
var Command = require_Command();
|
|
49
|
+
var SetSceneCommand = class extends Command {
|
|
50
|
+
static {
|
|
51
|
+
__name(this, "SetSceneCommand");
|
|
52
|
+
}
|
|
53
|
+
constructor({ id, devices, ...rest }) {
|
|
54
|
+
super({ id, devices, ...rest });
|
|
55
|
+
}
|
|
56
|
+
get name() {
|
|
57
|
+
return "SetScene";
|
|
58
|
+
}
|
|
59
|
+
get routingKey() {
|
|
60
|
+
return `scene.${this.data.id}.set`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
module.exports = SetSceneCommand;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
46
67
|
// src/Commands/SetAlarmCommand.js
|
|
47
68
|
var require_SetAlarmCommand = __commonJS({
|
|
48
69
|
"src/Commands/SetAlarmCommand.js"(exports, module) {
|
|
49
70
|
var Command = require_Command();
|
|
50
71
|
var SetAlarmCommand = class extends Command {
|
|
72
|
+
static {
|
|
73
|
+
__name(this, "SetAlarmCommand");
|
|
74
|
+
}
|
|
51
75
|
constructor({ id, zones, areas }) {
|
|
52
76
|
super({ id, zones, areas });
|
|
53
77
|
}
|
|
@@ -57,11 +81,7 @@ var require_SetAlarmCommand = __commonJS({
|
|
|
57
81
|
get routingKey() {
|
|
58
82
|
return `alarm.${this.data.id}.set`;
|
|
59
83
|
}
|
|
60
|
-
get replyTo() {
|
|
61
|
-
return "system.response.devices";
|
|
62
|
-
}
|
|
63
84
|
};
|
|
64
|
-
__name(SetAlarmCommand, "SetAlarmCommand");
|
|
65
85
|
module.exports = SetAlarmCommand;
|
|
66
86
|
}
|
|
67
87
|
});
|
|
@@ -71,6 +91,9 @@ var require_SetDimmerCommand = __commonJS({
|
|
|
71
91
|
"src/Commands/SetDimmerCommand.js"(exports, module) {
|
|
72
92
|
var Command = require_Command();
|
|
73
93
|
var SetDimmerCommand = class extends Command {
|
|
94
|
+
static {
|
|
95
|
+
__name(this, "SetDimmerCommand");
|
|
96
|
+
}
|
|
74
97
|
constructor({ id, level }) {
|
|
75
98
|
super({ id, level });
|
|
76
99
|
}
|
|
@@ -80,11 +103,7 @@ var require_SetDimmerCommand = __commonJS({
|
|
|
80
103
|
get routingKey() {
|
|
81
104
|
return `dimmer.${this.data.id}.set`;
|
|
82
105
|
}
|
|
83
|
-
get replyTo() {
|
|
84
|
-
return "system.response.devices";
|
|
85
|
-
}
|
|
86
106
|
};
|
|
87
|
-
__name(SetDimmerCommand, "SetDimmerCommand");
|
|
88
107
|
module.exports = SetDimmerCommand;
|
|
89
108
|
}
|
|
90
109
|
});
|
|
@@ -94,6 +113,9 @@ var require_SetSwitchCommand = __commonJS({
|
|
|
94
113
|
"src/Commands/SetSwitchCommand.js"(exports, module) {
|
|
95
114
|
var Command = require_Command();
|
|
96
115
|
var SetSwitchCommand = class extends Command {
|
|
116
|
+
static {
|
|
117
|
+
__name(this, "SetSwitchCommand");
|
|
118
|
+
}
|
|
97
119
|
constructor({ id, state }) {
|
|
98
120
|
super({ id, state });
|
|
99
121
|
}
|
|
@@ -103,11 +125,7 @@ var require_SetSwitchCommand = __commonJS({
|
|
|
103
125
|
get routingKey() {
|
|
104
126
|
return `switch.${this.data.id}.set`;
|
|
105
127
|
}
|
|
106
|
-
get replyTo() {
|
|
107
|
-
return "system.response.devices";
|
|
108
|
-
}
|
|
109
128
|
};
|
|
110
|
-
__name(SetSwitchCommand, "SetSwitchCommand");
|
|
111
129
|
module.exports = SetSwitchCommand;
|
|
112
130
|
}
|
|
113
131
|
});
|
|
@@ -117,6 +135,9 @@ var require_SetThermostatCommand = __commonJS({
|
|
|
117
135
|
"src/Commands/SetThermostatCommand.js"(exports, module) {
|
|
118
136
|
var Command = require_Command();
|
|
119
137
|
var SetThermostatCommand = class extends Command {
|
|
138
|
+
static {
|
|
139
|
+
__name(this, "SetThermostatCommand");
|
|
140
|
+
}
|
|
120
141
|
constructor({ id, setpoints, hvacMode, fanMode }) {
|
|
121
142
|
super({ id, setpoints, hvacMode, fanMode });
|
|
122
143
|
}
|
|
@@ -126,11 +147,7 @@ var require_SetThermostatCommand = __commonJS({
|
|
|
126
147
|
get routingKey() {
|
|
127
148
|
return `thermostat.${this.data.id}.set`;
|
|
128
149
|
}
|
|
129
|
-
get replyTo() {
|
|
130
|
-
return "system.response.devices";
|
|
131
|
-
}
|
|
132
150
|
};
|
|
133
|
-
__name(SetThermostatCommand, "SetThermostatCommand");
|
|
134
151
|
module.exports = SetThermostatCommand;
|
|
135
152
|
}
|
|
136
153
|
});
|
|
@@ -140,6 +157,9 @@ var require_SetLockCommand = __commonJS({
|
|
|
140
157
|
"src/Commands/SetLockCommand.js"(exports, module) {
|
|
141
158
|
var Command = require_Command();
|
|
142
159
|
var SetLockCommand = class extends Command {
|
|
160
|
+
static {
|
|
161
|
+
__name(this, "SetLockCommand");
|
|
162
|
+
}
|
|
143
163
|
constructor({ id, state }) {
|
|
144
164
|
super({ id, state });
|
|
145
165
|
}
|
|
@@ -149,43 +169,19 @@ var require_SetLockCommand = __commonJS({
|
|
|
149
169
|
get routingKey() {
|
|
150
170
|
return `lock.${this.data.id}.set`;
|
|
151
171
|
}
|
|
152
|
-
get replyTo() {
|
|
153
|
-
return "system.response.devices";
|
|
154
|
-
}
|
|
155
172
|
};
|
|
156
|
-
__name(SetLockCommand, "SetLockCommand");
|
|
157
173
|
module.exports = SetLockCommand;
|
|
158
174
|
}
|
|
159
175
|
});
|
|
160
176
|
|
|
161
|
-
// src/Commands/SetSceneControllerCommand.js
|
|
162
|
-
var require_SetSceneControllerCommand = __commonJS({
|
|
163
|
-
"src/Commands/SetSceneControllerCommand.js"(exports, module) {
|
|
164
|
-
var Command = require_Command();
|
|
165
|
-
var SetSceneControllerCommand = class extends Command {
|
|
166
|
-
constructor({ id, scene }) {
|
|
167
|
-
super({ id, scene });
|
|
168
|
-
}
|
|
169
|
-
get name() {
|
|
170
|
-
return "SetSceneController";
|
|
171
|
-
}
|
|
172
|
-
get routingKey() {
|
|
173
|
-
return `sceneController.${this.data.id}.set`;
|
|
174
|
-
}
|
|
175
|
-
get replyTo() {
|
|
176
|
-
return "system.response.devices";
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
__name(SetSceneControllerCommand, "SetSceneControllerCommand");
|
|
180
|
-
module.exports = SetSceneControllerCommand;
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
177
|
// src/Commands/SetWindowCoveringCommand.js
|
|
185
178
|
var require_SetWindowCoveringCommand = __commonJS({
|
|
186
179
|
"src/Commands/SetWindowCoveringCommand.js"(exports, module) {
|
|
187
180
|
var Command = require_Command();
|
|
188
181
|
var SetWindowCoveringCommand = class extends Command {
|
|
182
|
+
static {
|
|
183
|
+
__name(this, "SetWindowCoveringCommand");
|
|
184
|
+
}
|
|
189
185
|
constructor({ id, position }) {
|
|
190
186
|
super({ id, position });
|
|
191
187
|
}
|
|
@@ -195,11 +191,7 @@ var require_SetWindowCoveringCommand = __commonJS({
|
|
|
195
191
|
get routingKey() {
|
|
196
192
|
return `windowCovering.${this.data.id}.set`;
|
|
197
193
|
}
|
|
198
|
-
get replyTo() {
|
|
199
|
-
return "system.response.devices";
|
|
200
|
-
}
|
|
201
194
|
};
|
|
202
|
-
__name(SetWindowCoveringCommand, "SetWindowCoveringCommand");
|
|
203
195
|
module.exports = SetWindowCoveringCommand;
|
|
204
196
|
}
|
|
205
197
|
});
|
|
@@ -209,6 +201,9 @@ var require_SetCourtesyCommand = __commonJS({
|
|
|
209
201
|
"src/Commands/SetCourtesyCommand.js"(exports, module) {
|
|
210
202
|
var Command = require_Command();
|
|
211
203
|
var SetCourtesyCommand = class extends Command {
|
|
204
|
+
static {
|
|
205
|
+
__name(this, "SetCourtesyCommand");
|
|
206
|
+
}
|
|
212
207
|
constructor({ id, state }) {
|
|
213
208
|
super({ id, state });
|
|
214
209
|
}
|
|
@@ -218,34 +213,55 @@ var require_SetCourtesyCommand = __commonJS({
|
|
|
218
213
|
get routingKey() {
|
|
219
214
|
return `courtesy.${this.data.id}.set`;
|
|
220
215
|
}
|
|
221
|
-
get replyTo() {
|
|
222
|
-
return "system.response.devices";
|
|
223
|
-
}
|
|
224
216
|
};
|
|
225
|
-
__name(SetCourtesyCommand, "SetCourtesyCommand");
|
|
226
217
|
module.exports = SetCourtesyCommand;
|
|
227
218
|
}
|
|
228
219
|
});
|
|
229
220
|
|
|
221
|
+
// src/Commands/SetMediaCommand.js
|
|
222
|
+
var require_SetMediaCommand = __commonJS({
|
|
223
|
+
"src/Commands/SetMediaCommand.js"(exports, module) {
|
|
224
|
+
var Command = require_Command();
|
|
225
|
+
var SetMediaCommand = class extends Command {
|
|
226
|
+
static {
|
|
227
|
+
__name(this, "SetMediaCommand");
|
|
228
|
+
}
|
|
229
|
+
constructor({ id, command, ...rest }) {
|
|
230
|
+
super({ id, command, ...rest });
|
|
231
|
+
}
|
|
232
|
+
get name() {
|
|
233
|
+
return "SetMedia";
|
|
234
|
+
}
|
|
235
|
+
get routingKey() {
|
|
236
|
+
return `mediaSource.${this.data.id}.set`;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
module.exports = SetMediaCommand;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
|
|
230
243
|
// src/Commands/DiscoverUsersCommand.js
|
|
231
244
|
var require_DiscoverUsersCommand = __commonJS({
|
|
232
245
|
"src/Commands/DiscoverUsersCommand.js"(exports, module) {
|
|
233
246
|
var Command = require_Command();
|
|
234
247
|
var DiscoverUsersCommand = class extends Command {
|
|
235
|
-
|
|
236
|
-
|
|
248
|
+
static {
|
|
249
|
+
__name(this, "DiscoverUsersCommand");
|
|
250
|
+
}
|
|
251
|
+
constructor({ id, ...rest }) {
|
|
252
|
+
super({ id, ...rest });
|
|
237
253
|
}
|
|
238
254
|
get name() {
|
|
239
255
|
return "DiscoverUsers";
|
|
240
256
|
}
|
|
241
257
|
get routingKey() {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
258
|
+
if (typeof this.data.id === "string")
|
|
259
|
+
return `users.${this.data.id}.get`;
|
|
260
|
+
if (Array.isArray(this.data.id))
|
|
261
|
+
return "users.batch.get";
|
|
262
|
+
return "users.get";
|
|
246
263
|
}
|
|
247
264
|
};
|
|
248
|
-
__name(DiscoverUsersCommand, "DiscoverUsersCommand");
|
|
249
265
|
module.exports = DiscoverUsersCommand;
|
|
250
266
|
}
|
|
251
267
|
});
|
|
@@ -253,14 +269,17 @@ var require_DiscoverUsersCommand = __commonJS({
|
|
|
253
269
|
// src/Errors/AppError.js
|
|
254
270
|
var require_AppError = __commonJS({
|
|
255
271
|
"src/Errors/AppError.js"(exports, module) {
|
|
256
|
-
module.exports =
|
|
272
|
+
module.exports = class AppError extends Error {
|
|
273
|
+
static {
|
|
274
|
+
__name(this, "AppError");
|
|
275
|
+
}
|
|
257
276
|
constructor(message = "Internal Server Error", options) {
|
|
258
277
|
super(message, options);
|
|
259
278
|
this.type = this.constructor.name;
|
|
260
279
|
this.statusCode = 500;
|
|
261
280
|
Object.setPrototypeOf(this, AppError.prototype);
|
|
262
281
|
}
|
|
263
|
-
}
|
|
282
|
+
};
|
|
264
283
|
}
|
|
265
284
|
});
|
|
266
285
|
|
|
@@ -268,13 +287,16 @@ var require_AppError = __commonJS({
|
|
|
268
287
|
var require_RequestError = __commonJS({
|
|
269
288
|
"src/Errors/RequestError.js"(exports, module) {
|
|
270
289
|
var AppError = require_AppError();
|
|
271
|
-
module.exports =
|
|
290
|
+
module.exports = class RequestError extends AppError {
|
|
291
|
+
static {
|
|
292
|
+
__name(this, "RequestError");
|
|
293
|
+
}
|
|
272
294
|
constructor(message = "Bad Request", options = {}) {
|
|
273
295
|
super(message, options);
|
|
274
296
|
this.statusCode = 400;
|
|
275
297
|
Object.setPrototypeOf(this, RequestError.prototype);
|
|
276
298
|
}
|
|
277
|
-
}
|
|
299
|
+
};
|
|
278
300
|
}
|
|
279
301
|
});
|
|
280
302
|
|
|
@@ -284,9 +306,10 @@ var require_OCRDocumentCommand = __commonJS({
|
|
|
284
306
|
var Command = require_Command();
|
|
285
307
|
var RequestError = require_RequestError();
|
|
286
308
|
var OCRDocumentCommand = class extends Command {
|
|
309
|
+
static {
|
|
310
|
+
__name(this, "OCRDocumentCommand");
|
|
311
|
+
}
|
|
287
312
|
constructor({ type, image }) {
|
|
288
|
-
if (!type)
|
|
289
|
-
throw new RequestError("document type is required");
|
|
290
313
|
if (!image)
|
|
291
314
|
throw new RequestError("document image is required");
|
|
292
315
|
super({ type, image });
|
|
@@ -294,11 +317,7 @@ var require_OCRDocumentCommand = __commonJS({
|
|
|
294
317
|
get name() {
|
|
295
318
|
return "OCRDocument";
|
|
296
319
|
}
|
|
297
|
-
get routingKey() {
|
|
298
|
-
return `document.${this.data.type}.ocr`;
|
|
299
|
-
}
|
|
300
320
|
};
|
|
301
|
-
__name(OCRDocumentCommand, "OCRDocumentCommand");
|
|
302
321
|
module.exports = OCRDocumentCommand;
|
|
303
322
|
}
|
|
304
323
|
});
|
|
@@ -309,6 +328,9 @@ var require_CheckInReservationCommand = __commonJS({
|
|
|
309
328
|
var Command = require_Command();
|
|
310
329
|
var RequestError = require_RequestError();
|
|
311
330
|
var CheckInReservationCommand = class extends Command {
|
|
331
|
+
static {
|
|
332
|
+
__name(this, "CheckInReservationCommand");
|
|
333
|
+
}
|
|
312
334
|
constructor({ id }) {
|
|
313
335
|
if (!id)
|
|
314
336
|
throw new RequestError("document type is required");
|
|
@@ -320,29 +342,59 @@ var require_CheckInReservationCommand = __commonJS({
|
|
|
320
342
|
get routingKey() {
|
|
321
343
|
return `reservation.${this.data.id}.checkin`;
|
|
322
344
|
}
|
|
323
|
-
get replyTo() {
|
|
324
|
-
return "system.response.reservations";
|
|
325
|
-
}
|
|
326
345
|
};
|
|
327
|
-
__name(CheckInReservationCommand, "CheckInReservationCommand");
|
|
328
346
|
module.exports = CheckInReservationCommand;
|
|
329
347
|
}
|
|
330
348
|
});
|
|
331
349
|
|
|
350
|
+
// src/Commands/SendEmailCommand.js
|
|
351
|
+
var require_SendEmailCommand = __commonJS({
|
|
352
|
+
"src/Commands/SendEmailCommand.js"(exports, module) {
|
|
353
|
+
var Command = require_Command();
|
|
354
|
+
var RequestError = require_RequestError();
|
|
355
|
+
var SendEmailCommand = class extends Command {
|
|
356
|
+
static {
|
|
357
|
+
__name(this, "SendEmailCommand");
|
|
358
|
+
}
|
|
359
|
+
constructor({ text, html, to, from, subject, ...rest }) {
|
|
360
|
+
if (!to)
|
|
361
|
+
throw new RequestError("email to is required");
|
|
362
|
+
if (!from)
|
|
363
|
+
throw new RequestError("email from is required");
|
|
364
|
+
if (!subject)
|
|
365
|
+
throw new RequestError("email subject is required");
|
|
366
|
+
if (!text && !html)
|
|
367
|
+
throw new RequestError("email text or html is required");
|
|
368
|
+
super({ text, html, to, from, subject, ...rest });
|
|
369
|
+
}
|
|
370
|
+
get name() {
|
|
371
|
+
return "SendEmail";
|
|
372
|
+
}
|
|
373
|
+
get routingKey() {
|
|
374
|
+
return "comm.email.send";
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
module.exports = SendEmailCommand;
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
|
|
332
381
|
// src/Commands/SendSMSCommand.js
|
|
333
382
|
var require_SendSMSCommand = __commonJS({
|
|
334
383
|
"src/Commands/SendSMSCommand.js"(exports, module) {
|
|
335
384
|
var Command = require_Command();
|
|
336
385
|
var RequestError = require_RequestError();
|
|
337
386
|
var SendSMSCommand = class extends Command {
|
|
338
|
-
|
|
387
|
+
static {
|
|
388
|
+
__name(this, "SendSMSCommand");
|
|
389
|
+
}
|
|
390
|
+
constructor({ id, body, to, from, ...rest }) {
|
|
339
391
|
if (!body)
|
|
340
392
|
throw new RequestError("sms body is required");
|
|
341
393
|
if (!to)
|
|
342
394
|
throw new RequestError("sms to is required");
|
|
343
395
|
if (!from)
|
|
344
396
|
throw new RequestError("sms from is required");
|
|
345
|
-
super({ body, to, from,
|
|
397
|
+
super({ id, body, to, from, ...rest });
|
|
346
398
|
}
|
|
347
399
|
get name() {
|
|
348
400
|
return "SendSMS";
|
|
@@ -351,7 +403,6 @@ var require_SendSMSCommand = __commonJS({
|
|
|
351
403
|
return "comm.sms.send";
|
|
352
404
|
}
|
|
353
405
|
};
|
|
354
|
-
__name(SendSMSCommand, "SendSMSCommand");
|
|
355
406
|
module.exports = SendSMSCommand;
|
|
356
407
|
}
|
|
357
408
|
});
|
|
@@ -360,13 +411,16 @@ var require_SendSMSCommand = __commonJS({
|
|
|
360
411
|
var require_AuthenticationError = __commonJS({
|
|
361
412
|
"src/Errors/AuthenticationError.js"(exports, module) {
|
|
362
413
|
var AppError = require_AppError();
|
|
363
|
-
module.exports =
|
|
414
|
+
module.exports = class AuthenticationError extends AppError {
|
|
415
|
+
static {
|
|
416
|
+
__name(this, "AuthenticationError");
|
|
417
|
+
}
|
|
364
418
|
constructor(message = "Authentication Error", options = {}) {
|
|
365
419
|
super(message, options);
|
|
366
420
|
this.statusCode = 401;
|
|
367
421
|
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
368
422
|
}
|
|
369
|
-
}
|
|
423
|
+
};
|
|
370
424
|
}
|
|
371
425
|
});
|
|
372
426
|
|
|
@@ -374,13 +428,33 @@ var require_AuthenticationError = __commonJS({
|
|
|
374
428
|
var require_AuthorizationError = __commonJS({
|
|
375
429
|
"src/Errors/AuthorizationError.js"(exports, module) {
|
|
376
430
|
var AppError = require_AppError();
|
|
377
|
-
module.exports =
|
|
431
|
+
module.exports = class AuthorizationError extends AppError {
|
|
432
|
+
static {
|
|
433
|
+
__name(this, "AuthorizationError");
|
|
434
|
+
}
|
|
378
435
|
constructor(message = "Authorization Error", options = {}) {
|
|
379
436
|
super(message, options);
|
|
380
437
|
this.statusCode = 403;
|
|
381
438
|
Object.setPrototypeOf(this, AuthorizationError.prototype);
|
|
382
439
|
}
|
|
383
|
-
}
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// src/Errors/ConflictError.js
|
|
445
|
+
var require_ConflictError = __commonJS({
|
|
446
|
+
"src/Errors/ConflictError.js"(exports, module) {
|
|
447
|
+
var AppError = require_AppError();
|
|
448
|
+
module.exports = class ConflictError extends AppError {
|
|
449
|
+
static {
|
|
450
|
+
__name(this, "ConflictError");
|
|
451
|
+
}
|
|
452
|
+
constructor(message = "Bad Request", options = {}) {
|
|
453
|
+
super(message, options);
|
|
454
|
+
this.statusCode = 409;
|
|
455
|
+
Object.setPrototypeOf(this, ConflictError.prototype);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
384
458
|
}
|
|
385
459
|
});
|
|
386
460
|
|
|
@@ -388,13 +462,16 @@ var require_AuthorizationError = __commonJS({
|
|
|
388
462
|
var require_DeviceCommError = __commonJS({
|
|
389
463
|
"src/Errors/DeviceCommError.js"(exports, module) {
|
|
390
464
|
var AppError = require_AppError();
|
|
391
|
-
module.exports =
|
|
465
|
+
module.exports = class DeviceCommError extends AppError {
|
|
466
|
+
static {
|
|
467
|
+
__name(this, "DeviceCommError");
|
|
468
|
+
}
|
|
392
469
|
constructor(message = "Device Communication Error", options = {}) {
|
|
393
470
|
super(message, options);
|
|
394
471
|
this.statusCode = 503;
|
|
395
472
|
Object.setPrototypeOf(this, DeviceCommError.prototype);
|
|
396
473
|
}
|
|
397
|
-
}
|
|
474
|
+
};
|
|
398
475
|
}
|
|
399
476
|
});
|
|
400
477
|
|
|
@@ -402,13 +479,16 @@ var require_DeviceCommError = __commonJS({
|
|
|
402
479
|
var require_LoginError = __commonJS({
|
|
403
480
|
"src/Errors/LoginError.js"(exports, module) {
|
|
404
481
|
var AppError = require_AppError();
|
|
405
|
-
module.exports =
|
|
482
|
+
module.exports = class LoginError extends AppError {
|
|
483
|
+
static {
|
|
484
|
+
__name(this, "LoginError");
|
|
485
|
+
}
|
|
406
486
|
constructor(message = "Invalid Login information provided", options = {}) {
|
|
407
487
|
super(message, options);
|
|
408
488
|
this.statusCode = 401;
|
|
409
489
|
Object.setPrototypeOf(this, LoginError.prototype);
|
|
410
490
|
}
|
|
411
|
-
}
|
|
491
|
+
};
|
|
412
492
|
}
|
|
413
493
|
});
|
|
414
494
|
|
|
@@ -416,13 +496,16 @@ var require_LoginError = __commonJS({
|
|
|
416
496
|
var require_NotFoundError = __commonJS({
|
|
417
497
|
"src/Errors/NotFoundError.js"(exports, module) {
|
|
418
498
|
var AppError = require_AppError();
|
|
419
|
-
module.exports =
|
|
499
|
+
module.exports = class NotFoundError extends AppError {
|
|
500
|
+
static {
|
|
501
|
+
__name(this, "NotFoundError");
|
|
502
|
+
}
|
|
420
503
|
constructor(message = "Resource Not Found", options = {}) {
|
|
421
504
|
super(message, options);
|
|
422
505
|
this.statusCode = 404;
|
|
423
506
|
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
424
507
|
}
|
|
425
|
-
}
|
|
508
|
+
};
|
|
426
509
|
}
|
|
427
510
|
});
|
|
428
511
|
|
|
@@ -430,13 +513,16 @@ var require_NotFoundError = __commonJS({
|
|
|
430
513
|
var require_SystemCommError = __commonJS({
|
|
431
514
|
"src/Errors/SystemCommError.js"(exports, module) {
|
|
432
515
|
var AppError = require_AppError();
|
|
433
|
-
module.exports =
|
|
516
|
+
module.exports = class SystemCommError extends AppError {
|
|
517
|
+
static {
|
|
518
|
+
__name(this, "SystemCommError");
|
|
519
|
+
}
|
|
434
520
|
constructor(message = "System Communication Error", options = {}) {
|
|
435
521
|
super(message, options);
|
|
436
522
|
this.statusCode = 503;
|
|
437
523
|
Object.setPrototypeOf(this, SystemCommError.prototype);
|
|
438
524
|
}
|
|
439
|
-
}
|
|
525
|
+
};
|
|
440
526
|
}
|
|
441
527
|
});
|
|
442
528
|
|
|
@@ -444,13 +530,16 @@ var require_SystemCommError = __commonJS({
|
|
|
444
530
|
var require_TokenExpiredError = __commonJS({
|
|
445
531
|
"src/Errors/TokenExpiredError.js"(exports, module) {
|
|
446
532
|
var AppError = require_AppError();
|
|
447
|
-
module.exports =
|
|
533
|
+
module.exports = class TokenExpiredError extends AppError {
|
|
534
|
+
static {
|
|
535
|
+
__name(this, "TokenExpiredError");
|
|
536
|
+
}
|
|
448
537
|
constructor(message = "Token Expired", options = {}) {
|
|
449
538
|
super(message, options);
|
|
450
539
|
this.statusCode = 401;
|
|
451
540
|
Object.setPrototypeOf(this, TokenExpiredError.prototype);
|
|
452
541
|
}
|
|
453
|
-
}
|
|
542
|
+
};
|
|
454
543
|
}
|
|
455
544
|
});
|
|
456
545
|
|
|
@@ -458,13 +547,16 @@ var require_TokenExpiredError = __commonJS({
|
|
|
458
547
|
var require_UnprocessableRequestError = __commonJS({
|
|
459
548
|
"src/Errors/UnprocessableRequestError.js"(exports, module) {
|
|
460
549
|
var AppError = require_AppError();
|
|
461
|
-
module.exports =
|
|
550
|
+
module.exports = class UnprocessableRequestError extends AppError {
|
|
551
|
+
static {
|
|
552
|
+
__name(this, "UnprocessableRequestError");
|
|
553
|
+
}
|
|
462
554
|
constructor(message = "Unprocessable Request Error", options = {}) {
|
|
463
555
|
super(message, options);
|
|
464
556
|
this.statusCode = 422;
|
|
465
557
|
Object.setPrototypeOf(this, UnprocessableRequestError.prototype);
|
|
466
558
|
}
|
|
467
|
-
}
|
|
559
|
+
};
|
|
468
560
|
}
|
|
469
561
|
});
|
|
470
562
|
|
|
@@ -472,13 +564,16 @@ var require_UnprocessableRequestError = __commonJS({
|
|
|
472
564
|
var require_ValidationError = __commonJS({
|
|
473
565
|
"src/Errors/ValidationError.js"(exports, module) {
|
|
474
566
|
var AppError = require_AppError();
|
|
475
|
-
module.exports =
|
|
567
|
+
module.exports = class ValidationError extends AppError {
|
|
568
|
+
static {
|
|
569
|
+
__name(this, "ValidationError");
|
|
570
|
+
}
|
|
476
571
|
constructor(message = "Validation Error", options = {}) {
|
|
477
572
|
super(message, options);
|
|
478
573
|
this.statusCode = 400;
|
|
479
574
|
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
480
575
|
}
|
|
481
|
-
}
|
|
576
|
+
};
|
|
482
577
|
}
|
|
483
578
|
});
|
|
484
579
|
|
|
@@ -489,6 +584,7 @@ var require_Errors = __commonJS({
|
|
|
489
584
|
AppError: require_AppError(),
|
|
490
585
|
AuthenticationError: require_AuthenticationError(),
|
|
491
586
|
AuthorizationError: require_AuthorizationError(),
|
|
587
|
+
ConflictError: require_ConflictError(),
|
|
492
588
|
DeviceCommError: require_DeviceCommError(),
|
|
493
589
|
LoginError: require_LoginError(),
|
|
494
590
|
NotFoundError: require_NotFoundError(),
|
|
@@ -508,11 +604,14 @@ var require_DiscoverReservationsCommand = __commonJS({
|
|
|
508
604
|
var { RequestError } = require_Errors();
|
|
509
605
|
var Command = require_Command();
|
|
510
606
|
var DiscoverReservationsCommand = class extends Command {
|
|
607
|
+
static {
|
|
608
|
+
__name(this, "DiscoverReservationsCommand");
|
|
609
|
+
}
|
|
511
610
|
constructor(options) {
|
|
512
611
|
if (!options)
|
|
513
612
|
throw new RequestError("options are required");
|
|
514
|
-
const { id, startDate, endDate, status } = options;
|
|
515
|
-
super({ id, startDate, endDate, status });
|
|
613
|
+
const { id, startDate, endDate, status, ...rest } = options;
|
|
614
|
+
super({ id, startDate, endDate, status, ...rest });
|
|
516
615
|
}
|
|
517
616
|
get name() {
|
|
518
617
|
return "DiscoverReservations";
|
|
@@ -520,70 +619,379 @@ var require_DiscoverReservationsCommand = __commonJS({
|
|
|
520
619
|
get routingKey() {
|
|
521
620
|
return "reservation.discover";
|
|
522
621
|
}
|
|
523
|
-
get replyTo() {
|
|
524
|
-
return "system.response.reservations";
|
|
525
|
-
}
|
|
526
622
|
};
|
|
527
|
-
__name(DiscoverReservationsCommand, "DiscoverReservationsCommand");
|
|
528
623
|
module.exports = DiscoverReservationsCommand;
|
|
529
624
|
}
|
|
530
625
|
});
|
|
531
626
|
|
|
627
|
+
// src/Commands/DiscoverReservationSpaceCategoryAvailabilitiesCommand.js
|
|
628
|
+
var require_DiscoverReservationSpaceCategoryAvailabilitiesCommand = __commonJS({
|
|
629
|
+
"src/Commands/DiscoverReservationSpaceCategoryAvailabilitiesCommand.js"(exports, module) {
|
|
630
|
+
var { RequestError } = require_Errors();
|
|
631
|
+
var Command = require_Command();
|
|
632
|
+
var DiscoverReservationSpaceCategoryAvailabilitiesCommand = class extends Command {
|
|
633
|
+
static {
|
|
634
|
+
__name(this, "DiscoverReservationSpaceCategoryAvailabilitiesCommand");
|
|
635
|
+
}
|
|
636
|
+
constructor(options) {
|
|
637
|
+
if (!options)
|
|
638
|
+
throw new RequestError("options are required");
|
|
639
|
+
const { id, ...rest } = options;
|
|
640
|
+
super({ id, ...rest });
|
|
641
|
+
}
|
|
642
|
+
get name() {
|
|
643
|
+
return "DiscoverReservationSpaceCategoryAvailabilities";
|
|
644
|
+
}
|
|
645
|
+
get routingKey() {
|
|
646
|
+
return "reservation.discoverRoomUpsells";
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
module.exports = DiscoverReservationSpaceCategoryAvailabilitiesCommand;
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
|
|
532
653
|
// src/Commands/DiscoverRoomsCommand.js
|
|
533
654
|
var require_DiscoverRoomsCommand = __commonJS({
|
|
534
655
|
"src/Commands/DiscoverRoomsCommand.js"(exports, module) {
|
|
535
656
|
var Command = require_Command();
|
|
536
657
|
var DiscoverRoomsCommand = class extends Command {
|
|
537
|
-
|
|
538
|
-
|
|
658
|
+
static {
|
|
659
|
+
__name(this, "DiscoverRoomsCommand");
|
|
660
|
+
}
|
|
661
|
+
constructor({
|
|
662
|
+
id,
|
|
663
|
+
types,
|
|
664
|
+
categories,
|
|
665
|
+
startDate,
|
|
666
|
+
endDate,
|
|
667
|
+
serviceStatus,
|
|
668
|
+
housekeepingStatus,
|
|
669
|
+
...rest
|
|
670
|
+
}) {
|
|
671
|
+
super({
|
|
672
|
+
id,
|
|
673
|
+
types,
|
|
674
|
+
categories,
|
|
675
|
+
startDate,
|
|
676
|
+
endDate,
|
|
677
|
+
serviceStatus,
|
|
678
|
+
housekeepingStatus,
|
|
679
|
+
...rest
|
|
680
|
+
});
|
|
539
681
|
}
|
|
540
682
|
get name() {
|
|
541
683
|
return "DiscoverRooms";
|
|
542
684
|
}
|
|
543
685
|
get routingKey() {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
686
|
+
if (typeof this.data.id === "string")
|
|
687
|
+
return `rooms.${this.data.id}.get`;
|
|
688
|
+
if (Array.isArray(this.data.id))
|
|
689
|
+
return "rooms.batch.get";
|
|
690
|
+
return "rooms.get";
|
|
548
691
|
}
|
|
549
692
|
};
|
|
550
|
-
__name(DiscoverRoomsCommand, "DiscoverRoomsCommand");
|
|
551
693
|
module.exports = DiscoverRoomsCommand;
|
|
552
694
|
}
|
|
553
695
|
});
|
|
554
696
|
|
|
697
|
+
// src/Commands/DiscoverCategoriesCommand.js
|
|
698
|
+
var require_DiscoverCategoriesCommand = __commonJS({
|
|
699
|
+
"src/Commands/DiscoverCategoriesCommand.js"(exports, module) {
|
|
700
|
+
var Command = require_Command();
|
|
701
|
+
var DiscoverCategoriesCommand = class extends Command {
|
|
702
|
+
static {
|
|
703
|
+
__name(this, "DiscoverCategoriesCommand");
|
|
704
|
+
}
|
|
705
|
+
constructor({ id, ...rest }) {
|
|
706
|
+
super({ id, ...rest });
|
|
707
|
+
}
|
|
708
|
+
get name() {
|
|
709
|
+
return "DiscoverCategories";
|
|
710
|
+
}
|
|
711
|
+
get routingKey() {
|
|
712
|
+
if (typeof this.data.id === "string")
|
|
713
|
+
return `categories.${this.data.id}.get`;
|
|
714
|
+
if (Array.isArray(this.data.id))
|
|
715
|
+
return "categories.batch.get";
|
|
716
|
+
return "categories.get";
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
module.exports = DiscoverCategoriesCommand;
|
|
720
|
+
}
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// src/Commands/CreateShortLinkCommand.js
|
|
724
|
+
var require_CreateShortLinkCommand = __commonJS({
|
|
725
|
+
"src/Commands/CreateShortLinkCommand.js"(exports, module) {
|
|
726
|
+
var Command = require_Command();
|
|
727
|
+
var RequestError = require_RequestError();
|
|
728
|
+
var CreateShortLinkCommand = class extends Command {
|
|
729
|
+
static {
|
|
730
|
+
__name(this, "CreateShortLinkCommand");
|
|
731
|
+
}
|
|
732
|
+
constructor({ title, destination }) {
|
|
733
|
+
if (!title)
|
|
734
|
+
throw new RequestError("title is required");
|
|
735
|
+
if (!destination)
|
|
736
|
+
throw new RequestError("destination to is required");
|
|
737
|
+
super({ title, destination });
|
|
738
|
+
}
|
|
739
|
+
get name() {
|
|
740
|
+
return "CreateShortLink";
|
|
741
|
+
}
|
|
742
|
+
get routingKey() {
|
|
743
|
+
return "comm.shortlink.create";
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
module.exports = CreateShortLinkCommand;
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
// src/Commands/UpdateReservationCommand.js
|
|
751
|
+
var require_UpdateReservationCommand = __commonJS({
|
|
752
|
+
"src/Commands/UpdateReservationCommand.js"(exports, module) {
|
|
753
|
+
var Command = require_Command();
|
|
754
|
+
var RequestError = require_RequestError();
|
|
755
|
+
var UpdateReservationCommand = class extends Command {
|
|
756
|
+
static {
|
|
757
|
+
__name(this, "UpdateReservationCommand");
|
|
758
|
+
}
|
|
759
|
+
constructor({ id, ...rest }) {
|
|
760
|
+
if (!id)
|
|
761
|
+
throw new RequestError("document type is required");
|
|
762
|
+
super({ id, ...rest });
|
|
763
|
+
}
|
|
764
|
+
get name() {
|
|
765
|
+
return "UpdateReservation";
|
|
766
|
+
}
|
|
767
|
+
get routingKey() {
|
|
768
|
+
return `reservation.${this.data.id}.update`;
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
module.exports = UpdateReservationCommand;
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
// src/Commands/UpdateUserCommand.js
|
|
776
|
+
var require_UpdateUserCommand = __commonJS({
|
|
777
|
+
"src/Commands/UpdateUserCommand.js"(exports, module) {
|
|
778
|
+
var Command = require_Command();
|
|
779
|
+
var RequestError = require_RequestError();
|
|
780
|
+
var UpdateUserCommand = class extends Command {
|
|
781
|
+
static {
|
|
782
|
+
__name(this, "UpdateUserCommand");
|
|
783
|
+
}
|
|
784
|
+
constructor({
|
|
785
|
+
id,
|
|
786
|
+
email,
|
|
787
|
+
phone,
|
|
788
|
+
identification,
|
|
789
|
+
address,
|
|
790
|
+
note,
|
|
791
|
+
nationality,
|
|
792
|
+
file,
|
|
793
|
+
payment,
|
|
794
|
+
...rest
|
|
795
|
+
}) {
|
|
796
|
+
if (!id)
|
|
797
|
+
throw new RequestError("document type is required");
|
|
798
|
+
super({
|
|
799
|
+
id,
|
|
800
|
+
email,
|
|
801
|
+
phone,
|
|
802
|
+
identification,
|
|
803
|
+
address,
|
|
804
|
+
note,
|
|
805
|
+
nationality,
|
|
806
|
+
file,
|
|
807
|
+
payment,
|
|
808
|
+
...rest
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
get name() {
|
|
812
|
+
return "UpdateUser";
|
|
813
|
+
}
|
|
814
|
+
get routingKey() {
|
|
815
|
+
return `user.${this.data.id}.update`;
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
module.exports = UpdateUserCommand;
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
// src/Commands/GetMobileKeyCommand.js
|
|
823
|
+
var require_GetMobileKeyCommand = __commonJS({
|
|
824
|
+
"src/Commands/GetMobileKeyCommand.js"(exports, module) {
|
|
825
|
+
var Command = require_Command();
|
|
826
|
+
var GetMobileKeyCommand = class extends Command {
|
|
827
|
+
static {
|
|
828
|
+
__name(this, "GetMobileKeyCommand");
|
|
829
|
+
}
|
|
830
|
+
constructor({
|
|
831
|
+
id,
|
|
832
|
+
phone,
|
|
833
|
+
beginDateTime,
|
|
834
|
+
endDateTime,
|
|
835
|
+
keyToReplace,
|
|
836
|
+
...rest
|
|
837
|
+
}) {
|
|
838
|
+
super({ id, phone, beginDateTime, endDateTime, keyToReplace, ...rest });
|
|
839
|
+
}
|
|
840
|
+
get name() {
|
|
841
|
+
return "GetMobileKey";
|
|
842
|
+
}
|
|
843
|
+
get routingKey() {
|
|
844
|
+
return `lock.${this.data.id}.set`;
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
module.exports = GetMobileKeyCommand;
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
// src/Commands/CreateImageUploadEndpointCommand.js
|
|
852
|
+
var require_CreateImageUploadEndpointCommand = __commonJS({
|
|
853
|
+
"src/Commands/CreateImageUploadEndpointCommand.js"(exports, module) {
|
|
854
|
+
var Command = require_Command();
|
|
855
|
+
var CreateImageUploadEndpointCommand = class extends Command {
|
|
856
|
+
static {
|
|
857
|
+
__name(this, "CreateImageUploadEndpointCommand");
|
|
858
|
+
}
|
|
859
|
+
constructor({ id, expires, ...rest }) {
|
|
860
|
+
super({ id, expires, ...rest });
|
|
861
|
+
}
|
|
862
|
+
get name() {
|
|
863
|
+
return "CreateImageUploadEndpoint";
|
|
864
|
+
}
|
|
865
|
+
get routingKey() {
|
|
866
|
+
return "image.createUploadEndpoint";
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
module.exports = CreateImageUploadEndpointCommand;
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
// src/Commands/UploadImageCommand.js
|
|
874
|
+
var require_UploadImageCommand = __commonJS({
|
|
875
|
+
"src/Commands/UploadImageCommand.js"(exports, module) {
|
|
876
|
+
var Command = require_Command();
|
|
877
|
+
var UploadImageCommand = class extends Command {
|
|
878
|
+
static {
|
|
879
|
+
__name(this, "UploadImageCommand");
|
|
880
|
+
}
|
|
881
|
+
constructor({ id, url, file, ...rest }) {
|
|
882
|
+
super({ id, url, file, ...rest });
|
|
883
|
+
}
|
|
884
|
+
get name() {
|
|
885
|
+
return "UploadImage";
|
|
886
|
+
}
|
|
887
|
+
get routingKey() {
|
|
888
|
+
return `image.${this.data.id}.upload`;
|
|
889
|
+
}
|
|
890
|
+
};
|
|
891
|
+
module.exports = UploadImageCommand;
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
|
|
895
|
+
// src/Commands/GetProductsCommand.js
|
|
896
|
+
var require_GetProductsCommand = __commonJS({
|
|
897
|
+
"src/Commands/GetProductsCommand.js"(exports, module) {
|
|
898
|
+
var Command = require_Command();
|
|
899
|
+
var GetProductsCommand = class extends Command {
|
|
900
|
+
static {
|
|
901
|
+
__name(this, "GetProductsCommand");
|
|
902
|
+
}
|
|
903
|
+
constructor({ id, externalSystemId, ...rest }) {
|
|
904
|
+
super({ id, externalSystemId, ...rest });
|
|
905
|
+
}
|
|
906
|
+
get name() {
|
|
907
|
+
return "GetProducts";
|
|
908
|
+
}
|
|
909
|
+
get routingKey() {
|
|
910
|
+
return `product.${this.data.id}.get`;
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
module.exports = GetProductsCommand;
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
// src/Commands/SellProductsCommand.js
|
|
918
|
+
var require_SellProductsCommand = __commonJS({
|
|
919
|
+
"src/Commands/SellProductsCommand.js"(exports, module) {
|
|
920
|
+
var Command = require_Command();
|
|
921
|
+
var SellProductsCommand = class extends Command {
|
|
922
|
+
static {
|
|
923
|
+
__name(this, "SellProductsCommand");
|
|
924
|
+
}
|
|
925
|
+
constructor({ reservationId, userId, products, ...rest }) {
|
|
926
|
+
super({ reservationId, userId, products, ...rest });
|
|
927
|
+
}
|
|
928
|
+
get name() {
|
|
929
|
+
return "SellProducts";
|
|
930
|
+
}
|
|
931
|
+
get routingKey() {
|
|
932
|
+
return `product.${this.data.id}.sell`;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
module.exports = SellProductsCommand;
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
|
|
555
939
|
// src/Commands/index.js
|
|
556
940
|
var require_Commands = __commonJS({
|
|
557
941
|
"src/Commands/index.js"(exports, module) {
|
|
942
|
+
var SetSceneCommand = require_SetSceneCommand();
|
|
558
943
|
var SetAlarmCommand = require_SetAlarmCommand();
|
|
559
944
|
var SetDimmerCommand = require_SetDimmerCommand();
|
|
560
945
|
var SetSwitchCommand = require_SetSwitchCommand();
|
|
561
946
|
var SetThermostatCommand = require_SetThermostatCommand();
|
|
562
947
|
var SetLockCommand = require_SetLockCommand();
|
|
563
|
-
var SetSceneControllerCommand = require_SetSceneControllerCommand();
|
|
564
948
|
var SetWindowCoveringCommand = require_SetWindowCoveringCommand();
|
|
565
949
|
var SetCourtesyCommand = require_SetCourtesyCommand();
|
|
950
|
+
var SetMediaCommand = require_SetMediaCommand();
|
|
566
951
|
var DiscoverUsersCommand = require_DiscoverUsersCommand();
|
|
567
952
|
var OCRDocumentCommand = require_OCRDocumentCommand();
|
|
568
953
|
var CheckInReservationCommand = require_CheckInReservationCommand();
|
|
954
|
+
var SendEmailCommand = require_SendEmailCommand();
|
|
569
955
|
var SendSMSCommand = require_SendSMSCommand();
|
|
570
956
|
var DiscoverReservationsCommand = require_DiscoverReservationsCommand();
|
|
957
|
+
var DiscoverReservationSpaceCategoryAvailabilitiesCommand = require_DiscoverReservationSpaceCategoryAvailabilitiesCommand();
|
|
571
958
|
var DiscoverRoomsCommand = require_DiscoverRoomsCommand();
|
|
959
|
+
var DiscoverCategoriesCommand = require_DiscoverCategoriesCommand();
|
|
960
|
+
var CreateShortLinkCommand = require_CreateShortLinkCommand();
|
|
961
|
+
var UpdateReservationCommand = require_UpdateReservationCommand();
|
|
962
|
+
var UpdateUserCommand = require_UpdateUserCommand();
|
|
963
|
+
var GetMobileKeyCommand = require_GetMobileKeyCommand();
|
|
964
|
+
var CreateImageUploadEndpointCommand = require_CreateImageUploadEndpointCommand();
|
|
965
|
+
var UploadImageCommand = require_UploadImageCommand();
|
|
966
|
+
var GetProductsCommand = require_GetProductsCommand();
|
|
967
|
+
var SellProductsCommand = require_SellProductsCommand();
|
|
572
968
|
module.exports = {
|
|
969
|
+
SetSceneCommand,
|
|
573
970
|
SetAlarmCommand,
|
|
574
971
|
SetDimmerCommand,
|
|
575
972
|
SetSwitchCommand,
|
|
576
973
|
SetThermostatCommand,
|
|
577
974
|
SetLockCommand,
|
|
578
|
-
SetSceneControllerCommand,
|
|
579
975
|
SetWindowCoveringCommand,
|
|
580
976
|
SetCourtesyCommand,
|
|
977
|
+
SetMediaCommand,
|
|
581
978
|
OCRDocumentCommand,
|
|
582
979
|
DiscoverUsersCommand,
|
|
583
980
|
CheckInReservationCommand,
|
|
584
981
|
SendSMSCommand,
|
|
982
|
+
SendEmailCommand,
|
|
585
983
|
DiscoverReservationsCommand,
|
|
586
|
-
|
|
984
|
+
DiscoverReservationSpaceCategoryAvailabilitiesCommand,
|
|
985
|
+
DiscoverRoomsCommand,
|
|
986
|
+
DiscoverCategoriesCommand,
|
|
987
|
+
CreateShortLinkCommand,
|
|
988
|
+
UpdateReservationCommand,
|
|
989
|
+
UpdateUserCommand,
|
|
990
|
+
GetMobileKeyCommand,
|
|
991
|
+
CreateImageUploadEndpointCommand,
|
|
992
|
+
UploadImageCommand,
|
|
993
|
+
GetProductsCommand,
|
|
994
|
+
SellProductsCommand
|
|
587
995
|
};
|
|
588
996
|
}
|
|
589
997
|
});
|