@camstack/server 1.2.858 → 1.2.860
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/CHANGELOG.md +16 -0
- package/dist/api/trpc/generated-cap-routers.js +16 -0
- package/dist/core/cluster-update/cluster-update-steps.js +10 -2
- package/dist/server-root/index.js +1125 -45
- package/package.json +17 -16
- package/system/dist/addon-runner.js +76 -1
- package/system/dist/addon-runner.mjs +76 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +4 -4
- package/system/dist/builtins/composer/composer.addon.mjs +4 -4
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +32 -23
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +32 -23
- package/system/dist/builtins/device-manager/device-search.d.ts +4 -3
- package/system/dist/builtins/device-manager/removal-fence.d.ts +2 -2
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-B4_fq2JB.mjs → capture-engine-B5OYzCH1.mjs} +1 -1
- package/system/dist/{capture-engine-yhFFC7F8.js → capture-engine-BManwD48.js} +1 -1
- package/system/dist/{composition-sources-BQOEYCJG.mjs → composition-sources-B8hoUx1K.mjs} +1 -1
- package/system/dist/{composition-sources-CKSSe5ny.js → composition-sources-DWu-IL2w.js} +1 -1
- package/system/dist/{constants-dfnEfsX7.js → constants-CUAopsxj.js} +1 -1
- package/system/dist/{constants-h8wJE_8O.mjs → constants-qDKQ7NaY.mjs} +1 -1
- package/system/dist/{device-ca-h54CenJx.mjs → device-ca-BOUTrISA.mjs} +1 -1
- package/system/dist/{device-ca-_o0-3jJ6.js → device-ca-DNrM4Ao-.js} +1 -1
- package/system/dist/{dist-atHH8IeD.mjs → dist-3MQdfUTG.mjs} +254 -71
- package/system/dist/{dist-WEGVb8qV.js → dist-B9Kzw974.js} +259 -70
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-nIMYA24i.js → hub-identity-BQIE6w3g.js} +1 -1
- package/system/dist/{hub-identity-DLF698tj.mjs → hub-identity-DEbxcoVh.mjs} +1 -1
- package/system/dist/{hub-mdns-ciao-B6ZHStt1.js → hub-mdns-ciao-Bj_RdJiH.js} +2 -2
- package/system/dist/{hub-mdns-ciao-DchpUVAk.mjs → hub-mdns-ciao-BzKGywE2.mjs} +2 -2
- package/system/dist/index.js +84 -9
- package/system/dist/index.mjs +84 -9
- package/system/dist/kernel/moleculer/switch-toggle.d.ts +41 -0
- package/system/dist/{legacy-integration-rows-door-BbaIE1qF.js → legacy-integration-rows-door-CRfEC_HP.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-DBO3ZLmn.mjs → legacy-integration-rows-door-rgL9olef.mjs} +1 -1
- package/system/dist/{rename-composition-block-IIfaFnEl.js → rename-composition-block-Bbt43q6n.js} +1 -1
- package/system/dist/{rename-composition-block-6ISzMLgj.mjs → rename-composition-block-DlgSgxch.mjs} +1 -1
- package/system/dist/{restore-archive-ChRNoqGg.js → restore-archive-DJBACMC0.js} +1 -1
- package/system/dist/{restore-archive-DeDRh7Lf.mjs → restore-archive-aQzQt2Kv.mjs} +82 -82
- package/system/dist/{wal-maintenance-BXj9xnDD.mjs → wal-maintenance-Bu6vjJlR.mjs} +0 -0
- package/system/dist/{wal-maintenance-l3CsKEaJ.js → wal-maintenance-BvIEU1r1.js} +0 -0
- package/system/package.json +1 -1
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { A as CatalogFileSchema,
|
|
3
|
-
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-
|
|
2
|
+
import { A as CatalogFileSchema, Al as withoutCallerStamp, At as LOG_LEVEL_RANK, Bs as DEVICE_STATUS_METHOD, C as CATALOG_LANGS, Ca as procedureAuthKey, Dl as userError, Ei as isObjectInput, Er as describeUnmet, Fl as errMsg$1, Hi as looseSchema, Ht as PackageRequiresSchema, Ja as resolveMethodAuth, Jc as isDebugChannelName, Kr as extractNestedAddonId, Lc as defineRecordKinds, Ll as EventCategory$1, Ls as CALLER_STAMPED_CAPABILITIES$1, Mc as createEvent$1, Oc as collectSecretMarkerRefs, Oi as isVoidInput, Oo as supportedRuntimes, Pi as lifecycleJobSchema, Pn as bareAddonId, Rc as emitDownForOwnedCaps, Ro as unmetRequirements, Rs as DATAPLANE_SECRET_HEADER$1, Uc as getDebugInterest, Vc as expandCapMethods, Vi as logLevelAtMost, a as AGENT_MDNS_SERVICE_TYPE, aa as objectInputDeclaresAddonId, bc as asNumber, bi as isCollectionArrayMethod, dl as parseJsonObject, fl as parseJsonUnknown, gl as resolveCapMount, ic as ReadinessTimeoutError, jt as METHOD_ACCESS_MAP, ki as kebabToCamel$1, mi as isAddonInstanceId, ml as readinessKey, nc as RUNTIME_DEFAULTS, o as AGENT_MDNS_TXT_KEYS, oa as objectInputDeclaresRequiredDeviceId, oo as scopesAllowAddon, pi as interpolate, rc as ReadinessRegistry, rr as compareVersions, s as ALL_CAPABILITY_DEFINITIONS, so as scopesAllowDeviceCap, vi as isArrayOutputSchema, wn as addonSettingsCapability, xc as asString$1, yc as asJsonObject$1, yl as scopeKey, yo as splitTranslationRef, zs as DEVICE_SETTINGS_CONTRIBUTION_METHODS } from "./dist-3MQdfUTG.mjs";
|
|
3
|
+
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-BOUTrISA.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
5
|
import { a as redactLogText, i as redactLogMeta, r as redactLogEntry, t as isCredentialKeyName } from "./log-redactor-XLDrPzOi.mjs";
|
|
6
6
|
import { AlertCenterAddon, n as lastCauseAfterChunk, r as readRunnerDisplayName, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
|
|
@@ -27,22 +27,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
27
27
|
import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
28
28
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
29
29
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
30
|
-
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
31
|
-
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-
|
|
30
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-Bu6vjJlR.mjs";
|
|
31
|
+
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-rgL9olef.mjs";
|
|
32
32
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
33
33
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
34
34
|
import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
35
35
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
36
|
-
import { A as evaluateExistingCert, B as AGENT_HTTPS_NAMES_COLLECTION, C as localCaCommonName, D as LEAF_RENEWAL_WINDOW_DAYS, E as CA_VALIDITY_DAYS, F as isConstrainedCa, H as AgentHttpsNames, I as isLocalOnlyHostname, L as permitsIdentity, M as PERMITTED_DNS_SUFFIXES, N as PERMITTED_IP_RANGES, O as MAX_LEAF_VALIDITY_DAYS, P as buildNameConstraintSet, R as permitsName, T as systemHostFacts, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, _ as pemDigest, a as AgentHttpsInstallError, c as certificateNames, d as describeHttpsLeaf, f as installAgentHttps, g as loadAgentHttps, h as issueAgentHttpsLeaf, i as loadOrCreateHubId, k as SERVER_AUTH_OID, l as collectAgentNames, m as isPrivateAddress, n as HUB_IDENTITY_RELATIVE, o as acceptAgentSans, p as isContainerBridgeAddress, r as isAnnouncedHubId, s as agentHttpsPaths, t as HUB_IDENTITY_FILE, u as createAgentHttpsRequest, v as pinnedHttpsCaFingerprint, w as collectCertIdentity, y as CA_COMMON_NAME, z as readNameConstraints } from "./hub-identity-
|
|
37
|
-
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-
|
|
36
|
+
import { A as evaluateExistingCert, B as AGENT_HTTPS_NAMES_COLLECTION, C as localCaCommonName, D as LEAF_RENEWAL_WINDOW_DAYS, E as CA_VALIDITY_DAYS, F as isConstrainedCa, H as AgentHttpsNames, I as isLocalOnlyHostname, L as permitsIdentity, M as PERMITTED_DNS_SUFFIXES, N as PERMITTED_IP_RANGES, O as MAX_LEAF_VALIDITY_DAYS, P as buildNameConstraintSet, R as permitsName, T as systemHostFacts, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, _ as pemDigest, a as AgentHttpsInstallError, c as certificateNames, d as describeHttpsLeaf, f as installAgentHttps, g as loadAgentHttps, h as issueAgentHttpsLeaf, i as loadOrCreateHubId, k as SERVER_AUTH_OID, l as collectAgentNames, m as isPrivateAddress, n as HUB_IDENTITY_RELATIVE, o as acceptAgentSans, p as isContainerBridgeAddress, r as isAnnouncedHubId, s as agentHttpsPaths, t as HUB_IDENTITY_FILE, u as createAgentHttpsRequest, v as pinnedHttpsCaFingerprint, w as collectCertIdentity, y as CA_COMMON_NAME, z as readNameConstraints } from "./hub-identity-DEbxcoVh.mjs";
|
|
37
|
+
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-qDKQ7NaY.mjs";
|
|
38
38
|
import { $ as caFingerprint, A as emitProcessNodeRegistered, B as setProcessMeshTlsListenerState, C as verifyMembershipAnswer, Ct as parseOriginList, D as ServiceBroker, Dt as parseCidrList, E as Errors, Et as normalizeIp, F as setProcessMeshPeerTransportLookup, G as describeMeshLeaf, H as MESH_NODE_CERTIFICATES_COLUMNS, I as renewMeshCertificate, J as MeshCrl, K as getProcessMeshCertificateRegistry, L as revokeMeshCertificate, M as getProcessPeerLeaf, N as isProcessVerifiedMeshPeer, O as setProcessMeshTlsEnabler, Ot as readCidrSetting, P as onProcessNodeRegistered, Q as requireProcessMeshCa, R as getProcessMeshTlsListenerState, S as signMembershipProof, St as normalizeOrigin, SystemConfigAddon, T as TlsTcpTransporter, Tt as createCidrMatcher, U as MeshCertificateRegistry, V as MESH_NODE_CERTIFICATES_COLLECTION, W as RENEWAL_ABANDONED, X as MeshCaKeeper, Y as processMeshCrl, Z as getProcessMeshCaState, _ as keyFingerprintShort, _t as parseAgentDashboardOrigins, a as dialableHubHost, at as isValidAgentNodeId, b as MEMBERSHIP_PATHS, bt as OPAQUE_ORIGIN, c as PAIRING_MAX_CODE_ATTEMPTS, ct as loadMeshCa, d as PAIRING_PIN_DIGITS, dt as AGENT_UI_UNLOCK_TYP, et as caFingerprintCompact, f as PAIRING_PROTOCOL, ft as AGENT_UI_UNLOCK_USE, g as describeCsr, gt as mintAgentUiUnlockTicket, h as computePairingSas, ht as isAllowedAgentDashboardReturnTo, i as AgentPairing, it as generateMeshKeyPair, j as getProcessNodeMeshTransport, k as dropProcessPeer, l as PAIRING_MAX_SESSIONS, lt as AGENT_DASHBOARD_ORIGINS_FIELD, m as computePairingCommitment, mt as UnlockTicketJtiStore, n as HubPairing, nt as exportMeshPrivateKeyPem, o as hubHostFromMeshAddress, ot as issueMeshLeafForNode, p as PAIRING_TTL_MS, pt as AGENT_UI_UNLOCK_VERSION, q as setProcessMeshCertificateRegistry, r as PairingHttpError, rt as generateMeshCa, s as PAIRING_CODE_DIGITS, st as issueMeshLeafFromCsr, tt as createMeshCsrPem, u as PAIRING_PATHS, ut as AGENT_UI_UNLOCK_TTL_MS, v as signPairingProof, vt as verifyAgentUiUnlockTicket, w as MESH_TLS_PORT_HELLO_FIELD, wt as readOriginSetting, x as MembershipResponder, xt as isInsecureOrigin, y as verifyPairingProof, yt as InvalidCorsOriginError, z as openMeshTlsWhenRevocationsLoaded } from "./builtins/system-config/system-config.addon.mjs";
|
|
39
39
|
import "./builtins/system-config/index.mjs";
|
|
40
40
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
41
41
|
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-B9zFBNVa.mjs";
|
|
42
|
-
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-
|
|
42
|
+
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-BzKGywE2.mjs";
|
|
43
43
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
44
44
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
45
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
45
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-aQzQt2Kv.mjs";
|
|
46
46
|
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
47
47
|
import { z } from "zod";
|
|
48
48
|
import * as crypto$1 from "node:crypto";
|
|
@@ -13725,6 +13725,76 @@ function recordsTransportOf(api) {
|
|
|
13725
13725
|
};
|
|
13726
13726
|
}
|
|
13727
13727
|
//#endregion
|
|
13728
|
+
//#region src/kernel/moleculer/switch-toggle.ts
|
|
13729
|
+
var REFUSAL_TEXT = {
|
|
13730
|
+
"no-slice": "switch has no state slice",
|
|
13731
|
+
stale: "switch state is unknown"
|
|
13732
|
+
};
|
|
13733
|
+
var SwitchToggleRefusedError = class extends Error {
|
|
13734
|
+
reason;
|
|
13735
|
+
deviceId;
|
|
13736
|
+
constructor(reason, deviceId) {
|
|
13737
|
+
super(`device ${deviceId}: ${REFUSAL_TEXT[reason]}; refusing to guess on or off`);
|
|
13738
|
+
this.name = "SwitchToggleRefusedError";
|
|
13739
|
+
this.reason = reason;
|
|
13740
|
+
this.deviceId = deviceId;
|
|
13741
|
+
}
|
|
13742
|
+
};
|
|
13743
|
+
/** `on` when the slice states it, otherwise the reason the toggle must refuse. */
|
|
13744
|
+
function classifySwitchOn(slice) {
|
|
13745
|
+
if (slice === void 0 || slice === null) return {
|
|
13746
|
+
known: false,
|
|
13747
|
+
reason: "no-slice"
|
|
13748
|
+
};
|
|
13749
|
+
if (typeof slice !== "object" || Array.isArray(slice)) return {
|
|
13750
|
+
known: false,
|
|
13751
|
+
reason: "stale"
|
|
13752
|
+
};
|
|
13753
|
+
const on = Reflect.get(slice, "on");
|
|
13754
|
+
if (typeof on !== "boolean") return {
|
|
13755
|
+
known: false,
|
|
13756
|
+
reason: "stale"
|
|
13757
|
+
};
|
|
13758
|
+
return {
|
|
13759
|
+
known: true,
|
|
13760
|
+
on
|
|
13761
|
+
};
|
|
13762
|
+
}
|
|
13763
|
+
function isSetState(fn) {
|
|
13764
|
+
return typeof fn === "function";
|
|
13765
|
+
}
|
|
13766
|
+
function refuse$1(read, deviceId, reason) {
|
|
13767
|
+
read.logger.warn(`switch.toggle refused: ${REFUSAL_TEXT[reason]}`, {
|
|
13768
|
+
tags: { deviceId },
|
|
13769
|
+
meta: { reason }
|
|
13770
|
+
});
|
|
13771
|
+
throw new SwitchToggleRefusedError(reason, deviceId);
|
|
13772
|
+
}
|
|
13773
|
+
async function runToggle(provider, setState, read, input) {
|
|
13774
|
+
const deviceId = typeof input?.deviceId === "number" ? input.deviceId : read.deviceId;
|
|
13775
|
+
const state = classifySwitchOn(deviceId === read.deviceId ? read.readSlice() : void 0);
|
|
13776
|
+
if (!state.known) refuse$1(read, deviceId, state.reason);
|
|
13777
|
+
await setState.call(provider, {
|
|
13778
|
+
deviceId,
|
|
13779
|
+
on: !state.on
|
|
13780
|
+
});
|
|
13781
|
+
}
|
|
13782
|
+
/**
|
|
13783
|
+
* `provider`, plus `toggle` when `capName` is `switch` and the provider did
|
|
13784
|
+
* not write one. Any other cap is returned as the same object.
|
|
13785
|
+
*/
|
|
13786
|
+
function withDefaultSwitchToggle(capName, provider, read) {
|
|
13787
|
+
if (capName !== "switch") return provider;
|
|
13788
|
+
if (typeof Reflect.get(provider, "toggle") === "function") return provider;
|
|
13789
|
+
const setState = Reflect.get(provider, "setState");
|
|
13790
|
+
if (!isSetState(setState)) return provider;
|
|
13791
|
+
const toggle = (input) => runToggle(provider, setState, read, input);
|
|
13792
|
+
return {
|
|
13793
|
+
...provider,
|
|
13794
|
+
toggle
|
|
13795
|
+
};
|
|
13796
|
+
}
|
|
13797
|
+
//#endregion
|
|
13728
13798
|
//#region src/kernel/moleculer/children-batch-loader.ts
|
|
13729
13799
|
/**
|
|
13730
13800
|
* Narrow an untyped cap answer to the fields the reconcile reads.
|
|
@@ -14277,7 +14347,7 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
14277
14347
|
}
|
|
14278
14348
|
});
|
|
14279
14349
|
}
|
|
14280
|
-
const
|
|
14350
|
+
const withStatus = (() => {
|
|
14281
14351
|
if (!cap.status || !cap.runtimeState || !runtimeStateRef) return provider;
|
|
14282
14352
|
if (typeof Reflect.get(provider, "getStatus") === "function") return provider;
|
|
14283
14353
|
const rsRef = runtimeStateRef;
|
|
@@ -14290,6 +14360,11 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
14290
14360
|
getStatus: defaultGetStatus
|
|
14291
14361
|
};
|
|
14292
14362
|
})();
|
|
14363
|
+
const finalProvider = withDefaultSwitchToggle(cap.name, withStatus, {
|
|
14364
|
+
deviceId: id,
|
|
14365
|
+
readSlice: () => runtimeStateRef?.getCapState("switch"),
|
|
14366
|
+
logger: opts.logger
|
|
14367
|
+
});
|
|
14293
14368
|
if (opts.capabilityRegistry) opts.capabilityRegistry.registerNativeProvider(cap.name, id, addonId, finalProvider);
|
|
14294
14369
|
else if (opts.broker || opts.udsMode) {
|
|
14295
14370
|
let perCap = workerNativeCaps.get(cap.name);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one default for `switch.toggle` (D393).
|
|
3
|
+
*
|
|
4
|
+
* Every native provider is registered in `registerNativeCap`. A switch
|
|
5
|
+
* provider that did not write `toggle` gets this body there — never a copy
|
|
6
|
+
* in each addon. It reads the device's `switch` slice and calls that
|
|
7
|
+
* provider's `setState` with the opposite `on`. A missing slice, or a slice
|
|
8
|
+
* whose `on` is not a boolean (`null` is "never reported"), is unknown:
|
|
9
|
+
* the call refuses and logs the device. It does not guess off.
|
|
10
|
+
*/
|
|
11
|
+
import type { IScopedLogger } from "@camstack/types";
|
|
12
|
+
/** Why a toggle will not act. Both are unknown; neither is off. */
|
|
13
|
+
export type SwitchToggleRefusal = "no-slice" | "stale";
|
|
14
|
+
export type SwitchOn = {
|
|
15
|
+
readonly known: true;
|
|
16
|
+
readonly on: boolean;
|
|
17
|
+
} | {
|
|
18
|
+
readonly known: false;
|
|
19
|
+
readonly reason: SwitchToggleRefusal;
|
|
20
|
+
};
|
|
21
|
+
export declare class SwitchToggleRefusedError extends Error {
|
|
22
|
+
readonly reason: SwitchToggleRefusal;
|
|
23
|
+
readonly deviceId: number;
|
|
24
|
+
constructor(reason: SwitchToggleRefusal, deviceId: number);
|
|
25
|
+
}
|
|
26
|
+
/** `on` when the slice states it, otherwise the reason the toggle must refuse. */
|
|
27
|
+
export declare function classifySwitchOn(slice: unknown): SwitchOn;
|
|
28
|
+
export interface SwitchToggleInput {
|
|
29
|
+
readonly deviceId?: number;
|
|
30
|
+
}
|
|
31
|
+
/** What the default needs from the device it was registered on. */
|
|
32
|
+
export interface SwitchToggleRead {
|
|
33
|
+
readonly deviceId: number;
|
|
34
|
+
readSlice(): unknown;
|
|
35
|
+
readonly logger: Pick<IScopedLogger, "warn">;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* `provider`, plus `toggle` when `capName` is `switch` and the provider did
|
|
39
|
+
* not write one. Any other cap is returned as the same object.
|
|
40
|
+
*/
|
|
41
|
+
export declare function withDefaultSwitchToggle<P extends object>(capName: string, provider: P, read: SwitchToggleRead): P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Oc as collectSecretMarkerRefs } from "./dist-3MQdfUTG.mjs";
|
|
2
2
|
//#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
|
|
3
3
|
/**
|
|
4
4
|
* Migration-only door for the leftover integration rows (planning#416).
|
package/system/dist/{rename-composition-block-6ISzMLgj.mjs → rename-composition-block-DlgSgxch.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fl as errMsg, jl as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./dist-3MQdfUTG.mjs";
|
|
2
2
|
//#region src/builtins/core-blocks/rename-composition-block.ts
|
|
3
3
|
/**
|
|
4
4
|
* An operator rename of a composed device writes the composition block's
|