@camstack/types 1.2.593 → 1.2.594
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 +11 -0
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/composer.cap.d.ts +9 -0
- package/dist/capabilities/core-blocks.cap.d.ts +64 -0
- package/dist/capabilities/device-manager.cap.d.ts +681 -48
- package/dist/capabilities/power-source.cap.d.ts +10 -0
- package/dist/client.js +5 -0
- package/dist/client.mjs +5 -0
- package/dist/composition/composition-report.d.ts +3 -0
- package/dist/composition/composition.d.ts +14 -0
- package/dist/composition/power-source-link.d.ts +8 -0
- package/dist/device/base-device.d.ts +8 -0
- package/dist/device/device-management.d.ts +4 -0
- package/dist/device/identity-links.d.ts +310 -0
- package/dist/device/index.d.ts +2 -0
- package/dist/enums/event-category.d.ts +14 -0
- package/dist/enums.js +1 -1
- package/dist/enums.mjs +1 -1
- package/dist/{event-category-CY27-fF0.mjs → event-category-7P4A3bYA.mjs} +14 -0
- package/dist/{event-category-BKxXXxnV.js → event-category-CMA0-jGW.js} +14 -0
- package/dist/generated/addon-api.d.ts +35 -0
- package/dist/generated/device-proxy.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +2 -2
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/{implemented-methods-k3KProJd.mjs → implemented-methods-DXeNAPAS.mjs} +11 -2
- package/dist/{implemented-methods-BarLh7tc.js → implemented-methods-Dj_2fX8-.js} +16 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +285 -12
- package/dist/index.mjs +270 -13
- package/dist/node.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/{sleep-BOK28JE0.js → sleep-Bgzv_TCG.js} +3 -1
- package/dist/{sleep-DO-ayTnk.mjs → sleep-C9eelFbV.mjs} +3 -1
- package/package.json +1 -1
|
@@ -32,6 +32,8 @@ export declare const POWER_SOURCE_OFF_SECONDS_MIN = 3;
|
|
|
32
32
|
export declare const POWER_SOURCE_OFF_SECONDS_MAX = 120;
|
|
33
33
|
export declare const POWER_SOURCE_OFF_SECONDS_DEFAULT = 10;
|
|
34
34
|
export declare const PowerSourceRefusalReasonSchema: z.ZodEnum<{
|
|
35
|
+
"link-lost": "link-lost";
|
|
36
|
+
"link-unknown": "link-unknown";
|
|
35
37
|
"no-power-source": "no-power-source";
|
|
36
38
|
"not-settable": "not-settable";
|
|
37
39
|
"restart-in-progress": "restart-in-progress";
|
|
@@ -48,6 +50,8 @@ export declare const PowerSourceActionResultSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
48
50
|
}, z.core.$strip>, z.ZodObject<{
|
|
49
51
|
accepted: z.ZodLiteral<false>;
|
|
50
52
|
reason: z.ZodEnum<{
|
|
53
|
+
"link-lost": "link-lost";
|
|
54
|
+
"link-unknown": "link-unknown";
|
|
51
55
|
"no-power-source": "no-power-source";
|
|
52
56
|
"not-settable": "not-settable";
|
|
53
57
|
"restart-in-progress": "restart-in-progress";
|
|
@@ -111,6 +115,8 @@ export declare const powerSourceCapability: {
|
|
|
111
115
|
}, z.core.$strip>, z.ZodObject<{
|
|
112
116
|
accepted: z.ZodLiteral<false>;
|
|
113
117
|
reason: z.ZodEnum<{
|
|
118
|
+
"link-lost": "link-lost";
|
|
119
|
+
"link-unknown": "link-unknown";
|
|
114
120
|
"no-power-source": "no-power-source";
|
|
115
121
|
"not-settable": "not-settable";
|
|
116
122
|
"restart-in-progress": "restart-in-progress";
|
|
@@ -132,6 +138,8 @@ export declare const powerSourceCapability: {
|
|
|
132
138
|
}, z.core.$strip>, z.ZodObject<{
|
|
133
139
|
accepted: z.ZodLiteral<false>;
|
|
134
140
|
reason: z.ZodEnum<{
|
|
141
|
+
"link-lost": "link-lost";
|
|
142
|
+
"link-unknown": "link-unknown";
|
|
135
143
|
"no-power-source": "no-power-source";
|
|
136
144
|
"not-settable": "not-settable";
|
|
137
145
|
"restart-in-progress": "restart-in-progress";
|
|
@@ -153,6 +161,8 @@ export declare const powerSourceCapability: {
|
|
|
153
161
|
}, z.core.$strip>, z.ZodObject<{
|
|
154
162
|
accepted: z.ZodLiteral<false>;
|
|
155
163
|
reason: z.ZodEnum<{
|
|
164
|
+
"link-lost": "link-lost";
|
|
165
|
+
"link-unknown": "link-unknown";
|
|
156
166
|
"no-power-source": "no-power-source";
|
|
157
167
|
"not-settable": "not-settable";
|
|
158
168
|
"restart-in-progress": "restart-in-progress";
|
package/dist/client.js
CHANGED
|
@@ -28338,6 +28338,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28338
28338
|
applyInitialMeta: (input, options) => dispatchSystem("deviceManager", "applyInitialMeta", "mutation", input, void 0, options),
|
|
28339
28339
|
setMetadata: (input, options) => dispatchSystem("deviceManager", "setMetadata", "mutation", input, void 0, options),
|
|
28340
28340
|
setIdentifiers: (input, options) => dispatchSystem("deviceManager", "setIdentifiers", "mutation", input, void 0, options),
|
|
28341
|
+
setAttachedIdentifiers: (input, options) => dispatchSystem("deviceManager", "setAttachedIdentifiers", "mutation", input, void 0, options),
|
|
28342
|
+
listIdentityLinks: (input, options) => dispatchSystem("deviceManager", "listIdentityLinks", "query", input, void 0, options),
|
|
28341
28343
|
setDisabled: (input, options) => dispatchSystem("deviceManager", "setDisabled", "mutation", input, void 0, options),
|
|
28342
28344
|
getDevice: (input, options) => dispatchSystem("deviceManager", "getDevice", "query", input, void 0, options),
|
|
28343
28345
|
getLinkedDevices: (input, options) => dispatchSystem("deviceManager", "getLinkedDevices", "query", input, void 0, options),
|
|
@@ -29589,6 +29591,9 @@ function createSystemProxy(api) {
|
|
|
29589
29591
|
getRoleDisplayDefaults: (input) => dispatch("deviceManager", "getRoleDisplayDefaults", "query", input),
|
|
29590
29592
|
setRoleDisplayDefaults: (input) => dispatch("deviceManager", "setRoleDisplayDefaults", "mutation", input),
|
|
29591
29593
|
listIdentityCandidates: (input) => dispatch("deviceManager", "listIdentityCandidates", "query", input),
|
|
29594
|
+
confirmIdentityLink: (input) => dispatch("deviceManager", "confirmIdentityLink", "mutation", input),
|
|
29595
|
+
dismissIdentityLink: (input) => dispatch("deviceManager", "dismissIdentityLink", "mutation", input),
|
|
29596
|
+
unlinkIdentity: (input) => dispatch("deviceManager", "unlinkIdentity", "mutation", input),
|
|
29592
29597
|
listLocations: (input) => dispatch("deviceManager", "listLocations", "query", input),
|
|
29593
29598
|
addLocation: (input) => dispatch("deviceManager", "addLocation", "mutation", input),
|
|
29594
29599
|
removeLocation: (input) => dispatch("deviceManager", "removeLocation", "mutation", input),
|
package/dist/client.mjs
CHANGED
|
@@ -28337,6 +28337,8 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28337
28337
|
applyInitialMeta: (input, options) => dispatchSystem("deviceManager", "applyInitialMeta", "mutation", input, void 0, options),
|
|
28338
28338
|
setMetadata: (input, options) => dispatchSystem("deviceManager", "setMetadata", "mutation", input, void 0, options),
|
|
28339
28339
|
setIdentifiers: (input, options) => dispatchSystem("deviceManager", "setIdentifiers", "mutation", input, void 0, options),
|
|
28340
|
+
setAttachedIdentifiers: (input, options) => dispatchSystem("deviceManager", "setAttachedIdentifiers", "mutation", input, void 0, options),
|
|
28341
|
+
listIdentityLinks: (input, options) => dispatchSystem("deviceManager", "listIdentityLinks", "query", input, void 0, options),
|
|
28340
28342
|
setDisabled: (input, options) => dispatchSystem("deviceManager", "setDisabled", "mutation", input, void 0, options),
|
|
28341
28343
|
getDevice: (input, options) => dispatchSystem("deviceManager", "getDevice", "query", input, void 0, options),
|
|
28342
28344
|
getLinkedDevices: (input, options) => dispatchSystem("deviceManager", "getLinkedDevices", "query", input, void 0, options),
|
|
@@ -29588,6 +29590,9 @@ function createSystemProxy(api) {
|
|
|
29588
29590
|
getRoleDisplayDefaults: (input) => dispatch("deviceManager", "getRoleDisplayDefaults", "query", input),
|
|
29589
29591
|
setRoleDisplayDefaults: (input) => dispatch("deviceManager", "setRoleDisplayDefaults", "mutation", input),
|
|
29590
29592
|
listIdentityCandidates: (input) => dispatch("deviceManager", "listIdentityCandidates", "query", input),
|
|
29593
|
+
confirmIdentityLink: (input) => dispatch("deviceManager", "confirmIdentityLink", "mutation", input),
|
|
29594
|
+
dismissIdentityLink: (input) => dispatch("deviceManager", "dismissIdentityLink", "mutation", input),
|
|
29595
|
+
unlinkIdentity: (input) => dispatch("deviceManager", "unlinkIdentity", "mutation", input),
|
|
29591
29596
|
listLocations: (input) => dispatch("deviceManager", "listLocations", "query", input),
|
|
29592
29597
|
addLocation: (input) => dispatch("deviceManager", "addLocation", "mutation", input),
|
|
29593
29598
|
removeLocation: (input) => dispatch("deviceManager", "removeLocation", "mutation", input),
|
|
@@ -15,6 +15,7 @@ export declare const CompositionProblemCodeSchema: z.ZodEnum<{
|
|
|
15
15
|
"helper-mismatch": "helper-mismatch";
|
|
16
16
|
"item-field-reserved": "item-field-reserved";
|
|
17
17
|
"kind-mismatch": "kind-mismatch";
|
|
18
|
+
"link-contribution-removed": "link-contribution-removed";
|
|
18
19
|
"may-be-null": "may-be-null";
|
|
19
20
|
"member-constraint": "member-constraint";
|
|
20
21
|
"missing-field": "missing-field";
|
|
@@ -53,6 +54,7 @@ export declare const CompositionProblemSchema: z.ZodObject<{
|
|
|
53
54
|
"helper-mismatch": "helper-mismatch";
|
|
54
55
|
"item-field-reserved": "item-field-reserved";
|
|
55
56
|
"kind-mismatch": "kind-mismatch";
|
|
57
|
+
"link-contribution-removed": "link-contribution-removed";
|
|
56
58
|
"may-be-null": "may-be-null";
|
|
57
59
|
"member-constraint": "member-constraint";
|
|
58
60
|
"missing-field": "missing-field";
|
|
@@ -281,6 +283,7 @@ export declare const CompositionValidationSchema: z.ZodObject<{
|
|
|
281
283
|
"helper-mismatch": "helper-mismatch";
|
|
282
284
|
"item-field-reserved": "item-field-reserved";
|
|
283
285
|
"kind-mismatch": "kind-mismatch";
|
|
286
|
+
"link-contribution-removed": "link-contribution-removed";
|
|
284
287
|
"may-be-null": "may-be-null";
|
|
285
288
|
"member-constraint": "member-constraint";
|
|
286
289
|
"missing-field": "missing-field";
|
|
@@ -414,6 +414,11 @@ export declare const CompositionItemEntrySchema: z.ZodObject<{
|
|
|
414
414
|
}, z.core.$strip>>;
|
|
415
415
|
}, z.core.$strip>;
|
|
416
416
|
export type CompositionItemEntry = z.infer<typeof CompositionItemEntrySchema>;
|
|
417
|
+
/** Which identity link added a feature (D1063). */
|
|
418
|
+
export declare const CompositionContributedBySchema: z.ZodObject<{
|
|
419
|
+
linkId: z.ZodString;
|
|
420
|
+
}, z.core.$strip>;
|
|
421
|
+
export type CompositionContributedBy = z.infer<typeof CompositionContributedBySchema>;
|
|
417
422
|
export declare const CompositionFieldsFeatureSchema: z.ZodObject<{
|
|
418
423
|
kind: z.ZodLiteral<"fields">;
|
|
419
424
|
cap: z.ZodString;
|
|
@@ -605,6 +610,9 @@ export declare const CompositionFieldsFeatureSchema: z.ZodObject<{
|
|
|
605
610
|
kind: z.ZodLiteral<"extension">;
|
|
606
611
|
target: z.ZodLiteral<"remote">;
|
|
607
612
|
}, z.core.$strip>], "kind">>>;
|
|
613
|
+
contributedBy: z.ZodOptional<z.ZodObject<{
|
|
614
|
+
linkId: z.ZodString;
|
|
615
|
+
}, z.core.$strip>>;
|
|
608
616
|
}, z.core.$strip>;
|
|
609
617
|
export type CompositionFieldsFeature = z.infer<typeof CompositionFieldsFeatureSchema>;
|
|
610
618
|
/** RESERVED for slice 3: a media / data-plane cap, whole, from one source. */
|
|
@@ -809,6 +817,9 @@ export declare const CompositionFeatureSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
809
817
|
kind: z.ZodLiteral<"extension">;
|
|
810
818
|
target: z.ZodLiteral<"remote">;
|
|
811
819
|
}, z.core.$strip>], "kind">>>;
|
|
820
|
+
contributedBy: z.ZodOptional<z.ZodObject<{
|
|
821
|
+
linkId: z.ZodString;
|
|
822
|
+
}, z.core.$strip>>;
|
|
812
823
|
}, z.core.$strip>, z.ZodObject<{
|
|
813
824
|
kind: z.ZodLiteral<"passthrough">;
|
|
814
825
|
cap: z.ZodString;
|
|
@@ -1063,6 +1074,9 @@ export declare const CompositionSchema: z.ZodObject<{
|
|
|
1063
1074
|
kind: z.ZodLiteral<"extension">;
|
|
1064
1075
|
target: z.ZodLiteral<"remote">;
|
|
1065
1076
|
}, z.core.$strip>], "kind">>>;
|
|
1077
|
+
contributedBy: z.ZodOptional<z.ZodObject<{
|
|
1078
|
+
linkId: z.ZodString;
|
|
1079
|
+
}, z.core.$strip>>;
|
|
1066
1080
|
}, z.core.$strip>, z.ZodObject<{
|
|
1067
1081
|
kind: z.ZodLiteral<"passthrough">;
|
|
1068
1082
|
cap: z.ZodString;
|
|
@@ -7,6 +7,14 @@ export interface PowerSourceLink {
|
|
|
7
7
|
readonly switch: CompositionSourceRef;
|
|
8
8
|
/** How long a forced restart keeps the switch off: an integer within the cap's bounds. */
|
|
9
9
|
readonly offSeconds: number;
|
|
10
|
+
/**
|
|
11
|
+
* The identity link that contributed this feature (D1063), or absent when the
|
|
12
|
+
* operator wrote it. A contributed link is re-checked against that link before
|
|
13
|
+
* any action: a stamp is not proof the port still feeds this device.
|
|
14
|
+
*/
|
|
15
|
+
readonly contributedBy?: {
|
|
16
|
+
readonly linkId: string;
|
|
17
|
+
};
|
|
10
18
|
}
|
|
11
19
|
/**
|
|
12
20
|
* The stored off time, or the default when none is stored. A stored number out
|
|
@@ -183,6 +183,14 @@ export declare abstract class BaseDevice<T extends z.ZodObject<z.core.$ZodLooseS
|
|
|
183
183
|
* nothing. Best-effort: never throws.
|
|
184
184
|
*/
|
|
185
185
|
protected declareIdentifiers(raw: RawDeviceIdentifiers, options?: DeclareIdentifiersOptions): Promise<DeclareIdentifiersResult>;
|
|
186
|
+
/**
|
|
187
|
+
* Declare the identity of the device at the FAR END of this device's physical
|
|
188
|
+
* link (D1063): a PoE port's wired client. Same normalisation, `unread`
|
|
189
|
+
* rule and owner check as {@link declareIdentifiers}, written through
|
|
190
|
+
* `device-manager.setAttachedIdentifiers`. It never makes the two devices the
|
|
191
|
+
* same device. Best-effort: never throws.
|
|
192
|
+
*/
|
|
193
|
+
protected declareAttachedIdentifiers(raw: RawDeviceIdentifiers, options?: DeclareIdentifiersOptions): Promise<DeclareIdentifiersResult>;
|
|
186
194
|
/**
|
|
187
195
|
* Re-publish the device's current `features` array to the persisted
|
|
188
196
|
* meta blob. Drivers call this after a probe finishes when the live
|
|
@@ -164,6 +164,10 @@ export interface DeviceMeta {
|
|
|
164
164
|
* the owning provider through `device-manager.setIdentifiers`, read-only for
|
|
165
165
|
* the operator. Absent ⇒ the provider declared none. */
|
|
166
166
|
readonly identifiers?: DeviceIdentifiers;
|
|
167
|
+
/** The identity of the device at the far end of this device's physical link
|
|
168
|
+
* (D1063) — a PoE port's wired client. Written only by the owning provider
|
|
169
|
+
* through `device-manager.setAttachedIdentifiers`. Absent ⇒ none declared. */
|
|
170
|
+
readonly attachedIdentifiers?: DeviceIdentifiers;
|
|
167
171
|
/** Optional upstream-system identity + rendering envelope. See
|
|
168
172
|
* `SourceInfo`. Persisted under `metadata.sourceInfo` — this field
|
|
169
173
|
* is the typed projection callers consume directly. `BaseDevice`
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity links (planning#594, D1063): a RELATION between two devices of
|
|
3
|
+
* different integrations, decided from the identifiers their providers declared
|
|
4
|
+
* (D1059) — never from location, never from a name.
|
|
5
|
+
*
|
|
6
|
+
* A link is not a merge: both devices keep their provider, their id and their
|
|
7
|
+
* bindings. What a link adds to one of them is a Customize feature, stamped
|
|
8
|
+
* with the link's id (`CompositionFieldsFeature.contributedBy`), so the
|
|
9
|
+
* operator's switch for it is the feature's own `enabled` (D62, D676) and the
|
|
10
|
+
* link record never holds a second copy of it.
|
|
11
|
+
*
|
|
12
|
+
* | Kind | Sides | Evidence |
|
|
13
|
+
* | ------------- | -------------------------------------------- | ---------------------------------------- |
|
|
14
|
+
* | `same-device` | two views of ONE object, unordered | `identifiers` ↔ `identifiers` |
|
|
15
|
+
* | `poe-power` | `a` = the PoE port, `b` = the device it feeds | port `attachedIdentifiers` ↔ `identifiers` |
|
|
16
|
+
*
|
|
17
|
+
* The row id names the two sides by `<addonId>/<stableId>`, so a link survives
|
|
18
|
+
* a device re-registered under a new numeric id. A symmetric kind sorts its two
|
|
19
|
+
* refs; a directional kind keeps `a` as the attaching side.
|
|
20
|
+
*/
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
import { DeviceRole } from './device-type.js';
|
|
23
|
+
export declare const IDENTITY_LINK_KIND_NAMES: readonly ['same-device', 'poe-power'];
|
|
24
|
+
export declare const IdentityLinkKindSchema: z.ZodEnum<{
|
|
25
|
+
"poe-power": "poe-power";
|
|
26
|
+
"same-device": "same-device";
|
|
27
|
+
}>;
|
|
28
|
+
export type IdentityLinkKind = z.infer<typeof IdentityLinkKindSchema>;
|
|
29
|
+
/**
|
|
30
|
+
* - `proposed` — one strong key matched: waits for the operator;
|
|
31
|
+
* - `linked` — confirmed by the operator, or auto-linked on strong evidence;
|
|
32
|
+
* - `dismissed` — the operator said no (or unlinked): sticky, never re-proposed.
|
|
33
|
+
*/
|
|
34
|
+
export declare const IdentityLinkStateSchema: z.ZodEnum<{
|
|
35
|
+
dismissed: "dismissed";
|
|
36
|
+
linked: "linked";
|
|
37
|
+
proposed: "proposed";
|
|
38
|
+
}>;
|
|
39
|
+
export type IdentityLinkState = z.infer<typeof IdentityLinkStateSchema>;
|
|
40
|
+
/** Who decided the current state: the matcher (`auto`) or the operator. */
|
|
41
|
+
export declare const IdentityLinkOriginSchema: z.ZodEnum<{
|
|
42
|
+
auto: "auto";
|
|
43
|
+
operator: "operator";
|
|
44
|
+
}>;
|
|
45
|
+
export type IdentityLinkOrigin = z.infer<typeof IdentityLinkOriginSchema>;
|
|
46
|
+
/** One side: the device ref that survives re-registration, plus its current numeric id. */
|
|
47
|
+
export declare const IdentityLinkSideSchema: z.ZodObject<{
|
|
48
|
+
addonId: z.ZodString;
|
|
49
|
+
stableId: z.ZodString;
|
|
50
|
+
deviceId: z.ZodNumber;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type IdentityLinkSide = z.infer<typeof IdentityLinkSideSchema>;
|
|
53
|
+
/** The stored body of one `identity-links` record. */
|
|
54
|
+
export declare const IdentityLinkBodySchema: z.ZodObject<{
|
|
55
|
+
kind: z.ZodEnum<{
|
|
56
|
+
"poe-power": "poe-power";
|
|
57
|
+
"same-device": "same-device";
|
|
58
|
+
}>;
|
|
59
|
+
a: z.ZodObject<{
|
|
60
|
+
addonId: z.ZodString;
|
|
61
|
+
stableId: z.ZodString;
|
|
62
|
+
deviceId: z.ZodNumber;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
b: z.ZodObject<{
|
|
65
|
+
addonId: z.ZodString;
|
|
66
|
+
stableId: z.ZodString;
|
|
67
|
+
deviceId: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
state: z.ZodEnum<{
|
|
70
|
+
dismissed: "dismissed";
|
|
71
|
+
linked: "linked";
|
|
72
|
+
proposed: "proposed";
|
|
73
|
+
}>;
|
|
74
|
+
origin: z.ZodEnum<{
|
|
75
|
+
auto: "auto";
|
|
76
|
+
operator: "operator";
|
|
77
|
+
}>;
|
|
78
|
+
evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
79
|
+
key: z.ZodEnum<{
|
|
80
|
+
hostname: "hostname";
|
|
81
|
+
ip: "ip";
|
|
82
|
+
mac: "mac";
|
|
83
|
+
"machine-uuid": "machine-uuid";
|
|
84
|
+
serial: "serial";
|
|
85
|
+
"vendor-uid": "vendor-uid";
|
|
86
|
+
}>;
|
|
87
|
+
value: z.ZodString;
|
|
88
|
+
}, z.core.$strip>>>;
|
|
89
|
+
evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
|
|
90
|
+
createdAt: z.ZodNumber;
|
|
91
|
+
decidedAt: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type IdentityLinkBody = z.infer<typeof IdentityLinkBodySchema>;
|
|
94
|
+
export declare const IdentityLinkSchema: z.ZodObject<{
|
|
95
|
+
kind: z.ZodEnum<{
|
|
96
|
+
"poe-power": "poe-power";
|
|
97
|
+
"same-device": "same-device";
|
|
98
|
+
}>;
|
|
99
|
+
a: z.ZodObject<{
|
|
100
|
+
addonId: z.ZodString;
|
|
101
|
+
stableId: z.ZodString;
|
|
102
|
+
deviceId: z.ZodNumber;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
b: z.ZodObject<{
|
|
105
|
+
addonId: z.ZodString;
|
|
106
|
+
stableId: z.ZodString;
|
|
107
|
+
deviceId: z.ZodNumber;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
state: z.ZodEnum<{
|
|
110
|
+
dismissed: "dismissed";
|
|
111
|
+
linked: "linked";
|
|
112
|
+
proposed: "proposed";
|
|
113
|
+
}>;
|
|
114
|
+
origin: z.ZodEnum<{
|
|
115
|
+
auto: "auto";
|
|
116
|
+
operator: "operator";
|
|
117
|
+
}>;
|
|
118
|
+
evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
119
|
+
key: z.ZodEnum<{
|
|
120
|
+
hostname: "hostname";
|
|
121
|
+
ip: "ip";
|
|
122
|
+
mac: "mac";
|
|
123
|
+
"machine-uuid": "machine-uuid";
|
|
124
|
+
serial: "serial";
|
|
125
|
+
"vendor-uid": "vendor-uid";
|
|
126
|
+
}>;
|
|
127
|
+
value: z.ZodString;
|
|
128
|
+
}, z.core.$strip>>>;
|
|
129
|
+
evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
|
|
130
|
+
createdAt: z.ZodNumber;
|
|
131
|
+
decidedAt: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export type IdentityLink = z.infer<typeof IdentityLinkSchema>;
|
|
135
|
+
/** A device ref as a link id names it. */
|
|
136
|
+
export interface IdentityLinkRef {
|
|
137
|
+
readonly addonId: string;
|
|
138
|
+
readonly stableId: string;
|
|
139
|
+
}
|
|
140
|
+
/** One Customize feature a link kind adds to one of its sides. */
|
|
141
|
+
export interface IdentityLinkContribution {
|
|
142
|
+
/** The cap whose Customize target is filled. */
|
|
143
|
+
readonly cap: string;
|
|
144
|
+
/** The scalar target of that cap. */
|
|
145
|
+
readonly targetId: string;
|
|
146
|
+
/** The side that RECEIVES the feature. */
|
|
147
|
+
readonly host: 'a' | 'b';
|
|
148
|
+
/** The side the feature reads from. */
|
|
149
|
+
readonly source: 'a' | 'b';
|
|
150
|
+
/** What it reads on the source side. */
|
|
151
|
+
readonly sourceCap: string;
|
|
152
|
+
readonly sourceField: string;
|
|
153
|
+
}
|
|
154
|
+
export interface IdentityLinkKindSpec {
|
|
155
|
+
/** A directional kind keeps `a` as the attaching side; a symmetric one sorts its refs. */
|
|
156
|
+
readonly directional: boolean;
|
|
157
|
+
/** The role the attaching side (`a`) must have; `null` when any device may attach. */
|
|
158
|
+
readonly attachingRole: DeviceRole | null;
|
|
159
|
+
/** What a `linked` link of this kind adds, by default. */
|
|
160
|
+
readonly contributions: readonly IdentityLinkContribution[];
|
|
161
|
+
}
|
|
162
|
+
/** The one table of link kinds. */
|
|
163
|
+
export declare const IDENTITY_LINK_KINDS: Readonly<Record<IdentityLinkKind, IdentityLinkKindSpec>>;
|
|
164
|
+
/** Why a pair cannot be a link of a kind; `null` when it can. */
|
|
165
|
+
export type IdentityLinkSidesRefusal = 'attaching-side-role';
|
|
166
|
+
/** Whether the attaching side of `kind` may be a device of `aRole`. */
|
|
167
|
+
export declare function identityLinkSidesRefusal(kind: IdentityLinkKind, aRole: string | null | undefined): IdentityLinkSidesRefusal | null;
|
|
168
|
+
/**
|
|
169
|
+
* The record id of a link: `<kind>:<refA>|<refB>`. A symmetric kind sorts the
|
|
170
|
+
* two refs, so either order names one row; a directional kind keeps `a` first.
|
|
171
|
+
*/
|
|
172
|
+
export declare function identityLinkId(kind: IdentityLinkKind, a: IdentityLinkRef, b: IdentityLinkRef): string;
|
|
173
|
+
/**
|
|
174
|
+
* The answer of `device-manager.listIdentityLinks`. `not-loaded` until the
|
|
175
|
+
* links have been read — never an empty list (D315).
|
|
176
|
+
*/
|
|
177
|
+
export declare const IdentityLinksReadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
+
status: z.ZodLiteral<"not-loaded">;
|
|
179
|
+
reason: z.ZodString;
|
|
180
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
181
|
+
status: z.ZodLiteral<"answered">;
|
|
182
|
+
links: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
183
|
+
kind: z.ZodEnum<{
|
|
184
|
+
"poe-power": "poe-power";
|
|
185
|
+
"same-device": "same-device";
|
|
186
|
+
}>;
|
|
187
|
+
a: z.ZodObject<{
|
|
188
|
+
addonId: z.ZodString;
|
|
189
|
+
stableId: z.ZodString;
|
|
190
|
+
deviceId: z.ZodNumber;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
b: z.ZodObject<{
|
|
193
|
+
addonId: z.ZodString;
|
|
194
|
+
stableId: z.ZodString;
|
|
195
|
+
deviceId: z.ZodNumber;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
state: z.ZodEnum<{
|
|
198
|
+
dismissed: "dismissed";
|
|
199
|
+
linked: "linked";
|
|
200
|
+
proposed: "proposed";
|
|
201
|
+
}>;
|
|
202
|
+
origin: z.ZodEnum<{
|
|
203
|
+
auto: "auto";
|
|
204
|
+
operator: "operator";
|
|
205
|
+
}>;
|
|
206
|
+
evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
207
|
+
key: z.ZodEnum<{
|
|
208
|
+
hostname: "hostname";
|
|
209
|
+
ip: "ip";
|
|
210
|
+
mac: "mac";
|
|
211
|
+
"machine-uuid": "machine-uuid";
|
|
212
|
+
serial: "serial";
|
|
213
|
+
"vendor-uid": "vendor-uid";
|
|
214
|
+
}>;
|
|
215
|
+
value: z.ZodString;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
|
|
218
|
+
createdAt: z.ZodNumber;
|
|
219
|
+
decidedAt: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
id: z.ZodString;
|
|
221
|
+
}, z.core.$strip>>>;
|
|
222
|
+
}, z.core.$strip>], "status">;
|
|
223
|
+
export type IdentityLinksRead = z.infer<typeof IdentityLinksReadSchema>;
|
|
224
|
+
/** Why an operator decision on a link was refused. */
|
|
225
|
+
export declare const IdentityLinkDecisionRefusalSchema: z.ZodEnum<{
|
|
226
|
+
"not-loaded": "not-loaded";
|
|
227
|
+
"unknown-link": "unknown-link";
|
|
228
|
+
"wrong-state": "wrong-state";
|
|
229
|
+
}>;
|
|
230
|
+
export type IdentityLinkDecisionRefusal = z.infer<typeof IdentityLinkDecisionRefusalSchema>;
|
|
231
|
+
/** The answer of `confirmIdentityLink` / `dismissIdentityLink` / `unlinkIdentity`. */
|
|
232
|
+
export declare const IdentityLinkDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
233
|
+
ok: z.ZodLiteral<true>;
|
|
234
|
+
link: z.ZodObject<{
|
|
235
|
+
kind: z.ZodEnum<{
|
|
236
|
+
"poe-power": "poe-power";
|
|
237
|
+
"same-device": "same-device";
|
|
238
|
+
}>;
|
|
239
|
+
a: z.ZodObject<{
|
|
240
|
+
addonId: z.ZodString;
|
|
241
|
+
stableId: z.ZodString;
|
|
242
|
+
deviceId: z.ZodNumber;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
b: z.ZodObject<{
|
|
245
|
+
addonId: z.ZodString;
|
|
246
|
+
stableId: z.ZodString;
|
|
247
|
+
deviceId: z.ZodNumber;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
state: z.ZodEnum<{
|
|
250
|
+
dismissed: "dismissed";
|
|
251
|
+
linked: "linked";
|
|
252
|
+
proposed: "proposed";
|
|
253
|
+
}>;
|
|
254
|
+
origin: z.ZodEnum<{
|
|
255
|
+
auto: "auto";
|
|
256
|
+
operator: "operator";
|
|
257
|
+
}>;
|
|
258
|
+
evidence: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
259
|
+
key: z.ZodEnum<{
|
|
260
|
+
hostname: "hostname";
|
|
261
|
+
ip: "ip";
|
|
262
|
+
mac: "mac";
|
|
263
|
+
"machine-uuid": "machine-uuid";
|
|
264
|
+
serial: "serial";
|
|
265
|
+
"vendor-uid": "vendor-uid";
|
|
266
|
+
}>;
|
|
267
|
+
value: z.ZodString;
|
|
268
|
+
}, z.core.$strip>>>;
|
|
269
|
+
evidenceGone: z.ZodOptional<z.ZodLiteral<true>>;
|
|
270
|
+
createdAt: z.ZodNumber;
|
|
271
|
+
decidedAt: z.ZodOptional<z.ZodNumber>;
|
|
272
|
+
id: z.ZodString;
|
|
273
|
+
}, z.core.$strip>;
|
|
274
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
275
|
+
ok: z.ZodLiteral<false>;
|
|
276
|
+
reason: z.ZodEnum<{
|
|
277
|
+
"not-loaded": "not-loaded";
|
|
278
|
+
"unknown-link": "unknown-link";
|
|
279
|
+
"wrong-state": "wrong-state";
|
|
280
|
+
}>;
|
|
281
|
+
message: z.ZodString;
|
|
282
|
+
}, z.core.$strip>], "ok">;
|
|
283
|
+
export type IdentityLinkDecision = z.infer<typeof IdentityLinkDecisionSchema>;
|
|
284
|
+
/** Why a link was lost. */
|
|
285
|
+
export declare const IdentityLinkLostReasonSchema: z.ZodEnum<{
|
|
286
|
+
"device-removed": "device-removed";
|
|
287
|
+
"evidence-gone": "evidence-gone";
|
|
288
|
+
"operator-unlinked": "operator-unlinked";
|
|
289
|
+
}>;
|
|
290
|
+
export type IdentityLinkLostReason = z.infer<typeof IdentityLinkLostReasonSchema>;
|
|
291
|
+
/** The payload of `identity-link.created` / `identity-link.lost` (telemetry; the record is the truth). */
|
|
292
|
+
export declare const IdentityLinkEventPayloadSchema: z.ZodObject<{
|
|
293
|
+
linkId: z.ZodString;
|
|
294
|
+
kind: z.ZodEnum<{
|
|
295
|
+
"poe-power": "poe-power";
|
|
296
|
+
"same-device": "same-device";
|
|
297
|
+
}>;
|
|
298
|
+
aDeviceId: z.ZodNumber;
|
|
299
|
+
bDeviceId: z.ZodNumber;
|
|
300
|
+
origin: z.ZodEnum<{
|
|
301
|
+
auto: "auto";
|
|
302
|
+
operator: "operator";
|
|
303
|
+
}>;
|
|
304
|
+
reason: z.ZodOptional<z.ZodEnum<{
|
|
305
|
+
"device-removed": "device-removed";
|
|
306
|
+
"evidence-gone": "evidence-gone";
|
|
307
|
+
"operator-unlinked": "operator-unlinked";
|
|
308
|
+
}>>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
export type IdentityLinkEventPayload = z.infer<typeof IdentityLinkEventPayloadSchema>;
|
package/dist/device/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { declareDeviceIdentifiers } from './declare-identifiers.js';
|
|
|
20
20
|
export type { DeclareIdentifiersDeps, DeclareIdentifiersOptions, DeclareIdentifiersOutcome, DeclareIdentifiersResult, IdentifiersWriter, SetIdentifiersInput, } from './declare-identifiers.js';
|
|
21
21
|
export { IdentityCandidateDeviceSchema, IdentityCandidatePairSchema, IdentityCandidatesSchema, IdentityConfidenceSchema, IdentityMatchedKeySchema, } from './device-identity-candidates.js';
|
|
22
22
|
export type { IdentityCandidateDevice, IdentityCandidatePair, IdentityCandidates, IdentityConfidence, IdentityMatchedKey, } from './device-identity-candidates.js';
|
|
23
|
+
export { IDENTITY_LINK_KIND_NAMES, IDENTITY_LINK_KINDS, IdentityLinkBodySchema, IdentityLinkDecisionRefusalSchema, IdentityLinkDecisionSchema, IdentityLinkEventPayloadSchema, IdentityLinkKindSchema, IdentityLinkLostReasonSchema, IdentityLinkOriginSchema, IdentityLinkSchema, IdentityLinkSideSchema, IdentityLinkStateSchema, IdentityLinksReadSchema, identityLinkId, identityLinkSidesRefusal, } from './identity-links.js';
|
|
24
|
+
export type { IdentityLink, IdentityLinkBody, IdentityLinkContribution, IdentityLinkDecision, IdentityLinkDecisionRefusal, IdentityLinkEventPayload, IdentityLinkKind, IdentityLinkKindSpec, IdentityLinkLostReason, IdentityLinkOrigin, IdentityLinkRef, IdentityLinkSide, IdentityLinkSidesRefusal, IdentityLinkState, IdentityLinksRead, } from './identity-links.js';
|
|
23
25
|
export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device-profile.js';
|
|
24
26
|
export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
|
|
25
27
|
export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot, } from './device-runtime-state.js';
|
|
@@ -228,6 +228,20 @@ export declare enum EventCategory {
|
|
|
228
228
|
* dropped) — consumers MUST also gate on the device record's `probed` flag.
|
|
229
229
|
*/
|
|
230
230
|
DeviceReady = "device.ready",
|
|
231
|
+
/**
|
|
232
|
+
* An identity link (D1063) became `linked` — auto on strong evidence or
|
|
233
|
+
* confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
|
|
234
|
+
* truth, and core-blocks reconciles its contributions from it as well.
|
|
235
|
+
* Payload: `IdentityLinkEventPayload`.
|
|
236
|
+
*/
|
|
237
|
+
IdentityLinkCreated = "identity-link.created",
|
|
238
|
+
/**
|
|
239
|
+
* A `linked` identity link stopped acting: its evidence is gone (an auto link
|
|
240
|
+
* is deleted; an operator-confirmed one stays `linked`, flagged
|
|
241
|
+
* `evidenceGone`, and no longer acts), a side was removed, or the operator
|
|
242
|
+
* unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
|
|
243
|
+
*/
|
|
244
|
+
IdentityLinkLost = "identity-link.lost",
|
|
231
245
|
IntegrationEnabled = "integration.enabled",
|
|
232
246
|
IntegrationDisabled = "integration.disabled",
|
|
233
247
|
IntegrationDeleted = "integration.deleted",
|
package/dist/enums.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_event_category = require("./event-category-
|
|
2
|
+
const require_event_category = require("./event-category-CMA0-jGW.js");
|
|
3
3
|
//#region src/enums/event-source-type.ts
|
|
4
4
|
var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
|
|
5
5
|
EventSourceType["Addon"] = "addon";
|
package/dist/enums.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as EventCategory } from "./event-category-
|
|
1
|
+
import { t as EventCategory } from "./event-category-7P4A3bYA.mjs";
|
|
2
2
|
//#region src/enums/event-source-type.ts
|
|
3
3
|
var EventSourceType = /* @__PURE__ */ function(EventSourceType) {
|
|
4
4
|
EventSourceType["Addon"] = "addon";
|
|
@@ -229,6 +229,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
229
229
|
* dropped) — consumers MUST also gate on the device record's `probed` flag.
|
|
230
230
|
*/
|
|
231
231
|
EventCategory["DeviceReady"] = "device.ready";
|
|
232
|
+
/**
|
|
233
|
+
* An identity link (D1063) became `linked` — auto on strong evidence or
|
|
234
|
+
* confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
|
|
235
|
+
* truth, and core-blocks reconciles its contributions from it as well.
|
|
236
|
+
* Payload: `IdentityLinkEventPayload`.
|
|
237
|
+
*/
|
|
238
|
+
EventCategory["IdentityLinkCreated"] = "identity-link.created";
|
|
239
|
+
/**
|
|
240
|
+
* A `linked` identity link stopped acting: its evidence is gone (an auto link
|
|
241
|
+
* is deleted; an operator-confirmed one stays `linked`, flagged
|
|
242
|
+
* `evidenceGone`, and no longer acts), a side was removed, or the operator
|
|
243
|
+
* unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
|
|
244
|
+
*/
|
|
245
|
+
EventCategory["IdentityLinkLost"] = "identity-link.lost";
|
|
232
246
|
EventCategory["IntegrationEnabled"] = "integration.enabled";
|
|
233
247
|
EventCategory["IntegrationDisabled"] = "integration.disabled";
|
|
234
248
|
EventCategory["IntegrationDeleted"] = "integration.deleted";
|
|
@@ -229,6 +229,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
229
229
|
* dropped) — consumers MUST also gate on the device record's `probed` flag.
|
|
230
230
|
*/
|
|
231
231
|
EventCategory["DeviceReady"] = "device.ready";
|
|
232
|
+
/**
|
|
233
|
+
* An identity link (D1063) became `linked` — auto on strong evidence or
|
|
234
|
+
* confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
|
|
235
|
+
* truth, and core-blocks reconciles its contributions from it as well.
|
|
236
|
+
* Payload: `IdentityLinkEventPayload`.
|
|
237
|
+
*/
|
|
238
|
+
EventCategory["IdentityLinkCreated"] = "identity-link.created";
|
|
239
|
+
/**
|
|
240
|
+
* A `linked` identity link stopped acting: its evidence is gone (an auto link
|
|
241
|
+
* is deleted; an operator-confirmed one stays `linked`, flagged
|
|
242
|
+
* `evidenceGone`, and no longer acts), a side was removed, or the operator
|
|
243
|
+
* unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
|
|
244
|
+
*/
|
|
245
|
+
EventCategory["IdentityLinkLost"] = "identity-link.lost";
|
|
232
246
|
EventCategory["IntegrationEnabled"] = "integration.enabled";
|
|
233
247
|
EventCategory["IntegrationDisabled"] = "integration.disabled";
|
|
234
248
|
EventCategory["IntegrationDeleted"] = "integration.deleted";
|
|
@@ -2836,6 +2836,41 @@ export type AppRouter = TrpcCoreRouter<{
|
|
|
2836
2836
|
output: z.infer<typeof deviceManagerCapability.methods.listIdentityCandidates.output>;
|
|
2837
2837
|
meta: object;
|
|
2838
2838
|
}>;
|
|
2839
|
+
setAttachedIdentifiers: TRPCMutationProcedure<{
|
|
2840
|
+
input: {
|
|
2841
|
+
[x: string]: unknown;
|
|
2842
|
+
} & z.input<typeof deviceManagerCapability.methods.setAttachedIdentifiers.input>;
|
|
2843
|
+
output: z.infer<typeof deviceManagerCapability.methods.setAttachedIdentifiers.output>;
|
|
2844
|
+
meta: object;
|
|
2845
|
+
}>;
|
|
2846
|
+
listIdentityLinks: TRPCQueryProcedure<{
|
|
2847
|
+
input: {
|
|
2848
|
+
[x: string]: unknown;
|
|
2849
|
+
} & z.input<typeof deviceManagerCapability.methods.listIdentityLinks.input>;
|
|
2850
|
+
output: z.infer<typeof deviceManagerCapability.methods.listIdentityLinks.output>;
|
|
2851
|
+
meta: object;
|
|
2852
|
+
}>;
|
|
2853
|
+
confirmIdentityLink: TRPCMutationProcedure<{
|
|
2854
|
+
input: {
|
|
2855
|
+
[x: string]: unknown;
|
|
2856
|
+
} & z.input<typeof deviceManagerCapability.methods.confirmIdentityLink.input>;
|
|
2857
|
+
output: z.infer<typeof deviceManagerCapability.methods.confirmIdentityLink.output>;
|
|
2858
|
+
meta: object;
|
|
2859
|
+
}>;
|
|
2860
|
+
dismissIdentityLink: TRPCMutationProcedure<{
|
|
2861
|
+
input: {
|
|
2862
|
+
[x: string]: unknown;
|
|
2863
|
+
} & z.input<typeof deviceManagerCapability.methods.dismissIdentityLink.input>;
|
|
2864
|
+
output: z.infer<typeof deviceManagerCapability.methods.dismissIdentityLink.output>;
|
|
2865
|
+
meta: object;
|
|
2866
|
+
}>;
|
|
2867
|
+
unlinkIdentity: TRPCMutationProcedure<{
|
|
2868
|
+
input: {
|
|
2869
|
+
[x: string]: unknown;
|
|
2870
|
+
} & z.input<typeof deviceManagerCapability.methods.unlinkIdentity.input>;
|
|
2871
|
+
output: z.infer<typeof deviceManagerCapability.methods.unlinkIdentity.output>;
|
|
2872
|
+
meta: object;
|
|
2873
|
+
}>;
|
|
2839
2874
|
listLocations: TRPCQueryProcedure<{
|
|
2840
2875
|
input: {
|
|
2841
2876
|
nodeId?: string | undefined;
|