@fastybird/smart-panel-backend 0.12.0-alpha.0 → 1.0.0-beta.2
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/app.constants.js.map +1 -1
- package/dist/app.module.js +44 -17
- package/dist/app.module.js.map +1 -1
- package/dist/common/filters/bad-request-exception.filter.js +0 -6
- package/dist/common/filters/bad-request-exception.filter.js.map +1 -1
- package/dist/common/filters/global-error.filter.js +2 -6
- package/dist/common/filters/global-error.filter.js.map +1 -1
- package/dist/common/filters/internal-server-error-exception.filter.js +0 -5
- package/dist/common/filters/internal-server-error-exception.filter.js.map +1 -1
- package/dist/common/filters/not-found-exception.filter.d.ts +4 -0
- package/dist/common/filters/not-found-exception.filter.js +22 -3
- package/dist/common/filters/not-found-exception.filter.js.map +1 -1
- package/dist/common/filters/query-failed-exception.filter.js +0 -5
- package/dist/common/filters/query-failed-exception.filter.js.map +1 -1
- package/dist/common/filters/unprocessable-entity-exception.filter.js +0 -5
- package/dist/common/filters/unprocessable-entity-exception.filter.js.map +1 -1
- package/dist/common/plugin-relations/relation-loader.interface.d.ts +5 -0
- package/dist/common/plugin-relations/relation-loader.interface.js +3 -0
- package/dist/common/plugin-relations/relation-loader.interface.js.map +1 -0
- package/dist/common/services/app-instance-holder.service.d.ts +1 -2
- package/dist/common/services/app-instance-holder.service.js.map +1 -1
- package/dist/common/utils/config.utils.d.ts +0 -1
- package/dist/common/utils/config.utils.js +1 -11
- package/dist/common/utils/config.utils.js.map +1 -1
- package/dist/main.js +25 -6
- package/dist/main.js.map +1 -1
- package/dist/migrations/1000000000000-InitialSetup.js +8 -0
- package/dist/migrations/1000000000000-InitialSetup.js.map +1 -1
- package/dist/migrations/1000000000002-AddTokenLastUsedAt.d.ts +6 -0
- package/dist/migrations/1000000000002-AddTokenLastUsedAt.js +15 -0
- package/dist/migrations/1000000000002-AddTokenLastUsedAt.js.map +1 -0
- package/dist/migrations/1000000000003-UnifySpaceRoleTables.d.ts +6 -0
- package/dist/migrations/1000000000003-UnifySpaceRoleTables.js +88 -0
- package/dist/migrations/1000000000003-UnifySpaceRoleTables.js.map +1 -0
- package/dist/migrations/1000000000004-DisplaysSpaceOnly.d.ts +6 -0
- package/dist/migrations/1000000000004-DisplaysSpaceOnly.js +165 -0
- package/dist/migrations/1000000000004-DisplaysSpaceOnly.js.map +1 -0
- package/dist/migrations/1000000000005-SpacesSignageInfoPanel.d.ts +6 -0
- package/dist/migrations/1000000000005-SpacesSignageInfoPanel.js +66 -0
- package/dist/migrations/1000000000005-SpacesSignageInfoPanel.js.map +1 -0
- package/dist/migrations/1000000000006-DropLegacyRoleTables.d.ts +6 -0
- package/dist/migrations/1000000000006-DropLegacyRoleTables.js +32 -0
- package/dist/migrations/1000000000006-DropLegacyRoleTables.js.map +1 -0
- package/dist/modules/api/interceptors/open-api-response.interceptor.js +1 -1
- package/dist/modules/api/interceptors/open-api-response.interceptor.js.map +1 -1
- package/dist/modules/auth/auth.module.js +44 -28
- package/dist/modules/auth/auth.module.js.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +6 -0
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/tokens.controller.d.ts +10 -3
- package/dist/modules/auth/controllers/tokens.controller.js +96 -7
- package/dist/modules/auth/controllers/tokens.controller.js.map +1 -1
- package/dist/modules/auth/dto/create-personal-token.dto.d.ts +8 -0
- package/dist/modules/auth/dto/create-personal-token.dto.js +75 -0
- package/dist/modules/auth/dto/create-personal-token.dto.js.map +1 -0
- package/dist/modules/auth/dto/register.dto.d.ts +1 -1
- package/dist/modules/auth/dto/register.dto.js +13 -11
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/entities/auth.entity.d.ts +1 -0
- package/dist/modules/auth/entities/auth.entity.js +13 -0
- package/dist/modules/auth/entities/auth.entity.js.map +1 -1
- package/dist/modules/auth/guards/auth.guard.d.ts +0 -1
- package/dist/modules/auth/guards/auth.guard.js +8 -26
- package/dist/modules/auth/guards/auth.guard.js.map +1 -1
- package/dist/modules/auth/guards/display-aware-throttler.guard.d.ts +16 -0
- package/dist/modules/auth/guards/display-aware-throttler.guard.js +133 -0
- package/dist/modules/auth/guards/display-aware-throttler.guard.js.map +1 -0
- package/dist/modules/auth/services/auth.service.js +1 -1
- package/dist/modules/auth/services/auth.service.js.map +1 -1
- package/dist/modules/auth/services/tokens.service.d.ts +10 -0
- package/dist/modules/auth/services/tokens.service.js +35 -0
- package/dist/modules/auth/services/tokens.service.js.map +1 -1
- package/dist/modules/auth/utils/token.utils.d.ts +7 -0
- package/dist/modules/auth/utils/token.utils.js +12 -1
- package/dist/modules/auth/utils/token.utils.js.map +1 -1
- package/dist/modules/buddy/buddy.module.d.ts +5 -1
- package/dist/modules/buddy/buddy.module.js +42 -15
- package/dist/modules/buddy/buddy.module.js.map +1 -1
- package/dist/modules/buddy/buddy.utils.d.ts +8 -0
- package/dist/modules/buddy/buddy.utils.js +49 -0
- package/dist/modules/buddy/buddy.utils.js.map +1 -1
- package/dist/modules/buddy/controllers/buddy-suggestions.controller.js +2 -2
- package/dist/modules/buddy/controllers/buddy-suggestions.controller.js.map +1 -1
- package/dist/modules/buddy/entities/buddy-conversation.entity.js +3 -3
- package/dist/modules/buddy/entities/buddy-conversation.entity.js.map +1 -1
- package/dist/modules/buddy/entities/buddy-message.entity.js +2 -2
- package/dist/modules/buddy/entities/buddy-message.entity.js.map +1 -1
- package/dist/modules/buddy/entities/buddy-suggestion.entity.d.ts +19 -0
- package/dist/modules/buddy/entities/buddy-suggestion.entity.js +93 -0
- package/dist/modules/buddy/entities/buddy-suggestion.entity.js.map +1 -0
- package/dist/modules/buddy/listeners/media-activity-event.listener.js +3 -3
- package/dist/modules/buddy/listeners/media-activity-event.listener.js.map +1 -1
- package/dist/modules/buddy/platforms/llm-provider.platform.d.ts +6 -0
- package/dist/modules/buddy/platforms/openai-sdk.utils.d.ts +2 -1
- package/dist/modules/buddy/platforms/openai-sdk.utils.js +12 -1
- package/dist/modules/buddy/platforms/openai-sdk.utils.js.map +1 -1
- package/dist/modules/buddy/services/buddy-context.service.js +2 -2
- package/dist/modules/buddy/services/buddy-context.service.js.map +1 -1
- package/dist/modules/buddy/services/buddy-conversation.service.js +23 -8
- package/dist/modules/buddy/services/buddy-conversation.service.js.map +1 -1
- package/dist/modules/buddy/services/buddy-personality.service.d.ts +1 -1
- package/dist/modules/buddy/services/buddy-personality.service.js.map +1 -1
- package/dist/modules/buddy/services/heartbeat.service.js +2 -2
- package/dist/modules/buddy/services/heartbeat.service.js.map +1 -1
- package/dist/modules/buddy/services/llm-provider.service.js +2 -10
- package/dist/modules/buddy/services/llm-provider.service.js.map +1 -1
- package/dist/modules/buddy/services/module-reset.service.d.ts +3 -1
- package/dist/modules/buddy/services/module-reset.service.js +6 -1
- package/dist/modules/buddy/services/module-reset.service.js.map +1 -1
- package/dist/modules/buddy/services/pattern-detector.service.d.ts +4 -1
- package/dist/modules/buddy/services/pattern-detector.service.js +10 -3
- package/dist/modules/buddy/services/pattern-detector.service.js.map +1 -1
- package/dist/modules/buddy/services/scene-suggestion-evaluator.service.d.ts +4 -1
- package/dist/modules/buddy/services/scene-suggestion-evaluator.service.js +10 -4
- package/dist/modules/buddy/services/scene-suggestion-evaluator.service.js.map +1 -1
- package/dist/modules/buddy/services/stt-provider.service.js +2 -10
- package/dist/modules/buddy/services/stt-provider.service.js.map +1 -1
- package/dist/modules/buddy/services/suggestion-engine.service.d.ts +19 -13
- package/dist/modules/buddy/services/suggestion-engine.service.js +170 -103
- package/dist/modules/buddy/services/suggestion-engine.service.js.map +1 -1
- package/dist/modules/buddy/services/tts-provider.service.js +2 -10
- package/dist/modules/buddy/services/tts-provider.service.js.map +1 -1
- package/dist/modules/config/config.constants.d.ts +2 -1
- package/dist/modules/config/config.constants.js +1 -0
- package/dist/modules/config/config.constants.js.map +1 -1
- package/dist/modules/config/config.module.d.ts +5 -1
- package/dist/modules/config/config.module.js +78 -14
- package/dist/modules/config/config.module.js.map +1 -1
- package/dist/modules/config/services/config.service.d.ts +1 -0
- package/dist/modules/config/services/config.service.js +11 -1
- package/dist/modules/config/services/config.service.js.map +1 -1
- package/dist/modules/dashboard/dashboard.module.js +21 -18
- package/dist/modules/dashboard/dashboard.module.js.map +1 -1
- package/dist/modules/dashboard/entities/dashboard.relations.d.ts +1 -5
- package/dist/modules/devices/devices.module.js +24 -16
- package/dist/modules/devices/devices.module.js.map +1 -1
- package/dist/modules/devices/services/device-zones.service.js +2 -2
- package/dist/modules/devices/services/device-zones.service.js.map +1 -1
- package/dist/modules/devices/services/devices.service.js.map +1 -1
- package/dist/modules/displays/displays.constants.d.ts +0 -5
- package/dist/modules/displays/displays.constants.js +1 -7
- package/dist/modules/displays/displays.constants.js.map +1 -1
- package/dist/modules/displays/displays.module.js +27 -23
- package/dist/modules/displays/displays.module.js.map +1 -1
- package/dist/modules/displays/dto/update-display.dto.d.ts +2 -3
- package/dist/modules/displays/dto/update-display.dto.js +4 -19
- package/dist/modules/displays/dto/update-display.dto.js.map +1 -1
- package/dist/modules/displays/entities/displays.entity.d.ts +3 -4
- package/dist/modules/displays/entities/displays.entity.js +8 -25
- package/dist/modules/displays/entities/displays.entity.js.map +1 -1
- package/dist/modules/displays/services/displays.service.d.ts +4 -2
- package/dist/modules/displays/services/displays.service.js +19 -24
- package/dist/modules/displays/services/displays.service.js.map +1 -1
- package/dist/modules/displays/services/home-resolution.service.d.ts +7 -2
- package/dist/modules/displays/services/home-resolution.service.js +50 -6
- package/dist/modules/displays/services/home-resolution.service.js.map +1 -1
- package/dist/modules/displays/services/space-home-page-resolver-registry.service.d.ts +9 -0
- package/dist/modules/displays/services/space-home-page-resolver-registry.service.js +26 -0
- package/dist/modules/displays/services/space-home-page-resolver-registry.service.js.map +1 -0
- package/dist/modules/displays/services/space-selection-validator-registry.service.d.ts +9 -0
- package/dist/modules/displays/services/space-selection-validator-registry.service.js +26 -0
- package/dist/modules/displays/services/space-selection-validator-registry.service.js.map +1 -0
- package/dist/modules/energy/energy.module.js +29 -15
- package/dist/modules/energy/energy.module.js.map +1 -1
- package/dist/modules/extensions/controllers/actions.controller.d.ts +9 -4
- package/dist/modules/extensions/controllers/actions.controller.js +63 -10
- package/dist/modules/extensions/controllers/actions.controller.js.map +1 -1
- package/dist/modules/extensions/extensions.module.js +31 -28
- package/dist/modules/extensions/extensions.module.js.map +1 -1
- package/dist/modules/extensions/extensions.openapi.d.ts +3 -3
- package/dist/modules/extensions/extensions.openapi.js +2 -0
- package/dist/modules/extensions/extensions.openapi.js.map +1 -1
- package/dist/modules/extensions/models/action.model.d.ts +13 -0
- package/dist/modules/extensions/models/action.model.js +89 -3
- package/dist/modules/extensions/models/action.model.js.map +1 -1
- package/dist/modules/extensions/models/actions-response.model.d.ts +4 -1
- package/dist/modules/extensions/models/actions-response.model.js +19 -1
- package/dist/modules/extensions/models/actions-response.model.js.map +1 -1
- package/dist/modules/extensions/models/extension.model.js +5 -0
- package/dist/modules/extensions/models/extension.model.js.map +1 -1
- package/dist/modules/extensions/models/service-status.model.js +7 -0
- package/dist/modules/extensions/models/service-status.model.js.map +1 -1
- package/dist/modules/extensions/services/action-audit.service.d.ts +21 -0
- package/dist/modules/extensions/services/action-audit.service.js +49 -0
- package/dist/modules/extensions/services/action-audit.service.js.map +1 -0
- package/dist/modules/extensions/services/base-managed-plugin.service.d.ts +11 -0
- package/dist/modules/extensions/services/base-managed-plugin.service.js +28 -0
- package/dist/modules/extensions/services/base-managed-plugin.service.js.map +1 -0
- package/dist/modules/extensions/services/extension-action-registry.service.d.ts +6 -1
- package/dist/modules/extensions/services/extension-action-registry.service.js +22 -3
- package/dist/modules/extensions/services/extension-action-registry.service.js.map +1 -1
- package/dist/modules/extensions/services/extension-action.interface.d.ts +3 -0
- package/dist/modules/extensions/services/extension-action.interface.js +3 -1
- package/dist/modules/extensions/services/extension-action.interface.js.map +1 -1
- package/dist/modules/intents/intents.module.js +27 -26
- package/dist/modules/intents/intents.module.js.map +1 -1
- package/dist/modules/mdns/mdns.module.js +24 -19
- package/dist/modules/mdns/mdns.module.js.map +1 -1
- package/dist/modules/platform/dto/system-info.dto.d.ts +2 -0
- package/dist/modules/platform/dto/system-info.dto.js +7 -0
- package/dist/modules/platform/dto/system-info.dto.js.map +1 -1
- package/dist/modules/platform/platform.module.js +25 -17
- package/dist/modules/platform/platform.module.js.map +1 -1
- package/dist/modules/platform/platforms/abstract.platform.d.ts +44 -0
- package/dist/modules/platform/platforms/abstract.platform.js +267 -0
- package/dist/modules/platform/platforms/abstract.platform.js.map +1 -1
- package/dist/modules/platform/platforms/docker.platform.d.ts +2 -0
- package/dist/modules/platform/platforms/docker.platform.js +3 -0
- package/dist/modules/platform/platforms/docker.platform.js.map +1 -1
- package/dist/modules/platform/platforms/generic.platform.d.ts +2 -1
- package/dist/modules/platform/platforms/generic.platform.js +17 -15
- package/dist/modules/platform/platforms/generic.platform.js.map +1 -1
- package/dist/modules/platform/platforms/home-assistant.platform.d.ts +4 -0
- package/dist/modules/platform/platforms/home-assistant.platform.js +21 -0
- package/dist/modules/platform/platforms/home-assistant.platform.js.map +1 -1
- package/dist/modules/platform/platforms/raspberry.platform.js +22 -40
- package/dist/modules/platform/platforms/raspberry.platform.js.map +1 -1
- package/dist/modules/platform/services/platform.service.d.ts +2 -0
- package/dist/modules/platform/services/platform.service.js +7 -0
- package/dist/modules/platform/services/platform.service.js.map +1 -1
- package/dist/modules/scenes/scenes.module.js +18 -18
- package/dist/modules/scenes/scenes.module.js.map +1 -1
- package/dist/modules/security/security.module.js +22 -17
- package/dist/modules/security/security.module.js.map +1 -1
- package/dist/modules/spaces/controllers/spaces.controller.d.ts +5 -115
- package/dist/modules/spaces/controllers/spaces.controller.js +22 -1922
- package/dist/modules/spaces/controllers/spaces.controller.js.map +1 -1
- package/dist/modules/spaces/dto/create-space.dto.d.ts +1 -5
- package/dist/modules/spaces/dto/create-space.dto.js +0 -61
- package/dist/modules/spaces/dto/create-space.dto.js.map +1 -1
- package/dist/modules/spaces/dto/update-space.dto.d.ts +1 -5
- package/dist/modules/spaces/dto/update-space.dto.js +0 -61
- package/dist/modules/spaces/dto/update-space.dto.js.map +1 -1
- package/dist/modules/spaces/entities/space-role.entity.d.ts +8 -0
- package/dist/modules/spaces/entities/space-role.entity.js +58 -0
- package/dist/modules/spaces/entities/space-role.entity.js.map +1 -0
- package/dist/modules/spaces/entities/space.entity.d.ts +3 -6
- package/dist/modules/spaces/entities/space.entity.js +11 -74
- package/dist/modules/spaces/entities/space.entity.js.map +1 -1
- package/dist/modules/spaces/entities/space.relations.d.ts +11 -0
- package/dist/modules/spaces/entities/space.relations.js +3 -0
- package/dist/modules/spaces/entities/space.relations.js.map +1 -0
- package/dist/modules/spaces/models/spaces-response.model.d.ts +1 -522
- package/dist/modules/spaces/models/spaces-response.model.js +23 -4150
- package/dist/modules/spaces/models/spaces-response.model.js.map +1 -1
- package/dist/modules/spaces/services/space-create-builder-registry.service.d.ts +6 -0
- package/dist/modules/spaces/services/space-create-builder-registry.service.js +26 -0
- package/dist/modules/spaces/services/space-create-builder-registry.service.js.map +1 -0
- package/dist/modules/spaces/services/space-relations-loader-registry.service.d.ts +6 -0
- package/dist/modules/spaces/services/space-relations-loader-registry.service.js +26 -0
- package/dist/modules/spaces/services/space-relations-loader-registry.service.js.map +1 -0
- package/dist/modules/spaces/services/space-roles-type-mapper.service.d.ts +12 -0
- package/dist/modules/spaces/services/space-roles-type-mapper.service.js +39 -0
- package/dist/modules/spaces/services/space-roles-type-mapper.service.js.map +1 -0
- package/dist/modules/spaces/services/spaces-type-mapper.service.d.ts +17 -0
- package/dist/modules/spaces/services/spaces-type-mapper.service.js +36 -0
- package/dist/modules/spaces/services/spaces-type-mapper.service.js.map +1 -0
- package/dist/modules/spaces/services/spaces.service.d.ts +4 -12
- package/dist/modules/spaces/services/spaces.service.js +120 -160
- package/dist/modules/spaces/services/spaces.service.js.map +1 -1
- package/dist/modules/spaces/spaces.constants.d.ts +13 -292
- package/dist/modules/spaces/spaces.constants.js +13 -1449
- package/dist/modules/spaces/spaces.constants.js.map +1 -1
- package/dist/modules/spaces/spaces.module.d.ts +2 -9
- package/dist/modules/spaces/spaces.module.js +51 -108
- package/dist/modules/spaces/spaces.module.js.map +1 -1
- package/dist/modules/spaces/spaces.openapi.d.ts +3 -16
- package/dist/modules/spaces/spaces.openapi.js +0 -136
- package/dist/modules/spaces/spaces.openapi.js.map +1 -1
- package/dist/modules/stats/controllers/prometheus.controller.js +0 -2
- package/dist/modules/stats/controllers/prometheus.controller.js.map +1 -1
- package/dist/modules/storage/models/config.model.js +2 -4
- package/dist/modules/storage/models/config.model.js.map +1 -1
- package/dist/modules/storage/services/storage.service.d.ts +4 -10
- package/dist/modules/storage/services/storage.service.js +21 -60
- package/dist/modules/storage/services/storage.service.js.map +1 -1
- package/dist/modules/storage/storage.constants.d.ts +2 -0
- package/dist/modules/storage/storage.constants.js +3 -1
- package/dist/modules/storage/storage.constants.js.map +1 -1
- package/dist/modules/storage/storage.module.js +26 -7
- package/dist/modules/storage/storage.module.js.map +1 -1
- package/dist/modules/swagger/commands/serve-swagger.command.d.ts +14 -0
- package/dist/modules/swagger/commands/serve-swagger.command.js +60 -0
- package/dist/modules/swagger/commands/serve-swagger.command.js.map +1 -0
- package/dist/modules/swagger/swagger.module.js +2 -0
- package/dist/modules/swagger/swagger.module.js.map +1 -1
- package/dist/modules/system/backup-contribution.module.d.ts +2 -0
- package/dist/modules/system/backup-contribution.module.js +22 -0
- package/dist/modules/system/backup-contribution.module.js.map +1 -0
- package/dist/modules/system/controllers/backup.controller.d.ts +17 -0
- package/dist/modules/system/controllers/backup.controller.js +308 -0
- package/dist/modules/system/controllers/backup.controller.js.map +1 -0
- package/dist/modules/system/dto/create-backup.dto.d.ts +6 -0
- package/dist/modules/system/dto/create-backup.dto.js +43 -0
- package/dist/modules/system/dto/create-backup.dto.js.map +1 -0
- package/dist/modules/system/models/backup-response.model.d.ts +8 -0
- package/dist/modules/system/models/backup-response.model.js +46 -0
- package/dist/modules/system/models/backup-response.model.js.map +1 -0
- package/dist/modules/system/models/backup.model.d.ts +14 -0
- package/dist/modules/system/models/backup.model.js +103 -0
- package/dist/modules/system/models/backup.model.js.map +1 -0
- package/dist/modules/system/models/system.model.d.ts +3 -1
- package/dist/modules/system/models/system.model.js +26 -0
- package/dist/modules/system/models/system.model.js.map +1 -1
- package/dist/modules/system/scripts/update-worker.sh +304 -0
- package/dist/modules/system/services/backup-contribution-registry.service.d.ts +24 -0
- package/dist/modules/system/services/backup-contribution-registry.service.js +52 -0
- package/dist/modules/system/services/backup-contribution-registry.service.js.map +1 -0
- package/dist/modules/system/services/backup.service.d.ts +52 -0
- package/dist/modules/system/services/backup.service.js +630 -0
- package/dist/modules/system/services/backup.service.js.map +1 -0
- package/dist/modules/system/services/house-mode-actions.service.d.ts +1 -1
- package/dist/modules/system/services/house-mode-actions.service.js +5 -5
- package/dist/modules/system/services/house-mode-actions.service.js.map +1 -1
- package/dist/modules/system/services/system-command.service.d.ts +7 -1
- package/dist/modules/system/services/system-command.service.js +24 -4
- package/dist/modules/system/services/system-command.service.js.map +1 -1
- package/dist/modules/system/services/system.service.js +4 -1
- package/dist/modules/system/services/system.service.js.map +1 -1
- package/dist/modules/system/services/update-executor.service.d.ts +4 -0
- package/dist/modules/system/services/update-executor.service.js +130 -10
- package/dist/modules/system/services/update-executor.service.js.map +1 -1
- package/dist/modules/system/system.constants.d.ts +7 -0
- package/dist/modules/system/system.constants.js +9 -1
- package/dist/modules/system/system.constants.js.map +1 -1
- package/dist/modules/system/system.module.d.ts +5 -1
- package/dist/modules/system/system.module.js +95 -31
- package/dist/modules/system/system.module.js.map +1 -1
- package/dist/modules/system/system.openapi.d.ts +4 -1
- package/dist/modules/system/system.openapi.js +8 -0
- package/dist/modules/system/system.openapi.js.map +1 -1
- package/dist/modules/users/controllers/users.controller.js +9 -0
- package/dist/modules/users/controllers/users.controller.js.map +1 -1
- package/dist/modules/users/dto/create-user.dto.js +1 -0
- package/dist/modules/users/dto/create-user.dto.js.map +1 -1
- package/dist/modules/users/dto/update-user.dto.d.ts +1 -0
- package/dist/modules/users/dto/update-user.dto.js +15 -1
- package/dist/modules/users/dto/update-user.dto.js.map +1 -1
- package/dist/modules/users/services/users.service.d.ts +1 -0
- package/dist/modules/users/services/users.service.js +12 -2
- package/dist/modules/users/services/users.service.js.map +1 -1
- package/dist/modules/users/users.constants.d.ts +3 -0
- package/dist/modules/users/users.constants.js +35 -1
- package/dist/modules/users/users.constants.js.map +1 -1
- package/dist/modules/users/users.module.js +29 -13
- package/dist/modules/users/users.module.js.map +1 -1
- package/dist/modules/weather/weather.module.js +20 -18
- package/dist/modules/weather/weather.module.js.map +1 -1
- package/dist/modules/websocket/dto/client-user.dto.js +25 -0
- package/dist/modules/websocket/dto/client-user.dto.js.map +1 -1
- package/dist/modules/websocket/dto/ws-client.dto.js +26 -0
- package/dist/modules/websocket/dto/ws-client.dto.js.map +1 -1
- package/dist/modules/websocket/gateway/websocket.gateway.d.ts +2 -2
- package/dist/modules/websocket/gateway/websocket.gateway.js +27 -9
- package/dist/modules/websocket/gateway/websocket.gateway.js.map +1 -1
- package/dist/modules/websocket/services/command-event-registry.service.d.ts +3 -1
- package/dist/modules/websocket/services/command-event-registry.service.js +5 -4
- package/dist/modules/websocket/services/command-event-registry.service.js.map +1 -1
- package/dist/plugins/buddy-claude/buddy-claude.plugin.js +24 -11
- package/dist/plugins/buddy-claude/buddy-claude.plugin.js.map +1 -1
- package/dist/plugins/buddy-claude-setup-token/buddy-claude-setup-token.plugin.js +21 -11
- package/dist/plugins/buddy-claude-setup-token/buddy-claude-setup-token.plugin.js.map +1 -1
- package/dist/plugins/buddy-discord/buddy-discord.plugin.js +28 -16
- package/dist/plugins/buddy-discord/buddy-discord.plugin.js.map +1 -1
- package/dist/plugins/buddy-elevenlabs/buddy-elevenlabs.plugin.js +22 -11
- package/dist/plugins/buddy-elevenlabs/buddy-elevenlabs.plugin.js.map +1 -1
- package/dist/plugins/buddy-ollama/buddy-ollama.plugin.js +28 -12
- package/dist/plugins/buddy-ollama/buddy-ollama.plugin.js.map +1 -1
- package/dist/plugins/buddy-openai/buddy-openai.plugin.js +24 -15
- package/dist/plugins/buddy-openai/buddy-openai.plugin.js.map +1 -1
- package/dist/plugins/buddy-openai/platforms/openai.provider.js +1 -0
- package/dist/plugins/buddy-openai/platforms/openai.provider.js.map +1 -1
- package/dist/plugins/buddy-openai-codex/buddy-openai-codex.plugin.js +26 -15
- package/dist/plugins/buddy-openai-codex/buddy-openai-codex.plugin.js.map +1 -1
- package/dist/plugins/buddy-stt-whisper-local/buddy-stt-whisper-local.plugin.js +23 -9
- package/dist/plugins/buddy-stt-whisper-local/buddy-stt-whisper-local.plugin.js.map +1 -1
- package/dist/plugins/buddy-system-tts/buddy-system-tts.plugin.js +21 -10
- package/dist/plugins/buddy-system-tts/buddy-system-tts.plugin.js.map +1 -1
- package/dist/plugins/buddy-telegram/buddy-telegram.plugin.js +22 -11
- package/dist/plugins/buddy-telegram/buddy-telegram.plugin.js.map +1 -1
- package/dist/plugins/buddy-voiceai/buddy-voiceai.plugin.js +22 -12
- package/dist/plugins/buddy-voiceai/buddy-voiceai.plugin.js.map +1 -1
- package/dist/plugins/buddy-whatsapp/buddy-whatsapp.plugin.js +24 -12
- package/dist/plugins/buddy-whatsapp/buddy-whatsapp.plugin.js.map +1 -1
- package/dist/plugins/buddy-whatsapp/controllers/whatsapp-webhook.controller.d.ts +2 -2
- package/dist/plugins/buddy-whatsapp/controllers/whatsapp-webhook.controller.js +3 -3
- package/dist/plugins/buddy-whatsapp/controllers/whatsapp-webhook.controller.js.map +1 -1
- package/dist/plugins/buddy-whatsapp/platforms/whatsapp-bot.provider.d.ts +2 -1
- package/dist/plugins/buddy-whatsapp/platforms/whatsapp-bot.provider.js +31 -12
- package/dist/plugins/buddy-whatsapp/platforms/whatsapp-bot.provider.js.map +1 -1
- package/dist/plugins/data-sources-device-channel/data-sources-device-channel.plugin.js +16 -30
- package/dist/plugins/data-sources-device-channel/data-sources-device-channel.plugin.js.map +1 -1
- package/dist/plugins/data-sources-weather/data-sources-weather.plugin.js +17 -29
- package/dist/plugins/data-sources-weather/data-sources-weather.plugin.js.map +1 -1
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js +37 -136
- package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js.map +1 -1
- package/dist/plugins/devices-home-assistant/dto/home-assistant-discovered-helper.dto.js +22 -2
- package/dist/plugins/devices-home-assistant/dto/home-assistant-discovered-helper.dto.js.map +1 -1
- package/dist/plugins/devices-home-assistant/models/config.model.d.ts +1 -0
- package/dist/plugins/devices-home-assistant/models/config.model.js +12 -0
- package/dist/plugins/devices-home-assistant/models/config.model.js.map +1 -1
- package/dist/plugins/devices-home-assistant/platforms/home-assistant.device.platform.d.ts +3 -1
- package/dist/plugins/devices-home-assistant/platforms/home-assistant.device.platform.js +11 -2
- package/dist/plugins/devices-home-assistant/platforms/home-assistant.device.platform.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js +0 -6
- package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/ha-supervisor.service.d.ts +10 -0
- package/dist/plugins/devices-home-assistant/services/ha-supervisor.service.js +47 -0
- package/dist/plugins/devices-home-assistant/services/ha-supervisor.service.js.map +1 -0
- package/dist/plugins/devices-home-assistant/services/home-assistant-config-validator.service.d.ts +3 -1
- package/dist/plugins/devices-home-assistant/services/home-assistant-config-validator.service.js +8 -2
- package/dist/plugins/devices-home-assistant/services/home-assistant-config-validator.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/home-assistant.http.service.d.ts +5 -1
- package/dist/plugins/devices-home-assistant/services/home-assistant.http.service.js +27 -7
- package/dist/plugins/devices-home-assistant/services/home-assistant.http.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.d.ts +9 -7
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js +58 -24
- package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js.map +1 -1
- package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js +1 -0
- package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js.map +1 -1
- package/dist/plugins/devices-reterminal/devices-reterminal.plugin.js +20 -17
- package/dist/plugins/devices-reterminal/devices-reterminal.plugin.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/controllers/shelly-ng-devices.controller.d.ts +7 -2
- package/dist/plugins/devices-shelly-ng/controllers/shelly-ng-devices.controller.js +83 -2
- package/dist/plugins/devices-shelly-ng/controllers/shelly-ng-devices.controller.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.d.ts +4 -0
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js +86 -11
- package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.d.ts +8 -0
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js +45 -0
- package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.openapi.d.ts +3 -3
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.openapi.js +4 -0
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.openapi.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.d.ts +6 -1
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js +72 -21
- package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/dto/update-config.dto.d.ts +1 -0
- package/dist/plugins/devices-shelly-ng/dto/update-config.dto.js +24 -6
- package/dist/plugins/devices-shelly-ng/dto/update-config.dto.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/entities/devices-shelly-ng.entity.js +12 -0
- package/dist/plugins/devices-shelly-ng/entities/devices-shelly-ng.entity.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/entities/shelly-ng-device-address.entity.js +2 -0
- package/dist/plugins/devices-shelly-ng/entities/shelly-ng-device-address.entity.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/models/config.model.d.ts +1 -0
- package/dist/plugins/devices-shelly-ng/models/config.model.js +18 -6
- package/dist/plugins/devices-shelly-ng/models/config.model.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/models/shelly-ng-response.model.d.ts +4 -1
- package/dist/plugins/devices-shelly-ng/models/shelly-ng-response.model.js +15 -1
- package/dist/plugins/devices-shelly-ng/models/shelly-ng-response.model.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/models/shelly-ng.model.d.ts +30 -0
- package/dist/plugins/devices-shelly-ng/models/shelly-ng.model.js +269 -1
- package/dist/plugins/devices-shelly-ng/models/shelly-ng.model.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/device-manager.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/shelly-ng-discovery.service.d.ts +64 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ng-discovery.service.js +301 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ng-discovery.service.js.map +1 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.d.ts +17 -7
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js +110 -15
- package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.d.ts +5 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js +3 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js.map +1 -1
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.d.ts +28 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js +197 -0
- package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js.map +1 -0
- package/dist/plugins/devices-shelly-v1/controllers/shelly-v1-devices.controller.d.ts +7 -2
- package/dist/plugins/devices-shelly-v1/controllers/shelly-v1-devices.controller.js +83 -2
- package/dist/plugins/devices-shelly-v1/controllers/shelly-v1-devices.controller.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.openapi.d.ts +3 -3
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.openapi.js +4 -0
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.openapi.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js +27 -23
- package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/models/shelly-v1-response.model.d.ts +4 -1
- package/dist/plugins/devices-shelly-v1/models/shelly-v1-response.model.js +15 -1
- package/dist/plugins/devices-shelly-v1/models/shelly-v1-response.model.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/models/shelly-v1.model.d.ts +31 -0
- package/dist/plugins/devices-shelly-v1/models/shelly-v1.model.js +279 -1
- package/dist/plugins/devices-shelly-v1/models/shelly-v1.model.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.d.ts +0 -1
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js +2 -9
- package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/services/device-mapper.service.d.ts +0 -1
- package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js +2 -15
- package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/services/shellies-adapter.service.d.ts +9 -2
- package/dist/plugins/devices-shelly-v1/services/shellies-adapter.service.js +93 -20
- package/dist/plugins/devices-shelly-v1/services/shellies-adapter.service.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/services/shelly-v1-discovery.service.d.ts +62 -0
- package/dist/plugins/devices-shelly-v1/services/shelly-v1-discovery.service.js +314 -0
- package/dist/plugins/devices-shelly-v1/services/shelly-v1-discovery.service.js.map +1 -0
- package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.d.ts +3 -6
- package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js +13 -37
- package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js.map +1 -1
- package/dist/plugins/devices-shelly-v1/utils/descriptor.utils.d.ts +2 -0
- package/dist/plugins/devices-shelly-v1/utils/descriptor.utils.js +23 -0
- package/dist/plugins/devices-shelly-v1/utils/descriptor.utils.js.map +1 -0
- package/dist/plugins/devices-third-party/devices-third-party.plugin.js +19 -23
- package/dist/plugins/devices-third-party/devices-third-party.plugin.js.map +1 -1
- package/dist/plugins/devices-wled/devices-wled.plugin.js +30 -20
- package/dist/plugins/devices-wled/devices-wled.plugin.js.map +1 -1
- package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js +0 -6
- package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js.map +1 -1
- package/dist/plugins/devices-wled/services/wled.service.d.ts +3 -6
- package/dist/plugins/devices-wled/services/wled.service.js +3 -20
- package/dist/plugins/devices-wled/services/wled.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/controllers/zigbee2mqtt-wizard.controller.d.ts +14 -0
- package/dist/plugins/devices-zigbee2mqtt/controllers/zigbee2mqtt-wizard.controller.js +185 -0
- package/dist/plugins/devices-zigbee2mqtt/controllers/zigbee2mqtt-wizard.controller.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.openapi.d.ts +5 -3
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.openapi.js +12 -0
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.openapi.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.plugin.js +43 -54
- package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.plugin.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/dto/wizard-adopt.dto.d.ts +12 -0
- package/dist/plugins/devices-zigbee2mqtt/dto/wizard-adopt.dto.js +73 -0
- package/dist/plugins/devices-zigbee2mqtt/dto/wizard-adopt.dto.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/models/wizard.model.d.ts +38 -0
- package/dist/plugins/devices-zigbee2mqtt/models/wizard.model.js +259 -0
- package/dist/plugins/devices-zigbee2mqtt/models/wizard.model.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/models/zigbee2mqtt-response.model.d.ts +7 -0
- package/dist/plugins/devices-zigbee2mqtt/models/zigbee2mqtt-response.model.js +30 -1
- package/dist/plugins/devices-zigbee2mqtt/models/zigbee2mqtt-response.model.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.d.ts +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.d.ts +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js +22 -0
- package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/wizard.service.d.ts +70 -0
- package/dist/plugins/devices-zigbee2mqtt/services/wizard.service.js +361 -0
- package/dist/plugins/devices-zigbee2mqtt/services/wizard.service.js.map +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/ws-client-adapter.service.d.ts +1 -0
- package/dist/plugins/devices-zigbee2mqtt/services/ws-client-adapter.service.js +23 -0
- package/dist/plugins/devices-zigbee2mqtt/services/ws-client-adapter.service.js.map +1 -1
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.d.ts +10 -7
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js +46 -22
- package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js.map +1 -1
- package/dist/{modules/storage/plugins/influx-v1/influx-v1.update-config.dto.d.ts → plugins/influx-v1/dto/update-config.dto.d.ts} +1 -1
- package/dist/{modules/storage/plugins/influx-v1/influx-v1.update-config.dto.js → plugins/influx-v1/dto/update-config.dto.js} +3 -3
- package/dist/plugins/influx-v1/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/influx-v1/influx-v1.constants.js.map +1 -0
- package/dist/{modules/storage/plugins → plugins}/influx-v1/influx-v1.openapi.d.ts +1 -1
- package/dist/plugins/influx-v1/influx-v1.openapi.js +7 -0
- package/dist/plugins/influx-v1/influx-v1.openapi.js.map +1 -0
- package/dist/plugins/influx-v1/influx-v1.plugin.d.ts +15 -0
- package/dist/plugins/influx-v1/influx-v1.plugin.js +109 -0
- package/dist/plugins/influx-v1/influx-v1.plugin.js.map +1 -0
- package/dist/{modules/storage/plugins/influx-v1/influx-v1.config.model.d.ts → plugins/influx-v1/models/config.model.d.ts} +1 -1
- package/dist/{modules/storage/plugins/influx-v1/influx-v1.config.model.js → plugins/influx-v1/models/config.model.js} +3 -3
- package/dist/plugins/influx-v1/models/config.model.js.map +1 -0
- package/dist/plugins/influx-v1/services/influx-v1-managed.service.d.ts +20 -0
- package/dist/plugins/influx-v1/services/influx-v1-managed.service.js +128 -0
- package/dist/plugins/influx-v1/services/influx-v1-managed.service.js.map +1 -0
- package/dist/{modules/storage/plugins/influx-v1/influx-v1.plugin.d.ts → plugins/influx-v1/services/influx-v1.storage.d.ts} +3 -3
- package/dist/{modules/storage/plugins/influx-v1/influx-v1.plugin.js → plugins/influx-v1/services/influx-v1.storage.js} +9 -9
- package/dist/plugins/influx-v1/services/influx-v1.storage.js.map +1 -0
- package/dist/plugins/influx-v2/dto/update-config.dto.d.ts +8 -0
- package/dist/plugins/influx-v2/dto/update-config.dto.js +82 -0
- package/dist/plugins/influx-v2/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/influx-v2/influx-v2.constants.d.ts +4 -0
- package/dist/plugins/influx-v2/influx-v2.constants.js +8 -0
- package/dist/plugins/influx-v2/influx-v2.constants.js.map +1 -0
- package/dist/plugins/influx-v2/influx-v2.openapi.d.ts +2 -0
- package/dist/plugins/influx-v2/influx-v2.openapi.js +7 -0
- package/dist/plugins/influx-v2/influx-v2.openapi.js.map +1 -0
- package/dist/plugins/influx-v2/influx-v2.plugin.d.ts +15 -0
- package/dist/plugins/influx-v2/influx-v2.plugin.js +109 -0
- package/dist/plugins/influx-v2/influx-v2.plugin.js.map +1 -0
- package/dist/plugins/influx-v2/models/config.model.d.ts +9 -0
- package/dist/plugins/influx-v2/models/config.model.js +93 -0
- package/dist/plugins/influx-v2/models/config.model.js.map +1 -0
- package/dist/plugins/influx-v2/services/influx-v2-managed.service.d.ts +20 -0
- package/dist/plugins/influx-v2/services/influx-v2-managed.service.js +132 -0
- package/dist/plugins/influx-v2/services/influx-v2-managed.service.js.map +1 -0
- package/dist/plugins/influx-v2/services/influx-v2.storage.d.ts +33 -0
- package/dist/plugins/influx-v2/services/influx-v2.storage.js +230 -0
- package/dist/plugins/influx-v2/services/influx-v2.storage.js.map +1 -0
- package/dist/plugins/logger-rotating-file/logger-rotating-file.plugin.js +20 -29
- package/dist/plugins/logger-rotating-file/logger-rotating-file.plugin.js.map +1 -1
- package/dist/{modules/storage/plugins/memory/memory.update-config.dto.d.ts → plugins/memory-storage/dto/update-config.dto.d.ts} +1 -1
- package/dist/{modules/storage/plugins/memory/memory.update-config.dto.js → plugins/memory-storage/dto/update-config.dto.js} +5 -5
- package/dist/plugins/memory-storage/dto/update-config.dto.js.map +1 -0
- package/dist/{modules/storage/plugins/memory/memory.constants.js → plugins/memory-storage/memory-storage.constants.js} +1 -1
- package/dist/plugins/memory-storage/memory-storage.constants.js.map +1 -0
- package/dist/{modules/storage/plugins/memory/memory.openapi.d.ts → plugins/memory-storage/memory-storage.openapi.d.ts} +1 -1
- package/dist/plugins/memory-storage/memory-storage.openapi.js +7 -0
- package/dist/plugins/memory-storage/memory-storage.openapi.js.map +1 -0
- package/dist/plugins/memory-storage/memory-storage.plugin.d.ts +15 -0
- package/dist/plugins/memory-storage/memory-storage.plugin.js +92 -0
- package/dist/plugins/memory-storage/memory-storage.plugin.js.map +1 -0
- package/dist/{modules/storage/plugins/memory/memory.config.model.d.ts → plugins/memory-storage/models/config.model.d.ts} +1 -1
- package/dist/{modules/storage/plugins/memory/memory.config.model.js → plugins/memory-storage/models/config.model.js} +5 -5
- package/dist/plugins/memory-storage/models/config.model.js.map +1 -0
- package/dist/{modules/storage/plugins/memory → plugins/memory-storage/services}/in-memory-timeseries.store.d.ts +1 -1
- package/dist/{modules/storage/plugins/memory → plugins/memory-storage/services}/in-memory-timeseries.store.js +4 -4
- package/dist/plugins/memory-storage/services/in-memory-timeseries.store.js.map +1 -0
- package/dist/plugins/memory-storage/services/influxql-parser.js.map +1 -0
- package/dist/plugins/memory-storage/services/memory-storage-managed.service.d.ts +14 -0
- package/dist/plugins/memory-storage/services/memory-storage-managed.service.js +87 -0
- package/dist/plugins/memory-storage/services/memory-storage-managed.service.js.map +1 -0
- package/dist/{modules/storage/plugins/memory/memory.plugin.d.ts → plugins/memory-storage/services/memory-storage.storage.d.ts} +3 -3
- package/dist/{modules/storage/plugins/memory/memory.plugin.js → plugins/memory-storage/services/memory-storage.storage.js} +8 -8
- package/dist/plugins/memory-storage/services/memory-storage.storage.js.map +1 -0
- package/dist/plugins/pages-cards/pages-cards.plugin.js +15 -26
- package/dist/plugins/pages-cards/pages-cards.plugin.js.map +1 -1
- package/dist/plugins/pages-device-detail/pages-device-detail.plugin.js +16 -25
- package/dist/plugins/pages-device-detail/pages-device-detail.plugin.js.map +1 -1
- package/dist/plugins/pages-tiles/pages-tiles.plugin.js +15 -26
- package/dist/plugins/pages-tiles/pages-tiles.plugin.js.map +1 -1
- package/dist/plugins/scenes-local/scenes-local.plugin.js +21 -22
- package/dist/plugins/scenes-local/scenes-local.plugin.js.map +1 -1
- package/dist/plugins/simulator/services/scenario-executor.service.d.ts +5 -5
- package/dist/plugins/simulator/services/scenario-executor.service.js +7 -6
- package/dist/plugins/simulator/services/scenario-executor.service.js.map +1 -1
- package/dist/plugins/simulator/services/simulator-actions.service.js +3 -0
- package/dist/plugins/simulator/services/simulator-actions.service.js.map +1 -1
- package/dist/plugins/simulator/simulator.plugin.js +49 -58
- package/dist/plugins/simulator/simulator.plugin.js.map +1 -1
- package/dist/plugins/spaces-home-control/controllers/spaces-domain.controller.d.ts +119 -0
- package/dist/plugins/spaces-home-control/controllers/spaces-domain.controller.js +1958 -0
- package/dist/plugins/spaces-home-control/controllers/spaces-domain.controller.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/climate-intent.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/climate-intent.dto.js +24 -24
- package/dist/plugins/spaces-home-control/dto/climate-intent.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/climate-role.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/climate-role.dto.js +4 -4
- package/dist/plugins/spaces-home-control/dto/climate-role.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/covers-intent.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/covers-intent.dto.js +18 -18
- package/dist/plugins/spaces-home-control/dto/covers-intent.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/covers-role.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/covers-role.dto.js +4 -4
- package/dist/plugins/spaces-home-control/dto/covers-role.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/dto/create-home-control-space.dto.d.ts +8 -0
- package/dist/plugins/spaces-home-control/dto/create-home-control-space.dto.js +85 -0
- package/dist/plugins/spaces-home-control/dto/create-home-control-space.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/lighting-intent.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/lighting-intent.dto.js +34 -34
- package/dist/plugins/spaces-home-control/dto/lighting-intent.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/lighting-role.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/lighting-role.dto.js +4 -4
- package/dist/plugins/spaces-home-control/dto/lighting-role.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/media-activity-binding.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/media-activity-binding.dto.js +4 -4
- package/dist/plugins/spaces-home-control/dto/media-activity-binding.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/sensor-role.dto.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/sensor-role.dto.js +4 -4
- package/dist/plugins/spaces-home-control/dto/sensor-role.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/dto/status-widget.dto.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/suggestion.dto.d.ts +2 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/dto/suggestion.dto.js +5 -4
- package/dist/plugins/spaces-home-control/dto/suggestion.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/dto/update-config.dto.d.ts +5 -0
- package/dist/plugins/spaces-home-control/dto/update-config.dto.js +34 -0
- package/dist/plugins/spaces-home-control/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/dto/update-home-control-space.dto.d.ts +8 -0
- package/dist/plugins/spaces-home-control/dto/update-home-control-space.dto.js +85 -0
- package/dist/plugins/spaces-home-control/dto/update-home-control-space.dto.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/room-space.entity.d.ts +8 -0
- package/dist/plugins/spaces-home-control/entities/room-space.entity.js +91 -0
- package/dist/plugins/spaces-home-control/entities/room-space.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-active-media-activity.entity.d.ts +11 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/entities/space-active-media-activity.entity.js +23 -30
- package/dist/plugins/spaces-home-control/entities/space-active-media-activity.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-climate-role.entity.d.ts +13 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/entities/space-climate-role.entity.js +25 -32
- package/dist/plugins/spaces-home-control/entities/space-climate-role.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-covers-role.entity.d.ts +13 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/entities/space-covers-role.entity.js +27 -34
- package/dist/plugins/spaces-home-control/entities/space-covers-role.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-lighting-role.entity.d.ts +13 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/entities/space-lighting-role.entity.js +27 -34
- package/dist/plugins/spaces-home-control/entities/space-lighting-role.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-media-activity-binding.entity.d.ts +15 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/entities/space-media-activity-binding.entity.js +20 -28
- package/dist/plugins/spaces-home-control/entities/space-media-activity-binding.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/space-sensor-role.entity.d.ts +13 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/entities/space-sensor-role.entity.js +27 -34
- package/dist/plugins/spaces-home-control/entities/space-sensor-role.entity.js.map +1 -0
- package/dist/plugins/spaces-home-control/entities/zone-space.entity.d.ts +8 -0
- package/dist/plugins/spaces-home-control/entities/zone-space.entity.js +91 -0
- package/dist/plugins/spaces-home-control/entities/zone-space.entity.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-activity.listener.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-activity.listener.js +4 -4
- package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-climate-state.listener.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-climate-state.listener.js +6 -5
- package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-lighting-state.listener.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-lighting-state.listener.js +6 -5
- package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-sensor-state.listener.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/space-sensor-state.listener.js +9 -8
- package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/websocket-exchange.listener.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/listeners/websocket-exchange.listener.js +5 -5
- package/dist/plugins/spaces-home-control/listeners/websocket-exchange.listener.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/config.model.d.ts +5 -0
- package/dist/plugins/spaces-home-control/models/config.model.js +49 -0
- package/dist/plugins/spaces-home-control/models/config.model.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/derived-media-endpoint.model.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/derived-media-endpoint.model.js +4 -4
- package/dist/plugins/spaces-home-control/models/derived-media-endpoint.model.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/media-activity-binding.model.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/media-activity-binding.model.js +1 -1
- package/dist/plugins/spaces-home-control/models/media-activity-binding.model.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/media-activity.model.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/media-activity.model.js +6 -6
- package/dist/plugins/spaces-home-control/models/media-activity.model.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/media-routing.model.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/models/media-routing.model.js +4 -4
- package/dist/plugins/spaces-home-control/models/media-routing.model.js.map +1 -0
- package/dist/plugins/spaces-home-control/models/spaces-response.model.d.ts +524 -0
- package/dist/plugins/spaces-home-control/models/spaces-response.model.js +4145 -0
- package/dist/plugins/spaces-home-control/models/spaces-response.model.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/__fixtures__/media-scenario-templates.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/__fixtures__/media-scenario-templates.js +3 -3
- package/dist/plugins/spaces-home-control/services/__fixtures__/media-scenario-templates.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/__fixtures__/media-test-harness.d.ts +1 -1
- package/dist/plugins/spaces-home-control/services/__fixtures__/media-test-harness.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/climate-intent.service.d.ts +5 -5
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/climate-intent.service.js +35 -34
- package/dist/plugins/spaces-home-control/services/climate-intent.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/covers-intent.service.d.ts +5 -5
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/covers-intent.service.js +48 -47
- package/dist/plugins/spaces-home-control/services/covers-intent.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/derived-media-endpoint.service.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/derived-media-endpoint.service.js +28 -27
- package/dist/plugins/spaces-home-control/services/derived-media-endpoint.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/home-control-home-page.resolver.d.ts +4 -0
- package/dist/plugins/spaces-home-control/services/home-control-home-page.resolver.js +20 -0
- package/dist/plugins/spaces-home-control/services/home-control-home-page.resolver.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/home-control-spaces.service.d.ts +24 -0
- package/dist/plugins/spaces-home-control/services/home-control-spaces.service.js +182 -0
- package/dist/plugins/spaces-home-control/services/home-control-spaces.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/lighting-intent.service.d.ts +6 -6
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/lighting-intent.service.js +68 -67
- package/dist/plugins/spaces-home-control/services/lighting-intent.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/media-capability.service.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/media-capability.service.js +20 -19
- package/dist/plugins/spaces-home-control/services/media-capability.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-climate-role.service.d.ts +4 -4
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-climate-role.service.js +18 -17
- package/dist/plugins/spaces-home-control/services/space-climate-role.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-climate-state.service.d.ts +5 -5
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-climate-state.service.js +32 -31
- package/dist/plugins/spaces-home-control/services/space-climate-state.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-context-snapshot.service.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-context-snapshot.service.js +7 -6
- package/dist/plugins/spaces-home-control/services/space-context-snapshot.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-covers-role.service.d.ts +3 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-covers-role.service.js +28 -25
- package/dist/plugins/spaces-home-control/services/space-covers-role.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-covers-state.service.d.ts +4 -4
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-covers-state.service.js +9 -8
- package/dist/plugins/spaces-home-control/services/space-covers-state.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-intent-base.service.d.ts +1 -1
- package/dist/plugins/spaces-home-control/services/space-intent-base.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/services/space-intent.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-lighting-role.service.d.ts +3 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-lighting-role.service.js +25 -22
- package/dist/plugins/spaces-home-control/services/space-lighting-role.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-lighting-state.service.d.ts +3 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-lighting-state.service.js +20 -19
- package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-lighting-tool.service.d.ts +4 -4
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-lighting-tool.service.js +8 -7
- package/dist/plugins/spaces-home-control/services/space-lighting-tool.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-media-activity-binding.service.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-media-activity-binding.service.js +31 -30
- package/dist/plugins/spaces-home-control/services/space-media-activity-binding.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-media-activity.service.d.ts +3 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-media-activity.service.js +38 -37
- package/dist/plugins/spaces-home-control/services/space-media-activity.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-sensor-role.service.d.ts +4 -4
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-sensor-role.service.js +24 -23
- package/dist/plugins/spaces-home-control/services/space-sensor-role.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-sensor-state.service.d.ts +3 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-sensor-state.service.js +19 -18
- package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-suggestion-heartbeat.service.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-suggestion-heartbeat.service.js +10 -9
- package/dist/plugins/spaces-home-control/services/space-suggestion-heartbeat.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-suggestion.service.d.ts +4 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-suggestion.service.js +8 -7
- package/dist/plugins/spaces-home-control/services/space-suggestion.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-undo-history.service.d.ts +3 -3
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-undo-history.service.js +5 -5
- package/dist/plugins/spaces-home-control/services/space-undo-history.service.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/spaces-seeder.service.d.ts +2 -2
- package/dist/{modules/spaces → plugins/spaces-home-control}/services/spaces-seeder.service.js +5 -5
- package/dist/plugins/spaces-home-control/services/spaces-seeder.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.constants.d.ts +297 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.constants.js +1460 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.constants.js.map +1 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.openapi.d.ts +2 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.openapi.js +155 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.openapi.js.map +1 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.d.ts +29 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js +334 -0
- package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js.map +1 -0
- package/dist/plugins/spaces-home-control/spec/index.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/spec/intent-spec-loader.service.d.ts +1 -1
- package/dist/{modules/spaces → plugins/spaces-home-control}/spec/intent-spec-loader.service.js +1 -1
- package/dist/plugins/spaces-home-control/spec/intent-spec-loader.service.js.map +1 -0
- package/dist/plugins/spaces-home-control/spec/intent-spec.types.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/validators/at-least-one-setpoint.validator.js +2 -2
- package/dist/plugins/spaces-home-control/validators/at-least-one-setpoint.validator.js.map +1 -0
- package/dist/plugins/spaces-home-control/validators/setpoint-order-constraint.validator.js.map +1 -0
- package/dist/{modules/spaces → plugins/spaces-home-control}/validators/space-category-constraint.validator.js +1 -1
- package/dist/plugins/spaces-home-control/validators/space-category-constraint.validator.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/controllers/signage-announcements.controller.d.ts +18 -0
- package/dist/plugins/spaces-signage-info-panel/controllers/signage-announcements.controller.js +219 -0
- package/dist/plugins/spaces-signage-info-panel/controllers/signage-announcements.controller.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/dto/create-announcement.dto.d.ts +13 -0
- package/dist/plugins/spaces-signage-info-panel/dto/create-announcement.dto.js +143 -0
- package/dist/plugins/spaces-signage-info-panel/dto/create-announcement.dto.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/dto/create-signage-info-panel-space.dto.d.ts +13 -0
- package/dist/plugins/spaces-signage-info-panel/dto/create-signage-info-panel-space.dto.js +130 -0
- package/dist/plugins/spaces-signage-info-panel/dto/create-signage-info-panel-space.dto.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/dto/reorder-announcements.dto.d.ts +10 -0
- package/dist/plugins/spaces-signage-info-panel/dto/reorder-announcements.dto.js +78 -0
- package/dist/plugins/spaces-signage-info-panel/dto/reorder-announcements.dto.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-announcement.dto.d.ts +12 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-announcement.dto.js +134 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-announcement.dto.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-config.dto.d.ts +5 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-config.dto.js +34 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-signage-info-panel-space.dto.d.ts +13 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-signage-info-panel-space.dto.js +130 -0
- package/dist/plugins/spaces-signage-info-panel/dto/update-signage-info-panel-space.dto.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/entities/signage-announcement.entity.d.ts +13 -0
- package/dist/plugins/spaces-signage-info-panel/entities/signage-announcement.entity.js +161 -0
- package/dist/plugins/spaces-signage-info-panel/entities/signage-announcement.entity.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/entities/signage-info-panel-space.entity.d.ts +13 -0
- package/dist/plugins/spaces-signage-info-panel/entities/signage-info-panel-space.entity.js +147 -0
- package/dist/plugins/spaces-signage-info-panel/entities/signage-info-panel-space.entity.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/models/config.model.d.ts +5 -0
- package/dist/plugins/spaces-signage-info-panel/models/config.model.js +49 -0
- package/dist/plugins/spaces-signage-info-panel/models/config.model.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/models/signage-announcement-response.model.d.ts +8 -0
- package/dist/plugins/spaces-signage-info-panel/models/signage-announcement-response.model.js +46 -0
- package/dist/plugins/spaces-signage-info-panel/models/signage-announcement-response.model.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-announcements.service.d.ts +28 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-announcements.service.js +181 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-announcements.service.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-home-page.resolver.d.ts +4 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-home-page.resolver.js +20 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-home-page.resolver.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-info-panel-reset.service.d.ts +14 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-info-panel-reset.service.js +59 -0
- package/dist/plugins/spaces-signage-info-panel/services/signage-info-panel-reset.service.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.constants.d.ts +17 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.constants.js +23 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.constants.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.exceptions.d.ts +9 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.exceptions.js +25 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.exceptions.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.openapi.d.ts +2 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.openapi.js +31 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.openapi.js.map +1 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.plugin.d.ts +23 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.plugin.js +159 -0
- package/dist/plugins/spaces-signage-info-panel/spaces-signage-info-panel.plugin.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/dto/create-entry-space.dto.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-entry/dto/create-entry-space.dto.js +31 -0
- package/dist/plugins/spaces-synthetic-entry/dto/create-entry-space.dto.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/dto/update-config.dto.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-entry/dto/update-config.dto.js +34 -0
- package/dist/plugins/spaces-synthetic-entry/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/dto/update-entry-space.dto.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-entry/dto/update-entry-space.dto.js +31 -0
- package/dist/plugins/spaces-synthetic-entry/dto/update-entry-space.dto.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/entities/entry-space.entity.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-entry/entities/entry-space.entity.js +39 -0
- package/dist/plugins/spaces-synthetic-entry/entities/entry-space.entity.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/models/config.model.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-entry/models/config.model.js +49 -0
- package/dist/plugins/spaces-synthetic-entry/models/config.model.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.constants.d.ts +7 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.constants.js +11 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.constants.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.openapi.d.ts +2 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.openapi.js +16 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.openapi.js.map +1 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.plugin.d.ts +15 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.plugin.js +124 -0
- package/dist/plugins/spaces-synthetic-entry/spaces-synthetic-entry.plugin.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/dto/create-master-space.dto.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-master/dto/create-master-space.dto.js +31 -0
- package/dist/plugins/spaces-synthetic-master/dto/create-master-space.dto.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/dto/update-config.dto.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-master/dto/update-config.dto.js +34 -0
- package/dist/plugins/spaces-synthetic-master/dto/update-config.dto.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/dto/update-master-space.dto.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-master/dto/update-master-space.dto.js +31 -0
- package/dist/plugins/spaces-synthetic-master/dto/update-master-space.dto.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/entities/master-space.entity.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-master/entities/master-space.entity.js +39 -0
- package/dist/plugins/spaces-synthetic-master/entities/master-space.entity.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/models/config.model.d.ts +5 -0
- package/dist/plugins/spaces-synthetic-master/models/config.model.js +49 -0
- package/dist/plugins/spaces-synthetic-master/models/config.model.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.constants.d.ts +7 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.constants.js +11 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.constants.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.openapi.d.ts +2 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.openapi.js +16 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.openapi.js.map +1 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.plugin.d.ts +15 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.plugin.js +124 -0
- package/dist/plugins/spaces-synthetic-master/spaces-synthetic-master.plugin.js.map +1 -0
- package/dist/plugins/tiles-device-preview/tiles-device-preview.plugin.js +16 -22
- package/dist/plugins/tiles-device-preview/tiles-device-preview.plugin.js.map +1 -1
- package/dist/plugins/tiles-scene/tiles-scene.plugin.js +15 -21
- package/dist/plugins/tiles-scene/tiles-scene.plugin.js.map +1 -1
- package/dist/plugins/tiles-time/tiles-time.plugin.js +13 -19
- package/dist/plugins/tiles-time/tiles-time.plugin.js.map +1 -1
- package/dist/plugins/tiles-weather/tiles-weather.plugin.js +16 -19
- package/dist/plugins/tiles-weather/tiles-weather.plugin.js.map +1 -1
- package/dist/plugins/weather-open-meteo/weather-open-meteo.plugin.js +32 -21
- package/dist/plugins/weather-open-meteo/weather-open-meteo.plugin.js.map +1 -1
- package/dist/plugins/weather-openweathermap/weather-openweathermap.plugin.js +22 -23
- package/dist/plugins/weather-openweathermap/weather-openweathermap.plugin.js.map +1 -1
- package/dist/plugins/weather-openweathermap-onecall/weather-openweathermap-onecall.plugin.js +27 -23
- package/dist/plugins/weather-openweathermap-onecall/weather-openweathermap-onecall.plugin.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +10 -6
- package/dist/modules/spaces/dto/climate-intent.dto.js.map +0 -1
- package/dist/modules/spaces/dto/climate-role.dto.js.map +0 -1
- package/dist/modules/spaces/dto/covers-intent.dto.js.map +0 -1
- package/dist/modules/spaces/dto/covers-role.dto.js.map +0 -1
- package/dist/modules/spaces/dto/lighting-intent.dto.js.map +0 -1
- package/dist/modules/spaces/dto/lighting-role.dto.js.map +0 -1
- package/dist/modules/spaces/dto/media-activity-binding.dto.js.map +0 -1
- package/dist/modules/spaces/dto/sensor-role.dto.js.map +0 -1
- package/dist/modules/spaces/dto/status-widget.dto.js.map +0 -1
- package/dist/modules/spaces/dto/suggestion.dto.js.map +0 -1
- package/dist/modules/spaces/entities/space-active-media-activity.entity.d.ts +0 -12
- package/dist/modules/spaces/entities/space-active-media-activity.entity.js.map +0 -1
- package/dist/modules/spaces/entities/space-climate-role.entity.d.ts +0 -14
- package/dist/modules/spaces/entities/space-climate-role.entity.js.map +0 -1
- package/dist/modules/spaces/entities/space-covers-role.entity.d.ts +0 -14
- package/dist/modules/spaces/entities/space-covers-role.entity.js.map +0 -1
- package/dist/modules/spaces/entities/space-lighting-role.entity.d.ts +0 -14
- package/dist/modules/spaces/entities/space-lighting-role.entity.js.map +0 -1
- package/dist/modules/spaces/entities/space-media-activity-binding.entity.d.ts +0 -16
- package/dist/modules/spaces/entities/space-media-activity-binding.entity.js.map +0 -1
- package/dist/modules/spaces/entities/space-sensor-role.entity.d.ts +0 -14
- package/dist/modules/spaces/entities/space-sensor-role.entity.js.map +0 -1
- package/dist/modules/spaces/listeners/space-activity.listener.js.map +0 -1
- package/dist/modules/spaces/listeners/space-climate-state.listener.js.map +0 -1
- package/dist/modules/spaces/listeners/space-lighting-state.listener.js.map +0 -1
- package/dist/modules/spaces/listeners/space-sensor-state.listener.js.map +0 -1
- package/dist/modules/spaces/listeners/websocket-exchange.listener.js.map +0 -1
- package/dist/modules/spaces/models/derived-media-endpoint.model.js.map +0 -1
- package/dist/modules/spaces/models/media-activity-binding.model.js.map +0 -1
- package/dist/modules/spaces/models/media-activity.model.js.map +0 -1
- package/dist/modules/spaces/models/media-routing.model.js.map +0 -1
- package/dist/modules/spaces/services/__fixtures__/media-scenario-templates.js.map +0 -1
- package/dist/modules/spaces/services/__fixtures__/media-test-harness.js.map +0 -1
- package/dist/modules/spaces/services/climate-intent.service.js.map +0 -1
- package/dist/modules/spaces/services/covers-intent.service.js.map +0 -1
- package/dist/modules/spaces/services/derived-media-endpoint.service.js.map +0 -1
- package/dist/modules/spaces/services/lighting-intent.service.js.map +0 -1
- package/dist/modules/spaces/services/media-capability.service.js.map +0 -1
- package/dist/modules/spaces/services/space-climate-role.service.js.map +0 -1
- package/dist/modules/spaces/services/space-climate-state.service.js.map +0 -1
- package/dist/modules/spaces/services/space-context-snapshot.service.js.map +0 -1
- package/dist/modules/spaces/services/space-covers-role.service.js.map +0 -1
- package/dist/modules/spaces/services/space-covers-state.service.js.map +0 -1
- package/dist/modules/spaces/services/space-intent-base.service.js.map +0 -1
- package/dist/modules/spaces/services/space-intent.service.js.map +0 -1
- package/dist/modules/spaces/services/space-lighting-role.service.js.map +0 -1
- package/dist/modules/spaces/services/space-lighting-state.service.js.map +0 -1
- package/dist/modules/spaces/services/space-lighting-tool.service.js.map +0 -1
- package/dist/modules/spaces/services/space-media-activity-binding.service.js.map +0 -1
- package/dist/modules/spaces/services/space-media-activity.service.js.map +0 -1
- package/dist/modules/spaces/services/space-sensor-role.service.js.map +0 -1
- package/dist/modules/spaces/services/space-sensor-state.service.js.map +0 -1
- package/dist/modules/spaces/services/space-suggestion-heartbeat.service.js.map +0 -1
- package/dist/modules/spaces/services/space-suggestion.service.js.map +0 -1
- package/dist/modules/spaces/services/space-undo-history.service.js.map +0 -1
- package/dist/modules/spaces/services/spaces-seeder.service.js.map +0 -1
- package/dist/modules/spaces/spec/definitions/climate-intents.yaml +0 -94
- package/dist/modules/spaces/spec/definitions/covers-modes.yaml +0 -83
- package/dist/modules/spaces/spec/definitions/enums.yaml +0 -119
- package/dist/modules/spaces/spec/definitions/lighting-intents.yaml +0 -181
- package/dist/modules/spaces/spec/definitions/lighting-modes.yaml +0 -119
- package/dist/modules/spaces/spec/definitions/suggestions.yaml +0 -47
- package/dist/modules/spaces/spec/index.js.map +0 -1
- package/dist/modules/spaces/spec/intent-spec-loader.service.js.map +0 -1
- package/dist/modules/spaces/spec/intent-spec.types.js.map +0 -1
- package/dist/modules/spaces/validators/at-least-one-setpoint.validator.js.map +0 -1
- package/dist/modules/spaces/validators/setpoint-order-constraint.validator.js.map +0 -1
- package/dist/modules/spaces/validators/space-category-constraint.validator.js.map +0 -1
- package/dist/modules/storage/plugins/influx-v1/influx-v1.config.model.js.map +0 -1
- package/dist/modules/storage/plugins/influx-v1/influx-v1.constants.js.map +0 -1
- package/dist/modules/storage/plugins/influx-v1/influx-v1.module.d.ts +0 -17
- package/dist/modules/storage/plugins/influx-v1/influx-v1.module.js +0 -94
- package/dist/modules/storage/plugins/influx-v1/influx-v1.module.js.map +0 -1
- package/dist/modules/storage/plugins/influx-v1/influx-v1.openapi.js +0 -7
- package/dist/modules/storage/plugins/influx-v1/influx-v1.openapi.js.map +0 -1
- package/dist/modules/storage/plugins/influx-v1/influx-v1.plugin.js.map +0 -1
- package/dist/modules/storage/plugins/influx-v1/influx-v1.update-config.dto.js.map +0 -1
- package/dist/modules/storage/plugins/memory/in-memory-timeseries.store.js.map +0 -1
- package/dist/modules/storage/plugins/memory/influxql-parser.js.map +0 -1
- package/dist/modules/storage/plugins/memory/memory.config.model.js.map +0 -1
- package/dist/modules/storage/plugins/memory/memory.constants.js.map +0 -1
- package/dist/modules/storage/plugins/memory/memory.module.d.ts +0 -13
- package/dist/modules/storage/plugins/memory/memory.module.js +0 -75
- package/dist/modules/storage/plugins/memory/memory.module.js.map +0 -1
- package/dist/modules/storage/plugins/memory/memory.openapi.js +0 -7
- package/dist/modules/storage/plugins/memory/memory.openapi.js.map +0 -1
- package/dist/modules/storage/plugins/memory/memory.plugin.js.map +0 -1
- package/dist/modules/storage/plugins/memory/memory.update-config.dto.js.map +0 -1
- /package/dist/{modules/storage/plugins → plugins}/influx-v1/influx-v1.constants.d.ts +0 -0
- /package/dist/{modules/storage/plugins → plugins}/influx-v1/influx-v1.constants.js +0 -0
- /package/dist/{modules/storage/plugins/memory/memory.constants.d.ts → plugins/memory-storage/memory-storage.constants.d.ts} +0 -0
- /package/dist/{modules/storage/plugins/memory → plugins/memory-storage/services}/influxql-parser.d.ts +0 -0
- /package/dist/{modules/storage/plugins/memory → plugins/memory-storage/services}/influxql-parser.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/dto/status-widget.dto.d.ts +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/dto/status-widget.dto.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/services/__fixtures__/media-test-harness.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-intent-base.service.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-intent.service.d.ts +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/services/space-intent.service.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/spec/index.d.ts +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/spec/index.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/spec/intent-spec.types.d.ts +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/spec/intent-spec.types.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/validators/at-least-one-setpoint.validator.d.ts +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/validators/setpoint-order-constraint.validator.d.ts +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/validators/setpoint-order-constraint.validator.js +0 -0
- /package/dist/{modules/spaces → plugins/spaces-home-control}/validators/space-category-constraint.validator.d.ts +0 -0
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.BackupService = exports.BackupArchiveError = void 0;
|
|
16
|
+
const child_process_1 = require("child_process");
|
|
17
|
+
const fs_1 = require("fs");
|
|
18
|
+
const path_1 = require("path");
|
|
19
|
+
const typeorm_1 = require("typeorm");
|
|
20
|
+
const util_1 = require("util");
|
|
21
|
+
const uuid_1 = require("uuid");
|
|
22
|
+
const common_1 = require("@nestjs/common");
|
|
23
|
+
const config_1 = require("@nestjs/config");
|
|
24
|
+
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
25
|
+
const typeorm_2 = require("@nestjs/typeorm");
|
|
26
|
+
const logger_1 = require("../../../common/logger");
|
|
27
|
+
const config_utils_1 = require("../../../common/utils/config.utils");
|
|
28
|
+
const config_constants_1 = require("../../config/config.constants");
|
|
29
|
+
const system_constants_1 = require("../system.constants");
|
|
30
|
+
const backup_contribution_registry_service_1 = require("./backup-contribution-registry.service");
|
|
31
|
+
const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
32
|
+
const packageJson = JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../../../../../package.json'), 'utf-8'));
|
|
33
|
+
const MAX_BACKUPS = 5;
|
|
34
|
+
class BackupArchiveError extends Error {
|
|
35
|
+
constructor(message) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.name = 'BackupArchiveError';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.BackupArchiveError = BackupArchiveError;
|
|
41
|
+
const ALLOWED_CONTRIBUTION_TYPES = ['file', 'directory'];
|
|
42
|
+
const UUID_V4_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
43
|
+
function parseStoredMetadata(raw) {
|
|
44
|
+
if (typeof raw !== 'object' || raw === null) {
|
|
45
|
+
throw new BackupArchiveError('Invalid backup archive: metadata is not an object');
|
|
46
|
+
}
|
|
47
|
+
const candidate = raw;
|
|
48
|
+
const isNonEmptyString = (value) => typeof value === 'string' && value.length > 0;
|
|
49
|
+
if (!isNonEmptyString(candidate.id) ||
|
|
50
|
+
!isNonEmptyString(candidate.name) ||
|
|
51
|
+
!isNonEmptyString(candidate.version) ||
|
|
52
|
+
!isNonEmptyString(candidate.createdAt)) {
|
|
53
|
+
throw new BackupArchiveError('Invalid backup archive: metadata is missing required fields');
|
|
54
|
+
}
|
|
55
|
+
if (!UUID_V4_REGEX.test(candidate.id)) {
|
|
56
|
+
throw new BackupArchiveError('Invalid backup archive: metadata.id is not a valid UUIDv4');
|
|
57
|
+
}
|
|
58
|
+
if (!Array.isArray(candidate.contributions)) {
|
|
59
|
+
throw new BackupArchiveError('Invalid backup archive: metadata.contributions is not an array');
|
|
60
|
+
}
|
|
61
|
+
const contributions = candidate.contributions.map((entry, index) => {
|
|
62
|
+
if (typeof entry !== 'object' || entry === null) {
|
|
63
|
+
throw new BackupArchiveError(`Invalid backup archive: metadata.contributions[${index}] is not an object`);
|
|
64
|
+
}
|
|
65
|
+
const contribution = entry;
|
|
66
|
+
if (typeof contribution.source !== 'string' ||
|
|
67
|
+
typeof contribution.label !== 'string' ||
|
|
68
|
+
typeof contribution.type !== 'string') {
|
|
69
|
+
throw new BackupArchiveError(`Invalid backup archive: metadata.contributions[${index}] is missing required fields`);
|
|
70
|
+
}
|
|
71
|
+
if (!ALLOWED_CONTRIBUTION_TYPES.includes(contribution.type)) {
|
|
72
|
+
throw new BackupArchiveError(`Invalid backup archive: metadata.contributions[${index}].type must be "file" or "directory"`);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
source: contribution.source,
|
|
76
|
+
label: contribution.label,
|
|
77
|
+
type: contribution.type,
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
id: candidate.id,
|
|
82
|
+
name: candidate.name,
|
|
83
|
+
version: candidate.version,
|
|
84
|
+
createdAt: candidate.createdAt,
|
|
85
|
+
contributions,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
let BackupService = class BackupService {
|
|
89
|
+
constructor(configService, contributionRegistry, eventEmitter, dataSource) {
|
|
90
|
+
this.configService = configService;
|
|
91
|
+
this.contributionRegistry = contributionRegistry;
|
|
92
|
+
this.eventEmitter = eventEmitter;
|
|
93
|
+
this.dataSource = dataSource;
|
|
94
|
+
this.logger = (0, logger_1.createExtensionLogger)(system_constants_1.SYSTEM_MODULE_NAME, 'BackupService');
|
|
95
|
+
const dbDir = (0, config_utils_1.getEnvValue)(this.configService, 'FB_DB_PATH', (0, path_1.resolve)(__dirname, '../../../../../../var/db'));
|
|
96
|
+
this.dbPath = (0, path_1.join)(dbDir, 'database.sqlite');
|
|
97
|
+
const dataDir = (0, config_utils_1.getEnvValue)(this.configService, 'FB_DATA_DIR', (0, path_1.resolve)(__dirname, '../../../../../../var'));
|
|
98
|
+
this.backupsDir = (0, path_1.join)(dataDir, 'backups');
|
|
99
|
+
}
|
|
100
|
+
ensureBackupsDir() {
|
|
101
|
+
if (!(0, fs_1.existsSync)(this.backupsDir)) {
|
|
102
|
+
(0, fs_1.mkdirSync)(this.backupsDir, { recursive: true });
|
|
103
|
+
this.logger.debug(`Created backups directory: ${this.backupsDir}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async create(name) {
|
|
107
|
+
this.ensureBackupsDir();
|
|
108
|
+
const id = (0, uuid_1.v4)();
|
|
109
|
+
const trimmedName = name?.trim() ?? '';
|
|
110
|
+
const backupName = trimmedName.length > 0 ? trimmedName : `backup-${new Date().toISOString().replace(/[:.]/g, '-')}`;
|
|
111
|
+
const tempDir = (0, path_1.join)(this.backupsDir, `temp-${id}`);
|
|
112
|
+
const tarPath = (0, path_1.join)(this.backupsDir, `${id}.tar.gz`);
|
|
113
|
+
let sidecarPath = null;
|
|
114
|
+
let fullMetadata;
|
|
115
|
+
this.logger.debug(`Creating backup id=${id} name=${backupName}`);
|
|
116
|
+
try {
|
|
117
|
+
(0, fs_1.mkdirSync)(tempDir, { recursive: true });
|
|
118
|
+
if ((0, fs_1.existsSync)(this.dbPath)) {
|
|
119
|
+
const backupDbPath = (0, path_1.join)(tempDir, 'database.sqlite');
|
|
120
|
+
try {
|
|
121
|
+
const escapedBackupPath = backupDbPath.replace(/'/g, "''");
|
|
122
|
+
await execFileAsync('sqlite3', [this.dbPath, `.backup '${escapedBackupPath}'`]);
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
const err = error;
|
|
126
|
+
if (err.code !== 'ENOENT') {
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
this.logger.warn('sqlite3 CLI not found — falling back to copyFileSync (unsafe under concurrent writes)');
|
|
130
|
+
(0, fs_1.copyFileSync)(this.dbPath, backupDbPath);
|
|
131
|
+
}
|
|
132
|
+
this.logger.debug('Database snapshot created for backup');
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.logger.warn(`Database file not found at ${this.dbPath}, skipping`);
|
|
136
|
+
}
|
|
137
|
+
const contributions = this.contributionRegistry.getContributions();
|
|
138
|
+
const includedContributions = [];
|
|
139
|
+
for (const contribution of contributions) {
|
|
140
|
+
if (!(0, fs_1.existsSync)(contribution.path)) {
|
|
141
|
+
if (contribution.optional) {
|
|
142
|
+
this.logger.debug(`Optional contribution not found, skipping: ${contribution.path}`);
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
throw new Error(`Required backup contribution is missing: ${contribution.label} (${contribution.source}) at ${contribution.path}`);
|
|
146
|
+
}
|
|
147
|
+
const safeSource = contribution.source.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
148
|
+
const safeLabel = (contribution.label || 'default').replace(/[^a-zA-Z0-9_-]/g, '_') || 'default';
|
|
149
|
+
const contributionDir = (0, path_1.join)(tempDir, 'contributions', safeSource, safeLabel);
|
|
150
|
+
(0, fs_1.mkdirSync)(contributionDir, { recursive: true });
|
|
151
|
+
if (contribution.type === 'file') {
|
|
152
|
+
const fileName = (contribution.path.split('/').pop() || 'file').replace(/[^a-zA-Z0-9._-]/g, '_');
|
|
153
|
+
(0, fs_1.copyFileSync)(contribution.path, (0, path_1.join)(contributionDir, fileName));
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
const dirName = (contribution.path.split('/').pop() || 'dir').replace(/[^a-zA-Z0-9._-]/g, '_');
|
|
157
|
+
const sourceRoot = contribution.path;
|
|
158
|
+
const excludeSet = new Set(contribution.exclude ?? []);
|
|
159
|
+
(0, fs_1.cpSync)(contribution.path, (0, path_1.join)(contributionDir, dirName), {
|
|
160
|
+
recursive: true,
|
|
161
|
+
filter: (src) => {
|
|
162
|
+
if (excludeSet.size === 0 || src === sourceRoot) {
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
const rel = (0, path_1.relative)(sourceRoot, src);
|
|
166
|
+
const firstSegment = rel.split(path_1.sep)[0];
|
|
167
|
+
return !excludeSet.has(firstSegment);
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
includedContributions.push({
|
|
172
|
+
source: contribution.source,
|
|
173
|
+
label: contribution.label,
|
|
174
|
+
type: contribution.type,
|
|
175
|
+
});
|
|
176
|
+
this.logger.debug(`Copied contribution: ${contribution.label} from ${contribution.source}`);
|
|
177
|
+
}
|
|
178
|
+
const metadata = {
|
|
179
|
+
id,
|
|
180
|
+
name: backupName,
|
|
181
|
+
version: packageJson.version,
|
|
182
|
+
createdAt: new Date().toISOString(),
|
|
183
|
+
contributions: includedContributions,
|
|
184
|
+
};
|
|
185
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(tempDir, 'metadata.json'), JSON.stringify(metadata, null, 2));
|
|
186
|
+
await execFileAsync('tar', ['-czf', tarPath, '-C', tempDir, '.']);
|
|
187
|
+
const stats = (0, fs_1.statSync)(tarPath);
|
|
188
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
189
|
+
this.writeMetadataSidecar(id, metadata);
|
|
190
|
+
sidecarPath = this.getMetadataSidecarPath(id);
|
|
191
|
+
fullMetadata = {
|
|
192
|
+
...metadata,
|
|
193
|
+
sizeBytes: stats.size,
|
|
194
|
+
};
|
|
195
|
+
this.logger.log(`Backup created successfully: id=${id}, size=${stats.size} bytes`);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
199
|
+
if ((0, fs_1.existsSync)(tarPath)) {
|
|
200
|
+
(0, fs_1.rmSync)(tarPath, { force: true });
|
|
201
|
+
}
|
|
202
|
+
if (sidecarPath && (0, fs_1.existsSync)(sidecarPath)) {
|
|
203
|
+
(0, fs_1.rmSync)(sidecarPath, { force: true });
|
|
204
|
+
}
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
try {
|
|
208
|
+
await this.cleanupOldBackups(id);
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
const err = error;
|
|
212
|
+
this.logger.warn(`Retention sweep failed after creating backup ${id}: ${err.message}`);
|
|
213
|
+
}
|
|
214
|
+
return fullMetadata;
|
|
215
|
+
}
|
|
216
|
+
async list() {
|
|
217
|
+
if (!(0, fs_1.existsSync)(this.backupsDir)) {
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
const files = (0, fs_1.readdirSync)(this.backupsDir).filter((f) => f.endsWith('.tar.gz') && !f.startsWith('upload-'));
|
|
221
|
+
const backups = [];
|
|
222
|
+
for (const file of files) {
|
|
223
|
+
const id = file.replace('.tar.gz', '');
|
|
224
|
+
try {
|
|
225
|
+
const metadata = await this.getMetadata(id);
|
|
226
|
+
if (metadata) {
|
|
227
|
+
backups.push(metadata);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
this.logger.warn(`Failed to read metadata from backup ${file}`, { error });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
backups.sort((a, b) => this.getCreatedAtMs(b.createdAt) - this.getCreatedAtMs(a.createdAt));
|
|
235
|
+
return backups;
|
|
236
|
+
}
|
|
237
|
+
getCreatedAtMs(createdAt) {
|
|
238
|
+
const ms = new Date(createdAt).getTime();
|
|
239
|
+
return Number.isFinite(ms) ? ms : 0;
|
|
240
|
+
}
|
|
241
|
+
getBackupPath(id) {
|
|
242
|
+
return (0, path_1.join)(this.backupsDir, `${id}.tar.gz`);
|
|
243
|
+
}
|
|
244
|
+
delete(id) {
|
|
245
|
+
const tarPath = this.getBackupPath(id);
|
|
246
|
+
if (!(0, fs_1.existsSync)(tarPath)) {
|
|
247
|
+
throw new Error(`Backup not found: ${id}`);
|
|
248
|
+
}
|
|
249
|
+
(0, fs_1.rmSync)(tarPath, { force: true });
|
|
250
|
+
const sidecarPath = this.getMetadataSidecarPath(id);
|
|
251
|
+
if ((0, fs_1.existsSync)(sidecarPath)) {
|
|
252
|
+
(0, fs_1.rmSync)(sidecarPath, { force: true });
|
|
253
|
+
}
|
|
254
|
+
this.logger.log(`Backup deleted: id=${id}`);
|
|
255
|
+
}
|
|
256
|
+
async prepareRestore(id) {
|
|
257
|
+
const tarPath = this.getBackupPath(id);
|
|
258
|
+
if (!(0, fs_1.existsSync)(tarPath)) {
|
|
259
|
+
throw new Error(`Backup not found: ${id}`);
|
|
260
|
+
}
|
|
261
|
+
const tempDir = (0, path_1.join)(this.backupsDir, `restore-${id}-${(0, uuid_1.v4)()}`);
|
|
262
|
+
try {
|
|
263
|
+
(0, fs_1.mkdirSync)(tempDir, { recursive: true });
|
|
264
|
+
const workingArchive = (0, path_1.join)(tempDir, 'archive.tar.gz');
|
|
265
|
+
this.pinArchive(tarPath, workingArchive);
|
|
266
|
+
await this.validateArchiveSafety(workingArchive);
|
|
267
|
+
await execFileAsync('tar', [
|
|
268
|
+
'--no-same-owner',
|
|
269
|
+
'--no-same-permissions',
|
|
270
|
+
'-xzf',
|
|
271
|
+
workingArchive,
|
|
272
|
+
'-C',
|
|
273
|
+
tempDir,
|
|
274
|
+
'./metadata.json',
|
|
275
|
+
]);
|
|
276
|
+
const metadataPath = (0, path_1.join)(tempDir, 'metadata.json');
|
|
277
|
+
if (!(0, fs_1.existsSync)(metadataPath)) {
|
|
278
|
+
throw new BackupArchiveError('Invalid backup: metadata.json not found');
|
|
279
|
+
}
|
|
280
|
+
const storedMetadata = parseStoredMetadata(JSON.parse(this.readExtractedFileSafely(metadataPath)));
|
|
281
|
+
if (storedMetadata.id !== id) {
|
|
282
|
+
throw new BackupArchiveError(`Invalid backup archive ${id}: metadata.id "${storedMetadata.id}" does not match filename`);
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
metadata: {
|
|
286
|
+
...storedMetadata,
|
|
287
|
+
sizeBytes: (0, fs_1.statSync)(workingArchive).size,
|
|
288
|
+
},
|
|
289
|
+
workingArchive,
|
|
290
|
+
tempDir,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
295
|
+
throw error;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
async restore(prepared) {
|
|
299
|
+
const { workingArchive, tempDir, metadata } = prepared;
|
|
300
|
+
this.logger.log(`Restoring backup id=${metadata.id}`);
|
|
301
|
+
let pointOfNoReturn = false;
|
|
302
|
+
try {
|
|
303
|
+
await execFileAsync('tar', ['--no-same-owner', '--no-same-permissions', '-xzf', workingArchive, '-C', tempDir]);
|
|
304
|
+
if (metadata.contributions && metadata.contributions.length > 0) {
|
|
305
|
+
const registrations = this.contributionRegistry.getRegistrations();
|
|
306
|
+
const contributionKey = (source, label) => `${source}\u0000${label}`;
|
|
307
|
+
const registrationByKey = new Map(registrations.map((r) => [contributionKey(r.source, r.label), r]));
|
|
308
|
+
const staticPass = [];
|
|
309
|
+
const lazyPass = [];
|
|
310
|
+
for (const contribution of metadata.contributions) {
|
|
311
|
+
const registration = registrationByKey.get(contributionKey(contribution.source, contribution.label));
|
|
312
|
+
if (registration && typeof registration.path === 'function') {
|
|
313
|
+
lazyPass.push(contribution);
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
staticPass.push(contribution);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const restoreContribution = (contribution) => {
|
|
320
|
+
const registration = registrationByKey.get(contributionKey(contribution.source, contribution.label));
|
|
321
|
+
if (!registration) {
|
|
322
|
+
this.logger.warn(`Skipping unregistered contribution: ${contribution.source} (${contribution.label})`);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
const safeSource = contribution.source.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
326
|
+
const safeLabel = (contribution.label || 'default').replace(/[^a-zA-Z0-9_-]/g, '_') || 'default';
|
|
327
|
+
const contributionDir = (0, path_1.join)(tempDir, 'contributions', safeSource, safeLabel);
|
|
328
|
+
if (!(0, fs_1.existsSync)(contributionDir)) {
|
|
329
|
+
throw new BackupArchiveError(`Invalid backup: contribution ${contribution.label} not present in archive`);
|
|
330
|
+
}
|
|
331
|
+
const entries = (0, fs_1.readdirSync)(contributionDir);
|
|
332
|
+
if (entries.length !== 1) {
|
|
333
|
+
throw new BackupArchiveError(`Invalid backup: contribution ${contribution.label} has unexpected archive layout (${entries.length} entries)`);
|
|
334
|
+
}
|
|
335
|
+
const sourcePath = (0, path_1.join)(contributionDir, entries[0]);
|
|
336
|
+
const targetPath = typeof registration.path === 'function' ? registration.path() : registration.path;
|
|
337
|
+
const targetDir = (0, path_1.resolve)(targetPath, '..');
|
|
338
|
+
if (!(0, fs_1.existsSync)(targetDir)) {
|
|
339
|
+
(0, fs_1.mkdirSync)(targetDir, { recursive: true });
|
|
340
|
+
}
|
|
341
|
+
pointOfNoReturn = true;
|
|
342
|
+
if (registration.type === 'directory') {
|
|
343
|
+
const excludeSet = new Set(registration.exclude ?? []);
|
|
344
|
+
if (excludeSet.size === 0) {
|
|
345
|
+
if ((0, fs_1.existsSync)(targetPath)) {
|
|
346
|
+
(0, fs_1.rmSync)(targetPath, { recursive: true, force: true });
|
|
347
|
+
}
|
|
348
|
+
(0, fs_1.cpSync)(sourcePath, targetPath, { recursive: true });
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
(0, fs_1.mkdirSync)(targetPath, { recursive: true });
|
|
352
|
+
for (const entry of (0, fs_1.readdirSync)(targetPath)) {
|
|
353
|
+
if (excludeSet.has(entry)) {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
(0, fs_1.rmSync)((0, path_1.join)(targetPath, entry), { recursive: true, force: true });
|
|
357
|
+
}
|
|
358
|
+
for (const entry of (0, fs_1.readdirSync)(sourcePath)) {
|
|
359
|
+
if (excludeSet.has(entry)) {
|
|
360
|
+
this.logger.warn(`Skipping excluded entry "${entry}" found in archive for contribution ${contribution.label}`);
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
(0, fs_1.cpSync)((0, path_1.join)(sourcePath, entry), (0, path_1.join)(targetPath, entry), { recursive: true });
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
(0, fs_1.copyFileSync)(sourcePath, targetPath);
|
|
369
|
+
}
|
|
370
|
+
this.logger.debug(`Restored contribution: ${contribution.label} to ${targetPath}`);
|
|
371
|
+
};
|
|
372
|
+
for (const contribution of staticPass) {
|
|
373
|
+
restoreContribution(contribution);
|
|
374
|
+
}
|
|
375
|
+
if (lazyPass.length > 0) {
|
|
376
|
+
this.eventEmitter.emit(config_constants_1.EventType.CONFIG_RELOAD);
|
|
377
|
+
for (const contribution of lazyPass) {
|
|
378
|
+
restoreContribution(contribution);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const backupDbPath = (0, path_1.join)(tempDir, 'database.sqlite');
|
|
383
|
+
if ((0, fs_1.existsSync)(backupDbPath)) {
|
|
384
|
+
pointOfNoReturn = true;
|
|
385
|
+
if (this.dataSource.isInitialized) {
|
|
386
|
+
await this.dataSource.destroy();
|
|
387
|
+
}
|
|
388
|
+
const dbDir = (0, path_1.resolve)(this.dbPath, '..');
|
|
389
|
+
if (!(0, fs_1.existsSync)(dbDir)) {
|
|
390
|
+
(0, fs_1.mkdirSync)(dbDir, { recursive: true });
|
|
391
|
+
}
|
|
392
|
+
(0, fs_1.copyFileSync)(backupDbPath, this.dbPath);
|
|
393
|
+
const walPath = `${this.dbPath}-wal`;
|
|
394
|
+
const shmPath = `${this.dbPath}-shm`;
|
|
395
|
+
if ((0, fs_1.existsSync)(walPath)) {
|
|
396
|
+
(0, fs_1.rmSync)(walPath, { force: true });
|
|
397
|
+
}
|
|
398
|
+
if ((0, fs_1.existsSync)(shmPath)) {
|
|
399
|
+
(0, fs_1.rmSync)(shmPath, { force: true });
|
|
400
|
+
}
|
|
401
|
+
this.logger.log('Database restored from backup');
|
|
402
|
+
}
|
|
403
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
404
|
+
this.logger.log(`Backup restored successfully: id=${metadata.id}. Ready for process restart.`);
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
408
|
+
if (pointOfNoReturn) {
|
|
409
|
+
this.logger.error(`Backup restore failed after mutating live state: ${error.message}. Exiting for restart.`, error.stack);
|
|
410
|
+
process.exit(1);
|
|
411
|
+
}
|
|
412
|
+
throw error;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
async getMetadata(id) {
|
|
416
|
+
const tarPath = this.getBackupPath(id);
|
|
417
|
+
if (!(0, fs_1.existsSync)(tarPath)) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
const stats = (0, fs_1.statSync)(tarPath);
|
|
421
|
+
const sidecar = this.readMetadataSidecar(id);
|
|
422
|
+
if (sidecar) {
|
|
423
|
+
if (sidecar.id !== id) {
|
|
424
|
+
throw new BackupArchiveError(`Invalid backup sidecar for ${id}: metadata.id "${sidecar.id}" does not match filename`);
|
|
425
|
+
}
|
|
426
|
+
return { ...sidecar, sizeBytes: stats.size };
|
|
427
|
+
}
|
|
428
|
+
const tempDir = (0, path_1.join)(this.backupsDir, `meta-${id}`);
|
|
429
|
+
try {
|
|
430
|
+
(0, fs_1.mkdirSync)(tempDir, { recursive: true });
|
|
431
|
+
const workingArchive = (0, path_1.join)(tempDir, 'archive.tar.gz');
|
|
432
|
+
this.pinArchive(tarPath, workingArchive);
|
|
433
|
+
await this.validateArchiveSafety(workingArchive);
|
|
434
|
+
await execFileAsync('tar', [
|
|
435
|
+
'--no-same-owner',
|
|
436
|
+
'--no-same-permissions',
|
|
437
|
+
'-xzf',
|
|
438
|
+
workingArchive,
|
|
439
|
+
'-C',
|
|
440
|
+
tempDir,
|
|
441
|
+
'./metadata.json',
|
|
442
|
+
]);
|
|
443
|
+
const metadataPath = (0, path_1.join)(tempDir, 'metadata.json');
|
|
444
|
+
if (!(0, fs_1.existsSync)(metadataPath)) {
|
|
445
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
const metadata = parseStoredMetadata(JSON.parse(this.readExtractedFileSafely(metadataPath)));
|
|
449
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
450
|
+
if (metadata.id !== id) {
|
|
451
|
+
throw new BackupArchiveError(`Invalid backup archive ${id}: metadata.id "${metadata.id}" does not match filename`);
|
|
452
|
+
}
|
|
453
|
+
try {
|
|
454
|
+
this.writeMetadataSidecar(id, metadata);
|
|
455
|
+
}
|
|
456
|
+
catch (error) {
|
|
457
|
+
this.logger.warn(`Failed to cache metadata sidecar for backup ${id}`, { error });
|
|
458
|
+
}
|
|
459
|
+
return {
|
|
460
|
+
...metadata,
|
|
461
|
+
sizeBytes: stats.size,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
catch (error) {
|
|
465
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
466
|
+
if (error instanceof BackupArchiveError) {
|
|
467
|
+
throw error;
|
|
468
|
+
}
|
|
469
|
+
this.logger.warn(`Failed to extract metadata from backup ${id}`, { error });
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
pinArchive(sourcePath, destPath) {
|
|
474
|
+
try {
|
|
475
|
+
(0, fs_1.linkSync)(sourcePath, destPath);
|
|
476
|
+
}
|
|
477
|
+
catch (error) {
|
|
478
|
+
const err = error;
|
|
479
|
+
if (err.code !== 'EXDEV') {
|
|
480
|
+
throw error;
|
|
481
|
+
}
|
|
482
|
+
(0, fs_1.copyFileSync)(sourcePath, destPath);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
async validateArchiveSafety(archivePath) {
|
|
486
|
+
const [{ stdout: tarPaths }, { stdout: tarVerbose }] = await Promise.all([
|
|
487
|
+
execFileAsync('tar', ['-tzf', archivePath]),
|
|
488
|
+
execFileAsync('tar', ['-tvzf', archivePath]),
|
|
489
|
+
]);
|
|
490
|
+
const paths = tarPaths.split('\n').filter((line) => line.length > 0);
|
|
491
|
+
const verboseLines = tarVerbose.split('\n').filter((line) => line.length > 0);
|
|
492
|
+
if (paths.length !== verboseLines.length) {
|
|
493
|
+
throw new BackupArchiveError('Invalid backup: archive listing is inconsistent');
|
|
494
|
+
}
|
|
495
|
+
for (let i = 0; i < paths.length; i++) {
|
|
496
|
+
const entryPath = paths[i];
|
|
497
|
+
if (entryPath.startsWith('/') || entryPath.split('/').some((segment) => segment === '..')) {
|
|
498
|
+
throw new BackupArchiveError('Invalid backup: archive contains path traversal entries');
|
|
499
|
+
}
|
|
500
|
+
const fileType = verboseLines[i][0];
|
|
501
|
+
if (fileType !== '-' && fileType !== 'd') {
|
|
502
|
+
throw new BackupArchiveError(`Invalid backup: archive contains disallowed entry type "${fileType}"`);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
readExtractedFileSafely(filePath) {
|
|
507
|
+
if ((0, fs_1.lstatSync)(filePath).isSymbolicLink()) {
|
|
508
|
+
throw new BackupArchiveError('Invalid backup archive: extracted entry is a symlink');
|
|
509
|
+
}
|
|
510
|
+
return (0, fs_1.readFileSync)(filePath, 'utf-8');
|
|
511
|
+
}
|
|
512
|
+
getMetadataSidecarPath(id) {
|
|
513
|
+
return (0, path_1.join)(this.backupsDir, `${id}.json`);
|
|
514
|
+
}
|
|
515
|
+
writeMetadataSidecar(id, metadata) {
|
|
516
|
+
(0, fs_1.writeFileSync)(this.getMetadataSidecarPath(id), JSON.stringify(metadata, null, 2));
|
|
517
|
+
}
|
|
518
|
+
readMetadataSidecar(id) {
|
|
519
|
+
const sidecarPath = this.getMetadataSidecarPath(id);
|
|
520
|
+
if (!(0, fs_1.existsSync)(sidecarPath)) {
|
|
521
|
+
return null;
|
|
522
|
+
}
|
|
523
|
+
try {
|
|
524
|
+
return parseStoredMetadata(JSON.parse((0, fs_1.readFileSync)(sidecarPath, 'utf-8')));
|
|
525
|
+
}
|
|
526
|
+
catch (error) {
|
|
527
|
+
this.logger.warn(`Failed to read metadata sidecar for backup ${id}`, { error });
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
async saveUploadedBackup(buffer, _originalFilename) {
|
|
532
|
+
this.ensureBackupsDir();
|
|
533
|
+
const tempId = (0, uuid_1.v4)();
|
|
534
|
+
const tempTarPath = (0, path_1.join)(this.backupsDir, `upload-${tempId}.tar.gz`);
|
|
535
|
+
const tempDir = (0, path_1.join)(this.backupsDir, `upload-meta-${tempId}`);
|
|
536
|
+
let finalPath = null;
|
|
537
|
+
let sidecarPath = null;
|
|
538
|
+
let savedMetadata;
|
|
539
|
+
let savedId;
|
|
540
|
+
try {
|
|
541
|
+
(0, fs_1.writeFileSync)(tempTarPath, buffer);
|
|
542
|
+
(0, fs_1.mkdirSync)(tempDir, { recursive: true });
|
|
543
|
+
await this.validateArchiveSafety(tempTarPath);
|
|
544
|
+
await execFileAsync('tar', [
|
|
545
|
+
'--no-same-owner',
|
|
546
|
+
'--no-same-permissions',
|
|
547
|
+
'-xzf',
|
|
548
|
+
tempTarPath,
|
|
549
|
+
'-C',
|
|
550
|
+
tempDir,
|
|
551
|
+
'./metadata.json',
|
|
552
|
+
]);
|
|
553
|
+
const metadataPath = (0, path_1.join)(tempDir, 'metadata.json');
|
|
554
|
+
if (!(0, fs_1.existsSync)(metadataPath)) {
|
|
555
|
+
throw new BackupArchiveError('Invalid backup archive: metadata.json not found');
|
|
556
|
+
}
|
|
557
|
+
const metadata = parseStoredMetadata(JSON.parse(this.readExtractedFileSafely(metadataPath)));
|
|
558
|
+
if (!Number.isFinite(new Date(metadata.createdAt).getTime())) {
|
|
559
|
+
throw new BackupArchiveError('Invalid backup archive: metadata.createdAt is not a valid ISO date');
|
|
560
|
+
}
|
|
561
|
+
finalPath = this.getBackupPath(metadata.id);
|
|
562
|
+
if ((0, fs_1.existsSync)(finalPath)) {
|
|
563
|
+
throw new BackupArchiveError(`Backup with id=${metadata.id} already exists — refusing to overwrite`);
|
|
564
|
+
}
|
|
565
|
+
(0, fs_1.copyFileSync)(tempTarPath, finalPath);
|
|
566
|
+
(0, fs_1.rmSync)(tempTarPath, { force: true });
|
|
567
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
568
|
+
const stats = (0, fs_1.statSync)(finalPath);
|
|
569
|
+
this.logger.log(`Uploaded backup saved: id=${metadata.id}, size=${stats.size} bytes`);
|
|
570
|
+
this.writeMetadataSidecar(metadata.id, metadata);
|
|
571
|
+
sidecarPath = this.getMetadataSidecarPath(metadata.id);
|
|
572
|
+
savedId = metadata.id;
|
|
573
|
+
savedMetadata = {
|
|
574
|
+
...metadata,
|
|
575
|
+
sizeBytes: stats.size,
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
catch (error) {
|
|
579
|
+
if ((0, fs_1.existsSync)(tempTarPath)) {
|
|
580
|
+
(0, fs_1.rmSync)(tempTarPath, { force: true });
|
|
581
|
+
}
|
|
582
|
+
(0, fs_1.rmSync)(tempDir, { recursive: true, force: true });
|
|
583
|
+
if (finalPath && (0, fs_1.existsSync)(finalPath)) {
|
|
584
|
+
(0, fs_1.rmSync)(finalPath, { force: true });
|
|
585
|
+
}
|
|
586
|
+
if (sidecarPath && (0, fs_1.existsSync)(sidecarPath)) {
|
|
587
|
+
(0, fs_1.rmSync)(sidecarPath, { force: true });
|
|
588
|
+
}
|
|
589
|
+
throw error;
|
|
590
|
+
}
|
|
591
|
+
try {
|
|
592
|
+
await this.cleanupOldBackups(savedId);
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
const err = error;
|
|
596
|
+
this.logger.warn(`Retention sweep failed after uploading backup ${savedId}: ${err.message}`);
|
|
597
|
+
}
|
|
598
|
+
return savedMetadata;
|
|
599
|
+
}
|
|
600
|
+
async cleanupOldBackups(preserveId) {
|
|
601
|
+
const backups = await this.list();
|
|
602
|
+
if (backups.length <= MAX_BACKUPS) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
const candidates = backups
|
|
606
|
+
.filter((backup) => backup.id !== preserveId)
|
|
607
|
+
.sort((a, b) => this.getCreatedAtMs(a.createdAt) - this.getCreatedAtMs(b.createdAt));
|
|
608
|
+
const excessCount = backups.length - MAX_BACKUPS;
|
|
609
|
+
const toRemove = candidates.slice(0, excessCount);
|
|
610
|
+
for (const backup of toRemove) {
|
|
611
|
+
try {
|
|
612
|
+
this.delete(backup.id);
|
|
613
|
+
this.logger.debug(`Cleaned up old backup: id=${backup.id}`);
|
|
614
|
+
}
|
|
615
|
+
catch (error) {
|
|
616
|
+
this.logger.warn(`Failed to cleanup old backup: id=${backup.id}`, { error });
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
exports.BackupService = BackupService;
|
|
622
|
+
exports.BackupService = BackupService = __decorate([
|
|
623
|
+
(0, common_1.Injectable)(),
|
|
624
|
+
__param(3, (0, typeorm_2.InjectDataSource)()),
|
|
625
|
+
__metadata("design:paramtypes", [config_1.ConfigService,
|
|
626
|
+
backup_contribution_registry_service_1.BackupContributionRegistry,
|
|
627
|
+
event_emitter_1.EventEmitter2,
|
|
628
|
+
typeorm_1.DataSource])
|
|
629
|
+
], BackupService);
|
|
630
|
+
//# sourceMappingURL=backup.service.js.map
|