@nurama/types 1.4.2 → 1.4.3

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/user.d.ts CHANGED
@@ -141,6 +141,42 @@ export interface User {
141
141
  */
142
142
  updatedAt?: number;
143
143
  }
144
+ /**
145
+ * A passkey saved to the user's account. The key itself never leaves the user's device or password manager.
146
+ */
147
+ export interface Passkey {
148
+ id: string;
149
+ /** A name to tell it apart, e.g. "MacBook" */
150
+ name: string;
151
+ /** `multiDevice` passkeys sync between devices (iCloud Keychain, Google Password Manager, 1Password) */
152
+ deviceType: 'singleDevice' | 'multiDevice';
153
+ backedUp: boolean;
154
+ transports: string[];
155
+ createdAt: string;
156
+ lastUsedAt: string | null;
157
+ }
158
+ /**
159
+ * What adding a passkey asks for: the password when the account has one, and a two-factor code when two-factor is
160
+ * on. An account with neither sends nothing.
161
+ */
162
+ export interface PasskeyRegistrationProof {
163
+ password?: string;
164
+ mfaToken?: string;
165
+ }
166
+ /**
167
+ * WebAuthn options for the browser's passkey prompt (PublicKeyCredentialCreationOptionsJSON or
168
+ * PublicKeyCredentialRequestOptionsJSON). Passed straight to the WebAuthn library, so kept opaque here.
169
+ */
170
+ export type PasskeyCredentialOptions = Record<string, unknown> & {
171
+ challenge: string;
172
+ };
173
+ /**
174
+ * The browser's response to a passkey prompt (RegistrationResponseJSON or AuthenticationResponseJSON), as the
175
+ * WebAuthn library returns it.
176
+ */
177
+ export type PasskeyCredentialResponse = Record<string, unknown> & {
178
+ id: string;
179
+ };
144
180
  /**
145
181
  * OAuth platform types
146
182
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nurama/types",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Shared TypeScript types for the Nurama ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/user.ts CHANGED
@@ -146,6 +146,42 @@ export interface User {
146
146
  updatedAt?: number;
147
147
  }
148
148
 
149
+ /**
150
+ * A passkey saved to the user's account. The key itself never leaves the user's device or password manager.
151
+ */
152
+ export interface Passkey {
153
+ id: string;
154
+ /** A name to tell it apart, e.g. "MacBook" */
155
+ name: string;
156
+ /** `multiDevice` passkeys sync between devices (iCloud Keychain, Google Password Manager, 1Password) */
157
+ deviceType: 'singleDevice' | 'multiDevice';
158
+ backedUp: boolean;
159
+ transports: string[];
160
+ createdAt: string;
161
+ lastUsedAt: string | null;
162
+ }
163
+
164
+ /**
165
+ * What adding a passkey asks for: the password when the account has one, and a two-factor code when two-factor is
166
+ * on. An account with neither sends nothing.
167
+ */
168
+ export interface PasskeyRegistrationProof {
169
+ password?: string;
170
+ mfaToken?: string;
171
+ }
172
+
173
+ /**
174
+ * WebAuthn options for the browser's passkey prompt (PublicKeyCredentialCreationOptionsJSON or
175
+ * PublicKeyCredentialRequestOptionsJSON). Passed straight to the WebAuthn library, so kept opaque here.
176
+ */
177
+ export type PasskeyCredentialOptions = Record<string, unknown> & { challenge: string };
178
+
179
+ /**
180
+ * The browser's response to a passkey prompt (RegistrationResponseJSON or AuthenticationResponseJSON), as the
181
+ * WebAuthn library returns it.
182
+ */
183
+ export type PasskeyCredentialResponse = Record<string, unknown> & { id: string };
184
+
149
185
  /**
150
186
  * OAuth platform types
151
187
  */