@camstack/types 1.1.36 → 1.1.38

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,67 @@ 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
+ }>;
717
+ exchangeSession: import("@trpc/server").TRPCMutationProcedure<{
718
+ input: Record<string, never> | undefined;
719
+ output: {
720
+ token: string;
721
+ user: {
722
+ id: string;
723
+ username: string;
724
+ isAdmin: boolean;
725
+ };
726
+ requiresTotp?: boolean | undefined;
727
+ secondFactors?: ("totp" | "passkey")[] | undefined;
728
+ };
729
+ meta: object;
730
+ }>;
731
+ createHandoffCode: import("@trpc/server").TRPCMutationProcedure<{
732
+ input: void;
733
+ output: {
734
+ code: string;
735
+ expiresAt: number;
736
+ };
737
+ meta: object;
738
+ }>;
739
+ redeemHandoffCode: import("@trpc/server").TRPCMutationProcedure<{
740
+ input: {
741
+ code: string;
742
+ };
743
+ output: {
744
+ token: string;
745
+ user: {
746
+ id: string;
747
+ username: string;
748
+ isAdmin: boolean;
749
+ };
750
+ requiresTotp?: boolean | undefined;
751
+ secondFactors?: ("totp" | "passkey")[] | undefined;
752
+ };
753
+ meta: object;
754
+ }>;
703
755
  me: import("@trpc/server").TRPCQueryProcedure<{
704
756
  input: void;
705
757
  output: {
@@ -796,6 +848,47 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
796
848
  };
797
849
  meta: object;
798
850
  }>;
851
+ createShareToken: import("@trpc/server").TRPCMutationProcedure<{
852
+ input: {
853
+ scope: {
854
+ kind: "grid-view";
855
+ deviceIds: number[];
856
+ };
857
+ ttlSec?: number | "never" | undefined;
858
+ };
859
+ output: {
860
+ id: string;
861
+ token: string;
862
+ expiresAt: number | null;
863
+ };
864
+ meta: object;
865
+ }>;
866
+ revokeShareToken: import("@trpc/server").TRPCMutationProcedure<{
867
+ input: {
868
+ id: string;
869
+ };
870
+ output: {
871
+ success: boolean;
872
+ };
873
+ meta: object;
874
+ }>;
875
+ listShareTokens: import("@trpc/server").TRPCQueryProcedure<{
876
+ input: void;
877
+ output: {
878
+ id: string;
879
+ userId: string;
880
+ tokenPrefix: string;
881
+ scope: {
882
+ kind: "grid-view";
883
+ deviceIds: number[];
884
+ };
885
+ createdAt: number;
886
+ expiresAt: number | null;
887
+ neverExpires: boolean;
888
+ lastUsedAt?: number | undefined;
889
+ }[];
890
+ meta: object;
891
+ }>;
799
892
  logout: import("@trpc/server").TRPCMutationProcedure<{
800
893
  input: void;
801
894
  output: {
@@ -14096,6 +14189,26 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
14096
14189
  };
14097
14190
  meta: object;
14098
14191
  }>;
14192
+ beginDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
14193
+ input: {
14194
+ [x: string]: unknown;
14195
+ };
14196
+ output: {
14197
+ optionsJSON: Record<string, unknown>;
14198
+ };
14199
+ meta: object;
14200
+ }>;
14201
+ finishDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
14202
+ input: {
14203
+ [x: string]: unknown;
14204
+ response: Record<string, unknown>;
14205
+ };
14206
+ output: {
14207
+ verified: boolean;
14208
+ userId: string | null;
14209
+ };
14210
+ meta: object;
14211
+ }>;
14099
14212
  listPasskeys: import("@trpc/server").TRPCQueryProcedure<{
14100
14213
  input: {
14101
14214
  [x: string]: unknown;
@@ -14299,14 +14412,18 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
14299
14412
  input: {
14300
14413
  nodeId?: string | undefined;
14301
14414
  } | undefined;
14302
- output: any;
14415
+ output: {
14416
+ staticDir: string;
14417
+ };
14303
14418
  meta: object;
14304
14419
  }>;
14305
14420
  getVersion: import("@trpc/server").TRPCQueryProcedure<{
14306
14421
  input: {
14307
14422
  nodeId?: string | undefined;
14308
14423
  } | undefined;
14309
- output: any;
14424
+ output: {
14425
+ version: string;
14426
+ };
14310
14427
  meta: object;
14311
14428
  }>;
14312
14429
  }>>;
@@ -15267,23 +15384,14 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
15267
15384
  category?: string | undefined;
15268
15385
  limit?: number | undefined;
15269
15386
  } | undefined;
15270
- output: readonly import("@camstack/system").SystemEvent[];
15387
+ output: readonly import("@camstack/types").SystemEvent[];
15271
15388
  meta: object;
15272
15389
  }>;
15273
15390
  onEvent: import("@trpc/server").TRPCSubscriptionProcedure<{
15274
15391
  input: {
15275
15392
  category?: string | undefined;
15276
15393
  };
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>;
15394
+ output: AsyncIterable<import("@camstack/types").SystemEvent, any, any>;
15287
15395
  meta: object;
15288
15396
  }>;
15289
15397
  onDeviceEvent: import("@trpc/server").TRPCSubscriptionProcedure<{
@@ -15449,6 +15557,67 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
15449
15557
  };
15450
15558
  meta: object;
15451
15559
  }>;
15560
+ passkeyLoginBegin: import("@trpc/server").TRPCMutationProcedure<{
15561
+ input: void;
15562
+ output: {
15563
+ optionsJSON: Record<string, unknown>;
15564
+ };
15565
+ meta: object;
15566
+ }>;
15567
+ passkeyLoginFinish: import("@trpc/server").TRPCMutationProcedure<{
15568
+ input: {
15569
+ response: Record<string, unknown>;
15570
+ };
15571
+ output: {
15572
+ token: string;
15573
+ user: {
15574
+ id: string;
15575
+ username: string;
15576
+ isAdmin: boolean;
15577
+ };
15578
+ requiresTotp?: boolean | undefined;
15579
+ secondFactors?: ("totp" | "passkey")[] | undefined;
15580
+ };
15581
+ meta: object;
15582
+ }>;
15583
+ exchangeSession: import("@trpc/server").TRPCMutationProcedure<{
15584
+ input: Record<string, never> | undefined;
15585
+ output: {
15586
+ token: string;
15587
+ user: {
15588
+ id: string;
15589
+ username: string;
15590
+ isAdmin: boolean;
15591
+ };
15592
+ requiresTotp?: boolean | undefined;
15593
+ secondFactors?: ("totp" | "passkey")[] | undefined;
15594
+ };
15595
+ meta: object;
15596
+ }>;
15597
+ createHandoffCode: import("@trpc/server").TRPCMutationProcedure<{
15598
+ input: void;
15599
+ output: {
15600
+ code: string;
15601
+ expiresAt: number;
15602
+ };
15603
+ meta: object;
15604
+ }>;
15605
+ redeemHandoffCode: import("@trpc/server").TRPCMutationProcedure<{
15606
+ input: {
15607
+ code: string;
15608
+ };
15609
+ output: {
15610
+ token: string;
15611
+ user: {
15612
+ id: string;
15613
+ username: string;
15614
+ isAdmin: boolean;
15615
+ };
15616
+ requiresTotp?: boolean | undefined;
15617
+ secondFactors?: ("totp" | "passkey")[] | undefined;
15618
+ };
15619
+ meta: object;
15620
+ }>;
15452
15621
  me: import("@trpc/server").TRPCQueryProcedure<{
15453
15622
  input: void;
15454
15623
  output: {
@@ -15545,6 +15714,47 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
15545
15714
  };
15546
15715
  meta: object;
15547
15716
  }>;
15717
+ createShareToken: import("@trpc/server").TRPCMutationProcedure<{
15718
+ input: {
15719
+ scope: {
15720
+ kind: "grid-view";
15721
+ deviceIds: number[];
15722
+ };
15723
+ ttlSec?: number | "never" | undefined;
15724
+ };
15725
+ output: {
15726
+ id: string;
15727
+ token: string;
15728
+ expiresAt: number | null;
15729
+ };
15730
+ meta: object;
15731
+ }>;
15732
+ revokeShareToken: import("@trpc/server").TRPCMutationProcedure<{
15733
+ input: {
15734
+ id: string;
15735
+ };
15736
+ output: {
15737
+ success: boolean;
15738
+ };
15739
+ meta: object;
15740
+ }>;
15741
+ listShareTokens: import("@trpc/server").TRPCQueryProcedure<{
15742
+ input: void;
15743
+ output: {
15744
+ id: string;
15745
+ userId: string;
15746
+ tokenPrefix: string;
15747
+ scope: {
15748
+ kind: "grid-view";
15749
+ deviceIds: number[];
15750
+ };
15751
+ createdAt: number;
15752
+ expiresAt: number | null;
15753
+ neverExpires: boolean;
15754
+ lastUsedAt?: number | undefined;
15755
+ }[];
15756
+ meta: object;
15757
+ }>;
15548
15758
  logout: import("@trpc/server").TRPCMutationProcedure<{
15549
15759
  input: void;
15550
15760
  output: {
@@ -28845,6 +29055,26 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
28845
29055
  };
28846
29056
  meta: object;
28847
29057
  }>;
29058
+ beginDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
29059
+ input: {
29060
+ [x: string]: unknown;
29061
+ };
29062
+ output: {
29063
+ optionsJSON: Record<string, unknown>;
29064
+ };
29065
+ meta: object;
29066
+ }>;
29067
+ finishDiscoverableAuthentication: import("@trpc/server").TRPCMutationProcedure<{
29068
+ input: {
29069
+ [x: string]: unknown;
29070
+ response: Record<string, unknown>;
29071
+ };
29072
+ output: {
29073
+ verified: boolean;
29074
+ userId: string | null;
29075
+ };
29076
+ meta: object;
29077
+ }>;
28848
29078
  listPasskeys: import("@trpc/server").TRPCQueryProcedure<{
28849
29079
  input: {
28850
29080
  [x: string]: unknown;
@@ -29048,14 +29278,18 @@ export type AppRouter = import("@trpc/server/unstable-core-do-not-import").Route
29048
29278
  input: {
29049
29279
  nodeId?: string | undefined;
29050
29280
  } | undefined;
29051
- output: any;
29281
+ output: {
29282
+ staticDir: string;
29283
+ };
29052
29284
  meta: object;
29053
29285
  }>;
29054
29286
  getVersion: import("@trpc/server").TRPCQueryProcedure<{
29055
29287
  input: {
29056
29288
  nodeId?: string | undefined;
29057
29289
  } | undefined;
29058
- output: any;
29290
+ output: {
29291
+ version: string;
29292
+ };
29059
29293
  meta: object;
29060
29294
  }>;
29061
29295
  }>>;
@@ -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.38",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",