@camstack/types 1.1.36 → 1.1.37

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.
@@ -23,6 +23,19 @@ import { type InferProvider } from './capability-definition.js';
23
23
  * b. `finishAuthentication({userId, response})` → server verifies
24
24
  * the assertion, bumps the credential counter, returns ok.
25
25
  *
26
+ * 2b. Usernameless (discoverable-credential) authentication — the
27
+ * passkey IS the primary factor, no password leg:
28
+ * a. `beginDiscoverableAuthentication({})` → assertion options with
29
+ * EMPTY `allowCredentials` (the browser offers every resident
30
+ * passkey it holds for this RP) + `userVerification: 'required'`
31
+ * (the passkey replaces both factors, so UV is mandatory).
32
+ * The challenge is stored server-side, NOT bound to any user.
33
+ * b. `finishDiscoverableAuthentication({response})` → the provider
34
+ * resolves the credential by the response's credential id,
35
+ * verifies the assertion against the stored challenge + that
36
+ * credential's public key/counter, and returns the OWNING
37
+ * `userId` — the caller (core auth router) mints the session.
38
+ *
26
39
  * 3. Management:
27
40
  * - `listPasskeys({userId})` — enumerate user's enrolled credentials.
28
41
  * - `removePasskey({userId, credentialId})` — revoke one credential.
@@ -70,6 +83,15 @@ export declare const userPasskeysCapability: {
70
83
  }, z.core.$strip>, z.ZodObject<{
71
84
  verified: z.ZodBoolean;
72
85
  }, z.core.$strip>, "mutation">;
86
+ readonly beginDiscoverableAuthentication: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
87
+ optionsJSON: z.ZodRecord<z.ZodString, z.ZodUnknown>;
88
+ }, z.core.$strip>, "mutation">;
89
+ readonly finishDiscoverableAuthentication: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
90
+ response: z.ZodRecord<z.ZodString, z.ZodUnknown>;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ verified: z.ZodBoolean;
93
+ userId: z.ZodNullable<z.ZodString>;
94
+ }, z.core.$strip>, "mutation">;
73
95
  readonly listPasskeys: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
74
96
  userId: z.ZodString;
75
97
  }, z.core.$strip>, z.ZodArray<z.ZodObject<{
@@ -518,23 +518,14 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
518
518
  category?: string | undefined;
519
519
  limit?: number | undefined;
520
520
  } | undefined;
521
- output: readonly import("@camstack/system").SystemEvent[];
521
+ output: readonly import("@camstack/types").SystemEvent[];
522
522
  meta: object;
523
523
  }>;
524
524
  onEvent: import("@trpc/server").TRPCSubscriptionProcedure<{
525
525
  input: {
526
526
  category?: string | undefined;
527
527
  };
528
- output: AsyncIterable<{
529
- id: string;
530
- timestamp: Date;
531
- source: {
532
- type: string;
533
- id: string | number;
534
- };
535
- category: string;
536
- data: Record<string, unknown>;
537
- }, any, any>;
528
+ output: AsyncIterable<import("@camstack/types").SystemEvent, any, any>;
538
529
  meta: object;
539
530
  }>;
540
531
  onDeviceEvent: import("@trpc/server").TRPCSubscriptionProcedure<{
@@ -700,6 +691,29 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
700
691
  };
701
692
  meta: object;
702
693
  }>;
694
+ passkeyLoginBegin: import("@trpc/server").TRPCMutationProcedure<{
695
+ input: void;
696
+ output: {
697
+ optionsJSON: Record<string, unknown>;
698
+ };
699
+ meta: object;
700
+ }>;
701
+ passkeyLoginFinish: import("@trpc/server").TRPCMutationProcedure<{
702
+ input: {
703
+ response: Record<string, unknown>;
704
+ };
705
+ output: {
706
+ token: string;
707
+ user: {
708
+ id: string;
709
+ username: string;
710
+ isAdmin: boolean;
711
+ };
712
+ requiresTotp?: boolean | undefined;
713
+ secondFactors?: ("totp" | "passkey")[] | undefined;
714
+ };
715
+ meta: object;
716
+ }>;
703
717
  me: import("@trpc/server").TRPCQueryProcedure<{
704
718
  input: void;
705
719
  output: {
@@ -796,6 +810,47 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
796
810
  };
797
811
  meta: object;
798
812
  }>;
813
+ createShareToken: import("@trpc/server").TRPCMutationProcedure<{
814
+ input: {
815
+ scope: {
816
+ kind: "grid-view";
817
+ deviceIds: number[];
818
+ };
819
+ ttlSec?: number | "never" | undefined;
820
+ };
821
+ output: {
822
+ id: string;
823
+ token: string;
824
+ expiresAt: number | null;
825
+ };
826
+ meta: object;
827
+ }>;
828
+ revokeShareToken: import("@trpc/server").TRPCMutationProcedure<{
829
+ input: {
830
+ id: string;
831
+ };
832
+ output: {
833
+ success: boolean;
834
+ };
835
+ meta: object;
836
+ }>;
837
+ listShareTokens: import("@trpc/server").TRPCQueryProcedure<{
838
+ input: void;
839
+ output: {
840
+ id: string;
841
+ userId: string;
842
+ tokenPrefix: string;
843
+ scope: {
844
+ kind: "grid-view";
845
+ deviceIds: number[];
846
+ };
847
+ createdAt: number;
848
+ expiresAt: number | null;
849
+ neverExpires: boolean;
850
+ lastUsedAt?: number | undefined;
851
+ }[];
852
+ meta: object;
853
+ }>;
799
854
  logout: import("@trpc/server").TRPCMutationProcedure<{
800
855
  input: void;
801
856
  output: {
@@ -14096,6 +14151,26 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
14096
14151
  };
14097
14152
  meta: object;
14098
14153
  }>;
14154
+ beginDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
14155
+ input: {
14156
+ [x: string]: unknown;
14157
+ };
14158
+ output: {
14159
+ optionsJSON: Record<string, unknown>;
14160
+ };
14161
+ meta: object;
14162
+ }>;
14163
+ finishDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
14164
+ input: {
14165
+ [x: string]: unknown;
14166
+ response: Record<string, unknown>;
14167
+ };
14168
+ output: {
14169
+ verified: boolean;
14170
+ userId: string | null;
14171
+ };
14172
+ meta: object;
14173
+ }>;
14099
14174
  listPasskeys: import("@trpc/server").TRPCQueryProcedure<{
14100
14175
  input: {
14101
14176
  [x: string]: unknown;
@@ -14299,14 +14374,18 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
14299
14374
  input: {
14300
14375
  nodeId?: string | undefined;
14301
14376
  } | undefined;
14302
- output: any;
14377
+ output: {
14378
+ staticDir: string;
14379
+ };
14303
14380
  meta: object;
14304
14381
  }>;
14305
14382
  getVersion: import("@trpc/server").TRPCQueryProcedure<{
14306
14383
  input: {
14307
14384
  nodeId?: string | undefined;
14308
14385
  } | undefined;
14309
- output: any;
14386
+ output: {
14387
+ version: string;
14388
+ };
14310
14389
  meta: object;
14311
14390
  }>;
14312
14391
  }>>;
@@ -15267,23 +15346,14 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
15267
15346
  category?: string | undefined;
15268
15347
  limit?: number | undefined;
15269
15348
  } | undefined;
15270
- output: readonly import("@camstack/system").SystemEvent[];
15349
+ output: readonly import("@camstack/types").SystemEvent[];
15271
15350
  meta: object;
15272
15351
  }>;
15273
15352
  onEvent: import("@trpc/server").TRPCSubscriptionProcedure<{
15274
15353
  input: {
15275
15354
  category?: string | undefined;
15276
15355
  };
15277
- output: AsyncIterable<{
15278
- id: string;
15279
- timestamp: Date;
15280
- source: {
15281
- type: string;
15282
- id: string | number;
15283
- };
15284
- category: string;
15285
- data: Record<string, unknown>;
15286
- }, any, any>;
15356
+ output: AsyncIterable<import("@camstack/types").SystemEvent, any, any>;
15287
15357
  meta: object;
15288
15358
  }>;
15289
15359
  onDeviceEvent: import("@trpc/server").TRPCSubscriptionProcedure<{
@@ -15449,6 +15519,29 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
15449
15519
  };
15450
15520
  meta: object;
15451
15521
  }>;
15522
+ passkeyLoginBegin: import("@trpc/server").TRPCMutationProcedure<{
15523
+ input: void;
15524
+ output: {
15525
+ optionsJSON: Record<string, unknown>;
15526
+ };
15527
+ meta: object;
15528
+ }>;
15529
+ passkeyLoginFinish: import("@trpc/server").TRPCMutationProcedure<{
15530
+ input: {
15531
+ response: Record<string, unknown>;
15532
+ };
15533
+ output: {
15534
+ token: string;
15535
+ user: {
15536
+ id: string;
15537
+ username: string;
15538
+ isAdmin: boolean;
15539
+ };
15540
+ requiresTotp?: boolean | undefined;
15541
+ secondFactors?: ("totp" | "passkey")[] | undefined;
15542
+ };
15543
+ meta: object;
15544
+ }>;
15452
15545
  me: import("@trpc/server").TRPCQueryProcedure<{
15453
15546
  input: void;
15454
15547
  output: {
@@ -15545,6 +15638,47 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
15545
15638
  };
15546
15639
  meta: object;
15547
15640
  }>;
15641
+ createShareToken: import("@trpc/server").TRPCMutationProcedure<{
15642
+ input: {
15643
+ scope: {
15644
+ kind: "grid-view";
15645
+ deviceIds: number[];
15646
+ };
15647
+ ttlSec?: number | "never" | undefined;
15648
+ };
15649
+ output: {
15650
+ id: string;
15651
+ token: string;
15652
+ expiresAt: number | null;
15653
+ };
15654
+ meta: object;
15655
+ }>;
15656
+ revokeShareToken: import("@trpc/server").TRPCMutationProcedure<{
15657
+ input: {
15658
+ id: string;
15659
+ };
15660
+ output: {
15661
+ success: boolean;
15662
+ };
15663
+ meta: object;
15664
+ }>;
15665
+ listShareTokens: import("@trpc/server").TRPCQueryProcedure<{
15666
+ input: void;
15667
+ output: {
15668
+ id: string;
15669
+ userId: string;
15670
+ tokenPrefix: string;
15671
+ scope: {
15672
+ kind: "grid-view";
15673
+ deviceIds: number[];
15674
+ };
15675
+ createdAt: number;
15676
+ expiresAt: number | null;
15677
+ neverExpires: boolean;
15678
+ lastUsedAt?: number | undefined;
15679
+ }[];
15680
+ meta: object;
15681
+ }>;
15548
15682
  logout: import("@trpc/server").TRPCMutationProcedure<{
15549
15683
  input: void;
15550
15684
  output: {
@@ -28845,6 +28979,26 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
28845
28979
  };
28846
28980
  meta: object;
28847
28981
  }>;
28982
+ beginDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
28983
+ input: {
28984
+ [x: string]: unknown;
28985
+ };
28986
+ output: {
28987
+ optionsJSON: Record<string, unknown>;
28988
+ };
28989
+ meta: object;
28990
+ }>;
28991
+ finishDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
28992
+ input: {
28993
+ [x: string]: unknown;
28994
+ response: Record<string, unknown>;
28995
+ };
28996
+ output: {
28997
+ verified: boolean;
28998
+ userId: string | null;
28999
+ };
29000
+ meta: object;
29001
+ }>;
28848
29002
  listPasskeys: import("@trpc/server").TRPCQueryProcedure<{
28849
29003
  input: {
28850
29004
  [x: string]: unknown;
@@ -29048,14 +29202,18 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
29048
29202
  input: {
29049
29203
  nodeId?: string | undefined;
29050
29204
  } | undefined;
29051
- output: any;
29205
+ output: {
29206
+ staticDir: string;
29207
+ };
29052
29208
  meta: object;
29053
29209
  }>;
29054
29210
  getVersion: import("@trpc/server").TRPCQueryProcedure<{
29055
29211
  input: {
29056
29212
  nodeId?: string | undefined;
29057
29213
  } | undefined;
29058
- output: any;
29214
+ output: {
29215
+ version: string;
29216
+ };
29059
29217
  meta: object;
29060
29218
  }>;
29061
29219
  }>>;
@@ -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: 730 method paths across 112 capabilities.
9
+ * Coverage: 732 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
@@ -19158,6 +19158,19 @@ getTurnServers: require_sleep.method(zod.z.void(), zod.z.array(TurnServerSchema)
19158
19158
  * b. `finishAuthentication({userId, response})` → server verifies
19159
19159
  * the assertion, bumps the credential counter, returns ok.
19160
19160
  *
19161
+ * 2b. Usernameless (discoverable-credential) authentication — the
19162
+ * passkey IS the primary factor, no password leg:
19163
+ * a. `beginDiscoverableAuthentication({})` → assertion options with
19164
+ * EMPTY `allowCredentials` (the browser offers every resident
19165
+ * passkey it holds for this RP) + `userVerification: 'required'`
19166
+ * (the passkey replaces both factors, so UV is mandatory).
19167
+ * The challenge is stored server-side, NOT bound to any user.
19168
+ * b. `finishDiscoverableAuthentication({response})` → the provider
19169
+ * resolves the credential by the response's credential id,
19170
+ * verifies the assertion against the stored challenge + that
19171
+ * credential's public key/counter, and returns the OWNING
19172
+ * `userId` — the caller (core auth router) mints the session.
19173
+ *
19161
19174
  * 3. Management:
19162
19175
  * - `listPasskeys({userId})` — enumerate user's enrolled credentials.
19163
19176
  * - `removePasskey({userId, credentialId})` — revoke one credential.
@@ -19214,6 +19227,19 @@ var userPasskeysCapability = {
19214
19227
  kind: "mutation",
19215
19228
  access: "view"
19216
19229
  }),
19230
+ beginDiscoverableAuthentication: require_sleep.method(zod.z.object({}), zod.z.object({ optionsJSON: zod.z.record(zod.z.string(), zod.z.unknown()) }), {
19231
+ kind: "mutation",
19232
+ access: "view"
19233
+ }),
19234
+ finishDiscoverableAuthentication: require_sleep.method(zod.z.object({
19235
+ /** AuthenticationResponseJSON from the browser. */
19236
+ response: zod.z.record(zod.z.string(), zod.z.unknown()) }), zod.z.object({
19237
+ verified: zod.z.boolean(),
19238
+ userId: zod.z.string().nullable()
19239
+ }), {
19240
+ kind: "mutation",
19241
+ access: "view"
19242
+ }),
19217
19243
  listPasskeys: require_sleep.method(zod.z.object({ userId: zod.z.string() }), zod.z.array(PasskeySummarySchema), { auth: "admin" }),
19218
19244
  removePasskey: require_sleep.method(zod.z.object({
19219
19245
  userId: zod.z.string(),
@@ -27892,6 +27918,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
27892
27918
  addonId: null,
27893
27919
  access: "view"
27894
27920
  },
27921
+ "userPasskeys.beginDiscoverableAuthentication": {
27922
+ capName: "user-passkeys",
27923
+ capScope: "system",
27924
+ addonId: null,
27925
+ access: "view"
27926
+ },
27895
27927
  "userPasskeys.beginRegistration": {
27896
27928
  capName: "user-passkeys",
27897
27929
  capScope: "system",
@@ -27904,6 +27936,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
27904
27936
  addonId: null,
27905
27937
  access: "view"
27906
27938
  },
27939
+ "userPasskeys.finishDiscoverableAuthentication": {
27940
+ capName: "user-passkeys",
27941
+ capScope: "system",
27942
+ addonId: null,
27943
+ access: "view"
27944
+ },
27907
27945
  "userPasskeys.finishRegistration": {
27908
27946
  capName: "user-passkeys",
27909
27947
  capScope: "system",
package/dist/index.mjs CHANGED
@@ -19157,6 +19157,19 @@ getTurnServers: method(z.void(), z.array(TurnServerSchema).readonly()) }
19157
19157
  * b. `finishAuthentication({userId, response})` → server verifies
19158
19158
  * the assertion, bumps the credential counter, returns ok.
19159
19159
  *
19160
+ * 2b. Usernameless (discoverable-credential) authentication — the
19161
+ * passkey IS the primary factor, no password leg:
19162
+ * a. `beginDiscoverableAuthentication({})` → assertion options with
19163
+ * EMPTY `allowCredentials` (the browser offers every resident
19164
+ * passkey it holds for this RP) + `userVerification: 'required'`
19165
+ * (the passkey replaces both factors, so UV is mandatory).
19166
+ * The challenge is stored server-side, NOT bound to any user.
19167
+ * b. `finishDiscoverableAuthentication({response})` → the provider
19168
+ * resolves the credential by the response's credential id,
19169
+ * verifies the assertion against the stored challenge + that
19170
+ * credential's public key/counter, and returns the OWNING
19171
+ * `userId` — the caller (core auth router) mints the session.
19172
+ *
19160
19173
  * 3. Management:
19161
19174
  * - `listPasskeys({userId})` — enumerate user's enrolled credentials.
19162
19175
  * - `removePasskey({userId, credentialId})` — revoke one credential.
@@ -19213,6 +19226,19 @@ var userPasskeysCapability = {
19213
19226
  kind: "mutation",
19214
19227
  access: "view"
19215
19228
  }),
19229
+ beginDiscoverableAuthentication: method(z.object({}), z.object({ optionsJSON: z.record(z.string(), z.unknown()) }), {
19230
+ kind: "mutation",
19231
+ access: "view"
19232
+ }),
19233
+ finishDiscoverableAuthentication: method(z.object({
19234
+ /** AuthenticationResponseJSON from the browser. */
19235
+ response: z.record(z.string(), z.unknown()) }), z.object({
19236
+ verified: z.boolean(),
19237
+ userId: z.string().nullable()
19238
+ }), {
19239
+ kind: "mutation",
19240
+ access: "view"
19241
+ }),
19216
19242
  listPasskeys: method(z.object({ userId: z.string() }), z.array(PasskeySummarySchema), { auth: "admin" }),
19217
19243
  removePasskey: method(z.object({
19218
19244
  userId: z.string(),
@@ -27891,6 +27917,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
27891
27917
  addonId: null,
27892
27918
  access: "view"
27893
27919
  },
27920
+ "userPasskeys.beginDiscoverableAuthentication": {
27921
+ capName: "user-passkeys",
27922
+ capScope: "system",
27923
+ addonId: null,
27924
+ access: "view"
27925
+ },
27894
27926
  "userPasskeys.beginRegistration": {
27895
27927
  capName: "user-passkeys",
27896
27928
  capScope: "system",
@@ -27903,6 +27935,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
27903
27935
  addonId: null,
27904
27936
  access: "view"
27905
27937
  },
27938
+ "userPasskeys.finishDiscoverableAuthentication": {
27939
+ capName: "user-passkeys",
27940
+ capScope: "system",
27941
+ addonId: null,
27942
+ access: "view"
27943
+ },
27906
27944
  "userPasskeys.finishRegistration": {
27907
27945
  capName: "user-passkeys",
27908
27946
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.1.36",
3
+ "version": "1.1.37",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",