@camstack/types 1.2.537 → 1.2.538
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 +8 -0
- package/dist/addon.d.ts +2 -2
- package/dist/addon.js +3 -1
- package/dist/addon.mjs +2 -2
- package/dist/audit/command-origin-claim.d.ts +79 -0
- package/dist/audit/device-transition.d.ts +2 -2
- package/dist/automation/action.d.ts +4 -0
- package/dist/automation/index.d.ts +0 -1
- package/dist/automation/recipe.d.ts +9 -18
- package/dist/capabilities/action-source.cap.d.ts +1 -0
- package/dist/capabilities/actions.cap.d.ts +7 -0
- package/dist/capabilities/index.d.ts +1 -1
- package/dist/capabilities/notification-rules.cap.d.ts +79 -1897
- package/dist/client.js +27 -977
- package/dist/client.mjs +27 -977
- package/dist/generated/addon-api.d.ts +0 -35
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +56 -206
- package/dist/index.mjs +52 -198
- package/dist/notification/alarm-membership.d.ts +12 -11
- package/dist/{sleep-DIg2Mx82.js → sleep-DgCXXFc3.js} +64 -9
- package/dist/{sleep-B36hHDDz.mjs → sleep-VrfKAAGN.mjs} +53 -10
- package/package.json +1 -1
- package/dist/automation/nc-action-target.d.ts +0 -21
|
@@ -6385,41 +6385,6 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
6385
6385
|
output: z.infer<typeof notificationRulesCapability.methods.setRuleEnabled.output>;
|
|
6386
6386
|
meta: object;
|
|
6387
6387
|
}>;
|
|
6388
|
-
listSequences: TRPCQueryProcedure<{
|
|
6389
|
-
input: {
|
|
6390
|
-
[x: string]: unknown;
|
|
6391
|
-
} & z.input<typeof notificationRulesCapability.methods.listSequences.input>;
|
|
6392
|
-
output: z.infer<typeof notificationRulesCapability.methods.listSequences.output>;
|
|
6393
|
-
meta: object;
|
|
6394
|
-
}>;
|
|
6395
|
-
getSequence: TRPCQueryProcedure<{
|
|
6396
|
-
input: {
|
|
6397
|
-
[x: string]: unknown;
|
|
6398
|
-
} & z.input<typeof notificationRulesCapability.methods.getSequence.input>;
|
|
6399
|
-
output: z.infer<typeof notificationRulesCapability.methods.getSequence.output>;
|
|
6400
|
-
meta: object;
|
|
6401
|
-
}>;
|
|
6402
|
-
createSequence: TRPCMutationProcedure<{
|
|
6403
|
-
input: {
|
|
6404
|
-
[x: string]: unknown;
|
|
6405
|
-
} & z.input<typeof notificationRulesCapability.methods.createSequence.input>;
|
|
6406
|
-
output: z.infer<typeof notificationRulesCapability.methods.createSequence.output>;
|
|
6407
|
-
meta: object;
|
|
6408
|
-
}>;
|
|
6409
|
-
updateSequence: TRPCMutationProcedure<{
|
|
6410
|
-
input: {
|
|
6411
|
-
[x: string]: unknown;
|
|
6412
|
-
} & z.input<typeof notificationRulesCapability.methods.updateSequence.input>;
|
|
6413
|
-
output: z.infer<typeof notificationRulesCapability.methods.updateSequence.output>;
|
|
6414
|
-
meta: object;
|
|
6415
|
-
}>;
|
|
6416
|
-
deleteSequence: TRPCMutationProcedure<{
|
|
6417
|
-
input: {
|
|
6418
|
-
[x: string]: unknown;
|
|
6419
|
-
} & z.input<typeof notificationRulesCapability.methods.deleteSequence.input>;
|
|
6420
|
-
output: z.infer<typeof notificationRulesCapability.methods.deleteSequence.output>;
|
|
6421
|
-
meta: object;
|
|
6422
|
-
}>;
|
|
6423
6388
|
getClipRetentionAsks: TRPCQueryProcedure<{
|
|
6424
6389
|
input: {
|
|
6425
6390
|
[x: string]: unknown;
|
|
@@ -110,7 +110,7 @@ export interface SystemProxy {
|
|
|
110
110
|
readonly networkQuality: Pick<InferProvider<typeof networkQualityCapability>, 'getAllStats'>;
|
|
111
111
|
readonly nodes: Pick<InferProvider<typeof nodesCapability>, 'topology' | 'directory' | 'deployAddon' | 'undeployAddon' | 'restartAddon' | 'restartProcess' | 'restartNode' | 'shutdownNode' | 'renameNode' | 'clusterAddonStatus' | 'getCapUsageGraph' | 'getNodeAddons' | 'setProcessLogLevel' | 'executeQuery'>;
|
|
112
112
|
readonly notificationOutput: Pick<InferProvider<typeof notificationOutputCapability>, 'listTargetKinds' | 'discoverTargets' | 'probeTargetConfig' | 'send' | 'testTarget'>;
|
|
113
|
-
readonly notificationRules: Pick<InferProvider<typeof notificationRulesCapability>, 'listRules' | 'getRule' | 'createRule' | 'updateRule' | 'deleteRule' | 'setRuleEnabled' | '
|
|
113
|
+
readonly notificationRules: Pick<InferProvider<typeof notificationRulesCapability>, 'listRules' | 'getRule' | 'createRule' | 'updateRule' | 'deleteRule' | 'setRuleEnabled' | 'getClipRetentionAsks' | 'listDeviceMutes' | 'testRule' | 'previewStateSummary' | 'getConditionCatalog' | 'getTemplateCatalog' | 'previewTemplate' | 'getHistory' | 'getRuleLastRuns' | 'resolveArtifactUrl' | 'listSnoozes' | 'createSnooze' | 'cancelSnooze' | 'getAlarmConfig' | 'setAlarmConfig' | 'createAlarmProfile' | 'renameAlarmProfile' | 'deleteAlarmProfile' | 'activateAlarmProfile' | 'getAlarmSensors'>;
|
|
114
114
|
readonly osdManager: Pick<InferProvider<typeof osdManagerCapability>, 'getConditionSupport' | 'copyDeviceConfiguration' | 'listTemplates' | 'upsertTemplate' | 'deleteTemplate'>;
|
|
115
115
|
readonly pipelineExecutor: Pick<InferProvider<typeof pipelineExecutorCapability>, 'getAvailableEngines' | 'getSelectedEngine' | 'getEngineProvisioning' | 'getVideoPipelineSteps' | 'setVideoPipelineSteps' | 'getInferenceDeviceHealth' | 'rearmInferenceDevice' | 'getSchema' | 'getOrchestratorConfigSchema' | 'validatePipeline' | 'getCapabilities' | 'getAddonModels' | 'downloadModel' | 'deleteModel' | 'cacheFrameInPool' | 'inferCached' | 'uncacheFrame' | 'getEffectiveTuning' | 'listLoadedEngines' | 'spinEngine' | 'killEngine' | 'listReferenceImages' | 'getReferenceImage' | 'getReferenceAudioFiles' | 'getReferenceAudio' | 'getAudioCapabilities' | 'runAudioTest' | 'getDetectionConfigSchema'>;
|
|
116
116
|
readonly pipelineOrchestrator: Pick<InferProvider<typeof pipelineOrchestratorCapability>, 'requestOccupancyLook' | 'pauseForStorageMigration' | 'resumeForStorageMigration' | 'rebalance' | 'getPipelineAssignments' | 'getAgentLoad' | 'getClusterModelChoice' | 'getGlobalMetrics' | 'getCapabilityBindings' | 'setCapabilityBinding' | 'getIngestOwner' | 'getAudioNodeLoad' | 'getAudioAssignments' | 'getAgentSettings' | 'listAgentSettings' | 'removeAgentSettings' | 'setAgentMaxCameras' | 'setAgentCapabilities' | 'setAgentDecodeLimits' | 'setAgentReachableHost' | 'setAgentInferenceDevices' | 'setNodeStepSettings' | 'getNodeInferenceDevices' | 'forgetInferenceDevice' | 'resetNodePipelineDefaults' | 'planAutoTune' | 'applyAutoTune' | 'setLoadBalancingShares' | 'getPlacementStats' | 'suggestShares' | 'getEffectiveShares' | 'setShareSource' | 'getNodeBenchmarkPreflight' | 'startNodeBenchmark' | 'getNodeBenchmarkStatus' | 'abortNodeBenchmark' | 'getNodeBenchmarkCandidates' | 'listNodeBenchmarkResults' | 'deleteNodeBenchmarkResult' | 'getCameraStatuses' | 'setCameraSensors' | 'reconcileFromDisk' | 'getReconcileFromDiskStatus'>;
|
package/dist/index.d.ts
CHANGED
|
@@ -198,7 +198,6 @@ export type { PreparedRecipe, UnitResolver, UnitWarning, UnitsNormalized, } from
|
|
|
198
198
|
export * from './automation/action.js';
|
|
199
199
|
export * from './automation/action-target.js';
|
|
200
200
|
export * from './automation/scheduler.js';
|
|
201
|
-
export * from './automation/nc-action-target.js';
|
|
202
201
|
export * from './automation/step-condition.js';
|
|
203
202
|
export * from './automation/step-runner.js';
|
|
204
203
|
export * from './automation/export-entities.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-DgCXXFc3.js");
|
|
3
3
|
const require_event_category = require("./event-category-BC4RRerT.js");
|
|
4
4
|
const require_composed_stable_id = require("./composed-stable-id-C3J6LxC9.js");
|
|
5
5
|
const require_composition = require("./composition-BcVAbtBc.js");
|
|
@@ -32888,30 +32888,21 @@ function convertLegacyWhen(half) {
|
|
|
32888
32888
|
* (instants) and state leaves (durations). It replaces the flat trigger list
|
|
32889
32889
|
* plus the separate condition tree; the firing rule is in that file and in
|
|
32890
32890
|
* ADR "one tree".
|
|
32891
|
-
* - **Actions** — `
|
|
32892
|
-
* fragment of §3.2.2. See {@link AutomationActionSchema}
|
|
32893
|
-
* this had to diverge from "verbatim", and why.
|
|
32891
|
+
* - **Actions** — the `wait` and `cap` steps, plus the `{kind:'code'}`
|
|
32892
|
+
* fragment of §3.2.2. See {@link AutomationActionSchema}.
|
|
32894
32893
|
*
|
|
32895
32894
|
* A recipe stored in the old shape (`triggers` + `conditions`) still LOADS:
|
|
32896
32895
|
* {@link AutomationRecipeSchema} (the parse-anywhere schema) converts it on parse. Nothing writes it.
|
|
32897
32896
|
*/
|
|
32898
32897
|
/**
|
|
32899
|
-
* One action step.
|
|
32898
|
+
* One action step: `wait`, or a `cap` call.
|
|
32900
32899
|
*
|
|
32901
|
-
*
|
|
32902
|
-
*
|
|
32903
|
-
*
|
|
32904
|
-
*
|
|
32905
|
-
*
|
|
32906
|
-
*
|
|
32907
|
-
* a literal `z.number().int()`, and the NC runner's own `RunSequencesInput`
|
|
32908
|
-
* documents its subject device as *"for the log tag, never for routing"*. So an
|
|
32909
|
-
* NC action can never target the device that triggered it — which is fine for
|
|
32910
|
-
* the NC (its rules already scope to a device) and fatal for an automation
|
|
32911
|
-
* ("sound the siren of the camera that saw the person"). `deviceId` therefore
|
|
32912
|
-
* also accepts `{ $var }`, resolved from the run's `vars` bag BEFORE the runner
|
|
32913
|
-
* is called. The runner still receives a number and is untouched; the
|
|
32914
|
-
* resolution is the recipe's job, not the runner's.
|
|
32900
|
+
* A cap step's target is who it acts on (D983: `devices`, a `domain`, or a
|
|
32901
|
+
* `{ $var }` resolved from the run's variables); the legacy `deviceId` is still
|
|
32902
|
+
* READ, never written. The step runner (`runSteps`) owns the device-scope
|
|
32903
|
+
* check, the stop-at-first-failure and the variable substitution, once, for
|
|
32904
|
+
* every caller — automations, Actions, and the notification centre, which runs
|
|
32905
|
+
* only Actions (planning#473).
|
|
32915
32906
|
*/
|
|
32916
32907
|
var AutomationWaitStepSchema = zod.z.object({
|
|
32917
32908
|
kind: zod.z.literal("wait"),
|
|
@@ -35571,6 +35562,8 @@ var IDLE_ACTION_STATUS = {
|
|
|
35571
35562
|
lastRunAt: null,
|
|
35572
35563
|
lastError: null
|
|
35573
35564
|
};
|
|
35565
|
+
/** The throttle window of an action, in seconds; absent or 0 = no throttle. */
|
|
35566
|
+
var ActionMinDelaySecSchema = zod.z.number().int().min(0).max(86400);
|
|
35574
35567
|
var ActionEntrySchema = zod.z.object({
|
|
35575
35568
|
/** `internal:<uuid>` or `<addonId>:<localId>`. */
|
|
35576
35569
|
id: zod.z.string().min(3),
|
|
@@ -35583,6 +35576,14 @@ var ActionEntrySchema = zod.z.object({
|
|
|
35583
35576
|
/** Internal only: cap and wait steps. No action-in-action, so no cycles. */
|
|
35584
35577
|
steps: zod.z.array(ActionStepSchema).min(1).max(50).optional(),
|
|
35585
35578
|
variables: zod.z.array(ActionVariableSchema).max(20).optional(),
|
|
35579
|
+
/**
|
|
35580
|
+
* Internal only: the least time between two run STARTS. A run that begins
|
|
35581
|
+
* inside the window is skipped (`skipped-cooldown`), traced and logged. It
|
|
35582
|
+
* is an actuator's budget — "how often may this gate physically open" —
|
|
35583
|
+
* not a notification cooldown, and it is shared by every caller of the
|
|
35584
|
+
* action (two rules, a button, an automation).
|
|
35585
|
+
*/
|
|
35586
|
+
minDelaySec: ActionMinDelaySecSchema.optional(),
|
|
35586
35587
|
status: ActionStatusSchema
|
|
35587
35588
|
}).superRefine((entry, ctx) => {
|
|
35588
35589
|
if (entry.source === "internal") {
|
|
@@ -35613,7 +35614,8 @@ var ActionEntrySchema = zod.z.object({
|
|
|
35613
35614
|
var ActionInputSchema = zod.z.object({
|
|
35614
35615
|
name: zod.z.string().min(1).max(120),
|
|
35615
35616
|
steps: zod.z.array(ActionStepSchema).min(1).max(50),
|
|
35616
|
-
variables: zod.z.array(ActionVariableSchema).max(20).optional()
|
|
35617
|
+
variables: zod.z.array(ActionVariableSchema).max(20).optional(),
|
|
35618
|
+
minDelaySec: ActionMinDelaySecSchema.optional()
|
|
35617
35619
|
});
|
|
35618
35620
|
/** Who started a run. Absent = the operator pressed it. */
|
|
35619
35621
|
var ActionRunOriginSchema = zod.z.object({
|
|
@@ -35666,30 +35668,6 @@ var ActionRunChangedSchema = zod.z.object({
|
|
|
35666
35668
|
lastError: zod.z.string().nullable()
|
|
35667
35669
|
});
|
|
35668
35670
|
//#endregion
|
|
35669
|
-
//#region src/automation/nc-action-target.ts
|
|
35670
|
-
function normalizeNcCapTarget(action) {
|
|
35671
|
-
const target = action.target ?? (action.deviceId === void 0 ? void 0 : {
|
|
35672
|
-
kind: "devices",
|
|
35673
|
-
ids: [action.deviceId]
|
|
35674
|
-
});
|
|
35675
|
-
if (target === void 0) throw new Error(`rule action ${action.cap}.${action.method} has no target`);
|
|
35676
|
-
return {
|
|
35677
|
-
target,
|
|
35678
|
-
actionId: action.actionId ?? (action.deviceId === void 0 ? void 0 : require_sleep.vocabActionIdFor(action.cap, action.method, action.args))
|
|
35679
|
-
};
|
|
35680
|
-
}
|
|
35681
|
-
/** The step as it is stored from now on: `target` (and `actionId`) set, no `deviceId`. */
|
|
35682
|
-
function normalizeNcAction(action) {
|
|
35683
|
-
if (action.kind !== "cap") return action;
|
|
35684
|
-
const { deviceId: _legacy, target: _target, actionId: _actionId, ...rest } = action;
|
|
35685
|
-
const { target, actionId } = normalizeNcCapTarget(action);
|
|
35686
|
-
return {
|
|
35687
|
-
...rest,
|
|
35688
|
-
...actionId === void 0 ? {} : { actionId },
|
|
35689
|
-
target
|
|
35690
|
-
};
|
|
35691
|
-
}
|
|
35692
|
-
//#endregion
|
|
35693
35671
|
//#region src/automation/step-condition.ts
|
|
35694
35672
|
/**
|
|
35695
35673
|
* The guard of a conditional step (#472): the step's `if` is the ONE `when`
|
|
@@ -71795,101 +71773,21 @@ var NcZoneConditionSchema = zod.z.object({
|
|
|
71795
71773
|
* membership lists are OR within the list (spec §2.3).
|
|
71796
71774
|
*/
|
|
71797
71775
|
/**
|
|
71798
|
-
* What a rule
|
|
71799
|
-
*
|
|
71800
|
-
* **No hand-maintained allowlist** (operator decision, and the right one — a
|
|
71801
|
-
* written list of methods is a third parallel map to keep aligned, and this
|
|
71802
|
-
* repo has paid for those). The boundary instead comes from a property the
|
|
71803
|
-
* capabilities already carry: an action may target only a **device-scoped**
|
|
71804
|
-
* capability method.
|
|
71805
|
-
*
|
|
71806
|
-
* That is not decoration. A rule can be authored by a NON-ADMIN — personal
|
|
71807
|
-
* rules are a supported flow — and the executor runs with the addon's
|
|
71808
|
-
* privileges, so an unbounded action is an arbitrary RPC channel with a
|
|
71809
|
-
* privilege escalation attached. Restricting to device scope excludes the
|
|
71810
|
-
* system caps (`device-manager.removeDevice` and friends) by construction,
|
|
71811
|
-
* costs nothing to maintain, and cannot rot: a cap that stops being
|
|
71812
|
-
* device-scoped stops being actuatable in the same change.
|
|
71813
|
-
*
|
|
71814
|
-
* The executor enforces it; {@link NcRuleActionSchema} carries the intent.
|
|
71815
|
-
*/
|
|
71816
|
-
/**
|
|
71817
|
-
* One step of a sequence.
|
|
71818
|
-
*
|
|
71819
|
-
* `wait` is a first-class step rather than a property of the next action: it is
|
|
71820
|
-
* what makes a sequence a SEQUENCE and not a list — "unlock, wait 5s, open"
|
|
71821
|
-
* cannot be expressed otherwise.
|
|
71822
|
-
*/
|
|
71823
|
-
var NcRuleActionSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
71824
|
-
kind: zod.z.literal("wait"),
|
|
71825
|
-
seconds: zod.z.number().min(0).max(300)
|
|
71826
|
-
}), zod.z.object({
|
|
71827
|
-
kind: zod.z.literal("cap"),
|
|
71828
|
-
/**
|
|
71829
|
-
* WHO the step acts on (D983) — the only shape that is written. A sequence
|
|
71830
|
-
* stored before D983 carries `deviceId`; the sequence store reads it as a
|
|
71831
|
-
* `devices` target.
|
|
71832
|
-
*/
|
|
71833
|
-
target: ActionTargetSchema.optional(),
|
|
71834
|
-
/** The vocabulary action the step performs; required for a `domain` target. */
|
|
71835
|
-
actionId: zod.z.string().min(1).optional(),
|
|
71836
|
-
/** @deprecated The pre-D983 single device. Read, never written. */
|
|
71837
|
-
deviceId: zod.z.number().int().optional(),
|
|
71838
|
-
/** Capability name, e.g. `alarm-panel`. */
|
|
71839
|
-
cap: zod.z.string().min(1),
|
|
71840
|
-
/** Method on it. The executor refuses a non-device-scoped cap. */
|
|
71841
|
-
method: zod.z.string().min(1),
|
|
71842
|
-
/** Method arguments, minus `deviceId` (the executor injects it). */
|
|
71843
|
-
args: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
71844
|
-
}).refine((step) => step.target !== void 0 || step.deviceId !== void 0, {
|
|
71845
|
-
message: "a cap step needs a target",
|
|
71846
|
-
path: ["target"]
|
|
71847
|
-
}).refine((step) => step.target?.kind !== "domain" || step.actionId !== void 0, {
|
|
71848
|
-
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
71849
|
-
path: ["actionId"]
|
|
71850
|
-
})]);
|
|
71851
|
-
/**
|
|
71852
|
-
* A named, ordered run of steps shared across rules, with its own throttle.
|
|
71853
|
-
*
|
|
71854
|
-
* Sequences live in the notification centre's sequence store — never inline on
|
|
71855
|
-
* a rule. A rule binds to one by id ({@link NcActionBindingSchema}), and a
|
|
71856
|
-
* button names one the same way. `minDelaySec` exists because a noisy rule
|
|
71857
|
-
* otherwise hammers a physical actuator — the rule's own cooldown governs
|
|
71858
|
-
* NOTIFICATIONS, which is a different budget from "how often may this gate
|
|
71859
|
-
* actually open". The throttle key is the sequence id, so two rules sharing
|
|
71860
|
-
* one sequence share its budget.
|
|
71861
|
-
*/
|
|
71862
|
-
var NcSharedSequenceSchema = zod.z.object({
|
|
71863
|
-
id: zod.z.string().min(1),
|
|
71864
|
-
name: zod.z.string().min(1).max(120),
|
|
71865
|
-
minDelaySec: zod.z.number().int().min(0).max(86400).optional(),
|
|
71866
|
-
actions: zod.z.array(NcRuleActionSchema).min(1)
|
|
71867
|
-
});
|
|
71868
|
-
/** Create / update body — the id is minted by the provider. */
|
|
71869
|
-
var NcSharedSequenceInputSchema = zod.z.object({
|
|
71870
|
-
name: zod.z.string().min(1).max(120),
|
|
71871
|
-
minDelaySec: zod.z.number().int().min(0).max(86400).optional(),
|
|
71872
|
-
actions: zod.z.array(NcRuleActionSchema).min(1)
|
|
71873
|
-
});
|
|
71874
|
-
/**
|
|
71875
|
-
* What one hook slot may run: a shared sequence, or a single step authored
|
|
71876
|
-
* inline ("Do").
|
|
71776
|
+
* What a rule or a button runs: an **Action** of the `actions` surface
|
|
71777
|
+
* (`internal:<uuid>` or an addon's), by id, and nothing else (planning#473).
|
|
71877
71778
|
*
|
|
71878
|
-
*
|
|
71879
|
-
*
|
|
71880
|
-
*
|
|
71779
|
+
* The notification centre has no step vocabulary of its own. The steps, the
|
|
71780
|
+
* device-scope boundary, the stop-at-first-failure, the throttle
|
|
71781
|
+
* (`minDelaySec`), the variables and the runs ledger all belong to the Action;
|
|
71782
|
+
* an operator edits them in ONE place (the Actions page) and a rule points at
|
|
71783
|
+
* the result. A rule can be authored by a non-admin (personal rules), which is
|
|
71784
|
+
* safe for the same reason: it can only name an Action an admin already wrote.
|
|
71881
71785
|
*/
|
|
71882
|
-
var
|
|
71883
|
-
|
|
71884
|
-
|
|
71885
|
-
}), zod.z.object({
|
|
71886
|
-
kind: zod.z.literal("do"),
|
|
71887
|
-
action: NcRuleActionSchema
|
|
71888
|
-
})]);
|
|
71889
|
-
/** Bindings on one hook edge. Cap keeps a slot from becoming a second sequence editor. */
|
|
71890
|
-
var NcHookBindingsSchema = zod.z.array(NcActionBindingSchema).max(4);
|
|
71786
|
+
var NcActionIdSchema = zod.z.string().min(1);
|
|
71787
|
+
/** Action ids one hook edge runs, in order. Capped so a slot never becomes a second editor. */
|
|
71788
|
+
var NcHookActionIdsSchema = zod.z.array(NcActionIdSchema).max(4);
|
|
71891
71789
|
/**
|
|
71892
|
-
* One button carried by the notification, running
|
|
71790
|
+
* One button carried by the notification, running an Action on tap.
|
|
71893
71791
|
*
|
|
71894
71792
|
* **Read this before adding a button that does something physical.** The tap
|
|
71895
71793
|
* arrives over a link that travelled through third-party infrastructure — ntfy,
|
|
@@ -71904,9 +71802,9 @@ var NcRuleNotificationButtonSchema = zod.z.object({
|
|
|
71904
71802
|
/** Stable id — travels in the callback and identifies the button in logs. */
|
|
71905
71803
|
id: zod.z.string().min(1).max(64),
|
|
71906
71804
|
label: zod.z.string().min(1).max(40),
|
|
71907
|
-
/**
|
|
71908
|
-
*
|
|
71909
|
-
|
|
71805
|
+
/** The Action the tap runs. The dispatcher drops a button whose Action does
|
|
71806
|
+
* not exist rather than minting a token for nothing. */
|
|
71807
|
+
actionId: NcActionIdSchema,
|
|
71910
71808
|
icon: NotificationActionIconSchema.optional(),
|
|
71911
71809
|
destructive: zod.z.boolean().optional()
|
|
71912
71810
|
});
|
|
@@ -71921,33 +71819,20 @@ var NcRuleNotificationButtonSchema = zod.z.object({
|
|
|
71921
71819
|
* leave). A delivery with no clear edge never produces this hook.
|
|
71922
71820
|
*/
|
|
71923
71821
|
var NcRuleActionsSchema = zod.z.object({
|
|
71924
|
-
onActivation:
|
|
71925
|
-
onDeactivation:
|
|
71822
|
+
onActivation: NcHookActionIdsSchema.optional(),
|
|
71823
|
+
onDeactivation: NcHookActionIdsSchema.optional(),
|
|
71926
71824
|
/** Runs on a positive / raised match. */
|
|
71927
|
-
onTrigger:
|
|
71825
|
+
onTrigger: NcHookActionIdsSchema.optional(),
|
|
71928
71826
|
/** Runs on a clear / leave match, when the subject carries one. */
|
|
71929
|
-
onTriggerOff:
|
|
71827
|
+
onTriggerOff: NcHookActionIdsSchema.optional(),
|
|
71930
71828
|
/**
|
|
71931
|
-
* Buttons the NOTIFICATION carries, each running one
|
|
71932
|
-
*
|
|
71933
|
-
*
|
|
71829
|
+
* Buttons the NOTIFICATION carries, each running one Action when tapped.
|
|
71830
|
+
* Deliberately a REFERENCE — a button that could define its own steps would
|
|
71831
|
+
* be a parallel actuation vocabulary.
|
|
71934
71832
|
*/
|
|
71935
71833
|
buttons: zod.z.array(NcRuleNotificationButtonSchema).max(8).optional()
|
|
71936
71834
|
});
|
|
71937
71835
|
/**
|
|
71938
|
-
* @deprecated Legacy inline sequence shape (pre shared-sequence store). Kept
|
|
71939
|
-
* only so boot migration / tests can recognise and rewrite persisted rows.
|
|
71940
|
-
* New code must use {@link NcSharedSequence} + {@link NcActionBinding}.
|
|
71941
|
-
*/
|
|
71942
|
-
var NcLegacyRuleActionSequenceSchema = zod.z.object({
|
|
71943
|
-
name: zod.z.string().min(1).max(120),
|
|
71944
|
-
enabled: zod.z.boolean(),
|
|
71945
|
-
minDelaySec: zod.z.number().int().min(0).max(86400).optional(),
|
|
71946
|
-
actions: zod.z.array(NcRuleActionSchema).min(1)
|
|
71947
|
-
});
|
|
71948
|
-
/** @deprecated Alias kept for call sites mid-migration; prefer {@link NcSharedSequence}. */
|
|
71949
|
-
var NcRuleActionSequenceSchema = NcLegacyRuleActionSequenceSchema;
|
|
71950
|
-
/**
|
|
71951
71836
|
* "This rule applies only while `deviceId` is in one of `states`."
|
|
71952
71837
|
*
|
|
71953
71838
|
* The states are the DEVICE's own vocabulary — `AlarmState` for a panel,
|
|
@@ -74353,28 +74238,6 @@ var notificationRulesCapability = {
|
|
|
74353
74238
|
auth: "admin"
|
|
74354
74239
|
}),
|
|
74355
74240
|
/**
|
|
74356
|
-
* Shared action sequences — named step lists rules and buttons bind to by
|
|
74357
|
-
* id. One store for the whole notification centre so two rules sharing a
|
|
74358
|
-
* gate share its throttle too.
|
|
74359
|
-
*/
|
|
74360
|
-
listSequences: require_sleep.method(zod.z.object({}), zod.z.object({ sequences: zod.z.array(NcSharedSequenceSchema) }), { auth: "admin" }),
|
|
74361
|
-
getSequence: require_sleep.method(zod.z.object({ sequenceId: zod.z.string().min(1) }), zod.z.object({ sequence: NcSharedSequenceSchema.nullable() }), { auth: "admin" }),
|
|
74362
|
-
createSequence: require_sleep.method(zod.z.object({ sequence: NcSharedSequenceInputSchema }), zod.z.object({ sequence: NcSharedSequenceSchema }), {
|
|
74363
|
-
kind: "mutation",
|
|
74364
|
-
auth: "admin"
|
|
74365
|
-
}),
|
|
74366
|
-
updateSequence: require_sleep.method(zod.z.object({
|
|
74367
|
-
sequenceId: zod.z.string().min(1),
|
|
74368
|
-
sequence: NcSharedSequenceInputSchema
|
|
74369
|
-
}), zod.z.object({ sequence: NcSharedSequenceSchema }), {
|
|
74370
|
-
kind: "mutation",
|
|
74371
|
-
auth: "admin"
|
|
74372
|
-
}),
|
|
74373
|
-
deleteSequence: require_sleep.method(zod.z.object({ sequenceId: zod.z.string().min(1) }), zod.z.object({ success: zod.z.literal(true) }), {
|
|
74374
|
-
kind: "mutation",
|
|
74375
|
-
auth: "admin"
|
|
74376
|
-
}),
|
|
74377
|
-
/**
|
|
74378
74241
|
* WHAT THE RULES ACTUALLY ASK the stream broker to retain, per camera.
|
|
74379
74242
|
*
|
|
74380
74243
|
* The notification centre owns the rules, so it is the only thing that can
|
|
@@ -122942,11 +122805,6 @@ function createSystemProxy(api) {
|
|
|
122942
122805
|
updateRule: (input) => dispatch("notificationRules", "updateRule", "mutation", input),
|
|
122943
122806
|
deleteRule: (input) => dispatch("notificationRules", "deleteRule", "mutation", input),
|
|
122944
122807
|
setRuleEnabled: (input) => dispatch("notificationRules", "setRuleEnabled", "mutation", input),
|
|
122945
|
-
listSequences: (input) => dispatch("notificationRules", "listSequences", "query", input),
|
|
122946
|
-
getSequence: (input) => dispatch("notificationRules", "getSequence", "query", input),
|
|
122947
|
-
createSequence: (input) => dispatch("notificationRules", "createSequence", "mutation", input),
|
|
122948
|
-
updateSequence: (input) => dispatch("notificationRules", "updateSequence", "mutation", input),
|
|
122949
|
-
deleteSequence: (input) => dispatch("notificationRules", "deleteSequence", "mutation", input),
|
|
122950
122808
|
getClipRetentionAsks: (input) => dispatch("notificationRules", "getClipRetentionAsks", "query", input),
|
|
122951
122809
|
listDeviceMutes: (input) => dispatch("notificationRules", "listDeviceMutes", "query", input),
|
|
122952
122810
|
testRule: (input) => dispatch("notificationRules", "testRule", "mutation", input),
|
|
@@ -125518,12 +125376,8 @@ var NC_ALARM_CONTROLLABLE_CAPS = [
|
|
|
125518
125376
|
function isAlarmControllableCap(cap) {
|
|
125519
125377
|
return NC_ALARM_CONTROLLABLE_CAPS.includes(cap);
|
|
125520
125378
|
}
|
|
125521
|
-
function
|
|
125522
|
-
|
|
125523
|
-
const action = binding.action;
|
|
125524
|
-
return action.kind === "cap" && action.cap === ALARM_PANEL_CAP && action.method === ALARM_PANEL_TRIGGER_METHOD;
|
|
125525
|
-
}
|
|
125526
|
-
const steps = sequenceActionsOf?.(binding.sequenceId);
|
|
125379
|
+
function actionPullsAlarmTrigger(actionId, actionStepsOf) {
|
|
125380
|
+
const steps = actionStepsOf?.(actionId);
|
|
125527
125381
|
if (steps === void 0) return false;
|
|
125528
125382
|
return steps.some((step) => step.kind === "cap" && step.cap === ALARM_PANEL_CAP && step.method === ALARM_PANEL_TRIGGER_METHOD);
|
|
125529
125383
|
}
|
|
@@ -125533,19 +125387,19 @@ function ruleGatedOnArmedState(rule) {
|
|
|
125533
125387
|
}
|
|
125534
125388
|
/**
|
|
125535
125389
|
* A rule belongs to the alarm when its `deviceState` gate names ANY device's
|
|
125536
|
-
* `armed_*` word, or an on-match
|
|
125537
|
-
* (D630). Button-only
|
|
125390
|
+
* `armed_*` word, or an on-match Action pulls the alarm panel's trigger
|
|
125391
|
+
* (D630). Button-only Actions do NOT count — they are not an automatic
|
|
125538
125392
|
* escalation.
|
|
125539
125393
|
*/
|
|
125540
125394
|
function ruleBelongsToAlarm(rule) {
|
|
125541
125395
|
if (ruleGatedOnArmedState(rule)) return true;
|
|
125542
|
-
for (const
|
|
125396
|
+
for (const actionId of rule.actions?.onTrigger ?? []) if (actionPullsAlarmTrigger(actionId, rule.actionStepsOf)) return true;
|
|
125543
125397
|
return false;
|
|
125544
125398
|
}
|
|
125545
125399
|
/**
|
|
125546
125400
|
* A rule gated on `armed_*` auto-triggers the CamStack `alarm-panel` on match
|
|
125547
|
-
* — no `onTrigger`
|
|
125548
|
-
* An explicit `alarm-panel.trigger`
|
|
125401
|
+
* — no `onTrigger` Action required. Sirens are never part of this path.
|
|
125402
|
+
* An explicit `alarm-panel.trigger` step without an armed gate stays
|
|
125549
125403
|
* explicit actuation only ({@link ruleBelongsToAlarm}).
|
|
125550
125404
|
*/
|
|
125551
125405
|
function ruleAutoTriggersAlarm(rule) {
|
|
@@ -135027,6 +134881,7 @@ exports.ActionError = ActionError;
|
|
|
135027
134881
|
exports.ActionErrorCodeSchema = ActionErrorCodeSchema;
|
|
135028
134882
|
exports.ActionInputSchema = ActionInputSchema;
|
|
135029
134883
|
exports.ActionLinksSchema = ActionLinksSchema;
|
|
134884
|
+
exports.ActionMinDelaySecSchema = ActionMinDelaySecSchema;
|
|
135030
134885
|
exports.ActionRunChangedSchema = ActionRunChangedSchema;
|
|
135031
134886
|
exports.ActionRunOriginSchema = ActionRunOriginSchema;
|
|
135032
134887
|
exports.ActionRunOutcomeSchema = ActionRunOutcomeSchema;
|
|
@@ -136379,7 +136234,7 @@ exports.NavigationMoveCommandSchema = NavigationMoveCommandSchema;
|
|
|
136379
136234
|
exports.NavigationPointSchema = NavigationPointSchema;
|
|
136380
136235
|
exports.NavigationRuntimeStateSchema = NavigationRuntimeStateSchema;
|
|
136381
136236
|
exports.NavigationStatusSchema = NavigationStatusSchema;
|
|
136382
|
-
exports.
|
|
136237
|
+
exports.NcActionIdSchema = NcActionIdSchema;
|
|
136383
136238
|
exports.NcAlarmBlockingEditSchema = NcAlarmBlockingEditSchema;
|
|
136384
136239
|
exports.NcAlarmBlockingSchema = NcAlarmBlockingSchema;
|
|
136385
136240
|
exports.NcAlarmConfigSchema = NcAlarmConfigSchema;
|
|
@@ -136420,16 +136275,13 @@ exports.NcHistoryFilterSchema = NcHistoryFilterSchema;
|
|
|
136420
136275
|
exports.NcHistoryRecordKindSchema = NcHistoryRecordKindSchema;
|
|
136421
136276
|
exports.NcHistoryStatusSchema = NcHistoryStatusSchema;
|
|
136422
136277
|
exports.NcHistorySubjectSchema = NcHistorySubjectSchema;
|
|
136423
|
-
exports.
|
|
136424
|
-
exports.NcLegacyRuleActionSequenceSchema = NcLegacyRuleActionSequenceSchema;
|
|
136278
|
+
exports.NcHookActionIdsSchema = NcHookActionIdsSchema;
|
|
136425
136279
|
exports.NcLinkedCameraModeSchema = NcLinkedCameraModeSchema;
|
|
136426
136280
|
exports.NcMediaFrameSchema = NcMediaFrameSchema;
|
|
136427
136281
|
exports.NcMediaImageSchema = NcMediaImageSchema;
|
|
136428
136282
|
exports.NcMediaPolicySchema = NcMediaPolicySchema;
|
|
136429
136283
|
exports.NcOccupancyConditionSchema = NcOccupancyConditionSchema;
|
|
136430
136284
|
exports.NcPlateMatcherSchema = NcPlateMatcherSchema;
|
|
136431
|
-
exports.NcRuleActionSchema = NcRuleActionSchema;
|
|
136432
|
-
exports.NcRuleActionSequenceSchema = NcRuleActionSequenceSchema;
|
|
136433
136285
|
exports.NcRuleActionsSchema = NcRuleActionsSchema;
|
|
136434
136286
|
exports.NcRuleClearableKeySchema = NcRuleClearableKeySchema;
|
|
136435
136287
|
exports.NcRuleInputSchema = NcRuleInputSchema;
|
|
@@ -136445,8 +136297,6 @@ exports.NcSceneConditionSchema = NcSceneConditionSchema;
|
|
|
136445
136297
|
exports.NcScheduleSchema = NcScheduleSchema;
|
|
136446
136298
|
exports.NcScheduleWindowSchema = NcScheduleWindowSchema;
|
|
136447
136299
|
exports.NcSensorTransitionSchema = NcSensorTransitionSchema;
|
|
136448
|
-
exports.NcSharedSequenceInputSchema = NcSharedSequenceInputSchema;
|
|
136449
|
-
exports.NcSharedSequenceSchema = NcSharedSequenceSchema;
|
|
136450
136300
|
exports.NcSnoozeInputSchema = NcSnoozeInputSchema;
|
|
136451
136301
|
exports.NcSnoozeSchema = NcSnoozeSchema;
|
|
136452
136302
|
exports.NcSnoozeScopeSchema = NcSnoozeScopeSchema;
|
|
@@ -136966,6 +136816,7 @@ exports.RollingWindowSchema = require_composition.RollingWindowSchema;
|
|
|
136966
136816
|
exports.RootStepSupplySchema = RootStepSupplySchema;
|
|
136967
136817
|
exports.RtpSourceSchema = RtpSourceSchema;
|
|
136968
136818
|
exports.RtspRestreamEntrySchema = RtspRestreamEntrySchema;
|
|
136819
|
+
exports.RuleFireOriginSchema = require_sleep.RuleFireOriginSchema;
|
|
136969
136820
|
exports.RunGate = RunGate;
|
|
136970
136821
|
exports.RunnerBootCheckSchema = RunnerBootCheckSchema;
|
|
136971
136822
|
exports.RunnerCameraConfigSchema = RunnerCameraConfigSchema;
|
|
@@ -138236,8 +138087,6 @@ exports.normalizeAudioLabel = normalizeAudioLabel;
|
|
|
138236
138087
|
exports.normalizeCapStep = normalizeCapStep;
|
|
138237
138088
|
exports.normalizeConditionUnits = normalizeConditionUnits;
|
|
138238
138089
|
exports.normalizeCoreBlockWrite = normalizeCoreBlockWrite;
|
|
138239
|
-
exports.normalizeNcAction = normalizeNcAction;
|
|
138240
|
-
exports.normalizeNcCapTarget = normalizeNcCapTarget;
|
|
138241
138090
|
exports.normalizeNcMediaPolicy = normalizeNcMediaPolicy;
|
|
138242
138091
|
exports.normalizeNodeId = require_sleep.normalizeNodeId;
|
|
138243
138092
|
exports.normalizeOffSeconds = normalizeOffSeconds;
|
|
@@ -138526,6 +138375,7 @@ exports.ruleBelongsToAlarm = ruleBelongsToAlarm;
|
|
|
138526
138375
|
exports.ruleDeviceCompatCapNames = ruleDeviceCompatCapNames;
|
|
138527
138376
|
exports.ruleDeviceCompatCapQueries = ruleDeviceCompatCapQueries;
|
|
138528
138377
|
exports.ruleEditorSectionsForKind = ruleEditorSectionsForKind;
|
|
138378
|
+
exports.ruleFireOfClaim = require_sleep.ruleFireOfClaim;
|
|
138529
138379
|
exports.ruleGatedOnArmedState = ruleGatedOnArmedState;
|
|
138530
138380
|
exports.ruleGroupingApplies = ruleGroupingApplies;
|
|
138531
138381
|
exports.ruleKindOf = ruleKindOf;
|