@flow-industries/id 0.26.4 → 0.27.0
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/contracts/v1/sdk-exports.json +150 -0
- package/dist/sdk/client/github-connector.d.ts +19 -0
- package/dist/sdk/client/github-connector.js +128 -0
- package/dist/sdk/client/index.d.ts +8 -1
- package/dist/sdk/client/index.js +5 -0
- package/dist/sdk/client/note-transport.d.ts +15 -0
- package/dist/sdk/client/note-transport.js +104 -0
- package/dist/sdk/client/oauth.d.ts +9 -0
- package/dist/sdk/client/oauth.js +68 -0
- package/dist/sdk/client/passkey-prf.d.ts +8 -0
- package/dist/sdk/client/passkey-prf.js +67 -0
- package/dist/sdk/client/session.d.ts +2 -0
- package/dist/sdk/client/session.js +23 -0
- package/dist/sdk/github/operations.d.ts +909 -0
- package/dist/sdk/github/operations.js +543 -0
- package/dist/sdk/github/scopes.d.ts +31 -0
- package/dist/sdk/github/scopes.js +70 -0
- package/dist/sdk/oauth/stores.d.ts +3 -0
- package/dist/sdk/oauth/stores.js +4 -0
- package/dist/sdk/profile.css +1 -1
- package/dist/sdk/types/atproto.d.ts +2 -0
- package/dist/sdk/types/auth.d.ts +3 -0
- package/dist/sdk/types/github-connector.d.ts +88 -0
- package/dist/sdk/types/github-connector.js +0 -0
- package/dist/sdk/types/index.d.ts +5 -2
- package/dist/sdk/types/landing.d.ts +20 -0
- package/dist/sdk/types/note-transport.d.ts +140 -0
- package/dist/sdk/types/note-transport.js +0 -0
- package/dist/sdk/types/oauth.d.ts +64 -0
- package/dist/sdk/types/oauth.js +0 -0
- package/dist/sdk/types/sdk.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
import * as OxAddress from "ox/Address";
|
|
2
2
|
import * as PublicKey from "ox/PublicKey";
|
|
3
|
+
import { z } from "zod";
|
|
3
4
|
import { hex0x } from "../hex";
|
|
4
5
|
import { idb } from "./idb";
|
|
5
6
|
import { initialFlowState } from "./store";
|
|
6
7
|
const CREDENTIAL_KEY = "flow.activeCredential";
|
|
8
|
+
const cachedCredentialSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
id: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.max(2048)
|
|
14
|
+
.regex(/^[A-Za-z0-9_-]+$/),
|
|
15
|
+
publicKey: z.string().regex(/^(?:0x)?(?:04)?[a-fA-F0-9]{128}$/),
|
|
16
|
+
})
|
|
17
|
+
.strict();
|
|
18
|
+
/** Reads cached public passkey metadata only; this does not establish a signed-in session or evaluate PRF. */
|
|
19
|
+
export async function getConnectedPasskey() {
|
|
20
|
+
if (!globalThis.indexedDB)
|
|
21
|
+
return null;
|
|
22
|
+
try {
|
|
23
|
+
const parsed = cachedCredentialSchema.safeParse(await idb.get(CREDENTIAL_KEY));
|
|
24
|
+
return parsed.success ? parsed.data : null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
7
30
|
/**
|
|
8
31
|
* Reads the active credential from IndexedDB and seeds the in-memory store
|
|
9
32
|
* with `{ credential, address }`. Run on every page load so signing operations
|