@oxyhq/contracts 0.14.0 → 0.14.2

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.
@@ -0,0 +1,83 @@
1
+ /**
2
+ * WebAuthn / passkey ceremony contracts (Fase B/b1).
3
+ *
4
+ * These schemas describe ONLY the outer Oxy envelope that wraps a WebAuthn
5
+ * ceremony request — the username the client is registering/authenticating as,
6
+ * plus the device-session options every first-party sign-in accepts. The browser
7
+ * `RegistrationResponseJSON` / `AuthenticationResponseJSON` payloads are NOT
8
+ * mirrored here: they are validated by `@simplewebauthn/server` inside the route
9
+ * (`verifyRegistrationResponse` / `verifyAuthenticationResponse`), which is the
10
+ * single source of truth for their structure. Re-encoding them in Zod would just
11
+ * create a second, drift-prone definition of a shape we do not own.
12
+ */
13
+ import { z } from 'zod';
14
+ /**
15
+ * `POST /webauthn/register/options` — request registration options. With a bearer
16
+ * token the caller links a passkey to their signed-in account and `username` is
17
+ * ignored; without one it is a prospective signup and `username` is the desired
18
+ * (not-yet-created) handle.
19
+ */
20
+ export declare const webauthnRegisterOptionsRequestSchema: z.ZodObject<{
21
+ username: z.ZodOptional<z.ZodString>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ username?: string | undefined;
24
+ }, {
25
+ username?: string | undefined;
26
+ }>;
27
+ export type WebauthnRegisterOptionsRequest = z.infer<typeof webauthnRegisterOptionsRequestSchema>;
28
+ /**
29
+ * `POST /webauthn/login/options` — request authentication options. When
30
+ * `username` is present the server scopes `allowCredentials` to that user's
31
+ * passkeys (username-first); when omitted it returns an empty allow-list for the
32
+ * usernameless / discoverable-credential flow (the default).
33
+ */
34
+ export declare const webauthnLoginOptionsRequestSchema: z.ZodObject<{
35
+ username: z.ZodOptional<z.ZodString>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ username?: string | undefined;
38
+ }, {
39
+ username?: string | undefined;
40
+ }>;
41
+ export type WebauthnLoginOptionsRequest = z.infer<typeof webauthnLoginOptionsRequestSchema>;
42
+ /**
43
+ * `POST /webauthn/register/verify` — the outer envelope. The browser
44
+ * `RegistrationResponseJSON` travels alongside these fields under `response` and
45
+ * is validated by `@simplewebauthn/server`, not here. `username` is required only
46
+ * for the prospective-signup branch (no bearer); the linking branch ignores it.
47
+ */
48
+ export declare const webauthnRegisterVerifyRequestSchema: z.ZodObject<{
49
+ deviceName: z.ZodOptional<z.ZodString>;
50
+ deviceFingerprint: z.ZodOptional<z.ZodString>;
51
+ deviceId: z.ZodOptional<z.ZodString>;
52
+ username: z.ZodOptional<z.ZodString>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ username?: string | undefined;
55
+ deviceId?: string | undefined;
56
+ deviceName?: string | undefined;
57
+ deviceFingerprint?: string | undefined;
58
+ }, {
59
+ username?: string | undefined;
60
+ deviceId?: string | undefined;
61
+ deviceName?: string | undefined;
62
+ deviceFingerprint?: string | undefined;
63
+ }>;
64
+ export type WebauthnRegisterVerifyRequest = z.infer<typeof webauthnRegisterVerifyRequestSchema>;
65
+ /**
66
+ * `POST /webauthn/login/verify` — the outer envelope. The browser
67
+ * `AuthenticationResponseJSON` travels alongside these fields under `response`
68
+ * and is validated by `@simplewebauthn/server`, not here.
69
+ */
70
+ export declare const webauthnLoginVerifyRequestSchema: z.ZodObject<{
71
+ deviceName: z.ZodOptional<z.ZodString>;
72
+ deviceFingerprint: z.ZodOptional<z.ZodString>;
73
+ deviceId: z.ZodOptional<z.ZodString>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ deviceId?: string | undefined;
76
+ deviceName?: string | undefined;
77
+ deviceFingerprint?: string | undefined;
78
+ }, {
79
+ deviceId?: string | undefined;
80
+ deviceName?: string | undefined;
81
+ deviceFingerprint?: string | undefined;
82
+ }>;
83
+ export type WebauthnLoginVerifyRequest = z.infer<typeof webauthnLoginVerifyRequestSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/contracts",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",