@brett_lamy/ui 4.0.0 → 5.1.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/README.md +1 -1
- package/dist/components/animated-height.d.ts +3 -1
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +11 -11
- package/dist/components/artifact-chat-container.d.ts.map +1 -1
- package/dist/components/artifact-chat-container.js +81 -82
- package/dist/components/button.d.ts +4 -3
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +22 -9
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +97 -0
- package/dist/components/canvas.d.ts +91 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +296 -0
- package/dist/components/color-field.d.ts +22 -0
- package/dist/components/color-field.d.ts.map +1 -0
- package/dist/components/color-field.js +60 -0
- package/dist/components/color-picker.d.ts +49 -0
- package/dist/components/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker.js +121 -0
- package/dist/components/composer/composer-cards.d.ts +55 -0
- package/dist/components/composer/composer-cards.d.ts.map +1 -0
- package/dist/components/composer/composer-cards.js +351 -0
- package/dist/components/composer/composer.d.ts +9 -1
- package/dist/components/composer/composer.d.ts.map +1 -1
- package/dist/components/composer/composer.js +179 -154
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +127 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +52 -92
- package/dist/components/cron-editor.d.ts +47 -0
- package/dist/components/cron-editor.d.ts.map +1 -0
- package/dist/components/cron-editor.js +297 -0
- package/dist/components/date-field.d.ts +19 -0
- package/dist/components/date-field.d.ts.map +1 -0
- package/dist/components/date-field.js +79 -0
- package/dist/components/date-picker.d.ts +38 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +110 -0
- package/dist/components/dropdown-menu.d.ts +3 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +5 -5
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +1 -0
- package/dist/components/file-upload.d.ts +121 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +405 -0
- package/dist/components/filter-input.d.ts +22 -0
- package/dist/components/filter-input.d.ts.map +1 -0
- package/dist/components/filter-input.js +126 -0
- package/dist/components/filter.d.ts +154 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +815 -0
- package/dist/components/floating-chat.d.ts.map +1 -1
- package/dist/components/floating-chat.js +71 -88
- package/dist/components/floating-sheet.d.ts.map +1 -1
- package/dist/components/floating-sheet.js +93 -104
- package/dist/components/markdown-editor.d.ts +2 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +46 -45
- package/dist/components/markdown-view.d.ts +6 -1
- package/dist/components/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view.js +13 -11
- package/dist/components/navigation-stack.d.ts +3 -5
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +212 -382
- package/dist/components/passkey-enroll-dialog.d.ts +36 -0
- package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
- package/dist/components/passkey-enroll-dialog.js +234 -0
- package/dist/components/result-table.d.ts +38 -0
- package/dist/components/result-table.d.ts.map +1 -0
- package/dist/components/result-table.js +161 -0
- package/dist/components/schema-tree.d.ts +19 -0
- package/dist/components/schema-tree.d.ts.map +1 -0
- package/dist/components/schema-tree.js +172 -0
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +117 -143
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +4 -1
- package/dist/components/spinner-shapes.d.ts +299 -0
- package/dist/components/spinner-shapes.d.ts.map +1 -0
- package/dist/components/spinner-shapes.js +876 -0
- package/dist/components/spinner.d.ts +133 -3
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +445 -29
- package/dist/components/sql-console.d.ts +28 -0
- package/dist/components/sql-console.d.ts.map +1 -0
- package/dist/components/sql-console.js +348 -0
- package/dist/components/sql-editor.d.ts +47 -0
- package/dist/components/sql-editor.d.ts.map +1 -0
- package/dist/components/sql-editor.js +170 -0
- package/dist/components/tab-view.d.ts +2 -2
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +63 -49
- package/dist/components/tailscale-login-button.d.ts +53 -0
- package/dist/components/tailscale-login-button.d.ts.map +1 -0
- package/dist/components/tailscale-login-button.js +197 -0
- package/dist/components/time-input.d.ts +46 -0
- package/dist/components/time-input.d.ts.map +1 -0
- package/dist/components/time-input.js +258 -0
- package/dist/components/toast.d.ts +5 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +249 -125
- package/dist/components/vault-gate.d.ts +60 -0
- package/dist/components/vault-gate.d.ts.map +1 -0
- package/dist/components/vault-gate.js +382 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +90 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134 -83
- package/dist/lib/back-history.d.ts +5 -0
- package/dist/lib/back-history.d.ts.map +1 -0
- package/dist/lib/back-history.js +44 -0
- package/dist/lib/canvas-math.d.ts +82 -0
- package/dist/lib/canvas-math.d.ts.map +1 -0
- package/dist/lib/canvas-math.js +226 -0
- package/dist/lib/controllable-state.d.ts +4 -0
- package/dist/lib/controllable-state.d.ts.map +1 -0
- package/dist/lib/controllable-state.js +11 -0
- package/dist/lib/cron.d.ts +55 -0
- package/dist/lib/cron.d.ts.map +1 -0
- package/dist/lib/cron.js +269 -0
- package/dist/lib/edge-swipe.d.ts +36 -0
- package/dist/lib/edge-swipe.d.ts.map +1 -0
- package/dist/lib/edge-swipe.js +73 -0
- package/dist/lib/file-upload.d.ts +187 -0
- package/dist/lib/file-upload.d.ts.map +1 -0
- package/dist/lib/file-upload.js +349 -0
- package/dist/lib/filter-query.d.ts +90 -0
- package/dist/lib/filter-query.d.ts.map +1 -0
- package/dist/lib/filter-query.js +459 -0
- package/dist/lib/filter.d.ts +120 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +399 -0
- package/dist/lib/format-bytes.d.ts +3 -0
- package/dist/lib/format-bytes.d.ts.map +1 -0
- package/dist/lib/format-bytes.js +16 -0
- package/dist/lib/gpu-cron.d.ts +51 -0
- package/dist/lib/gpu-cron.d.ts.map +1 -0
- package/dist/lib/gpu-cron.js +81 -0
- package/dist/lib/gpu-query/featurize.d.ts +19 -0
- package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
- package/dist/lib/gpu-query/featurize.js +88 -0
- package/dist/lib/gpu-query/index.d.ts +73 -0
- package/dist/lib/gpu-query/index.d.ts.map +1 -0
- package/dist/lib/gpu-query/index.js +117 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.d.ts +8 -0
- package/dist/lib/gpu-query/model.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.js +91 -0
- package/dist/lib/gpu-query/schema.d.ts +40 -0
- package/dist/lib/gpu-query/schema.d.ts.map +1 -0
- package/dist/lib/gpu-query/schema.js +0 -0
- package/dist/lib/gpu-query/webgpu.d.ts +12 -0
- package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.d.ts +17 -0
- package/dist/lib/gpu-query/weights.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.js +40 -0
- package/dist/lib/gpu-query/weights.json.d.ts +3 -0
- package/dist/lib/gpu-query/weights2.js +25 -0
- package/dist/lib/gpu-time.d.ts +77 -0
- package/dist/lib/gpu-time.d.ts.map +1 -0
- package/dist/lib/gpu-time.js +260 -0
- package/dist/lib/morph-path.d.ts +22 -0
- package/dist/lib/morph-path.d.ts.map +1 -0
- package/dist/lib/morph-path.js +42 -0
- package/dist/lib/passkey.d.ts +120 -0
- package/dist/lib/passkey.d.ts.map +1 -0
- package/dist/lib/passkey.js +186 -0
- package/dist/lib/persistent-state.d.ts +9 -0
- package/dist/lib/persistent-state.d.ts.map +1 -0
- package/dist/lib/persistent-state.js +37 -0
- package/dist/lib/pglite-core.d.ts +219 -0
- package/dist/lib/pglite-core.d.ts.map +1 -0
- package/dist/lib/pglite-core.js +273 -0
- package/dist/lib/pglite-files.d.ts +7 -0
- package/dist/lib/pglite-files.d.ts.map +1 -0
- package/dist/lib/pglite-files.js +17 -0
- package/dist/lib/pglite-schema.d.ts +58 -0
- package/dist/lib/pglite-schema.d.ts.map +1 -0
- package/dist/lib/pglite-schema.js +105 -0
- package/dist/lib/pglite-storage.d.ts +33 -0
- package/dist/lib/pglite-storage.d.ts.map +1 -0
- package/dist/lib/pglite-storage.js +55 -0
- package/dist/lib/pglite-transfer.d.ts +53 -0
- package/dist/lib/pglite-transfer.d.ts.map +1 -0
- package/dist/lib/pglite-transfer.js +126 -0
- package/dist/lib/pglite.d.ts +106 -0
- package/dist/lib/pglite.d.ts.map +1 -0
- package/dist/lib/pglite.js +298 -0
- package/dist/lib/pull-to-refresh.d.ts +24 -0
- package/dist/lib/pull-to-refresh.d.ts.map +1 -0
- package/dist/lib/pull-to-refresh.js +74 -0
- package/dist/lib/scroll-hidden.d.ts +6 -0
- package/dist/lib/scroll-hidden.d.ts.map +1 -0
- package/dist/lib/scroll-hidden.js +21 -0
- package/dist/lib/sql-format.d.ts +62 -0
- package/dist/lib/sql-format.d.ts.map +1 -0
- package/dist/lib/sql-format.js +175 -0
- package/dist/lib/sql-lex.d.ts +25 -0
- package/dist/lib/sql-lex.d.ts.map +1 -0
- package/dist/lib/sql-lex.js +135 -0
- package/dist/lib/tab-lock.d.ts +28 -0
- package/dist/lib/tab-lock.d.ts.map +1 -0
- package/dist/lib/tab-lock.js +80 -0
- package/dist/lib/tailscale-connect.d.ts +56 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -0
- package/dist/lib/tailscale-connect.js +99 -0
- package/dist/lib/tailscale-fake.d.ts +33 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -0
- package/dist/lib/tailscale-fake.js +80 -0
- package/dist/lib/tailscale-policy.d.ts +71 -0
- package/dist/lib/tailscale-policy.d.ts.map +1 -0
- package/dist/lib/tailscale-policy.js +244 -0
- package/dist/lib/tailscale-react.d.ts +20 -0
- package/dist/lib/tailscale-react.d.ts.map +1 -0
- package/dist/lib/tailscale-react.js +37 -0
- package/dist/lib/tailscale-router/bridge.d.ts +60 -0
- package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
- package/dist/lib/tailscale-router/bridge.js +198 -0
- package/dist/lib/tailscale-router/react.d.ts +19 -0
- package/dist/lib/tailscale-router/react.d.ts.map +1 -0
- package/dist/lib/tailscale-router/react.js +52 -0
- package/dist/lib/tailscale.d.ts +204 -0
- package/dist/lib/tailscale.d.ts.map +1 -0
- package/dist/lib/tailscale.js +443 -0
- package/dist/lib/title-flight.d.ts +34 -0
- package/dist/lib/title-flight.d.ts.map +1 -0
- package/dist/lib/title-flight.js +123 -0
- package/dist/lib/vault-react.d.ts +49 -0
- package/dist/lib/vault-react.d.ts.map +1 -0
- package/dist/lib/vault-react.js +196 -0
- package/dist/lib/vault-storage.d.ts +30 -0
- package/dist/lib/vault-storage.d.ts.map +1 -0
- package/dist/lib/vault-storage.js +105 -0
- package/dist/lib/vault.d.ts +200 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +641 -0
- package/dist/tailscale-sw.js +332 -0
- package/package.json +35 -4
- package/dist/components/icon-button.d.ts +0 -19
- package/dist/components/icon-button.d.ts.map +0 -1
- package/dist/components/icon-button.js +0 -31
- package/dist/components/measure-h.d.ts +0 -7
- package/dist/components/measure-h.d.ts.map +0 -1
- package/dist/components/measure-h.js +0 -20
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** Why a passkey operation failed, in terms an app can branch on. */
|
|
2
|
+
export type PasskeyErrorReason =
|
|
3
|
+
/** No WebAuthn in this browser (or `navigator.credentials` is missing). */
|
|
4
|
+
'unsupported'
|
|
5
|
+
/** WebAuthn needs HTTPS (or localhost). */
|
|
6
|
+
| 'insecure-context'
|
|
7
|
+
/** The user dismissed the prompt, it timed out, or the call was aborted. Browsers report all three the same way. */
|
|
8
|
+
| 'cancelled'
|
|
9
|
+
/** The credential or authenticator has no PRF support, so it cannot produce a key. */
|
|
10
|
+
| 'no-prf'
|
|
11
|
+
/** The browser refused: wrong relying-party id for this origin, or a frame without the permissions policy. */
|
|
12
|
+
| 'not-allowed'
|
|
13
|
+
/** `excludeCredentials` matched: this authenticator already holds a credential for this vault. */
|
|
14
|
+
| 'excluded'
|
|
15
|
+
/** Bad arguments (empty salt, malformed credential id…). */
|
|
16
|
+
| 'invalid'
|
|
17
|
+
/** Anything else. `cause` has the original error. */
|
|
18
|
+
| 'failed';
|
|
19
|
+
export declare class PasskeyError extends Error {
|
|
20
|
+
readonly reason: PasskeyErrorReason;
|
|
21
|
+
readonly cause?: unknown;
|
|
22
|
+
constructor(reason: PasskeyErrorReason, message: string, cause?: unknown);
|
|
23
|
+
}
|
|
24
|
+
/** A `Uint8Array` over a plain `ArrayBuffer` — what Web Crypto and WebAuthn accept as a `BufferSource`. */
|
|
25
|
+
export type Bytes = Uint8Array<ArrayBuffer>;
|
|
26
|
+
/** `n` cryptographically random bytes. */
|
|
27
|
+
export declare function randomBytes(n: number): Bytes;
|
|
28
|
+
/** Copies any buffer or view into a fresh `Uint8Array`. */
|
|
29
|
+
export declare function toBytes(source: ArrayBuffer | ArrayBufferView): Bytes;
|
|
30
|
+
/** Base64url without padding (RFC 4648 §5) — how credential ids are written down. */
|
|
31
|
+
export declare function bytesToBase64Url(bytes: ArrayBuffer | ArrayBufferView): string;
|
|
32
|
+
/** Decodes base64url (padding optional). Throws a `PasskeyError('invalid')` on anything else. */
|
|
33
|
+
export declare function base64UrlToBytes(text: string): Bytes;
|
|
34
|
+
/** Overwrites a buffer with zeros. Best effort: JavaScript cannot promise no other copy exists. */
|
|
35
|
+
export declare function wipe(bytes: Uint8Array): void;
|
|
36
|
+
/** The parts of the browser this module touches. Defaults to the real globals, read lazily on each call. */
|
|
37
|
+
export interface PasskeyEnv {
|
|
38
|
+
/** `navigator.credentials`. */
|
|
39
|
+
credentials?: Pick<CredentialsContainer, 'create' | 'get'> | null;
|
|
40
|
+
/** The `PublicKeyCredential` constructor (for the capability and platform-authenticator checks). */
|
|
41
|
+
PublicKeyCredential?: {
|
|
42
|
+
isUserVerifyingPlatformAuthenticatorAvailable?: () => Promise<boolean>;
|
|
43
|
+
getClientCapabilities?: () => Promise<Record<string, boolean>>;
|
|
44
|
+
} | null;
|
|
45
|
+
/** `window.isSecureContext`. */
|
|
46
|
+
isSecureContext?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface PasskeySupport {
|
|
49
|
+
/** HTTPS or localhost. WebAuthn does not exist elsewhere. */
|
|
50
|
+
secureContext: boolean;
|
|
51
|
+
/** `navigator.credentials` and `PublicKeyCredential` are present. */
|
|
52
|
+
webauthn: boolean;
|
|
53
|
+
/** A built-in authenticator (Touch ID, Windows Hello, Android) can verify the user. */
|
|
54
|
+
platformAuthenticator: boolean;
|
|
55
|
+
/** Does the client implement the PRF extension? `unknown` where the browser cannot say (it still may work). The
|
|
56
|
+
* authenticator can lack PRF even when this is `yes`: only a real ceremony settles that. */
|
|
57
|
+
prf: 'yes' | 'no' | 'unknown';
|
|
58
|
+
}
|
|
59
|
+
/** What this browser can do. Never prompts the user. */
|
|
60
|
+
export declare function detectPasskeySupport(env?: PasskeyEnv): Promise<PasskeySupport>;
|
|
61
|
+
/** Why a passkey vault cannot be used here, or `null` when it can be attempted. */
|
|
62
|
+
export declare function passkeyUnsupportedReason(support: PasskeySupport): 'insecure-context' | 'no-webauthn' | 'no-prf' | null;
|
|
63
|
+
export interface CreatePasskeyOptions {
|
|
64
|
+
/** Shown by the authenticator next to the passkey (the app's name). */
|
|
65
|
+
rpName: string;
|
|
66
|
+
/** Registrable domain the passkey is bound to. Defaults to the current origin's host. Must be a suffix of it. */
|
|
67
|
+
rpId?: string;
|
|
68
|
+
/** Account label the authenticator shows ("Vault", an e-mail…). */
|
|
69
|
+
userName: string;
|
|
70
|
+
userDisplayName?: string;
|
|
71
|
+
/** PRF salt: public, any length ≥ 1; the same salt and credential always give the same secret. */
|
|
72
|
+
salt: BufferSource;
|
|
73
|
+
/** `platform` = built-in (Touch ID, Hello); `cross-platform` = security keys and phones; omitted = the user chooses. */
|
|
74
|
+
attachment?: 'platform' | 'cross-platform';
|
|
75
|
+
/** `required` makes a discoverable credential (it appears in the browser's passkey list); default `preferred`. */
|
|
76
|
+
residentKey?: ResidentKeyRequirement;
|
|
77
|
+
/** Default `required`: the prompt always checks biometrics or PIN, which PRF over hmac-secret expects. */
|
|
78
|
+
userVerification?: UserVerificationRequirement;
|
|
79
|
+
/** Credential ids (base64url) the authenticator must not already hold; avoids enrolling the same passkey twice. */
|
|
80
|
+
excludeCredentialIds?: string[];
|
|
81
|
+
/** Milliseconds before the browser gives up on the prompt. Default 60000. */
|
|
82
|
+
timeout?: number;
|
|
83
|
+
signal?: AbortSignal;
|
|
84
|
+
env?: PasskeyEnv;
|
|
85
|
+
}
|
|
86
|
+
export interface CreatePasskeyResult {
|
|
87
|
+
/** Base64url credential id. */
|
|
88
|
+
credentialId: string;
|
|
89
|
+
/** The PRF secret, when the authenticator evaluated it during creation (platform authenticators, passkey
|
|
90
|
+
* managers). Security keys usually do not: call `getPrfSecret` next, which prompts once more. */
|
|
91
|
+
secret?: Bytes;
|
|
92
|
+
transports: string[];
|
|
93
|
+
authenticatorAttachment: string | null;
|
|
94
|
+
}
|
|
95
|
+
/** Creates a passkey with the PRF extension enabled. Throws `PasskeyError('no-prf')` if the authenticator cannot do PRF
|
|
96
|
+
* (the credential exists on the authenticator then, but is useless to this library). */
|
|
97
|
+
export declare function createPasskey(options: CreatePasskeyOptions): Promise<CreatePasskeyResult>;
|
|
98
|
+
export interface PasskeyCredentialRef {
|
|
99
|
+
/** Base64url credential id. */
|
|
100
|
+
id: string;
|
|
101
|
+
/** Transports saved at creation (`internal`, `usb`, `hybrid`…); lets the browser go straight to the right UI. */
|
|
102
|
+
transports?: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface GetPrfSecretOptions {
|
|
105
|
+
rpId?: string;
|
|
106
|
+
userVerification?: UserVerificationRequirement;
|
|
107
|
+
timeout?: number;
|
|
108
|
+
signal?: AbortSignal;
|
|
109
|
+
env?: PasskeyEnv;
|
|
110
|
+
}
|
|
111
|
+
export interface PrfSecret {
|
|
112
|
+
/** Which credential answered. */
|
|
113
|
+
credentialId: string;
|
|
114
|
+
/** The 32-byte PRF output for this credential and salt. Wipe it (`wipe`) when you are done. */
|
|
115
|
+
secret: Bytes;
|
|
116
|
+
}
|
|
117
|
+
/** Asks the user to tap one of `credentials` and returns its PRF secret for `salt`. An empty list lets the browser offer
|
|
118
|
+
* any discoverable passkey for the relying party. */
|
|
119
|
+
export declare function getPrfSecret(credentials: ReadonlyArray<string | PasskeyCredentialRef>, salt: BufferSource, options?: GetPrfSecretOptions): Promise<PrfSecret>;
|
|
120
|
+
//# sourceMappingURL=passkey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passkey.d.ts","sourceRoot":"","sources":["../../src/lib/passkey.ts"],"names":[],"mappings":"AAeA,qEAAqE;AACrE,MAAM,MAAM,kBAAkB;AAC5B,2EAA2E;AACzE,aAAa;AACf,2CAA2C;GACzC,kBAAkB;AACpB,oHAAoH;GAClH,WAAW;AACb,sFAAsF;GACpF,QAAQ;AACV,8GAA8G;GAC5G,aAAa;AACf,kGAAkG;GAChG,UAAU;AACZ,4DAA4D;GAC1D,SAAS;AACX,qDAAqD;GACnD,QAAQ,CAAC;AAEb,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,MAAM,EAAE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W,oBAAoB;IACnC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,iHAAiH;IACjH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,GAAG,CAAC,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,+FAA+F;IAC/F,MAAM,EAAE,KAAK,CAAC;CACf;AAED;sDACsD;AACtD,wBAAsB,YAAY,CAChC,WAAW,EAAE,aAAa,CAAC,MAAM,GAAG,oBAAoB,CAAC,EACzD,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,SAAS,CAAC,CAiCpB"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
//#region src/lib/passkey.ts
|
|
2
|
+
var e = class extends Error {
|
|
3
|
+
reason;
|
|
4
|
+
cause;
|
|
5
|
+
constructor(e, t, n) {
|
|
6
|
+
super(t), this.name = "PasskeyError", this.reason = e, this.cause = n;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function t(e) {
|
|
10
|
+
return globalThis.crypto.getRandomValues(new Uint8Array(e));
|
|
11
|
+
}
|
|
12
|
+
function n(e) {
|
|
13
|
+
if (ArrayBuffer.isView(e)) {
|
|
14
|
+
let t = new Uint8Array(e.byteLength);
|
|
15
|
+
return t.set(new Uint8Array(e.buffer, e.byteOffset, e.byteLength)), t;
|
|
16
|
+
}
|
|
17
|
+
return new Uint8Array(e.slice(0));
|
|
18
|
+
}
|
|
19
|
+
function r(e) {
|
|
20
|
+
let t = ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e), n = "";
|
|
21
|
+
for (let e = 0; e < t.length; e += 32768) n += String.fromCharCode(...t.subarray(e, e + 32768));
|
|
22
|
+
return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
23
|
+
}
|
|
24
|
+
var i = /^[A-Za-z0-9_-]*$/;
|
|
25
|
+
function a(t) {
|
|
26
|
+
if (!i.test(t) || t.length % 4 == 1) throw new e("invalid", "Not a base64url string.");
|
|
27
|
+
let n = atob(t.replace(/-/g, "+").replace(/_/g, "/").padEnd(Math.ceil(t.length / 4) * 4, "=")), r = new Uint8Array(n.length);
|
|
28
|
+
for (let e = 0; e < n.length; e++) r[e] = n.charCodeAt(e);
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
function o(e) {
|
|
32
|
+
e.fill(0);
|
|
33
|
+
}
|
|
34
|
+
function s(e) {
|
|
35
|
+
let t = globalThis;
|
|
36
|
+
return {
|
|
37
|
+
credentials: e && "credentials" in e ? e.credentials ?? null : t.navigator?.credentials ?? null,
|
|
38
|
+
PublicKeyCredential: e && "PublicKeyCredential" in e ? e.PublicKeyCredential ?? null : t.PublicKeyCredential ?? null,
|
|
39
|
+
isSecureContext: e && "isSecureContext" in e ? !!e.isSecureContext : !!t.isSecureContext
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async function c(e) {
|
|
43
|
+
let t = s(e), n = t.PublicKeyCredential, r = !!(t.credentials && typeof t.credentials.create == "function" && typeof t.credentials.get == "function" && n);
|
|
44
|
+
if (!n || !r) return {
|
|
45
|
+
secureContext: t.isSecureContext,
|
|
46
|
+
webauthn: !1,
|
|
47
|
+
platformAuthenticator: !1,
|
|
48
|
+
prf: "no"
|
|
49
|
+
};
|
|
50
|
+
let i = !1;
|
|
51
|
+
try {
|
|
52
|
+
i = await n.isUserVerifyingPlatformAuthenticatorAvailable?.() === !0;
|
|
53
|
+
} catch {}
|
|
54
|
+
let a = "unknown";
|
|
55
|
+
try {
|
|
56
|
+
let e = (await n.getClientCapabilities?.())?.["extension:prf"];
|
|
57
|
+
e === !0 ? a = "yes" : e === !1 && (a = "no");
|
|
58
|
+
} catch {}
|
|
59
|
+
return {
|
|
60
|
+
secureContext: t.isSecureContext,
|
|
61
|
+
webauthn: r,
|
|
62
|
+
platformAuthenticator: i,
|
|
63
|
+
prf: a
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function l(e) {
|
|
67
|
+
return e.secureContext ? e.webauthn ? e.prf === "no" ? "no-prf" : null : "no-webauthn" : "insecure-context";
|
|
68
|
+
}
|
|
69
|
+
var u = /permissions? policy|feature is not enabled|publickey-credentials/i;
|
|
70
|
+
function d(t, n) {
|
|
71
|
+
if (t instanceof e) return t;
|
|
72
|
+
let r = t?.name, i = t?.message ?? "";
|
|
73
|
+
if (n?.aborted || r === "AbortError") return new e("cancelled", "The passkey request was cancelled.", t);
|
|
74
|
+
switch (r) {
|
|
75
|
+
case "NotAllowedError": return u.test(i) ? new e("not-allowed", "Passkeys are blocked in this frame. The embedding page must allow publickey-credentials-get and publickey-credentials-create.", t) : new e("cancelled", "The passkey prompt was dismissed or timed out.", t);
|
|
76
|
+
case "SecurityError": return new e("not-allowed", "The browser rejected the relying-party id for this origin.", t);
|
|
77
|
+
case "InvalidStateError": return new e("excluded", "This authenticator already has a passkey for this vault.", t);
|
|
78
|
+
case "NotSupportedError": return new e("unsupported", "This authenticator or browser does not support the requested passkey options.", t);
|
|
79
|
+
case "TypeError":
|
|
80
|
+
case "SyntaxError": return new e("invalid", i || "Invalid passkey options.", t);
|
|
81
|
+
default: return new e("failed", i || "The passkey request failed.", t);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function f(e) {
|
|
85
|
+
return e.getClientExtensionResults().prf;
|
|
86
|
+
}
|
|
87
|
+
function p(t) {
|
|
88
|
+
let r = n(t);
|
|
89
|
+
if (r.byteLength === 0) throw new e("invalid", "The PRF salt must not be empty.");
|
|
90
|
+
return r;
|
|
91
|
+
}
|
|
92
|
+
function m(t) {
|
|
93
|
+
if (!t.credentials || !t.PublicKeyCredential) throw new e("unsupported", "WebAuthn is not available in this browser.");
|
|
94
|
+
if (!t.isSecureContext) throw new e("insecure-context", "Passkeys need a secure context (HTTPS or localhost).");
|
|
95
|
+
return t.credentials;
|
|
96
|
+
}
|
|
97
|
+
async function h(i) {
|
|
98
|
+
let o = m(s(i.env)), { signal: c } = i;
|
|
99
|
+
if (c?.aborted) throw new e("cancelled", "The passkey request was cancelled.");
|
|
100
|
+
let l = p(i.salt), u = (i.excludeCredentialIds ?? []).map((e) => ({
|
|
101
|
+
type: "public-key",
|
|
102
|
+
id: a(e)
|
|
103
|
+
})), h = {
|
|
104
|
+
challenge: t(32),
|
|
105
|
+
rp: {
|
|
106
|
+
name: i.rpName,
|
|
107
|
+
...i.rpId ? { id: i.rpId } : {}
|
|
108
|
+
},
|
|
109
|
+
user: {
|
|
110
|
+
id: t(16),
|
|
111
|
+
name: i.userName,
|
|
112
|
+
displayName: i.userDisplayName ?? i.userName
|
|
113
|
+
},
|
|
114
|
+
pubKeyCredParams: [{
|
|
115
|
+
type: "public-key",
|
|
116
|
+
alg: -7
|
|
117
|
+
}, {
|
|
118
|
+
type: "public-key",
|
|
119
|
+
alg: -257
|
|
120
|
+
}],
|
|
121
|
+
timeout: i.timeout ?? 6e4,
|
|
122
|
+
attestation: "none",
|
|
123
|
+
authenticatorSelection: {
|
|
124
|
+
userVerification: i.userVerification ?? "required",
|
|
125
|
+
residentKey: i.residentKey ?? "preferred",
|
|
126
|
+
...i.residentKey === "required" ? { requireResidentKey: !0 } : {},
|
|
127
|
+
...i.attachment ? { authenticatorAttachment: i.attachment } : {}
|
|
128
|
+
},
|
|
129
|
+
...u.length ? { excludeCredentials: u } : {},
|
|
130
|
+
extensions: { prf: { eval: { first: l } } }
|
|
131
|
+
}, g;
|
|
132
|
+
try {
|
|
133
|
+
g = await o.create({
|
|
134
|
+
publicKey: h,
|
|
135
|
+
...c ? { signal: c } : {}
|
|
136
|
+
});
|
|
137
|
+
} catch (e) {
|
|
138
|
+
throw d(e, c);
|
|
139
|
+
}
|
|
140
|
+
if (!g || !("rawId" in g)) throw new e("failed", "The browser did not return a public-key credential.");
|
|
141
|
+
let _ = g, v = f(_), y = v?.results?.first;
|
|
142
|
+
if (!v || v.enabled !== !0 && !y) throw new e("no-prf", "This passkey cannot derive an encryption key (no PRF support). Try a different authenticator or browser.");
|
|
143
|
+
let b = _.response;
|
|
144
|
+
return {
|
|
145
|
+
credentialId: r(_.rawId),
|
|
146
|
+
...y ? { secret: n(y) } : {},
|
|
147
|
+
transports: typeof b.getTransports == "function" ? b.getTransports() : [],
|
|
148
|
+
authenticatorAttachment: _.authenticatorAttachment ?? null
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
async function g(i, o, c = {}) {
|
|
152
|
+
let l = m(s(c.env)), { signal: u } = c;
|
|
153
|
+
if (u?.aborted) throw new e("cancelled", "The passkey request was cancelled.");
|
|
154
|
+
let h = p(o), g = i.map((e) => {
|
|
155
|
+
let t = typeof e == "string" ? { id: e } : e;
|
|
156
|
+
return {
|
|
157
|
+
type: "public-key",
|
|
158
|
+
id: a(t.id),
|
|
159
|
+
...t.transports?.length ? { transports: t.transports } : {}
|
|
160
|
+
};
|
|
161
|
+
}), _ = {
|
|
162
|
+
challenge: t(32),
|
|
163
|
+
timeout: c.timeout ?? 6e4,
|
|
164
|
+
userVerification: c.userVerification ?? "required",
|
|
165
|
+
...c.rpId ? { rpId: c.rpId } : {},
|
|
166
|
+
...g.length ? { allowCredentials: g } : {},
|
|
167
|
+
extensions: { prf: { eval: { first: h } } }
|
|
168
|
+
}, v;
|
|
169
|
+
try {
|
|
170
|
+
v = await l.get({
|
|
171
|
+
publicKey: _,
|
|
172
|
+
...u ? { signal: u } : {}
|
|
173
|
+
});
|
|
174
|
+
} catch (e) {
|
|
175
|
+
throw d(e, u);
|
|
176
|
+
}
|
|
177
|
+
if (!v || !("rawId" in v)) throw new e("failed", "The browser did not return a public-key credential.");
|
|
178
|
+
let y = v, b = f(y)?.results?.first;
|
|
179
|
+
if (!b) throw new e("no-prf", "This passkey did not return a PRF secret. It may have been created without PRF support.");
|
|
180
|
+
return {
|
|
181
|
+
credentialId: r(y.rawId),
|
|
182
|
+
secret: n(b)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { e as PasskeyError, a as base64UrlToBytes, r as bytesToBase64Url, h as createPasskey, c as detectPasskeySupport, g as getPrfSecret, l as passkeyUnsupportedReason, t as randomBytes, n as toBytes, o as wipe };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
/** Reads a JSON value from localStorage, or `undefined` when it is missing, malformed or storage is unavailable. */
|
|
3
|
+
export declare function loadJSON(key: string): unknown;
|
|
4
|
+
/** Writes a JSON value to localStorage; storage that throws is ignored. */
|
|
5
|
+
export declare function saveJSON(key: string, value: unknown): void;
|
|
6
|
+
export declare function usePersistentState<T>(key: string | null, initial: T | (() => T),
|
|
7
|
+
/** Returns true for a stored value that is the right shape; anything else is ignored. */
|
|
8
|
+
isValid?: (value: unknown) => value is T): [T, Dispatch<SetStateAction<T>>];
|
|
9
|
+
//# sourceMappingURL=persistent-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistent-state.d.ts","sourceRoot":"","sources":["../../src/lib/persistent-state.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAMxF,oHAAoH;AACpH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO7C;AAED,2EAA2E;AAC3E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAM1D;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,OAAO,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,yFAAyF;AACzF,OAAO,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAA8C,GACnF,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAuBlC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
3
|
+
//#region src/lib/persistent-state.ts
|
|
4
|
+
function r(e) {
|
|
5
|
+
try {
|
|
6
|
+
let t = typeof localStorage > "u" ? null : localStorage.getItem(e);
|
|
7
|
+
return t == null ? void 0 : JSON.parse(t);
|
|
8
|
+
} catch {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function i(e, t) {
|
|
13
|
+
try {
|
|
14
|
+
typeof localStorage < "u" && localStorage.setItem(e, JSON.stringify(t));
|
|
15
|
+
} catch {}
|
|
16
|
+
}
|
|
17
|
+
function a(a, o, s = (e) => e !== void 0) {
|
|
18
|
+
let c = (e) => {
|
|
19
|
+
let t = e ? r(e) : void 0;
|
|
20
|
+
return t !== void 0 && s(t) ? t : o instanceof Function ? o() : o;
|
|
21
|
+
}, [l, u] = n(() => c(a)), [d, f] = n(a);
|
|
22
|
+
d !== a && (f(a), u(c(a)));
|
|
23
|
+
let p = t(!0), m = t(a);
|
|
24
|
+
return e(() => {
|
|
25
|
+
if (p.current) {
|
|
26
|
+
p.current = !1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (m.current !== a) {
|
|
30
|
+
m.current = a;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
a && i(a, l);
|
|
34
|
+
}, [a, l]), [l, u];
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { r as loadJSON, i as saveJSON, a as usePersistentState };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
export interface SqlField {
|
|
2
|
+
name: string;
|
|
3
|
+
/** The column's type OID (see `pgTypeName` in lib/sql-format). */
|
|
4
|
+
dataTypeID: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SqlResult<T = Record<string, unknown>> {
|
|
7
|
+
rows: T[];
|
|
8
|
+
fields: SqlField[];
|
|
9
|
+
/** Rows changed so far in a multi-statement `exec` (cumulative); prefer `rowCount`. */
|
|
10
|
+
affectedRows?: number;
|
|
11
|
+
/** `SELECT`, `INSERT`, `CREATE`, … */
|
|
12
|
+
command?: string;
|
|
13
|
+
/** Rows returned or changed by this statement alone. */
|
|
14
|
+
rowCount?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SqlRunner {
|
|
17
|
+
query<T = Record<string, unknown>>(sql: string, params?: unknown[]): Promise<SqlResult<T>>;
|
|
18
|
+
exec(sql: string): Promise<SqlResult[]>;
|
|
19
|
+
}
|
|
20
|
+
export interface SqlTransaction extends SqlRunner {
|
|
21
|
+
rollback(): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface LiveQueryHandle<T = Record<string, unknown>> {
|
|
24
|
+
initialResults: SqlResult<T>;
|
|
25
|
+
subscribe(callback: (results: SqlResult<T>) => void): void;
|
|
26
|
+
unsubscribe(callback?: (results: SqlResult<T>) => void): Promise<void>;
|
|
27
|
+
refresh(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
/** PGlite's `live` extension namespace. */
|
|
30
|
+
export interface LiveNamespace {
|
|
31
|
+
query<T = Record<string, unknown>>(query: string, params?: unknown[] | null, callback?: (results: SqlResult<T>) => void): Promise<LiveQueryHandle<T>>;
|
|
32
|
+
incrementalQuery<T = Record<string, unknown>>(query: string, params: unknown[] | undefined | null, key: string, callback?: (results: SqlResult<T>) => void): Promise<LiveQueryHandle<T>>;
|
|
33
|
+
}
|
|
34
|
+
/** An open database: a `PGlite` (main thread) or `PGliteWorker` (worker) instance. Cast to `PGlite` to reach the rest of its API. */
|
|
35
|
+
export interface Database extends SqlRunner {
|
|
36
|
+
readonly closed: boolean;
|
|
37
|
+
transaction<T>(callback: (tx: SqlTransaction) => Promise<T>): Promise<T>;
|
|
38
|
+
close(): Promise<void>;
|
|
39
|
+
dumpDataDir(compression?: 'none' | 'gzip' | 'auto'): Promise<File | Blob>;
|
|
40
|
+
/** Present unless the provider was opened with `live: false`. */
|
|
41
|
+
live?: LiveNamespace;
|
|
42
|
+
}
|
|
43
|
+
export type PGliteErrorCode = 'OPEN_FAILED' | 'VERSION_MISMATCH' | 'DATABASE_EXISTS' | 'UNSUPPORTED' | 'IMPORT_FAILED' | 'EXPORT_FAILED' | 'LOCKED';
|
|
44
|
+
/** Something went wrong opening, importing or exporting a database. `cause` carries the original error. */
|
|
45
|
+
export declare class PGliteError extends Error {
|
|
46
|
+
readonly code: PGliteErrorCode;
|
|
47
|
+
constructor(code: PGliteErrorCode, message: string, options?: {
|
|
48
|
+
cause?: unknown;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** The data directory was written by a different Postgres major version than the one this PGlite build runs.
|
|
52
|
+
Nothing is deleted or modified: open it with the PGlite release that wrote it, export it as SQL, and import that. */
|
|
53
|
+
export declare class DataDirVersionError extends PGliteError {
|
|
54
|
+
/** Major version in the data directory's `PG_VERSION` (`'17'`). */
|
|
55
|
+
readonly found: string;
|
|
56
|
+
/** Major version of the running engine (`'18'`), when known. */
|
|
57
|
+
readonly expected: string | undefined;
|
|
58
|
+
readonly dataDir: string;
|
|
59
|
+
constructor(dataDir: string, found: string, expected: string | undefined, options?: {
|
|
60
|
+
cause?: unknown;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export type MigrationErrorKind = 'unknown-applied' | 'order' | 'changed' | 'duplicate' | 'failed';
|
|
64
|
+
/** A migration problem: the database's history does not match the list (drift), or one migration failed (and was rolled back). */
|
|
65
|
+
export declare class MigrationError extends Error {
|
|
66
|
+
readonly kind: MigrationErrorKind;
|
|
67
|
+
readonly migration?: string;
|
|
68
|
+
constructor(kind: MigrationErrorKind, message: string, options?: {
|
|
69
|
+
migration?: string;
|
|
70
|
+
cause?: unknown;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** A database error in a form a UI can show: the message, SQLSTATE code and where in the SQL it happened. */
|
|
74
|
+
export interface SqlError {
|
|
75
|
+
message: string;
|
|
76
|
+
/** SQLSTATE, e.g. `42P01` (undefined table). */
|
|
77
|
+
code?: string;
|
|
78
|
+
severity?: string;
|
|
79
|
+
detail?: string;
|
|
80
|
+
hint?: string;
|
|
81
|
+
/** 1-based character position of the error in the SQL that was run. */
|
|
82
|
+
position?: number;
|
|
83
|
+
line?: number;
|
|
84
|
+
column?: number;
|
|
85
|
+
}
|
|
86
|
+
/** Normalises whatever was thrown (a PGlite `DatabaseError`, a plain Error, a string) into a {@link SqlError}. `sql` adds line and column. */
|
|
87
|
+
export declare function toSqlError(error: unknown, sql?: string): SqlError;
|
|
88
|
+
/** `"my table"` — an identifier quoted for SQL. */
|
|
89
|
+
export declare function quoteIdent(name: string): string;
|
|
90
|
+
/** An identifier as you would type it: bare when it is a plain lowercase name, quoted when it has capitals, spaces or is a reserved word. */
|
|
91
|
+
export declare function identifier(name: string): string;
|
|
92
|
+
/** `'it''s'` — a string literal quoted for SQL (prefer query parameters for values). */
|
|
93
|
+
export declare function quoteLiteral(value: string): string;
|
|
94
|
+
export type DataDirKind = 'memory' | 'idb' | 'opfs-ahp' | 'nodefs';
|
|
95
|
+
export interface ParsedDataDir {
|
|
96
|
+
kind: DataDirKind;
|
|
97
|
+
/** The database name (the part after `idb://` / `opfs-ahp://`; the path for `file://`). */
|
|
98
|
+
name: string;
|
|
99
|
+
/** The normalised string PGlite takes. */
|
|
100
|
+
dataDir: string;
|
|
101
|
+
}
|
|
102
|
+
/** `memory://` (default) | `idb://<name>` | `opfs-ahp://<name>` | `file://<path>` (Node and Bun). */
|
|
103
|
+
export declare function parseDataDir(dataDir: string | undefined): ParsedDataDir;
|
|
104
|
+
/** The Postgres major version recorded in an `idb://` database (its `PG_VERSION` file), `null` if the database does
|
|
105
|
+
not exist (or is not readable), without starting PGlite. Other data-dir kinds return `null`. */
|
|
106
|
+
export declare function peekDataDirVersion(dataDir: string): Promise<string | null>;
|
|
107
|
+
/** Deletes a persisted database. This destroys data — call it only from an explicit user action. Resolves when the
|
|
108
|
+
delete went through; rejects after `timeoutMs` if another connection (a tab, a worker) keeps it open. */
|
|
109
|
+
export declare function deleteDatabase(dataDir: string, { timeoutMs }?: {
|
|
110
|
+
timeoutMs?: number;
|
|
111
|
+
}): Promise<void>;
|
|
112
|
+
/** Where PGlite's binaries come from. By default PGlite resolves them next to its own module with
|
|
113
|
+
`new URL('./pglite.wasm', import.meta.url)`, which a bundler turns into an asset. Set these to host them yourself
|
|
114
|
+
(a CDN, a path your server compresses and caches) — URLs are fetched and compiled before the database starts.
|
|
115
|
+
Main-thread databases only: a worker file configures its own. */
|
|
116
|
+
export interface PGliteAssets {
|
|
117
|
+
/** `pglite.wasm`, the Postgres engine (~10 MB, ~3.4 MB gzip). */
|
|
118
|
+
wasm?: string | URL;
|
|
119
|
+
/** `initdb.wasm`, runs only when a database is created (~0.4 MB). */
|
|
120
|
+
initdbWasm?: string | URL;
|
|
121
|
+
/** `pglite.data`, the Postgres share files (~6 MB). */
|
|
122
|
+
data?: string | URL;
|
|
123
|
+
}
|
|
124
|
+
export interface Migration {
|
|
125
|
+
/** Unique and stable (`001_init`, `2026-10-02-add-notes`). Order in the list is the order they run in. */
|
|
126
|
+
id: string;
|
|
127
|
+
/** SQL (may hold several statements) or a function that receives the migration's transaction. */
|
|
128
|
+
sql: string | ((tx: SqlTransaction) => Promise<void>);
|
|
129
|
+
}
|
|
130
|
+
export interface OpenDatabaseOptions {
|
|
131
|
+
/** `memory://` (default), `idb://<name>` or `opfs-ahp://<name>`. */
|
|
132
|
+
dataDir?: string;
|
|
133
|
+
/** Run PGlite in a Web Worker: returns the `Worker` (`() => new Worker(new URL('./pglite.worker.ts', import.meta.url), { type: 'module' })`).
|
|
134
|
+
The worker file calls `worker({ init })` from `@electric-sql/pglite/worker`. With the default id, every tab that
|
|
135
|
+
starts the same worker shares ONE database through leader election, so several tabs can use it at once. */
|
|
136
|
+
worker?: () => Worker;
|
|
137
|
+
/** PGliteWorker's `id`: workers with the same id share one database across tabs; a unique id opts out. */
|
|
138
|
+
workerId?: string;
|
|
139
|
+
/** PGlite extensions by namespace (`{ vector }` from `@electric-sql/pglite-pgvector`). `live` is added unless `live` is false. */
|
|
140
|
+
extensions?: Record<string, unknown>;
|
|
141
|
+
/** Load the `live` extension (`useLiveQuery`). Default true (it is ~10 KB). */
|
|
142
|
+
live?: boolean;
|
|
143
|
+
/** Applied after the database opens (see {@link runMigrations}). */
|
|
144
|
+
migrations?: readonly Migration[];
|
|
145
|
+
/** Restore a data-directory archive from `exportDatabase(db, 'datadir')`. Only into a database that does not exist yet. */
|
|
146
|
+
loadDataDir?: Blob;
|
|
147
|
+
/** Flush to IndexedDB lazily instead of after every query: faster bulk writes, the last writes can be lost if the tab dies. */
|
|
148
|
+
relaxedDurability?: boolean;
|
|
149
|
+
assets?: PGliteAssets;
|
|
150
|
+
/** PGlite's debug level, 0–5. */
|
|
151
|
+
debug?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
152
|
+
}
|
|
153
|
+
export interface DatabaseInfo {
|
|
154
|
+
dataDir: string;
|
|
155
|
+
kind: DataDirKind;
|
|
156
|
+
/** `18.3` — `server_version`. */
|
|
157
|
+
serverVersion: string;
|
|
158
|
+
/** `18` */
|
|
159
|
+
serverMajor: number;
|
|
160
|
+
/** `0.5.8`, from `version()`, when reported. */
|
|
161
|
+
pgliteVersion?: string;
|
|
162
|
+
/** Running in a Web Worker. */
|
|
163
|
+
worker: boolean;
|
|
164
|
+
/** Applied by this open (empty when the database was already up to date). */
|
|
165
|
+
migrated: string[];
|
|
166
|
+
/** The `PG_VERSION` the data directory had before this open (`undefined` for a new database). */
|
|
167
|
+
previousMajor?: string;
|
|
168
|
+
}
|
|
169
|
+
export interface OpenedDatabase {
|
|
170
|
+
db: Database;
|
|
171
|
+
info: DatabaseInfo;
|
|
172
|
+
}
|
|
173
|
+
/** The server's version, from an open database. */
|
|
174
|
+
export declare function readServerInfo(db: SqlRunner): Promise<{
|
|
175
|
+
serverVersion: string;
|
|
176
|
+
serverMajor: number;
|
|
177
|
+
pgliteVersion?: string;
|
|
178
|
+
}>;
|
|
179
|
+
export declare function runtimePostgresMajor(): Promise<string>;
|
|
180
|
+
/** Opens a database. Imports PGlite on first use. Never deletes or rewrites existing data: a data directory from a
|
|
181
|
+
different Postgres major version rejects with {@link DataDirVersionError} instead. */
|
|
182
|
+
export declare function openDatabase(options?: OpenDatabaseOptions): Promise<OpenedDatabase & {
|
|
183
|
+
close(): Promise<void>;
|
|
184
|
+
}>;
|
|
185
|
+
export interface MigrationOptions {
|
|
186
|
+
/** The bookkeeping table (default `_bl_migrations`). */
|
|
187
|
+
table?: string;
|
|
188
|
+
}
|
|
189
|
+
export interface MigrationResult {
|
|
190
|
+
/** Ids applied by this call, in order. */
|
|
191
|
+
applied: string[];
|
|
192
|
+
/** How many were already applied. */
|
|
193
|
+
skipped: number;
|
|
194
|
+
}
|
|
195
|
+
/** Applies migrations in order, each in its own transaction together with its bookkeeping row.
|
|
196
|
+
*
|
|
197
|
+
* - Idempotent: calling it again applies only what is new.
|
|
198
|
+
* - Drift is an error, never repaired: the migrations the database has applied must be a **prefix** of `migrations`
|
|
199
|
+
* (same ids, same order), and an applied SQL migration whose text changed is rejected. A database that has applied
|
|
200
|
+
* migrations the list no longer contains (an older app version opened a newer database) is rejected too.
|
|
201
|
+
* - A failing migration rolls back, stops the run and throws a {@link MigrationError} naming it; earlier ones stay applied. */
|
|
202
|
+
export declare function runMigrations(db: Pick<Database, 'transaction' | 'exec' | 'query'>, migrations: readonly Migration[], { table }?: MigrationOptions): Promise<MigrationResult>;
|
|
203
|
+
export interface StatementResult extends SqlResult {
|
|
204
|
+
/** The statement's SQL, when the script could be split reliably. */
|
|
205
|
+
statement?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface RunOutcome {
|
|
208
|
+
results: StatementResult[];
|
|
209
|
+
/** Wall-clock time of the whole script. */
|
|
210
|
+
durationMs: number;
|
|
211
|
+
/** Set when a statement failed; `results` is then empty (a script is one implicit transaction, so nothing was applied). */
|
|
212
|
+
error?: SqlError;
|
|
213
|
+
/** Statements in the script that ran (or tried to). */
|
|
214
|
+
statementCount: number;
|
|
215
|
+
}
|
|
216
|
+
/** Runs a script of one or more statements through `exec` and returns one result per statement. A script without its
|
|
217
|
+
* own BEGIN/COMMIT is one implicit transaction, so a failure applies none of it; the error carries the position. Never throws for SQL errors. */
|
|
218
|
+
export declare function runSql(db: Pick<Database, 'exec'>, sql: string): Promise<RunOutcome>;
|
|
219
|
+
//# sourceMappingURL=pglite-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pglite-core.d.ts","sourceRoot":"","sources":["../../src/lib/pglite-core.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACpD,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,uFAAuF;IACvF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,SAAS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