@7365admin1/core 3.51.1-staging.225 → 3.51.1-staging.226
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/.changeset/site-camera-direction-valid.md +15 -0
- package/dist/index.js +40 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/site-camera-direction.test.mjs +109 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Constrain a site camera's `direction` to a fixed set instead of accepting any string.
|
|
6
|
+
|
|
7
|
+
`Joi.string().allow("entry", "exit", "both", "none")` reads like a whitelist but is not one — on a
|
|
8
|
+
validator that already accepts every non-empty string, `.allow()` only adds permitted values, so the
|
|
9
|
+
field rejected nothing. It is now `.valid()`.
|
|
10
|
+
|
|
11
|
+
The accepted set is `entry | exit | both | none | visitors | residents`: the four values the staging
|
|
12
|
+
collection actually holds (measured read-only across all 22 rows), plus the two extra options
|
|
13
|
+
layer-common's live `CameraForm.vue` offers for ANPR cameras. No stored camera and no reachable form
|
|
14
|
+
is refused. Whether `visitors` and `residents` are directions at all is a product question; dropping
|
|
15
|
+
them later is a zero-row migration.
|
package/dist/index.js
CHANGED
|
@@ -19414,14 +19414,47 @@ var schemaUpdateSiteCamera = import_joi20.default.object({
|
|
|
19414
19414
|
* write callers in the estate (layer-common `CameraForm.vue` and
|
|
19415
19415
|
* `iservice365-mobile-app-security`) offer exactly those values.
|
|
19416
19416
|
*
|
|
19417
|
-
* `direction` is
|
|
19418
|
-
*
|
|
19419
|
-
*
|
|
19420
|
-
*
|
|
19417
|
+
* `direction` is now `.valid()` too, but over a WIDER set than the intended
|
|
19418
|
+
* one - deliberately, because tightening to the intended set alone would
|
|
19419
|
+
* break a live form.
|
|
19420
|
+
*
|
|
19421
|
+
* Measured read-only on the staging `site.cameras` collection on 2026-08-28,
|
|
19422
|
+
* all 22 rows, no nulls and no missing field:
|
|
19423
|
+
*
|
|
19424
|
+
* none 13 (all type:ip) both 6 (4 anpr, 2 ip) entry 2 (anpr) exit 1 (anpr)
|
|
19425
|
+
*
|
|
19426
|
+
* So every stored value is inside `entry|exit|both|none` and no real row
|
|
19427
|
+
* would be rejected by the narrow set. The write callers are the problem, not
|
|
19428
|
+
* the data. Swept by path across the org, not by credential:
|
|
19429
|
+
*
|
|
19430
|
+
* - layer-common `CameraForm.vue` (LIVE, the camera add/edit form) offers
|
|
19431
|
+
* five ANPR options: entry, exit, both, **visitors**, **residents**. The
|
|
19432
|
+
* last two are outside the intended set and are held by 0 of 22 rows -
|
|
19433
|
+
* nobody has ever picked them - but the options are on screen today, so the
|
|
19434
|
+
* narrow set would turn two of five into a 400.
|
|
19435
|
+
* - `iservice365-web-app-security` `VehicleCameraSettingAdd.vue` offers a
|
|
19436
|
+
* third vocabulary entirely (approach, depart, both). It is an ORPHAN: the
|
|
19437
|
+
* string `VehicleCameraSetting` appears nowhere else in that repository on
|
|
19438
|
+
* `staging` or `main`, so no page or component can mount it and no user can
|
|
19439
|
+
* reach it. `approach`/`depart` are therefore NOT accepted here.
|
|
19440
|
+
* - the bulk import (`site-camera.controller.ts` `addBulk`) always writes
|
|
19441
|
+
* `direction: "none"`.
|
|
19442
|
+
*
|
|
19443
|
+
* So the set below is: what real data holds, plus what a reachable form can
|
|
19444
|
+
* actually send. That is still a genuine tightening - `.allow()` on a
|
|
19445
|
+
* `Joi.string()` accepts EVERY non-empty string, including a 10 MB one - and
|
|
19446
|
+
* it breaks nothing.
|
|
19447
|
+
*
|
|
19448
|
+
* **Follow-up for product:** are "visitors" and "residents" directions at
|
|
19449
|
+
* all, or lane designations that belong in a different field? If they should
|
|
19450
|
+
* not be offered, removing them from `CameraForm.vue` and dropping the two
|
|
19451
|
+
* entries here is a one-line change with a **zero-row** migration, because no
|
|
19452
|
+
* stored camera uses either. Until someone answers that, refusing them would
|
|
19453
|
+
* be breaking a form on a guess.
|
|
19421
19454
|
*/
|
|
19422
19455
|
category: import_joi20.default.string().valid("standard", "resident", "visitor").required(),
|
|
19423
19456
|
guardPost: import_joi20.default.number().integer().optional(),
|
|
19424
|
-
direction: import_joi20.default.string().optional().
|
|
19457
|
+
direction: import_joi20.default.string().optional().valid("entry", "exit", "both", "none", "visitors", "residents"),
|
|
19425
19458
|
status: import_joi20.default.string().optional().valid("active", "inactive", "deleted"),
|
|
19426
19459
|
name: import_joi20.default.string().optional().allow(null, "")
|
|
19427
19460
|
});
|
|
@@ -19455,9 +19488,9 @@ var schemaSiteCamera = import_joi20.default.object({
|
|
|
19455
19488
|
* today. Every client in the estate already sends the lower-case pair.
|
|
19456
19489
|
*/
|
|
19457
19490
|
type: import_joi20.default.string().trim().lowercase().valid("ip", "anpr").required(),
|
|
19458
|
-
/** See the note on `schemaUpdateSiteCamera` for
|
|
19491
|
+
/** See the note on `schemaUpdateSiteCamera` for the `direction` set and why it is wider than the intended one. */
|
|
19459
19492
|
category: import_joi20.default.string().valid("standard", "resident", "visitor").required(),
|
|
19460
|
-
direction: import_joi20.default.string().required().
|
|
19493
|
+
direction: import_joi20.default.string().required().valid("entry", "exit", "both", "none", "visitors", "residents"),
|
|
19461
19494
|
guardPost: import_joi20.default.number().integer().optional(),
|
|
19462
19495
|
status: import_joi20.default.string().optional().valid("active", "inactive", "deleted"),
|
|
19463
19496
|
name: import_joi20.default.string().optional().allow(null, ""),
|