@kohost/api-client 4.11.0 → 4.11.1
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/dist/amqpClient.cjs.map +1 -1
- package/dist/amqpClient.js +1 -1
- package/dist/{chunk-4RGKXRCC.js → chunk-3T7O6SSX.js} +1 -1
- package/dist/chunk-3T7O6SSX.js.map +1 -0
- package/dist/{chunk-EFDNWLMA.js → chunk-44FUQXMY.js} +1 -1
- package/dist/chunk-44FUQXMY.js.map +1 -0
- package/dist/{chunk-HAZA2CC4.js → chunk-4JPS6JAG.js} +1 -1
- package/dist/chunk-4JPS6JAG.js.map +1 -0
- package/dist/{chunk-VWZZQPYF.js → chunk-5GYG24VQ.js} +1 -1
- package/dist/{chunk-R7LFTNN3.js → chunk-5QBIGY4H.js} +1 -1
- package/dist/{chunk-R7LFTNN3.js.map → chunk-5QBIGY4H.js.map} +1 -1
- package/dist/{chunk-4E6X4AWF.js → chunk-5UTH7OAH.js} +1 -1
- package/dist/chunk-5UTH7OAH.js.map +1 -0
- package/dist/{chunk-UBBFO4DV.js → chunk-7AFOPOH6.js} +1 -1
- package/dist/chunk-7AFOPOH6.js.map +1 -0
- package/dist/{chunk-5IUMCO6K.js → chunk-AHC2WGJE.js} +1 -1
- package/dist/chunk-AHC2WGJE.js.map +1 -0
- package/dist/{chunk-AT5O6OJM.js → chunk-BDSQQ6HP.js} +1 -1
- package/dist/chunk-BDSQQ6HP.js.map +1 -0
- package/dist/{chunk-CW272SBN.js → chunk-BHKQEUCN.js} +1 -1
- package/dist/{chunk-CW272SBN.js.map → chunk-BHKQEUCN.js.map} +1 -1
- package/dist/{chunk-KE6CXWXD.js → chunk-BSJSKTKW.js} +1 -1
- package/dist/chunk-BSJSKTKW.js.map +1 -0
- package/dist/{chunk-QUHOFRXV.js → chunk-C5BVAUUD.js} +1 -1
- package/dist/chunk-C5BVAUUD.js.map +1 -0
- package/dist/{chunk-2UB3LUDU.js → chunk-DYI5AGYE.js} +1 -1
- package/dist/chunk-DYI5AGYE.js.map +1 -0
- package/dist/{chunk-E74W6L7V.js → chunk-EQRRWEUV.js} +1 -1
- package/dist/chunk-EQRRWEUV.js.map +1 -0
- package/dist/{chunk-5QKL3YIQ.js → chunk-GGDJAKJZ.js} +1 -1
- package/dist/{chunk-5QKL3YIQ.js.map → chunk-GGDJAKJZ.js.map} +1 -1
- package/dist/{chunk-IDRUXPFD.js → chunk-GOX3QHII.js} +1 -1
- package/dist/{chunk-IDRUXPFD.js.map → chunk-GOX3QHII.js.map} +1 -1
- package/dist/{chunk-IVOUXLE7.js → chunk-GXHDNNEZ.js} +1 -1
- package/dist/chunk-GXHDNNEZ.js.map +1 -0
- package/dist/{chunk-3AH7ESNC.js → chunk-J2AC6RFR.js} +1 -1
- package/dist/chunk-J2AC6RFR.js.map +1 -0
- package/dist/{chunk-3JL7QMK4.js → chunk-JF2EVZYA.js} +1 -1
- package/dist/chunk-JF2EVZYA.js.map +1 -0
- package/dist/{chunk-VX4FUPNL.js → chunk-JGB2IDZ6.js} +1 -1
- package/dist/chunk-JGB2IDZ6.js.map +1 -0
- package/dist/{chunk-4JJEZYIX.js → chunk-LKIPRLBQ.js} +1 -1
- package/dist/chunk-LKIPRLBQ.js.map +1 -0
- package/dist/{chunk-TLXGHYP5.js → chunk-M7J5VN2K.js} +1 -1
- package/dist/{chunk-TLXGHYP5.js.map → chunk-M7J5VN2K.js.map} +1 -1
- package/dist/{chunk-WNUSIEB4.js → chunk-NVHDJTCZ.js} +1 -1
- package/dist/{chunk-ZZMM3QTI.js → chunk-O3T2FO7O.js} +1 -1
- package/dist/{chunk-ZZMM3QTI.js.map → chunk-O3T2FO7O.js.map} +1 -1
- package/dist/{chunk-XO5U52AY.js → chunk-OEO6RXVP.js} +1 -1
- package/dist/chunk-OEO6RXVP.js.map +1 -0
- package/dist/{chunk-BRMQZWQQ.js → chunk-QAOGHEYG.js} +1 -1
- package/dist/chunk-QAOGHEYG.js.map +1 -0
- package/dist/{chunk-OYGGJUZ2.js → chunk-S5OTB2OU.js} +1 -1
- package/dist/chunk-S5OTB2OU.js.map +1 -0
- package/dist/{chunk-O3P2AKRX.js → chunk-STZLODEY.js} +1 -1
- package/dist/chunk-STZLODEY.js.map +1 -0
- package/dist/{chunk-BORTGG46.js → chunk-T7ZYREDK.js} +1 -1
- package/dist/chunk-T7ZYREDK.js.map +1 -0
- package/dist/{chunk-CEYKBJZW.js → chunk-TI3ILTHZ.js} +1 -1
- package/dist/chunk-TI3ILTHZ.js.map +1 -0
- package/dist/{chunk-RXY4LNO4.js → chunk-W7P3OFBI.js} +1 -1
- package/dist/chunk-W7P3OFBI.js.map +1 -0
- package/dist/{chunk-U2AGLPI4.js → chunk-WJWT5H6X.js} +1 -1
- package/dist/chunk-WJWT5H6X.js.map +1 -0
- package/dist/{chunk-QC6E54KG.js → chunk-WSJEJ7RX.js} +1 -1
- package/dist/chunk-WSJEJ7RX.js.map +1 -0
- package/dist/{chunk-QDDBU2BV.js → chunk-X2VO5SPG.js} +1 -1
- package/dist/chunk-X2VO5SPG.js.map +1 -0
- package/dist/{chunk-KY6X4QAD.js → chunk-X42K4JVV.js} +1 -1
- package/dist/chunk-X42K4JVV.js.map +1 -0
- package/dist/{chunk-K3NN32XK.js → chunk-XNM55KLN.js} +1 -1
- package/dist/chunk-XNM55KLN.js.map +1 -0
- package/dist/{chunk-YMVHMEXG.js → chunk-XYTZBG4S.js} +1 -1
- package/dist/chunk-XYTZBG4S.js.map +1 -0
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.js +1 -1
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/events/index.cjs.map +1 -1
- package/dist/events/index.js +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/models/alarm.cjs.map +1 -1
- package/dist/models/alarm.d.cts +8 -8
- package/dist/models/alarm.d.ts +8 -8
- package/dist/models/alarm.js +1 -1
- package/dist/models/announcement.cjs.map +1 -1
- package/dist/models/announcement.d.cts +13 -13
- package/dist/models/announcement.d.ts +13 -13
- package/dist/models/announcement.js +1 -1
- package/dist/models/camera.cjs.map +1 -1
- package/dist/models/camera.d.cts +23 -23
- package/dist/models/camera.d.ts +23 -23
- package/dist/models/camera.js +1 -1
- package/dist/models/category.cjs.map +1 -1
- package/dist/models/category.d.cts +13 -13
- package/dist/models/category.d.ts +13 -13
- package/dist/models/category.js +1 -1
- package/dist/models/courtesy.cjs.map +1 -1
- package/dist/models/courtesy.d.cts +6 -6
- package/dist/models/courtesy.d.ts +6 -6
- package/dist/models/courtesy.js +1 -1
- package/dist/models/credential.cjs.map +1 -1
- package/dist/models/credential.d.cts +2 -2
- package/dist/models/credential.d.ts +2 -2
- package/dist/models/credential.js +1 -1
- package/dist/models/deviceRouter.cjs.map +1 -1
- package/dist/models/deviceRouter.d.cts +3 -3
- package/dist/models/deviceRouter.d.ts +3 -3
- package/dist/models/deviceRouter.js +1 -1
- package/dist/models/dimmer.cjs.map +1 -1
- package/dist/models/dimmer.d.cts +6 -6
- package/dist/models/dimmer.d.ts +6 -6
- package/dist/models/dimmer.js +1 -1
- package/dist/models/discoveredDevice.cjs.map +1 -1
- package/dist/models/discoveredDevice.d.cts +6 -6
- package/dist/models/discoveredDevice.d.ts +6 -6
- package/dist/models/discoveredDevice.js +1 -1
- package/dist/models/gateway.cjs.map +1 -1
- package/dist/models/gateway.d.cts +3 -3
- package/dist/models/gateway.d.ts +3 -3
- package/dist/models/gateway.js +1 -1
- package/dist/models/identification.cjs.map +1 -1
- package/dist/models/identification.d.cts +2 -2
- package/dist/models/identification.d.ts +2 -2
- package/dist/models/identification.js +1 -1
- package/dist/models/index.cjs.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/lock.cjs.map +1 -1
- package/dist/models/lock.d.cts +3 -3
- package/dist/models/lock.d.ts +3 -3
- package/dist/models/lock.js +1 -1
- package/dist/models/mediaSource.cjs.map +1 -1
- package/dist/models/mediaSource.d.cts +8 -8
- package/dist/models/mediaSource.d.ts +8 -8
- package/dist/models/mediaSource.js +1 -1
- package/dist/models/motionSensor.cjs.map +1 -1
- package/dist/models/motionSensor.d.cts +3 -3
- package/dist/models/motionSensor.d.ts +3 -3
- package/dist/models/motionSensor.js +1 -1
- package/dist/models/organization.cjs.map +1 -1
- package/dist/models/organization.d.cts +6 -6
- package/dist/models/organization.d.ts +6 -6
- package/dist/models/organization.js +1 -1
- package/dist/models/payment.cjs.map +1 -1
- package/dist/models/payment.d.cts +6 -6
- package/dist/models/payment.d.ts +6 -6
- package/dist/models/payment.js +1 -1
- package/dist/models/product.cjs.map +1 -1
- package/dist/models/product.d.cts +16 -16
- package/dist/models/product.d.ts +16 -16
- package/dist/models/product.js +1 -1
- package/dist/models/property.cjs.map +1 -1
- package/dist/models/property.d.cts +3 -3
- package/dist/models/property.d.ts +3 -3
- package/dist/models/property.js +1 -1
- package/dist/models/reservation.cjs.map +1 -1
- package/dist/models/reservation.d.cts +9 -9
- package/dist/models/reservation.d.ts +9 -9
- package/dist/models/reservation.js +1 -1
- package/dist/models/room.cjs.map +1 -1
- package/dist/models/room.d.cts +304 -182
- package/dist/models/room.d.ts +304 -182
- package/dist/models/room.js +1 -1
- package/dist/models/scene.cjs.map +1 -1
- package/dist/models/scene.d.cts +39 -15
- package/dist/models/scene.d.ts +39 -15
- package/dist/models/scene.js +1 -1
- package/dist/models/session.cjs.map +1 -1
- package/dist/models/session.d.cts +2 -2
- package/dist/models/session.d.ts +2 -2
- package/dist/models/session.js +1 -1
- package/dist/models/space.cjs.map +1 -1
- package/dist/models/space.d.cts +3 -3
- package/dist/models/space.d.ts +3 -3
- package/dist/models/space.js +1 -1
- package/dist/models/switch.cjs.map +1 -1
- package/dist/models/switch.d.cts +3 -3
- package/dist/models/switch.d.ts +3 -3
- package/dist/models/switch.js +1 -1
- package/dist/models/system.cjs.map +1 -1
- package/dist/models/system.d.cts +13 -13
- package/dist/models/system.d.ts +13 -13
- package/dist/models/system.js +1 -1
- package/dist/models/systemUser.cjs.map +1 -1
- package/dist/models/systemUser.d.cts +38 -38
- package/dist/models/systemUser.d.ts +38 -38
- package/dist/models/systemUser.js +1 -1
- package/dist/models/thermostat.cjs.map +1 -1
- package/dist/models/thermostat.d.cts +40 -16
- package/dist/models/thermostat.d.ts +40 -16
- package/dist/models/thermostat.js +1 -1
- package/dist/models/user.cjs.map +1 -1
- package/dist/models/user.d.cts +105 -93
- package/dist/models/user.d.ts +105 -93
- package/dist/models/user.js +1 -1
- package/dist/models/vendor.cjs.map +1 -1
- package/dist/models/vendor.d.cts +19 -19
- package/dist/models/vendor.d.ts +19 -19
- package/dist/models/vendor.js +1 -1
- package/dist/models/windowCovering.cjs.map +1 -1
- package/dist/models/windowCovering.d.cts +6 -6
- package/dist/models/windowCovering.d.ts +6 -6
- package/dist/models/windowCovering.js +1 -1
- package/dist/useCases/index.cjs.map +1 -1
- package/dist/useCases/index.js +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2UB3LUDU.js.map +0 -1
- package/dist/chunk-3AH7ESNC.js.map +0 -1
- package/dist/chunk-3JL7QMK4.js.map +0 -1
- package/dist/chunk-4E6X4AWF.js.map +0 -1
- package/dist/chunk-4JJEZYIX.js.map +0 -1
- package/dist/chunk-4RGKXRCC.js.map +0 -1
- package/dist/chunk-5IUMCO6K.js.map +0 -1
- package/dist/chunk-AT5O6OJM.js.map +0 -1
- package/dist/chunk-BORTGG46.js.map +0 -1
- package/dist/chunk-BRMQZWQQ.js.map +0 -1
- package/dist/chunk-CEYKBJZW.js.map +0 -1
- package/dist/chunk-E74W6L7V.js.map +0 -1
- package/dist/chunk-EFDNWLMA.js.map +0 -1
- package/dist/chunk-HAZA2CC4.js.map +0 -1
- package/dist/chunk-IVOUXLE7.js.map +0 -1
- package/dist/chunk-K3NN32XK.js.map +0 -1
- package/dist/chunk-KE6CXWXD.js.map +0 -1
- package/dist/chunk-KY6X4QAD.js.map +0 -1
- package/dist/chunk-O3P2AKRX.js.map +0 -1
- package/dist/chunk-OYGGJUZ2.js.map +0 -1
- package/dist/chunk-QC6E54KG.js.map +0 -1
- package/dist/chunk-QDDBU2BV.js.map +0 -1
- package/dist/chunk-QUHOFRXV.js.map +0 -1
- package/dist/chunk-RXY4LNO4.js.map +0 -1
- package/dist/chunk-U2AGLPI4.js.map +0 -1
- package/dist/chunk-UBBFO4DV.js.map +0 -1
- package/dist/chunk-VX4FUPNL.js.map +0 -1
- package/dist/chunk-XO5U52AY.js.map +0 -1
- package/dist/chunk-YMVHMEXG.js.map +0 -1
- /package/dist/{chunk-VWZZQPYF.js.map → chunk-5GYG24VQ.js.map} +0 -0
- /package/dist/{chunk-WNUSIEB4.js.map → chunk-NVHDJTCZ.js.map} +0 -0
package/dist/amqpClient.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/amqpClient.js","../src/defs.js","../src/errors/index.js","../src/errors/appError.js","../src/errors/authenticationError.js","../src/errors/authorizationError.js","../src/errors/conflictError.js","../src/errors/deviceCommError.js","../src/errors/loginError.js","../src/errors/notFoundError.js","../src/errors/requestError.js","../src/errors/systemCommError.js","../src/errors/tokenExpiredError.js","../src/errors/unprocessableRequestError.js","../src/errors/validationError.js"],"sourcesContent":["import { connect } from \"amqplib\";\nimport dbg from \"debug\";\nimport { Buffer } from \"node:buffer\";\nimport * as crypto from \"node:crypto\";\nimport { amqpExchanges as exchanges } from \"./defs\";\nimport * as Errors from \"./errors\";\n\nconst randomUUID = crypto.randomUUID;\n\nconst debug = dbg(\"kohost:amqp-client\");\n\nconst HEADER_KEY_ORGANIZATION_ID = \"X-Organization-Id\";\nconst HEADER_KEY_PROPERTY_ID = \"X-Property-Id\";\nconst HEADER_KEY_DRIVER = \"X-Driver\";\nconst HEADER_KEY_COMMAND_NAME = \"X-Command-Name\";\nconst HEADER_KEY_EVENT_NAME = \"X-Event-Name\";\n\nexport class KohostAMQPClient {\n static get Message() {\n return Message;\n }\n\n static get exchanges() {\n return exchanges;\n }\n static generateCorrelationId() {\n return randomUUID();\n }\n\n static validateMessage(message) {\n if (!message) throw new Error(\"Message is required\");\n }\n\n static parseError(err) {\n let type;\n let message;\n let options = {};\n if (err.message && err.type) {\n const { message: errMessage, type: errType, ...rest } = err;\n type = errType;\n message = errMessage;\n options = rest;\n } else {\n message = err.message || \"Unknown Error\";\n }\n\n debug(\"parseError\", type, message, options);\n\n if (type && Errors[type]) {\n return new Errors[type](message, options);\n }\n\n return new Error(message, options);\n }\n\n static parseMessage(message) {\n let error = null;\n let data = {};\n let query = {};\n let context = {};\n let headers = {};\n\n const isCommand = message?.properties?.type === \"Command\";\n const isEvent = message?.properties?.type === \"Event\";\n\n const messageHeaders = message?.properties?.headers || {};\n\n const commandName = messageHeaders[HEADER_KEY_COMMAND_NAME] || null;\n const eventName = messageHeaders[HEADER_KEY_EVENT_NAME] || null;\n\n if (message.content) {\n try {\n const payload =\n message.properties?.contentType === \"application/json\"\n ? JSON.parse(message.content.toString())\n : message.content.toString();\n data = payload?.data || {};\n error = payload?.error;\n query = payload?.query || {};\n context = payload?.context || {};\n } catch (error) {\n debug(\"error parsing content\", error);\n data = message.content.toString();\n }\n }\n\n if (message?.properties?.headers) {\n const orgHeader = message.properties.headers[HEADER_KEY_ORGANIZATION_ID];\n const propertyHeader = message.properties.headers[HEADER_KEY_PROPERTY_ID];\n const driverHeader = message.properties.headers[HEADER_KEY_DRIVER];\n\n if (orgHeader) {\n context.organizationId = orgHeader;\n headers[HEADER_KEY_ORGANIZATION_ID] = orgHeader;\n }\n\n if (propertyHeader) {\n context.propertyId = propertyHeader;\n headers[HEADER_KEY_PROPERTY_ID] = propertyHeader;\n }\n\n if (driverHeader) {\n context.driver = driverHeader;\n headers[HEADER_KEY_DRIVER] = driverHeader;\n }\n }\n\n const parsed = {};\n\n if (error) parsed.error = this.parseError(error);\n\n parsed.data = data;\n parsed.query = query;\n parsed.context = context;\n parsed.headers = headers;\n\n if (isEvent && eventName) parsed.event = eventName;\n else if (isCommand && commandName) parsed.command = commandName;\n\n debug(\"amqp parsed %o\", parsed);\n\n return parsed;\n }\n\n static getMessage(message) {\n if (!message?.content) return null;\n const payload = JSON.parse(message.content.toString());\n const data = payload?.data;\n return data;\n }\n\n static isFatalError(err) {\n return isFatalError(err);\n }\n\n async createConnection(connection, options = {}) {\n return await connect(connection, options);\n }\n\n static createMessage(content) {\n return new Message(content);\n }\n\n async createChannel(connection) {\n const channel = await connection.createChannel();\n return channel;\n }\n\n async assertExchange(channel, { exchange, type, options }) {\n return await channel.assertExchange(exchange, type, options);\n }\n\n async assertQueue(channel, { queue, options }) {\n return await channel.assertQueue(queue, options);\n }\n\n async bindQueue(channel, { queue, exchange, routingKey, args }) {\n return await channel.bindQueue(queue, exchange, routingKey, args);\n }\n\n async bindExchange(channel, { source, destination, routingKey, args }) {\n return await channel.bindExchange(destination, source, routingKey, args);\n }\n\n async subscribeToQueue(channel, { queue, cb, options }) {\n return await channel.consume(queue, cb, options);\n }\n\n publishToExchange(channel, { exchange, routingKey, content, options }) {\n return channel.publish(exchange, routingKey, content, options);\n }\n}\n\nclass Message {\n constructor(content) {\n this.toExchange = null;\n this.content = content;\n this.options = {\n contentType: \"application/json\",\n timestamp: Date.now(),\n };\n this.routingKey = \"\";\n }\n\n get correlationId() {\n return this.options.correlationId || null;\n }\n\n to({ exchange }) {\n if (typeof exchange === \"undefined\")\n throw new Error(\"Exchange is required\");\n this.toExchange = exchange;\n return this;\n }\n\n withType(type) {\n this.options.type = type;\n return this;\n }\n\n withRoutingKey(routingKey) {\n this.routingKey = routingKey;\n return this;\n }\n\n withHeaders(headers) {\n if (!this.options.headers) this.options.headers = {};\n this.options.headers = { ...this.options.headers, ...headers };\n return this;\n }\n\n withContext(context) {\n for (let key in context) {\n this.withHeaders({ [key]: context[key] });\n }\n return this;\n }\n\n withCorrelationId(correlationId) {\n this.options.correlationId = correlationId;\n return this;\n }\n\n withReplyTo(queue) {\n this.options.replyTo = queue;\n return this;\n }\n\n build() {\n let content = this.content;\n if (content.build && typeof content.build === \"function\")\n content = content.build();\n\n return {\n exchange: this.toExchange,\n content: Buffer.from(JSON.stringify(content)),\n options: this.options,\n routingKey: this.routingKey,\n };\n }\n}\n\nfunction isFatalError(err) {\n switch (err && err.code) {\n case 320:\n case 200:\n return false;\n default:\n return true;\n }\n}\n","export const amqpExchanges = {\n // routes commands based on `command-name` header and in many cases `property-id` header\n Commands: {\n name: \"kohost.commands\",\n type: \"headers\",\n options: {\n durable: true,\n },\n },\n CommandResponses: {\n name: \"kohost.commandResponses\",\n type: \"topic\",\n options: {\n durable: true,\n },\n },\n // routes events based on routing keys\n DriverEvents: {\n name: \"kohost.events.drivers\",\n type: \"topic\",\n options: {\n durable: true,\n },\n },\n AppEvents: {\n name: \"kohost.events.app\",\n type: \"topic\",\n options: {\n durable: true,\n },\n },\n Direct: {\n name: \"kohost.direct\",\n type: \"direct\",\n options: {\n durable: true,\n },\n },\n // dead letter exchange\n dlx: {\n name: \"kohost.dlx\",\n type: \"direct\",\n },\n};\n\nexport const deviceTypes = [\n \"dimmer\",\n \"switch\",\n \"thermostat\",\n \"lock\",\n \"windowCovering\",\n \"courtesy\",\n \"alarm\",\n \"camera\",\n \"mediaSource\",\n \"motionSensor\",\n \"gateway\",\n];\n","// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-11-03T19:54:18.014Z\n\nexport * from \"./appError\";\nexport * from \"./authenticationError\";\nexport * from \"./authorizationError\";\nexport * from \"./conflictError\";\nexport * from \"./deviceCommError\";\nexport * from \"./loginError\";\nexport * from \"./notFoundError\";\nexport * from \"./requestError\";\nexport * from \"./systemCommError\";\nexport * from \"./tokenExpiredError\";\nexport * from \"./unprocessableRequestError\";\nexport * from \"./validationError\";","export class AppError extends Error {\n constructor(message = \"Internal Server Error\", options) {\n super(message, options);\n this.type = this.constructor.name;\n this.statusCode = 500;\n this.name = \"AppError\";\n Object.setPrototypeOf(this, AppError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class AuthenticationError extends AppError {\n constructor(message = \"Authentication Error\", options = {}) {\n super(message, options);\n this.statusCode = 401;\n this.name = \"AuthenticationError\";\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class AuthorizationError extends AppError {\n constructor(message = \"Authorization Error\", options = {}) {\n super(message, options);\n this.statusCode = 403;\n this.name = \"AuthorizationError\";\n Object.setPrototypeOf(this, AuthorizationError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class ConflictError extends AppError {\n constructor(message = \"Bad Request\", options = {}) {\n super(message, options);\n this.statusCode = 409;\n this.name = \"ConflictError\";\n Object.setPrototypeOf(this, ConflictError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class DeviceCommError extends AppError {\n constructor(message = \"Device Communication Error\", options = {}) {\n super(message, options);\n this.statusCode = 503;\n this.name = \"DeviceCommError\";\n Object.setPrototypeOf(this, DeviceCommError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class LoginError extends AppError {\n constructor(message = \"Invalid Login information provided\", options = {}) {\n super(message, options);\n this.statusCode = 401;\n this.name = \"LoginError\";\n Object.setPrototypeOf(this, LoginError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class NotFoundError extends AppError {\n constructor(message = \"Resource Not Found\", options = {}) {\n super(message, options);\n this.statusCode = 404;\n this.name = \"NotFoundError\";\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class RequestError extends AppError {\n constructor(message = \"Bad Request\", options = {}) {\n super(message, options);\n this.statusCode = 400;\n this.name = \"RequestError\";\n Object.setPrototypeOf(this, RequestError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class SystemCommError extends AppError {\n constructor(message = \"System Communication Error\", options = {}) {\n super(message, options);\n this.statusCode = 503;\n this.name = \"SystemCommError\";\n Object.setPrototypeOf(this, SystemCommError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class TokenExpiredError extends AppError {\n constructor(message = \"Token Expired\", options = {}) {\n super(message, options);\n this.statusCode = 401;\n this.name = \"TokenExpiredError\";\n Object.setPrototypeOf(this, TokenExpiredError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class UnprocessableRequestError extends AppError {\n constructor(message = \"Unprocessable Request Error\", options = {}) {\n super(message, options);\n this.statusCode = 422;\n this.name = \"UnprocessableRequestError\";\n Object.setPrototypeOf(this, UnprocessableRequestError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class ValidationError extends AppError {\n constructor(message = \"Validation Error\", options = {}) {\n super(message, options);\n this.statusCode = 400;\n this.name = \"ValidationError\";\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,mBAAgB;AAChB,yBAAuB;AACvB,aAAwB;;;ACHjB,IAAM,gBAAgB;AAAA;AAAA,EAE3B,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA;AAAA,EAEA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA;AAAA,EAEA,KAAK;AAA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AAA,EACT;AAAA,EAEA,YAAY,SAAS;AACnB,aAAS,OAAO,SAAS;AACvB,WAAK,YAAY,EAAE,CAAC,GAAG,GAAG,QAAQ,GAAG,EAAE,CAAC;AAAA,IAC1C;AACA,WAAO;AAAA,EACT;AAAA,EAEA,kBAAkB,eAAe;AAC/B,SAAK,QAAQ,gBAAgB;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,OAAO;AACjB,SAAK,QAAQ,UAAU;AACvB,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ;AACN,QAAI,UAAU,KAAK;AACnB,QAAI,QAAQ,SAAS,OAAO,QAAQ,UAAU;AAC5C,gBAAU,QAAQ,MAAM;AAE1B,WAAO;AAAA,MACL,UAAU,KAAK;AAAA,MACf,SAAS,0BAAO,KAAK,KAAK,UAAU,OAAO,CAAC;AAAA,MAC5C,SAAS,KAAK;AAAA,MACd,YAAY,KAAK;AAAA,IACnB;AAAA,EACF;AACF;AAEA,SAAS,aAAa,KAAK;AACzB,UAAQ,OAAO,IAAI,MAAM;AAAA,IACvB,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AARS;","names":["randomUUID","dbg","error"]}
|
|
1
|
+
{"version":3,"sources":["../src/amqpClient.js","../src/defs.js","../src/errors/index.js","../src/errors/appError.js","../src/errors/authenticationError.js","../src/errors/authorizationError.js","../src/errors/conflictError.js","../src/errors/deviceCommError.js","../src/errors/loginError.js","../src/errors/notFoundError.js","../src/errors/requestError.js","../src/errors/systemCommError.js","../src/errors/tokenExpiredError.js","../src/errors/unprocessableRequestError.js","../src/errors/validationError.js"],"sourcesContent":["import { connect } from \"amqplib\";\nimport dbg from \"debug\";\nimport { Buffer } from \"node:buffer\";\nimport * as crypto from \"node:crypto\";\nimport { amqpExchanges as exchanges } from \"./defs\";\nimport * as Errors from \"./errors\";\n\nconst randomUUID = crypto.randomUUID;\n\nconst debug = dbg(\"kohost:amqp-client\");\n\nconst HEADER_KEY_ORGANIZATION_ID = \"X-Organization-Id\";\nconst HEADER_KEY_PROPERTY_ID = \"X-Property-Id\";\nconst HEADER_KEY_DRIVER = \"X-Driver\";\nconst HEADER_KEY_COMMAND_NAME = \"X-Command-Name\";\nconst HEADER_KEY_EVENT_NAME = \"X-Event-Name\";\n\nexport class KohostAMQPClient {\n static get Message() {\n return Message;\n }\n\n static get exchanges() {\n return exchanges;\n }\n static generateCorrelationId() {\n return randomUUID();\n }\n\n static validateMessage(message) {\n if (!message) throw new Error(\"Message is required\");\n }\n\n static parseError(err) {\n let type;\n let message;\n let options = {};\n if (err.message && err.type) {\n const { message: errMessage, type: errType, ...rest } = err;\n type = errType;\n message = errMessage;\n options = rest;\n } else {\n message = err.message || \"Unknown Error\";\n }\n\n debug(\"parseError\", type, message, options);\n\n if (type && Errors[type]) {\n return new Errors[type](message, options);\n }\n\n return new Error(message, options);\n }\n\n static parseMessage(message) {\n let error = null;\n let data = {};\n let query = {};\n let context = {};\n let headers = {};\n\n const isCommand = message?.properties?.type === \"Command\";\n const isEvent = message?.properties?.type === \"Event\";\n\n const messageHeaders = message?.properties?.headers || {};\n\n const commandName = messageHeaders[HEADER_KEY_COMMAND_NAME] || null;\n const eventName = messageHeaders[HEADER_KEY_EVENT_NAME] || null;\n\n if (message.content) {\n try {\n const payload =\n message.properties?.contentType === \"application/json\"\n ? JSON.parse(message.content.toString())\n : message.content.toString();\n data = payload?.data || {};\n error = payload?.error;\n query = payload?.query || {};\n context = payload?.context || {};\n } catch (error) {\n debug(\"error parsing content\", error);\n data = message.content.toString();\n }\n }\n\n if (message?.properties?.headers) {\n const orgHeader = message.properties.headers[HEADER_KEY_ORGANIZATION_ID];\n const propertyHeader = message.properties.headers[HEADER_KEY_PROPERTY_ID];\n const driverHeader = message.properties.headers[HEADER_KEY_DRIVER];\n\n if (orgHeader) {\n context.organizationId = orgHeader;\n headers[HEADER_KEY_ORGANIZATION_ID] = orgHeader;\n }\n\n if (propertyHeader) {\n context.propertyId = propertyHeader;\n headers[HEADER_KEY_PROPERTY_ID] = propertyHeader;\n }\n\n if (driverHeader) {\n context.driver = driverHeader;\n headers[HEADER_KEY_DRIVER] = driverHeader;\n }\n }\n\n const parsed = {};\n\n if (error) parsed.error = this.parseError(error);\n\n parsed.data = data;\n parsed.query = query;\n parsed.context = context;\n parsed.headers = headers;\n\n if (isEvent && eventName) parsed.event = eventName;\n else if (isCommand && commandName) parsed.command = commandName;\n\n debug(\"amqp parsed %o\", parsed);\n\n return parsed;\n }\n\n static getMessage(message) {\n if (!message?.content) return null;\n const payload = JSON.parse(message.content.toString());\n const data = payload?.data;\n return data;\n }\n\n static isFatalError(err) {\n return isFatalError(err);\n }\n\n async createConnection(connection, options = {}) {\n return await connect(connection, options);\n }\n\n static createMessage(content) {\n return new Message(content);\n }\n\n async createChannel(connection) {\n const channel = await connection.createChannel();\n return channel;\n }\n\n async assertExchange(channel, { exchange, type, options }) {\n return await channel.assertExchange(exchange, type, options);\n }\n\n async assertQueue(channel, { queue, options }) {\n return await channel.assertQueue(queue, options);\n }\n\n async bindQueue(channel, { queue, exchange, routingKey, args }) {\n return await channel.bindQueue(queue, exchange, routingKey, args);\n }\n\n async bindExchange(channel, { source, destination, routingKey, args }) {\n return await channel.bindExchange(destination, source, routingKey, args);\n }\n\n async subscribeToQueue(channel, { queue, cb, options }) {\n return await channel.consume(queue, cb, options);\n }\n\n publishToExchange(channel, { exchange, routingKey, content, options }) {\n return channel.publish(exchange, routingKey, content, options);\n }\n}\n\nclass Message {\n constructor(content) {\n this.toExchange = null;\n this.content = content;\n this.options = {\n contentType: \"application/json\",\n timestamp: Date.now(),\n };\n this.routingKey = \"\";\n }\n\n get correlationId() {\n return this.options.correlationId || null;\n }\n\n to({ exchange }) {\n if (typeof exchange === \"undefined\")\n throw new Error(\"Exchange is required\");\n this.toExchange = exchange;\n return this;\n }\n\n withType(type) {\n this.options.type = type;\n return this;\n }\n\n withRoutingKey(routingKey) {\n this.routingKey = routingKey;\n return this;\n }\n\n withHeaders(headers) {\n if (!this.options.headers) this.options.headers = {};\n this.options.headers = { ...this.options.headers, ...headers };\n return this;\n }\n\n withContext(context) {\n for (let key in context) {\n this.withHeaders({ [key]: context[key] });\n }\n return this;\n }\n\n withCorrelationId(correlationId) {\n this.options.correlationId = correlationId;\n return this;\n }\n\n withReplyTo(queue) {\n this.options.replyTo = queue;\n return this;\n }\n\n build() {\n let content = this.content;\n if (content.build && typeof content.build === \"function\")\n content = content.build();\n\n return {\n exchange: this.toExchange,\n content: Buffer.from(JSON.stringify(content)),\n options: this.options,\n routingKey: this.routingKey,\n };\n }\n}\n\nfunction isFatalError(err) {\n switch (err && err.code) {\n case 320:\n case 200:\n return false;\n default:\n return true;\n }\n}\n","export const amqpExchanges = {\n // routes commands based on `command-name` header and in many cases `property-id` header\n Commands: {\n name: \"kohost.commands\",\n type: \"headers\",\n options: {\n durable: true,\n },\n },\n CommandResponses: {\n name: \"kohost.commandResponses\",\n type: \"topic\",\n options: {\n durable: true,\n },\n },\n // routes events based on routing keys\n DriverEvents: {\n name: \"kohost.events.drivers\",\n type: \"topic\",\n options: {\n durable: true,\n },\n },\n AppEvents: {\n name: \"kohost.events.app\",\n type: \"topic\",\n options: {\n durable: true,\n },\n },\n Direct: {\n name: \"kohost.direct\",\n type: \"direct\",\n options: {\n durable: true,\n },\n },\n // dead letter exchange\n dlx: {\n name: \"kohost.dlx\",\n type: \"direct\",\n },\n};\n\nexport const deviceTypes = [\n \"dimmer\",\n \"switch\",\n \"thermostat\",\n \"lock\",\n \"windowCovering\",\n \"courtesy\",\n \"alarm\",\n \"camera\",\n \"mediaSource\",\n \"motionSensor\",\n \"gateway\",\n];\n","// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-11-05T14:27:49.884Z\n\nexport * from \"./appError\";\nexport * from \"./authenticationError\";\nexport * from \"./authorizationError\";\nexport * from \"./conflictError\";\nexport * from \"./deviceCommError\";\nexport * from \"./loginError\";\nexport * from \"./notFoundError\";\nexport * from \"./requestError\";\nexport * from \"./systemCommError\";\nexport * from \"./tokenExpiredError\";\nexport * from \"./unprocessableRequestError\";\nexport * from \"./validationError\";","export class AppError extends Error {\n constructor(message = \"Internal Server Error\", options) {\n super(message, options);\n this.type = this.constructor.name;\n this.statusCode = 500;\n this.name = \"AppError\";\n Object.setPrototypeOf(this, AppError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class AuthenticationError extends AppError {\n constructor(message = \"Authentication Error\", options = {}) {\n super(message, options);\n this.statusCode = 401;\n this.name = \"AuthenticationError\";\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class AuthorizationError extends AppError {\n constructor(message = \"Authorization Error\", options = {}) {\n super(message, options);\n this.statusCode = 403;\n this.name = \"AuthorizationError\";\n Object.setPrototypeOf(this, AuthorizationError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class ConflictError extends AppError {\n constructor(message = \"Bad Request\", options = {}) {\n super(message, options);\n this.statusCode = 409;\n this.name = \"ConflictError\";\n Object.setPrototypeOf(this, ConflictError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class DeviceCommError extends AppError {\n constructor(message = \"Device Communication Error\", options = {}) {\n super(message, options);\n this.statusCode = 503;\n this.name = \"DeviceCommError\";\n Object.setPrototypeOf(this, DeviceCommError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class LoginError extends AppError {\n constructor(message = \"Invalid Login information provided\", options = {}) {\n super(message, options);\n this.statusCode = 401;\n this.name = \"LoginError\";\n Object.setPrototypeOf(this, LoginError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class NotFoundError extends AppError {\n constructor(message = \"Resource Not Found\", options = {}) {\n super(message, options);\n this.statusCode = 404;\n this.name = \"NotFoundError\";\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class RequestError extends AppError {\n constructor(message = \"Bad Request\", options = {}) {\n super(message, options);\n this.statusCode = 400;\n this.name = \"RequestError\";\n Object.setPrototypeOf(this, RequestError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class SystemCommError extends AppError {\n constructor(message = \"System Communication Error\", options = {}) {\n super(message, options);\n this.statusCode = 503;\n this.name = \"SystemCommError\";\n Object.setPrototypeOf(this, SystemCommError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class TokenExpiredError extends AppError {\n constructor(message = \"Token Expired\", options = {}) {\n super(message, options);\n this.statusCode = 401;\n this.name = \"TokenExpiredError\";\n Object.setPrototypeOf(this, TokenExpiredError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class UnprocessableRequestError extends AppError {\n constructor(message = \"Unprocessable Request Error\", options = {}) {\n super(message, options);\n this.statusCode = 422;\n this.name = \"UnprocessableRequestError\";\n Object.setPrototypeOf(this, UnprocessableRequestError.prototype);\n }\n}\n","import { AppError } from \"./appError\";\n\nexport class ValidationError extends AppError {\n constructor(message = \"Validation Error\", options = {}) {\n super(message, options);\n this.statusCode = 400;\n this.name = \"ValidationError\";\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AACxB,mBAAgB;AAChB,yBAAuB;AACvB,aAAwB;;;ACHjB,IAAM,gBAAgB;AAAA;AAAA,EAE3B,UAAU;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA;AAAA,EAEA,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,WAAW;AAAA,I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AAY;AACzB,SAAK,aAAa;AAClB,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,SAAS;AACnB,QAAI,CAAC,KAAK,QAAQ,QAAS,MAAK,QAAQ,UAAU,CAAC;AACnD,SAAK,QAAQ,UAAU,EAAE,GAAG,KAAK,QAAQ,SAAS,GAAG,QAAQ;AAC7D,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,SAAS;AACnB,aAAS,OAAO,SAAS;AACvB,WAAK,YAAY,EAAE,CAAC,GAAG,GAAG,QAAQ,GAAG,EAAE,CAAC;AAAA,IAC1C;AACA,WAAO;AAAA,EACT;AAAA,EAEA,kBAAkB,eAAe;AAC/B,SAAK,QAAQ,gBAAgB;AAC7B,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,OAAO;AACjB,SAAK,QAAQ,UAAU;AACvB,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ;AACN,QAAI,UAAU,KAAK;AACnB,QAAI,QAAQ,SAAS,OAAO,QAAQ,UAAU;AAC5C,gBAAU,QAAQ,MAAM;AAE1B,WAAO;AAAA,MACL,UAAU,KAAK;AAAA,MACf,SAAS,0BAAO,KAAK,KAAK,UAAU,OAAO,CAAC;AAAA,MAC5C,SAAS,KAAK;AAAA,MACd,YAAY,KAAK;AAAA,IACnB;AAAA,EACF;AACF;AAEA,SAAS,aAAa,KAAK;AACzB,UAAQ,OAAO,IAAI,MAAM;AAAA,IACvB,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AARS;","names":["randomUUID","dbg","error"]}
|
package/dist/amqpClient.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{KohostAMQPClient}from"./chunk-
|
|
1
|
+
import{KohostAMQPClient}from"./chunk-NVHDJTCZ.js";import"./chunk-5QBIGY4H.js";import"./chunk-FU3MLFEZ.js";import"./chunk-S3LGXCUW.js";import"./chunk-R36FVWOK.js";import"./chunk-J3IXW2RX.js";import"./chunk-ELAUVDF4.js";import"./chunk-ZXW3Q5ZK.js";import"./chunk-5FSWHSBF.js";import"./chunk-FWQABD55.js";import"./chunk-WN4Z5JJD.js";import"./chunk-7GGLCJ6I.js";import"./chunk-3AE3KSKI.js";import"./chunk-P3ZPJTJ2.js";import"./chunk-THXOWLL3.js";import"./chunk-XE4OXN2W.js";export{KohostAMQPClient};//# sourceMappingURL=amqpClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateSwitch}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Switch=class extends Entity{static{__name(this,"Switch")}constructor(data){super(data),this.id=data.id,void 0!==data.name&&(this.name=data.name),this.type=data.type,void 0!==data.discriminator&&(this.discriminator=data.discriminator),void 0!==data.supportedNotifications&&(this.supportedNotifications=data.supportedNotifications),void 0!==data.notification&&(this.notification=data.notification),this.driver=data.driver,void 0!==data.offline&&(this.offline=data.offline),this.state=data.state,void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.watts&&(this.watts=data.watts),void 0!==data.icon&&(this.icon=data.icon),void 0!==data.manufacturer&&(this.manufacturer=data.manufacturer),void 0!==data.modelNumber&&(this.modelNumber=data.modelNumber),void 0!==data.serialNumber&&(this.serialNumber=data.serialNumber),void 0!==data.firmwareVersion&&(this.firmwareVersion=data.firmwareVersion),void 0!==data.restoresAt&&(this.restoresAt=data.restoresAt)}};Object.defineProperty(Switch.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"switch.json",title:"Switch",description:"Any smart switch",type:"object",required:["id","type","state","driver"],properties:{id:{$ref:"definitions.json#/definitions/id"},name:{type:"string"},type:{type:"string",enum:["switch"],default:"switch"},discriminator:{type:"string",enum:["light","fan","irrigation"]},supportedNotifications:{$ref:"definitions.json#/definitions/supportedNotifications"},notification:{$ref:"definitions.json#/definitions/notification"},driver:{$ref:"definitions.json#/definitions/driver"},offline:{type:"boolean"},state:{type:"string",enum:["on","off"]},systemId:{$ref:"definitions.json#/definitions/systemId"},watts:{$ref:"definitions.json#/definitions/watts"},icon:{type:"string"},manufacturer:{type:"string"},modelNumber:{type:"string"},serialNumber:{type:"string"},firmwareVersion:{type:"string"},restoresAt:{type:"string",format:"date-time"}}}}),Object.defineProperty(Switch.prototype,"validator",{get:__name(function(){return validateSwitch},"get")});export{Switch};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateSwitch}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Switch=class extends Entity{static{__name(this,"Switch")}constructor(data){super(data),this.id=data.id,void 0!==data.name&&(this.name=data.name),this.type=data.type,void 0!==data.discriminator&&(this.discriminator=data.discriminator),void 0!==data.supportedNotifications&&(this.supportedNotifications=data.supportedNotifications),void 0!==data.notification&&(this.notification=data.notification),this.driver=data.driver,void 0!==data.offline&&(this.offline=data.offline),this.state=data.state,void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.watts&&(this.watts=data.watts),void 0!==data.icon&&(this.icon=data.icon),void 0!==data.manufacturer&&(this.manufacturer=data.manufacturer),void 0!==data.modelNumber&&(this.modelNumber=data.modelNumber),void 0!==data.serialNumber&&(this.serialNumber=data.serialNumber),void 0!==data.firmwareVersion&&(this.firmwareVersion=data.firmwareVersion),void 0!==data.restoresAt&&(this.restoresAt=data.restoresAt)}};Object.defineProperty(Switch.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"switch.json",title:"Switch",description:"Any smart switch",type:"object",required:["id","type","state","driver"],properties:{id:{$ref:"definitions.json#/definitions/id"},name:{type:"string"},type:{type:"string",enum:["switch"],default:"switch"},discriminator:{type:"string",enum:["light","fan","irrigation"]},supportedNotifications:{$ref:"definitions.json#/definitions/supportedNotifications"},notification:{$ref:"definitions.json#/definitions/notification"},driver:{$ref:"definitions.json#/definitions/driver"},offline:{type:"boolean"},state:{type:"string",enum:["on","off"]},systemId:{$ref:"definitions.json#/definitions/systemId"},watts:{$ref:"definitions.json#/definitions/watts"},icon:{type:"string"},manufacturer:{type:"string"},modelNumber:{type:"string"},serialNumber:{type:"string"},firmwareVersion:{type:"string"},restoresAt:{type:"string",format:"date-time"}}}}),Object.defineProperty(Switch.prototype,"validator",{get:__name(function(){return validateSwitch},"get")});export{Switch};//# sourceMappingURL=chunk-3T7O6SSX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/switch.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateSwitch as validate } from \"../validate\";\n\n/**\n * @typedef {Object} SwitchData Any smart switch\n * @property {string} id - Identifier of the object.\n * @property {string} [name]\n * @property {\"switch\"} type - Default: \"switch\"\n * @property {(\"light\"|\"fan\"|\"irrigation\")} [discriminator]\n * @property {(\"button 1\"|\"button 2\"|\"button 3\"|\"button 4\"|\"button 5\"|\"idle\"|\"powerHasBeedApplied\"|\"acMainsDisconnected\"|\"acMainsReconnected\"|\"replaceBatterySoon\"|\"replaceBatteryNow\"|\"batteryOk\"|\"hardwareFailure\"|\"softwareFailure\"|\"hardwareFailureWithCode\"|\"softwareFailureWithCode\"|\"motionDetection\"|\"airFilterNeedsCleaned\"|\"airFilterNeedsReplaced\"|\"smokeDetected\"|\"outsideSafeTemperatureRange\"|\"outsideSafeHumidityRange\"|\"scheduleMaintenance\"|\"doorAjar\"|\"communicationFailure\"|\"communicationOk\"|\"burglarAlarm\"|\"fireAlarm\")[]} [supportedNotifications]\n * @property {{name?: (\"button 1\"|\"button 2\"|\"button 3\"|\"button 4\"|\"button 5\"|\"idle\"|\"powerHasBeedApplied\"|\"acMainsDisconnected\"|\"acMainsReconnected\"|\"replaceBatterySoon\"|\"replaceBatteryNow\"|\"batteryOk\"|\"hardwareFailure\"|\"softwareFailure\"|\"hardwareFailureWithCode\"|\"softwareFailureWithCode\"|\"motionDetection\"|\"airFilterNeedsCleaned\"|\"airFilterNeedsReplaced\"|\"smokeDetected\"|\"outsideSafeTemperatureRange\"|\"outsideSafeHumidityRange\"|\"scheduleMaintenance\"|\"doorAjar\"|\"communicationFailure\"|\"communicationOk\"|\"burglarAlarm\"|\"fireAlarm\"), timestamp?: number, description?: string}} [notification]\n * @property {(\"adlink\"|\"aws-kinesis\"|\"bacnet\"|\"benq\"|\"butler\"|\"comelit\"|\"crestron\"|\"dell\"|\"digital-watchdog\"|\"distech\"|\"dmp\"|\"doorbird\"|\"dormakaba\"|\"dsc\"|\"ecobee\"|\"epson\"|\"geovision-rs\"|\"geovision-as-manager\"|\"honeywell-vista\"|\"igor\"|\"inncom\"|\"isapi\"|\"kohost-k7\"|\"kohost\"|\"lg\"|\"lg-webos\"|\"lapi\"|\"lirc\"|\"mews\"|\"mht\"|\"newline\"|\"paxton\"|\"pelican-wireless\"|\"power-shades\"|\"rachio\"|\"rebrandly\"|\"relay\"|\"rtsp\"|\"salto\"|\"salto-irn\"|\"samsung\"|\"se\"|\"sendgrid\"|\"smartboard\"|\"sonifi\"|\"stay-n-touch\"|\"storable\"|\"twilio\"|\"unifi\"|\"valcom\"|\"veracross\"|\"vivotek\"|\"vizio\"|\"wisenet\"|\"cloudflare-images\"|\"cloudflare-stream\"|\"insperia-privacy\")} driver - Driver used to communicate with the object.\n * @property {boolean} [offline]\n * @property {(\"on\"|\"off\")} state\n * @property {string} [systemId] - Identifier of the object, directly related to the system.\n * @property {number} [watts]\n * @property {string} [icon]\n * @property {string} [manufacturer]\n * @property {string} [modelNumber]\n * @property {string} [serialNumber]\n * @property {string} [firmwareVersion]\n * @property {string} [restoresAt]\n */\n\n/**\n * Any smart switch\n * @class Switch\n * @extends {Entity}\n */\nexport class Switch extends Entity {\n /**\n * @constructor\n * @param {SwitchData} data - The data to initialize the Switch with\n */\n constructor(data) {\n super(data);\n this.id = data.id;\n if (data.name !== undefined) this.name = data.name;\n this.type = data.type;\n if (data.discriminator !== undefined)\n this.discriminator = data.discriminator;\n if (data.supportedNotifications !== undefined)\n this.supportedNotifications = data.supportedNotifications;\n if (data.notification !== undefined) this.notification = data.notification;\n this.driver = data.driver;\n if (data.offline !== undefined) this.offline = data.offline;\n this.state = data.state;\n if (data.systemId !== undefined) this.systemId = data.systemId;\n if (data.watts !== undefined) this.watts = data.watts;\n if (data.icon !== undefined) this.icon = data.icon;\n if (data.manufacturer !== undefined) this.manufacturer = data.manufacturer;\n if (data.modelNumber !== undefined) this.modelNumber = data.modelNumber;\n if (data.serialNumber !== undefined) this.serialNumber = data.serialNumber;\n if (data.firmwareVersion !== undefined)\n this.firmwareVersion = data.firmwareVersion;\n if (data.restoresAt !== undefined) this.restoresAt = data.restoresAt;\n }\n}\n\nObject.defineProperty(Switch.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"switch.json\",\n title: \"Switch\",\n description: \"Any smart switch\",\n type: \"object\",\n required: [\"id\", \"type\", \"state\", \"driver\"],\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n name: { type: \"string\" },\n type: { type: \"string\", enum: [\"switch\"], default: \"switch\" },\n discriminator: { type: \"string\", enum: [\"light\", \"fan\", \"irrigation\"] },\n supportedNotifications: {\n $ref: \"definitions.json#/definitions/supportedNotifications\",\n },\n notification: { $ref: \"definitions.json#/definitions/notification\" },\n driver: { $ref: \"definitions.json#/definitions/driver\" },\n offline: { type: \"boolean\" },\n state: { type: \"string\", enum: [\"on\", \"off\"] },\n systemId: { $ref: \"definitions.json#/definitions/systemId\" },\n watts: { $ref: \"definitions.json#/definitions/watts\" },\n icon: { type: \"string\" },\n manufacturer: { type: \"string\" },\n modelNumber: { type: \"string\" },\n serialNumber: { type: \"string\" },\n firmwareVersion: { type: \"string\" },\n restoresAt: { type: \"string\", format: \"date-time\" },\n },\n },\n});\n\nObject.defineProperty(Switch.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AAgCO,IAAM,SAAN,cAAqB,OAAO;AAAA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,MAC5D,eAAe,EAAE,MAAM,UAAU,MAAM,CAAC,SAAS,OAAO,YAAY,EAAE;AAAA,MACtE,wBAAwB;AAAA,QACtB,MAAM;AAAA,MACR;AAAA,MACA,cAAc,EAAE,MAAM,6CAA6C;AAAA,MACnE,QAAQ,EAAE,MAAM,uCAAuC;AAAA,MACvD,SAAS,EAAE,MAAM,UAAU;AAAA,MAC3B,OAAO,EAAE,MAAM,UAAU,MAAM,CAAC,MAAM,KAAK,EAAE;AAAA,MAC7C,UAAU,EAAE,MAAM,yCAAyC;AAAA,MAC3D,OAAO,EAAE,MAAM,sCAAsC;AAAA,MACrD,MAAM,EAAE,MAAM,SAAS;AAAA,MACvB,cAAc,EAAE,MAAM,SAAS;AAAA,MAC/B,aAAa,EAAE,MAAM,SAAS;AAAA,MAC9B,cAAc,EAAE,MAAM,SAAS;AAAA,MAC/B,iBAAiB,EAAE,MAAM,SAAS;AAAA,MAClC,YAAY,EAAE,MAAM,UAAU,QAAQ,YAAY;AAAA,IACpD;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,OAAO,WAAW,aAAa;AAAA,EACnD,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateProduct}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Product=class extends Entity{static{__name(this,"Product")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),void 0!==data.type&&(this.type=data.type),this.name=data.name,this.driver=data.driver,void 0!==data.description&&(this.description=data.description),this.price=data.price,void 0!==data.tax&&(this.tax=data.tax),void 0!==data.image&&(this.image=data.image),void 0!==data.category&&(this.category=data.category),void 0!==data.imageUrl&&(this.imageUrl=data.imageUrl),void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.createdAt&&(this.createdAt=data.createdAt),void 0!==data.updatedAt&&(this.updatedAt=data.updatedAt),void 0!==data.deletedAt&&(this.deletedAt=data.deletedAt)}};Object.defineProperty(Product.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"product.json",title:"Product",type:"object",required:["name","price","driver"],properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",default:"product",enum:["product"]},name:{type:"string"},driver:{$ref:"definitions.json#/definitions/driver"},description:{type:"string"},price:{type:"number"},tax:{type:["number","null"]},image:{$ref:"mediaFile.json"},category:{type:"string"},imageUrl:{type:"string",format:"uri",pattern:"^https?://"},systemId:{$ref:"definitions.json#/definitions/systemId"},createdAt:{$ref:"definitions.json#/definitions/date"},updatedAt:{$ref:"definitions.json#/definitions/date"},deletedAt:{$ref:"definitions.json#/definitions/date"}}}}),Object.defineProperty(Product.prototype,"validator",{get:__name(function(){return validateProduct},"get")});export{Product};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateProduct}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Product=class extends Entity{static{__name(this,"Product")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),void 0!==data.type&&(this.type=data.type),this.name=data.name,this.driver=data.driver,void 0!==data.description&&(this.description=data.description),this.price=data.price,void 0!==data.tax&&(this.tax=data.tax),void 0!==data.image&&(this.image=data.image),void 0!==data.category&&(this.category=data.category),void 0!==data.imageUrl&&(this.imageUrl=data.imageUrl),void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.createdAt&&(this.createdAt=data.createdAt),void 0!==data.updatedAt&&(this.updatedAt=data.updatedAt),void 0!==data.deletedAt&&(this.deletedAt=data.deletedAt)}};Object.defineProperty(Product.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"product.json",title:"Product",type:"object",required:["name","price","driver"],properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",default:"product",enum:["product"]},name:{type:"string"},driver:{$ref:"definitions.json#/definitions/driver"},description:{type:"string"},price:{type:"number"},tax:{type:["number","null"]},image:{$ref:"mediaFile.json"},category:{type:"string"},imageUrl:{type:"string",format:"uri",pattern:"^https?://"},systemId:{$ref:"definitions.json#/definitions/systemId"},createdAt:{$ref:"definitions.json#/definitions/date"},updatedAt:{$ref:"definitions.json#/definitions/date"},deletedAt:{$ref:"definitions.json#/definitions/date"}}}}),Object.defineProperty(Product.prototype,"validator",{get:__name(function(){return validateProduct},"get")});export{Product};//# sourceMappingURL=chunk-44FUQXMY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/product.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateProduct as validate } from \"../validate\";\n\n/**\n * @typedef {Object} ProductData\n * @property {string} [id] - Identifier of the object.\n * @property {\"product\"} [type] - Default: \"product\"\n * @property {string} name\n * @property {(\"adlink\"|\"aws-kinesis\"|\"bacnet\"|\"benq\"|\"butler\"|\"comelit\"|\"crestron\"|\"dell\"|\"digital-watchdog\"|\"distech\"|\"dmp\"|\"doorbird\"|\"dormakaba\"|\"dsc\"|\"ecobee\"|\"epson\"|\"geovision-rs\"|\"geovision-as-manager\"|\"honeywell-vista\"|\"igor\"|\"inncom\"|\"isapi\"|\"kohost-k7\"|\"kohost\"|\"lg\"|\"lg-webos\"|\"lapi\"|\"lirc\"|\"mews\"|\"mht\"|\"newline\"|\"paxton\"|\"pelican-wireless\"|\"power-shades\"|\"rachio\"|\"rebrandly\"|\"relay\"|\"rtsp\"|\"salto\"|\"salto-irn\"|\"samsung\"|\"se\"|\"sendgrid\"|\"smartboard\"|\"sonifi\"|\"stay-n-touch\"|\"storable\"|\"twilio\"|\"unifi\"|\"valcom\"|\"veracross\"|\"vivotek\"|\"vizio\"|\"wisenet\"|\"cloudflare-images\"|\"cloudflare-stream\"|\"insperia-privacy\")} driver - Driver used to communicate with the object.\n * @property {string} [description]\n * @property {number} price\n * @property {(number|null)} [tax]\n * @property {{id?: string, type: \"mediaFile\", name?: string, fileHash?: string, category?: string, mimeType?: (\"image/*\"|\"image/jpeg\"|\"image/png\"|\"image/gif\"|\"image/webp\"|\"image/avif\"|\"image/svg+xml\"|\"application/pdf\"), data?: string, url?: string, width?: number, height?: number, size?: number, uploadUrl?: string, uploadUrlExpires?: (string|object), createdBy?: string, systemId?: string, createdAt?: (string|object), updatedAt?: (string|object), deletedAt?: (string|object)}} [image] - Any media file\n * @property {string} [category]\n * @property {string} [imageUrl]\n * @property {string} [systemId] - Identifier of the object, directly related to the system.\n * @property {(string|object)} [createdAt]\n * @property {(string|object)} [updatedAt]\n * @property {(string|object)} [deletedAt]\n */\n\n/**\n *\n * @class Product\n * @extends {Entity}\n */\nexport class Product extends Entity {\n /**\n * @constructor\n * @param {ProductData} data - The data to initialize the Product with\n */\n constructor(data) {\n super(data);\n if (data.id !== undefined) this.id = data.id;\n if (data.type !== undefined) this.type = data.type;\n this.name = data.name;\n this.driver = data.driver;\n if (data.description !== undefined) this.description = data.description;\n this.price = data.price;\n if (data.tax !== undefined) this.tax = data.tax;\n if (data.image !== undefined) this.image = data.image;\n if (data.category !== undefined) this.category = data.category;\n if (data.imageUrl !== undefined) this.imageUrl = data.imageUrl;\n if (data.systemId !== undefined) this.systemId = data.systemId;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n }\n}\n\nObject.defineProperty(Product.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"product.json\",\n title: \"Product\",\n type: \"object\",\n required: [\"name\", \"price\", \"driver\"],\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n type: { type: \"string\", default: \"product\", enum: [\"product\"] },\n name: { type: \"string\" },\n driver: { $ref: \"definitions.json#/definitions/driver\" },\n description: { type: \"string\" },\n price: { type: \"number\" },\n tax: { type: [\"number\", \"null\"] },\n image: { $ref: \"mediaFile.json\" },\n category: { type: \"string\" },\n imageUrl: { type: \"string\", format: \"uri\", pattern: \"^https?://\" },\n systemId: { $ref: \"definitions.json#/definitions/systemId\" },\n createdAt: { $ref: \"definitions.json#/definitions/date\" },\n updatedAt: { $ref: \"definitions.json#/definitions/date\" },\n deletedAt: { $ref: \"definitions.json#/definitions/date\" },\n },\n },\n});\n\nObject.defineProperty(Product.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AA6BO,IAAM,UAAN,cAAsB,OAAO;AAAA,EA7BpC,OA6BoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlC,YAAY,MAAM;AAChB,UAAM,IAAI;AACV,QAAI,KAAK,OAAO,OAAW,MAAK,KAAK,KAAK;AAC1C,QAAI,KAAK,SAAS,OAAW,MAAK,OAAO,KAAK;AAC9C,SAAK,OAAO,KAAK;AACjB,SAAK,SAAS,KAAK;AACnB,QAAI,KAAK,gBAAgB,OAAW,MAAK,cAAc,KAAK;AAC5D,SAAK,QAAQ,KAAK;AAClB,QAAI,KAAK,QAAQ,OAAW,MAAK,MAAM,KAAK;AAC5C,QAAI,KAAK,UAAU,OAAW,MAAK,QAAQ,KAAK;AAChD,QAAI,KAAK,aAAa,OAAW,MAAK,WAAW,KAAK;AACtD,QAAI,KAAK,aAAa,OAAW,MAAK,WAAW,KAAK;AACtD,QAAI,KAAK,aAAa,OAAW,MAAK,WAAW,KAAK;AACtD,QAAI,KAAK,cAAc,OAAW,MAAK,YAAY,KAAK;AACxD,QAAI,KAAK,cAAc,OAAW,MAAK,YAAY,KAAK;AACxD,QAAI,KAAK,cAAc,OAAW,MAAK,YAAY,KAAK;AAAA,EAC1D;AACF;AAEA,OAAO,eAAe,QAAQ,WAAW,UAAU;AAAA,EACjD,OAAO;AAAA,IACL,SAAS;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU,CAAC,QAAQ,SAAS,QAAQ;AAAA,IACpC,YAAY;AAAA,MACV,IAAI,EAAE,MAAM,mCAAmC;AAAA,MAC/C,MAAM,EAAE,MAAM,UAAU,SAAS,WAAW,MAAM,CAAC,SAAS,EAAE;AAAA,MAC9D,MAAM,EAAE,MAAM,SAAS;AAAA,MACvB,QAAQ,EAAE,MAAM,uCAAuC;AAAA,MACvD,aAAa,EAAE,MAAM,SAAS;AAAA,MAC9B,OAAO,EAAE,MAAM,SAAS;AAAA,MACxB,KAAK,EAAE,MAAM,CAAC,UAAU,MAAM,EAAE;AAAA,MAChC,OAAO,EAAE,MAAM,iBAAiB;AAAA,MAChC,UAAU,EAAE,MAAM,SAAS;AAAA,MAC3B,UAAU,EAAE,MAAM,UAAU,QAAQ,OAAO,SAAS,aAAa;AAAA,MACjE,UAAU,EAAE,MAAM,yCAAyC;AAAA,MAC3D,WAAW,EAAE,MAAM,qCAAqC;AAAA,MACxD,WAAW,EAAE,MAAM,qCAAqC;AAAA,MACxD,WAAW,EAAE,MAAM,qCAAqC;AAAA,IAC1D;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,QAAQ,WAAW,aAAa;AAAA,EACpD,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateIdentification}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Identification=class extends Entity{static{__name(this,"Identification")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),this.type=data.type,void 0!==data.number&&(this.number=data.number),void 0!==data.maskedNumber&&(this.maskedNumber=data.maskedNumber),void 0!==data.encryptedNumber&&(this.encryptedNumber=data.encryptedNumber),void 0!==data.issued&&(this.issued=data.issued),void 0!==data.expires&&(this.expires=data.expires),void 0!==data.verified&&(this.verified=data.verified),void 0!==data.matched&&(this.matched=data.matched),void 0!==data.firstName&&(this.firstName=data.firstName),void 0!==data.lastName&&(this.lastName=data.lastName),void 0!==data.issuingCountry&&(this.issuingCountry=data.issuingCountry),void 0!==data.issuingState&&(this.issuingState=data.issuingState),void 0!==data.systemId&&(this.systemId=data.systemId)}};Object.defineProperty(Identification.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"identification.json",title:"Identification",type:"object",required:["type"],additionalProperties:!1,oneOf:[{required:["number"]},{required:["encryptedNumber"]}],properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",enum:["driversLicense","passport","identityCard","visa"]},number:{type:"string"},maskedNumber:{type:"string"},encryptedNumber:{type:"string"},issued:{type:["string","object"],format:"date-time"},expires:{type:["string","object","null"],format:"date-time"},verified:{type:"boolean"},matched:{type:"boolean"},firstName:{type:"string"},lastName:{type:"string"},issuingCountry:{type:"string",minLength:2,maxLength:2},issuingState:{type:"string",minLength:2,maxLength:2},systemId:{$ref:"definitions.json#/definitions/systemId"}}}}),Object.defineProperty(Identification.prototype,"validator",{get:__name(function(){return validateIdentification},"get")});export{Identification};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateIdentification}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Identification=class extends Entity{static{__name(this,"Identification")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),this.type=data.type,void 0!==data.number&&(this.number=data.number),void 0!==data.maskedNumber&&(this.maskedNumber=data.maskedNumber),void 0!==data.encryptedNumber&&(this.encryptedNumber=data.encryptedNumber),void 0!==data.issued&&(this.issued=data.issued),void 0!==data.expires&&(this.expires=data.expires),void 0!==data.verified&&(this.verified=data.verified),void 0!==data.matched&&(this.matched=data.matched),void 0!==data.firstName&&(this.firstName=data.firstName),void 0!==data.lastName&&(this.lastName=data.lastName),void 0!==data.issuingCountry&&(this.issuingCountry=data.issuingCountry),void 0!==data.issuingState&&(this.issuingState=data.issuingState),void 0!==data.systemId&&(this.systemId=data.systemId)}};Object.defineProperty(Identification.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"identification.json",title:"Identification",type:"object",required:["type"],additionalProperties:!1,oneOf:[{required:["number"]},{required:["encryptedNumber"]}],properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",enum:["driversLicense","passport","identityCard","visa"]},number:{type:"string"},maskedNumber:{type:"string"},encryptedNumber:{type:"string"},issued:{type:["string","object"],format:"date-time"},expires:{type:["string","object","null"],format:"date-time"},verified:{type:"boolean"},matched:{type:"boolean"},firstName:{type:"string"},lastName:{type:"string"},issuingCountry:{type:"string",minLength:2,maxLength:2},issuingState:{type:"string",minLength:2,maxLength:2},systemId:{$ref:"definitions.json#/definitions/systemId"}}}}),Object.defineProperty(Identification.prototype,"validator",{get:__name(function(){return validateIdentification},"get")});export{Identification};//# sourceMappingURL=chunk-4JPS6JAG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/identification.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateIdentification as validate } from \"../validate\";\n\n/**\n * @typedef {Object} IdentificationData\n * @property {string} [id] - Identifier of the object.\n * @property {(\"driversLicense\"|\"passport\"|\"identityCard\"|\"visa\")} type\n * @property {string} [number]\n * @property {string} [maskedNumber]\n * @property {string} [encryptedNumber]\n * @property {(string|object)} [issued]\n * @property {(string|object|null)} [expires]\n * @property {boolean} [verified]\n * @property {boolean} [matched]\n * @property {string} [firstName]\n * @property {string} [lastName]\n * @property {string} [issuingCountry]\n * @property {string} [issuingState]\n * @property {string} [systemId] - Identifier of the object, directly related to the system.\n */\n\n/**\n *\n * @class Identification\n * @extends {Entity}\n */\nexport class Identification extends Entity {\n /**\n * @constructor\n * @param {IdentificationData} data - The data to initialize the Identification with\n */\n constructor(data) {\n super(data);\n if (data.id !== undefined) this.id = data.id;\n this.type = data.type;\n if (data.number !== undefined) this.number = data.number;\n if (data.maskedNumber !== undefined) this.maskedNumber = data.maskedNumber;\n if (data.encryptedNumber !== undefined)\n this.encryptedNumber = data.encryptedNumber;\n if (data.issued !== undefined) this.issued = data.issued;\n if (data.expires !== undefined) this.expires = data.expires;\n if (data.verified !== undefined) this.verified = data.verified;\n if (data.matched !== undefined) this.matched = data.matched;\n if (data.firstName !== undefined) this.firstName = data.firstName;\n if (data.lastName !== undefined) this.lastName = data.lastName;\n if (data.issuingCountry !== undefined)\n this.issuingCountry = data.issuingCountry;\n if (data.issuingState !== undefined) this.issuingState = data.issuingState;\n if (data.systemId !== undefined) this.systemId = data.systemId;\n }\n}\n\nObject.defineProperty(Identification.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"identification.json\",\n title: \"Identification\",\n type: \"object\",\n required: [\"type\"],\n additionalProperties: false,\n oneOf: [{ required: [\"number\"] }, { required: [\"encryptedNumber\"] }],\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n type: {\n type: \"string\",\n enum: [\"driversLicense\", \"passport\", \"identityCard\", \"visa\"],\n },\n number: { type: \"string\" },\n maskedNumber: { type: \"string\" },\n encryptedNumber: { type: \"string\" },\n issued: { type: [\"string\", \"object\"], format: \"date-time\" },\n expires: { type: [\"string\", \"object\", \"null\"], format: \"date-time\" },\n verified: { type: \"boolean\" },\n matched: { type: \"boolean\" },\n firstName: { type: \"string\" },\n lastName: { type: \"string\" },\n issuingCountry: { type: \"string\", minLength: 2, maxLength: 2 },\n issuingState: { type: \"string\", minLength: 2, maxLength: 2 },\n systemId: { $ref: \"definitions.json#/definitions/systemId\" },\n },\n },\n});\n\nObject.defineProperty(Identification.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AA6BO,IAAM,iBAAN,cAA6B,OAAO;AAAA,EA7B3C,OA6B2C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKzC,YAAY,MAAM;AAChB,UAAM,IAAI;AACV,QAAI,KAAK,O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AE,MAAM,CAAC,UAAU,QAAQ,GAAG,QAAQ,YAAY;AAAA,MAC1D,SAAS,EAAE,MAAM,CAAC,UAAU,UAAU,MAAM,GAAG,QAAQ,YAAY;AAAA,MACnE,UAAU,EAAE,MAAM,UAAU;AAAA,MAC5B,SAAS,EAAE,MAAM,UAAU;AAAA,MAC3B,WAAW,EAAE,MAAM,SAAS;AAAA,MAC5B,UAAU,EAAE,MAAM,SAAS;AAAA,MAC3B,gBAAgB,EAAE,MAAM,UAAU,WAAW,GAAG,WAAW,EAAE;AAAA,MAC7D,cAAc,EAAE,MAAM,UAAU,WAAW,GAAG,WAAW,EAAE;AAAA,MAC3D,UAAU,EAAE,MAAM,yCAAyC;AAAA,IAC7D;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,eAAe,WAAW,aAAa;AAAA,EAC3D,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ticket}from"./chunk-LP654L2T.js";import{TimeSheet}from"./chunk-MDUXUTZE.js";import{User}from"./chunk-
|
|
1
|
+
import{Ticket}from"./chunk-LP654L2T.js";import{TimeSheet}from"./chunk-MDUXUTZE.js";import{User}from"./chunk-EQRRWEUV.js";import{Vendor}from"./chunk-J2AC6RFR.js";import{WindowCovering}from"./chunk-WSJEJ7RX.js";import{ShortLink}from"./chunk-WRXPM632.js";import{SmsMessage}from"./chunk-MOJQUUBD.js";import{Space}from"./chunk-XNM55KLN.js";import{Switch}from"./chunk-3T7O6SSX.js";import{SystemUser}from"./chunk-W7P3OFBI.js";import{Thermostat}from"./chunk-7AFOPOH6.js";import{Organization}from"./chunk-GXHDNNEZ.js";import{Policy}from"./chunk-IY5FFXJ2.js";import{Product}from"./chunk-44FUQXMY.js";import{Property}from"./chunk-AHC2WGJE.js";import{Reservation}from"./chunk-S5OTB2OU.js";import{Room}from"./chunk-JF2EVZYA.js";import{Scene}from"./chunk-GGDJAKJZ.js";import{Issue}from"./chunk-VBGYHXL3.js";import{Lock}from"./chunk-WJWT5H6X.js";import{Log}from"./chunk-T55IDNO3.js";import{MediaFile}from"./chunk-IVZ3NUQX.js";import{MediaSource}from"./chunk-STZLODEY.js";import{MotionSensor}from"./chunk-OEO6RXVP.js";import{Order}from"./chunk-6GYXNHAJ.js";import{DiscoveredDevice}from"./chunk-QAOGHEYG.js";import{EmailMessage}from"./chunk-EY64ZXPD.js";import{EnergyReport}from"./chunk-2S3PRL4Z.js";import{EnergyReportShard}from"./chunk-X6T2DYFK.js";import{Gateway}from"./chunk-TI3ILTHZ.js";import{Identification}from"./chunk-4JPS6JAG.js";import{Announcement}from"./chunk-T7ZYREDK.js";import{Camera}from"./chunk-DYI5AGYE.js";import{Category}from"./chunk-X2VO5SPG.js";import{Courtesy}from"./chunk-JGB2IDZ6.js";import{Credential}from"./chunk-XYTZBG4S.js";import{DeviceRouter}from"./chunk-BDSQQ6HP.js";import{Dimmer}from"./chunk-LKIPRLBQ.js";import{Alarm}from"./chunk-C5BVAUUD.js";import{events_exports}from"./chunk-BHKQEUCN.js";import{LoginError}from"./chunk-FU3MLFEZ.js";import{NotFoundError}from"./chunk-S3LGXCUW.js";import{RequestError}from"./chunk-R36FVWOK.js";import{SystemCommError}from"./chunk-J3IXW2RX.js";import{TokenExpiredError}from"./chunk-ELAUVDF4.js";import{UnprocessableRequestError}from"./chunk-ZXW3Q5ZK.js";import{ValidationError}from"./chunk-5FSWHSBF.js";import{AuthenticationError}from"./chunk-FWQABD55.js";import{AuthorizationError}from"./chunk-WN4Z5JJD.js";import{ConflictError}from"./chunk-7GGLCJ6I.js";import{DeviceCommError}from"./chunk-3AE3KSKI.js";import{AppError}from"./chunk-P3ZPJTJ2.js";import{__export,__name}from"./chunk-XE4OXN2W.js";var utils_exports={};function entityFactory(type){switch(type){case"reservation":return Reservation;case"mediaFile":return MediaFile;case"switch":return Switch;case"alarm":return Alarm;case"dimmer":return Dimmer;case"lock":return Lock;case"thermostat":return Thermostat;case"windowCovering":return WindowCovering;case"identification":return Identification;case"user":return User;case"systemUser":return SystemUser;case"policy":return Policy;case"courtesy":return Courtesy;case"camera":return Camera;case"motionSensor":return MotionSensor;case"mediaSource":return MediaSource;case"room":return Room;case"space":return Space;case"category":return Category;case"ticket":return Ticket;case"scene":return Scene;case"gateway":return Gateway;case"product":return Product;case"order":return Order;case"discoveredDevice":return DiscoveredDevice;case"deviceRouter":return DeviceRouter;case"credential":return Credential;case"shortLink":return ShortLink;case"energyReportShard":return EnergyReportShard;case"energyReport":return EnergyReport;case"smsMessage":return SmsMessage;case"emailMessage":return EmailMessage;case"announcement":return Announcement;case"timeSheet":return TimeSheet;case"property":return Property;case"organization":return Organization;case"issue":return Issue;case"vendor":return Vendor;case"log":return Log;default:throw new Error("Unknown entity type: "+type)}}function errorFactory(errName){switch(errName){case"AppError":return AppError;case"AuthenticationError":return AuthenticationError;case"AuthorizationError":return AuthorizationError;case"ConflictError":return ConflictError;case"DeviceCommError":return DeviceCommError;case"LoginError":return LoginError;case"NotFoundError":return NotFoundError;case"RequestError":return RequestError;case"SystemCommError":return SystemCommError;case"TokenExpiredError":return TokenExpiredError;case"UnprocessableRequestError":return UnprocessableRequestError;case"ValidationError":return ValidationError;default:return new Error("Invalid error name: "+errName)}}function eventFactory(eventName){const Event=Object.values(events_exports).find(E=>E.prototype.name===eventName);if(!Event)throw new Error("Invalid event name: "+eventName);return Event}__export(utils_exports,{entityFactory:()=>entityFactory,errorFactory:()=>errorFactory,eventFactory:()=>eventFactory}),__name(entityFactory,"entityFactory"),__name(errorFactory,"errorFactory"),__name(eventFactory,"eventFactory");export{entityFactory,errorFactory,eventFactory,utils_exports};//# sourceMappingURL=chunk-5GYG24VQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LoginError}from"./chunk-FU3MLFEZ.js";import{NotFoundError}from"./chunk-S3LGXCUW.js";import{RequestError}from"./chunk-R36FVWOK.js";import{SystemCommError}from"./chunk-J3IXW2RX.js";import{TokenExpiredError}from"./chunk-ELAUVDF4.js";import{UnprocessableRequestError}from"./chunk-ZXW3Q5ZK.js";import{ValidationError}from"./chunk-5FSWHSBF.js";import{AuthenticationError}from"./chunk-FWQABD55.js";import{AuthorizationError}from"./chunk-WN4Z5JJD.js";import{ConflictError}from"./chunk-7GGLCJ6I.js";import{DeviceCommError}from"./chunk-3AE3KSKI.js";import{AppError}from"./chunk-P3ZPJTJ2.js";import{__export}from"./chunk-XE4OXN2W.js";var errors_exports={};__export(errors_exports,{AppError:()=>AppError,AuthenticationError:()=>AuthenticationError,AuthorizationError:()=>AuthorizationError,ConflictError:()=>ConflictError,DeviceCommError:()=>DeviceCommError,LoginError:()=>LoginError,NotFoundError:()=>NotFoundError,RequestError:()=>RequestError,SystemCommError:()=>SystemCommError,TokenExpiredError:()=>TokenExpiredError,UnprocessableRequestError:()=>UnprocessableRequestError,ValidationError:()=>ValidationError});export{errors_exports};//# sourceMappingURL=chunk-
|
|
1
|
+
import{LoginError}from"./chunk-FU3MLFEZ.js";import{NotFoundError}from"./chunk-S3LGXCUW.js";import{RequestError}from"./chunk-R36FVWOK.js";import{SystemCommError}from"./chunk-J3IXW2RX.js";import{TokenExpiredError}from"./chunk-ELAUVDF4.js";import{UnprocessableRequestError}from"./chunk-ZXW3Q5ZK.js";import{ValidationError}from"./chunk-5FSWHSBF.js";import{AuthenticationError}from"./chunk-FWQABD55.js";import{AuthorizationError}from"./chunk-WN4Z5JJD.js";import{ConflictError}from"./chunk-7GGLCJ6I.js";import{DeviceCommError}from"./chunk-3AE3KSKI.js";import{AppError}from"./chunk-P3ZPJTJ2.js";import{__export}from"./chunk-XE4OXN2W.js";var errors_exports={};__export(errors_exports,{AppError:()=>AppError,AuthenticationError:()=>AuthenticationError,AuthorizationError:()=>AuthorizationError,ConflictError:()=>ConflictError,DeviceCommError:()=>DeviceCommError,LoginError:()=>LoginError,NotFoundError:()=>NotFoundError,RequestError:()=>RequestError,SystemCommError:()=>SystemCommError,TokenExpiredError:()=>TokenExpiredError,UnprocessableRequestError:()=>UnprocessableRequestError,ValidationError:()=>ValidationError});export{errors_exports};//# sourceMappingURL=chunk-5QBIGY4H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors/index.js"],"sourcesContent":["// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-11-
|
|
1
|
+
{"version":3,"sources":["../src/errors/index.js"],"sourcesContent":["// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-11-05T14:27:49.884Z\n\nexport * from \"./appError\";\nexport * from \"./authenticationError\";\nexport * from \"./authorizationError\";\nexport * from \"./conflictError\";\nexport * from \"./deviceCommError\";\nexport * from \"./loginError\";\nexport * from \"./notFoundError\";\nexport * from \"./requestError\";\nexport * from \"./systemCommError\";\nexport * from \"./tokenExpiredError\";\nexport * from \"./unprocessableRequestError\";\nexport * from \"./validationError\";"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validatePayment}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Payment=class extends Entity{static{__name(this,"Payment")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),this.type=data.type,void 0!==data.enabled&&(this.enabled=data.enabled),void 0!==data.storageData&&(this.storageData=data.storageData),this.maskedNumber=data.maskedNumber,void 0!==data.issued&&(this.issued=data.issued),this.expires=data.expires,void 0!==data.systemId&&(this.systemId=data.systemId)}};Object.defineProperty(Payment.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"payment.json",title:"Payment",type:"object",required:["type","maskedNumber","expires"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",enum:["amex","visa","masterCard","maestro","discover","diners","jcb","applePay","alipay","chinaUnionPay","vpay"]},enabled:{type:"boolean",default:!0},storageData:{type:["string","null"]},maskedNumber:{type:"string"},issued:{type:["string","null"]},expires:{type:"string"},systemId:{$ref:"definitions.json#/definitions/systemId"}}}}),Object.defineProperty(Payment.prototype,"validator",{get:__name(function(){return validatePayment},"get")});export{Payment};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validatePayment}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Payment=class extends Entity{static{__name(this,"Payment")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),this.type=data.type,void 0!==data.enabled&&(this.enabled=data.enabled),void 0!==data.storageData&&(this.storageData=data.storageData),this.maskedNumber=data.maskedNumber,void 0!==data.issued&&(this.issued=data.issued),this.expires=data.expires,void 0!==data.systemId&&(this.systemId=data.systemId)}};Object.defineProperty(Payment.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"payment.json",title:"Payment",type:"object",required:["type","maskedNumber","expires"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",enum:["amex","visa","masterCard","maestro","discover","diners","jcb","applePay","alipay","chinaUnionPay","vpay"]},enabled:{type:"boolean",default:!0},storageData:{type:["string","null"]},maskedNumber:{type:"string"},issued:{type:["string","null"]},expires:{type:"string"},systemId:{$ref:"definitions.json#/definitions/systemId"}}}}),Object.defineProperty(Payment.prototype,"validator",{get:__name(function(){return validatePayment},"get")});export{Payment};//# sourceMappingURL=chunk-5UTH7OAH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/payment.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validatePayment as validate } from \"../validate\";\n\n/**\n * @typedef {Object} PaymentData\n * @property {string} [id] - Identifier of the object.\n * @property {(\"amex\"|\"visa\"|\"masterCard\"|\"maestro\"|\"discover\"|\"diners\"|\"jcb\"|\"applePay\"|\"alipay\"|\"chinaUnionPay\"|\"vpay\")} type\n * @property {boolean} [enabled] - Default: true\n * @property {(string|null)} [storageData]\n * @property {string} maskedNumber\n * @property {(string|null)} [issued]\n * @property {string} expires\n * @property {string} [systemId] - Identifier of the object, directly related to the system.\n */\n\n/**\n *\n * @class Payment\n * @extends {Entity}\n */\nexport class Payment extends Entity {\n /**\n * @constructor\n * @param {PaymentData} data - The data to initialize the Payment with\n */\n constructor(data) {\n super(data);\n if (data.id !== undefined) this.id = data.id;\n this.type = data.type;\n if (data.enabled !== undefined) this.enabled = data.enabled;\n if (data.storageData !== undefined) this.storageData = data.storageData;\n this.maskedNumber = data.maskedNumber;\n if (data.issued !== undefined) this.issued = data.issued;\n this.expires = data.expires;\n if (data.systemId !== undefined) this.systemId = data.systemId;\n }\n}\n\nObject.defineProperty(Payment.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"payment.json\",\n title: \"Payment\",\n type: \"object\",\n required: [\"type\", \"maskedNumber\", \"expires\"],\n additionalProperties: false,\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n type: {\n type: \"string\",\n enum: [\n \"amex\",\n \"visa\",\n \"masterCard\",\n \"maestro\",\n \"discover\",\n \"diners\",\n \"jcb\",\n \"applePay\",\n \"alipay\",\n \"chinaUnionPay\",\n \"vpay\",\n ],\n },\n enabled: { type: \"boolean\", default: true },\n storageData: { type: [\"string\", \"null\"] },\n maskedNumber: { type: \"string\" },\n issued: { type: [\"string\", \"null\"] },\n expires: { type: \"string\" },\n systemId: { $ref: \"definitions.json#/definitions/systemId\" },\n },\n },\n});\n\nObject.defineProperty(Payment.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AAuBO,IAAM,UAAN,cAAsB,OAAO;AAAA,EAvBpC,OAuBoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateThermostat}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Thermostat=class extends Entity{static{__name(this,"Thermostat")}constructor(data){super(data),this.id=data.id,void 0!==data.name&&(this.name=data.name),this.type=data.type,this.driver=data.driver,void 0!==data.offline&&(this.offline=data.offline),void 0!==data.supportedNotifications&&(this.supportedNotifications=data.supportedNotifications),void 0!==data.notification&&(this.notification=data.notification),void 0!==data.currentTemperature&&(this.currentTemperature=data.currentTemperature),void 0!==data.currentHumidity&&(this.currentHumidity=data.currentHumidity),this.hvacMode=data.hvacMode,this.hvacState=data.hvacState,this.fanMode=data.fanMode,this.fanState=data.fanState,this.temperatureScale=data.temperatureScale,void 0!==data.humidityScale&&(this.humidityScale=data.humidityScale),this.supportedHvacModes=data.supportedHvacModes,this.supportedFanModes=data.supportedFanModes,this.setpoints=data.setpoints,void 0!==data.minAutoDelta&&(this.minAutoDelta=data.minAutoDelta),void 0!==data.cycleRate&&(this.cycleRate=data.cycleRate),void 0!==data.co2&&(this.co2=data.co2),void 0!==data.voc&&(this.voc=data.voc),void 0!==data.batteryLevel&&(this.batteryLevel=data.batteryLevel),void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.watts&&(this.watts=data.watts),void 0!==data.icon&&(this.icon=data.icon),void 0!==data.manufacturer&&(this.manufacturer=data.manufacturer),void 0!==data.modelNumber&&(this.modelNumber=data.modelNumber),void 0!==data.serialNumber&&(this.serialNumber=data.serialNumber),void 0!==data.firmwareVersion&&(this.firmwareVersion=data.firmwareVersion),void 0!==data.uiEnabled&&(this.uiEnabled=data.uiEnabled)}};Object.defineProperty(Thermostat.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"thermostat.json",title:"Thermostat",description:"Any smart thermostat",type:"object",required:["id","type","hvacMode","fanMode","hvacState","fanState","setpoints","temperatureScale","supportedHvacModes","supportedFanModes","driver"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},name:{$ref:"definitions.json#/definitions/name"},type:{type:"string",enum:["thermostat"],default:"thermostat"},driver:{$ref:"definitions.json#/definitions/driver"},offline:{type:"boolean"},supportedNotifications:{$ref:"definitions.json#/definitions/supportedNotifications"},notification:{$ref:"definitions.json#/definitions/notification"},currentTemperature:{type:"number"},currentHumidity:{type:"number",minimum:0},hvacMode:{type:"string",$ref:"#/properties/supportedHvacModes/items"},hvacState:{type:["string","null"],enum:["cooling","heating","off",null]},fanMode:{type:"string",$ref:"#/properties/supportedFanModes/items"},fanState:{type:["string","null"],enum:["off","low","medium","high","on",null]},temperatureScale:{type:"string",enum:["celsius","fahrenheit"],default:"fahrenheit"},humidityScale:{type:["string","null"],enum:["absolute","relative",null]},supportedHvacModes:{type:"array",uniqueItems:!0,minItems:2,items:{enum:["cool","heat","auto","off"]}},supportedFanModes:{type:"array",uniqueItems:!0,items:{enum:["auto","low","medium","high","off","on"]}},setpoints:{type:"object",additionalProperties:!1,properties:{cool:{$ref:"#/$defs/setpoint"},heat:{$ref:"#/$defs/setpoint"},auto:{$ref:"#/$defs/setpoint"}}},minAutoDelta:{type:"number",default:3},cycleRate:{type:"number"},co2:{type:"number",description:"Parts per million (ppm)"},voc:{type:"number",description:"Parts per billion (ppb)"},batteryLevel:{$ref:"definitions.json#/definitions/batteryLevel"},systemId:{$ref:"definitions.json#/definitions/systemId"},watts:{$ref:"definitions.json#/definitions/watts"},icon:{type:"string"},manufacturer:{type:"string"},modelNumber:{type:"string"},serialNumber:{type:"string"},firmwareVersion:{type:"string"},uiEnabled:{type:"boolean",description:"Local thermostat controls active or not",default:!0}},$defs:{setpoint:{type:"object",additionalProperties:!1,properties:{value:{$ref:"#/$defs/setpointValue"},min:{$ref:"#/$defs/setpointMinMax"},max:{$ref:"#/$defs/setpointMinMax"}}},setpointValue:{type:"number",minimum:0,maximum:99},setpointMinMax:{type:["number","null"],minimum:0,maximum:99}}}}),Object.defineProperty(Thermostat.prototype,"validator",{get:__name(function(){return validateThermostat},"get")});export{Thermostat};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateThermostat}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Thermostat=class extends Entity{static{__name(this,"Thermostat")}constructor(data){super(data),this.id=data.id,void 0!==data.name&&(this.name=data.name),this.type=data.type,this.driver=data.driver,void 0!==data.offline&&(this.offline=data.offline),void 0!==data.supportedNotifications&&(this.supportedNotifications=data.supportedNotifications),void 0!==data.notification&&(this.notification=data.notification),void 0!==data.currentTemperature&&(this.currentTemperature=data.currentTemperature),void 0!==data.currentHumidity&&(this.currentHumidity=data.currentHumidity),this.hvacMode=data.hvacMode,this.hvacState=data.hvacState,this.fanMode=data.fanMode,this.fanState=data.fanState,this.temperatureScale=data.temperatureScale,void 0!==data.humidityScale&&(this.humidityScale=data.humidityScale),this.supportedHvacModes=data.supportedHvacModes,this.supportedFanModes=data.supportedFanModes,this.setpoints=data.setpoints,void 0!==data.minAutoDelta&&(this.minAutoDelta=data.minAutoDelta),void 0!==data.cycleRate&&(this.cycleRate=data.cycleRate),void 0!==data.co2&&(this.co2=data.co2),void 0!==data.voc&&(this.voc=data.voc),void 0!==data.batteryLevel&&(this.batteryLevel=data.batteryLevel),void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.watts&&(this.watts=data.watts),void 0!==data.icon&&(this.icon=data.icon),void 0!==data.manufacturer&&(this.manufacturer=data.manufacturer),void 0!==data.modelNumber&&(this.modelNumber=data.modelNumber),void 0!==data.serialNumber&&(this.serialNumber=data.serialNumber),void 0!==data.firmwareVersion&&(this.firmwareVersion=data.firmwareVersion),void 0!==data.uiEnabled&&(this.uiEnabled=data.uiEnabled)}};Object.defineProperty(Thermostat.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"thermostat.json",title:"Thermostat",description:"Any smart thermostat",type:"object",required:["id","type","hvacMode","fanMode","hvacState","fanState","setpoints","temperatureScale","supportedHvacModes","supportedFanModes","driver"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},name:{$ref:"definitions.json#/definitions/name"},type:{type:"string",enum:["thermostat"],default:"thermostat"},driver:{$ref:"definitions.json#/definitions/driver"},offline:{type:"boolean"},supportedNotifications:{$ref:"definitions.json#/definitions/supportedNotifications"},notification:{$ref:"definitions.json#/definitions/notification"},currentTemperature:{type:"number"},currentHumidity:{type:"number",minimum:0},hvacMode:{type:"string",$ref:"#/properties/supportedHvacModes/items"},hvacState:{type:["string","null"],enum:["cooling","heating","off",null]},fanMode:{type:"string",$ref:"#/properties/supportedFanModes/items"},fanState:{type:["string","null"],enum:["off","low","medium","high","on",null]},temperatureScale:{type:"string",enum:["celsius","fahrenheit"],default:"fahrenheit"},humidityScale:{type:["string","null"],enum:["absolute","relative",null]},supportedHvacModes:{type:"array",uniqueItems:!0,minItems:2,items:{enum:["cool","heat","auto","off"]}},supportedFanModes:{type:"array",uniqueItems:!0,items:{enum:["auto","low","medium","high","off","on"]}},setpoints:{type:"object",additionalProperties:!1,properties:{cool:{$ref:"#/$defs/setpoint"},heat:{$ref:"#/$defs/setpoint"},auto:{$ref:"#/$defs/setpoint"}}},minAutoDelta:{type:"number",default:3},cycleRate:{type:"number"},co2:{type:"number",description:"Parts per million (ppm)"},voc:{type:"number",description:"Parts per billion (ppb)"},batteryLevel:{$ref:"definitions.json#/definitions/batteryLevel"},systemId:{$ref:"definitions.json#/definitions/systemId"},watts:{$ref:"definitions.json#/definitions/watts"},icon:{type:"string"},manufacturer:{type:"string"},modelNumber:{type:"string"},serialNumber:{type:"string"},firmwareVersion:{type:"string"},uiEnabled:{type:"boolean",description:"Local thermostat controls active or not",default:!0}},$defs:{setpoint:{type:"object",additionalProperties:!1,properties:{value:{$ref:"#/$defs/setpointValue"},min:{$ref:"#/$defs/setpointMinMax"},max:{$ref:"#/$defs/setpointMinMax"}}},setpointValue:{type:"number",minimum:0,maximum:99},setpointMinMax:{type:["number","null"],minimum:0,maximum:99}}}}),Object.defineProperty(Thermostat.prototype,"validator",{get:__name(function(){return validateThermostat},"get")});export{Thermostat};//# sourceMappingURL=chunk-7AFOPOH6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/thermostat.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateThermostat as validate } from \"../validate\";\n\n/**\n * @typedef {Object} ThermostatData Any smart thermostat\n * @property {string} id - Identifier of the object.\n * @property {string} [name]\n * @property {\"thermostat\"} type - Default: \"thermostat\"\n * @property {(\"adlink\"|\"aws-kinesis\"|\"bacnet\"|\"benq\"|\"butler\"|\"comelit\"|\"crestron\"|\"dell\"|\"digital-watchdog\"|\"distech\"|\"dmp\"|\"doorbird\"|\"dormakaba\"|\"dsc\"|\"ecobee\"|\"epson\"|\"geovision-rs\"|\"geovision-as-manager\"|\"honeywell-vista\"|\"igor\"|\"inncom\"|\"isapi\"|\"kohost-k7\"|\"kohost\"|\"lg\"|\"lg-webos\"|\"lapi\"|\"lirc\"|\"mews\"|\"mht\"|\"newline\"|\"paxton\"|\"pelican-wireless\"|\"power-shades\"|\"rachio\"|\"rebrandly\"|\"relay\"|\"rtsp\"|\"salto\"|\"salto-irn\"|\"samsung\"|\"se\"|\"sendgrid\"|\"smartboard\"|\"sonifi\"|\"stay-n-touch\"|\"storable\"|\"twilio\"|\"unifi\"|\"valcom\"|\"veracross\"|\"vivotek\"|\"vizio\"|\"wisenet\"|\"cloudflare-images\"|\"cloudflare-stream\"|\"insperia-privacy\")} driver - Driver used to communicate with the object.\n * @property {boolean} [offline]\n * @property {(\"button 1\"|\"button 2\"|\"button 3\"|\"button 4\"|\"button 5\"|\"idle\"|\"powerHasBeedApplied\"|\"acMainsDisconnected\"|\"acMainsReconnected\"|\"replaceBatterySoon\"|\"replaceBatteryNow\"|\"batteryOk\"|\"hardwareFailure\"|\"softwareFailure\"|\"hardwareFailureWithCode\"|\"softwareFailureWithCode\"|\"motionDetection\"|\"airFilterNeedsCleaned\"|\"airFilterNeedsReplaced\"|\"smokeDetected\"|\"outsideSafeTemperatureRange\"|\"outsideSafeHumidityRange\"|\"scheduleMaintenance\"|\"doorAjar\"|\"communicationFailure\"|\"communicationOk\"|\"burglarAlarm\"|\"fireAlarm\")[]} [supportedNotifications]\n * @property {{name?: (\"button 1\"|\"button 2\"|\"button 3\"|\"button 4\"|\"button 5\"|\"idle\"|\"powerHasBeedApplied\"|\"acMainsDisconnected\"|\"acMainsReconnected\"|\"replaceBatterySoon\"|\"replaceBatteryNow\"|\"batteryOk\"|\"hardwareFailure\"|\"softwareFailure\"|\"hardwareFailureWithCode\"|\"softwareFailureWithCode\"|\"motionDetection\"|\"airFilterNeedsCleaned\"|\"airFilterNeedsReplaced\"|\"smokeDetected\"|\"outsideSafeTemperatureRange\"|\"outsideSafeHumidityRange\"|\"scheduleMaintenance\"|\"doorAjar\"|\"communicationFailure\"|\"communicationOk\"|\"burglarAlarm\"|\"fireAlarm\"), timestamp?: number, description?: string}} [notification]\n * @property {number} [currentTemperature]\n * @property {number} [currentHumidity]\n * @property {(\"cool\"|\"heat\"|\"auto\"|\"off\")} hvacMode\n * @property {(\"cooling\"|\"heating\"|\"off\")} hvacState\n * @property {(\"auto\"|\"low\"|\"medium\"|\"high\"|\"off\"|\"on\")} fanMode\n * @property {(\"off\"|\"low\"|\"medium\"|\"high\"|\"on\")} fanState\n * @property {(\"celsius\"|\"fahrenheit\")} temperatureScale - Default: \"fahrenheit\"\n * @property {(\"absolute\"|\"relative\")} [humidityScale]\n * @property {(\"cool\"|\"heat\"|\"auto\"|\"off\")[]} supportedHvacModes\n * @property {(\"auto\"|\"low\"|\"medium\"|\"high\"|\"off\"|\"on\")[]} supportedFanModes\n * @property {{cool?: {value?: number, min?: (number|null), max?: (number|null)}, heat?: {value?: number, min?: (number|null), max?: (number|null)}, auto?: {value?: number, min?: (number|null), max?: (number|null)}}} setpoints\n * @property {number} [minAutoDelta] - Default: 3\n * @property {number} [cycleRate]\n * @property {number} [co2] - Parts per million (ppm)\n * @property {number} [voc] - Parts per billion (ppb)\n * @property {number} [batteryLevel]\n * @property {string} [systemId] - Identifier of the object, directly related to the system.\n * @property {number} [watts]\n * @property {string} [icon]\n * @property {string} [manufacturer]\n * @property {string} [modelNumber]\n * @property {string} [serialNumber]\n * @property {string} [firmwareVersion]\n * @property {boolean} [uiEnabled] - Local thermostat controls active or not. Default: true\n */\n\n/**\n * Any smart thermostat\n * @class Thermostat\n * @extends {Entity}\n */\nexport class Thermostat extends Entity {\n /**\n * @constructor\n * @param {ThermostatData} data - The data to initialize the Thermostat with\n */\n constructor(data) {\n super(data);\n this.id = data.id;\n if (data.name !== undefined) this.name = data.name;\n this.type = data.type;\n this.driver = data.driver;\n if (data.offline !== undefined) this.offline = data.offline;\n if (data.supportedNotifications !== undefined)\n this.supportedNotifications = data.supportedNotifications;\n if (data.notification !== undefined) this.notification = data.notification;\n if (data.currentTemperature !== undefined)\n this.currentTemperature = data.currentTemperature;\n if (data.currentHumidity !== undefined)\n this.currentHumidity = data.currentHumidity;\n this.hvacMode = data.hvacMode;\n this.hvacState = data.hvacState;\n this.fanMode = data.fanMode;\n this.fanState = data.fanState;\n this.temperatureScale = data.temperatureScale;\n if (data.humidityScale !== undefined)\n this.humidityScale = data.humidityScale;\n this.supportedHvacModes = data.supportedHvacModes;\n this.supportedFanModes = data.supportedFanModes;\n this.setpoints = data.setpoints;\n if (data.minAutoDelta !== undefined) this.minAutoDelta = data.minAutoDelta;\n if (data.cycleRate !== undefined) this.cycleRate = data.cycleRate;\n if (data.co2 !== undefined) this.co2 = data.co2;\n if (data.voc !== undefined) this.voc = data.voc;\n if (data.batteryLevel !== undefined) this.batteryLevel = data.batteryLevel;\n if (data.systemId !== undefined) this.systemId = data.systemId;\n if (data.watts !== undefined) this.watts = data.watts;\n if (data.icon !== undefined) this.icon = data.icon;\n if (data.manufacturer !== undefined) this.manufacturer = data.manufacturer;\n if (data.modelNumber !== undefined) this.modelNumber = data.modelNumber;\n if (data.serialNumber !== undefined) this.serialNumber = data.serialNumber;\n if (data.firmwareVersion !== undefined)\n this.firmwareVersion = data.firmwareVersion;\n if (data.uiEnabled !== undefined) this.uiEnabled = data.uiEnabled;\n }\n}\n\nObject.defineProperty(Thermostat.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"thermostat.json\",\n title: \"Thermostat\",\n description: \"Any smart thermostat\",\n type: \"object\",\n required: [\n \"id\",\n \"type\",\n \"hvacMode\",\n \"fanMode\",\n \"hvacState\",\n \"fanState\",\n \"setpoints\",\n \"temperatureScale\",\n \"supportedHvacModes\",\n \"supportedFanModes\",\n \"driver\",\n ],\n additionalProperties: false,\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n name: { $ref: \"definitions.json#/definitions/name\" },\n type: { type: \"string\", enum: [\"thermostat\"], default: \"thermostat\" },\n driver: { $ref: \"definitions.json#/definitions/driver\" },\n offline: { type: \"boolean\" },\n supportedNotifications: {\n $ref: \"definitions.json#/definitions/supportedNotifications\",\n },\n notification: { $ref: \"definitions.json#/definitions/notification\" },\n currentTemperature: { type: \"number\" },\n currentHumidity: { type: \"number\", minimum: 0 },\n hvacMode: {\n type: \"string\",\n $ref: \"#/properties/supportedHvacModes/items\",\n },\n hvacState: {\n type: [\"string\", \"null\"],\n enum: [\"cooling\", \"heating\", \"off\", null],\n },\n fanMode: { type: \"string\", $ref: \"#/properties/supportedFanModes/items\" },\n fanState: {\n type: [\"string\", \"null\"],\n enum: [\"off\", \"low\", \"medium\", \"high\", \"on\", null],\n },\n temperatureScale: {\n type: \"string\",\n enum: [\"celsius\", \"fahrenheit\"],\n default: \"fahrenheit\",\n },\n humidityScale: {\n type: [\"string\", \"null\"],\n enum: [\"absolute\", \"relative\", null],\n },\n supportedHvacModes: {\n type: \"array\",\n uniqueItems: true,\n minItems: 2,\n items: { enum: [\"cool\", \"heat\", \"auto\", \"off\"] },\n },\n supportedFanModes: {\n type: \"array\",\n uniqueItems: true,\n items: { enum: [\"auto\", \"low\", \"medium\", \"high\", \"off\", \"on\"] },\n },\n setpoints: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n cool: { $ref: \"#/$defs/setpoint\" },\n heat: { $ref: \"#/$defs/setpoint\" },\n auto: { $ref: \"#/$defs/setpoint\" },\n },\n },\n minAutoDelta: { type: \"number\", default: 3 },\n cycleRate: { type: \"number\" },\n co2: { type: \"number\", description: \"Parts per million (ppm)\" },\n voc: { type: \"number\", description: \"Parts per billion (ppb)\" },\n batteryLevel: { $ref: \"definitions.json#/definitions/batteryLevel\" },\n systemId: { $ref: \"definitions.json#/definitions/systemId\" },\n watts: { $ref: \"definitions.json#/definitions/watts\" },\n icon: { type: \"string\" },\n manufacturer: { type: \"string\" },\n modelNumber: { type: \"string\" },\n serialNumber: { type: \"string\" },\n firmwareVersion: { type: \"string\" },\n uiEnabled: {\n type: \"boolean\",\n description: \"Local thermostat controls active or not\",\n default: true,\n },\n },\n $defs: {\n setpoint: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n value: { $ref: \"#/$defs/setpointValue\" },\n min: { $ref: \"#/$defs/setpointMinMax\" },\n max: { $ref: \"#/$defs/setpointMinMax\" },\n },\n },\n setpointValue: { type: \"number\", minimum: 0, maximum: 99 },\n setpointMinMax: { type: [\"number\", \"null\"], minimum: 0, maximum: 99 },\n },\n },\n});\n\nObject.defineProperty(Thermostat.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AA8CO,IAAM,aAAN,cAAyB,OAAO;AAAA,EA9CvC,OA8CuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrC,YAAY,MAAM;AAChB,UAAM,IAAI;AACV,SAAK,KAAK,KAAK;AACf,QAAI,KAAK,SAAS,OAAW,MAAK,OAAO,KAAK;AAC9C,SAAK,OAAO,KAAK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O,EAAE,MAAM,wBAAwB;AAAA,UACvC,KAAK,EAAE,MAAM,yBAAyB;AAAA,UACtC,KAAK,EAAE,MAAM,yBAAyB;AAAA,QACxC;AAAA,MACF;AAAA,MACA,eAAe,EAAE,MAAM,UAAU,SAAS,GAAG,SAAS,GAAG;AAAA,MACzD,gBAAgB,EAAE,MAAM,CAAC,UAAU,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG;AAAA,IACtE;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,WAAW,WAAW,aAAa;AAAA,EACvD,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateProperty}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Property=class extends Entity{static{__name(this,"Property")}constructor(data){super(data),this.id=data.id,this.name=data.name,this.type=data.type,this.discriminator=data.discriminator,this.organization=data.organization,void 0!==data.departments&&(this.departments=data.departments),void 0!==data.testModeEnabled&&(this.testModeEnabled=data.testModeEnabled),void 0!==data.testMode&&(this.testMode=data.testMode),this.timezone=data.timezone,void 0!==data.smsNumber&&(this.smsNumber=data.smsNumber),void 0!==data.voiceNumber&&(this.voiceNumber=data.voiceNumber),void 0!==data.tags&&(this.tags=data.tags),void 0!==data.checkInTime&&(this.checkInTime=data.checkInTime),void 0!==data.checkOutTime&&(this.checkOutTime=data.checkOutTime),void 0!==data.address&&(this.address=data.address),void 0!==data.latitude&&(this.latitude=data.latitude),void 0!==data.longitude&&(this.longitude=data.longitude),void 0!==data.appFeatures&&(this.appFeatures=data.appFeatures),void 0!==data.notifications&&(this.notifications=data.notifications),void 0!==data.credentials&&(this.credentials=data.credentials)}};Object.defineProperty(Property.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"property.json",title:"Property",type:"object",description:"A property is a physical asset or building",required:["id","name","type","organization","timezone","discriminator"],properties:{id:{$ref:"definitions.json#/definitions/id"},name:{type:"string"},type:{type:"string",default:"property",enum:["property"]},discriminator:{type:"string",enum:["hospitality","education","commercial","storage"]},organization:{type:["string","null"],description:"Reference (id) to the organization that owns this property"},departments:{type:"array",items:{type:"string"}},testModeEnabled:{type:"boolean"},testMode:{type:"object",properties:{notificationEmails:{type:"array",items:{type:"string"},description:"Only users with these email addresses will receive notifications in test mode, including sms, email, or push."},notificationEmailDomains:{type:"array",items:{type:"string"},description:"Only users with email addreses ending in these domains will receive notifications in test mode, including sms, email, or push."}}},timezone:{type:"string",description:"IANA timezone string",pattern:"^([a-zA-Z]+/[a-zA-Z_]+)$",examples:["America/New_York","America/Los_Angeles"]},smsNumber:{type:"string"},voiceNumber:{type:"string"},tags:{type:"array",items:{type:"string"}},checkInTime:{type:"string"},checkOutTime:{type:"string"},address:{$ref:"definitions.json#/definitions/address"},latitude:{type:"number"},longitude:{type:"number"},appFeatures:{type:"object",properties:{RoomControl:{type:"object",properties:{disabledSystems:{type:"array",items:{type:"string",enum:["climate","lights","shades","tv","doors"]}},excludedDeviceIds:{type:"array",items:{type:"string"},default:[]},commonAreas:{type:"object",properties:{spaces:{type:"array",items:{type:"string"}}}},alarmConfig:{type:"object",patternProperties:{"^[a-zA-Z0-9]+$":{type:"object",properties:{zoneLockMap:{type:"object",description:"Maps zone numbers to lock ids",additionalProperties:{type:"string"}}}}},examples:[{wZz7hucY:{zoneLockMap:{1:"wc87hucc",2:"bc86hzxc",3:"zv5ah5jv"}}}]},cameraConfig:{type:"object",doorStationConfig:{type:"object",patternProperties:{"^[a-zA-Z0-9]+$":{type:"object",properties:{lockIds:{type:"array",items:{type:"string"},default:[],description:"List of lock ids that will be available for control from this door station"}}}}},examples:[{wZz7hucY:{lockIds:["wc87hucb","wc87hucd"]}}]}},additionalProperties:!1},Concierge:{type:"object",properties:{timeTracking:{type:"boolean",default:!1},feedback:{type:"boolean",default:!0},ratings:{type:"boolean",default:!0},newTicketCCs:{type:"array",items:{type:"string"},default:[]},newMessageChannel:{type:["string","null"],enum:["sms","email"],default:"sms",description:"Determines how users should be notified of new messages in the concierge system"},issues:{type:"object",properties:{syncWithPropertyId:{type:"string"}}}}},SOS:{type:"object",properties:{active:{type:"boolean"},activeEmergencies:{type:"array",items:{type:"string",enum:["medical","fire","suspiciousPerson","other","conflict","shooter"]}}}}},additionalProperties:!1,default:{RoomControl:{}}},notifications:{type:"object",properties:{email:{type:"object",properties:{enabled:{type:"boolean"}},additionalProperties:!1},sms:{type:"object",properties:{enabled:{type:"boolean"}},additionalProperties:!1},push:{type:"object",properties:{enabled:{type:"boolean"}},additionalProperties:!1}},additionalProperties:!1,default:{email:{enabled:!1},sms:{enabled:!1},push:{enabled:!1}}},credentials:{type:"object",additionalProperties:!0}}}}),Object.defineProperty(Property.prototype,"validator",{get:__name(function(){return validateProperty},"get")});export{Property};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateProperty}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Property=class extends Entity{static{__name(this,"Property")}constructor(data){super(data),this.id=data.id,this.name=data.name,this.type=data.type,this.discriminator=data.discriminator,this.organization=data.organization,void 0!==data.departments&&(this.departments=data.departments),void 0!==data.testModeEnabled&&(this.testModeEnabled=data.testModeEnabled),void 0!==data.testMode&&(this.testMode=data.testMode),this.timezone=data.timezone,void 0!==data.smsNumber&&(this.smsNumber=data.smsNumber),void 0!==data.voiceNumber&&(this.voiceNumber=data.voiceNumber),void 0!==data.tags&&(this.tags=data.tags),void 0!==data.checkInTime&&(this.checkInTime=data.checkInTime),void 0!==data.checkOutTime&&(this.checkOutTime=data.checkOutTime),void 0!==data.address&&(this.address=data.address),void 0!==data.latitude&&(this.latitude=data.latitude),void 0!==data.longitude&&(this.longitude=data.longitude),void 0!==data.appFeatures&&(this.appFeatures=data.appFeatures),void 0!==data.notifications&&(this.notifications=data.notifications),void 0!==data.credentials&&(this.credentials=data.credentials)}};Object.defineProperty(Property.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"property.json",title:"Property",type:"object",description:"A property is a physical asset or building",required:["id","name","type","organization","timezone","discriminator"],properties:{id:{$ref:"definitions.json#/definitions/id"},name:{type:"string"},type:{type:"string",default:"property",enum:["property"]},discriminator:{type:"string",enum:["hospitality","education","commercial","storage"]},organization:{type:["string","null"],description:"Reference (id) to the organization that owns this property"},departments:{type:"array",items:{type:"string"}},testModeEnabled:{type:"boolean"},testMode:{type:"object",properties:{notificationEmails:{type:"array",items:{type:"string"},description:"Only users with these email addresses will receive notifications in test mode, including sms, email, or push."},notificationEmailDomains:{type:"array",items:{type:"string"},description:"Only users with email addreses ending in these domains will receive notifications in test mode, including sms, email, or push."}}},timezone:{type:"string",description:"IANA timezone string",pattern:"^([a-zA-Z]+/[a-zA-Z_]+)$",examples:["America/New_York","America/Los_Angeles"]},smsNumber:{type:"string"},voiceNumber:{type:"string"},tags:{type:"array",items:{type:"string"}},checkInTime:{type:"string"},checkOutTime:{type:"string"},address:{$ref:"definitions.json#/definitions/address"},latitude:{type:"number"},longitude:{type:"number"},appFeatures:{type:"object",properties:{RoomControl:{type:"object",properties:{disabledSystems:{type:"array",items:{type:"string",enum:["climate","lights","shades","tv","doors"]}},excludedDeviceIds:{type:"array",items:{type:"string"},default:[]},commonAreas:{type:"object",properties:{spaces:{type:"array",items:{type:"string"}}}},alarmConfig:{type:"object",patternProperties:{"^[a-zA-Z0-9]+$":{type:"object",properties:{zoneLockMap:{type:"object",description:"Maps zone numbers to lock ids",additionalProperties:{type:"string"}}}}},examples:[{wZz7hucY:{zoneLockMap:{1:"wc87hucc",2:"bc86hzxc",3:"zv5ah5jv"}}}]},cameraConfig:{type:"object",doorStationConfig:{type:"object",patternProperties:{"^[a-zA-Z0-9]+$":{type:"object",properties:{lockIds:{type:"array",items:{type:"string"},default:[],description:"List of lock ids that will be available for control from this door station"}}}}},examples:[{wZz7hucY:{lockIds:["wc87hucb","wc87hucd"]}}]}},additionalProperties:!1},Concierge:{type:"object",properties:{timeTracking:{type:"boolean",default:!1},feedback:{type:"boolean",default:!0},ratings:{type:"boolean",default:!0},newTicketCCs:{type:"array",items:{type:"string"},default:[]},newMessageChannel:{type:["string","null"],enum:["sms","email"],default:"sms",description:"Determines how users should be notified of new messages in the concierge system"},issues:{type:"object",properties:{syncWithPropertyId:{type:"string"}}}}},SOS:{type:"object",properties:{active:{type:"boolean"},activeEmergencies:{type:"array",items:{type:"string",enum:["medical","fire","suspiciousPerson","other","conflict","shooter"]}}}}},additionalProperties:!1,default:{RoomControl:{}}},notifications:{type:"object",properties:{email:{type:"object",properties:{enabled:{type:"boolean"}},additionalProperties:!1},sms:{type:"object",properties:{enabled:{type:"boolean"}},additionalProperties:!1},push:{type:"object",properties:{enabled:{type:"boolean"}},additionalProperties:!1}},additionalProperties:!1,default:{email:{enabled:!1},sms:{enabled:!1},push:{enabled:!1}}},credentials:{type:"object",additionalProperties:!0}}}}),Object.defineProperty(Property.prototype,"validator",{get:__name(function(){return validateProperty},"get")});export{Property};//# sourceMappingURL=chunk-AHC2WGJE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/property.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateProperty as validate } from \"../validate\";\n\n/**\n * @typedef {Object} PropertyData A property is a physical asset or building\n * @property {string} id - Identifier of the object.\n * @property {string} name\n * @property {\"property\"} type - Default: \"property\"\n * @property {(\"hospitality\"|\"education\"|\"commercial\"|\"storage\")} discriminator\n * @property {(string|null)} organization - Reference (id) to the organization that owns this property\n * @property {string[]} [departments]\n * @property {boolean} [testModeEnabled]\n * @property {{notificationEmails?: string[], notificationEmailDomains?: string[]}} [testMode]\n * @property {string} timezone - IANA timezone string\n * @property {string} [smsNumber]\n * @property {string} [voiceNumber]\n * @property {string[]} [tags]\n * @property {string} [checkInTime]\n * @property {string} [checkOutTime]\n * @property {{id?: string, line1?: string, line2?: string, line3?: string, city?: string, state?: string, postalCode?: string, countryCode?: string}} [address]\n * @property {number} [latitude]\n * @property {number} [longitude]\n * @property {{RoomControl?: {disabledSystems?: (\"climate\"|\"lights\"|\"shades\"|\"tv\"|\"doors\")[], excludedDeviceIds?: string[], commonAreas?: {spaces?: string[]}, alarmConfig?: object, cameraConfig?: object}, Concierge?: {timeTracking?: boolean, feedback?: boolean, ratings?: boolean, newTicketCCs?: string[], newMessageChannel?: (\"sms\"|\"email\"), issues?: {syncWithPropertyId?: string}}, SOS?: {active?: boolean, activeEmergencies?: (\"medical\"|\"fire\"|\"suspiciousPerson\"|\"other\"|\"conflict\"|\"shooter\")[]}}} [appFeatures] - Default: {\"RoomControl\":{}}\n * @property {{email?: {enabled?: boolean}, sms?: {enabled?: boolean}, push?: {enabled?: boolean}}} [notifications] - Default: {\"email\":{\"enabled\":false},\"sms\":{\"enabled\":false},\"push\":{\"enabled\":false}}\n * @property {object} [credentials]\n */\n\n/**\n * A property is a physical asset or building\n * @class Property\n * @extends {Entity}\n */\nexport class Property extends Entity {\n /**\n * @constructor\n * @param {PropertyData} data - The data to initialize the Property with\n */\n constructor(data) {\n super(data);\n this.id = data.id;\n this.name = data.name;\n this.type = data.type;\n this.discriminator = data.discriminator;\n this.organization = data.organization;\n if (data.departments !== undefined) this.departments = data.departments;\n if (data.testModeEnabled !== undefined)\n this.testModeEnabled = data.testModeEnabled;\n if (data.testMode !== undefined) this.testMode = data.testMode;\n this.timezone = data.timezone;\n if (data.smsNumber !== undefined) this.smsNumber = data.smsNumber;\n if (data.voiceNumber !== undefined) this.voiceNumber = data.voiceNumber;\n if (data.tags !== undefined) this.tags = data.tags;\n if (data.checkInTime !== undefined) this.checkInTime = data.checkInTime;\n if (data.checkOutTime !== undefined) this.checkOutTime = data.checkOutTime;\n if (data.address !== undefined) this.address = data.address;\n if (data.latitude !== undefined) this.latitude = data.latitude;\n if (data.longitude !== undefined) this.longitude = data.longitude;\n if (data.appFeatures !== undefined) this.appFeatures = data.appFeatures;\n if (data.notifications !== undefined)\n this.notifications = data.notifications;\n if (data.credentials !== undefined) this.credentials = data.credentials;\n }\n}\n\nObject.defineProperty(Property.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"property.json\",\n title: \"Property\",\n type: \"object\",\n description: \"A property is a physical asset or building\",\n required: [\n \"id\",\n \"name\",\n \"type\",\n \"organization\",\n \"timezone\",\n \"discriminator\",\n ],\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n name: { type: \"string\" },\n type: { type: \"string\", default: \"property\", enum: [\"property\"] },\n discriminator: {\n type: \"string\",\n enum: [\"hospitality\", \"education\", \"commercial\", \"storage\"],\n },\n organization: {\n type: [\"string\", \"null\"],\n description:\n \"Reference (id) to the organization that owns this property\",\n },\n departments: { type: \"array\", items: { type: \"string\" } },\n testModeEnabled: { type: \"boolean\" },\n testMode: {\n type: \"object\",\n properties: {\n notificationEmails: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Only users with these email addresses will receive notifications in test mode, including sms, email, or push.\",\n },\n notificationEmailDomains: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Only users with email addreses ending in these domains will receive notifications in test mode, including sms, email, or push.\",\n },\n },\n },\n timezone: {\n type: \"string\",\n description: \"IANA timezone string\",\n pattern: \"^([a-zA-Z]+/[a-zA-Z_]+)$\",\n examples: [\"America/New_York\", \"America/Los_Angeles\"],\n },\n smsNumber: { type: \"string\" },\n voiceNumber: { type: \"string\" },\n tags: { type: \"array\", items: { type: \"string\" } },\n checkInTime: { type: \"string\" },\n checkOutTime: { type: \"string\" },\n address: { $ref: \"definitions.json#/definitions/address\" },\n latitude: { type: \"number\" },\n longitude: { type: \"number\" },\n appFeatures: {\n type: \"object\",\n properties: {\n RoomControl: {\n type: \"object\",\n properties: {\n disabledSystems: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"climate\", \"lights\", \"shades\", \"tv\", \"doors\"],\n },\n },\n excludedDeviceIds: {\n type: \"array\",\n items: { type: \"string\" },\n default: [],\n },\n commonAreas: {\n type: \"object\",\n properties: {\n spaces: { type: \"array\", items: { type: \"string\" } },\n },\n },\n alarmConfig: {\n type: \"object\",\n patternProperties: {\n \"^[a-zA-Z0-9]+$\": {\n type: \"object\",\n properties: {\n zoneLockMap: {\n type: \"object\",\n description: \"Maps zone numbers to lock ids\",\n additionalProperties: { type: \"string\" },\n },\n },\n },\n },\n examples: [\n {\n wZz7hucY: {\n zoneLockMap: {\n 1: \"wc87hucc\",\n 2: \"bc86hzxc\",\n 3: \"zv5ah5jv\",\n },\n },\n },\n ],\n },\n cameraConfig: {\n type: \"object\",\n doorStationConfig: {\n type: \"object\",\n patternProperties: {\n \"^[a-zA-Z0-9]+$\": {\n type: \"object\",\n properties: {\n lockIds: {\n type: \"array\",\n items: { type: \"string\" },\n default: [],\n description:\n \"List of lock ids that will be available for control from this door station\",\n },\n },\n },\n },\n },\n examples: [{ wZz7hucY: { lockIds: [\"wc87hucb\", \"wc87hucd\"] } }],\n },\n },\n additionalProperties: false,\n },\n Concierge: {\n type: \"object\",\n properties: {\n timeTracking: { type: \"boolean\", default: false },\n feedback: { type: \"boolean\", default: true },\n ratings: { type: \"boolean\", default: true },\n newTicketCCs: {\n type: \"array\",\n items: { type: \"string\" },\n default: [],\n },\n newMessageChannel: {\n type: [\"string\", \"null\"],\n enum: [\"sms\", \"email\"],\n default: \"sms\",\n description:\n \"Determines how users should be notified of new messages in the concierge system\",\n },\n issues: {\n type: \"object\",\n properties: { syncWithPropertyId: { type: \"string\" } },\n },\n },\n },\n SOS: {\n type: \"object\",\n properties: {\n active: { type: \"boolean\" },\n activeEmergencies: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\n \"medical\",\n \"fire\",\n \"suspiciousPerson\",\n \"other\",\n \"conflict\",\n \"shooter\",\n ],\n },\n },\n },\n },\n },\n additionalProperties: false,\n default: { RoomControl: {} },\n },\n notifications: {\n type: \"object\",\n properties: {\n email: {\n type: \"object\",\n properties: { enabled: { type: \"boolean\" } },\n additionalProperties: false,\n },\n sms: {\n type: \"object\",\n properties: { enabled: { type: \"boolean\" } },\n additionalProperties: false,\n },\n push: {\n type: \"object\",\n properties: { enabled: { type: \"boolean\" } },\n additionalProperties: false,\n },\n },\n additionalProperties: false,\n default: {\n email: { enabled: false },\n sms: { enabled: false },\n push: { enabled: false },\n },\n },\n credentials: { type: \"object\", additionalProperties: true },\n },\n },\n});\n\nObject.defineProperty(Property.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AAmCO,IAAM,WAAN,cAAuB,OAAO;AAAA,EAnCrC,OAmCqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnC,YAAY,MAAM;AAChB,UAAM,IAAI;AACV,SAAK,KAAK,KAAK;AACf,SAAK,OAAO,KAAK;AACjB,SAAK,OAAO,KAAK;AACjB,SAAK,gBAAgB,KAAK;AAC1B,SAAK,eAAe,KAAK;AACzB,QAAI,KAAK,gBAAgB,OAAW,MAAK,cAAc,KAAK;AAC5D,QAAI,KAAK,oBAAoB;AAC3B,WAAK,kBAAkB,KAAK;AAC9B,QAAI,KAAK,aAAa,OAAW,MAAK,WAAW,KAAK;AACtD,SAAK,WAAW,KAAK;AACrB,QAAI,KAAK,cAAc,OAAW,MAAK,YAAY,KAAK;AACxD,QAAI,KAAK,gBAAgB,OAAW,MAAK,cAAc,KAAK;AAC5D,QAAI,KAAK,SAAS,OAAW,MAAK,OAAO,KAAK;AAC9C,QAAI,KAAK,gBAAgB,OAAW,MAAK,cAAc,KAAK;AAC5D,QAAI,KAAK,iBAAiB,OAAW,MAAK,eAAe,KAAK;AAC9D,QAAI,KAAK,YAAY,OAAW,MAAK,UAAU,KAAK;AACpD,QAAI,KAAK,aAAa,OAAW,MAAK,WAAW,KAAK;AACtD,QAAI,KAAK,cAAc,OAAW,MAAK,YAAY,KAAK;AACxD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OAAO;AAAA,kBACL,MAAM;AAAA,kBACN,MAAM;AAAA,oBACJ;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,kBACF;AAAA,gBACF;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,sBAAsB;AAAA,QACtB,SAAS,EAAE,aAAa,CAAC,EAAE;AAAA,MAC7B;AAAA,MACA,eAAe;AAAA,QACb,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM;AAAA,YACN,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,EAAE;AAAA,YAC3C,sBAAsB;AAAA,UACxB;AAAA,UACA,KAAK;AAAA,YACH,MAAM;AAAA,YACN,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,EAAE;AAAA,YAC3C,sBAAsB;AAAA,UACxB;AAAA,UACA,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,EAAE;AAAA,YAC3C,sBAAsB;AAAA,UACxB;AAAA,QACF;AAAA,QACA,sBAAsB;AAAA,QACtB,SAAS;AAAA,UACP,OAAO,EAAE,SAAS,MAAM;AAAA,UACxB,KAAK,EAAE,SAAS,MAAM;AAAA,UACtB,MAAM,EAAE,SAAS,MAAM;AAAA,QACzB;AAAA,MACF;AAAA,MACA,aAAa,EAAE,MAAM,UAAU,sBAAsB,KAAK;AAAA,IAC5D;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,SAAS,WAAW,aAAa;AAAA,EACrD,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateDeviceRouter}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var DeviceRouter=class extends Entity{static{__name(this,"DeviceRouter")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),void 0!==data.type&&(this.type=data.type),this.driver=data.driver,this.organizationId=data.organizationId,void 0!==data.devices&&(this.devices=data.devices)}};Object.defineProperty(DeviceRouter.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"deviceRouter.json",title:"Device Router",description:"A device router contains instructions on where to route devices based on their organization and driver.",type:"object",required:["driver","organizationId"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",default:"deviceRouter",enum:["deviceRouter"]},driver:{type:"string"},organizationId:{type:["string","null"],description:"Reference (id) to the organization that owns this router"},devices:{type:"object",additionalProperties:!0}}}}),Object.defineProperty(DeviceRouter.prototype,"validator",{get:__name(function(){return validateDeviceRouter},"get")});export{DeviceRouter};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateDeviceRouter}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var DeviceRouter=class extends Entity{static{__name(this,"DeviceRouter")}constructor(data){super(data),void 0!==data.id&&(this.id=data.id),void 0!==data.type&&(this.type=data.type),this.driver=data.driver,this.organizationId=data.organizationId,void 0!==data.devices&&(this.devices=data.devices)}};Object.defineProperty(DeviceRouter.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"deviceRouter.json",title:"Device Router",description:"A device router contains instructions on where to route devices based on their organization and driver.",type:"object",required:["driver","organizationId"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},type:{type:"string",default:"deviceRouter",enum:["deviceRouter"]},driver:{type:"string"},organizationId:{type:["string","null"],description:"Reference (id) to the organization that owns this router"},devices:{type:"object",additionalProperties:!0}}}}),Object.defineProperty(DeviceRouter.prototype,"validator",{get:__name(function(){return validateDeviceRouter},"get")});export{DeviceRouter};//# sourceMappingURL=chunk-BDSQQ6HP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/deviceRouter.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateDeviceRouter as validate } from \"../validate\";\n\n/**\n * @typedef {Object} DeviceRouterData A device router contains instructions on where to route devices based on their organization and driver.\n * @property {string} [id] - Identifier of the object.\n * @property {\"deviceRouter\"} [type] - Default: \"deviceRouter\"\n * @property {string} driver\n * @property {(string|null)} organizationId - Reference (id) to the organization that owns this router\n * @property {object} [devices]\n */\n\n/**\n * A device router contains instructions on where to route devices based on their organization and driver.\n * @class DeviceRouter\n * @extends {Entity}\n */\nexport class DeviceRouter extends Entity {\n /**\n * @constructor\n * @param {DeviceRouterData} data - The data to initialize the DeviceRouter with\n */\n constructor(data) {\n super(data);\n if (data.id !== undefined) this.id = data.id;\n if (data.type !== undefined) this.type = data.type;\n this.driver = data.driver;\n this.organizationId = data.organizationId;\n if (data.devices !== undefined) this.devices = data.devices;\n }\n}\n\nObject.defineProperty(DeviceRouter.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"deviceRouter.json\",\n title: \"Device Router\",\n description:\n \"A device router contains instructions on where to route devices based on their organization and driver.\",\n type: \"object\",\n required: [\"driver\", \"organizationId\"],\n additionalProperties: false,\n properties: {\n id: { $ref: \"definitions.json#/definitions/id\" },\n type: { type: \"string\", default: \"deviceRouter\", enum: [\"deviceRouter\"] },\n driver: { type: \"string\" },\n organizationId: {\n type: [\"string\", \"null\"],\n description: \"Reference (id) to the organization that owns this router\",\n },\n devices: { type: \"object\", additionalProperties: true },\n },\n },\n});\n\nObject.defineProperty(DeviceRouter.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AAoBO,IAAM,eAAN,cAA2B,OAAO;AAAA,EApBzC,OAoByC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKvC,YAAY,MAAM;AAChB,UAAM,IAAI;AACV,QAAI,KAAK,OAAO,OAAW,MAAK,KAAK,KAAK;AAC1C,QAAI,KAAK,SAAS,OAAW,MAAK,OAAO,KAAK;AAC9C,SAAK,SAAS,KAAK;AACnB,SAAK,iBAAiB,KAAK;AAC3B,QAAI,KAAK,YAAY,OAAW,MAAK,UAAU,KAAK;AAAA,EACtD;AACF;AAEA,OAAO,eAAe,aAAa,WAAW,UAAU;AAAA,EACtD,OAAO;AAAA,IACL,SAAS;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,IACP,aACE;AAAA,IACF,MAAM;AAAA,IACN,UAAU,CAAC,UAAU,gBAAgB;AAAA,IACrC,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,IAAI,EAAE,MAAM,mCAAmC;AAAA,MAC/C,MAAM,EAAE,MAAM,UAAU,SAAS,gBAAgB,MAAM,CAAC,cAAc,EAAE;AAAA,MACxE,QAAQ,EAAE,MAAM,SAAS;AAAA,MACzB,gBAAgB;AAAA,QACd,MAAM,CAAC,UAAU,MAAM;AAAA,QACvB,aAAa;AAAA,MACf;AAAA,MACA,SAAS,EAAE,MAAM,UAAU,sBAAsB,KAAK;AAAA,IACxD;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,aAAa,WAAW,aAAa;AAAA,EACzD,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SystemPropertyUpdated}from"./chunk-TXM6UAL7.js";import{SystemReservationUpdated}from"./chunk-IAAWIPRL.js";import{SystemSpaceUpdated}from"./chunk-XJTVR2N6.js";import{SystemSwitchUpdated}from"./chunk-Q6DULDGC.js";import{SystemThermostatUpdated}from"./chunk-6WMLZZ2S.js";import{SystemUserUpdated}from"./chunk-LL7JQZ22.js";import{SystemWindowCoveringUpdated}from"./chunk-3EFKTRVA.js";import{SystemDimmerUpdated}from"./chunk-WTHRQ7HY.js";import{SystemEntityDeleted}from"./chunk-3FWQCAHI.js";import{SystemGatewayUpdated}from"./chunk-WN55GEEA.js";import{SystemLockUpdated}from"./chunk-NPU3HOLY.js";import{SystemMediaSourceUpdated}from"./chunk-77ZRNQNC.js";import{SystemMotionSensorUpdated}from"./chunk-QA3JZFE6.js";import{SystemOrganizationUpdated}from"./chunk-XGMNXP5O.js";import{SystemProductUpdated}from"./chunk-2RWKPJ7X.js";import{SceneSet}from"./chunk-AFFBNWED.js";import{ShortLinkCreated}from"./chunk-RDORBZXU.js";import{SMSEvent}from"./chunk-PDC7GVYH.js";import{SystemAlarmUpdated}from"./chunk-MXEHDVPA.js";import{SystemCameraUpdated}from"./chunk-UGU6VADU.js";import{SystemCategoryUpdated}from"./chunk-UPJNM24X.js";import{SystemCourtesyUpdated}from"./chunk-F3OYDT5G.js";import{SystemCredentialUpdated}from"./chunk-OTCZ5EYP.js";import{ApplicationInUse}from"./chunk-77HBMMF6.js";import{ApplicationOutOfUse}from"./chunk-2QUVPJGQ.js";import{EmailEvent}from"./chunk-WIOEN43A.js";import{ReservationCheckedIn}from"./chunk-DKN6VMLC.js";import{ReservationCheckedOut}from"./chunk-ASWG7NGL.js";import{ReservationSpaceChanged}from"./chunk-YV5A37JB.js";import{Event}from"./chunk-OJ3NRGG4.js";import{__export}from"./chunk-XE4OXN2W.js";var events_exports={};__export(events_exports,{ApplicationInUse:()=>ApplicationInUse,ApplicationOutOfUse:()=>ApplicationOutOfUse,EmailEvent:()=>EmailEvent,Event:()=>Event,ReservationCheckedIn:()=>ReservationCheckedIn,ReservationCheckedOut:()=>ReservationCheckedOut,ReservationSpaceChanged:()=>ReservationSpaceChanged,SMSEvent:()=>SMSEvent,SceneSet:()=>SceneSet,ShortLinkCreated:()=>ShortLinkCreated,SystemAlarmUpdated:()=>SystemAlarmUpdated,SystemCameraUpdated:()=>SystemCameraUpdated,SystemCategoryUpdated:()=>SystemCategoryUpdated,SystemCourtesyUpdated:()=>SystemCourtesyUpdated,SystemCredentialUpdated:()=>SystemCredentialUpdated,SystemDimmerUpdated:()=>SystemDimmerUpdated,SystemEntityDeleted:()=>SystemEntityDeleted,SystemGatewayUpdated:()=>SystemGatewayUpdated,SystemLockUpdated:()=>SystemLockUpdated,SystemMediaSourceUpdated:()=>SystemMediaSourceUpdated,SystemMotionSensorUpdated:()=>SystemMotionSensorUpdated,SystemOrganizationUpdated:()=>SystemOrganizationUpdated,SystemProductUpdated:()=>SystemProductUpdated,SystemPropertyUpdated:()=>SystemPropertyUpdated,SystemReservationUpdated:()=>SystemReservationUpdated,SystemSpaceUpdated:()=>SystemSpaceUpdated,SystemSwitchUpdated:()=>SystemSwitchUpdated,SystemThermostatUpdated:()=>SystemThermostatUpdated,SystemUserUpdated:()=>SystemUserUpdated,SystemWindowCoveringUpdated:()=>SystemWindowCoveringUpdated});export{events_exports};//# sourceMappingURL=chunk-
|
|
1
|
+
import{SystemPropertyUpdated}from"./chunk-TXM6UAL7.js";import{SystemReservationUpdated}from"./chunk-IAAWIPRL.js";import{SystemSpaceUpdated}from"./chunk-XJTVR2N6.js";import{SystemSwitchUpdated}from"./chunk-Q6DULDGC.js";import{SystemThermostatUpdated}from"./chunk-6WMLZZ2S.js";import{SystemUserUpdated}from"./chunk-LL7JQZ22.js";import{SystemWindowCoveringUpdated}from"./chunk-3EFKTRVA.js";import{SystemDimmerUpdated}from"./chunk-WTHRQ7HY.js";import{SystemEntityDeleted}from"./chunk-3FWQCAHI.js";import{SystemGatewayUpdated}from"./chunk-WN55GEEA.js";import{SystemLockUpdated}from"./chunk-NPU3HOLY.js";import{SystemMediaSourceUpdated}from"./chunk-77ZRNQNC.js";import{SystemMotionSensorUpdated}from"./chunk-QA3JZFE6.js";import{SystemOrganizationUpdated}from"./chunk-XGMNXP5O.js";import{SystemProductUpdated}from"./chunk-2RWKPJ7X.js";import{SceneSet}from"./chunk-AFFBNWED.js";import{ShortLinkCreated}from"./chunk-RDORBZXU.js";import{SMSEvent}from"./chunk-PDC7GVYH.js";import{SystemAlarmUpdated}from"./chunk-MXEHDVPA.js";import{SystemCameraUpdated}from"./chunk-UGU6VADU.js";import{SystemCategoryUpdated}from"./chunk-UPJNM24X.js";import{SystemCourtesyUpdated}from"./chunk-F3OYDT5G.js";import{SystemCredentialUpdated}from"./chunk-OTCZ5EYP.js";import{ApplicationInUse}from"./chunk-77HBMMF6.js";import{ApplicationOutOfUse}from"./chunk-2QUVPJGQ.js";import{EmailEvent}from"./chunk-WIOEN43A.js";import{ReservationCheckedIn}from"./chunk-DKN6VMLC.js";import{ReservationCheckedOut}from"./chunk-ASWG7NGL.js";import{ReservationSpaceChanged}from"./chunk-YV5A37JB.js";import{Event}from"./chunk-OJ3NRGG4.js";import{__export}from"./chunk-XE4OXN2W.js";var events_exports={};__export(events_exports,{ApplicationInUse:()=>ApplicationInUse,ApplicationOutOfUse:()=>ApplicationOutOfUse,EmailEvent:()=>EmailEvent,Event:()=>Event,ReservationCheckedIn:()=>ReservationCheckedIn,ReservationCheckedOut:()=>ReservationCheckedOut,ReservationSpaceChanged:()=>ReservationSpaceChanged,SMSEvent:()=>SMSEvent,SceneSet:()=>SceneSet,ShortLinkCreated:()=>ShortLinkCreated,SystemAlarmUpdated:()=>SystemAlarmUpdated,SystemCameraUpdated:()=>SystemCameraUpdated,SystemCategoryUpdated:()=>SystemCategoryUpdated,SystemCourtesyUpdated:()=>SystemCourtesyUpdated,SystemCredentialUpdated:()=>SystemCredentialUpdated,SystemDimmerUpdated:()=>SystemDimmerUpdated,SystemEntityDeleted:()=>SystemEntityDeleted,SystemGatewayUpdated:()=>SystemGatewayUpdated,SystemLockUpdated:()=>SystemLockUpdated,SystemMediaSourceUpdated:()=>SystemMediaSourceUpdated,SystemMotionSensorUpdated:()=>SystemMotionSensorUpdated,SystemOrganizationUpdated:()=>SystemOrganizationUpdated,SystemProductUpdated:()=>SystemProductUpdated,SystemPropertyUpdated:()=>SystemPropertyUpdated,SystemReservationUpdated:()=>SystemReservationUpdated,SystemSpaceUpdated:()=>SystemSpaceUpdated,SystemSwitchUpdated:()=>SystemSwitchUpdated,SystemThermostatUpdated:()=>SystemThermostatUpdated,SystemUserUpdated:()=>SystemUserUpdated,SystemWindowCoveringUpdated:()=>SystemWindowCoveringUpdated});export{events_exports};//# sourceMappingURL=chunk-BHKQEUCN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/events/index.js"],"sourcesContent":["// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-11-
|
|
1
|
+
{"version":3,"sources":["../src/events/index.js"],"sourcesContent":["// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-11-05T14:27:49.884Z\n\nexport * from \"./applicationInUse\";\nexport * from \"./applicationOutOfUse\";\nexport * from \"./emailEvent\";\nexport * from \"./event\";\nexport * from \"./reservationCheckedIn\";\nexport * from \"./reservationCheckedOut\";\nexport * from \"./reservationSpaceChanged\";\nexport * from \"./sceneSet\";\nexport * from \"./shortLinkCreated\";\nexport * from \"./smsEvent\";\nexport * from \"./systemAlarmUpdated\";\nexport * from \"./systemCameraUpdated\";\nexport * from \"./systemCategoryUpdated\";\nexport * from \"./systemCourtesyUpdated\";\nexport * from \"./systemCredentialUpdated\";\nexport * from \"./systemDimmerUpdated\";\nexport * from \"./systemEntityDeleted\";\nexport * from \"./systemGatewayUpdated\";\nexport * from \"./systemLockUpdated\";\nexport * from \"./systemMediaSourceUpdated\";\nexport * from \"./systemMotionSensorUpdated\";\nexport * from \"./systemOrganizationUpdated\";\nexport * from \"./systemProductUpdated\";\nexport * from \"./systemPropertyUpdated\";\nexport * from \"./systemReservationUpdated\";\nexport * from \"./systemSpaceUpdated\";\nexport * from \"./systemSwitchUpdated\";\nexport * from \"./systemThermostatUpdated\";\nexport * from \"./systemUserUpdated\";\nexport * from \"./systemWindowCoveringUpdated\";"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateSystem}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var System=class extends Entity{static{__name(this,"System")}constructor(data){super(data),this.id=data.id,this.type=data.type,void 0!==data.name&&(this.name=data.name),this.driver=data.driver,void 0!==data.organizationId&&(this.organizationId=data.organizationId),void 0!==data.propertyId&&(this.propertyId=data.propertyId),this.entities=data.entities,void 0!==data.driverApiVersion&&(this.driverApiVersion=data.driverApiVersion),void 0!==data.logo&&(this.logo=data.logo),void 0!==data.config&&(this.config=data.config),void 0!==data.contactInfo&&(this.contactInfo=data.contactInfo),void 0!==data.health&&(this.health=data.health),void 0!==data.createdAt&&(this.createdAt=data.createdAt),void 0!==data.updatedAt&&(this.updatedAt=data.updatedAt),void 0!==data.deletedAt&&(this.deletedAt=data.deletedAt)}};Object.defineProperty(System.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"system.json",title:"System",type:"object",required:["id","type","driver","entities"],properties:{id:{type:"string"},type:{type:"string",default:"system",enum:["system"]},name:{type:"string"},driver:{$ref:"definitions.json#/definitions/driver",example:"salto",description:"The driver value that implements the system"},organizationId:{type:"string",description:"The id of the organization that uses the system"},propertyId:{type:"string",description:"The id of the property that uses the system"},entities:{type:"array",description:"The entities produced by the system",default:[],items:{type:"object",required:["systemId"],properties:{id:{type:"string",description:"The id of the entity"},systemId:{type:"string",description:"The id of the entity as known by the system"},type:{type:"string",description:"The type of the entity"},discriminator:{type:"string",description:"The discriminator of the entity"},propertyIds:{type:"array",description:"The ids of the properties where the entity is located",items:{type:"string"}}}}},driverApiVersion:{type:"string",description:"The version of the driver API used by the system"},logo:{$ref:"mediaFile.json#"},config:{type:"object",additionalProperties:!0,description:"The runtime configuration of the system"},contactInfo:{type:"object",additionalProperties:!1,properties:{websiteUrl:{type:"string",description:"The website URL of the system"},email:{type:"string",description:"The email address of the system"},phone:{type:"string",description:"The phone number of the system"},itunesAppId:{type:"string",example:"807316865"},googleAppId:{type:"string",example:"tw.com.geovision.gvaccesscontrol"}}},health:{type:"object",properties:{lastHeartbeatAt:{type:"string",description:"The date and time of the last communication with the system",format:"date-time"}}},createdAt:{$ref:"definitions.json#/definitions/createdAt"},updatedAt:{$ref:"definitions.json#/definitions/updatedAt"},deletedAt:{$ref:"definitions.json#/definitions/date"}}}}),Object.defineProperty(System.prototype,"validator",{get:__name(function(){return validateSystem},"get")});export{System};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateSystem}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var System=class extends Entity{static{__name(this,"System")}constructor(data){super(data),this.id=data.id,this.type=data.type,void 0!==data.name&&(this.name=data.name),this.driver=data.driver,void 0!==data.organizationId&&(this.organizationId=data.organizationId),void 0!==data.propertyId&&(this.propertyId=data.propertyId),this.entities=data.entities,void 0!==data.driverApiVersion&&(this.driverApiVersion=data.driverApiVersion),void 0!==data.logo&&(this.logo=data.logo),void 0!==data.config&&(this.config=data.config),void 0!==data.contactInfo&&(this.contactInfo=data.contactInfo),void 0!==data.health&&(this.health=data.health),void 0!==data.createdAt&&(this.createdAt=data.createdAt),void 0!==data.updatedAt&&(this.updatedAt=data.updatedAt),void 0!==data.deletedAt&&(this.deletedAt=data.deletedAt)}};Object.defineProperty(System.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"system.json",title:"System",type:"object",required:["id","type","driver","entities"],properties:{id:{type:"string"},type:{type:"string",default:"system",enum:["system"]},name:{type:"string"},driver:{$ref:"definitions.json#/definitions/driver",example:"salto",description:"The driver value that implements the system"},organizationId:{type:"string",description:"The id of the organization that uses the system"},propertyId:{type:"string",description:"The id of the property that uses the system"},entities:{type:"array",description:"The entities produced by the system",default:[],items:{type:"object",required:["systemId"],properties:{id:{type:"string",description:"The id of the entity"},systemId:{type:"string",description:"The id of the entity as known by the system"},type:{type:"string",description:"The type of the entity"},discriminator:{type:"string",description:"The discriminator of the entity"},propertyIds:{type:"array",description:"The ids of the properties where the entity is located",items:{type:"string"}}}}},driverApiVersion:{type:"string",description:"The version of the driver API used by the system"},logo:{$ref:"mediaFile.json#"},config:{type:"object",additionalProperties:!0,description:"The runtime configuration of the system"},contactInfo:{type:"object",additionalProperties:!1,properties:{websiteUrl:{type:"string",description:"The website URL of the system"},email:{type:"string",description:"The email address of the system"},phone:{type:"string",description:"The phone number of the system"},itunesAppId:{type:"string",example:"807316865"},googleAppId:{type:"string",example:"tw.com.geovision.gvaccesscontrol"}}},health:{type:"object",properties:{lastHeartbeatAt:{type:"string",description:"The date and time of the last communication with the system",format:"date-time"}}},createdAt:{$ref:"definitions.json#/definitions/createdAt"},updatedAt:{$ref:"definitions.json#/definitions/updatedAt"},deletedAt:{$ref:"definitions.json#/definitions/date"}}}}),Object.defineProperty(System.prototype,"validator",{get:__name(function(){return validateSystem},"get")});export{System};//# sourceMappingURL=chunk-BSJSKTKW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/system.js"],"sourcesContent":["/* @ts-nocheck */\n/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity\";\nimport { validateSystem as validate } from \"../validate\";\n\n/**\n * @typedef {Object} SystemData\n * @property {string} id\n * @property {\"system\"} type - Default: \"system\"\n * @property {string} [name]\n * @property {(\"adlink\"|\"aws-kinesis\"|\"bacnet\"|\"benq\"|\"butler\"|\"comelit\"|\"crestron\"|\"dell\"|\"digital-watchdog\"|\"distech\"|\"dmp\"|\"doorbird\"|\"dormakaba\"|\"dsc\"|\"ecobee\"|\"epson\"|\"geovision-rs\"|\"geovision-as-manager\"|\"honeywell-vista\"|\"igor\"|\"inncom\"|\"isapi\"|\"kohost-k7\"|\"kohost\"|\"lg\"|\"lg-webos\"|\"lapi\"|\"lirc\"|\"mews\"|\"mht\"|\"newline\"|\"paxton\"|\"pelican-wireless\"|\"power-shades\"|\"rachio\"|\"rebrandly\"|\"relay\"|\"rtsp\"|\"salto\"|\"salto-irn\"|\"samsung\"|\"se\"|\"sendgrid\"|\"smartboard\"|\"sonifi\"|\"stay-n-touch\"|\"storable\"|\"twilio\"|\"unifi\"|\"valcom\"|\"veracross\"|\"vivotek\"|\"vizio\"|\"wisenet\"|\"cloudflare-images\"|\"cloudflare-stream\"|\"insperia-privacy\")} driver - Driver used to communicate with the object.. The driver value that implements the system\n * @property {string} [organizationId] - The id of the organization that uses the system\n * @property {string} [propertyId] - The id of the property that uses the system\n * @property {{id?: string, systemId: string, type?: string, discriminator?: string, propertyIds?: string[]}[]} entities - The entities produced by the system. Default: []\n * @property {string} [driverApiVersion] - The version of the driver API used by the system\n * @property {{id?: string, type: \"mediaFile\", name?: string, fileHash?: string, category?: string, mimeType?: (\"image/*\"|\"image/jpeg\"|\"image/png\"|\"image/gif\"|\"image/webp\"|\"image/avif\"|\"image/svg+xml\"|\"application/pdf\"), data?: string, url?: string, width?: number, height?: number, size?: number, uploadUrl?: string, uploadUrlExpires?: (string|object), createdBy?: string, systemId?: string, createdAt?: (string|object), updatedAt?: (string|object), deletedAt?: (string|object)}} [logo] - Any media file\n * @property {object} [config] - The runtime configuration of the system\n * @property {{websiteUrl?: string, email?: string, phone?: string, itunesAppId?: string, googleAppId?: string}} [contactInfo]\n * @property {{lastHeartbeatAt?: string}} [health]\n * @property {(string|object)} [createdAt]\n * @property {(string|object)} [updatedAt]\n * @property {(string|object)} [deletedAt]\n */\n\n/**\n *\n * @class System\n * @extends {Entity}\n */\nexport class System extends Entity {\n /**\n * @constructor\n * @param {SystemData} data - The data to initialize the System with\n */\n constructor(data) {\n super(data);\n this.id = data.id;\n this.type = data.type;\n if (data.name !== undefined) this.name = data.name;\n this.driver = data.driver;\n if (data.organizationId !== undefined)\n this.organizationId = data.organizationId;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n this.entities = data.entities;\n if (data.driverApiVersion !== undefined)\n this.driverApiVersion = data.driverApiVersion;\n if (data.logo !== undefined) this.logo = data.logo;\n if (data.config !== undefined) this.config = data.config;\n if (data.contactInfo !== undefined) this.contactInfo = data.contactInfo;\n if (data.health !== undefined) this.health = data.health;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n }\n}\n\nObject.defineProperty(System.prototype, \"schema\", {\n value: {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"system.json\",\n title: \"System\",\n type: \"object\",\n required: [\"id\", \"type\", \"driver\", \"entities\"],\n properties: {\n id: { type: \"string\" },\n type: { type: \"string\", default: \"system\", enum: [\"system\"] },\n name: { type: \"string\" },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n example: \"salto\",\n description: \"The driver value that implements the system\",\n },\n organizationId: {\n type: \"string\",\n description: \"The id of the organization that uses the system\",\n },\n propertyId: {\n type: \"string\",\n description: \"The id of the property that uses the system\",\n },\n entities: {\n type: \"array\",\n description: \"The entities produced by the system\",\n default: [],\n items: {\n type: \"object\",\n required: [\"systemId\"],\n properties: {\n id: { type: \"string\", description: \"The id of the entity\" },\n systemId: {\n type: \"string\",\n description: \"The id of the entity as known by the system\",\n },\n type: { type: \"string\", description: \"The type of the entity\" },\n discriminator: {\n type: \"string\",\n description: \"The discriminator of the entity\",\n },\n propertyIds: {\n type: \"array\",\n description:\n \"The ids of the properties where the entity is located\",\n items: { type: \"string\" },\n },\n },\n },\n },\n driverApiVersion: {\n type: \"string\",\n description: \"The version of the driver API used by the system\",\n },\n logo: { $ref: \"mediaFile.json#\" },\n config: {\n type: \"object\",\n additionalProperties: true,\n description: \"The runtime configuration of the system\",\n },\n contactInfo: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n websiteUrl: {\n type: \"string\",\n description: \"The website URL of the system\",\n },\n email: {\n type: \"string\",\n description: \"The email address of the system\",\n },\n phone: {\n type: \"string\",\n description: \"The phone number of the system\",\n },\n itunesAppId: { type: \"string\", example: \"807316865\" },\n googleAppId: {\n type: \"string\",\n example: \"tw.com.geovision.gvaccesscontrol\",\n },\n },\n },\n health: {\n type: \"object\",\n properties: {\n lastHeartbeatAt: {\n type: \"string\",\n description:\n \"The date and time of the last communication with the system\",\n format: \"date-time\",\n },\n },\n },\n createdAt: { $ref: \"definitions.json#/definitions/createdAt\" },\n updatedAt: { $ref: \"definitions.json#/definitions/updatedAt\" },\n deletedAt: { $ref: \"definitions.json#/definitions/date\" },\n },\n },\n});\n\nObject.defineProperty(System.prototype, \"validator\", {\n get: function () {\n return validate;\n },\n});\n"],"mappings":";;;;;;;;;;;AA8BO,IAAM,SAAN,cAAqB,OAAO;AAAA,EA9BnC,OA8BmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjC,YAAY,MAAM;AAChB,UAAM,IAAI;AACV,SAAK,KAAK,KAAK;AACf,SAAK,OAAO,KAAK;AACjB,QAAI,KAAK,SAAS,OAAW,MAAK,OAAO,KAAK;AAC9C,SAAK,SAAS,KAAK;AACnB,QAAI,KAAK,mBAAmB;AAC1B,WAAK,iBAAiB,KAAK;AAC7B,QAAI,KAAK,eAAe,OAAW,MAAK,aAAa,KAAK;AAC1D,SAAK,WAAW,KAAK;AACrB,QAAI,KAAK,qBAAqB;AAC5B,WAAK,mBAAmB,KAAK;AAC/B,QAAI,KAAK,SAAS,OAAW,MAAK,OAAO,KAAK;AAC9C,QAAI,KAAK,WAAW,OAAW,MAAK,SAAS,KAAK;AAClD,QAAI,KAAK,gBAAgB,OAAW,MAAK,cAAc,KAAK;AAC5D,QAAI,KAAK,WAAW,OAAW,MAAK,SAAS,KAAK;AAClD,QAAI,KAAK,cAAc,OAAW,MAAK,YAAY,K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f;AAAA,MACA,MAAM,EAAE,MAAM,kBAAkB;AAAA,MAChC,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,sBAAsB;AAAA,QACtB,aAAa;AAAA,MACf;AAAA,MACA,aAAa;AAAA,QACX,MAAM;AAAA,QACN,sBAAsB;AAAA,QACtB,YAAY;AAAA,UACV,YAAY;AAAA,YACV,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,UACA,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,UACA,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aAAa;AAAA,UACf;AAAA,UACA,aAAa,EAAE,MAAM,UAAU,SAAS,YAAY;AAAA,UACpD,aAAa;AAAA,YACX,MAAM;AAAA,YACN,SAAS;AAAA,UACX;AAAA,QACF;AAAA,MACF;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,YAAY;AAAA,UACV,iBAAiB;AAAA,YACf,MAAM;AAAA,YACN,aACE;AAAA,YACF,QAAQ;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,MACA,WAAW,EAAE,MAAM,0CAA0C;AAAA,MAC7D,WAAW,EAAE,MAAM,0CAA0C;AAAA,MAC7D,WAAW,EAAE,MAAM,qCAAqC;AAAA,IAC1D;AAAA,EACF;AACF,CAAC;AAED,OAAO,eAAe,OAAO,WAAW,aAAa;AAAA,EACnD,KAAK,kCAAY;AACf,WAAO;AAAA,EACT,GAFK;AAGP,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validateAlarm}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Alarm=class extends Entity{static{__name(this,"Alarm")}constructor(data){super(data),this.id=data.id,void 0!==data.name&&(this.name=data.name),void 0!==data.offline&&(this.offline=data.offline),this.type=data.type,void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.supportedNotifications&&(this.supportedNotifications=data.supportedNotifications),void 0!==data.notification&&(this.notification=data.notification),this.driver=data.driver,this.areas=data.areas,this.zones=data.zones,void 0!==data.chime&&(this.chime=data.chime),void 0!==data.watts&&(this.watts=data.watts),void 0!==data.icon&&(this.icon=data.icon),void 0!==data.manufacturer&&(this.manufacturer=data.manufacturer),void 0!==data.modelNumber&&(this.modelNumber=data.modelNumber),void 0!==data.serialNumber&&(this.serialNumber=data.serialNumber),void 0!==data.firmwareVersion&&(this.firmwareVersion=data.firmwareVersion),void 0!==data.address&&(this.address=data.address)}};Object.defineProperty(Alarm.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"alarm.json",title:"Alarm",description:"Any smart alarm system",type:"object",required:["id","type","areas","zones","driver"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},name:{type:"string",description:"Name of the alarm"},offline:{type:"boolean"},type:{type:"string",enum:["alarm"],default:"alarm"},systemId:{$ref:"definitions.json#/definitions/systemId"},supportedNotifications:{$ref:"definitions.json#/definitions/supportedNotifications"},notification:{$ref:"definitions.json#/definitions/notification"},driver:{$ref:"definitions.json#/definitions/driver"},areas:{type:"array",items:{type:"object",properties:{number:{type:"number"},name:{type:"string"},securityMode:{type:["string","null"],enum:["arming","disarming","armed","disarmed","alarm",null]}},additionalProperties:!1}},zones:{type:"array",items:{type:"object",properties:{number:{type:"number",minimum:0},name:{type:"string"},secure:{type:["boolean","null"]},bypassed:{type:["boolean","null"]}},additionalProperties:!1}},chime:{type:"boolean",description:"Reflects whether console chime is enabled"},watts:{$ref:"definitions.json#/definitions/watts"},icon:{type:"string"},manufacturer:{type:"string"},modelNumber:{type:"string"},serialNumber:{type:"string"},firmwareVersion:{type:"string"},address:{$ref:"definitions.json#/definitions/address"}}}}),Object.defineProperty(Alarm.prototype,"validator",{get:__name(function(){return validateAlarm},"get")});export{Alarm};//# sourceMappingURL=chunk-
|
|
1
|
+
import{validateAlarm}from"./chunk-OX6FTZ5L.js";import{Entity}from"./chunk-YPJMXYGL.js";import{__name}from"./chunk-XE4OXN2W.js";var Alarm=class extends Entity{static{__name(this,"Alarm")}constructor(data){super(data),this.id=data.id,void 0!==data.name&&(this.name=data.name),void 0!==data.offline&&(this.offline=data.offline),this.type=data.type,void 0!==data.systemId&&(this.systemId=data.systemId),void 0!==data.supportedNotifications&&(this.supportedNotifications=data.supportedNotifications),void 0!==data.notification&&(this.notification=data.notification),this.driver=data.driver,this.areas=data.areas,this.zones=data.zones,void 0!==data.chime&&(this.chime=data.chime),void 0!==data.watts&&(this.watts=data.watts),void 0!==data.icon&&(this.icon=data.icon),void 0!==data.manufacturer&&(this.manufacturer=data.manufacturer),void 0!==data.modelNumber&&(this.modelNumber=data.modelNumber),void 0!==data.serialNumber&&(this.serialNumber=data.serialNumber),void 0!==data.firmwareVersion&&(this.firmwareVersion=data.firmwareVersion),void 0!==data.address&&(this.address=data.address)}};Object.defineProperty(Alarm.prototype,"schema",{value:{$schema:"http://json-schema.org/draft-07/schema",$id:"alarm.json",title:"Alarm",description:"Any smart alarm system",type:"object",required:["id","type","areas","zones","driver"],additionalProperties:!1,properties:{id:{$ref:"definitions.json#/definitions/id"},name:{type:"string",description:"Name of the alarm"},offline:{type:"boolean"},type:{type:"string",enum:["alarm"],default:"alarm"},systemId:{$ref:"definitions.json#/definitions/systemId"},supportedNotifications:{$ref:"definitions.json#/definitions/supportedNotifications"},notification:{$ref:"definitions.json#/definitions/notification"},driver:{$ref:"definitions.json#/definitions/driver"},areas:{type:"array",items:{type:"object",properties:{number:{type:"number"},name:{type:"string"},securityMode:{type:["string","null"],enum:["arming","disarming","armed","disarmed","alarm",null]}},additionalProperties:!1}},zones:{type:"array",items:{type:"object",properties:{number:{type:"number",minimum:0},name:{type:"string"},secure:{type:["boolean","null"]},bypassed:{type:["boolean","null"]}},additionalProperties:!1}},chime:{type:"boolean",description:"Reflects whether console chime is enabled"},watts:{$ref:"definitions.json#/definitions/watts"},icon:{type:"string"},manufacturer:{type:"string"},modelNumber:{type:"string"},serialNumber:{type:"string"},firmwareVersion:{type:"string"},address:{$ref:"definitions.json#/definitions/address"}}}}),Object.defineProperty(Alarm.prototype,"validator",{get:__name(function(){return validateAlarm},"get")});export{Alarm};//# sourceMappingURL=chunk-C5BVAUUD.js.map
|