@camstack/types 1.1.38 → 1.1.40
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/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/capability-definition.d.ts +26 -1
- package/dist/capabilities/snapshot.cap.d.ts +17 -0
- package/dist/capabilities/user-passkeys.cap.d.ts +20 -0
- package/dist/generated/addon-api.d.ts +100 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/index.js +51 -2
- package/dist/index.mjs +51 -2
- package/dist/{sleep-BtS3xMHv.js → sleep-Dqd2OlRi.js} +19 -0
- package/dist/{sleep-DJaTV2D7.mjs → sleep-b4Jf2n33.mjs} +14 -1
- package/package.json +1 -1
package/dist/addon.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-Dqd2OlRi.js");
|
|
3
3
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
4
4
|
exports.BaseAddon = require_sleep.BaseAddon;
|
|
5
5
|
exports.DATAPLANE_SECRET_HEADER = require_sleep.DATAPLANE_SECRET_HEADER;
|
package/dist/addon.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as parseJsonUnknown, D as asString, I as scopeKey, M as ReadinessRegistry, N as ReadinessTimeoutError, S as DeviceType, T as asJsonObject, a as viewerUiCapability, bt as EventCategory, ct as BaseAddon, ft as emitReadiness, i as deviceOpsCapability, j as DATAPLANE_SECRET_HEADER, lt as normalizeAddonInitResult, m as expandCapMethods, o as adminUiCapability, s as createDeviceProxy, t as sleep, xt as DisposerChain } from "./sleep-b4Jf2n33.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
export { BaseAddon, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, ReadinessTimeoutError, adminUiCapability, asJsonObject, asString, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, normalizeAddonInitResult, parseJsonUnknown, scopeKey, sleep, viewerUiCapability };
|
|
@@ -61,6 +61,14 @@ export interface CapabilityMethodSchema<TInput extends z.ZodType = z.ZodType, TO
|
|
|
61
61
|
readonly access?: CapabilityMethodAccess;
|
|
62
62
|
/** Moleculer action timeout override (ms). Overrides broker global requestTimeout for this action only. */
|
|
63
63
|
readonly timeoutMs?: number;
|
|
64
|
+
/**
|
|
65
|
+
* When true the method is served ONLY by the cap's system/wrapper provider —
|
|
66
|
+
* it is required on `InferProvider` but OPTIONAL on `InferNativeProvider`, so
|
|
67
|
+
* per-device driver natives (RtspCamera, OnvifCamera, …) don't stub out a
|
|
68
|
+
* wrapper-only concern (e.g. a cross-device cache-overview batch). Same
|
|
69
|
+
* rationale as the status-Partial on native providers.
|
|
70
|
+
*/
|
|
71
|
+
readonly systemOnly?: boolean;
|
|
64
72
|
}
|
|
65
73
|
/** Schema for a capability event (emitted to EventBus) */
|
|
66
74
|
export interface CapabilityEventSchema<TData extends z.ZodType = z.ZodType> {
|
|
@@ -659,8 +667,15 @@ export type InferProvider<T extends CapabilityDefinition> = {
|
|
|
659
667
|
* separate stops every device class (RtspCamera, OnvifCamera, …) from
|
|
660
668
|
* having to stub out three unused methods.
|
|
661
669
|
*/
|
|
670
|
+
type NativeMethodFn<M> = M extends CapabilityMethodSchema<infer TIn, infer TOut> ? M['kind'] extends 'subscription' ? (input: z.infer<TIn>, push: (value: z.infer<TOut>) => void) => (() => void) | void : (input: z.infer<TIn>) => Promise<z.infer<TOut>> : never;
|
|
662
671
|
export type InferNativeProvider<T extends CapabilityDefinition> = {
|
|
663
|
-
readonly [K in keyof T['methods']
|
|
672
|
+
readonly [K in keyof T['methods'] as T['methods'][K] extends {
|
|
673
|
+
systemOnly: true;
|
|
674
|
+
} ? never : K]: NativeMethodFn<T['methods'][K]>;
|
|
675
|
+
} & {
|
|
676
|
+
readonly [K in keyof T['methods'] as T['methods'][K] extends {
|
|
677
|
+
systemOnly: true;
|
|
678
|
+
} ? K : never]?: NativeMethodFn<T['methods'][K]>;
|
|
664
679
|
} & (T extends {
|
|
665
680
|
status: CapabilityStatusSchema;
|
|
666
681
|
} ? Partial<DeviceStatusContribution<InferStatus<T>>> : Record<never, never>);
|
|
@@ -736,9 +751,19 @@ export interface CapabilityMethodOptions<TKind extends CapabilityMethodKind = Ca
|
|
|
736
751
|
}
|
|
737
752
|
/** Shorthand to define a method schema */
|
|
738
753
|
export declare function method<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends CapabilityMethodKind = 'query'>(input: TIn, output: TOut, options?: CapabilityMethodOptions<TKind>): CapabilityMethodSchema<TIn, TOut, TKind>;
|
|
754
|
+
/**
|
|
755
|
+
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
756
|
+
* provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
|
|
757
|
+
* driver natives don't stub out a wrapper concern (e.g. a cross-device cache
|
|
758
|
+
* overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
|
|
759
|
+
*/
|
|
760
|
+
export declare function systemMethod<TIn extends z.ZodType, TOut extends z.ZodType, TKind extends CapabilityMethodKind = 'query'>(input: TIn, output: TOut, options?: CapabilityMethodOptions<TKind>): CapabilityMethodSchema<TIn, TOut, TKind> & {
|
|
761
|
+
readonly systemOnly: true;
|
|
762
|
+
};
|
|
739
763
|
/** Shorthand to define an event schema */
|
|
740
764
|
export declare function event<TData extends z.ZodType>(data: TData): CapabilityEventSchema<TData>;
|
|
741
765
|
/** Type guard: does this cap declare the D14 device-config archetype? */
|
|
742
766
|
export declare function isDeviceConfigCap(def: CapabilityDefinition | undefined): def is CapabilityDefinition & {
|
|
743
767
|
deviceConfig: DeviceConfigSpec;
|
|
744
768
|
};
|
|
769
|
+
export {};
|
|
@@ -65,6 +65,23 @@ export declare const snapshotCapability: {
|
|
|
65
65
|
readonly invalidateCache: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
66
66
|
deviceId: z.ZodNumber;
|
|
67
67
|
}, z.core.$strip>, z.ZodVoid, "mutation">;
|
|
68
|
+
/**
|
|
69
|
+
* Cache-only batch overview — answers from the wrapper's in-memory cache in
|
|
70
|
+
* O(n) and NEVER triggers a capture. Lets a grid skip requesting images for
|
|
71
|
+
* devices that never produced a frame, and gives it an ETag per device for
|
|
72
|
+
* conditional (304-able) image fetches. `lastCapturedAt`/`cacheAgeMs`/`etag`
|
|
73
|
+
* are null for a device with no cached frame.
|
|
74
|
+
*/
|
|
75
|
+
readonly getSnapshotOverview: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
76
|
+
deviceIds: z.ZodArray<z.ZodNumber>;
|
|
77
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
78
|
+
deviceId: z.ZodNumber;
|
|
79
|
+
lastCapturedAt: z.ZodNullable<z.ZodNumber>;
|
|
80
|
+
cacheAgeMs: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
etag: z.ZodNullable<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind> & {
|
|
83
|
+
readonly systemOnly: true;
|
|
84
|
+
};
|
|
68
85
|
};
|
|
69
86
|
readonly status: {
|
|
70
87
|
readonly schema: z.ZodObject<{
|
|
@@ -40,6 +40,15 @@ import { type InferProvider } from './capability-definition.js';
|
|
|
40
40
|
* - `listPasskeys({userId})` — enumerate user's enrolled credentials.
|
|
41
41
|
* - `removePasskey({userId, credentialId})` — revoke one credential.
|
|
42
42
|
*
|
|
43
|
+
* 4. Second-factor preference (opt-in, default OFF):
|
|
44
|
+
* Enrolling a passkey only enables passkey-FIRST sign-in. It is
|
|
45
|
+
* demanded as a second factor after a password login ONLY when the
|
|
46
|
+
* user explicitly opts in via `setSecondFactorPreference`.
|
|
47
|
+
* - `getSecondFactorPreference({userId})` → `{ enabled }` (missing
|
|
48
|
+
* row ⇒ `enabled: false`).
|
|
49
|
+
* - `setSecondFactorPreference({userId, enabled})` — persisted by
|
|
50
|
+
* the providing addon beside its credentials.
|
|
51
|
+
*
|
|
43
52
|
* Challenges are short-lived (5 min, in-memory). The cap is internal —
|
|
44
53
|
* the admin-ui composes the begin/finish round-trip and never exposes
|
|
45
54
|
* the cap to non-admins.
|
|
@@ -107,6 +116,17 @@ export declare const userPasskeysCapability: {
|
|
|
107
116
|
}, z.core.$strip>, z.ZodObject<{
|
|
108
117
|
success: z.ZodLiteral<true>;
|
|
109
118
|
}, z.core.$strip>, "mutation">;
|
|
119
|
+
readonly getSecondFactorPreference: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
120
|
+
userId: z.ZodString;
|
|
121
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
122
|
+
enabled: z.ZodBoolean;
|
|
123
|
+
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
124
|
+
readonly setSecondFactorPreference: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
125
|
+
userId: z.ZodString;
|
|
126
|
+
enabled: z.ZodBoolean;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
success: z.ZodLiteral<true>;
|
|
129
|
+
}, z.core.$strip>, "mutation">;
|
|
110
130
|
};
|
|
111
131
|
};
|
|
112
132
|
export type IUserPasskeysProvider = InferProvider<typeof userPasskeysCapability>;
|
|
@@ -848,6 +848,22 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
|
|
|
848
848
|
};
|
|
849
849
|
meta: object;
|
|
850
850
|
}>;
|
|
851
|
+
getOwnPasskeySecondFactorPreference: import("@trpc/server").TRPCQueryProcedure<{
|
|
852
|
+
input: void;
|
|
853
|
+
output: {
|
|
854
|
+
enabled: boolean;
|
|
855
|
+
};
|
|
856
|
+
meta: object;
|
|
857
|
+
}>;
|
|
858
|
+
setOwnPasskeySecondFactorPreference: import("@trpc/server").TRPCMutationProcedure<{
|
|
859
|
+
input: {
|
|
860
|
+
enabled: boolean;
|
|
861
|
+
};
|
|
862
|
+
output: {
|
|
863
|
+
success: true;
|
|
864
|
+
};
|
|
865
|
+
meta: object;
|
|
866
|
+
}>;
|
|
851
867
|
createShareToken: import("@trpc/server").TRPCMutationProcedure<{
|
|
852
868
|
input: {
|
|
853
869
|
scope: {
|
|
@@ -12044,6 +12060,19 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
|
|
|
12044
12060
|
output: void;
|
|
12045
12061
|
meta: object;
|
|
12046
12062
|
}>;
|
|
12063
|
+
getSnapshotOverview: import("@trpc/server").TRPCQueryProcedure<{
|
|
12064
|
+
input: {
|
|
12065
|
+
[x: string]: unknown;
|
|
12066
|
+
deviceIds: number[];
|
|
12067
|
+
};
|
|
12068
|
+
output: {
|
|
12069
|
+
deviceId: number;
|
|
12070
|
+
lastCapturedAt: number | null;
|
|
12071
|
+
cacheAgeMs: number | null;
|
|
12072
|
+
etag: string | null;
|
|
12073
|
+
}[];
|
|
12074
|
+
meta: object;
|
|
12075
|
+
}>;
|
|
12047
12076
|
}>>;
|
|
12048
12077
|
ssoBridge: import("@trpc/server").TRPCBuiltRouter<{
|
|
12049
12078
|
ctx: TrpcContext;
|
|
@@ -14234,6 +14263,27 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
|
|
|
14234
14263
|
};
|
|
14235
14264
|
meta: object;
|
|
14236
14265
|
}>;
|
|
14266
|
+
getSecondFactorPreference: import("@trpc/server").TRPCQueryProcedure<{
|
|
14267
|
+
input: {
|
|
14268
|
+
[x: string]: unknown;
|
|
14269
|
+
userId: string;
|
|
14270
|
+
};
|
|
14271
|
+
output: {
|
|
14272
|
+
enabled: boolean;
|
|
14273
|
+
};
|
|
14274
|
+
meta: object;
|
|
14275
|
+
}>;
|
|
14276
|
+
setSecondFactorPreference: import("@trpc/server").TRPCMutationProcedure<{
|
|
14277
|
+
input: {
|
|
14278
|
+
[x: string]: unknown;
|
|
14279
|
+
userId: string;
|
|
14280
|
+
enabled: boolean;
|
|
14281
|
+
};
|
|
14282
|
+
output: {
|
|
14283
|
+
success: true;
|
|
14284
|
+
};
|
|
14285
|
+
meta: object;
|
|
14286
|
+
}>;
|
|
14237
14287
|
}>>;
|
|
14238
14288
|
vacuumControl: import("@trpc/server").TRPCBuiltRouter<{
|
|
14239
14289
|
ctx: TrpcContext;
|
|
@@ -15714,6 +15764,22 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
|
|
|
15714
15764
|
};
|
|
15715
15765
|
meta: object;
|
|
15716
15766
|
}>;
|
|
15767
|
+
getOwnPasskeySecondFactorPreference: import("@trpc/server").TRPCQueryProcedure<{
|
|
15768
|
+
input: void;
|
|
15769
|
+
output: {
|
|
15770
|
+
enabled: boolean;
|
|
15771
|
+
};
|
|
15772
|
+
meta: object;
|
|
15773
|
+
}>;
|
|
15774
|
+
setOwnPasskeySecondFactorPreference: import("@trpc/server").TRPCMutationProcedure<{
|
|
15775
|
+
input: {
|
|
15776
|
+
enabled: boolean;
|
|
15777
|
+
};
|
|
15778
|
+
output: {
|
|
15779
|
+
success: true;
|
|
15780
|
+
};
|
|
15781
|
+
meta: object;
|
|
15782
|
+
}>;
|
|
15717
15783
|
createShareToken: import("@trpc/server").TRPCMutationProcedure<{
|
|
15718
15784
|
input: {
|
|
15719
15785
|
scope: {
|
|
@@ -26910,6 +26976,19 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
|
|
|
26910
26976
|
output: void;
|
|
26911
26977
|
meta: object;
|
|
26912
26978
|
}>;
|
|
26979
|
+
getSnapshotOverview: import("@trpc/server").TRPCQueryProcedure<{
|
|
26980
|
+
input: {
|
|
26981
|
+
[x: string]: unknown;
|
|
26982
|
+
deviceIds: number[];
|
|
26983
|
+
};
|
|
26984
|
+
output: {
|
|
26985
|
+
deviceId: number;
|
|
26986
|
+
lastCapturedAt: number | null;
|
|
26987
|
+
cacheAgeMs: number | null;
|
|
26988
|
+
etag: string | null;
|
|
26989
|
+
}[];
|
|
26990
|
+
meta: object;
|
|
26991
|
+
}>;
|
|
26913
26992
|
}>>;
|
|
26914
26993
|
ssoBridge: import("@trpc/server").TRPCBuiltRouter<{
|
|
26915
26994
|
ctx: TrpcContext;
|
|
@@ -29100,6 +29179,27 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
|
|
|
29100
29179
|
};
|
|
29101
29180
|
meta: object;
|
|
29102
29181
|
}>;
|
|
29182
|
+
getSecondFactorPreference: import("@trpc/server").TRPCQueryProcedure<{
|
|
29183
|
+
input: {
|
|
29184
|
+
[x: string]: unknown;
|
|
29185
|
+
userId: string;
|
|
29186
|
+
};
|
|
29187
|
+
output: {
|
|
29188
|
+
enabled: boolean;
|
|
29189
|
+
};
|
|
29190
|
+
meta: object;
|
|
29191
|
+
}>;
|
|
29192
|
+
setSecondFactorPreference: import("@trpc/server").TRPCMutationProcedure<{
|
|
29193
|
+
input: {
|
|
29194
|
+
[x: string]: unknown;
|
|
29195
|
+
userId: string;
|
|
29196
|
+
enabled: boolean;
|
|
29197
|
+
};
|
|
29198
|
+
output: {
|
|
29199
|
+
success: true;
|
|
29200
|
+
};
|
|
29201
|
+
meta: object;
|
|
29202
|
+
}>;
|
|
29103
29203
|
}>>;
|
|
29104
29204
|
vacuumControl: import("@trpc/server").TRPCBuiltRouter<{
|
|
29105
29205
|
ctx: TrpcContext;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* scope+access check inside `protectedProcedure` (see
|
|
7
7
|
* `server/backend/src/api/trpc/trpc.middleware.ts`).
|
|
8
8
|
*
|
|
9
|
-
* Coverage:
|
|
9
|
+
* Coverage: 735 method paths across 112 capabilities.
|
|
10
10
|
*/
|
|
11
11
|
import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
|
|
12
12
|
export interface MethodAccessRecord {
|
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-Dqd2OlRi.js");
|
|
3
3
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
//#region src/health/wiring-health.ts
|
|
@@ -18751,7 +18751,20 @@ var snapshotCapability = {
|
|
|
18751
18751
|
invalidateCache: require_sleep.method(zod.z.object({ deviceId: zod.z.number() }), zod.z.void(), {
|
|
18752
18752
|
kind: "mutation",
|
|
18753
18753
|
auth: "admin"
|
|
18754
|
-
})
|
|
18754
|
+
}),
|
|
18755
|
+
/**
|
|
18756
|
+
* Cache-only batch overview — answers from the wrapper's in-memory cache in
|
|
18757
|
+
* O(n) and NEVER triggers a capture. Lets a grid skip requesting images for
|
|
18758
|
+
* devices that never produced a frame, and gives it an ETag per device for
|
|
18759
|
+
* conditional (304-able) image fetches. `lastCapturedAt`/`cacheAgeMs`/`etag`
|
|
18760
|
+
* are null for a device with no cached frame.
|
|
18761
|
+
*/
|
|
18762
|
+
getSnapshotOverview: require_sleep.systemMethod(zod.z.object({ deviceIds: zod.z.array(zod.z.number()).min(1).max(200) }), zod.z.array(zod.z.object({
|
|
18763
|
+
deviceId: zod.z.number(),
|
|
18764
|
+
lastCapturedAt: zod.z.number().nullable(),
|
|
18765
|
+
cacheAgeMs: zod.z.number().nullable(),
|
|
18766
|
+
etag: zod.z.string().nullable()
|
|
18767
|
+
})))
|
|
18755
18768
|
},
|
|
18756
18769
|
status: {
|
|
18757
18770
|
schema: SnapshotStatusSchema,
|
|
@@ -19175,6 +19188,15 @@ getTurnServers: require_sleep.method(zod.z.void(), zod.z.array(TurnServerSchema)
|
|
|
19175
19188
|
* - `listPasskeys({userId})` — enumerate user's enrolled credentials.
|
|
19176
19189
|
* - `removePasskey({userId, credentialId})` — revoke one credential.
|
|
19177
19190
|
*
|
|
19191
|
+
* 4. Second-factor preference (opt-in, default OFF):
|
|
19192
|
+
* Enrolling a passkey only enables passkey-FIRST sign-in. It is
|
|
19193
|
+
* demanded as a second factor after a password login ONLY when the
|
|
19194
|
+
* user explicitly opts in via `setSecondFactorPreference`.
|
|
19195
|
+
* - `getSecondFactorPreference({userId})` → `{ enabled }` (missing
|
|
19196
|
+
* row ⇒ `enabled: false`).
|
|
19197
|
+
* - `setSecondFactorPreference({userId, enabled})` — persisted by
|
|
19198
|
+
* the providing addon beside its credentials.
|
|
19199
|
+
*
|
|
19178
19200
|
* Challenges are short-lived (5 min, in-memory). The cap is internal —
|
|
19179
19201
|
* the admin-ui composes the begin/finish round-trip and never exposes
|
|
19180
19202
|
* the cap to non-admins.
|
|
@@ -19248,6 +19270,15 @@ response: zod.z.record(zod.z.string(), zod.z.unknown()) }), zod.z.object({
|
|
|
19248
19270
|
kind: "mutation",
|
|
19249
19271
|
auth: "admin",
|
|
19250
19272
|
access: "delete"
|
|
19273
|
+
}),
|
|
19274
|
+
getSecondFactorPreference: require_sleep.method(zod.z.object({ userId: zod.z.string() }), zod.z.object({ enabled: zod.z.boolean() }), { auth: "admin" }),
|
|
19275
|
+
setSecondFactorPreference: require_sleep.method(zod.z.object({
|
|
19276
|
+
userId: zod.z.string(),
|
|
19277
|
+
enabled: zod.z.boolean()
|
|
19278
|
+
}), zod.z.object({ success: zod.z.literal(true) }), {
|
|
19279
|
+
kind: "mutation",
|
|
19280
|
+
auth: "admin",
|
|
19281
|
+
access: "create"
|
|
19251
19282
|
})
|
|
19252
19283
|
}
|
|
19253
19284
|
};
|
|
@@ -27240,6 +27271,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27240
27271
|
addonId: null,
|
|
27241
27272
|
access: "view"
|
|
27242
27273
|
},
|
|
27274
|
+
"snapshot.getSnapshotOverview": {
|
|
27275
|
+
capName: "snapshot",
|
|
27276
|
+
capScope: "device",
|
|
27277
|
+
addonId: null,
|
|
27278
|
+
access: "view"
|
|
27279
|
+
},
|
|
27243
27280
|
"snapshot.invalidateCache": {
|
|
27244
27281
|
capName: "snapshot",
|
|
27245
27282
|
capScope: "device",
|
|
@@ -27948,6 +27985,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27948
27985
|
addonId: null,
|
|
27949
27986
|
access: "create"
|
|
27950
27987
|
},
|
|
27988
|
+
"userPasskeys.getSecondFactorPreference": {
|
|
27989
|
+
capName: "user-passkeys",
|
|
27990
|
+
capScope: "system",
|
|
27991
|
+
addonId: null,
|
|
27992
|
+
access: "view"
|
|
27993
|
+
},
|
|
27951
27994
|
"userPasskeys.listPasskeys": {
|
|
27952
27995
|
capName: "user-passkeys",
|
|
27953
27996
|
capScope: "system",
|
|
@@ -27960,6 +28003,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27960
28003
|
addonId: null,
|
|
27961
28004
|
access: "delete"
|
|
27962
28005
|
},
|
|
28006
|
+
"userPasskeys.setSecondFactorPreference": {
|
|
28007
|
+
capName: "user-passkeys",
|
|
28008
|
+
capScope: "system",
|
|
28009
|
+
addonId: null,
|
|
28010
|
+
access: "create"
|
|
28011
|
+
},
|
|
27963
28012
|
"vacuumControl.locate": {
|
|
27964
28013
|
capName: "vacuum-control",
|
|
27965
28014
|
capScope: "device",
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as StreamSourceSchema, A as parseJsonUnknown, B as CamProfileSchema, C as asBoolean, D as asString, E as asNumber, F as readinessKey, G as DecodedFrameSchema, H as CamStreamResolutionSchema, I as scopeKey, J as FrameHandleSchema, K as EncodedPacketSchema, L as BrokerStatsSchema, M as ReadinessRegistry, N as ReadinessTimeoutError, O as parseJsonArray, P as emitDownForOwnedCaps, Q as StreamSourceEntrySchema, R as BrokerStatusSchema, S as DeviceType, T as asJsonObject, U as CameraStreamSchema, V as CamStreamKindSchema, W as DecodedAudioChunkSchema, X as ProfileSlotSchema, Y as ProfileRtspEntrySchema, Z as ProfileSlotStatusSchema, _ as resolveCapMount, _t as collectHydratedFieldValues, a as viewerUiCapability, at as makeSourceBrokerId, b as DeviceFeature, bt as EventCategory, c as createLazyTrpcSource, ct as BaseAddon, d as DEVICE_SETTINGS_CONTRIBUTION_METHODS, dt as createEvent, et as SubscribeAudioChunksInputSchema, f as DEVICE_STATUS_METHOD, ft as emitReadiness, g as method, gt as collectHydratedFieldEntries, h as isDeviceConfigCap, ht as WELL_KNOWN_TAB_MAP, i as deviceOpsCapability, it as makeProfileBrokerId, j as DATAPLANE_SECRET_HEADER, k as parseJsonObject, l as createMirrorSource, lt as normalizeAddonInitResult, m as expandCapMethods, mt as WELL_KNOWN_TABS, n as sleepCancellable, nt as SubscribeFramesInputSchema, o as adminUiCapability, ot as parseProfileBrokerId, p as event, pt as isEvent, q as FrameHandleFormatSchema, r as RawStateResultSchema, rt as SubscribeFramesResultSchema, s as createDeviceProxy, st as selectAssignedProfileSlots, t as sleep, tt as SubscribeAudioChunksResultSchema, u as createSliceHandle, ut as createDurableState, v as systemMethod, vt as hydrateSchema, w as asJsonArray, x as DeviceRole, xt as DisposerChain, y as ChargingStatus, yt as resolveHydratedFieldValue, z as CAM_PROFILE_ORDER } from "./sleep-b4Jf2n33.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/health/wiring-health.ts
|
|
@@ -18750,7 +18750,20 @@ var snapshotCapability = {
|
|
|
18750
18750
|
invalidateCache: method(z.object({ deviceId: z.number() }), z.void(), {
|
|
18751
18751
|
kind: "mutation",
|
|
18752
18752
|
auth: "admin"
|
|
18753
|
-
})
|
|
18753
|
+
}),
|
|
18754
|
+
/**
|
|
18755
|
+
* Cache-only batch overview — answers from the wrapper's in-memory cache in
|
|
18756
|
+
* O(n) and NEVER triggers a capture. Lets a grid skip requesting images for
|
|
18757
|
+
* devices that never produced a frame, and gives it an ETag per device for
|
|
18758
|
+
* conditional (304-able) image fetches. `lastCapturedAt`/`cacheAgeMs`/`etag`
|
|
18759
|
+
* are null for a device with no cached frame.
|
|
18760
|
+
*/
|
|
18761
|
+
getSnapshotOverview: systemMethod(z.object({ deviceIds: z.array(z.number()).min(1).max(200) }), z.array(z.object({
|
|
18762
|
+
deviceId: z.number(),
|
|
18763
|
+
lastCapturedAt: z.number().nullable(),
|
|
18764
|
+
cacheAgeMs: z.number().nullable(),
|
|
18765
|
+
etag: z.string().nullable()
|
|
18766
|
+
})))
|
|
18754
18767
|
},
|
|
18755
18768
|
status: {
|
|
18756
18769
|
schema: SnapshotStatusSchema,
|
|
@@ -19174,6 +19187,15 @@ getTurnServers: method(z.void(), z.array(TurnServerSchema).readonly()) }
|
|
|
19174
19187
|
* - `listPasskeys({userId})` — enumerate user's enrolled credentials.
|
|
19175
19188
|
* - `removePasskey({userId, credentialId})` — revoke one credential.
|
|
19176
19189
|
*
|
|
19190
|
+
* 4. Second-factor preference (opt-in, default OFF):
|
|
19191
|
+
* Enrolling a passkey only enables passkey-FIRST sign-in. It is
|
|
19192
|
+
* demanded as a second factor after a password login ONLY when the
|
|
19193
|
+
* user explicitly opts in via `setSecondFactorPreference`.
|
|
19194
|
+
* - `getSecondFactorPreference({userId})` → `{ enabled }` (missing
|
|
19195
|
+
* row ⇒ `enabled: false`).
|
|
19196
|
+
* - `setSecondFactorPreference({userId, enabled})` — persisted by
|
|
19197
|
+
* the providing addon beside its credentials.
|
|
19198
|
+
*
|
|
19177
19199
|
* Challenges are short-lived (5 min, in-memory). The cap is internal —
|
|
19178
19200
|
* the admin-ui composes the begin/finish round-trip and never exposes
|
|
19179
19201
|
* the cap to non-admins.
|
|
@@ -19247,6 +19269,15 @@ response: z.record(z.string(), z.unknown()) }), z.object({
|
|
|
19247
19269
|
kind: "mutation",
|
|
19248
19270
|
auth: "admin",
|
|
19249
19271
|
access: "delete"
|
|
19272
|
+
}),
|
|
19273
|
+
getSecondFactorPreference: method(z.object({ userId: z.string() }), z.object({ enabled: z.boolean() }), { auth: "admin" }),
|
|
19274
|
+
setSecondFactorPreference: method(z.object({
|
|
19275
|
+
userId: z.string(),
|
|
19276
|
+
enabled: z.boolean()
|
|
19277
|
+
}), z.object({ success: z.literal(true) }), {
|
|
19278
|
+
kind: "mutation",
|
|
19279
|
+
auth: "admin",
|
|
19280
|
+
access: "create"
|
|
19250
19281
|
})
|
|
19251
19282
|
}
|
|
19252
19283
|
};
|
|
@@ -27239,6 +27270,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27239
27270
|
addonId: null,
|
|
27240
27271
|
access: "view"
|
|
27241
27272
|
},
|
|
27273
|
+
"snapshot.getSnapshotOverview": {
|
|
27274
|
+
capName: "snapshot",
|
|
27275
|
+
capScope: "device",
|
|
27276
|
+
addonId: null,
|
|
27277
|
+
access: "view"
|
|
27278
|
+
},
|
|
27242
27279
|
"snapshot.invalidateCache": {
|
|
27243
27280
|
capName: "snapshot",
|
|
27244
27281
|
capScope: "device",
|
|
@@ -27947,6 +27984,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27947
27984
|
addonId: null,
|
|
27948
27985
|
access: "create"
|
|
27949
27986
|
},
|
|
27987
|
+
"userPasskeys.getSecondFactorPreference": {
|
|
27988
|
+
capName: "user-passkeys",
|
|
27989
|
+
capScope: "system",
|
|
27990
|
+
addonId: null,
|
|
27991
|
+
access: "view"
|
|
27992
|
+
},
|
|
27950
27993
|
"userPasskeys.listPasskeys": {
|
|
27951
27994
|
capName: "user-passkeys",
|
|
27952
27995
|
capScope: "system",
|
|
@@ -27959,6 +28002,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
27959
28002
|
addonId: null,
|
|
27960
28003
|
access: "delete"
|
|
27961
28004
|
},
|
|
28005
|
+
"userPasskeys.setSecondFactorPreference": {
|
|
28006
|
+
capName: "user-passkeys",
|
|
28007
|
+
capScope: "system",
|
|
28008
|
+
addonId: null,
|
|
28009
|
+
access: "create"
|
|
28010
|
+
},
|
|
27962
28011
|
"vacuumControl.locate": {
|
|
27963
28012
|
capName: "vacuum-control",
|
|
27964
28013
|
capScope: "device",
|
|
@@ -2853,6 +2853,18 @@ function method(input, output, options) {
|
|
|
2853
2853
|
timeoutMs: options?.timeoutMs
|
|
2854
2854
|
};
|
|
2855
2855
|
}
|
|
2856
|
+
/**
|
|
2857
|
+
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
2858
|
+
* provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
|
|
2859
|
+
* driver natives don't stub out a wrapper concern (e.g. a cross-device cache
|
|
2860
|
+
* overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
|
|
2861
|
+
*/
|
|
2862
|
+
function systemMethod(input, output, options) {
|
|
2863
|
+
return {
|
|
2864
|
+
...method(input, output, options),
|
|
2865
|
+
systemOnly: true
|
|
2866
|
+
};
|
|
2867
|
+
}
|
|
2856
2868
|
/** Shorthand to define an event schema */
|
|
2857
2869
|
function event(data) {
|
|
2858
2870
|
return { data };
|
|
@@ -3443,6 +3455,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3443
3455
|
snapshot: {
|
|
3444
3456
|
getSnapshot: (input) => dispatch("snapshot", "snapshot", "getSnapshot", "query", input),
|
|
3445
3457
|
invalidateCache: (input) => dispatch("snapshot", "snapshot", "invalidateCache", "mutation", input),
|
|
3458
|
+
getSnapshotOverview: (input) => dispatch("snapshot", "snapshot", "getSnapshotOverview", "query", input),
|
|
3446
3459
|
getStatus: (input) => dispatch("snapshot", "snapshot", "getStatus", "query", input),
|
|
3447
3460
|
getDeviceSettingsContribution: (input) => dispatch("snapshot", "snapshot", "getDeviceSettingsContribution", "query", input),
|
|
3448
3461
|
getDeviceLiveContribution: (input) => dispatch("snapshot", "snapshot", "getDeviceLiveContribution", "query", input),
|
|
@@ -4290,6 +4303,12 @@ Object.defineProperty(exports, "sleepCancellable", {
|
|
|
4290
4303
|
return sleepCancellable;
|
|
4291
4304
|
}
|
|
4292
4305
|
});
|
|
4306
|
+
Object.defineProperty(exports, "systemMethod", {
|
|
4307
|
+
enumerable: true,
|
|
4308
|
+
get: function() {
|
|
4309
|
+
return systemMethod;
|
|
4310
|
+
}
|
|
4311
|
+
});
|
|
4293
4312
|
Object.defineProperty(exports, "viewerUiCapability", {
|
|
4294
4313
|
enumerable: true,
|
|
4295
4314
|
get: function() {
|
|
@@ -2853,6 +2853,18 @@ function method(input, output, options) {
|
|
|
2853
2853
|
timeoutMs: options?.timeoutMs
|
|
2854
2854
|
};
|
|
2855
2855
|
}
|
|
2856
|
+
/**
|
|
2857
|
+
* A wrapper/system-only method: served exclusively by the cap's system-level
|
|
2858
|
+
* provider (`InferProvider`), and OPTIONAL on `InferNativeProvider` so per-device
|
|
2859
|
+
* driver natives don't stub out a wrapper concern (e.g. a cross-device cache
|
|
2860
|
+
* overview). The `systemOnly: true` literal is what `InferNativeProvider` keys on.
|
|
2861
|
+
*/
|
|
2862
|
+
function systemMethod(input, output, options) {
|
|
2863
|
+
return {
|
|
2864
|
+
...method(input, output, options),
|
|
2865
|
+
systemOnly: true
|
|
2866
|
+
};
|
|
2867
|
+
}
|
|
2856
2868
|
/** Shorthand to define an event schema */
|
|
2857
2869
|
function event(data) {
|
|
2858
2870
|
return { data };
|
|
@@ -3443,6 +3455,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
3443
3455
|
snapshot: {
|
|
3444
3456
|
getSnapshot: (input) => dispatch("snapshot", "snapshot", "getSnapshot", "query", input),
|
|
3445
3457
|
invalidateCache: (input) => dispatch("snapshot", "snapshot", "invalidateCache", "mutation", input),
|
|
3458
|
+
getSnapshotOverview: (input) => dispatch("snapshot", "snapshot", "getSnapshotOverview", "query", input),
|
|
3446
3459
|
getStatus: (input) => dispatch("snapshot", "snapshot", "getStatus", "query", input),
|
|
3447
3460
|
getDeviceSettingsContribution: (input) => dispatch("snapshot", "snapshot", "getDeviceSettingsContribution", "query", input),
|
|
3448
3461
|
getDeviceLiveContribution: (input) => dispatch("snapshot", "snapshot", "getDeviceLiveContribution", "query", input),
|
|
@@ -3852,4 +3865,4 @@ function sleepCancellable(ms, signal) {
|
|
|
3852
3865
|
});
|
|
3853
3866
|
}
|
|
3854
3867
|
//#endregion
|
|
3855
|
-
export {
|
|
3868
|
+
export { StreamSourceSchema as $, parseJsonUnknown as A, CamProfileSchema as B, asBoolean as C, asString as D, asNumber as E, readinessKey as F, DecodedFrameSchema as G, CamStreamResolutionSchema as H, scopeKey as I, FrameHandleSchema as J, EncodedPacketSchema as K, BrokerStatsSchema as L, ReadinessRegistry as M, ReadinessTimeoutError as N, parseJsonArray as O, emitDownForOwnedCaps as P, StreamSourceEntrySchema$1 as Q, BrokerStatusSchema as R, DeviceType as S, asJsonObject as T, CameraStreamSchema as U, CamStreamKindSchema as V, DecodedAudioChunkSchema as W, ProfileSlotSchema as X, ProfileRtspEntrySchema as Y, ProfileSlotStatusSchema as Z, resolveCapMount as _, collectHydratedFieldValues as _t, viewerUiCapability as a, makeSourceBrokerId as at, DeviceFeature as b, EventCategory as bt, createLazyTrpcSource as c, BaseAddon as ct, DEVICE_SETTINGS_CONTRIBUTION_METHODS as d, createEvent as dt, SubscribeAudioChunksInputSchema as et, DEVICE_STATUS_METHOD as f, emitReadiness as ft, method as g, collectHydratedFieldEntries as gt, isDeviceConfigCap as h, WELL_KNOWN_TAB_MAP as ht, deviceOpsCapability as i, makeProfileBrokerId as it, DATAPLANE_SECRET_HEADER as j, parseJsonObject as k, createMirrorSource as l, normalizeAddonInitResult as lt, expandCapMethods as m, WELL_KNOWN_TABS as mt, sleepCancellable as n, SubscribeFramesInputSchema as nt, adminUiCapability as o, parseProfileBrokerId as ot, event as p, isEvent as pt, FrameHandleFormatSchema as q, RawStateResultSchema as r, SubscribeFramesResultSchema as rt, createDeviceProxy as s, selectAssignedProfileSlots as st, sleep as t, SubscribeAudioChunksResultSchema as tt, createSliceHandle as u, createDurableState as ut, systemMethod as v, hydrateSchema as vt, asJsonArray as w, DeviceRole as x, DisposerChain as xt, ChargingStatus as y, resolveHydratedFieldValue as yt, CAM_PROFILE_ORDER as z };
|