@camstack/types 1.2.363 → 1.2.365

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.
@@ -12,6 +12,12 @@ export interface TokenPayload {
12
12
  * the session is revoked or expired. A token without it predates sessions.
13
13
  */
14
14
  sid?: string;
15
+ /**
16
+ * The device credential (D855) whose certificate login opened this session.
17
+ * Informational for clients; the hub's authority is the session row, whose
18
+ * refresh re-checks the credential.
19
+ */
20
+ cid?: string;
15
21
  userId?: string;
16
22
  username?: string;
17
23
  /**
@@ -399,14 +399,13 @@ export interface ConfigColorField extends ConfigFieldBase {
399
399
  presets?: string[];
400
400
  }
401
401
  /**
402
- * An icon chosen from the shared display-icon vocabulary (D780) —
403
- * `DISPLAY_ICON_VOCABULARY` in `device/display-icon-vocabulary.ts`, the same
404
- * keys the device and room pickers store. The form renders the shared
405
- * `<IconPicker>`; the stored value is a vocabulary KEY, never a free-text
406
- * lucide name. `default` must itself be a vocabulary key: clearing the picker
407
- * writes it back, and a stored value outside the vocabulary (a pre-D780
408
- * free-text name) is drawn as the default — readers resolve it with
409
- * `resolveDisplayIconKey(value, default)`.
402
+ * An icon chosen from the icon catalog (D780, D854) — `ICON_KEYS` in
403
+ * `device/icon-catalog.ts`, the same keys the device and room pickers store.
404
+ * The form renders the shared `<IconPicker>`; the stored value is a catalog
405
+ * KEY, never a free-text lucide name. `default` must itself be a catalog key:
406
+ * clearing the picker writes it back, and a stored value outside the catalog (a
407
+ * pre-D780 free-text name) is drawn as the default — readers resolve it with
408
+ * `resolveIconKey(value, default)`.
410
409
  *
411
410
  * COMPILE-TIME ONLY on the wire (`z.custom<ConfigField>()`): a form that
412
411
  * predates this type renders it through its default branch.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.363",
3
+ "version": "1.2.365",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1,113 +0,0 @@
1
- /**
2
- * display-icon-vocabulary — the icon KEYS both UIs share, and the search that
3
- * finds one.
4
- *
5
- * The reason this is here and not in a UI package is the one
6
- * `location-icon.ts` already states for the location vocabulary: two surfaces
7
- * draw these icons and they do NOT share an icon module. The admin UI imports
8
- * `lucide-react`; the viewer imports a hand-maintained per-icon allowlist
9
- * (`src/lib/icons.ts`, re-exporting `lucide-react-native/icons/*` because the
10
- * barrel is 47 % of that app's modules). Anything shared between them must
11
- * therefore be STRINGS, and this module contains no React, no lucide, and no
12
- * glyph.
13
- *
14
- * So the layering is:
15
- *
16
- * | layer | lives in | holds |
17
- * | --- | --- | --- |
18
- * | vocabulary + search | here | keys, groups, synonyms, scoring |
19
- * | glyph table (web) | `ui-library`'s `DISPLAY_ICON_REGISTRY` | key → lucide-react |
20
- * | glyph table (phone) | viewer's accessory icon map | key → lucide-react-native |
21
- *
22
- * Each glyph table must cover exactly these keys, and a test on each side
23
- * pins that. A key offered on one surface and missing on the other falls
24
- * through to the next precedence level there, which the operator reads as "my
25
- * change did nothing" — the failure this vocabulary exists to make impossible.
26
- *
27
- * {@link LOCATION_ICON_IDS} is a SUBSET of these keys, pinned by a test. Two
28
- * icon vocabularies on the same two surfaces with different members is the
29
- * same bug wearing a different name — `briefcase` and `route` are here only
30
- * because locations already draw them.
31
- *
32
- * ## Synonyms, and why they are bilingual
33
- *
34
- * The keys are English lucide ids and always will be: they name the DRAWING,
35
- * mechanically checkable against a package, not the room. But the operator
36
- * searching this list types Italian — "tapparella", not "blinds". A picker
37
- * whose search only matches the key would make three quarters of the
38
- * vocabulary unreachable to them.
39
- *
40
- * So every entry carries the words it answers to, in both languages. They are
41
- * deliberately not translations of a label: they are the words somebody would
42
- * actually type looking for that picture, including the wrong-but-obvious
43
- * ones (`blinds` answers to `persiana` and `serranda` too).
44
- */
45
- /** What an operator is naming when they pick from this group. */
46
- export type DisplayIconGroup = 'device' | 'lighting' | 'sensing' | 'place' | 'life';
47
- /** The order the groups are offered in, and the only members there are. */
48
- export declare const DISPLAY_ICON_GROUPS: readonly DisplayIconGroup[];
49
- /** One icon in the shared vocabulary. */
50
- export interface DisplayIconEntry {
51
- /** The kebab-case lucide id. This is the value that is PERSISTED. */
52
- readonly key: string;
53
- readonly group: DisplayIconGroup;
54
- /**
55
- * Words this icon answers to in search, English and Italian. Never
56
- * rendered — a caller that wants a label supplies its own translation.
57
- */
58
- readonly synonyms: readonly string[];
59
- /**
60
- * The key this one is a deprecated spelling OF, drawing the same picture.
61
- *
62
- * An alias must keep RESOLVING — rows have it persisted — but it must not
63
- * be OFFERED: a second, identical tile lets an operator newly choose the
64
- * spelling we are trying to retire, and gives them no way to tell the two
65
- * apart. So `searchDisplayIcons` skips aliases and `displayIconEntry` does
66
- * not.
67
- */
68
- readonly aliasOf?: string;
69
- }
70
- /**
71
- * The vocabulary, in the order a picker offers it.
72
- *
73
- * Adding a key here is not enough to make it pickable: both glyph tables must
74
- * gain it too, and their tests fail until they do. That is the intended
75
- * friction — it is the only thing that keeps the two surfaces honest.
76
- */
77
- export declare const DISPLAY_ICON_VOCABULARY: readonly DisplayIconEntry[];
78
- /** Every key, in vocabulary order — aliases included, because they resolve. */
79
- export declare const DISPLAY_ICON_KEYS: readonly string[];
80
- /** The keys a picker OFFERS: everything that is not a deprecated spelling. */
81
- export declare const DISPLAY_ICON_OFFERED_KEYS: readonly string[];
82
- /** Is this a key of the shared vocabulary? */
83
- export declare function isDisplayIconKey(value: unknown): boolean;
84
- /**
85
- * A stored icon value as a vocabulary key: `value` when it IS one, `fallback`
86
- * otherwise. For an `icon` settings field (D780) whose stored value may
87
- * predate the vocabulary (a free-text lucide name) — the field's default is
88
- * drawn rather than nothing.
89
- */
90
- export declare function resolveDisplayIconKey(value: unknown, fallback: string): string;
91
- /** The entry for a key, or `undefined` — never a guessed one. */
92
- export declare function displayIconEntry(key: string): DisplayIconEntry | undefined;
93
- /** The entries of one group, in vocabulary order. */
94
- export declare function displayIconsInGroup(group: DisplayIconGroup): readonly DisplayIconEntry[];
95
- /** One search result: the entry, and how strongly it matched. */
96
- export interface DisplayIconHit {
97
- readonly entry: DisplayIconEntry;
98
- readonly score: number;
99
- }
100
- /**
101
- * Rank the vocabulary against a free-text query.
102
- *
103
- * An empty query returns the WHOLE vocabulary in its declared order, because
104
- * a picker's resting state is the full list, not an empty one.
105
- *
106
- * `extraWords` lets a caller add the words IT can translate — a localised
107
- * device-role label, say — without this module knowing what a locale is.
108
- * They score exactly like a synonym.
109
- *
110
- * Ties keep vocabulary order: a search that reshuffles equally-good results
111
- * between two keystrokes makes the list unusable.
112
- */
113
- export declare function searchDisplayIcons(query: string, extraWords?: ReadonlyMap<string, readonly string[]>): readonly DisplayIconHit[];