@camstack/addon-admin-ui 1.2.666 → 1.2.668
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/assets/Addons-CS9fMA11.js +5 -0
- package/dist/assets/{AdminPage-CmU7TFpR.js → AdminPage-BF1i9kPY.js} +1 -1
- package/dist/assets/AdminSectionedPage-mnsiIZH6.js +1 -0
- package/dist/assets/AiProfiles-DbzB0Pbu.js +3 -0
- package/dist/assets/{BootstrapSettingsForm-D6UTTbsU.js → BootstrapSettingsForm-hTtEdByj.js} +1 -1
- package/dist/assets/Build-yBSDX1Kk.js +42 -0
- package/dist/assets/{Calendars-C5NgG8yX.js → Calendars-DbAHVmrk.js} +1 -1
- package/dist/assets/{CameraGrids-B0cBy4w5.js → CameraGrids-BHlKY46e.js} +1 -1
- package/dist/assets/{Cluster-BCyzfBO3.js → Cluster-DJcrrzAb.js} +1 -1
- package/dist/assets/CompositionBlockEditor-CkFtUEOb.js +2 -0
- package/dist/assets/{CompositionEditorPage-BDv9rAiM.js → CompositionEditorPage-B62gAhSg.js} +1 -1
- package/dist/assets/Data-C4pHhw3O.js +2 -0
- package/dist/assets/DeviceDetail-Bn3LfnpZ.js +2 -0
- package/dist/assets/{Devices-BzJ3Btzd.js → Devices-CtCY7Y3p.js} +1 -1
- package/dist/assets/{EmbedDevicePage-8C99LXxD.js → EmbedDevicePage-DumJpLzH.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-Ca2Sw4bZ.js → EmbedPlayerPage-Dd_mnALC.js} +1 -1
- package/dist/assets/History-CLxi8mtk.js +1 -0
- package/dist/assets/Identity-Dm39iAHu.js +1 -0
- package/dist/assets/InstancesTable-CKPmsmCY.js +1 -0
- package/dist/assets/IntegrationDetail-C5MLERb6.js +1 -0
- package/dist/assets/{Integrations-DSWNrJxB.js → Integrations-C5WzonVP.js} +1 -1
- package/dist/assets/{Integrations-BDCfdFnN.js → Integrations-Cu8s6iT9.js} +2 -2
- package/dist/assets/Library-Chq7sqXg.js +1 -0
- package/dist/assets/Locations-74WG8ksW.js +3 -0
- package/dist/assets/{Logs-1wrdl6wt.js → Logs-D7Y_z82A.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-Bq9CrmvE.js → MaskShapeCanvas-BqbVP9jy.js} +1 -1
- package/dist/assets/{MotionZonesSettings-BBu1rBTV.js → MotionZonesSettings-DeP_-aoj.js} +1 -1
- package/dist/assets/{MyAccess-xYr4opzQ.js → MyAccess-cXXeW1W2.js} +1 -1
- package/dist/assets/{Network-CvyVibLV.js → Network-DucbBwut.js} +1 -1
- package/dist/assets/NodeAddonsSettingsPanel-By-49erZ.js +2 -0
- package/dist/assets/Notifications-DOy2WcT3.js +1 -0
- package/dist/assets/{Pipeline-B_b10-YP.js → Pipeline-COhHnsdP.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-gWcdduy-.js → PrivacyMaskSettings-CZgjmB7K.js} +1 -1
- package/dist/assets/Recordings-BUByJnY-.js +1 -0
- package/dist/assets/{SceneMonitorEditor-Dx29RcZb.js → SceneMonitorEditor-BmU4cvFJ.js} +1 -1
- package/dist/assets/SessionsList-DU6cvGFu.js +2 -0
- package/dist/assets/{Showroom-CUEMO_di.js → Showroom-BEt9DNbA.js} +1 -1
- package/dist/assets/{StorageLocationsTable-CSQCOF91.js → StorageLocationsTable-Cve3-FxY.js} +1 -1
- package/dist/assets/System-Bzi48ZBO.js +1 -0
- package/dist/assets/{Terminal-Ah6yfRG5.js → Terminal-DozTqUqB.js} +4 -4
- package/dist/assets/{TrainingProviders-ClxXnXpP.js → TrainingProviders-BUkMf2wx.js} +1 -1
- package/dist/assets/{Viewer-BQrT9RT1.js → Viewer-S0tPSymT.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DhQkS3-x.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-P-4tHo8K.js} +1 -1
- package/dist/assets/{action-draft-D31SL5Iv.js → action-draft-D3UKrkg1.js} +1 -1
- package/dist/assets/{ai-page.helpers-0GgLwuhe.js → ai-page.helpers-Cs7gtuUF.js} +1 -1
- package/dist/assets/{assignment-candidates-DqQ8QJRE.js → assignment-candidates-CG_Tiehn.js} +1 -1
- package/dist/assets/{authed-media-VxlsUR-Z.js → authed-media-4OzXkRZ7.js} +1 -1
- package/dist/assets/{board-model-DTatxzz-.js → board-model-Cv7JHlPG.js} +1 -1
- package/dist/assets/client-DoiIBqwj.js +1119 -0
- package/dist/assets/{command-vocab-B5lwbaVw.js → command-vocab-BYX4pA4b.js} +1 -1
- package/dist/assets/{device-detail-CViRsVSZ.js → device-detail-BAZsiPq1.js} +1 -1
- package/dist/assets/{device-integration-icon-DRNFGMwO.js → device-integration-icon-DYGZQjZH.js} +1 -1
- package/dist/assets/device-picker-model-qk2Z3_xT.js +1 -0
- package/dist/assets/{dist-B2iUE_dF.js → dist-Ch3pRNws.js} +45 -45
- package/dist/assets/{dist-e7zknvUU.js → dist-Rh3LAX-C.js} +1 -1
- package/dist/assets/{format-DMC9AnIW.js → format-D_mC3UFE.js} +1 -1
- package/dist/assets/{hostInit-qJzSnSvz.js → hostInit-Cd5DWcEl.js} +1 -1
- package/dist/assets/i18n-DSVGwH5e.js +1 -0
- package/dist/assets/{icons-LCNDFamy.js → icons-UZl_ZY4u.js} +1 -1
- package/dist/assets/index-B77jgDOr.css +2 -0
- package/dist/assets/{index-DYgod6XH.js → index-DB-f81V7.js} +3 -3
- package/dist/assets/{linked-devices-model-BD77HUQH.js → linked-devices-model-B_gAE4Ak.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-f14661ef.js → mf-entry-bootstrap-0-94e05b9e.js} +2 -2
- package/dist/assets/mount-qk2Z3_xT.js +1 -0
- package/dist/assets/{notification-rule-status-DfwVGswl.js → notification-rule-status-DSkmsdJn.js} +1 -1
- package/dist/assets/{player-overlays-cnJlfjp-.js → player-overlays-PZJgLYRd.js} +1 -1
- package/dist/assets/remoteEntry-pgLtfwKj.js +1 -0
- package/dist/assets/src-C0iKIX_j.js +275 -0
- package/dist/assets/{sso-popup-zd7kZ7M8.js → sso-popup-BzLYKIa5.js} +1 -1
- package/dist/assets/{step-inspector-model-BwX9grtK.js → step-inspector-model-BOgBjq7X.js} +1 -1
- package/dist/assets/{use-scenes-feed-DLdvcIp2.js → use-scenes-feed-rY3lnB9G.js} +1 -1
- package/dist/assets/{use-stationary-objects-CHMJijgk.js → use-stationary-objects-XWJeux9x.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-am2_G0pf.js → useAdminDeviceRemoval-C1zpl_wj.js} +1 -1
- package/dist/assets/useEventInvalidation-qk2Z3_xT.js +1 -0
- package/dist/assets/{useNodeUrlSelection-CFdknlTi.js → useNodeUrlSelection-Ckf20QDa.js} +1 -1
- package/dist/assets/useTemplateSave-Ctfz_dym.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BtWTuqL9.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DtnmSeNe.js} +2 -2
- package/dist/index.html +9 -9
- package/dist/server/addon.js +333 -163
- package/package.json +2 -2
- package/dist/assets/Addons-BbdBk9wW.js +0 -5
- package/dist/assets/AdminSectionedPage-Cm0ZjYDU.js +0 -1
- package/dist/assets/AiProfiles-HJoGWhcS.js +0 -3
- package/dist/assets/Build-CCW-kQ0l.js +0 -42
- package/dist/assets/CompositionBlockEditor-BxZoOOq_.js +0 -2
- package/dist/assets/Data-D2RM7Tt4.js +0 -2
- package/dist/assets/DeviceDetail-rMZtKYoI.js +0 -2
- package/dist/assets/History-xW7LPyUG.js +0 -1
- package/dist/assets/Identity-DnwYpLFz.js +0 -1
- package/dist/assets/InstancesTable-DdCebknO.js +0 -1
- package/dist/assets/IntegrationDetail-O-kb6--D.js +0 -1
- package/dist/assets/Library-LsC-lNCD.js +0 -1
- package/dist/assets/Locations-BYoWfHdo.js +0 -3
- package/dist/assets/NodeAddonsSettingsPanel-BCe3XXQY.js +0 -2
- package/dist/assets/Notifications-rVhJKRmX.js +0 -1
- package/dist/assets/Recordings-BF59movC.js +0 -1
- package/dist/assets/SessionsList-DzIluTDz.js +0 -2
- package/dist/assets/System-Bcz-yvym.js +0 -1
- package/dist/assets/client-CjUsH2ih.js +0 -1119
- package/dist/assets/device-picker-model-DZUf4A44.js +0 -1
- package/dist/assets/i18n-HP_ZA8Cj.js +0 -1
- package/dist/assets/index-DinlcDxv.css +0 -2
- package/dist/assets/mount-DZUf4A44.js +0 -1
- package/dist/assets/remoteEntry-C5wElYQv.js +0 -1
- package/dist/assets/src-Bsetma4r.js +0 -272
- package/dist/assets/useEventInvalidation-DZUf4A44.js +0 -1
- package/dist/assets/useTemplateSave-BxTzxTH2.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -46889,69 +46889,6 @@ var EventVocabularyEntrySchema = object({
|
|
|
46889
46889
|
kind: EventVocabularyKindSchema.optional(),
|
|
46890
46890
|
payload: array(EventVocabularyFieldSchema).optional()
|
|
46891
46891
|
});
|
|
46892
|
-
/**
|
|
46893
|
-
* The link an automation made FROM a template carries (#527): which template,
|
|
46894
|
-
* the values the operator filled in, and — when the template has since changed
|
|
46895
|
-
* so that those values no longer fit — the problems that say why.
|
|
46896
|
-
*
|
|
46897
|
-
* It lives inside the recipe (`AutomationRecipe.template`), so the one row in
|
|
46898
|
-
* `core_blocks` stays the one artefact: there is no second store of instances
|
|
46899
|
-
* to drift from the blocks, and deleting the automation deletes the link.
|
|
46900
|
-
* "Convert to a free automation" is dropping this field.
|
|
46901
|
-
*
|
|
46902
|
-
* This file depends on nothing in `recipe.ts`, so the recipe can embed it and
|
|
46903
|
-
* the template engine (`template/automation-template.ts`) can import both.
|
|
46904
|
-
*/
|
|
46905
|
-
/** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
|
|
46906
|
-
var TemplateEventValueSchema = object({
|
|
46907
|
-
eventIds: array(string().min(1)).min(1).max(64).optional(),
|
|
46908
|
-
sourceIds: array(string().min(1)).min(1).max(64).optional(),
|
|
46909
|
-
kinds: array(EventVocabularyKindSchema).min(1).optional()
|
|
46910
|
-
}).refine((value) => value.eventIds !== void 0 || value.sourceIds !== void 0 || value.kinds !== void 0, { message: "an event names at least one event, part or kind" });
|
|
46911
|
-
/** An `action` input's value: a vocabulary action and its open args. */
|
|
46912
|
-
var TemplateActionValueSchema = object({
|
|
46913
|
-
actionId: string().min(1),
|
|
46914
|
-
args: record(string(), unknown()).optional()
|
|
46915
|
-
});
|
|
46916
|
-
/** The value of one non-group input. Which member is right is the input kind's to judge. */
|
|
46917
|
-
var TemplateScalarValueSchema = union([
|
|
46918
|
-
number$1(),
|
|
46919
|
-
string(),
|
|
46920
|
-
boolean(),
|
|
46921
|
-
array(number$1().int().nonnegative()),
|
|
46922
|
-
TemplateEventValueSchema,
|
|
46923
|
-
TemplateActionValueSchema
|
|
46924
|
-
]);
|
|
46925
|
-
var TemplateInputValueSchema = union([TemplateScalarValueSchema, array(record(string(), TemplateScalarValueSchema))]);
|
|
46926
|
-
/** Input key → value. */
|
|
46927
|
-
var TemplateInputValuesSchema = record(string(), TemplateInputValueSchema);
|
|
46928
|
-
var TemplateInstanceProblemSchema = object({
|
|
46929
|
-
code: _enum([
|
|
46930
|
-
"missing-input",
|
|
46931
|
-
"invalid-input",
|
|
46932
|
-
"invalid-recipe",
|
|
46933
|
-
"missing-template",
|
|
46934
|
-
"edited-by-hand"
|
|
46935
|
-
]),
|
|
46936
|
-
/** Dotted input address (`buttons.2.targets`); absent for a whole-recipe problem. */
|
|
46937
|
-
input: string().optional(),
|
|
46938
|
-
detail: string()
|
|
46939
|
-
});
|
|
46940
|
-
var AutomationTemplateLinkSchema = object({
|
|
46941
|
-
templateId: string().min(1),
|
|
46942
|
-
values: TemplateInputValuesSchema,
|
|
46943
|
-
/**
|
|
46944
|
-
* Fingerprint of the generated code with this literal blanked
|
|
46945
|
-
* (`instanceCodeHash`), stamped by `generateAutomationBlock`. Code that no
|
|
46946
|
-
* longer matches it was edited by hand, and is never regenerated over.
|
|
46947
|
-
*/
|
|
46948
|
-
codeHash: string().optional(),
|
|
46949
|
-
/**
|
|
46950
|
-
* Present when the last re-expansion refused these values. The automation
|
|
46951
|
-
* keeps running the body of its last good expansion; nothing is dropped.
|
|
46952
|
-
*/
|
|
46953
|
-
problems: array(TemplateInstanceProblemSchema).min(1).optional()
|
|
46954
|
-
});
|
|
46955
46892
|
var ExpressionBindingSourceSchema = union([
|
|
46956
46893
|
object({
|
|
46957
46894
|
kind: literal("field").optional(),
|
|
@@ -46987,6 +46924,58 @@ object({
|
|
|
46987
46924
|
path: ["expr"]
|
|
46988
46925
|
});
|
|
46989
46926
|
});
|
|
46927
|
+
Math.PI / 180;
|
|
46928
|
+
/**
|
|
46929
|
+
* WHEN something happens, as data (D983) — the one time vocabulary of the
|
|
46930
|
+
* scheduler and of an automation's schedule leaf. Three shapes, no cron:
|
|
46931
|
+
*
|
|
46932
|
+
* - `clock` — a wall-clock time every day (`07:30`), read in the site's zone;
|
|
46933
|
+
* - `sun` — a sun event (`sunrise`, `sunset`, `dawn`, `dusk`) plus or minus
|
|
46934
|
+
* up to twelve hours, from the site's coordinates;
|
|
46935
|
+
* - `date` — one local date and time (`2026-12-24T18:00`), once.
|
|
46936
|
+
*
|
|
46937
|
+
* A site is a place and its IANA zone ({@link TimeSite}). Every function here
|
|
46938
|
+
* is pure: the zone arithmetic uses `Intl`, no date library.
|
|
46939
|
+
*
|
|
46940
|
+
* Wall-clock honesty across a DST change: a local time that does not exist
|
|
46941
|
+
* (02:30 on the spring-forward day) happens at the first minute that does
|
|
46942
|
+
* (03:00); one that happens twice (02:30 on the fall-back day) happens at its
|
|
46943
|
+
* FIRST occurrence.
|
|
46944
|
+
*/
|
|
46945
|
+
var SunEventSchema = _enum([
|
|
46946
|
+
"sunrise",
|
|
46947
|
+
"sunset",
|
|
46948
|
+
"dawn",
|
|
46949
|
+
"dusk"
|
|
46950
|
+
]);
|
|
46951
|
+
var TimeSpecSchema = discriminatedUnion("kind", [
|
|
46952
|
+
object({
|
|
46953
|
+
kind: literal("clock"),
|
|
46954
|
+
hh: number$1().int().min(0).max(23),
|
|
46955
|
+
mm: number$1().int().min(0).max(59)
|
|
46956
|
+
}),
|
|
46957
|
+
object({
|
|
46958
|
+
kind: literal("sun"),
|
|
46959
|
+
event: SunEventSchema,
|
|
46960
|
+
/** Minutes after the event (negative: before). */
|
|
46961
|
+
offsetMin: number$1().int().min(-720).max(720)
|
|
46962
|
+
}),
|
|
46963
|
+
object({
|
|
46964
|
+
kind: literal("date"),
|
|
46965
|
+
/** `YYYY-MM-DDTHH:mm`, site-local. */
|
|
46966
|
+
local: string().regex(/^(\d{4}-\d{2}-\d{2})T([01]\d|2[0-3]):([0-5]\d)$/, "expected YYYY-MM-DDTHH:mm")
|
|
46967
|
+
})
|
|
46968
|
+
]);
|
|
46969
|
+
/** A day of the week as a schedule names it. */
|
|
46970
|
+
var WeekdayKeySchema = _enum([
|
|
46971
|
+
"mon",
|
|
46972
|
+
"tue",
|
|
46973
|
+
"wed",
|
|
46974
|
+
"thu",
|
|
46975
|
+
"fri",
|
|
46976
|
+
"sat",
|
|
46977
|
+
"sun"
|
|
46978
|
+
]);
|
|
46990
46979
|
/**
|
|
46991
46980
|
* Identity envelope for a device's upstream-system metadata.
|
|
46992
46981
|
*
|
|
@@ -47244,58 +47233,6 @@ function macroOnly(macro) {
|
|
|
47244
47233
|
};
|
|
47245
47234
|
}
|
|
47246
47235
|
}
|
|
47247
|
-
Math.PI / 180;
|
|
47248
|
-
/**
|
|
47249
|
-
* WHEN something happens, as data (D983) — the one time vocabulary of the
|
|
47250
|
-
* scheduler and of an automation's schedule leaf. Three shapes, no cron:
|
|
47251
|
-
*
|
|
47252
|
-
* - `clock` — a wall-clock time every day (`07:30`), read in the site's zone;
|
|
47253
|
-
* - `sun` — a sun event (`sunrise`, `sunset`, `dawn`, `dusk`) plus or minus
|
|
47254
|
-
* up to twelve hours, from the site's coordinates;
|
|
47255
|
-
* - `date` — one local date and time (`2026-12-24T18:00`), once.
|
|
47256
|
-
*
|
|
47257
|
-
* A site is a place and its IANA zone ({@link TimeSite}). Every function here
|
|
47258
|
-
* is pure: the zone arithmetic uses `Intl`, no date library.
|
|
47259
|
-
*
|
|
47260
|
-
* Wall-clock honesty across a DST change: a local time that does not exist
|
|
47261
|
-
* (02:30 on the spring-forward day) happens at the first minute that does
|
|
47262
|
-
* (03:00); one that happens twice (02:30 on the fall-back day) happens at its
|
|
47263
|
-
* FIRST occurrence.
|
|
47264
|
-
*/
|
|
47265
|
-
var SunEventSchema = _enum([
|
|
47266
|
-
"sunrise",
|
|
47267
|
-
"sunset",
|
|
47268
|
-
"dawn",
|
|
47269
|
-
"dusk"
|
|
47270
|
-
]);
|
|
47271
|
-
var TimeSpecSchema = discriminatedUnion("kind", [
|
|
47272
|
-
object({
|
|
47273
|
-
kind: literal("clock"),
|
|
47274
|
-
hh: number$1().int().min(0).max(23),
|
|
47275
|
-
mm: number$1().int().min(0).max(59)
|
|
47276
|
-
}),
|
|
47277
|
-
object({
|
|
47278
|
-
kind: literal("sun"),
|
|
47279
|
-
event: SunEventSchema,
|
|
47280
|
-
/** Minutes after the event (negative: before). */
|
|
47281
|
-
offsetMin: number$1().int().min(-720).max(720)
|
|
47282
|
-
}),
|
|
47283
|
-
object({
|
|
47284
|
-
kind: literal("date"),
|
|
47285
|
-
/** `YYYY-MM-DDTHH:mm`, site-local. */
|
|
47286
|
-
local: string().regex(/^(\d{4}-\d{2}-\d{2})T([01]\d|2[0-3]):([0-5]\d)$/, "expected YYYY-MM-DDTHH:mm")
|
|
47287
|
-
})
|
|
47288
|
-
]);
|
|
47289
|
-
/** A day of the week as a schedule names it. */
|
|
47290
|
-
var WeekdayKeySchema = _enum([
|
|
47291
|
-
"mon",
|
|
47292
|
-
"tue",
|
|
47293
|
-
"wed",
|
|
47294
|
-
"thu",
|
|
47295
|
-
"fri",
|
|
47296
|
-
"sat",
|
|
47297
|
-
"sun"
|
|
47298
|
-
]);
|
|
47299
47236
|
/**
|
|
47300
47237
|
* Hold semantics — "for N seconds" on a leaf of the `when` tree (#498).
|
|
47301
47238
|
*
|
|
@@ -47552,24 +47489,33 @@ var StationaryPresentLeafSchema = object({
|
|
|
47552
47489
|
* (`kind: 'date'`) is refused: only a clock time or a sun event makes a window
|
|
47553
47490
|
* that repeats every day.
|
|
47554
47491
|
*/
|
|
47555
|
-
var
|
|
47556
|
-
kind: literal("time-is"),
|
|
47492
|
+
var timeIsWindowShape = {
|
|
47557
47493
|
between: object({
|
|
47558
47494
|
from: TimeSpecSchema,
|
|
47559
47495
|
to: TimeSpecSchema
|
|
47560
47496
|
}).optional(),
|
|
47561
47497
|
days: array(WeekdayKeySchema).min(1).max(7).optional()
|
|
47562
|
-
}
|
|
47563
|
-
|
|
47498
|
+
};
|
|
47499
|
+
function timeIsWindowProblems(window, ctx) {
|
|
47500
|
+
if (window.between === void 0 && window.days === void 0) ctx.addIssue({
|
|
47564
47501
|
code: "custom",
|
|
47565
47502
|
message: "a time-is leaf needs a between window, days, or both"
|
|
47566
47503
|
});
|
|
47567
|
-
for (const end of ["from", "to"]) if (
|
|
47504
|
+
for (const end of ["from", "to"]) if (window.between?.[end].kind === "date") ctx.addIssue({
|
|
47568
47505
|
code: "custom",
|
|
47569
47506
|
message: "a one-date time cannot bound a daily window: use a clock time or a sun event",
|
|
47570
47507
|
path: ["between", end]
|
|
47571
47508
|
});
|
|
47572
|
-
}
|
|
47509
|
+
}
|
|
47510
|
+
/**
|
|
47511
|
+
* What a `time-is` leaf holds beside its kind, judged by the leaf's own rules.
|
|
47512
|
+
* A template's time-window input stores exactly this.
|
|
47513
|
+
*/
|
|
47514
|
+
var TimeIsWindowSchema = object(timeIsWindowShape).superRefine(timeIsWindowProblems);
|
|
47515
|
+
var TimeIsLeafSchema = object({
|
|
47516
|
+
kind: literal("time-is"),
|
|
47517
|
+
...timeIsWindowShape
|
|
47518
|
+
}).superRefine(timeIsWindowProblems);
|
|
47573
47519
|
/**
|
|
47574
47520
|
* True for the run that one of the named event leaves started. It reads the
|
|
47575
47521
|
* run, not a device: in the tree it is judged against the leaf that fired, in
|
|
@@ -47777,6 +47723,79 @@ function validateWhenTree(when) {
|
|
|
47777
47723
|
return null;
|
|
47778
47724
|
}
|
|
47779
47725
|
/**
|
|
47726
|
+
* The link an automation made FROM a template carries (#527): which template,
|
|
47727
|
+
* the values the operator filled in, and — when the template has since changed
|
|
47728
|
+
* so that those values no longer fit — the problems that say why.
|
|
47729
|
+
*
|
|
47730
|
+
* It lives inside the recipe (`AutomationRecipe.template`), so the one row in
|
|
47731
|
+
* `core_blocks` stays the one artefact: there is no second store of instances
|
|
47732
|
+
* to drift from the blocks, and deleting the automation deletes the link.
|
|
47733
|
+
* "Convert to a free automation" is dropping this field.
|
|
47734
|
+
*
|
|
47735
|
+
* This file depends on nothing in `recipe.ts`, so the recipe can embed it and
|
|
47736
|
+
* the template engine (`template/automation-template.ts`) can import both.
|
|
47737
|
+
*/
|
|
47738
|
+
/** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
|
|
47739
|
+
var TemplateEventValueSchema = object({
|
|
47740
|
+
eventIds: array(string().min(1)).min(1).max(64).optional(),
|
|
47741
|
+
sourceIds: array(string().min(1)).min(1).max(64).optional(),
|
|
47742
|
+
kinds: array(EventVocabularyKindSchema).min(1).optional()
|
|
47743
|
+
}).refine((value) => value.eventIds !== void 0 || value.sourceIds !== void 0 || value.kinds !== void 0, { message: "an event names at least one event, part or kind" });
|
|
47744
|
+
/** An `action` input's value: a vocabulary action and its open args. */
|
|
47745
|
+
var TemplateActionValueSchema = object({
|
|
47746
|
+
actionId: string().min(1),
|
|
47747
|
+
args: record(string(), unknown()).optional()
|
|
47748
|
+
});
|
|
47749
|
+
/**
|
|
47750
|
+
* A `time-window` input's value: what a `time-is` leaf holds beside its kind.
|
|
47751
|
+
* "No limit" is the input left without a value, never an empty object.
|
|
47752
|
+
*/
|
|
47753
|
+
var TemplateTimeWindowValueSchema = TimeIsWindowSchema;
|
|
47754
|
+
var TemplateEntriesValueSchema = array(record(string(), unknown()));
|
|
47755
|
+
/** The value of one non-group input. Which member is right is the input kind's to judge. */
|
|
47756
|
+
var TemplateScalarValueSchema = union([
|
|
47757
|
+
number$1(),
|
|
47758
|
+
string(),
|
|
47759
|
+
boolean(),
|
|
47760
|
+
array(number$1().int().nonnegative()),
|
|
47761
|
+
TemplateEventValueSchema,
|
|
47762
|
+
TemplateActionValueSchema,
|
|
47763
|
+
TemplateTimeWindowValueSchema,
|
|
47764
|
+
TemplateEntriesValueSchema
|
|
47765
|
+
]);
|
|
47766
|
+
/** What a group row holds under one key: a value, or the rows of a group it nests. */
|
|
47767
|
+
var TemplateRowValueSchema = union([TemplateScalarValueSchema, array(record(string(), TemplateScalarValueSchema))]);
|
|
47768
|
+
var TemplateInputValueSchema = union([TemplateScalarValueSchema, array(record(string(), TemplateRowValueSchema))]);
|
|
47769
|
+
/** Input key → value. */
|
|
47770
|
+
var TemplateInputValuesSchema = record(string(), TemplateInputValueSchema);
|
|
47771
|
+
var TemplateInstanceProblemSchema = object({
|
|
47772
|
+
code: _enum([
|
|
47773
|
+
"missing-input",
|
|
47774
|
+
"invalid-input",
|
|
47775
|
+
"invalid-recipe",
|
|
47776
|
+
"missing-template",
|
|
47777
|
+
"edited-by-hand"
|
|
47778
|
+
]),
|
|
47779
|
+
/** Dotted input address (`buttons.2.targets`, `buttons.0.commands.1.targets`); absent for a whole-recipe problem. */
|
|
47780
|
+
input: string().optional(),
|
|
47781
|
+
detail: string()
|
|
47782
|
+
});
|
|
47783
|
+
var AutomationTemplateLinkSchema = object({
|
|
47784
|
+
templateId: string().min(1),
|
|
47785
|
+
values: TemplateInputValuesSchema,
|
|
47786
|
+
/**
|
|
47787
|
+
* Fingerprint of the generated code with this literal blanked
|
|
47788
|
+
* (`instanceCodeHash`), stamped by `generateAutomationBlock`. Code that no
|
|
47789
|
+
* longer matches it was edited by hand, and is never regenerated over.
|
|
47790
|
+
*/
|
|
47791
|
+
codeHash: string().optional(),
|
|
47792
|
+
/**
|
|
47793
|
+
* Present when the last re-expansion refused these values. The automation
|
|
47794
|
+
* keeps running the body of its last good expansion; nothing is dropped.
|
|
47795
|
+
*/
|
|
47796
|
+
problems: array(TemplateInstanceProblemSchema).min(1).optional()
|
|
47797
|
+
});
|
|
47798
|
+
/**
|
|
47780
47799
|
* The recipe shape before the single `when` tree: a flat list of triggers
|
|
47781
47800
|
* (OR'd, each an instant) and an optional condition tree. Stored recipes —
|
|
47782
47801
|
* the `AUTOMATION_RECIPE` literal of every block saved so far, and whatever an
|
|
@@ -82838,31 +82857,57 @@ var TemplateSelectOptionSchema = object({
|
|
|
82838
82857
|
value: string().min(1),
|
|
82839
82858
|
label: string().min(1).max(80)
|
|
82840
82859
|
});
|
|
82860
|
+
var SelectInputSchema = object({
|
|
82861
|
+
kind: literal("select"),
|
|
82862
|
+
...inputBase,
|
|
82863
|
+
options: array(TemplateSelectOptionSchema).min(1).max(50),
|
|
82864
|
+
default: string().optional()
|
|
82865
|
+
});
|
|
82866
|
+
var BooleanInputSchema = object({
|
|
82867
|
+
kind: literal("boolean"),
|
|
82868
|
+
...inputBase,
|
|
82869
|
+
default: boolean().optional()
|
|
82870
|
+
});
|
|
82871
|
+
/** A limit on when the automation may run; only a `gate` binding reads it. */
|
|
82872
|
+
var TimeWindowInputSchema = object({
|
|
82873
|
+
kind: literal("time-window"),
|
|
82874
|
+
...inputBase
|
|
82875
|
+
});
|
|
82841
82876
|
var TemplateScalarInputSchema = discriminatedUnion("kind", [
|
|
82877
|
+
object({
|
|
82878
|
+
kind: literal("entries"),
|
|
82879
|
+
...inputBase,
|
|
82880
|
+
entry: _enum(["trigger", "step"]),
|
|
82881
|
+
allow: array(string().min(1)).min(1).max(10),
|
|
82882
|
+
maxItems: number$1().int().min(1).max(20).optional()
|
|
82883
|
+
}),
|
|
82842
82884
|
DeviceInputSchema,
|
|
82843
82885
|
EventInputSchema,
|
|
82844
82886
|
ActionInputSchema$1,
|
|
82845
82887
|
NumberInputSchema,
|
|
82846
82888
|
DurationInputSchema,
|
|
82847
82889
|
TextInputSchema,
|
|
82848
|
-
|
|
82849
|
-
|
|
82850
|
-
|
|
82851
|
-
options: array(TemplateSelectOptionSchema).min(1).max(50),
|
|
82852
|
-
default: string().optional()
|
|
82853
|
-
}),
|
|
82854
|
-
object({
|
|
82855
|
-
kind: literal("boolean"),
|
|
82856
|
-
...inputBase,
|
|
82857
|
-
default: boolean().optional()
|
|
82858
|
-
})
|
|
82890
|
+
SelectInputSchema,
|
|
82891
|
+
BooleanInputSchema,
|
|
82892
|
+
TimeWindowInputSchema
|
|
82859
82893
|
]);
|
|
82860
|
-
var
|
|
82894
|
+
var groupBase = {
|
|
82861
82895
|
kind: literal("group"),
|
|
82862
82896
|
...inputBase,
|
|
82863
|
-
|
|
82897
|
+
/** What one row is, in the singular and lower case ("button"): "Add button". */
|
|
82898
|
+
rowLabel: string().min(1).max(40).optional(),
|
|
82864
82899
|
minRows: number$1().int().min(0).max(20).optional(),
|
|
82865
82900
|
maxRows: number$1().int().min(1).max(20).optional()
|
|
82901
|
+
};
|
|
82902
|
+
/** A group inside a group row: its rows hold values only, never another group. */
|
|
82903
|
+
var NestedGroupInputSchema = object({
|
|
82904
|
+
...groupBase,
|
|
82905
|
+
inputs: array(TemplateScalarInputSchema).min(1).max(10)
|
|
82906
|
+
});
|
|
82907
|
+
var TemplateRowInputSchema = discriminatedUnion("kind", [...TemplateScalarInputSchema.options, NestedGroupInputSchema]);
|
|
82908
|
+
var GroupInputSchema = object({
|
|
82909
|
+
...groupBase,
|
|
82910
|
+
inputs: array(TemplateRowInputSchema).min(1).max(10)
|
|
82866
82911
|
});
|
|
82867
82912
|
var TemplateInputSchema = discriminatedUnion("kind", [...TemplateScalarInputSchema.options, GroupInputSchema]);
|
|
82868
82913
|
var TemplatePathSchema = array(union([string().min(1), number$1().int().nonnegative()])).max(24);
|
|
@@ -82873,41 +82918,154 @@ var TemplateValueBindingSchema = object({
|
|
|
82873
82918
|
/** A device value written as a step target (`{ kind: 'devices', ids }`). */
|
|
82874
82919
|
as: literal("target").optional()
|
|
82875
82920
|
});
|
|
82876
|
-
var
|
|
82921
|
+
var TemplateRowIdBindingSchema = object({
|
|
82877
82922
|
kind: literal("row-id"),
|
|
82878
82923
|
path: TemplatePathSchema
|
|
82879
|
-
})
|
|
82880
|
-
|
|
82881
|
-
|
|
82924
|
+
});
|
|
82925
|
+
/**
|
|
82926
|
+
* Appends an `entries` input's elements, verbatim, to the list at `path`. In a
|
|
82927
|
+
* row's bindings `input` is the row's own entries input and `path` is from the
|
|
82928
|
+
* row's item; at the top level, with `in`, it appends the `input` entries of
|
|
82929
|
+
* EVERY row of the group `in` (all buttons' triggers into one `when`), and
|
|
82930
|
+
* without `in` it appends a top-level entries input.
|
|
82931
|
+
*/
|
|
82932
|
+
var TemplateEntriesBindingSchema = object({
|
|
82933
|
+
kind: literal("entries"),
|
|
82882
82934
|
input: inputKey,
|
|
82883
|
-
/** The list in the body the rows are appended to. */
|
|
82884
82935
|
path: TemplatePathSchema,
|
|
82885
|
-
|
|
82886
|
-
|
|
82887
|
-
|
|
82888
|
-
|
|
82889
|
-
|
|
82890
|
-
|
|
82891
|
-
|
|
82892
|
-
|
|
82893
|
-
|
|
82936
|
+
in: inputKey.optional()
|
|
82937
|
+
});
|
|
82938
|
+
/** What fills the item of a row that holds values only. */
|
|
82939
|
+
var TemplateLeafRowBindingSchema = discriminatedUnion("kind", [TemplateValueBindingSchema, TemplateRowIdBindingSchema]);
|
|
82940
|
+
var TemplateRowItemBindingSchema = discriminatedUnion("kind", [
|
|
82941
|
+
TemplateValueBindingSchema,
|
|
82942
|
+
TemplateEntriesBindingSchema,
|
|
82943
|
+
TemplateRowIdBindingSchema,
|
|
82944
|
+
object({
|
|
82945
|
+
kind: literal("row-ids"),
|
|
82946
|
+
/** The nested group whose rows are named. */
|
|
82947
|
+
input: inputKey,
|
|
82948
|
+
path: TemplatePathSchema
|
|
82949
|
+
}),
|
|
82950
|
+
object({
|
|
82951
|
+
kind: literal("rows"),
|
|
82952
|
+
/** The nested group, declared by the parent row's group. */
|
|
82953
|
+
input: inputKey,
|
|
82954
|
+
/** The list the nested rows are appended to, from the parent row's item. */
|
|
82955
|
+
path: TemplatePathSchema,
|
|
82956
|
+
item: unknown(),
|
|
82957
|
+
bindings: array(TemplateLeafRowBindingSchema).max(40)
|
|
82958
|
+
})
|
|
82959
|
+
]);
|
|
82960
|
+
var TemplateBindingSchema = discriminatedUnion("kind", [
|
|
82961
|
+
TemplateValueBindingSchema,
|
|
82962
|
+
TemplateEntriesBindingSchema,
|
|
82963
|
+
object({
|
|
82964
|
+
kind: literal("rows"),
|
|
82965
|
+
input: inputKey,
|
|
82966
|
+
/**
|
|
82967
|
+
* A group the rows of `input` hold: the binding then appends one item per
|
|
82968
|
+
* NESTED row of every row, and its bindings read the nested row.
|
|
82969
|
+
*/
|
|
82970
|
+
nested: inputKey.optional(),
|
|
82971
|
+
/** The list in the body the rows are appended to. */
|
|
82972
|
+
path: TemplatePathSchema,
|
|
82973
|
+
/** The JSON copied once per row. */
|
|
82974
|
+
item: unknown(),
|
|
82975
|
+
bindings: array(TemplateRowItemBindingSchema).max(40)
|
|
82976
|
+
}),
|
|
82977
|
+
object({
|
|
82978
|
+
kind: literal("gate"),
|
|
82979
|
+
/** A top-level `time-window` input. */
|
|
82980
|
+
input: inputKey,
|
|
82981
|
+
path: TemplatePathSchema
|
|
82982
|
+
})
|
|
82983
|
+
]);
|
|
82984
|
+
/** Twice-declared keys and event / action inputs that read no device beside them. */
|
|
82985
|
+
function levelProblems(inputs, path, inRow = false) {
|
|
82986
|
+
const issues = [];
|
|
82987
|
+
const seen = /* @__PURE__ */ new Set();
|
|
82988
|
+
for (const input of inputs) {
|
|
82989
|
+
if (seen.has(input.key)) issues.push({
|
|
82894
82990
|
message: `input "${input.key}" is declared twice`,
|
|
82895
|
-
path
|
|
82991
|
+
path
|
|
82896
82992
|
});
|
|
82897
|
-
|
|
82898
|
-
|
|
82899
|
-
|
|
82900
|
-
|
|
82901
|
-
|
|
82902
|
-
|
|
82903
|
-
|
|
82904
|
-
|
|
82905
|
-
|
|
82906
|
-
|
|
82907
|
-
|
|
82993
|
+
seen.add(input.key);
|
|
82994
|
+
if (input.kind === "group") {
|
|
82995
|
+
issues.push(...levelProblems(input.inputs, path, true));
|
|
82996
|
+
continue;
|
|
82997
|
+
}
|
|
82998
|
+
if (input.kind === "time-window" && inRow) issues.push({
|
|
82999
|
+
message: `time window "${input.key}" limits the whole automation: it is not a row input`,
|
|
83000
|
+
path
|
|
83001
|
+
});
|
|
83002
|
+
if (input.kind !== "event" && input.kind !== "action") continue;
|
|
83003
|
+
if (input.deviceInput === void 0) continue;
|
|
83004
|
+
const device = inputs.find((sibling) => sibling.key === input.deviceInput);
|
|
83005
|
+
if (device === void 0 || device.kind !== "device") issues.push({
|
|
83006
|
+
message: `"${input.key}" reads the device input "${input.deviceInput}", which is not a device input beside it`,
|
|
83007
|
+
path
|
|
83008
|
+
});
|
|
83009
|
+
}
|
|
83010
|
+
return issues;
|
|
83011
|
+
}
|
|
83012
|
+
function nestedGroupOf(group, key) {
|
|
83013
|
+
const found = group.inputs.find((input) => input.key === key);
|
|
83014
|
+
return found !== void 0 && found.kind === "group" ? found : void 0;
|
|
83015
|
+
}
|
|
83016
|
+
function leafBindingProblems(bindings, owner) {
|
|
83017
|
+
const issues = [];
|
|
83018
|
+
for (const row of bindings) {
|
|
83019
|
+
if (row.kind === "row-id") continue;
|
|
83020
|
+
if (row.kind === "value") {
|
|
83021
|
+
const input = owner.inputs.find((i) => i.key === row.input);
|
|
83022
|
+
if (input === void 0) issues.push(`row binding names "${row.input}", which group "${owner.key}" does not declare`);
|
|
83023
|
+
else if (input.kind === "group") issues.push(`group "${input.key}" is bound with rows, not a value`);
|
|
83024
|
+
else if (input.kind === "entries") issues.push(`entries "${input.key}" are bound with entries, not a value`);
|
|
83025
|
+
continue;
|
|
83026
|
+
}
|
|
83027
|
+
const nested = owner.inputs.find((i) => i.key === row.input);
|
|
83028
|
+
if (row.kind === "entries") {
|
|
83029
|
+
if (nested === void 0 || nested.kind !== "entries") issues.push(`"${row.input}" is not an entries input inside "${owner.key}"`);
|
|
83030
|
+
continue;
|
|
82908
83031
|
}
|
|
83032
|
+
if (row.kind === "row-ids") {
|
|
83033
|
+
if (nested === void 0 || nested.kind !== "group" && nested.kind !== "entries") issues.push(`"${row.input}" is not a group or entries input inside "${owner.key}"`);
|
|
83034
|
+
continue;
|
|
83035
|
+
}
|
|
83036
|
+
if (nested === void 0 || nested.kind !== "group") {
|
|
83037
|
+
issues.push(`"${row.input}" is not a group inside "${owner.key}"`);
|
|
83038
|
+
continue;
|
|
83039
|
+
}
|
|
83040
|
+
issues.push(...leafBindingProblems(row.bindings, nested));
|
|
83041
|
+
}
|
|
83042
|
+
return issues;
|
|
83043
|
+
}
|
|
83044
|
+
function rowsBindingProblems(binding, group) {
|
|
83045
|
+
if (binding.nested === void 0) return leafBindingProblems(binding.bindings, group);
|
|
83046
|
+
const nested = nestedGroupOf(group, binding.nested);
|
|
83047
|
+
if (nested === void 0) return [`"${binding.nested}" is not a group inside "${group.key}"`];
|
|
83048
|
+
return leafBindingProblems(binding.bindings, nested);
|
|
83049
|
+
}
|
|
83050
|
+
function bindingProblems(payload, ctx) {
|
|
83051
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
83052
|
+
for (const input of payload.inputs) byKey.set(input.key, input);
|
|
83053
|
+
for (const issue of levelProblems(payload.inputs, ["inputs"])) ctx.addIssue({
|
|
83054
|
+
code: "custom",
|
|
83055
|
+
message: issue.message,
|
|
83056
|
+
path: [...issue.path]
|
|
82909
83057
|
});
|
|
82910
83058
|
payload.bindings.forEach((binding, index) => {
|
|
83059
|
+
if (binding.kind === "entries" && binding.in !== void 0) {
|
|
83060
|
+
const group = byKey.get(binding.in);
|
|
83061
|
+
const entries = group !== void 0 && group.kind === "group" ? group.inputs.find((i) => i.key === binding.input) : void 0;
|
|
83062
|
+
if (entries === void 0 || entries.kind !== "entries") ctx.addIssue({
|
|
83063
|
+
code: "custom",
|
|
83064
|
+
message: `"${binding.input}" is not an entries input inside the group "${binding.in}"`,
|
|
83065
|
+
path: ["bindings", index]
|
|
83066
|
+
});
|
|
83067
|
+
return;
|
|
83068
|
+
}
|
|
82911
83069
|
const input = byKey.get(binding.input);
|
|
82912
83070
|
if (input === void 0) {
|
|
82913
83071
|
ctx.addIssue({
|
|
@@ -82922,6 +83080,18 @@ function bindingProblems(payload, ctx) {
|
|
|
82922
83080
|
message: `group "${input.key}" is bound with rows, not a value`,
|
|
82923
83081
|
path: ["bindings", index]
|
|
82924
83082
|
});
|
|
83083
|
+
if (binding.kind === "entries" !== (input.kind === "entries") && binding.kind !== "rows") {
|
|
83084
|
+
if (binding.kind === "entries" || binding.kind === "value") ctx.addIssue({
|
|
83085
|
+
code: "custom",
|
|
83086
|
+
message: binding.kind === "entries" ? `entries bindings read an entries input: "${input.key}" is ${input.kind}` : `entries "${input.key}" are bound with entries, not a value`,
|
|
83087
|
+
path: ["bindings", index]
|
|
83088
|
+
});
|
|
83089
|
+
}
|
|
83090
|
+
if (binding.kind === "gate" !== (input.kind === "time-window")) ctx.addIssue({
|
|
83091
|
+
code: "custom",
|
|
83092
|
+
message: `a gate reads a time window and a time window is bound with a gate: "${input.key}" is ${input.kind}`,
|
|
83093
|
+
path: ["bindings", index]
|
|
83094
|
+
});
|
|
82925
83095
|
if (binding.kind === "rows") {
|
|
82926
83096
|
if (input.kind !== "group") {
|
|
82927
83097
|
ctx.addIssue({
|
|
@@ -82931,9 +83101,9 @@ function bindingProblems(payload, ctx) {
|
|
|
82931
83101
|
});
|
|
82932
83102
|
return;
|
|
82933
83103
|
}
|
|
82934
|
-
for (const
|
|
83104
|
+
for (const message of rowsBindingProblems(binding, input)) ctx.addIssue({
|
|
82935
83105
|
code: "custom",
|
|
82936
|
-
message
|
|
83106
|
+
message,
|
|
82937
83107
|
path: ["bindings", index]
|
|
82938
83108
|
});
|
|
82939
83109
|
}
|
|
@@ -103419,7 +103589,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
103419
103589
|
capability: adminUiCapability,
|
|
103420
103590
|
provider: {
|
|
103421
103591
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
103422
|
-
getVersion: async () => ({ version: "1.2.
|
|
103592
|
+
getVersion: async () => ({ version: "1.2.668" })
|
|
103423
103593
|
}
|
|
103424
103594
|
}];
|
|
103425
103595
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-admin-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.668",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Admin UI — Vite frontend build and server-side addon",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
],
|
|
52
52
|
"requires": {
|
|
53
|
-
"server": ">=1.2.
|
|
53
|
+
"server": ">=1.2.867"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|