@camstack/addon-provider-bosch 0.1.52 → 0.1.53
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 +6 -0
- package/dist/{account-integration-offline-BEzGeJcl.js → account-integration-offline-C-KJYRdX.js} +1 -1
- package/dist/{account-integration-offline-D5vjmfia.mjs → account-integration-offline-KQcJ_VVK.mjs} +1 -1
- package/dist/{bosch-instances-LWbVnsaD.js → bosch-instances-dqTG9no9.js} +354 -37
- package/dist/{bosch-instances-DSE6IXdU.mjs → bosch-instances-y_A00js_.mjs} +349 -38
- package/dist/home-connect/addon.js +5 -3
- package/dist/home-connect/addon.mjs +5 -3
- package/dist/homecom/addon.js +2 -2
- package/dist/homecom/addon.mjs +2 -2
- package/dist/shc/addon.js +1 -1
- package/dist/shc/addon.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.53] - 2026-11-12
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Event devices declare their event vocabulary; each event is listed under its native name for now
|
|
15
|
+
|
|
10
16
|
## [0.1.52] - 2026-11-11
|
|
11
17
|
|
|
12
18
|
### Changed
|
package/dist/{account-integration-offline-BEzGeJcl.js → account-integration-offline-C-KJYRdX.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_bosch_instances = require("./bosch-instances-
|
|
1
|
+
const require_bosch_instances = require("./bosch-instances-dqTG9no9.js");
|
|
2
2
|
let node_crypto = require("node:crypto");
|
|
3
3
|
//#region src/shared/sign-in-redirects.ts
|
|
4
4
|
/** The addresses each vendor sends the browser to after a sign-in; no browser can open them. Kept free of imports so the form schema can name them. */
|
package/dist/{account-integration-offline-D5vjmfia.mjs → account-integration-offline-KQcJ_VVK.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { et as errMsg } from "./bosch-instances-y_A00js_.mjs";
|
|
2
2
|
import { randomBytes } from "node:crypto";
|
|
3
3
|
//#region src/shared/sign-in-redirects.ts
|
|
4
4
|
/** The addresses each vendor sends the browser to after a sign-in; no browser can open them. Kept free of imports so the form schema can name them. */
|
|
@@ -6044,7 +6044,7 @@ var ZodIssueCode = {
|
|
|
6044
6044
|
var ZodFirstPartyTypeKind;
|
|
6045
6045
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6046
6046
|
//#endregion
|
|
6047
|
-
//#region ../types/dist/sleep-
|
|
6047
|
+
//#region ../types/dist/sleep-D0roI_CZ.mjs
|
|
6048
6048
|
/**
|
|
6049
6049
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6050
6050
|
* window to float samples (D455).
|
|
@@ -16242,6 +16242,10 @@ Object.freeze({
|
|
|
16242
16242
|
"path": "lastEvent.eventType",
|
|
16243
16243
|
"valueType": "string"
|
|
16244
16244
|
},
|
|
16245
|
+
{
|
|
16246
|
+
"path": "lastEvent.sourceId",
|
|
16247
|
+
"valueType": "string"
|
|
16248
|
+
},
|
|
16245
16249
|
{
|
|
16246
16250
|
"path": "lastEvent.timestamp",
|
|
16247
16251
|
"valueType": "number"
|
|
@@ -44800,9 +44804,12 @@ function convertLegacyWhen(half) {
|
|
|
44800
44804
|
* every caller — automations, Actions, and the notification centre, which runs
|
|
44801
44805
|
* only Actions (planning#473).
|
|
44802
44806
|
*/
|
|
44807
|
+
/** The longest one `wait` step lasts. It is cut by a restart of the run and does not survive a hub restart. */
|
|
44808
|
+
var WAIT_MAX_SECONDS = 3600;
|
|
44809
|
+
var WAIT_TOO_LONG = `a wait is at most one hour (${WAIT_MAX_SECONDS} s)`;
|
|
44803
44810
|
var AutomationWaitStepSchema = object({
|
|
44804
44811
|
kind: literal("wait"),
|
|
44805
|
-
seconds: number$1().min(0).max(
|
|
44812
|
+
seconds: number$1().min(0).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG)
|
|
44806
44813
|
});
|
|
44807
44814
|
/** The legacy `deviceId` of a cap step: still READ, never written (D983). */
|
|
44808
44815
|
var LegacyStepDeviceSchema = union([
|
|
@@ -44872,39 +44879,227 @@ var elseNeedsIf = {
|
|
|
44872
44879
|
path: ["else"]
|
|
44873
44880
|
};
|
|
44874
44881
|
var GuardedWaitStepSchema = AutomationWaitStepSchema.extend(stepGuardShape).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44875
|
-
var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44876
|
-
message: "a cap step needs a target",
|
|
44877
|
-
path: ["target"]
|
|
44878
|
-
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
44879
|
-
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44880
|
-
path: ["actionId"]
|
|
44881
|
-
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44882
44882
|
/**
|
|
44883
44883
|
* A step of a STANDALONE list (an action, a scheduler point, a preset): the
|
|
44884
44884
|
* same two step kinds an automation runs, minus a guard that reads the
|
|
44885
44885
|
* automation's trigger, which such a list does not have.
|
|
44886
44886
|
*/
|
|
44887
|
-
var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema,
|
|
44887
|
+
var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema, AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44888
|
+
message: "a cap step needs a target",
|
|
44889
|
+
path: ["target"]
|
|
44890
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
44891
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44892
|
+
path: ["actionId"]
|
|
44893
|
+
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf)]).superRefine((step, ctx) => {
|
|
44888
44894
|
if (step.if !== void 0 && hasTriggeredByLeaves(step.if)) ctx.addIssue({
|
|
44889
44895
|
code: "custom",
|
|
44890
44896
|
message: TRIGGERED_BY_NEEDS_AUTOMATION,
|
|
44891
44897
|
path: ["if"]
|
|
44892
44898
|
});
|
|
44893
44899
|
});
|
|
44900
|
+
/**
|
|
44901
|
+
* Flow control of an AUTOMATION's list (#500). A standalone list (an action, a
|
|
44902
|
+
* scheduler point, a preset) stays `wait` and `cap`: it has no run of its own
|
|
44903
|
+
* to end and no variable bag to write.
|
|
44904
|
+
*/
|
|
44905
|
+
var continueOnErrorShape = {
|
|
44906
|
+
/** A failure of this step is traced `failed-continued` and the next step runs. */
|
|
44907
|
+
continueOnError: literal(true).optional() };
|
|
44908
|
+
/** An automation's cap step: the shared guarded cap step, plus `continueOnError`. */
|
|
44909
|
+
var AutomationGuardedCapStepSchema = AutomationCapStepBaseSchema.extend({
|
|
44910
|
+
...stepGuardShape,
|
|
44911
|
+
...continueOnErrorShape
|
|
44912
|
+
}).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44913
|
+
message: "a cap step needs a target",
|
|
44914
|
+
path: ["target"]
|
|
44915
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
44916
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44917
|
+
path: ["actionId"]
|
|
44918
|
+
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44919
|
+
/** End the run here, on purpose. `reason` may carry `{{vars.x}}` slots. */
|
|
44920
|
+
var AutomationStopStepSchema = object({
|
|
44921
|
+
kind: literal("stop"),
|
|
44922
|
+
reason: string().min(1, "a stop needs a reason: it is what the run trace shows").max(200),
|
|
44923
|
+
/** `ok`: the run ends as a success. `failed`: it ends as a failure, with the reason. */
|
|
44924
|
+
outcome: _enum(["ok", "failed"]),
|
|
44925
|
+
/** Stop only when this reads true; false or unknown does not stop. */
|
|
44926
|
+
if: AutomationWhenSchema.optional()
|
|
44927
|
+
});
|
|
44928
|
+
var SET_VAR_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]{0,39}$/;
|
|
44929
|
+
/** Names the run itself writes and reads (`leaf` is what `triggered-by` judges): a step may not overwrite them. */
|
|
44930
|
+
var RESERVED_RUN_VARS = [
|
|
44931
|
+
"kind",
|
|
44932
|
+
"leaf",
|
|
44933
|
+
"at"
|
|
44934
|
+
];
|
|
44935
|
+
/**
|
|
44936
|
+
* Write variables into the run's bag, for the steps after it. SUBSTITUTION
|
|
44937
|
+
* only, never evaluation: a text value may carry `{{vars.x}}` slots.
|
|
44938
|
+
*/
|
|
44939
|
+
var AutomationSetStepSchema = object({
|
|
44940
|
+
kind: literal("set"),
|
|
44941
|
+
vars: record(string(), union([
|
|
44942
|
+
string().max(500),
|
|
44943
|
+
number$1(),
|
|
44944
|
+
boolean()
|
|
44945
|
+
])).refine((vars) => Object.keys(vars).every((name) => SET_VAR_NAME_RE.test(name)), { message: "a variable name is letters, digits and _, not starting with a digit (max 40)" }).refine((vars) => Object.keys(vars).length >= 1, { message: "set needs at least one variable" }).refine((vars) => Object.keys(vars).length <= 20, { message: `set holds at most 20 variables` }).refine((vars) => Object.keys(vars).every((name) => !RESERVED_RUN_VARS.includes(name)), { message: `the names ${RESERVED_RUN_VARS.join(", ")} belong to the run and cannot be set` }),
|
|
44946
|
+
/** Set only when this reads true; false or unknown leaves the bag as it is. */
|
|
44947
|
+
if: AutomationWhenSchema.optional()
|
|
44948
|
+
});
|
|
44949
|
+
var AutomationRunActionStepSchema = object({
|
|
44950
|
+
kind: literal("action"),
|
|
44951
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
44952
|
+
actionId: string().min(1),
|
|
44953
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
44954
|
+
variables: record(string(), union([
|
|
44955
|
+
string(),
|
|
44956
|
+
number$1(),
|
|
44957
|
+
boolean()
|
|
44958
|
+
])).optional(),
|
|
44959
|
+
...continueOnErrorShape
|
|
44960
|
+
});
|
|
44961
|
+
/**
|
|
44962
|
+
* A step INSIDE a branch of a `choose`: a flow step with no condition of its
|
|
44963
|
+
* own (the branch is the condition) and no block inside it. Strict, so an `if`
|
|
44964
|
+
* written on such a step is refused rather than dropped.
|
|
44965
|
+
*/
|
|
44966
|
+
/** The longest a `wait-until` may wait: six hours. */
|
|
44967
|
+
var WAIT_UNTIL_TIMEOUT_MAX_S = 21600;
|
|
44968
|
+
/**
|
|
44969
|
+
* Pause the run until a condition is true (#500). The timeout is mandatory: a
|
|
44970
|
+
* run never waits without an end. `onTimeout` says what a wait that ran out
|
|
44971
|
+
* does: `continue` goes on to the next step, `stop` ends the run as a failure.
|
|
44972
|
+
* A condition that cannot be read is not "true": the wait goes on (D49).
|
|
44973
|
+
*/
|
|
44974
|
+
var AutomationWaitUntilStepSchema = object({
|
|
44975
|
+
kind: literal("wait-until"),
|
|
44976
|
+
when: AutomationWhenSchema,
|
|
44977
|
+
timeoutS: number$1().int().min(1, "a wait needs a timeout of at least one second").max(WAIT_UNTIL_TIMEOUT_MAX_S, `a wait for a condition is at most six hours (${WAIT_UNTIL_TIMEOUT_MAX_S} s)`),
|
|
44978
|
+
onTimeout: _enum(["continue", "stop"])
|
|
44979
|
+
}).strict();
|
|
44980
|
+
/** The step kinds that hold steps of their own, or pause on a condition: they nest two levels at most. */
|
|
44981
|
+
var BLOCK_STEP_KINDS = [
|
|
44982
|
+
"choose",
|
|
44983
|
+
"repeat",
|
|
44984
|
+
"parallel",
|
|
44985
|
+
"wait-until"
|
|
44986
|
+
];
|
|
44987
|
+
var NEST_TOO_DEEP = `steps nest two levels at most: a step inside a nested choose or repeat can be a plain step only`;
|
|
44988
|
+
function kindOf(input) {
|
|
44989
|
+
return typeof input === "object" && input !== null ? Reflect.get(input, "kind") : void 0;
|
|
44990
|
+
}
|
|
44991
|
+
/** Where the nesting ends, a block step is refused in words rather than as an unknown kind. */
|
|
44992
|
+
function nestTooDeep(issue) {
|
|
44993
|
+
const kind = kindOf(issue.input);
|
|
44994
|
+
return typeof kind === "string" && BLOCK_STEP_KINDS.includes(kind) ? NEST_TOO_DEEP : void 0;
|
|
44995
|
+
}
|
|
44996
|
+
var plainStepSchemas = [
|
|
44997
|
+
AutomationWaitStepSchema.strict(),
|
|
44998
|
+
AutomationCapStepBaseSchema.extend(continueOnErrorShape).strict().refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44999
|
+
message: "a cap step needs a target",
|
|
45000
|
+
path: ["target"]
|
|
45001
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
45002
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
45003
|
+
path: ["actionId"]
|
|
45004
|
+
}),
|
|
45005
|
+
AutomationStopStepSchema.omit({ if: true }).strict(),
|
|
45006
|
+
AutomationSetStepSchema.omit({ if: true }).strict(),
|
|
45007
|
+
AutomationRunActionStepSchema.strict()
|
|
45008
|
+
];
|
|
45009
|
+
/**
|
|
45010
|
+
* A plain step: a flow step with no condition of its own and no step inside
|
|
45011
|
+
* it. The second (last) level of nesting holds these only.
|
|
45012
|
+
*/
|
|
45013
|
+
var AutomationBranchStepSchema = discriminatedUnion("kind", plainStepSchemas, { error: nestTooDeep });
|
|
45014
|
+
/** A step that can run beside others: it writes no variable and does not end the run. */
|
|
45015
|
+
var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) => step.kind === "cap" || step.kind === "action" || step.kind === "wait", "a parallel holds device commands, actions and waits only: a set or a stop beside other steps has no order");
|
|
45016
|
+
/**
|
|
45017
|
+
* Several steps at once (#500): all are started together and all are awaited.
|
|
45018
|
+
* A failure fails the run once the others finished, as in a sequence; a member
|
|
45019
|
+
* marked "continue if this fails" does not.
|
|
45020
|
+
*/
|
|
45021
|
+
var AutomationParallelStepSchema = object({
|
|
45022
|
+
kind: literal("parallel"),
|
|
45023
|
+
steps: array(AutomationParallelMemberSchema).min(2, "a parallel needs at least two steps").max(5, `a parallel takes at most 5 steps`)
|
|
45024
|
+
}).strict();
|
|
45025
|
+
var REPEAT_NEEDS_MAX = "a repeat on a condition needs a maximum number of iterations";
|
|
45026
|
+
/** A loop on a condition: the bound is mandatory, so a run never loops without an end. */
|
|
45027
|
+
var repeatConditionShape = {
|
|
45028
|
+
when: AutomationWhenSchema,
|
|
45029
|
+
maxIterations: number$1({ error: REPEAT_NEEDS_MAX }).int().min(1, REPEAT_NEEDS_MAX).max(50, `a repeat on a condition runs at most 50 times`),
|
|
45030
|
+
/** A pause between two iterations, never after the last. */
|
|
45031
|
+
waitS: number$1().int().min(1).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG).optional()
|
|
45032
|
+
};
|
|
45033
|
+
/** What decides how many times a `repeat` runs. */
|
|
45034
|
+
var AutomationRepeatLoopSchema = discriminatedUnion("by", [
|
|
45035
|
+
object({
|
|
45036
|
+
by: literal("count"),
|
|
45037
|
+
count: number$1().int().min(1).max(20, `a repeat runs at most 20 times`)
|
|
45038
|
+
}).strict(),
|
|
45039
|
+
object({
|
|
45040
|
+
by: literal("while"),
|
|
45041
|
+
...repeatConditionShape
|
|
45042
|
+
}).strict(),
|
|
45043
|
+
object({
|
|
45044
|
+
by: literal("until"),
|
|
45045
|
+
...repeatConditionShape
|
|
45046
|
+
}).strict(),
|
|
45047
|
+
object({
|
|
45048
|
+
by: literal("forEach"),
|
|
45049
|
+
target: object({
|
|
45050
|
+
kind: literal("devices"),
|
|
45051
|
+
ids: array(number$1().int()).min(1, "a repeat over devices needs at least one device").max(50, `a repeat over devices takes at most 50 devices`)
|
|
45052
|
+
}).strict()
|
|
45053
|
+
}).strict()
|
|
45054
|
+
]);
|
|
45055
|
+
/**
|
|
45056
|
+
* The same steps several times (#500). Every form is bounded at save, so a
|
|
45057
|
+
* run cannot loop without an end. A failure or a `stop` in the steps ends the
|
|
45058
|
+
* loop and the run, as in a sequence.
|
|
45059
|
+
*/
|
|
45060
|
+
function repeatSchemaOf(step) {
|
|
45061
|
+
return object({
|
|
45062
|
+
kind: literal("repeat"),
|
|
45063
|
+
loop: AutomationRepeatLoopSchema,
|
|
45064
|
+
steps: array(step).min(1, "a repeat needs at least one step").max(10, `a repeat takes at most 10 steps`)
|
|
45065
|
+
}).strict();
|
|
45066
|
+
}
|
|
45067
|
+
/**
|
|
45068
|
+
* One step, several ways (#500): the branches are read in order and the FIRST
|
|
45069
|
+
* whose condition is true runs; `else` runs when every branch is false. A
|
|
45070
|
+
* branch that cannot be read ends the choice: nothing runs, not the branches
|
|
45071
|
+
* after it and not the else (D49). The #472 `if` / `else` of a wait or cap
|
|
45072
|
+
* step is the one-branch case and stays as it is stored.
|
|
45073
|
+
*/
|
|
45074
|
+
function chooseSchemaOf(step) {
|
|
45075
|
+
const steps = array(step).max(10);
|
|
45076
|
+
return object({
|
|
45077
|
+
kind: literal("choose"),
|
|
45078
|
+
branches: array(object({
|
|
45079
|
+
if: AutomationWhenSchema,
|
|
45080
|
+
steps: steps.min(1, "a branch needs at least one step")
|
|
45081
|
+
})).min(1, "a choose needs at least one branch").max(6, `a choose takes at most 6 branches`),
|
|
45082
|
+
else: steps.optional()
|
|
45083
|
+
});
|
|
45084
|
+
}
|
|
45085
|
+
var AutomationBodyStepSchema = discriminatedUnion("kind", [
|
|
45086
|
+
...plainStepSchemas,
|
|
45087
|
+
AutomationWaitUntilStepSchema,
|
|
45088
|
+
AutomationParallelStepSchema,
|
|
45089
|
+
chooseSchemaOf(AutomationBranchStepSchema),
|
|
45090
|
+
repeatSchemaOf(AutomationBranchStepSchema)
|
|
45091
|
+
]);
|
|
45092
|
+
var AutomationRepeatStepSchema = repeatSchemaOf(AutomationBodyStepSchema);
|
|
44894
45093
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
44895
45094
|
GuardedWaitStepSchema,
|
|
44896
|
-
|
|
44897
|
-
|
|
44898
|
-
|
|
44899
|
-
|
|
44900
|
-
|
|
44901
|
-
|
|
44902
|
-
|
|
44903
|
-
|
|
44904
|
-
number$1(),
|
|
44905
|
-
boolean()
|
|
44906
|
-
])).optional()
|
|
44907
|
-
}),
|
|
45095
|
+
AutomationGuardedCapStepSchema,
|
|
45096
|
+
AutomationStopStepSchema,
|
|
45097
|
+
AutomationSetStepSchema,
|
|
45098
|
+
chooseSchemaOf(AutomationBodyStepSchema),
|
|
45099
|
+
AutomationWaitUntilStepSchema,
|
|
45100
|
+
AutomationParallelStepSchema,
|
|
45101
|
+
AutomationRepeatStepSchema,
|
|
45102
|
+
AutomationRunActionStepSchema,
|
|
44908
45103
|
object({
|
|
44909
45104
|
kind: literal("code"),
|
|
44910
45105
|
/** Compiled into the automation's OWN block by esbuild — not a third
|
|
@@ -44967,11 +45162,6 @@ function convertLegacyRecipe(legacy) {
|
|
|
44967
45162
|
...rest
|
|
44968
45163
|
};
|
|
44969
45164
|
}
|
|
44970
|
-
/**
|
|
44971
|
-
* Where recipes are PARSED (the core-blocks cap, the MCP tool, the literal a
|
|
44972
|
-
* saved block carries): the new shape as it is, or the old shape converted to
|
|
44973
|
-
* it. The output type is always the new one.
|
|
44974
|
-
*/
|
|
44975
45165
|
var AutomationRecipeSchema = union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
|
|
44976
45166
|
var DETECTION_DESCRIPTIONS = {
|
|
44977
45167
|
deviceId: "the camera that saw it",
|
|
@@ -45056,12 +45246,16 @@ var HoldOverrideSchema = discriminatedUnion("mode", [object({ mode: literal("res
|
|
|
45056
45246
|
})]);
|
|
45057
45247
|
/** A missed edge up to this late still runs. */
|
|
45058
45248
|
var DEFAULT_MAX_LATE_MS = 10 * 6e4;
|
|
45249
|
+
var SchedulerStepSchema = ActionStepSchema.refine((step) => step.kind !== "wait" || step.seconds <= 300, {
|
|
45250
|
+
message: `a scheduler point waits at most five minutes (300 s); put a longer wait in an action`,
|
|
45251
|
+
path: ["seconds"]
|
|
45252
|
+
});
|
|
45059
45253
|
var SchedulerPointSchema = object({
|
|
45060
45254
|
id: string().min(1).max(64),
|
|
45061
45255
|
at: SchedulerTimeSpecSchema,
|
|
45062
45256
|
mode: SchedulerPointModeSchema,
|
|
45063
45257
|
/** The actions of an `edge` or `hold`; a `release` has none. */
|
|
45064
|
-
steps: array(
|
|
45258
|
+
steps: array(SchedulerStepSchema).max(20).default([]),
|
|
45065
45259
|
/** Checked when the point runs (an edge) or is applied (a hold). */
|
|
45066
45260
|
conditions: SchedulerStateTreeSchema.optional(),
|
|
45067
45261
|
/** Hold only; absent means `respect`. */
|
|
@@ -45329,18 +45523,46 @@ var StepTraceBaseSchema = object({
|
|
|
45329
45523
|
]).optional(),
|
|
45330
45524
|
/** Why the condition read what it read, in the evaluator's own words. */
|
|
45331
45525
|
conditionReason: string().optional(),
|
|
45332
|
-
/** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. */
|
|
45526
|
+
/** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. `failed-continued`: it failed and was marked to be passed over (#500). */
|
|
45333
45527
|
outcome: _enum([
|
|
45334
45528
|
"ok",
|
|
45335
45529
|
"error",
|
|
45336
45530
|
"not-run",
|
|
45337
45531
|
"empty",
|
|
45338
|
-
"skipped"
|
|
45532
|
+
"skipped",
|
|
45533
|
+
"failed-continued",
|
|
45534
|
+
"timed-out"
|
|
45339
45535
|
]),
|
|
45340
45536
|
message: string().optional()
|
|
45341
45537
|
});
|
|
45538
|
+
/** What a block step adds to its row: which list ran, what each branch read, how many rounds. */
|
|
45539
|
+
var blockTraceShape = {
|
|
45540
|
+
/** A `choose` step (#500): the list that ran, `branches.<n>` or `else`. Absent when none did. */
|
|
45541
|
+
branch: string().optional(),
|
|
45542
|
+
/** A `choose` step: what each branch read, in order, up to the one that decided. */
|
|
45543
|
+
branchChecks: array(object({
|
|
45544
|
+
condition: _enum([
|
|
45545
|
+
"true",
|
|
45546
|
+
"false",
|
|
45547
|
+
"unknown"
|
|
45548
|
+
]),
|
|
45549
|
+
conditionReason: string().optional()
|
|
45550
|
+
})).optional(),
|
|
45551
|
+
/** A `repeat` step (#500): how many times its steps ran. */
|
|
45552
|
+
iterations: number$1().int().optional()
|
|
45553
|
+
};
|
|
45554
|
+
/** A step one level down: it may be a block step itself, whose own steps are plain rows (the nesting ends there). */
|
|
45555
|
+
var NestedStepTraceSchema = StepTraceBaseSchema.extend({
|
|
45556
|
+
...blockTraceShape,
|
|
45557
|
+
steps: array(StepTraceBaseSchema).optional()
|
|
45558
|
+
});
|
|
45342
45559
|
/** A step trace; the `else` steps that ran are one level of the same shape (the nesting is bounded at one). */
|
|
45343
|
-
var AutomationStepTraceSchema = StepTraceBaseSchema.extend({
|
|
45560
|
+
var AutomationStepTraceSchema = StepTraceBaseSchema.extend({
|
|
45561
|
+
else: array(StepTraceBaseSchema).optional(),
|
|
45562
|
+
...blockTraceShape,
|
|
45563
|
+
/** A `choose` step: the steps of the list that ran. A `parallel`: its members. A `repeat`: the LAST iteration. */
|
|
45564
|
+
steps: array(NestedStepTraceSchema).optional()
|
|
45565
|
+
});
|
|
45344
45566
|
var AutomationRunTraceSchema = object({
|
|
45345
45567
|
runId: string().min(1),
|
|
45346
45568
|
startedAt: number$1(),
|
|
@@ -45747,7 +45969,9 @@ var AddonHttpRouteSchema = object({
|
|
|
45747
45969
|
]).optional(),
|
|
45748
45970
|
description: string().optional(),
|
|
45749
45971
|
/** The hub limits this route per client address before the handler runs. */
|
|
45750
|
-
rateLimit: _enum(["auth"]).optional()
|
|
45972
|
+
rateLimit: _enum(["auth"]).optional(),
|
|
45973
|
+
/** Served once per integration instance; the handler reads `instanceId`. */
|
|
45974
|
+
perInstance: boolean().optional()
|
|
45751
45975
|
});
|
|
45752
45976
|
/**
|
|
45753
45977
|
* Cross-process route invocation envelope. The hub captures the
|
|
@@ -45764,6 +45988,8 @@ var InvokeRequestSchema = object({
|
|
|
45764
45988
|
query: record(string(), string()),
|
|
45765
45989
|
body: unknown(),
|
|
45766
45990
|
headers: record(string(), string()),
|
|
45991
|
+
/** The instance the hub resolved for a `perInstance` route. */
|
|
45992
|
+
instanceId: string().optional(),
|
|
45767
45993
|
user: object({
|
|
45768
45994
|
id: string(),
|
|
45769
45995
|
username: string(),
|
|
@@ -56435,25 +56661,81 @@ var enumSensorCapability = {
|
|
|
56435
56661
|
* whether persisting is worth a SQLite commit. */
|
|
56436
56662
|
volatileStateFields: ["lastFetchedAt", "timestamp"]
|
|
56437
56663
|
};
|
|
56664
|
+
var EventVocabularyKindSchema = _enum([
|
|
56665
|
+
"press",
|
|
56666
|
+
"long-press",
|
|
56667
|
+
"long-press-start",
|
|
56668
|
+
"release",
|
|
56669
|
+
"repeat",
|
|
56670
|
+
"double-press",
|
|
56671
|
+
"other"
|
|
56672
|
+
]);
|
|
56673
|
+
/** The part of the device an event comes from: a button, a channel. */
|
|
56674
|
+
var EventVocabularySourceSchema = object({
|
|
56675
|
+
id: string().min(1),
|
|
56676
|
+
label: string().min(1)
|
|
56677
|
+
});
|
|
56678
|
+
/** One scalar field of an event's `data`, by dotted path. */
|
|
56679
|
+
var EventVocabularyFieldSchema = object({
|
|
56680
|
+
path: string().min(1),
|
|
56681
|
+
kind: _enum([
|
|
56682
|
+
"string",
|
|
56683
|
+
"number",
|
|
56684
|
+
"boolean",
|
|
56685
|
+
"enum"
|
|
56686
|
+
]),
|
|
56687
|
+
enumValues: array(string()).optional(),
|
|
56688
|
+
label: string().min(1).optional()
|
|
56689
|
+
});
|
|
56690
|
+
var EventVocabularyEntrySchema = object({
|
|
56691
|
+
/** The native token, verbatim. */
|
|
56692
|
+
id: string().min(1),
|
|
56693
|
+
source: EventVocabularySourceSchema.optional(),
|
|
56694
|
+
label: string().min(1),
|
|
56695
|
+
description: string().optional(),
|
|
56696
|
+
kind: EventVocabularyKindSchema.optional(),
|
|
56697
|
+
payload: array(EventVocabularyFieldSchema).optional()
|
|
56698
|
+
});
|
|
56699
|
+
/**
|
|
56700
|
+
* The vocabulary of a source that declares tokens and nothing else: one
|
|
56701
|
+
* entry per token, labelled with the token itself.
|
|
56702
|
+
*/
|
|
56703
|
+
function plainEventVocabulary(eventTypes) {
|
|
56704
|
+
return [...new Set(eventTypes)].filter((eventType) => eventType !== "").map((eventType) => ({
|
|
56705
|
+
id: eventType,
|
|
56706
|
+
label: eventType
|
|
56707
|
+
}));
|
|
56708
|
+
}
|
|
56438
56709
|
/**
|
|
56439
56710
|
* Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
|
|
56440
56711
|
* device. Carries the device's EXACT declared event vocabulary verbatim
|
|
56441
56712
|
* (NO normalization). Two shapes:
|
|
56442
|
-
* - structured source (HA `event.*` entity) → `
|
|
56443
|
-
* declared
|
|
56444
|
-
* - generic/legacy source (HA bus events, e.g. zha_event) → `
|
|
56713
|
+
* - structured source (HA `event.*` entity) → `vocabulary` is the fixed
|
|
56714
|
+
* declared set (e.g. press_short, press_long, …).
|
|
56715
|
+
* - generic/legacy source (HA bus events, e.g. zha_event) → `vocabulary`
|
|
56445
56716
|
* is [] (open) and `lastEvent.data` carries the complex payload.
|
|
56717
|
+
* `vocabulary` (D1044) names each event for a person and types it for a
|
|
56718
|
+
* rule; `eventTypes` is its list of native tokens, kept for older readers.
|
|
56719
|
+
* A fire names the part of the device it came from in `sourceId` when the
|
|
56720
|
+
* vocabulary declares sources (a remote's buttons).
|
|
56446
56721
|
* `seq` is monotonic so two identical events still produce distinct slice writes.
|
|
56447
56722
|
*/
|
|
56448
56723
|
var EventFireSchema = object({
|
|
56449
56724
|
deviceId: number$1(),
|
|
56450
56725
|
eventType: string(),
|
|
56726
|
+
sourceId: string().optional(),
|
|
56451
56727
|
data: record(string(), unknown()).nullable(),
|
|
56452
56728
|
timestamp: number$1().meta(readingMeta("none")),
|
|
56453
56729
|
seq: number$1().meta(readingMeta("count"))
|
|
56454
56730
|
});
|
|
56455
56731
|
var EventEmitterStatusSchema = object({
|
|
56456
56732
|
eventTypes: array(string()),
|
|
56733
|
+
/**
|
|
56734
|
+
* Required of a provider by the type. A status written before the field
|
|
56735
|
+
* existed still parses, as an empty vocabulary: read it through
|
|
56736
|
+
* `readEventVocabulary`, which then answers with the plain tokens.
|
|
56737
|
+
*/
|
|
56738
|
+
vocabulary: array(EventVocabularyEntrySchema).default([]),
|
|
56457
56739
|
lastEvent: EventFireSchema.nullable(),
|
|
56458
56740
|
eventCountSinceStart: number$1().meta(readingMeta("count"))
|
|
56459
56741
|
});
|
|
@@ -71972,7 +72254,18 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
71972
72254
|
* The value is baked into the authorization code at `/authorize` and travels
|
|
71973
72255
|
* on the tokens, so editing this field changes FUTURE links only.
|
|
71974
72256
|
*/
|
|
71975
|
-
refreshTokenTtlSec: union([number$1().int().positive(), literal("never")]).optional()
|
|
72257
|
+
refreshTokenTtlSec: union([number$1().int().positive(), literal("never")]).optional(),
|
|
72258
|
+
/**
|
|
72259
|
+
* The integration instances an account can be linked to (planning#415),
|
|
72260
|
+
* beside the default one. `/api/oauth2/authorize?instance=<id>` is accepted
|
|
72261
|
+
* only for an id listed here; with no `instance=` the link is made to the
|
|
72262
|
+
* default instance, which is never listed and always accepted — it is the
|
|
72263
|
+
* address third parties already hold. Omit for a single-instance integration.
|
|
72264
|
+
*/
|
|
72265
|
+
instances: array(object({
|
|
72266
|
+
id: string(),
|
|
72267
|
+
displayName: string()
|
|
72268
|
+
})).optional()
|
|
71976
72269
|
});
|
|
71977
72270
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
71978
72271
|
/**
|
|
@@ -78909,6 +79202,13 @@ var SsoBridgeClaimsSchema = object({
|
|
|
78909
79202
|
/** OAuth authorization-code binding — set only on `oauth-code` tokens. */
|
|
78910
79203
|
redirectUri: string().optional(),
|
|
78911
79204
|
integrationId: string().optional(),
|
|
79205
|
+
/**
|
|
79206
|
+
* The integration INSTANCE an OAuth link was made for (planning#415). Set on
|
|
79207
|
+
* `oauth-code`, `oauth-access` and `oauth-refresh` tokens of a link made
|
|
79208
|
+
* with `instance=`; absent on a link to the default instance. A cloud relay
|
|
79209
|
+
* reads it off the access token to route; the hub answers from the session.
|
|
79210
|
+
*/
|
|
79211
|
+
instanceId: string().optional(),
|
|
78912
79212
|
/** JWT ID — unique per issued code; consumed-set enforces single-use. */
|
|
78913
79213
|
jti: string().optional(),
|
|
78914
79214
|
/** PKCE S256 challenge — set only on `oauth-code` tokens issued to a public
|
|
@@ -81287,6 +81587,8 @@ var OauthSessionSummarySchema = object({
|
|
|
81287
81587
|
userId: string(),
|
|
81288
81588
|
username: string(),
|
|
81289
81589
|
integrationId: string(),
|
|
81590
|
+
/** The instance the link was made for; `null` = the default instance. */
|
|
81591
|
+
instanceId: string().nullable().optional(),
|
|
81290
81592
|
scopes: array(TokenScopeSchema),
|
|
81291
81593
|
createdAt: number$1(),
|
|
81292
81594
|
lastUsedAt: number$1(),
|
|
@@ -81386,6 +81688,9 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(_void(), ob
|
|
|
81386
81688
|
access: "view"
|
|
81387
81689
|
}), method(object({
|
|
81388
81690
|
integrationId: string(),
|
|
81691
|
+
/** The integration instance the link is for. Omit for the default
|
|
81692
|
+
* instance — never pass the addon id to mean it. */
|
|
81693
|
+
instanceId: string().optional(),
|
|
81389
81694
|
userId: string(),
|
|
81390
81695
|
username: string(),
|
|
81391
81696
|
scopes: array(TokenScopeSchema),
|
|
@@ -81424,7 +81729,13 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(_void(), ob
|
|
|
81424
81729
|
}), method(object({ token: string() }), object({
|
|
81425
81730
|
userId: string(),
|
|
81426
81731
|
username: string(),
|
|
81427
|
-
scopes: array(TokenScopeSchema)
|
|
81732
|
+
scopes: array(TokenScopeSchema),
|
|
81733
|
+
/** The instance the link was made for, read from the SESSION.
|
|
81734
|
+
* Absent = the default instance. `oauthLinkServesInstance` is the
|
|
81735
|
+
* helper a per-instance route calls to compare it with the instance
|
|
81736
|
+
* of its path; no route declares `perInstance` yet (the Alexa
|
|
81737
|
+
* per-instance route, T3, is the first consumer). */
|
|
81738
|
+
instanceId: string().optional()
|
|
81428
81739
|
}).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
|
|
81429
81740
|
userId: string(),
|
|
81430
81741
|
issuer: string()
|
|
@@ -103128,6 +103439,12 @@ Object.defineProperty(exports, "object", {
|
|
|
103128
103439
|
return object;
|
|
103129
103440
|
}
|
|
103130
103441
|
});
|
|
103442
|
+
Object.defineProperty(exports, "plainEventVocabulary", {
|
|
103443
|
+
enumerable: true,
|
|
103444
|
+
get: function() {
|
|
103445
|
+
return plainEventVocabulary;
|
|
103446
|
+
}
|
|
103447
|
+
});
|
|
103131
103448
|
Object.defineProperty(exports, "powerMeterCapability", {
|
|
103132
103449
|
enumerable: true,
|
|
103133
103450
|
get: function() {
|
|
@@ -6044,7 +6044,7 @@ var ZodIssueCode = {
|
|
|
6044
6044
|
var ZodFirstPartyTypeKind;
|
|
6045
6045
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6046
6046
|
//#endregion
|
|
6047
|
-
//#region ../types/dist/sleep-
|
|
6047
|
+
//#region ../types/dist/sleep-D0roI_CZ.mjs
|
|
6048
6048
|
/**
|
|
6049
6049
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6050
6050
|
* window to float samples (D455).
|
|
@@ -16242,6 +16242,10 @@ Object.freeze({
|
|
|
16242
16242
|
"path": "lastEvent.eventType",
|
|
16243
16243
|
"valueType": "string"
|
|
16244
16244
|
},
|
|
16245
|
+
{
|
|
16246
|
+
"path": "lastEvent.sourceId",
|
|
16247
|
+
"valueType": "string"
|
|
16248
|
+
},
|
|
16245
16249
|
{
|
|
16246
16250
|
"path": "lastEvent.timestamp",
|
|
16247
16251
|
"valueType": "number"
|
|
@@ -44800,9 +44804,12 @@ function convertLegacyWhen(half) {
|
|
|
44800
44804
|
* every caller — automations, Actions, and the notification centre, which runs
|
|
44801
44805
|
* only Actions (planning#473).
|
|
44802
44806
|
*/
|
|
44807
|
+
/** The longest one `wait` step lasts. It is cut by a restart of the run and does not survive a hub restart. */
|
|
44808
|
+
var WAIT_MAX_SECONDS = 3600;
|
|
44809
|
+
var WAIT_TOO_LONG = `a wait is at most one hour (${WAIT_MAX_SECONDS} s)`;
|
|
44803
44810
|
var AutomationWaitStepSchema = object({
|
|
44804
44811
|
kind: literal("wait"),
|
|
44805
|
-
seconds: number$1().min(0).max(
|
|
44812
|
+
seconds: number$1().min(0).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG)
|
|
44806
44813
|
});
|
|
44807
44814
|
/** The legacy `deviceId` of a cap step: still READ, never written (D983). */
|
|
44808
44815
|
var LegacyStepDeviceSchema = union([
|
|
@@ -44872,39 +44879,227 @@ var elseNeedsIf = {
|
|
|
44872
44879
|
path: ["else"]
|
|
44873
44880
|
};
|
|
44874
44881
|
var GuardedWaitStepSchema = AutomationWaitStepSchema.extend(stepGuardShape).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44875
|
-
var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44876
|
-
message: "a cap step needs a target",
|
|
44877
|
-
path: ["target"]
|
|
44878
|
-
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
44879
|
-
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44880
|
-
path: ["actionId"]
|
|
44881
|
-
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44882
44882
|
/**
|
|
44883
44883
|
* A step of a STANDALONE list (an action, a scheduler point, a preset): the
|
|
44884
44884
|
* same two step kinds an automation runs, minus a guard that reads the
|
|
44885
44885
|
* automation's trigger, which such a list does not have.
|
|
44886
44886
|
*/
|
|
44887
|
-
var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema,
|
|
44887
|
+
var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema, AutomationCapStepBaseSchema.extend(stepGuardShape).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44888
|
+
message: "a cap step needs a target",
|
|
44889
|
+
path: ["target"]
|
|
44890
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
44891
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44892
|
+
path: ["actionId"]
|
|
44893
|
+
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf)]).superRefine((step, ctx) => {
|
|
44888
44894
|
if (step.if !== void 0 && hasTriggeredByLeaves(step.if)) ctx.addIssue({
|
|
44889
44895
|
code: "custom",
|
|
44890
44896
|
message: TRIGGERED_BY_NEEDS_AUTOMATION,
|
|
44891
44897
|
path: ["if"]
|
|
44892
44898
|
});
|
|
44893
44899
|
});
|
|
44900
|
+
/**
|
|
44901
|
+
* Flow control of an AUTOMATION's list (#500). A standalone list (an action, a
|
|
44902
|
+
* scheduler point, a preset) stays `wait` and `cap`: it has no run of its own
|
|
44903
|
+
* to end and no variable bag to write.
|
|
44904
|
+
*/
|
|
44905
|
+
var continueOnErrorShape = {
|
|
44906
|
+
/** A failure of this step is traced `failed-continued` and the next step runs. */
|
|
44907
|
+
continueOnError: literal(true).optional() };
|
|
44908
|
+
/** An automation's cap step: the shared guarded cap step, plus `continueOnError`. */
|
|
44909
|
+
var AutomationGuardedCapStepSchema = AutomationCapStepBaseSchema.extend({
|
|
44910
|
+
...stepGuardShape,
|
|
44911
|
+
...continueOnErrorShape
|
|
44912
|
+
}).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44913
|
+
message: "a cap step needs a target",
|
|
44914
|
+
path: ["target"]
|
|
44915
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
44916
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44917
|
+
path: ["actionId"]
|
|
44918
|
+
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44919
|
+
/** End the run here, on purpose. `reason` may carry `{{vars.x}}` slots. */
|
|
44920
|
+
var AutomationStopStepSchema = object({
|
|
44921
|
+
kind: literal("stop"),
|
|
44922
|
+
reason: string().min(1, "a stop needs a reason: it is what the run trace shows").max(200),
|
|
44923
|
+
/** `ok`: the run ends as a success. `failed`: it ends as a failure, with the reason. */
|
|
44924
|
+
outcome: _enum(["ok", "failed"]),
|
|
44925
|
+
/** Stop only when this reads true; false or unknown does not stop. */
|
|
44926
|
+
if: AutomationWhenSchema.optional()
|
|
44927
|
+
});
|
|
44928
|
+
var SET_VAR_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]{0,39}$/;
|
|
44929
|
+
/** Names the run itself writes and reads (`leaf` is what `triggered-by` judges): a step may not overwrite them. */
|
|
44930
|
+
var RESERVED_RUN_VARS = [
|
|
44931
|
+
"kind",
|
|
44932
|
+
"leaf",
|
|
44933
|
+
"at"
|
|
44934
|
+
];
|
|
44935
|
+
/**
|
|
44936
|
+
* Write variables into the run's bag, for the steps after it. SUBSTITUTION
|
|
44937
|
+
* only, never evaluation: a text value may carry `{{vars.x}}` slots.
|
|
44938
|
+
*/
|
|
44939
|
+
var AutomationSetStepSchema = object({
|
|
44940
|
+
kind: literal("set"),
|
|
44941
|
+
vars: record(string(), union([
|
|
44942
|
+
string().max(500),
|
|
44943
|
+
number$1(),
|
|
44944
|
+
boolean()
|
|
44945
|
+
])).refine((vars) => Object.keys(vars).every((name) => SET_VAR_NAME_RE.test(name)), { message: "a variable name is letters, digits and _, not starting with a digit (max 40)" }).refine((vars) => Object.keys(vars).length >= 1, { message: "set needs at least one variable" }).refine((vars) => Object.keys(vars).length <= 20, { message: `set holds at most 20 variables` }).refine((vars) => Object.keys(vars).every((name) => !RESERVED_RUN_VARS.includes(name)), { message: `the names ${RESERVED_RUN_VARS.join(", ")} belong to the run and cannot be set` }),
|
|
44946
|
+
/** Set only when this reads true; false or unknown leaves the bag as it is. */
|
|
44947
|
+
if: AutomationWhenSchema.optional()
|
|
44948
|
+
});
|
|
44949
|
+
var AutomationRunActionStepSchema = object({
|
|
44950
|
+
kind: literal("action"),
|
|
44951
|
+
/** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
|
|
44952
|
+
actionId: string().min(1),
|
|
44953
|
+
/** Values for the action's declared variables; the others take their default. */
|
|
44954
|
+
variables: record(string(), union([
|
|
44955
|
+
string(),
|
|
44956
|
+
number$1(),
|
|
44957
|
+
boolean()
|
|
44958
|
+
])).optional(),
|
|
44959
|
+
...continueOnErrorShape
|
|
44960
|
+
});
|
|
44961
|
+
/**
|
|
44962
|
+
* A step INSIDE a branch of a `choose`: a flow step with no condition of its
|
|
44963
|
+
* own (the branch is the condition) and no block inside it. Strict, so an `if`
|
|
44964
|
+
* written on such a step is refused rather than dropped.
|
|
44965
|
+
*/
|
|
44966
|
+
/** The longest a `wait-until` may wait: six hours. */
|
|
44967
|
+
var WAIT_UNTIL_TIMEOUT_MAX_S = 21600;
|
|
44968
|
+
/**
|
|
44969
|
+
* Pause the run until a condition is true (#500). The timeout is mandatory: a
|
|
44970
|
+
* run never waits without an end. `onTimeout` says what a wait that ran out
|
|
44971
|
+
* does: `continue` goes on to the next step, `stop` ends the run as a failure.
|
|
44972
|
+
* A condition that cannot be read is not "true": the wait goes on (D49).
|
|
44973
|
+
*/
|
|
44974
|
+
var AutomationWaitUntilStepSchema = object({
|
|
44975
|
+
kind: literal("wait-until"),
|
|
44976
|
+
when: AutomationWhenSchema,
|
|
44977
|
+
timeoutS: number$1().int().min(1, "a wait needs a timeout of at least one second").max(WAIT_UNTIL_TIMEOUT_MAX_S, `a wait for a condition is at most six hours (${WAIT_UNTIL_TIMEOUT_MAX_S} s)`),
|
|
44978
|
+
onTimeout: _enum(["continue", "stop"])
|
|
44979
|
+
}).strict();
|
|
44980
|
+
/** The step kinds that hold steps of their own, or pause on a condition: they nest two levels at most. */
|
|
44981
|
+
var BLOCK_STEP_KINDS = [
|
|
44982
|
+
"choose",
|
|
44983
|
+
"repeat",
|
|
44984
|
+
"parallel",
|
|
44985
|
+
"wait-until"
|
|
44986
|
+
];
|
|
44987
|
+
var NEST_TOO_DEEP = `steps nest two levels at most: a step inside a nested choose or repeat can be a plain step only`;
|
|
44988
|
+
function kindOf(input) {
|
|
44989
|
+
return typeof input === "object" && input !== null ? Reflect.get(input, "kind") : void 0;
|
|
44990
|
+
}
|
|
44991
|
+
/** Where the nesting ends, a block step is refused in words rather than as an unknown kind. */
|
|
44992
|
+
function nestTooDeep(issue) {
|
|
44993
|
+
const kind = kindOf(issue.input);
|
|
44994
|
+
return typeof kind === "string" && BLOCK_STEP_KINDS.includes(kind) ? NEST_TOO_DEEP : void 0;
|
|
44995
|
+
}
|
|
44996
|
+
var plainStepSchemas = [
|
|
44997
|
+
AutomationWaitStepSchema.strict(),
|
|
44998
|
+
AutomationCapStepBaseSchema.extend(continueOnErrorShape).strict().refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
44999
|
+
message: "a cap step needs a target",
|
|
45000
|
+
path: ["target"]
|
|
45001
|
+
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
45002
|
+
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
45003
|
+
path: ["actionId"]
|
|
45004
|
+
}),
|
|
45005
|
+
AutomationStopStepSchema.omit({ if: true }).strict(),
|
|
45006
|
+
AutomationSetStepSchema.omit({ if: true }).strict(),
|
|
45007
|
+
AutomationRunActionStepSchema.strict()
|
|
45008
|
+
];
|
|
45009
|
+
/**
|
|
45010
|
+
* A plain step: a flow step with no condition of its own and no step inside
|
|
45011
|
+
* it. The second (last) level of nesting holds these only.
|
|
45012
|
+
*/
|
|
45013
|
+
var AutomationBranchStepSchema = discriminatedUnion("kind", plainStepSchemas, { error: nestTooDeep });
|
|
45014
|
+
/** A step that can run beside others: it writes no variable and does not end the run. */
|
|
45015
|
+
var AutomationParallelMemberSchema = AutomationBranchStepSchema.refine((step) => step.kind === "cap" || step.kind === "action" || step.kind === "wait", "a parallel holds device commands, actions and waits only: a set or a stop beside other steps has no order");
|
|
45016
|
+
/**
|
|
45017
|
+
* Several steps at once (#500): all are started together and all are awaited.
|
|
45018
|
+
* A failure fails the run once the others finished, as in a sequence; a member
|
|
45019
|
+
* marked "continue if this fails" does not.
|
|
45020
|
+
*/
|
|
45021
|
+
var AutomationParallelStepSchema = object({
|
|
45022
|
+
kind: literal("parallel"),
|
|
45023
|
+
steps: array(AutomationParallelMemberSchema).min(2, "a parallel needs at least two steps").max(5, `a parallel takes at most 5 steps`)
|
|
45024
|
+
}).strict();
|
|
45025
|
+
var REPEAT_NEEDS_MAX = "a repeat on a condition needs a maximum number of iterations";
|
|
45026
|
+
/** A loop on a condition: the bound is mandatory, so a run never loops without an end. */
|
|
45027
|
+
var repeatConditionShape = {
|
|
45028
|
+
when: AutomationWhenSchema,
|
|
45029
|
+
maxIterations: number$1({ error: REPEAT_NEEDS_MAX }).int().min(1, REPEAT_NEEDS_MAX).max(50, `a repeat on a condition runs at most 50 times`),
|
|
45030
|
+
/** A pause between two iterations, never after the last. */
|
|
45031
|
+
waitS: number$1().int().min(1).max(WAIT_MAX_SECONDS, WAIT_TOO_LONG).optional()
|
|
45032
|
+
};
|
|
45033
|
+
/** What decides how many times a `repeat` runs. */
|
|
45034
|
+
var AutomationRepeatLoopSchema = discriminatedUnion("by", [
|
|
45035
|
+
object({
|
|
45036
|
+
by: literal("count"),
|
|
45037
|
+
count: number$1().int().min(1).max(20, `a repeat runs at most 20 times`)
|
|
45038
|
+
}).strict(),
|
|
45039
|
+
object({
|
|
45040
|
+
by: literal("while"),
|
|
45041
|
+
...repeatConditionShape
|
|
45042
|
+
}).strict(),
|
|
45043
|
+
object({
|
|
45044
|
+
by: literal("until"),
|
|
45045
|
+
...repeatConditionShape
|
|
45046
|
+
}).strict(),
|
|
45047
|
+
object({
|
|
45048
|
+
by: literal("forEach"),
|
|
45049
|
+
target: object({
|
|
45050
|
+
kind: literal("devices"),
|
|
45051
|
+
ids: array(number$1().int()).min(1, "a repeat over devices needs at least one device").max(50, `a repeat over devices takes at most 50 devices`)
|
|
45052
|
+
}).strict()
|
|
45053
|
+
}).strict()
|
|
45054
|
+
]);
|
|
45055
|
+
/**
|
|
45056
|
+
* The same steps several times (#500). Every form is bounded at save, so a
|
|
45057
|
+
* run cannot loop without an end. A failure or a `stop` in the steps ends the
|
|
45058
|
+
* loop and the run, as in a sequence.
|
|
45059
|
+
*/
|
|
45060
|
+
function repeatSchemaOf(step) {
|
|
45061
|
+
return object({
|
|
45062
|
+
kind: literal("repeat"),
|
|
45063
|
+
loop: AutomationRepeatLoopSchema,
|
|
45064
|
+
steps: array(step).min(1, "a repeat needs at least one step").max(10, `a repeat takes at most 10 steps`)
|
|
45065
|
+
}).strict();
|
|
45066
|
+
}
|
|
45067
|
+
/**
|
|
45068
|
+
* One step, several ways (#500): the branches are read in order and the FIRST
|
|
45069
|
+
* whose condition is true runs; `else` runs when every branch is false. A
|
|
45070
|
+
* branch that cannot be read ends the choice: nothing runs, not the branches
|
|
45071
|
+
* after it and not the else (D49). The #472 `if` / `else` of a wait or cap
|
|
45072
|
+
* step is the one-branch case and stays as it is stored.
|
|
45073
|
+
*/
|
|
45074
|
+
function chooseSchemaOf(step) {
|
|
45075
|
+
const steps = array(step).max(10);
|
|
45076
|
+
return object({
|
|
45077
|
+
kind: literal("choose"),
|
|
45078
|
+
branches: array(object({
|
|
45079
|
+
if: AutomationWhenSchema,
|
|
45080
|
+
steps: steps.min(1, "a branch needs at least one step")
|
|
45081
|
+
})).min(1, "a choose needs at least one branch").max(6, `a choose takes at most 6 branches`),
|
|
45082
|
+
else: steps.optional()
|
|
45083
|
+
});
|
|
45084
|
+
}
|
|
45085
|
+
var AutomationBodyStepSchema = discriminatedUnion("kind", [
|
|
45086
|
+
...plainStepSchemas,
|
|
45087
|
+
AutomationWaitUntilStepSchema,
|
|
45088
|
+
AutomationParallelStepSchema,
|
|
45089
|
+
chooseSchemaOf(AutomationBranchStepSchema),
|
|
45090
|
+
repeatSchemaOf(AutomationBranchStepSchema)
|
|
45091
|
+
]);
|
|
45092
|
+
var AutomationRepeatStepSchema = repeatSchemaOf(AutomationBodyStepSchema);
|
|
44894
45093
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
44895
45094
|
GuardedWaitStepSchema,
|
|
44896
|
-
|
|
44897
|
-
|
|
44898
|
-
|
|
44899
|
-
|
|
44900
|
-
|
|
44901
|
-
|
|
44902
|
-
|
|
44903
|
-
|
|
44904
|
-
number$1(),
|
|
44905
|
-
boolean()
|
|
44906
|
-
])).optional()
|
|
44907
|
-
}),
|
|
45095
|
+
AutomationGuardedCapStepSchema,
|
|
45096
|
+
AutomationStopStepSchema,
|
|
45097
|
+
AutomationSetStepSchema,
|
|
45098
|
+
chooseSchemaOf(AutomationBodyStepSchema),
|
|
45099
|
+
AutomationWaitUntilStepSchema,
|
|
45100
|
+
AutomationParallelStepSchema,
|
|
45101
|
+
AutomationRepeatStepSchema,
|
|
45102
|
+
AutomationRunActionStepSchema,
|
|
44908
45103
|
object({
|
|
44909
45104
|
kind: literal("code"),
|
|
44910
45105
|
/** Compiled into the automation's OWN block by esbuild — not a third
|
|
@@ -44967,11 +45162,6 @@ function convertLegacyRecipe(legacy) {
|
|
|
44967
45162
|
...rest
|
|
44968
45163
|
};
|
|
44969
45164
|
}
|
|
44970
|
-
/**
|
|
44971
|
-
* Where recipes are PARSED (the core-blocks cap, the MCP tool, the literal a
|
|
44972
|
-
* saved block carries): the new shape as it is, or the old shape converted to
|
|
44973
|
-
* it. The output type is always the new one.
|
|
44974
|
-
*/
|
|
44975
45165
|
var AutomationRecipeSchema = union([CurrentAutomationRecipeSchema, LegacyAutomationRecipeSchema.transform(convertLegacyRecipe)]);
|
|
44976
45166
|
var DETECTION_DESCRIPTIONS = {
|
|
44977
45167
|
deviceId: "the camera that saw it",
|
|
@@ -45056,12 +45246,16 @@ var HoldOverrideSchema = discriminatedUnion("mode", [object({ mode: literal("res
|
|
|
45056
45246
|
})]);
|
|
45057
45247
|
/** A missed edge up to this late still runs. */
|
|
45058
45248
|
var DEFAULT_MAX_LATE_MS = 10 * 6e4;
|
|
45249
|
+
var SchedulerStepSchema = ActionStepSchema.refine((step) => step.kind !== "wait" || step.seconds <= 300, {
|
|
45250
|
+
message: `a scheduler point waits at most five minutes (300 s); put a longer wait in an action`,
|
|
45251
|
+
path: ["seconds"]
|
|
45252
|
+
});
|
|
45059
45253
|
var SchedulerPointSchema = object({
|
|
45060
45254
|
id: string().min(1).max(64),
|
|
45061
45255
|
at: SchedulerTimeSpecSchema,
|
|
45062
45256
|
mode: SchedulerPointModeSchema,
|
|
45063
45257
|
/** The actions of an `edge` or `hold`; a `release` has none. */
|
|
45064
|
-
steps: array(
|
|
45258
|
+
steps: array(SchedulerStepSchema).max(20).default([]),
|
|
45065
45259
|
/** Checked when the point runs (an edge) or is applied (a hold). */
|
|
45066
45260
|
conditions: SchedulerStateTreeSchema.optional(),
|
|
45067
45261
|
/** Hold only; absent means `respect`. */
|
|
@@ -45329,18 +45523,46 @@ var StepTraceBaseSchema = object({
|
|
|
45329
45523
|
]).optional(),
|
|
45330
45524
|
/** Why the condition read what it read, in the evaluator's own words. */
|
|
45331
45525
|
conditionReason: string().optional(),
|
|
45332
|
-
/** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. */
|
|
45526
|
+
/** `empty`: the target resolved to no device, so nothing was done — never silently `ok`. `skipped`: its `if` was false (or unknown) and nothing ran in its place. `failed-continued`: it failed and was marked to be passed over (#500). */
|
|
45333
45527
|
outcome: _enum([
|
|
45334
45528
|
"ok",
|
|
45335
45529
|
"error",
|
|
45336
45530
|
"not-run",
|
|
45337
45531
|
"empty",
|
|
45338
|
-
"skipped"
|
|
45532
|
+
"skipped",
|
|
45533
|
+
"failed-continued",
|
|
45534
|
+
"timed-out"
|
|
45339
45535
|
]),
|
|
45340
45536
|
message: string().optional()
|
|
45341
45537
|
});
|
|
45538
|
+
/** What a block step adds to its row: which list ran, what each branch read, how many rounds. */
|
|
45539
|
+
var blockTraceShape = {
|
|
45540
|
+
/** A `choose` step (#500): the list that ran, `branches.<n>` or `else`. Absent when none did. */
|
|
45541
|
+
branch: string().optional(),
|
|
45542
|
+
/** A `choose` step: what each branch read, in order, up to the one that decided. */
|
|
45543
|
+
branchChecks: array(object({
|
|
45544
|
+
condition: _enum([
|
|
45545
|
+
"true",
|
|
45546
|
+
"false",
|
|
45547
|
+
"unknown"
|
|
45548
|
+
]),
|
|
45549
|
+
conditionReason: string().optional()
|
|
45550
|
+
})).optional(),
|
|
45551
|
+
/** A `repeat` step (#500): how many times its steps ran. */
|
|
45552
|
+
iterations: number$1().int().optional()
|
|
45553
|
+
};
|
|
45554
|
+
/** A step one level down: it may be a block step itself, whose own steps are plain rows (the nesting ends there). */
|
|
45555
|
+
var NestedStepTraceSchema = StepTraceBaseSchema.extend({
|
|
45556
|
+
...blockTraceShape,
|
|
45557
|
+
steps: array(StepTraceBaseSchema).optional()
|
|
45558
|
+
});
|
|
45342
45559
|
/** A step trace; the `else` steps that ran are one level of the same shape (the nesting is bounded at one). */
|
|
45343
|
-
var AutomationStepTraceSchema = StepTraceBaseSchema.extend({
|
|
45560
|
+
var AutomationStepTraceSchema = StepTraceBaseSchema.extend({
|
|
45561
|
+
else: array(StepTraceBaseSchema).optional(),
|
|
45562
|
+
...blockTraceShape,
|
|
45563
|
+
/** A `choose` step: the steps of the list that ran. A `parallel`: its members. A `repeat`: the LAST iteration. */
|
|
45564
|
+
steps: array(NestedStepTraceSchema).optional()
|
|
45565
|
+
});
|
|
45344
45566
|
var AutomationRunTraceSchema = object({
|
|
45345
45567
|
runId: string().min(1),
|
|
45346
45568
|
startedAt: number$1(),
|
|
@@ -45747,7 +45969,9 @@ var AddonHttpRouteSchema = object({
|
|
|
45747
45969
|
]).optional(),
|
|
45748
45970
|
description: string().optional(),
|
|
45749
45971
|
/** The hub limits this route per client address before the handler runs. */
|
|
45750
|
-
rateLimit: _enum(["auth"]).optional()
|
|
45972
|
+
rateLimit: _enum(["auth"]).optional(),
|
|
45973
|
+
/** Served once per integration instance; the handler reads `instanceId`. */
|
|
45974
|
+
perInstance: boolean().optional()
|
|
45751
45975
|
});
|
|
45752
45976
|
/**
|
|
45753
45977
|
* Cross-process route invocation envelope. The hub captures the
|
|
@@ -45764,6 +45988,8 @@ var InvokeRequestSchema = object({
|
|
|
45764
45988
|
query: record(string(), string()),
|
|
45765
45989
|
body: unknown(),
|
|
45766
45990
|
headers: record(string(), string()),
|
|
45991
|
+
/** The instance the hub resolved for a `perInstance` route. */
|
|
45992
|
+
instanceId: string().optional(),
|
|
45767
45993
|
user: object({
|
|
45768
45994
|
id: string(),
|
|
45769
45995
|
username: string(),
|
|
@@ -56435,25 +56661,81 @@ var enumSensorCapability = {
|
|
|
56435
56661
|
* whether persisting is worth a SQLite commit. */
|
|
56436
56662
|
volatileStateFields: ["lastFetchedAt", "timestamp"]
|
|
56437
56663
|
};
|
|
56664
|
+
var EventVocabularyKindSchema = _enum([
|
|
56665
|
+
"press",
|
|
56666
|
+
"long-press",
|
|
56667
|
+
"long-press-start",
|
|
56668
|
+
"release",
|
|
56669
|
+
"repeat",
|
|
56670
|
+
"double-press",
|
|
56671
|
+
"other"
|
|
56672
|
+
]);
|
|
56673
|
+
/** The part of the device an event comes from: a button, a channel. */
|
|
56674
|
+
var EventVocabularySourceSchema = object({
|
|
56675
|
+
id: string().min(1),
|
|
56676
|
+
label: string().min(1)
|
|
56677
|
+
});
|
|
56678
|
+
/** One scalar field of an event's `data`, by dotted path. */
|
|
56679
|
+
var EventVocabularyFieldSchema = object({
|
|
56680
|
+
path: string().min(1),
|
|
56681
|
+
kind: _enum([
|
|
56682
|
+
"string",
|
|
56683
|
+
"number",
|
|
56684
|
+
"boolean",
|
|
56685
|
+
"enum"
|
|
56686
|
+
]),
|
|
56687
|
+
enumValues: array(string()).optional(),
|
|
56688
|
+
label: string().min(1).optional()
|
|
56689
|
+
});
|
|
56690
|
+
var EventVocabularyEntrySchema = object({
|
|
56691
|
+
/** The native token, verbatim. */
|
|
56692
|
+
id: string().min(1),
|
|
56693
|
+
source: EventVocabularySourceSchema.optional(),
|
|
56694
|
+
label: string().min(1),
|
|
56695
|
+
description: string().optional(),
|
|
56696
|
+
kind: EventVocabularyKindSchema.optional(),
|
|
56697
|
+
payload: array(EventVocabularyFieldSchema).optional()
|
|
56698
|
+
});
|
|
56699
|
+
/**
|
|
56700
|
+
* The vocabulary of a source that declares tokens and nothing else: one
|
|
56701
|
+
* entry per token, labelled with the token itself.
|
|
56702
|
+
*/
|
|
56703
|
+
function plainEventVocabulary(eventTypes) {
|
|
56704
|
+
return [...new Set(eventTypes)].filter((eventType) => eventType !== "").map((eventType) => ({
|
|
56705
|
+
id: eventType,
|
|
56706
|
+
label: eventType
|
|
56707
|
+
}));
|
|
56708
|
+
}
|
|
56438
56709
|
/**
|
|
56439
56710
|
* Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
|
|
56440
56711
|
* device. Carries the device's EXACT declared event vocabulary verbatim
|
|
56441
56712
|
* (NO normalization). Two shapes:
|
|
56442
|
-
* - structured source (HA `event.*` entity) → `
|
|
56443
|
-
* declared
|
|
56444
|
-
* - generic/legacy source (HA bus events, e.g. zha_event) → `
|
|
56713
|
+
* - structured source (HA `event.*` entity) → `vocabulary` is the fixed
|
|
56714
|
+
* declared set (e.g. press_short, press_long, …).
|
|
56715
|
+
* - generic/legacy source (HA bus events, e.g. zha_event) → `vocabulary`
|
|
56445
56716
|
* is [] (open) and `lastEvent.data` carries the complex payload.
|
|
56717
|
+
* `vocabulary` (D1044) names each event for a person and types it for a
|
|
56718
|
+
* rule; `eventTypes` is its list of native tokens, kept for older readers.
|
|
56719
|
+
* A fire names the part of the device it came from in `sourceId` when the
|
|
56720
|
+
* vocabulary declares sources (a remote's buttons).
|
|
56446
56721
|
* `seq` is monotonic so two identical events still produce distinct slice writes.
|
|
56447
56722
|
*/
|
|
56448
56723
|
var EventFireSchema = object({
|
|
56449
56724
|
deviceId: number$1(),
|
|
56450
56725
|
eventType: string(),
|
|
56726
|
+
sourceId: string().optional(),
|
|
56451
56727
|
data: record(string(), unknown()).nullable(),
|
|
56452
56728
|
timestamp: number$1().meta(readingMeta("none")),
|
|
56453
56729
|
seq: number$1().meta(readingMeta("count"))
|
|
56454
56730
|
});
|
|
56455
56731
|
var EventEmitterStatusSchema = object({
|
|
56456
56732
|
eventTypes: array(string()),
|
|
56733
|
+
/**
|
|
56734
|
+
* Required of a provider by the type. A status written before the field
|
|
56735
|
+
* existed still parses, as an empty vocabulary: read it through
|
|
56736
|
+
* `readEventVocabulary`, which then answers with the plain tokens.
|
|
56737
|
+
*/
|
|
56738
|
+
vocabulary: array(EventVocabularyEntrySchema).default([]),
|
|
56457
56739
|
lastEvent: EventFireSchema.nullable(),
|
|
56458
56740
|
eventCountSinceStart: number$1().meta(readingMeta("count"))
|
|
56459
56741
|
});
|
|
@@ -71972,7 +72254,18 @@ var OauthIntegrationDescriptorSchema = object({
|
|
|
71972
72254
|
* The value is baked into the authorization code at `/authorize` and travels
|
|
71973
72255
|
* on the tokens, so editing this field changes FUTURE links only.
|
|
71974
72256
|
*/
|
|
71975
|
-
refreshTokenTtlSec: union([number$1().int().positive(), literal("never")]).optional()
|
|
72257
|
+
refreshTokenTtlSec: union([number$1().int().positive(), literal("never")]).optional(),
|
|
72258
|
+
/**
|
|
72259
|
+
* The integration instances an account can be linked to (planning#415),
|
|
72260
|
+
* beside the default one. `/api/oauth2/authorize?instance=<id>` is accepted
|
|
72261
|
+
* only for an id listed here; with no `instance=` the link is made to the
|
|
72262
|
+
* default instance, which is never listed and always accepted — it is the
|
|
72263
|
+
* address third parties already hold. Omit for a single-instance integration.
|
|
72264
|
+
*/
|
|
72265
|
+
instances: array(object({
|
|
72266
|
+
id: string(),
|
|
72267
|
+
displayName: string()
|
|
72268
|
+
})).optional()
|
|
71976
72269
|
});
|
|
71977
72270
|
method(_void(), OauthIntegrationDescriptorSchema, { auth: "admin" });
|
|
71978
72271
|
/**
|
|
@@ -78909,6 +79202,13 @@ var SsoBridgeClaimsSchema = object({
|
|
|
78909
79202
|
/** OAuth authorization-code binding — set only on `oauth-code` tokens. */
|
|
78910
79203
|
redirectUri: string().optional(),
|
|
78911
79204
|
integrationId: string().optional(),
|
|
79205
|
+
/**
|
|
79206
|
+
* The integration INSTANCE an OAuth link was made for (planning#415). Set on
|
|
79207
|
+
* `oauth-code`, `oauth-access` and `oauth-refresh` tokens of a link made
|
|
79208
|
+
* with `instance=`; absent on a link to the default instance. A cloud relay
|
|
79209
|
+
* reads it off the access token to route; the hub answers from the session.
|
|
79210
|
+
*/
|
|
79211
|
+
instanceId: string().optional(),
|
|
78912
79212
|
/** JWT ID — unique per issued code; consumed-set enforces single-use. */
|
|
78913
79213
|
jti: string().optional(),
|
|
78914
79214
|
/** PKCE S256 challenge — set only on `oauth-code` tokens issued to a public
|
|
@@ -81287,6 +81587,8 @@ var OauthSessionSummarySchema = object({
|
|
|
81287
81587
|
userId: string(),
|
|
81288
81588
|
username: string(),
|
|
81289
81589
|
integrationId: string(),
|
|
81590
|
+
/** The instance the link was made for; `null` = the default instance. */
|
|
81591
|
+
instanceId: string().nullable().optional(),
|
|
81290
81592
|
scopes: array(TokenScopeSchema),
|
|
81291
81593
|
createdAt: number$1(),
|
|
81292
81594
|
lastUsedAt: number$1(),
|
|
@@ -81386,6 +81688,9 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(_void(), ob
|
|
|
81386
81688
|
access: "view"
|
|
81387
81689
|
}), method(object({
|
|
81388
81690
|
integrationId: string(),
|
|
81691
|
+
/** The integration instance the link is for. Omit for the default
|
|
81692
|
+
* instance — never pass the addon id to mean it. */
|
|
81693
|
+
instanceId: string().optional(),
|
|
81389
81694
|
userId: string(),
|
|
81390
81695
|
username: string(),
|
|
81391
81696
|
scopes: array(TokenScopeSchema),
|
|
@@ -81424,7 +81729,13 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(_void(), ob
|
|
|
81424
81729
|
}), method(object({ token: string() }), object({
|
|
81425
81730
|
userId: string(),
|
|
81426
81731
|
username: string(),
|
|
81427
|
-
scopes: array(TokenScopeSchema)
|
|
81732
|
+
scopes: array(TokenScopeSchema),
|
|
81733
|
+
/** The instance the link was made for, read from the SESSION.
|
|
81734
|
+
* Absent = the default instance. `oauthLinkServesInstance` is the
|
|
81735
|
+
* helper a per-instance route calls to compare it with the instance
|
|
81736
|
+
* of its path; no route declares `perInstance` yet (the Alexa
|
|
81737
|
+
* per-instance route, T3, is the first consumer). */
|
|
81738
|
+
instanceId: string().optional()
|
|
81428
81739
|
}).nullable(), { access: "view" }), method(object({ userId: string() }), array(ExternalIdentitySchema), { auth: "admin" }), method(ExternalIdentityKeySchema, object({
|
|
81429
81740
|
userId: string(),
|
|
81430
81741
|
issuer: string()
|
|
@@ -102888,4 +103199,4 @@ function keepBodyKeys(provider, keys) {
|
|
|
102888
103199
|
};
|
|
102889
103200
|
}
|
|
102890
103201
|
//#endregion
|
|
102891
|
-
export {
|
|
103202
|
+
export { DeviceType as $, temperatureSensorCapability as A, rowsDepsOver as B, plainEventVocabulary as C, runningFromDishwasherOperation as D, registerPowerSwitch as E, defineCustomActions as F, literal as G, _null as H, defineEntryKind as I, record as J, number$1 as K, entryBody as L, RecordIntegrationInstances as M, createEvent as N, runningStateCapability as O, customAction as P, DeviceRole as Q, isSecretMarker as R, numericSensorCapability as S, quantityFromUnit as T, array as U, _enum as V, boolean as W, union as X, string as Y, unknown as Z, heatPumpControlCapability as _, BaseDevice as a, ingestReading as b, RUNNING_STATE_COLD as c, climateControlCapability as d, errMsg as et, consumablesCapability as f, eventEmitterCapability as g, enumSensorCapability as h, testBoschInstance as i, waterHeaterCapability as j, switchCapability as k, batteryCapability as l, dishwasherCapability as m, boschRowsPorts as n, BaseDeviceProvider as o, deviceAdoptionCapability as p, object as q, keepBodyKeys as r, DishwasherOperationStateSchema as s, boschRowsMigration as t, EventCategory as tt, binaryCapability as u, heatPumpStatusCapability as v, powerMeterCapability as w, integrationInstancesCapability as x, heatingValveCapability as y, isSecretMarkerLike as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_bosch_instances = require("../bosch-instances-
|
|
3
|
-
const require_account_integration_offline = require("../account-integration-offline-
|
|
2
|
+
const require_bosch_instances = require("../bosch-instances-dqTG9no9.js");
|
|
3
|
+
const require_account_integration_offline = require("../account-integration-offline-C-KJYRdX.js");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
let node_tls = require("node:tls");
|
|
6
6
|
let node_zlib = require("node:zlib");
|
|
@@ -4841,6 +4841,7 @@ var HomeConnectEventDevice = class extends require_bosch_instances.BaseDevice {
|
|
|
4841
4841
|
publish(eventTypes, previous, lastEvent) {
|
|
4842
4842
|
this.runtimeState.setCapState(EVENT_CAP, {
|
|
4843
4843
|
eventTypes: [...eventTypes],
|
|
4844
|
+
vocabulary: require_bosch_instances.plainEventVocabulary(eventTypes),
|
|
4844
4845
|
lastEvent: lastEvent ?? previous?.lastEvent ?? null,
|
|
4845
4846
|
eventCountSinceStart: (previous?.eventCountSinceStart ?? 0) + (lastEvent !== void 0 ? 1 : 0)
|
|
4846
4847
|
});
|
|
@@ -4895,7 +4896,8 @@ var HomeConnectEventDevice = class extends require_bosch_instances.BaseDevice {
|
|
|
4895
4896
|
}
|
|
4896
4897
|
registerCap() {
|
|
4897
4898
|
this.ctx.registerNativeCap(require_bosch_instances.eventEmitterCapability, { getStatus: async () => this.runtimeState.getCapState(EVENT_CAP) ?? {
|
|
4898
|
-
eventTypes: [],
|
|
4899
|
+
eventTypes: [...this.eventTypes()],
|
|
4900
|
+
vocabulary: require_bosch_instances.plainEventVocabulary(this.eventTypes()),
|
|
4899
4901
|
lastEvent: null,
|
|
4900
4902
|
eventCountSinceStart: 0
|
|
4901
4903
|
} });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as loginFailureForAttempt, c as HOME_CONNECT_REDIRECT_URI, i as createSignInAttemptStore, n as cascadeRemoveDevicesForIntegration, o as parseOAuthCallback, r as buildSignInGuideFields, t as setIntegrationDevicesOnline } from "../account-integration-offline-
|
|
1
|
+
import { $ as DeviceType, B as rowsDepsOver, C as plainEventVocabulary, D as runningFromDishwasherOperation, F as defineCustomActions, G as literal, I as defineEntryKind, J as record, L as entryBody, M as RecordIntegrationInstances, N as createEvent, O as runningStateCapability, P as customAction, Q as DeviceRole, R as isSecretMarker, S as numericSensorCapability, T as quantityFromUnit, U as array, V as _enum, X as union, Y as string, Z as unknown, a as BaseDevice, b as ingestReading, c as RUNNING_STATE_COLD, et as errMsg, f as consumablesCapability, g as eventEmitterCapability, h as enumSensorCapability, i as testBoschInstance, m as dishwasherCapability, n as boschRowsPorts, o as BaseDeviceProvider, p as deviceAdoptionCapability, q as object, r as keepBodyKeys, s as DishwasherOperationStateSchema, t as boschRowsMigration, tt as EventCategory, u as binaryCapability, w as powerMeterCapability, x as integrationInstancesCapability, z as isSecretMarkerLike } from "../bosch-instances-y_A00js_.mjs";
|
|
2
|
+
import { a as loginFailureForAttempt, c as HOME_CONNECT_REDIRECT_URI, i as createSignInAttemptStore, n as cascadeRemoveDevicesForIntegration, o as parseOAuthCallback, r as buildSignInGuideFields, t as setIntegrationDevicesOnline } from "../account-integration-offline-KQcJ_VVK.mjs";
|
|
3
3
|
import { createHash, randomBytes } from "node:crypto";
|
|
4
4
|
import { connect } from "node:tls";
|
|
5
5
|
import { inflateRawSync } from "node:zlib";
|
|
@@ -4840,6 +4840,7 @@ var HomeConnectEventDevice = class extends BaseDevice {
|
|
|
4840
4840
|
publish(eventTypes, previous, lastEvent) {
|
|
4841
4841
|
this.runtimeState.setCapState(EVENT_CAP, {
|
|
4842
4842
|
eventTypes: [...eventTypes],
|
|
4843
|
+
vocabulary: plainEventVocabulary(eventTypes),
|
|
4843
4844
|
lastEvent: lastEvent ?? previous?.lastEvent ?? null,
|
|
4844
4845
|
eventCountSinceStart: (previous?.eventCountSinceStart ?? 0) + (lastEvent !== void 0 ? 1 : 0)
|
|
4845
4846
|
});
|
|
@@ -4894,7 +4895,8 @@ var HomeConnectEventDevice = class extends BaseDevice {
|
|
|
4894
4895
|
}
|
|
4895
4896
|
registerCap() {
|
|
4896
4897
|
this.ctx.registerNativeCap(eventEmitterCapability, { getStatus: async () => this.runtimeState.getCapState(EVENT_CAP) ?? {
|
|
4897
|
-
eventTypes: [],
|
|
4898
|
+
eventTypes: [...this.eventTypes()],
|
|
4899
|
+
vocabulary: plainEventVocabulary(this.eventTypes()),
|
|
4898
4900
|
lastEvent: null,
|
|
4899
4901
|
eventCountSinceStart: 0
|
|
4900
4902
|
} });
|
package/dist/homecom/addon.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_bosch_instances = require("../bosch-instances-
|
|
3
|
-
const require_account_integration_offline = require("../account-integration-offline-
|
|
2
|
+
const require_bosch_instances = require("../bosch-instances-dqTG9no9.js");
|
|
3
|
+
const require_account_integration_offline = require("../account-integration-offline-C-KJYRdX.js");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
let node_child_process = require("node:child_process");
|
|
6
6
|
let node_fs = require("node:fs");
|
package/dist/homecom/addon.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { a as loginFailureForAttempt, i as createSignInAttemptStore, n as cascadeRemoveDevicesForIntegration, o as parseOAuthCallback, r as buildSignInGuideFields, s as HOMECOM_REDIRECT_URI, t as setIntegrationDevicesOnline } from "../account-integration-offline-
|
|
1
|
+
import { $ as DeviceType, B as rowsDepsOver, E as registerPowerSwitch, F as defineCustomActions, G as literal, H as _null, I as defineEntryKind, J as record, K as number, L as entryBody, M as RecordIntegrationInstances, P as customAction, Q as DeviceRole, U as array, V as _enum, W as boolean, X as union, Y as string, _ as heatPumpControlCapability, a as BaseDevice, d as climateControlCapability, et as errMsg, i as testBoschInstance, j as waterHeaterCapability, n as boschRowsPorts, o as BaseDeviceProvider, p as deviceAdoptionCapability, q as object, r as keepBodyKeys, t as boschRowsMigration, tt as EventCategory, v as heatPumpStatusCapability, x as integrationInstancesCapability } from "../bosch-instances-y_A00js_.mjs";
|
|
2
|
+
import { a as loginFailureForAttempt, i as createSignInAttemptStore, n as cascadeRemoveDevicesForIntegration, o as parseOAuthCallback, r as buildSignInGuideFields, s as HOMECOM_REDIRECT_URI, t as setIntegrationDevicesOnline } from "../account-integration-offline-KQcJ_VVK.mjs";
|
|
3
3
|
import { createHash, randomBytes } from "node:crypto";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { existsSync } from "node:fs";
|
package/dist/shc/addon.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
4
|
//#endregion
|
|
5
|
-
const require_bosch_instances = require("../bosch-instances-
|
|
5
|
+
const require_bosch_instances = require("../bosch-instances-dqTG9no9.js");
|
|
6
6
|
let node_crypto = require("node:crypto");
|
|
7
7
|
let node_https = require("node:https");
|
|
8
8
|
let node_child_process = require("node:child_process");
|
package/dist/shc/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as DeviceType, A as temperatureSensorCapability, B as rowsDepsOver, E as registerPowerSwitch, F as defineCustomActions, G as literal, I as defineEntryKind, K as number, L as entryBody, M as RecordIntegrationInstances, P as customAction, Q as DeviceRole, U as array, V as _enum, Y as string, a as BaseDevice, d as climateControlCapability, et as errMsg, i as testBoschInstance, k as switchCapability, l as batteryCapability, n as boschRowsPorts, o as BaseDeviceProvider, p as deviceAdoptionCapability, q as object, r as keepBodyKeys, t as boschRowsMigration, tt as EventCategory, x as integrationInstancesCapability, y as heatingValveCapability } from "../bosch-instances-y_A00js_.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { request } from "node:https";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-bosch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"description": "Bosch smart-home device-provider addons for CamStack — SHC, Home Connect, and HomeCom cloud integrations (scaffold)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
}
|
|
142
142
|
],
|
|
143
143
|
"requires": {
|
|
144
|
-
"server": ">=1.2.
|
|
144
|
+
"server": ">=1.2.842"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
"files": [
|