@camstack/addon-import-alexa 0.2.174 → 0.2.176
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 +13 -0
- package/dist/addon.js +451 -157
- package/dist/addon.mjs +451 -157
- package/package.json +2 -2
- package/python/alexa_gateway.py +58 -6
- package/python/test_alexa_gateway.py +34 -2
- package/python/test_alexa_gateway_send.py +83 -0
package/dist/addon.mjs
CHANGED
|
@@ -46,7 +46,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
46
46
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
47
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
48
48
|
//#endregion
|
|
49
|
-
//#region ../types/dist/event-category-
|
|
49
|
+
//#region ../types/dist/event-category-BmPm98n0.mjs
|
|
50
50
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
51
51
|
EventCategory["SystemBoot"] = "system.boot";
|
|
52
52
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -530,6 +530,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
530
530
|
EventCategory["RunningStarted"] = "running.started";
|
|
531
531
|
/** Mirrors `runningStateCapability.events.onFinished`. */
|
|
532
532
|
EventCategory["RunningFinished"] = "running.finished";
|
|
533
|
+
/** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
|
|
534
|
+
EventCategory["DeviceRunOpened"] = "device-run.opened";
|
|
535
|
+
/** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
|
|
536
|
+
EventCategory["DeviceRunClosed"] = "device-run.closed";
|
|
533
537
|
/**
|
|
534
538
|
* Cap event fired by every device that registers the `event-emitter`
|
|
535
539
|
* capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
|
|
@@ -6025,7 +6029,7 @@ function number(params) {
|
|
|
6025
6029
|
return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
|
|
6026
6030
|
}
|
|
6027
6031
|
//#endregion
|
|
6028
|
-
//#region ../types/dist/sleep-
|
|
6032
|
+
//#region ../types/dist/sleep-BKzhQTSm.mjs
|
|
6029
6033
|
/**
|
|
6030
6034
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6031
6035
|
* window to float samples (D455).
|
|
@@ -9704,6 +9708,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
9704
9708
|
"device-ops",
|
|
9705
9709
|
"device-provider",
|
|
9706
9710
|
"device-removal-hook",
|
|
9711
|
+
"device-runs",
|
|
9707
9712
|
"device-state",
|
|
9708
9713
|
"device-status",
|
|
9709
9714
|
"dishwasher",
|
|
@@ -11648,7 +11653,7 @@ object({
|
|
|
11648
11653
|
params: record(string(), union([string(), number$1()])).optional()
|
|
11649
11654
|
});
|
|
11650
11655
|
//#endregion
|
|
11651
|
-
//#region ../types/dist/composition-
|
|
11656
|
+
//#region ../types/dist/composition-BiKWlUCc.mjs
|
|
11652
11657
|
/**
|
|
11653
11658
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
11654
11659
|
*
|
|
@@ -12581,7 +12586,15 @@ var HelperSpecSchema = discriminatedUnion("kind", [
|
|
|
12581
12586
|
thresholdWatts: number$1().positive(),
|
|
12582
12587
|
startDwellMs: number$1().int().nonnegative(),
|
|
12583
12588
|
stopDwellMs: number$1().int().nonnegative(),
|
|
12584
|
-
member: HelperMemberSchema
|
|
12589
|
+
member: HelperMemberSchema,
|
|
12590
|
+
/**
|
|
12591
|
+
* The plug that powers the appliance (`switch.on`). Optional: when set, the
|
|
12592
|
+
* composition carries a `power-source` feature, so the hub can cut and restore
|
|
12593
|
+
* that plug (power-source link of a NEW-target composition).
|
|
12594
|
+
*/
|
|
12595
|
+
powerSwitch: HelperMemberSchema.optional(),
|
|
12596
|
+
/** How long a forced restart keeps the plug off; the cap's default when unset. */
|
|
12597
|
+
offSeconds: number$1().optional()
|
|
12585
12598
|
}),
|
|
12586
12599
|
object({
|
|
12587
12600
|
kind: literal("statistic"),
|
|
@@ -14096,7 +14109,13 @@ var MigrationLedgerEntrySchema = object({
|
|
|
14096
14109
|
/** Why it is `blocked` or `held` (`dependency-failed`, `snapshot-refused`, …). */
|
|
14097
14110
|
reason: string().nullable(),
|
|
14098
14111
|
nodeId: string().nullable(),
|
|
14099
|
-
bootId: string().nullable()
|
|
14112
|
+
bootId: string().nullable(),
|
|
14113
|
+
/**
|
|
14114
|
+
* The catalogued meta of this id (description, body kind, store, `dependsOn`…),
|
|
14115
|
+
* joined by the engine from the catalogues it knows this boot. Absent when no
|
|
14116
|
+
* catalogue lists the id (a newer database).
|
|
14117
|
+
*/
|
|
14118
|
+
meta: MigrationMetaSchema.optional()
|
|
14100
14119
|
});
|
|
14101
14120
|
/** A catalogued migration that is not applied, with where it stands. */
|
|
14102
14121
|
var MigrationPendingEntrySchema = object({
|
|
@@ -19903,6 +19922,14 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
19903
19922
|
}
|
|
19904
19923
|
} }
|
|
19905
19924
|
},
|
|
19925
|
+
"device-runs": {
|
|
19926
|
+
scope: "device",
|
|
19927
|
+
noun: t("Runs", "Esecuzioni"),
|
|
19928
|
+
events: {
|
|
19929
|
+
onRunOpened: { notOperatorFacing: "the durable record of a run that the running-state start flip already announces" },
|
|
19930
|
+
onRunClosed: { notOperatorFacing: "the durable record of a run that the running-state finish flip already announces" }
|
|
19931
|
+
}
|
|
19932
|
+
},
|
|
19906
19933
|
update: {
|
|
19907
19934
|
scope: "device",
|
|
19908
19935
|
noun: t("Firmware update", "Aggiornamento firmware"),
|
|
@@ -46575,6 +46602,117 @@ function actuator(input) {
|
|
|
46575
46602
|
};
|
|
46576
46603
|
}
|
|
46577
46604
|
new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
|
|
46605
|
+
var PowerSourceRefusalReasonSchema = _enum([
|
|
46606
|
+
"no-power-source",
|
|
46607
|
+
"switch-missing",
|
|
46608
|
+
"switch-offline",
|
|
46609
|
+
"switch-unknown",
|
|
46610
|
+
"restart-in-progress",
|
|
46611
|
+
"switch-call-failed"
|
|
46612
|
+
]);
|
|
46613
|
+
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
46614
|
+
accepted: literal(false),
|
|
46615
|
+
reason: PowerSourceRefusalReasonSchema,
|
|
46616
|
+
/** One line for the operator, naming the switch. */
|
|
46617
|
+
message: string()
|
|
46618
|
+
})]);
|
|
46619
|
+
var PowerSourceInfoSchema = object({
|
|
46620
|
+
/** False when the device has no power source linked; the rest is then empty. */
|
|
46621
|
+
linked: boolean(),
|
|
46622
|
+
switchDeviceId: number$1().nullable(),
|
|
46623
|
+
switchName: string().nullable(),
|
|
46624
|
+
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
46625
|
+
switchOn: boolean().nullable(),
|
|
46626
|
+
switchOnline: boolean().nullable(),
|
|
46627
|
+
restartInProgress: boolean(),
|
|
46628
|
+
offSeconds: number$1().int()
|
|
46629
|
+
});
|
|
46630
|
+
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
46631
|
+
var PowerSourceStateSchema = object({
|
|
46632
|
+
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
46633
|
+
switchOn: boolean().nullable(),
|
|
46634
|
+
offSeconds: number$1().int(),
|
|
46635
|
+
lastFetchedAt: number$1()
|
|
46636
|
+
});
|
|
46637
|
+
var POWER_SOURCE_DEVICE_TYPES = [
|
|
46638
|
+
DeviceType.Gateway,
|
|
46639
|
+
DeviceType.Hub,
|
|
46640
|
+
DeviceType.Camera,
|
|
46641
|
+
DeviceType.Sensor,
|
|
46642
|
+
DeviceType.MediaPlayer,
|
|
46643
|
+
DeviceType.Vacuum,
|
|
46644
|
+
DeviceType.Generic,
|
|
46645
|
+
DeviceType.Washer,
|
|
46646
|
+
DeviceType.Dryer,
|
|
46647
|
+
DeviceType.Dishwasher,
|
|
46648
|
+
DeviceType.PetFountain,
|
|
46649
|
+
DeviceType.Fan,
|
|
46650
|
+
DeviceType.Humidifier,
|
|
46651
|
+
DeviceType.Climate,
|
|
46652
|
+
DeviceType.WaterHeater
|
|
46653
|
+
];
|
|
46654
|
+
var powerSourceCustomize = {
|
|
46655
|
+
version: 1,
|
|
46656
|
+
targets: [{
|
|
46657
|
+
id: "switch",
|
|
46658
|
+
cardinality: "scalar",
|
|
46659
|
+
vocabulary: {
|
|
46660
|
+
cap: "power-source",
|
|
46661
|
+
stateField: "switchOn"
|
|
46662
|
+
},
|
|
46663
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
46664
|
+
apply: "add",
|
|
46665
|
+
path: "switchOn",
|
|
46666
|
+
sources: [{
|
|
46667
|
+
kind: "switch",
|
|
46668
|
+
transforms: [{ kind: "identity" }]
|
|
46669
|
+
}],
|
|
46670
|
+
companions: [{
|
|
46671
|
+
kind: "constant",
|
|
46672
|
+
path: "offSeconds",
|
|
46673
|
+
value: 10,
|
|
46674
|
+
when: "add"
|
|
46675
|
+
}, {
|
|
46676
|
+
kind: "clock",
|
|
46677
|
+
path: "lastFetchedAt",
|
|
46678
|
+
when: "always"
|
|
46679
|
+
}],
|
|
46680
|
+
sourceReport: { status: "assignment-status" }
|
|
46681
|
+
}]
|
|
46682
|
+
};
|
|
46683
|
+
var deviceInput$1 = object({ deviceId: number$1().int().nonnegative() });
|
|
46684
|
+
var powerSourceCapability = {
|
|
46685
|
+
name: "power-source",
|
|
46686
|
+
scope: "device",
|
|
46687
|
+
mode: "singleton",
|
|
46688
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
46689
|
+
methods: {
|
|
46690
|
+
getStatus: systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }),
|
|
46691
|
+
powerOn: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
46692
|
+
kind: "mutation",
|
|
46693
|
+
auth: "admin"
|
|
46694
|
+
}),
|
|
46695
|
+
powerOff: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
46696
|
+
kind: "mutation",
|
|
46697
|
+
auth: "admin"
|
|
46698
|
+
}),
|
|
46699
|
+
forceRestart: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
46700
|
+
kind: "mutation",
|
|
46701
|
+
auth: "admin"
|
|
46702
|
+
})
|
|
46703
|
+
},
|
|
46704
|
+
runtimeState: PowerSourceStateSchema,
|
|
46705
|
+
customize: powerSourceCustomize,
|
|
46706
|
+
/**
|
|
46707
|
+
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
46708
|
+
* its next report; a restored value would outlive the reading it names.
|
|
46709
|
+
*
|
|
46710
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
46711
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
46712
|
+
*/
|
|
46713
|
+
durability: "session",
|
|
46714
|
+
history: "none"
|
|
46715
|
+
};
|
|
46578
46716
|
DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
|
|
46579
46717
|
DeviceType.Camera;
|
|
46580
46718
|
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
@@ -48000,6 +48138,101 @@ method(object({ deviceId: number$1().int() }), array(SeriesInfoSchema).readonly(
|
|
|
48000
48138
|
kind: "mutation",
|
|
48001
48139
|
auth: "admin"
|
|
48002
48140
|
});
|
|
48141
|
+
/**
|
|
48142
|
+
* device-runs - the durable record of ONE run of a device: a washing cycle, a
|
|
48143
|
+
* dishwasher cycle, later a mow or a clean (D992).
|
|
48144
|
+
*
|
|
48145
|
+
* A run is a DOCUMENT (opened at one instant, closed at another, carrying what
|
|
48146
|
+
* was measured over it), never a sample - device-history keeps the numbers over
|
|
48147
|
+
* time and its `device-runs` provider keeps these documents beside them, because
|
|
48148
|
+
* the energy of a run is a question about device-history's own series. The
|
|
48149
|
+
* record is written from the `running-state` flip on `DeviceStateChanged`; it
|
|
48150
|
+
* survives a restart (the open row is on disk) and a missed flip (boot compares
|
|
48151
|
+
* the open rows against the live snapshots).
|
|
48152
|
+
*
|
|
48153
|
+
* Every measurement is `number | null` and `null` means "could not be
|
|
48154
|
+
* measured", never `0` (D393). A run closed by the boot reconcile because the
|
|
48155
|
+
* device stopped while nobody was watching has `outcome: 'unknown'`.
|
|
48156
|
+
*/
|
|
48157
|
+
var DeviceRunKindSchema = _enum([
|
|
48158
|
+
"appliance",
|
|
48159
|
+
"mower",
|
|
48160
|
+
"vacuum"
|
|
48161
|
+
]);
|
|
48162
|
+
var DeviceRunStateSchema = _enum(["open", "closed"]);
|
|
48163
|
+
var DeviceRunOutcomeSchema = _enum([
|
|
48164
|
+
"completed",
|
|
48165
|
+
"aborted",
|
|
48166
|
+
"error",
|
|
48167
|
+
"unknown"
|
|
48168
|
+
]);
|
|
48169
|
+
/** What opened or closed the run. `reconcile` is the boot comparison against live state. */
|
|
48170
|
+
var DeviceRunSourceSchema = _enum([
|
|
48171
|
+
"running-state",
|
|
48172
|
+
"activity",
|
|
48173
|
+
"reconcile"
|
|
48174
|
+
]);
|
|
48175
|
+
/** How the energy of a run was obtained; `null` when it could not be. */
|
|
48176
|
+
var DeviceRunEnergyMethodSchema = _enum(["counter-delta", "history-integral"]);
|
|
48177
|
+
var DeviceRunPhaseSchema = object({
|
|
48178
|
+
phase: string(),
|
|
48179
|
+
at: number$1()
|
|
48180
|
+
});
|
|
48181
|
+
/** The kind-specific block; a later phase adds a branch, nothing else changes. */
|
|
48182
|
+
var DeviceRunDetailSchema = discriminatedUnion("kind", [object({
|
|
48183
|
+
kind: literal("appliance"),
|
|
48184
|
+
/** kWh used over the run. */
|
|
48185
|
+
energyKwh: number$1().nullable().meta(readingMeta("energy")),
|
|
48186
|
+
energyMethod: DeviceRunEnergyMethodSchema.nullable(),
|
|
48187
|
+
/** Highest power seen while the run was open. */
|
|
48188
|
+
peakW: number$1().nullable().meta(readingMeta("power")),
|
|
48189
|
+
/** Time-weighted mean power while the run was open. */
|
|
48190
|
+
avgW: number$1().nullable().meta(readingMeta("power")),
|
|
48191
|
+
/** The program the appliance said it ran when the run opened. */
|
|
48192
|
+
program: string().nullable(),
|
|
48193
|
+
remainingAtStartSec: number$1().nullable().meta(readingMeta("duration")),
|
|
48194
|
+
/** The last phase the device reported before the run closed. */
|
|
48195
|
+
finalPhase: string().nullable(),
|
|
48196
|
+
/**
|
|
48197
|
+
* The meter's energy counter when the run opened; `null` when the meter had
|
|
48198
|
+
* not said (or the run was opened late, by the boot reconcile). It lives in
|
|
48199
|
+
* the row so a run that outlives a restart still ends with `end - start`.
|
|
48200
|
+
*/
|
|
48201
|
+
energyStartKwh: number$1().nullable().meta(readingMeta("energy")),
|
|
48202
|
+
/** Milliseconds of power readings behind `avgW` - the weight a restart resumes the mean with. */
|
|
48203
|
+
powerObservedMs: number$1()
|
|
48204
|
+
})]);
|
|
48205
|
+
var DeviceRunSchema = object({
|
|
48206
|
+
/** `${deviceId}:${startedAt}`. */
|
|
48207
|
+
runId: string(),
|
|
48208
|
+
deviceId: number$1().int(),
|
|
48209
|
+
kind: DeviceRunKindSchema,
|
|
48210
|
+
state: DeviceRunStateSchema,
|
|
48211
|
+
startedAt: number$1(),
|
|
48212
|
+
endedAt: number$1().nullable(),
|
|
48213
|
+
durationMs: number$1().nullable(),
|
|
48214
|
+
outcome: DeviceRunOutcomeSchema.nullable(),
|
|
48215
|
+
startSource: DeviceRunSourceSchema,
|
|
48216
|
+
endSource: DeviceRunSourceSchema.nullable(),
|
|
48217
|
+
/** Where the device's running bit came from (`running-state.source`); `null` when it did not say. */
|
|
48218
|
+
runningSource: _enum(["native", "assigned"]).nullable(),
|
|
48219
|
+
phases: array(DeviceRunPhaseSchema),
|
|
48220
|
+
detail: DeviceRunDetailSchema
|
|
48221
|
+
});
|
|
48222
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, method(object({
|
|
48223
|
+
deviceId: number$1().int(),
|
|
48224
|
+
outcome: DeviceRunOutcomeSchema.optional(),
|
|
48225
|
+
atFrom: number$1().optional(),
|
|
48226
|
+
atTo: number$1().optional(),
|
|
48227
|
+
limit: number$1().int().positive().max(200).default(50),
|
|
48228
|
+
cursor: string().optional()
|
|
48229
|
+
}), object({
|
|
48230
|
+
runs: array(DeviceRunSchema).readonly(),
|
|
48231
|
+
nextCursor: string().nullable()
|
|
48232
|
+
})), method(object({
|
|
48233
|
+
deviceId: number$1().int(),
|
|
48234
|
+
runId: string()
|
|
48235
|
+
}), DeviceRunSchema.nullable()), method(object({ deviceId: number$1().int() }), DeviceRunSchema.nullable());
|
|
48003
48236
|
var DeviceCaStatusSchema = discriminatedUnion("state", [
|
|
48004
48237
|
object({ state: literal("absent") }),
|
|
48005
48238
|
object({
|
|
@@ -48135,8 +48368,8 @@ method(object({}), object({
|
|
|
48135
48368
|
});
|
|
48136
48369
|
var KeychainKeySourceSchema = object({
|
|
48137
48370
|
kind: _enum([
|
|
48138
|
-
"
|
|
48139
|
-
"previous-
|
|
48371
|
+
"mounted-file",
|
|
48372
|
+
"previous-mounted-file",
|
|
48140
48373
|
"platform",
|
|
48141
48374
|
"default-file"
|
|
48142
48375
|
]),
|
|
@@ -52519,7 +52752,8 @@ var PALETTE_ENTRY_IDS = [
|
|
|
52519
52752
|
"switch",
|
|
52520
52753
|
"siren",
|
|
52521
52754
|
"button",
|
|
52522
|
-
"doorbell"
|
|
52755
|
+
"doorbell",
|
|
52756
|
+
"appliance-cycle"
|
|
52523
52757
|
];
|
|
52524
52758
|
var AUDIO_ENTRY_ID = "audio";
|
|
52525
52759
|
/** Six rungs, quiet → loud. The opaque end is the entry's hex. */
|
|
@@ -52590,7 +52824,8 @@ var CAMSTACK_HEX = {
|
|
|
52590
52824
|
switch: "#7a812a",
|
|
52591
52825
|
siren: "#ac5d7f",
|
|
52592
52826
|
button: "#b276cd",
|
|
52593
|
-
doorbell: "#0087ab"
|
|
52827
|
+
doorbell: "#0087ab",
|
|
52828
|
+
"appliance-cycle": "#2a8c8c"
|
|
52594
52829
|
};
|
|
52595
52830
|
var CAMSTACK_FALLBACK = [
|
|
52596
52831
|
"#b34dc7",
|
|
@@ -52655,7 +52890,8 @@ var HIGH_CONTRAST_HEX = {
|
|
|
52655
52890
|
switch: "#d05259",
|
|
52656
52891
|
siren: "#cd67b3",
|
|
52657
52892
|
button: "#c9746a",
|
|
52658
|
-
doorbell: "#338eeb"
|
|
52893
|
+
doorbell: "#338eeb",
|
|
52894
|
+
"appliance-cycle": "#00848a"
|
|
52659
52895
|
};
|
|
52660
52896
|
var HIGH_CONTRAST_FALLBACK = [
|
|
52661
52897
|
"#817f3b",
|
|
@@ -52720,7 +52956,8 @@ var OKABE_ITO_HEX = {
|
|
|
52720
52956
|
switch: "#ad2c4e",
|
|
52721
52957
|
siren: "#348e08",
|
|
52722
52958
|
button: "#d27303",
|
|
52723
|
-
doorbell: "#55770f"
|
|
52959
|
+
doorbell: "#55770f",
|
|
52960
|
+
"appliance-cycle": "#00737d"
|
|
52724
52961
|
};
|
|
52725
52962
|
var OKABE_ITO_FALLBACK = [
|
|
52726
52963
|
"#9a3784",
|
|
@@ -52929,6 +53166,7 @@ sub("switch", "control", "control", "switch", "Switch");
|
|
|
52929
53166
|
sub("siren", "control", "control", "siren", "Siren");
|
|
52930
53167
|
sub("button", "control", "control", "button", "Button");
|
|
52931
53168
|
sub("doorbell", "control", "control", "doorbell", "Doorbell");
|
|
53169
|
+
sub("appliance-cycle", "control", "control", "switch", "Appliance cycle");
|
|
52932
53170
|
for (const l of AUDIO_MACRO_LABELS) {
|
|
52933
53171
|
const kind = `audio-${l.id}`;
|
|
52934
53172
|
if (entries.has(kind)) continue;
|
|
@@ -61560,7 +61798,8 @@ var CAP_TO_KIND = {
|
|
|
61560
61798
|
cover: "cover",
|
|
61561
61799
|
switch: "switch",
|
|
61562
61800
|
button: "button",
|
|
61563
|
-
doorbell: "doorbell"
|
|
61801
|
+
doorbell: "doorbell",
|
|
61802
|
+
"running-state": "appliance-cycle"
|
|
61564
61803
|
};
|
|
61565
61804
|
function buildDescriptor(capName, kind) {
|
|
61566
61805
|
const t = EVENT_TAXONOMY[kind];
|
|
@@ -64690,10 +64929,7 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
64690
64929
|
}), InstallPackageResultSchema, {
|
|
64691
64930
|
kind: "mutation",
|
|
64692
64931
|
auth: "admin"
|
|
64693
|
-
}), method(object({
|
|
64694
|
-
kind: "mutation",
|
|
64695
|
-
auth: "admin"
|
|
64696
|
-
}), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
|
|
64932
|
+
}), method(object({
|
|
64697
64933
|
packageName: string().min(1),
|
|
64698
64934
|
nodeId: string().optional(),
|
|
64699
64935
|
everywhere: boolean().optional()
|
|
@@ -65954,19 +66190,19 @@ var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status:
|
|
|
65954
66190
|
reason: _enum(["unknown-template", "not-a-media-player"]),
|
|
65955
66191
|
detail: string()
|
|
65956
66192
|
})]);
|
|
65957
|
-
var deviceInput
|
|
66193
|
+
var deviceInput = object({ deviceId: number$1().int().nonnegative() });
|
|
65958
66194
|
DeviceType.MediaPlayer;
|
|
65959
|
-
method(deviceInput
|
|
66195
|
+
method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
|
|
65960
66196
|
kind: "mutation",
|
|
65961
66197
|
auth: "admin"
|
|
65962
|
-
}), method(deviceInput
|
|
66198
|
+
}), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
|
|
65963
66199
|
role: RemoteRoleSchema,
|
|
65964
66200
|
/** Sends in a row (volume steps). */
|
|
65965
66201
|
repeat: number$1().int().min(1).max(50).default(1)
|
|
65966
66202
|
}), RemoteSendResultSchema, {
|
|
65967
66203
|
kind: "mutation",
|
|
65968
66204
|
auth: "protected"
|
|
65969
|
-
}), method(deviceInput
|
|
66205
|
+
}), method(deviceInput.extend({
|
|
65970
66206
|
command: RemoteMediaCommandSchema,
|
|
65971
66207
|
muted: boolean().optional(),
|
|
65972
66208
|
source: string().optional(),
|
|
@@ -70295,117 +70531,6 @@ var lockControlCapability = {
|
|
|
70295
70531
|
* whether persisting is worth a SQLite commit. */
|
|
70296
70532
|
volatileStateFields: ["lastChangedAt"]
|
|
70297
70533
|
};
|
|
70298
|
-
var PowerSourceRefusalReasonSchema = _enum([
|
|
70299
|
-
"no-power-source",
|
|
70300
|
-
"switch-missing",
|
|
70301
|
-
"switch-offline",
|
|
70302
|
-
"switch-unknown",
|
|
70303
|
-
"restart-in-progress",
|
|
70304
|
-
"switch-call-failed"
|
|
70305
|
-
]);
|
|
70306
|
-
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
70307
|
-
accepted: literal(false),
|
|
70308
|
-
reason: PowerSourceRefusalReasonSchema,
|
|
70309
|
-
/** One line for the operator, naming the switch. */
|
|
70310
|
-
message: string()
|
|
70311
|
-
})]);
|
|
70312
|
-
var PowerSourceInfoSchema = object({
|
|
70313
|
-
/** False when the device has no power source linked; the rest is then empty. */
|
|
70314
|
-
linked: boolean(),
|
|
70315
|
-
switchDeviceId: number$1().nullable(),
|
|
70316
|
-
switchName: string().nullable(),
|
|
70317
|
-
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
70318
|
-
switchOn: boolean().nullable(),
|
|
70319
|
-
switchOnline: boolean().nullable(),
|
|
70320
|
-
restartInProgress: boolean(),
|
|
70321
|
-
offSeconds: number$1().int()
|
|
70322
|
-
});
|
|
70323
|
-
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
70324
|
-
var PowerSourceStateSchema = object({
|
|
70325
|
-
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
70326
|
-
switchOn: boolean().nullable(),
|
|
70327
|
-
offSeconds: number$1().int(),
|
|
70328
|
-
lastFetchedAt: number$1()
|
|
70329
|
-
});
|
|
70330
|
-
var POWER_SOURCE_DEVICE_TYPES = [
|
|
70331
|
-
DeviceType.Gateway,
|
|
70332
|
-
DeviceType.Hub,
|
|
70333
|
-
DeviceType.Camera,
|
|
70334
|
-
DeviceType.Sensor,
|
|
70335
|
-
DeviceType.MediaPlayer,
|
|
70336
|
-
DeviceType.Vacuum,
|
|
70337
|
-
DeviceType.Generic,
|
|
70338
|
-
DeviceType.Washer,
|
|
70339
|
-
DeviceType.Dryer,
|
|
70340
|
-
DeviceType.Dishwasher,
|
|
70341
|
-
DeviceType.PetFountain,
|
|
70342
|
-
DeviceType.Fan,
|
|
70343
|
-
DeviceType.Humidifier,
|
|
70344
|
-
DeviceType.Climate,
|
|
70345
|
-
DeviceType.WaterHeater
|
|
70346
|
-
];
|
|
70347
|
-
var powerSourceCustomize = {
|
|
70348
|
-
version: 1,
|
|
70349
|
-
targets: [{
|
|
70350
|
-
id: "switch",
|
|
70351
|
-
cardinality: "scalar",
|
|
70352
|
-
vocabulary: {
|
|
70353
|
-
cap: "power-source",
|
|
70354
|
-
stateField: "switchOn"
|
|
70355
|
-
},
|
|
70356
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
70357
|
-
apply: "add",
|
|
70358
|
-
path: "switchOn",
|
|
70359
|
-
sources: [{
|
|
70360
|
-
kind: "switch",
|
|
70361
|
-
transforms: [{ kind: "identity" }]
|
|
70362
|
-
}],
|
|
70363
|
-
companions: [{
|
|
70364
|
-
kind: "constant",
|
|
70365
|
-
path: "offSeconds",
|
|
70366
|
-
value: 10,
|
|
70367
|
-
when: "add"
|
|
70368
|
-
}, {
|
|
70369
|
-
kind: "clock",
|
|
70370
|
-
path: "lastFetchedAt",
|
|
70371
|
-
when: "always"
|
|
70372
|
-
}],
|
|
70373
|
-
sourceReport: { status: "assignment-status" }
|
|
70374
|
-
}]
|
|
70375
|
-
};
|
|
70376
|
-
var deviceInput = object({ deviceId: number$1().int().nonnegative() });
|
|
70377
|
-
var powerSourceCapability = {
|
|
70378
|
-
name: "power-source",
|
|
70379
|
-
scope: "device",
|
|
70380
|
-
mode: "singleton",
|
|
70381
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
70382
|
-
methods: {
|
|
70383
|
-
getStatus: systemMethod(deviceInput, PowerSourceInfoSchema, { auth: "admin" }),
|
|
70384
|
-
powerOn: systemMethod(deviceInput, PowerSourceActionResultSchema, {
|
|
70385
|
-
kind: "mutation",
|
|
70386
|
-
auth: "admin"
|
|
70387
|
-
}),
|
|
70388
|
-
powerOff: systemMethod(deviceInput, PowerSourceActionResultSchema, {
|
|
70389
|
-
kind: "mutation",
|
|
70390
|
-
auth: "admin"
|
|
70391
|
-
}),
|
|
70392
|
-
forceRestart: systemMethod(deviceInput, PowerSourceActionResultSchema, {
|
|
70393
|
-
kind: "mutation",
|
|
70394
|
-
auth: "admin"
|
|
70395
|
-
})
|
|
70396
|
-
},
|
|
70397
|
-
runtimeState: PowerSourceStateSchema,
|
|
70398
|
-
customize: powerSourceCustomize,
|
|
70399
|
-
/**
|
|
70400
|
-
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
70401
|
-
* its next report; a restored value would outlive the reading it names.
|
|
70402
|
-
*
|
|
70403
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
70404
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
70405
|
-
*/
|
|
70406
|
-
durability: "session",
|
|
70407
|
-
history: "none"
|
|
70408
|
-
};
|
|
70409
70534
|
/**
|
|
70410
70535
|
* A monotonic total between resets (D944). Energy uses `power-meter.energy`
|
|
70411
70536
|
* so dashboards keep one series; every other instantaneous reading lands here.
|
|
@@ -73947,6 +74072,10 @@ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
|
|
|
73947
74072
|
/** Generic Customize target for the running boolean (D936). */
|
|
73948
74073
|
var runningCustomize = {
|
|
73949
74074
|
version: 1,
|
|
74075
|
+
overridable: [{
|
|
74076
|
+
path: "running",
|
|
74077
|
+
by: "running"
|
|
74078
|
+
}],
|
|
73950
74079
|
targets: [{
|
|
73951
74080
|
id: "running",
|
|
73952
74081
|
cardinality: "scalar",
|
|
@@ -74004,7 +74133,7 @@ var runningCustomize = {
|
|
|
74004
74133
|
kind: "constant",
|
|
74005
74134
|
path: "phase",
|
|
74006
74135
|
value: null,
|
|
74007
|
-
when: "
|
|
74136
|
+
when: "add"
|
|
74008
74137
|
},
|
|
74009
74138
|
{
|
|
74010
74139
|
kind: "clock",
|
|
@@ -77288,7 +77417,7 @@ var ExternalIdentityKeySchema = object({
|
|
|
77288
77417
|
provider: string().min(1),
|
|
77289
77418
|
subject: string().min(1)
|
|
77290
77419
|
});
|
|
77291
|
-
method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
|
|
77420
|
+
method(_void(), array(UserSummarySchema), { auth: "admin" }), method(_void(), object({ defaultPasswordInUse: boolean() }), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
|
|
77292
77421
|
kind: "mutation",
|
|
77293
77422
|
auth: "admin",
|
|
77294
77423
|
access: "create"
|
|
@@ -80627,13 +80756,6 @@ Object.freeze({
|
|
|
80627
80756
|
access: "view",
|
|
80628
80757
|
role: "admin"
|
|
80629
80758
|
},
|
|
80630
|
-
"addons.installFromWorkspace": {
|
|
80631
|
-
capName: "addons",
|
|
80632
|
-
capScope: "system",
|
|
80633
|
-
addonId: null,
|
|
80634
|
-
access: "create",
|
|
80635
|
-
role: "admin"
|
|
80636
|
-
},
|
|
80637
80759
|
"addons.installPackage": {
|
|
80638
80760
|
capName: "addons",
|
|
80639
80761
|
capScope: "system",
|
|
@@ -80641,13 +80763,6 @@ Object.freeze({
|
|
|
80641
80763
|
access: "create",
|
|
80642
80764
|
role: "admin"
|
|
80643
80765
|
},
|
|
80644
|
-
"addons.isWorkspaceAvailable": {
|
|
80645
|
-
capName: "addons",
|
|
80646
|
-
capScope: "system",
|
|
80647
|
-
addonId: null,
|
|
80648
|
-
access: "view",
|
|
80649
|
-
role: "admin"
|
|
80650
|
-
},
|
|
80651
80766
|
"addons.list": {
|
|
80652
80767
|
capName: "addons",
|
|
80653
80768
|
capScope: "system",
|
|
@@ -80697,13 +80812,6 @@ Object.freeze({
|
|
|
80697
80812
|
access: "view",
|
|
80698
80813
|
role: "admin"
|
|
80699
80814
|
},
|
|
80700
|
-
"addons.listWorkspacePackages": {
|
|
80701
|
-
capName: "addons",
|
|
80702
|
-
capScope: "system",
|
|
80703
|
-
addonId: null,
|
|
80704
|
-
access: "view",
|
|
80705
|
-
role: "admin"
|
|
80706
|
-
},
|
|
80707
80815
|
"addons.onAddonLogs": {
|
|
80708
80816
|
capName: "addons",
|
|
80709
80817
|
capScope: "system",
|
|
@@ -83371,6 +83479,27 @@ Object.freeze({
|
|
|
83371
83479
|
access: "create",
|
|
83372
83480
|
role: "admin"
|
|
83373
83481
|
},
|
|
83482
|
+
"deviceRuns.getCurrentRun": {
|
|
83483
|
+
capName: "device-runs",
|
|
83484
|
+
capScope: "device",
|
|
83485
|
+
addonId: null,
|
|
83486
|
+
access: "view",
|
|
83487
|
+
role: "viewer"
|
|
83488
|
+
},
|
|
83489
|
+
"deviceRuns.getRun": {
|
|
83490
|
+
capName: "device-runs",
|
|
83491
|
+
capScope: "device",
|
|
83492
|
+
addonId: null,
|
|
83493
|
+
access: "view",
|
|
83494
|
+
role: "viewer"
|
|
83495
|
+
},
|
|
83496
|
+
"deviceRuns.listRuns": {
|
|
83497
|
+
capName: "device-runs",
|
|
83498
|
+
capScope: "device",
|
|
83499
|
+
addonId: null,
|
|
83500
|
+
access: "view",
|
|
83501
|
+
role: "viewer"
|
|
83502
|
+
},
|
|
83374
83503
|
"deviceState.claimFields": {
|
|
83375
83504
|
capName: "device-state",
|
|
83376
83505
|
capScope: "system",
|
|
@@ -90084,6 +90213,13 @@ Object.freeze({
|
|
|
90084
90213
|
access: "view",
|
|
90085
90214
|
role: "admin"
|
|
90086
90215
|
},
|
|
90216
|
+
"userManagement.getAdminBootstrapStatus": {
|
|
90217
|
+
capName: "user-management",
|
|
90218
|
+
capScope: "system",
|
|
90219
|
+
addonId: null,
|
|
90220
|
+
access: "view",
|
|
90221
|
+
role: "admin"
|
|
90222
|
+
},
|
|
90087
90223
|
"userManagement.getTotpStatus": {
|
|
90088
90224
|
capName: "user-management",
|
|
90089
90225
|
capScope: "system",
|
|
@@ -91569,6 +91705,21 @@ Object.freeze({
|
|
|
91569
91705
|
form: "single",
|
|
91570
91706
|
optional: false
|
|
91571
91707
|
}],
|
|
91708
|
+
"deviceRuns.getCurrentRun": [{
|
|
91709
|
+
name: "deviceId",
|
|
91710
|
+
form: "single",
|
|
91711
|
+
optional: false
|
|
91712
|
+
}],
|
|
91713
|
+
"deviceRuns.getRun": [{
|
|
91714
|
+
name: "deviceId",
|
|
91715
|
+
form: "single",
|
|
91716
|
+
optional: false
|
|
91717
|
+
}],
|
|
91718
|
+
"deviceRuns.listRuns": [{
|
|
91719
|
+
name: "deviceId",
|
|
91720
|
+
form: "single",
|
|
91721
|
+
optional: false
|
|
91722
|
+
}],
|
|
91572
91723
|
"deviceState.claimFields": [{
|
|
91573
91724
|
name: "deviceId",
|
|
91574
91725
|
form: "single",
|
|
@@ -94258,13 +94409,114 @@ NC_AUDIO_DEFAULTS.hitPercent, NC_AUDIO_DEFAULTS.samplingSeconds;
|
|
|
94258
94409
|
*
|
|
94259
94410
|
* Pure, RN-safe: the viewer imports the support rule from here.
|
|
94260
94411
|
*/
|
|
94412
|
+
/**
|
|
94413
|
+
* Control caps that still have a raise and a clear an operator names: an
|
|
94414
|
+
* appliance cycle raises when it STARTS and clears when it FINISHES. Kept out
|
|
94415
|
+
* of `SOURCE_CAP_ACTIVE_FIELD` on purpose — that table also makes a device a
|
|
94416
|
+
* camera-sensor / recorder-trigger source, and a dishwasher is neither.
|
|
94417
|
+
*/
|
|
94418
|
+
var CYCLE_RAISED_FIELD_BY_CAP = { "running-state": "running" };
|
|
94261
94419
|
/** Event kind → the boolean field of its cap slice that means "raised". */
|
|
94262
94420
|
var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.entries(EVENT_KIND_BY_CAP).flatMap(([capName, descriptor]) => {
|
|
94421
|
+
const cycleField = CYCLE_RAISED_FIELD_BY_CAP[capName];
|
|
94422
|
+
if (cycleField !== void 0) return [[descriptor.kind, cycleField]];
|
|
94263
94423
|
const field = SOURCE_CAP_ACTIVE_FIELD[capName];
|
|
94264
94424
|
if (field === void 0 || descriptor.category !== "sensor") return [];
|
|
94265
94425
|
return [[descriptor.kind, field]];
|
|
94266
94426
|
})));
|
|
94267
94427
|
Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
|
|
94428
|
+
Object.freeze({
|
|
94429
|
+
contact: {
|
|
94430
|
+
starts: {
|
|
94431
|
+
en: "opened",
|
|
94432
|
+
it: "si apre"
|
|
94433
|
+
},
|
|
94434
|
+
finishes: {
|
|
94435
|
+
en: "closed",
|
|
94436
|
+
it: "si chiude"
|
|
94437
|
+
}
|
|
94438
|
+
},
|
|
94439
|
+
"motion-sensor": {
|
|
94440
|
+
starts: {
|
|
94441
|
+
en: "motion detected",
|
|
94442
|
+
it: "movimento rilevato"
|
|
94443
|
+
},
|
|
94444
|
+
finishes: {
|
|
94445
|
+
en: "motion stopped",
|
|
94446
|
+
it: "movimento terminato"
|
|
94447
|
+
}
|
|
94448
|
+
},
|
|
94449
|
+
smoke: {
|
|
94450
|
+
starts: {
|
|
94451
|
+
en: "smoke detected",
|
|
94452
|
+
it: "fumo rilevato"
|
|
94453
|
+
},
|
|
94454
|
+
finishes: {
|
|
94455
|
+
en: "smoke gone",
|
|
94456
|
+
it: "fumo scomparso"
|
|
94457
|
+
}
|
|
94458
|
+
},
|
|
94459
|
+
flood: {
|
|
94460
|
+
starts: {
|
|
94461
|
+
en: "water detected",
|
|
94462
|
+
it: "acqua rilevata"
|
|
94463
|
+
},
|
|
94464
|
+
finishes: {
|
|
94465
|
+
en: "dry again",
|
|
94466
|
+
it: "di nuovo asciutto"
|
|
94467
|
+
}
|
|
94468
|
+
},
|
|
94469
|
+
gas: {
|
|
94470
|
+
starts: {
|
|
94471
|
+
en: "gas detected",
|
|
94472
|
+
it: "gas rilevato"
|
|
94473
|
+
},
|
|
94474
|
+
finishes: {
|
|
94475
|
+
en: "gas gone",
|
|
94476
|
+
it: "gas scomparso"
|
|
94477
|
+
}
|
|
94478
|
+
},
|
|
94479
|
+
"carbon-monoxide": {
|
|
94480
|
+
starts: {
|
|
94481
|
+
en: "carbon monoxide detected",
|
|
94482
|
+
it: "monossido rilevato"
|
|
94483
|
+
},
|
|
94484
|
+
finishes: {
|
|
94485
|
+
en: "carbon monoxide gone",
|
|
94486
|
+
it: "monossido scomparso"
|
|
94487
|
+
}
|
|
94488
|
+
},
|
|
94489
|
+
vibration: {
|
|
94490
|
+
starts: {
|
|
94491
|
+
en: "vibration detected",
|
|
94492
|
+
it: "vibrazione rilevata"
|
|
94493
|
+
},
|
|
94494
|
+
finishes: {
|
|
94495
|
+
en: "vibration stopped",
|
|
94496
|
+
it: "vibrazione terminata"
|
|
94497
|
+
}
|
|
94498
|
+
},
|
|
94499
|
+
tamper: {
|
|
94500
|
+
starts: {
|
|
94501
|
+
en: "tampered with",
|
|
94502
|
+
it: "manomesso"
|
|
94503
|
+
},
|
|
94504
|
+
finishes: {
|
|
94505
|
+
en: "tamper cleared",
|
|
94506
|
+
it: "manomissione rientrata"
|
|
94507
|
+
}
|
|
94508
|
+
},
|
|
94509
|
+
"appliance-cycle": {
|
|
94510
|
+
starts: {
|
|
94511
|
+
en: "the cycle started",
|
|
94512
|
+
it: "il ciclo parte"
|
|
94513
|
+
},
|
|
94514
|
+
finishes: {
|
|
94515
|
+
en: "the cycle finished",
|
|
94516
|
+
it: "il ciclo è terminato"
|
|
94517
|
+
}
|
|
94518
|
+
}
|
|
94519
|
+
});
|
|
94268
94520
|
object({
|
|
94269
94521
|
phase: _enum(["raised", "resolved"]),
|
|
94270
94522
|
episodeId: string().min(1),
|
|
@@ -94471,6 +94723,10 @@ var STATE_SUMMARY_VARS = [
|
|
|
94471
94723
|
[...RULE_TEXT],
|
|
94472
94724
|
[...RULE_TEXT],
|
|
94473
94725
|
[...RULE_TEXT],
|
|
94726
|
+
[...RULE_TEXT],
|
|
94727
|
+
[...RULE_TEXT],
|
|
94728
|
+
[...RULE_TEXT],
|
|
94729
|
+
[...RULE_TEXT],
|
|
94474
94730
|
[...RULE_BODY_ONLY],
|
|
94475
94731
|
[...RULE_TEXT],
|
|
94476
94732
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
@@ -94488,6 +94744,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
94488
94744
|
[...RULE_TEXT],
|
|
94489
94745
|
[...RULE_TEXT],
|
|
94490
94746
|
[...RULE_TEXT],
|
|
94747
|
+
[...RULE_TEXT],
|
|
94491
94748
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
94492
94749
|
[...RULE_TEXT],
|
|
94493
94750
|
[...RULE_TEXT],
|
|
@@ -94732,6 +94989,7 @@ new Set([
|
|
|
94732
94989
|
"siren",
|
|
94733
94990
|
"button",
|
|
94734
94991
|
"doorbell",
|
|
94992
|
+
"appliance-cycle",
|
|
94735
94993
|
"audio-speech",
|
|
94736
94994
|
"audio-scream",
|
|
94737
94995
|
"audio-crying",
|
|
@@ -133238,6 +133496,7 @@ var require_proxy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
133238
133496
|
_options.proxyLogLevel === "debug" && _options.logger && _options.logger(`Alexa-Cookie: Proxy-Request: (modified:${modified})${customStringify(proxyReq, null, 2)}`);
|
|
133239
133497
|
}
|
|
133240
133498
|
function onProxyRes(proxyRes, req, res) {
|
|
133499
|
+
stripUpgradeInsecureRequestsHeaders(proxyRes);
|
|
133241
133500
|
const url = req.originalUrl || req.url;
|
|
133242
133501
|
if (url.endsWith(".ico") || url.endsWith(".js") || url.endsWith(".ttf") || url.endsWith(".svg") || url.endsWith(".png") || url.endsWith(".appcache")) return;
|
|
133243
133502
|
if (url.startsWith("/ap/uedata")) return;
|
|
@@ -133330,7 +133589,18 @@ var require_proxy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
133330
133589
|
callbackListening = null;
|
|
133331
133590
|
});
|
|
133332
133591
|
}
|
|
133592
|
+
function stripUpgradeInsecureRequestsHeaders(proxyRes) {
|
|
133593
|
+
const headers = proxyRes && proxyRes.headers;
|
|
133594
|
+
if (!headers) return;
|
|
133595
|
+
for (const name of ["content-security-policy", "content-security-policy-report-only"]) {
|
|
133596
|
+
if (headers[name] === void 0) continue;
|
|
133597
|
+
const kept = (Array.isArray(headers[name]) ? headers[name] : [headers[name]]).map((v) => String(v).split(";").map((d) => d.trim()).filter((d) => d && !/^upgrade-insecure-requests$/i.test(d)).join("; ")).filter((v) => v);
|
|
133598
|
+
if (kept.length) headers[name] = kept.length === 1 ? kept[0] : kept;
|
|
133599
|
+
else delete headers[name];
|
|
133600
|
+
}
|
|
133601
|
+
}
|
|
133333
133602
|
module.exports.initAmazonProxy = initAmazonProxy;
|
|
133603
|
+
module.exports.stripUpgradeInsecureRequestsHeaders = stripUpgradeInsecureRequestsHeaders;
|
|
133334
133604
|
}));
|
|
133335
133605
|
//#endregion
|
|
133336
133606
|
//#region ../../node_modules/alexa-cookie2/alexa-cookie.js
|
|
@@ -138958,7 +139228,30 @@ var AlexaRemoteClient = class {
|
|
|
138958
139228
|
async pollStates(applianceIds) {
|
|
138959
139229
|
if (applianceIds.length === 0) return [];
|
|
138960
139230
|
const remote = this.#requireRemote();
|
|
138961
|
-
|
|
139231
|
+
const values = [];
|
|
139232
|
+
let failedChunks = 0;
|
|
139233
|
+
let lastError = null;
|
|
139234
|
+
let chunks = 0;
|
|
139235
|
+
for (let start = 0; start < applianceIds.length; start += 50) {
|
|
139236
|
+
const chunk = applianceIds.slice(start, start + 50);
|
|
139237
|
+
chunks += 1;
|
|
139238
|
+
try {
|
|
139239
|
+
const body = await this.#withBackoff("querySmarthomeDevices", () => this.#querySmarthomeDevices(remote, chunk));
|
|
139240
|
+
values.push(...decodeSmarthomeStates(body));
|
|
139241
|
+
} catch (err) {
|
|
139242
|
+
if (err instanceof AlexaAuthError) throw err;
|
|
139243
|
+
failedChunks += 1;
|
|
139244
|
+
lastError = err;
|
|
139245
|
+
this.#logger?.warn("AlexaRemoteClient: state query chunk failed", { meta: {
|
|
139246
|
+
brokerId: this.#options.brokerId,
|
|
139247
|
+
chunkSize: chunk.length,
|
|
139248
|
+
firstId: chunk[0],
|
|
139249
|
+
error: errMsg(err)
|
|
139250
|
+
} });
|
|
139251
|
+
}
|
|
139252
|
+
}
|
|
139253
|
+
if (failedChunks === chunks) throw lastError instanceof Error ? lastError : /* @__PURE__ */ new Error("AlexaRemoteClient: state poll failed");
|
|
139254
|
+
return values;
|
|
138962
139255
|
}
|
|
138963
139256
|
async sendCommand(command) {
|
|
138964
139257
|
const remote = this.#requireRemote();
|
|
@@ -139421,7 +139714,7 @@ var AlexaIntegrationManager = class {
|
|
|
139421
139714
|
httpStatus
|
|
139422
139715
|
}
|
|
139423
139716
|
});
|
|
139424
|
-
if (this.#pollFailures >= 3 && this.#status !== "disconnected") this.#transition(
|
|
139717
|
+
if (err instanceof AlexaAuthError && this.#pollFailures >= 3 && this.#status !== "disconnected") this.#transition("auth-failed");
|
|
139425
139718
|
}
|
|
139426
139719
|
}
|
|
139427
139720
|
#transition(next) {
|
|
@@ -140952,7 +141245,7 @@ var BrokerEcho = class {
|
|
|
140952
141245
|
try {
|
|
140953
141246
|
this.currentDevices = [...parseDevices(await this.deps.worker.request({ op: "devices" }))];
|
|
140954
141247
|
} catch (err) {
|
|
140955
|
-
this.deps.logger.warn("alexa speak: device
|
|
141248
|
+
this.deps.logger.warn("alexa speak: step 3 of 3, device list failed after a good sign-in", {
|
|
140956
141249
|
tags: { brokerId: this.deps.brokerId },
|
|
140957
141250
|
meta: { error: err instanceof Error ? err.message : String(err) }
|
|
140958
141251
|
});
|
|
@@ -141482,6 +141775,7 @@ function createAlexaNotificationProvider(ports) {
|
|
|
141482
141775
|
return found;
|
|
141483
141776
|
},
|
|
141484
141777
|
async discoverTargets(input) {
|
|
141778
|
+
for (const broker of ports.brokers()) if (!broker.ready) ports.logger.warn(`alexa echo discovery: no Echo listed for '${broker.name}', the Amazon account is not signed in for this broker`, { tags: { brokerId: broker.id } });
|
|
141485
141779
|
const named = readString(input.config ?? {}, "brokerId");
|
|
141486
141780
|
if (named.length > 0) {
|
|
141487
141781
|
const owner = ports.brokers().find((broker) => broker.id === named);
|