@kohost/api-client 4.0.12 → 4.0.13

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/events/index.js","../src/defs.js","../src/events/event.js","../src/events/applicationInUse.js","../src/events/applicationOutOfUse.js","../src/events/emailEvent.js","../src/events/reservationCheckedIn.js","../src/events/reservationCheckedOut.js","../src/events/reservationSpaceChanged.js","../src/events/sceneSet.js","../src/events/shortLinkCreated.js","../src/events/smsEvent.js","../src/events/systemAlarmUpdated.js","../src/events/systemCameraUpdated.js","../src/events/systemCategoryUpdated.js","../src/events/systemCourtesyUpdated.js","../src/events/systemCredentialUpdated.js","../src/events/systemDimmerUpdated.js","../src/events/systemEntityDeleted.js","../src/events/systemGatewayUpdated.js","../src/events/systemLockUpdated.js","../src/events/systemMediaSourceUpdated.js","../src/events/systemMotionSensorUpdated.js","../src/events/systemOrganizationUpdated.js","../src/events/systemProductUpdated.js","../src/events/systemPropertyUpdated.js","../src/events/systemReservationUpdated.js","../src/events/systemSpaceUpdated.js","../src/events/systemSwitchUpdated.js","../src/events/systemThermostatUpdated.js","../src/events/systemUserUpdated.js","../src/events/systemWindowCoveringUpdated.js"],"sourcesContent":["// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-01-23T15:31:20.558Z\n\nexport { ApplicationInUse } from \"./applicationInUse\";\nexport { ApplicationOutOfUse } from \"./applicationOutOfUse\";\nexport { EmailEvent } from \"./emailEvent\";\nexport { Event } from \"./event\";\nexport { ReservationCheckedIn } from \"./reservationCheckedIn\";\nexport { ReservationCheckedOut } from \"./reservationCheckedOut\";\nexport { ReservationSpaceChanged } from \"./reservationSpaceChanged\";\nexport { SceneSet } from \"./sceneSet\";\nexport { ShortLinkCreated } from \"./shortLinkCreated\";\nexport { SMSEvent } from \"./smsEvent\";\nexport { SystemAlarmUpdated } from \"./systemAlarmUpdated\";\nexport { SystemCameraUpdated } from \"./systemCameraUpdated\";\nexport { SystemCategoryUpdated } from \"./systemCategoryUpdated\";\nexport { SystemCourtesyUpdated } from \"./systemCourtesyUpdated\";\nexport { SystemCredentialUpdated } from \"./systemCredentialUpdated\";\nexport { SystemDimmerUpdated } from \"./systemDimmerUpdated\";\nexport { SystemEntityDeleted } from \"./systemEntityDeleted\";\nexport { SystemGatewayUpdated } from \"./systemGatewayUpdated\";\nexport { SystemLockUpdated } from \"./systemLockUpdated\";\nexport { SystemMediaSourceUpdated } from \"./systemMediaSourceUpdated\";\nexport { SystemMotionSensorUpdated } from \"./systemMotionSensorUpdated\";\nexport { SystemOrganizationUpdated } from \"./systemOrganizationUpdated\";\nexport { SystemProductUpdated } from \"./systemProductUpdated\";\nexport { SystemPropertyUpdated } from \"./systemPropertyUpdated\";\nexport { SystemReservationUpdated } from \"./systemReservationUpdated\";\nexport { SystemSpaceUpdate } from \"./systemSpaceUpdated\";\nexport { SystemSwitchUpdated } from \"./systemSwitchUpdated\";\nexport { SystemThermostatUpdated } from \"./systemThermostatUpdated\";\nexport { SystemUserUpdated } from \"./systemUserUpdated\";\nexport { SystemWindowCoveringUpdated } from \"./systemWindowCoveringUpdated\";","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","import { amqpExchanges } from \"../defs\";\n\nexport class Event {\n constructor(data, context = {}) {\n this.data = [];\n this.context = context;\n if (!data) throw new Error(\"Event data is required\");\n if (typeof data !== \"object\" && !Array.isArray(data))\n throw new Error(\"Event data must be an object or array\");\n\n if (!Array.isArray(data)) this.data = [data];\n else this.data = data;\n }\n\n get organizationId() {\n return this.context.organizationId || \"*\";\n }\n\n get propertyId() {\n return this.context.propertyId || \"*\";\n }\n\n static get type() {\n return \"Event\";\n }\n\n static get exchange() {\n return amqpExchanges.DriverEvents.name;\n }\n\n static get entity() {\n return \"\";\n }\n\n build() {\n return { data: { ...this.data } };\n }\n\n get routingKey() {\n return `${this.organizationId}.${this.propertyId}.${this.constructor.entity}.${this.constructor.name}`;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ApplicationInUse extends Event {\n constructor(data = {}, context) {\n super(data, context);\n }\n\n static get name() {\n return \"ApplicationInUse\";\n }\n\n static get entity() {\n return \"app\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ApplicationOutOfUse extends Event {\n constructor(data = {}, context = {}) {\n super(data, context);\n }\n\n static get name() {\n return \"ApplicationOutOfUse\";\n }\n\n static get entity() {\n return \"app\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { Event } from \"./event\";\n\nexport class EmailEvent extends Event {\n constructor(email, context) {\n super(email, context);\n }\n\n static get name() {\n return \"EmailEvent\";\n }\n\n static get entity() {\n return \"emailMessage\";\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ReservationCheckedIn extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"ReservationCheckedIn\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ReservationCheckedOut extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"ReservationCheckedOut\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ReservationSpaceChanged extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"ReservationSpaceChanged\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { Event } from \"./event\";\n\nexport class SceneSet extends Event {\n constructor(scene, context) {\n super(scene, context);\n }\n\n static get name() {\n return \"SceneSet\";\n }\n\n static get entity() {\n return \"scene\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class ShortLinkCreated extends Event {\n constructor(shortLink, context) {\n super(shortLink, context);\n }\n\n static get name() {\n return \"ShortLinkCreated\";\n }\n\n static get entity() {\n return \"shortLink\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SMSEvent extends Event {\n constructor(sms, context) {\n super(sms, context);\n }\n\n static get name() {\n return \"SMSEvent\";\n }\n\n static get entity() {\n return \"smsMessage\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemAlarmUpdated extends Event {\n constructor(alarm, context) {\n super(alarm, context);\n }\n\n static get name() {\n return \"SystemAlarmUpdated\";\n }\n\n static get entity() {\n return \"alarm\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCameraUpdated extends Event {\n constructor(camera, context) {\n super(camera, context);\n }\n\n static get name() {\n return \"SystemCameraUpdated\";\n }\n\n static get entity() {\n return \"camera\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCategoryUpdated extends Event {\n constructor(category, context) {\n super(category, context);\n }\n\n static get name() {\n return \"SystemCategoryUpdated\";\n }\n\n static get entity() {\n return \"category\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCourtesyUpdated extends Event {\n constructor(courtesy, context) {\n super(courtesy, context);\n }\n\n static get name() {\n return \"SystemCourtesyUpdated\";\n }\n\n static get entity() {\n return \"courtesy\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCredentialUpdated extends Event {\n constructor(cred, context) {\n super(cred, context);\n }\n\n static get name() {\n return \"SystemCredentialUpdated\";\n }\n\n static get entity() {\n return \"credential\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemDimmerUpdated extends Event {\n constructor(dimmer, context) {\n super(dimmer, context);\n }\n\n static get name() {\n return \"SystemDimmerUpdated\";\n }\n\n static get entity() {\n return \"dimmer\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemEntityDeleted extends Event {\n constructor(data, context) {\n super(data, context);\n }\n\n static get name() {\n return \"SystemEntityDeleted\";\n }\n\n static get entity() {\n return \"entity\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemGatewayUpdated extends Event {\n constructor(gateway, context) {\n super(gateway, context);\n }\n\n static get name() {\n return \"SystemGatewayUpdated\";\n }\n\n static get entity() {\n return \"gateway\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemLockUpdated extends Event {\n constructor(lock, context) {\n super(lock, context);\n }\n\n static get name() {\n return \"SystemLockUpdated\";\n }\n\n static get entity() {\n return \"lock\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemMediaSourceUpdated extends Event {\n constructor(mediaSource, context) {\n super(mediaSource, context);\n }\n\n static get name() {\n return \"SystemMediaSourceUpdated\";\n }\n\n static get entity() {\n return \"mediaSource\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemMotionSensorUpdated extends Event {\n constructor(motion, context) {\n super(motion, context);\n }\n\n static get name() {\n return \"SystemMotionSensorUpdated\";\n }\n\n static get entity() {\n return \"motionSensor\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemOrganizationUpdated extends Event {\n constructor(organization, context) {\n super(organization, context);\n }\n\n static get name() {\n return \"SystemOrganizationUpdated\";\n }\n\n static get entity() {\n return \"organization\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemProductUpdated extends Event {\n constructor(product, context) {\n super(product, context);\n }\n\n static get name() {\n return \"SystemProductUpdated\";\n }\n\n static get entity() {\n return \"product\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemPropertyUpdated extends Event {\n constructor(property, context) {\n super(property, context);\n }\n\n static get name() {\n return \"SystemPropertyUpdated\";\n }\n\n static get entity() {\n return \"property\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemReservationUpdated extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"SystemReservationUpdated\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemSpaceUpdate extends Event {\n constructor(space, context) {\n super(space, context);\n }\n\n static get name() {\n return \"SystemSpaceUpdated\";\n }\n\n static get entity() {\n return \"space\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemSwitchUpdated extends Event {\n constructor(_switch, context) {\n super(_switch, context);\n }\n\n static get name() {\n return \"SystemSwitchUpdated\";\n }\n\n static get entity() {\n return \"switch\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemThermostatUpdated extends Event {\n constructor(thermostat, context) {\n super(thermostat, context);\n }\n\n static get name() {\n return \"SystemThermostatUpdated\";\n }\n\n static get entity() {\n return \"thermostat\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemUserUpdated extends Event {\n constructor(user, context) {\n super(user, context);\n }\n\n static get name() {\n return \"SystemUserUpdated\";\n }\n\n static get entity() {\n return \"user\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemWindowCoveringUpdated extends Event {\n constructor(wc, context) {\n super(wc, context);\n }\n\n static get name() {\n return \"SystemWindowCoveringUpdated\";\n }\n\n static get entity() {\n return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A,EACjD,YAAY,YAAY,SAAS;AAC/B,UAAM,YAAY,OAAO;AAAA,EAC3B;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;;;ACZO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YAAY,MAAM,SAAS;AACzB,UAAM,MAAM,OAAO;AAAA,EACrB;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;;;ACZO,IAAM,8BAAN,cAA0C,MAAM;AAAA,EACrD,YAAY,IAAI,SAAS;AACvB,UAAM,IAAI,OAAO;AAAA,EACnB;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/events/index.js","../src/defs.js","../src/events/event.js","../src/events/applicationInUse.js","../src/events/applicationOutOfUse.js","../src/events/emailEvent.js","../src/events/reservationCheckedIn.js","../src/events/reservationCheckedOut.js","../src/events/reservationSpaceChanged.js","../src/events/sceneSet.js","../src/events/shortLinkCreated.js","../src/events/smsEvent.js","../src/events/systemAlarmUpdated.js","../src/events/systemCameraUpdated.js","../src/events/systemCategoryUpdated.js","../src/events/systemCourtesyUpdated.js","../src/events/systemCredentialUpdated.js","../src/events/systemDimmerUpdated.js","../src/events/systemEntityDeleted.js","../src/events/systemGatewayUpdated.js","../src/events/systemLockUpdated.js","../src/events/systemMediaSourceUpdated.js","../src/events/systemMotionSensorUpdated.js","../src/events/systemOrganizationUpdated.js","../src/events/systemProductUpdated.js","../src/events/systemPropertyUpdated.js","../src/events/systemReservationUpdated.js","../src/events/systemSpaceUpdated.js","../src/events/systemSwitchUpdated.js","../src/events/systemThermostatUpdated.js","../src/events/systemUserUpdated.js","../src/events/systemWindowCoveringUpdated.js"],"sourcesContent":["// This file is auto-generated. Do not edit this file manually.\n// Generated on: 2025-01-24T01:35:50.212Z\n\nexport { ApplicationInUse } from \"./applicationInUse\";\nexport { ApplicationOutOfUse } from \"./applicationOutOfUse\";\nexport { EmailEvent } from \"./emailEvent\";\nexport { Event } from \"./event\";\nexport { ReservationCheckedIn } from \"./reservationCheckedIn\";\nexport { ReservationCheckedOut } from \"./reservationCheckedOut\";\nexport { ReservationSpaceChanged } from \"./reservationSpaceChanged\";\nexport { SceneSet } from \"./sceneSet\";\nexport { ShortLinkCreated } from \"./shortLinkCreated\";\nexport { SMSEvent } from \"./smsEvent\";\nexport { SystemAlarmUpdated } from \"./systemAlarmUpdated\";\nexport { SystemCameraUpdated } from \"./systemCameraUpdated\";\nexport { SystemCategoryUpdated } from \"./systemCategoryUpdated\";\nexport { SystemCourtesyUpdated } from \"./systemCourtesyUpdated\";\nexport { SystemCredentialUpdated } from \"./systemCredentialUpdated\";\nexport { SystemDimmerUpdated } from \"./systemDimmerUpdated\";\nexport { SystemEntityDeleted } from \"./systemEntityDeleted\";\nexport { SystemGatewayUpdated } from \"./systemGatewayUpdated\";\nexport { SystemLockUpdated } from \"./systemLockUpdated\";\nexport { SystemMediaSourceUpdated } from \"./systemMediaSourceUpdated\";\nexport { SystemMotionSensorUpdated } from \"./systemMotionSensorUpdated\";\nexport { SystemOrganizationUpdated } from \"./systemOrganizationUpdated\";\nexport { SystemProductUpdated } from \"./systemProductUpdated\";\nexport { SystemPropertyUpdated } from \"./systemPropertyUpdated\";\nexport { SystemReservationUpdated } from \"./systemReservationUpdated\";\nexport { SystemSpaceUpdate } from \"./systemSpaceUpdated\";\nexport { SystemSwitchUpdated } from \"./systemSwitchUpdated\";\nexport { SystemThermostatUpdated } from \"./systemThermostatUpdated\";\nexport { SystemUserUpdated } from \"./systemUserUpdated\";\nexport { SystemWindowCoveringUpdated } from \"./systemWindowCoveringUpdated\";","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","import { amqpExchanges } from \"../defs\";\n\nexport class Event {\n constructor(data, context = {}) {\n this.data = [];\n this.context = context;\n if (!data) throw new Error(\"Event data is required\");\n if (typeof data !== \"object\" && !Array.isArray(data))\n throw new Error(\"Event data must be an object or array\");\n\n if (!Array.isArray(data)) this.data = [data];\n else this.data = data;\n }\n\n get organizationId() {\n return this.context.organizationId || \"*\";\n }\n\n get propertyId() {\n return this.context.propertyId || \"*\";\n }\n\n static get type() {\n return \"Event\";\n }\n\n static get exchange() {\n return amqpExchanges.DriverEvents.name;\n }\n\n static get entity() {\n return \"\";\n }\n\n build() {\n return { data: { ...this.data } };\n }\n\n get routingKey() {\n return `${this.organizationId}.${this.propertyId}.${this.constructor.entity}.${this.constructor.name}`;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ApplicationInUse extends Event {\n constructor(data = {}, context) {\n super(data, context);\n }\n\n static get name() {\n return \"ApplicationInUse\";\n }\n\n static get entity() {\n return \"app\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ApplicationOutOfUse extends Event {\n constructor(data = {}, context = {}) {\n super(data, context);\n }\n\n static get name() {\n return \"ApplicationOutOfUse\";\n }\n\n static get entity() {\n return \"app\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { Event } from \"./event\";\n\nexport class EmailEvent extends Event {\n constructor(email, context) {\n super(email, context);\n }\n\n static get name() {\n return \"EmailEvent\";\n }\n\n static get entity() {\n return \"emailMessage\";\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ReservationCheckedIn extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"ReservationCheckedIn\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ReservationCheckedOut extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"ReservationCheckedOut\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { amqpExchanges } from \"../defs\";\nimport { Event } from \"./event\";\n\nexport class ReservationSpaceChanged extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"ReservationSpaceChanged\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n\n static get exchange() {\n return amqpExchanges.AppEvents.name;\n }\n}\n","import { Event } from \"./event\";\n\nexport class SceneSet extends Event {\n constructor(scene, context) {\n super(scene, context);\n }\n\n static get name() {\n return \"SceneSet\";\n }\n\n static get entity() {\n return \"scene\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class ShortLinkCreated extends Event {\n constructor(shortLink, context) {\n super(shortLink, context);\n }\n\n static get name() {\n return \"ShortLinkCreated\";\n }\n\n static get entity() {\n return \"shortLink\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SMSEvent extends Event {\n constructor(sms, context) {\n super(sms, context);\n }\n\n static get name() {\n return \"SMSEvent\";\n }\n\n static get entity() {\n return \"smsMessage\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemAlarmUpdated extends Event {\n constructor(alarm, context) {\n super(alarm, context);\n }\n\n static get name() {\n return \"SystemAlarmUpdated\";\n }\n\n static get entity() {\n return \"alarm\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCameraUpdated extends Event {\n constructor(camera, context) {\n super(camera, context);\n }\n\n static get name() {\n return \"SystemCameraUpdated\";\n }\n\n static get entity() {\n return \"camera\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCategoryUpdated extends Event {\n constructor(category, context) {\n super(category, context);\n }\n\n static get name() {\n return \"SystemCategoryUpdated\";\n }\n\n static get entity() {\n return \"category\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCourtesyUpdated extends Event {\n constructor(courtesy, context) {\n super(courtesy, context);\n }\n\n static get name() {\n return \"SystemCourtesyUpdated\";\n }\n\n static get entity() {\n return \"courtesy\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemCredentialUpdated extends Event {\n constructor(cred, context) {\n super(cred, context);\n }\n\n static get name() {\n return \"SystemCredentialUpdated\";\n }\n\n static get entity() {\n return \"credential\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemDimmerUpdated extends Event {\n constructor(dimmer, context) {\n super(dimmer, context);\n }\n\n static get name() {\n return \"SystemDimmerUpdated\";\n }\n\n static get entity() {\n return \"dimmer\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemEntityDeleted extends Event {\n constructor(data, context) {\n super(data, context);\n }\n\n static get name() {\n return \"SystemEntityDeleted\";\n }\n\n static get entity() {\n return \"entity\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemGatewayUpdated extends Event {\n constructor(gateway, context) {\n super(gateway, context);\n }\n\n static get name() {\n return \"SystemGatewayUpdated\";\n }\n\n static get entity() {\n return \"gateway\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemLockUpdated extends Event {\n constructor(lock, context) {\n super(lock, context);\n }\n\n static get name() {\n return \"SystemLockUpdated\";\n }\n\n static get entity() {\n return \"lock\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemMediaSourceUpdated extends Event {\n constructor(mediaSource, context) {\n super(mediaSource, context);\n }\n\n static get name() {\n return \"SystemMediaSourceUpdated\";\n }\n\n static get entity() {\n return \"mediaSource\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemMotionSensorUpdated extends Event {\n constructor(motion, context) {\n super(motion, context);\n }\n\n static get name() {\n return \"SystemMotionSensorUpdated\";\n }\n\n static get entity() {\n return \"motionSensor\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemOrganizationUpdated extends Event {\n constructor(organization, context) {\n super(organization, context);\n }\n\n static get name() {\n return \"SystemOrganizationUpdated\";\n }\n\n static get entity() {\n return \"organization\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemProductUpdated extends Event {\n constructor(product, context) {\n super(product, context);\n }\n\n static get name() {\n return \"SystemProductUpdated\";\n }\n\n static get entity() {\n return \"product\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemPropertyUpdated extends Event {\n constructor(property, context) {\n super(property, context);\n }\n\n static get name() {\n return \"SystemPropertyUpdated\";\n }\n\n static get entity() {\n return \"property\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemReservationUpdated extends Event {\n constructor(reservation, context) {\n super(reservation, context);\n }\n\n static get name() {\n return \"SystemReservationUpdated\";\n }\n\n static get entity() {\n return \"reservation\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemSpaceUpdate extends Event {\n constructor(space, context) {\n super(space, context);\n }\n\n static get name() {\n return \"SystemSpaceUpdated\";\n }\n\n static get entity() {\n return \"space\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemSwitchUpdated extends Event {\n constructor(_switch, context) {\n super(_switch, context);\n }\n\n static get name() {\n return \"SystemSwitchUpdated\";\n }\n\n static get entity() {\n return \"switch\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemThermostatUpdated extends Event {\n constructor(thermostat, context) {\n super(thermostat, context);\n }\n\n static get name() {\n return \"SystemThermostatUpdated\";\n }\n\n static get entity() {\n return \"thermostat\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemUserUpdated extends Event {\n constructor(user, context) {\n super(user, context);\n }\n\n static get name() {\n return \"SystemUserUpdated\";\n }\n\n static get entity() {\n return \"user\";\n }\n}\n","import { Event } from \"./event\";\n\nexport class SystemWindowCoveringUpdated extends Event {\n constructor(wc, context) {\n super(wc, context);\n }\n\n static get name() {\n return \"SystemWindowCoveringUpdated\";\n }\n\n static get entity() {\n return \"windowCovering\";\n }\n}\n"],"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;AAAA;;;ACAO,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,IAC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;AACF;;;ACZO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YAAY,OAAO,SAAS;AAC1B,UAAM,OAAO,OAAO;AAAA,EACtB;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;;;ACZO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC7C,YAAY,SAAS,SAAS;AAC5B,UAAM,SAAS,OAAO;AAAA,EACxB;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;;;ACZO,IAAM,0BAAN,cAAsC,MAAM;AAAA,EACjD,YAAY,YAAY,SAAS;AAC/B,UAAM,YAAY,OAAO;AAAA,EAC3B;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;;;ACZO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YAAY,MAAM,SAAS;AACzB,UAAM,MAAM,OAAO;AAAA,EACrB;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;;;ACZO,IAAM,8BAAN,cAA0C,MAAM;AAAA,EACrD,YAAY,IAAI,SAAS;AACvB,UAAM,IAAI,OAAO;AAAA,EACnB;AAAA,EAEA,WAAW,OAAO;AAChB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,SAAS;AAClB,WAAO;AAAA,EACT;AACF;","names":[]}
package/dist/events.js CHANGED
@@ -1 +1 @@
1
- import{ApplicationInUse,ApplicationOutOfUse,EmailEvent,Event,ReservationCheckedIn,ReservationCheckedOut,ReservationSpaceChanged,SMSEvent,SceneSet,ShortLinkCreated,SystemAlarmUpdated,SystemCameraUpdated,SystemCategoryUpdated,SystemCourtesyUpdated,SystemCredentialUpdated,SystemDimmerUpdated,SystemEntityDeleted,SystemGatewayUpdated,SystemLockUpdated,SystemMediaSourceUpdated,SystemMotionSensorUpdated,SystemOrganizationUpdated,SystemProductUpdated,SystemPropertyUpdated,SystemReservationUpdated,SystemSpaceUpdate,SystemSwitchUpdated,SystemThermostatUpdated,SystemUserUpdated,SystemWindowCoveringUpdated}from"./chunk-WASFYCMJ.js";import"./chunk-KNSZIQXT.js";import"./chunk-HKJ2B2AA.js";export{ApplicationInUse,ApplicationOutOfUse,EmailEvent,Event,ReservationCheckedIn,ReservationCheckedOut,ReservationSpaceChanged,SMSEvent,SceneSet,ShortLinkCreated,SystemAlarmUpdated,SystemCameraUpdated,SystemCategoryUpdated,SystemCourtesyUpdated,SystemCredentialUpdated,SystemDimmerUpdated,SystemEntityDeleted,SystemGatewayUpdated,SystemLockUpdated,SystemMediaSourceUpdated,SystemMotionSensorUpdated,SystemOrganizationUpdated,SystemProductUpdated,SystemPropertyUpdated,SystemReservationUpdated,SystemSpaceUpdate,SystemSwitchUpdated,SystemThermostatUpdated,SystemUserUpdated,SystemWindowCoveringUpdated};//# sourceMappingURL=events.js.map
1
+ import{ApplicationInUse,ApplicationOutOfUse,EmailEvent,Event,ReservationCheckedIn,ReservationCheckedOut,ReservationSpaceChanged,SMSEvent,SceneSet,ShortLinkCreated,SystemAlarmUpdated,SystemCameraUpdated,SystemCategoryUpdated,SystemCourtesyUpdated,SystemCredentialUpdated,SystemDimmerUpdated,SystemEntityDeleted,SystemGatewayUpdated,SystemLockUpdated,SystemMediaSourceUpdated,SystemMotionSensorUpdated,SystemOrganizationUpdated,SystemProductUpdated,SystemPropertyUpdated,SystemReservationUpdated,SystemSpaceUpdate,SystemSwitchUpdated,SystemThermostatUpdated,SystemUserUpdated,SystemWindowCoveringUpdated}from"./chunk-JHS663AH.js";import"./chunk-KNSZIQXT.js";import"./chunk-HKJ2B2AA.js";export{ApplicationInUse,ApplicationOutOfUse,EmailEvent,Event,ReservationCheckedIn,ReservationCheckedOut,ReservationSpaceChanged,SMSEvent,SceneSet,ShortLinkCreated,SystemAlarmUpdated,SystemCameraUpdated,SystemCategoryUpdated,SystemCourtesyUpdated,SystemCredentialUpdated,SystemDimmerUpdated,SystemEntityDeleted,SystemGatewayUpdated,SystemLockUpdated,SystemMediaSourceUpdated,SystemMotionSensorUpdated,SystemOrganizationUpdated,SystemProductUpdated,SystemPropertyUpdated,SystemReservationUpdated,SystemSpaceUpdate,SystemSwitchUpdated,SystemThermostatUpdated,SystemUserUpdated,SystemWindowCoveringUpdated};//# sourceMappingURL=events.js.map
package/dist/index.cjs CHANGED
@@ -981,15 +981,9 @@ var KohostHTTPClient = class _KohostHTTPClient {
981
981
  if (expectedError && newTokensNeeded) {
982
982
  while (!this.isAuthTokenRenewalActive) {
983
983
  this.isAuthTokenRenewalActive = true;
984
- return this.send(
985
- new RefreshTokenCommand({
986
- data: commandConfig.data,
987
- query: commandConfig.params,
988
- headers: commandConfig.headers
989
- })
990
- ).then(() => {
984
+ return this.send(new RefreshTokenCommand({})).then(() => {
991
985
  this.isAuthTokenRenewalActive = false;
992
- return fetch(request.clone());
986
+ return this.send(command);
993
987
  }).catch((err) => {
994
988
  this.isAuthTokenRenewalActive = false;
995
989
  return Promise.reject(err);