@lunora/client 1.0.0-alpha.253 → 1.0.0-alpha.255
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 +2 -1
- package/dist/auth/index.d.mts +104 -3
- package/dist/auth/index.d.ts +104 -3
- package/dist/auth/index.mjs +1 -1
- package/dist/index.d.mts +36 -4
- package/dist/index.d.ts +36 -4
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/ADMIN_AUTH_DEFAULT_PAGE_SIZE-V9c3bHU1.mjs +1 -0
- package/dist/packem_shared/LunoraClient-C0k-uoqW.mjs +1 -0
- package/dist/packem_shared/base64-849R7V-V.mjs +1 -0
- package/dist/packem_shared/{createAsyncStorageQueryCache-COqH5_SV.mjs → createAsyncStorageQueryCache-D8NJXPJa.mjs} +1 -1
- package/dist/packem_shared/{createInMemoryPersistence-BfgXApi_.mjs → createInMemoryPersistence-C-IzNVbg.mjs} +1 -1
- package/dist/packem_shared/{createInMemoryQueryCache-B5wX-gTy.mjs → createInMemoryQueryCache-DR6AorA2.mjs} +1 -1
- package/dist/packem_shared/{createServerClient-kd9cUs8g.mjs → createServerClient-Du4HiC_d.mjs} +1 -1
- package/dist/packem_shared/{lunora-client.d-DNnOIB-r.d.ts → lunora-client.d-cLNaBGfy.d.ts} +28 -5
- package/dist/packem_shared/{lunora-client.d-ChRS_d1s.d.mts → lunora-client.d-dAc3I0a1.d.mts} +28 -5
- package/dist/packem_shared/lunoraQueryKey-CucWmxnx.mjs +1 -0
- package/dist/packem_shared/{preload.d-BI3eXoRM.d.ts → preload.d-BWyb1pSK.d.ts} +1 -1
- package/dist/packem_shared/{preload.d-tHxsfuM9.d.mts → preload.d-DJrMasnC.d.mts} +1 -1
- package/dist/packem_shared/setAuthTokenProvider-DhBppDiZ.mjs +1 -0
- package/dist/query/index.d.mts +77 -5
- package/dist/query/index.d.ts +77 -5
- package/dist/query/index.mjs +1 -1
- package/dist/ssr/index.d.mts +2 -2
- package/dist/ssr/index.d.ts +2 -2
- package/dist/ssr/index.mjs +1 -1
- package/dist/upload.d.mts +14 -0
- package/dist/upload.d.ts +14 -0
- package/package.json +1 -1
- package/dist/packem_shared/LunoraClient-C-auNTDs.mjs +0 -1
package/README.md
CHANGED
|
@@ -94,7 +94,8 @@ client.close();
|
|
|
94
94
|
## Related
|
|
95
95
|
|
|
96
96
|
- [`@lunora/react`](https://www.npmjs.com/package/@lunora/react) — React hooks built on this client.
|
|
97
|
-
- `@lunora/client/query` — the shared live-query state machine every UI adapter builds on (subpath of this package).
|
|
97
|
+
- `@lunora/client/query` — the shared live-query state machine every UI adapter builds on, plus the TanStack Query key contract and `lunoraQueryOptions` factory (subpath of this package).
|
|
98
|
+
- `@lunora/client/auth` — the identity store and auth-gate contract, plus the framework-neutral core of the admin/organization list hooks (subpath of this package).
|
|
98
99
|
- `@lunora/client/ssr` — server-side preloading over this client's HTTP transport (subpath of this package).
|
|
99
100
|
|
|
100
101
|
## Supported Node.js Versions
|
package/dist/auth/index.d.mts
CHANGED
|
@@ -1,7 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@lunora/client/auth` — framework-agnostic identity store, and the auth-gate
|
|
3
|
+
* contract every UI adapter implements.
|
|
4
|
+
*
|
|
5
|
+
* The `LunoraClient` is framework-neutral and exposes auth through an async
|
|
6
|
+
* `getCurrentUser()` plus `onAuthTokenChange`. This module lifts the per-client
|
|
7
|
+
* identity caching and listener-fan-out into a shared store that every UI
|
|
8
|
+
* adapter (React, Vue, Solid, Svelte, Angular) consumes, so only one fetch runs
|
|
9
|
+
* at a time and all mounted hooks re-render together when identity resolves or
|
|
10
|
+
* the token changes.
|
|
11
|
+
*
|
|
12
|
+
* ## The auth-gate contract
|
|
13
|
+
*
|
|
14
|
+
* **Read this before adding or changing a gate in any adapter.** Five adapters
|
|
15
|
+
* expose the same three-state gate, and they must agree on what each state
|
|
16
|
+
* means; deriving a gate from `user !== null` (or from the token alone) is how
|
|
17
|
+
* they last disagreed. The single source of truth is {@link AuthStatus}, and the
|
|
18
|
+
* two predicates {@link isAuthenticatedStatus} / {@link isLoadingStatus} — an
|
|
19
|
+
* adapter maps its reactive primitive onto those and adds nothing of its own.
|
|
20
|
+
*
|
|
21
|
+
* | status | meaning | gate |
|
|
22
|
+
* | ------------------ | ---------------------------------------------------------------- | --------------- |
|
|
23
|
+
* | `unauthenticated` | the server answered that there is no session | signed out |
|
|
24
|
+
* | `loading` | the first identity resolve is in flight | loading |
|
|
25
|
+
* | `authenticated` | the server returned a user | authenticated |
|
|
26
|
+
* | `unreachable` | a credential is held but the identity endpoint could not be reached | authenticated |
|
|
27
|
+
*
|
|
28
|
+
* No row says "no bearer token". A **cookie session carries no token here** —
|
|
29
|
+
* it is better-auth's default, what `@lunora/auth-ui` is built on, and what
|
|
30
|
+
* `examples/auth-playground` ships (`createAuthClient` plus
|
|
31
|
+
* `new LunoraClient({ url })`, never `setAuthToken`). Answering
|
|
32
|
+
* `unauthenticated` off a null token alone declared every user of every such
|
|
33
|
+
* app signed out without asking the server, which also left
|
|
34
|
+
* `LunoraClient`'s identity fingerprint `null` for all of them — and a
|
|
35
|
+
* fingerprint that is `null` for everyone is what turns the offline-queue,
|
|
36
|
+
* read-cache and socket identity gates into `null === null`. The first resolve
|
|
37
|
+
* therefore ALWAYS asks; only after an answer does a cleared token
|
|
38
|
+
* short-circuit.
|
|
39
|
+
*
|
|
40
|
+
* `unreachable` counts as authenticated because the **credential** is what
|
|
41
|
+
* authorises requests; a failed identity round-trip is a fact about the network,
|
|
42
|
+
* not about the session. Treating it as signed out turns every offline reload
|
|
43
|
+
* into a sign-out, and treating it as loading spins a fallback for the whole
|
|
44
|
+
* offline period — both of which shipped.
|
|
45
|
+
*
|
|
46
|
+
* The consequence a UI has to respect: `user` may be `null` while the gate says
|
|
47
|
+
* authenticated. Branch on `status`, never on `user === null`, to tell "signed
|
|
48
|
+
* out" from "signed in, identity not resolved yet".
|
|
49
|
+
*/
|
|
50
|
+
import { L as LunoraClient, U as User } from "../packem_shared/lunora-client.d-dAc3I0a1.mjs";
|
|
51
|
+
import { AuthPage, AuthSession, AuthUser } from '@lunora/runtime';
|
|
2
52
|
import '@lunora/errors';
|
|
3
53
|
import "../packem_shared/function-reference.d-Br_hsKje.mjs";
|
|
4
|
-
|
|
54
|
+
/** Default page size for the first read; a "load more" grows the requested window by the page size. */
|
|
55
|
+
declare const ADMIN_AUTH_DEFAULT_PAGE_SIZE = 50;
|
|
56
|
+
/** One paged admin-auth collection: the key that identifies its inputs, and how to read a `{ limit }` window from the top. */
|
|
57
|
+
interface AdminAuthList<T> {
|
|
58
|
+
/** Read the first `limit` rows. `AuthPage` is offset/limit-based, so a larger window re-reads from the top rather than appending. */
|
|
59
|
+
readonly fetchPage: (limit: number) => Promise<AuthPage<T>>;
|
|
60
|
+
/** Every input that should invalidate the cache — not `fetchPage`, which is a fresh closure per call. */
|
|
61
|
+
readonly key: ReadonlyArray<unknown>;
|
|
62
|
+
}
|
|
63
|
+
/** Search / filter / sort inputs for {@link authUsersList}. */
|
|
64
|
+
interface AuthUsersListFilter {
|
|
65
|
+
filterField?: string;
|
|
66
|
+
filterValue?: string;
|
|
67
|
+
search?: string;
|
|
68
|
+
searchField?: string;
|
|
69
|
+
sortBy?: string;
|
|
70
|
+
sortDirection?: "asc" | "desc";
|
|
71
|
+
}
|
|
72
|
+
/** Users, via the admin-gated `GET /_lunora/admin/auth/users` (`client.listAuthUsers`). */
|
|
73
|
+
declare const authUsersList: (client: LunoraClient, filter?: AuthUsersListFilter) => AdminAuthList<AuthUser>;
|
|
74
|
+
/** Organizations (better-auth `organization` plugin), via `client.listAuthOrganizations`. */
|
|
75
|
+
declare const authOrganizationsList: (client: LunoraClient) => AdminAuthList<Record<string, unknown>>;
|
|
76
|
+
/** Sign-up invitations (`inviteOnly` plugin), via `client.listAuthSignUpInvitations`. Rows are unfiltered and newest-first. */
|
|
77
|
+
declare const authSignUpInvitationsList: (client: LunoraClient) => AdminAuthList<Record<string, unknown>>;
|
|
78
|
+
/** Auth sessions, optionally scoped to one user, via `client.listAuthSessions`. */
|
|
79
|
+
declare const authSessionsList: (client: LunoraClient, options?: {
|
|
80
|
+
userId?: string;
|
|
81
|
+
}) => AdminAuthList<AuthSession>;
|
|
82
|
+
/**
|
|
83
|
+
* The cache key for one window of an admin list: `[namespace, identity, ...list.key, limit]`.
|
|
84
|
+
*
|
|
85
|
+
* The acting identity (slot 1) partitions the cache, or a credential swap on the
|
|
86
|
+
* same client (admin A → admin B) would serve A's cached rows to B until the
|
|
87
|
+
* refetch lands. It is `client.currentIdentity()` — a `subj:` label or a
|
|
88
|
+
* non-reversible token hash — never the bearer token: query keys are not
|
|
89
|
+
* private (persisters write them to `localStorage`, devtools render them,
|
|
90
|
+
* telemetry logs them), and a same-user token refresh keeps the same key.
|
|
91
|
+
*
|
|
92
|
+
* An adapter that keeps the previous window visible while a larger one loads
|
|
93
|
+
* must only do so when slot 1 is unchanged, so one identity's rows never stand
|
|
94
|
+
* in for another's.
|
|
95
|
+
*/
|
|
96
|
+
declare const adminAuthListQueryKey: (identity: string | null, list: AdminAuthList<unknown>, limit: number) => ReadonlyArray<unknown>;
|
|
97
|
+
/**
|
|
98
|
+
* Subscribe to every change of `client.currentIdentity()`. Both signals are
|
|
99
|
+
* needed: a bearer swap fires `onAuthTokenChange`, while a cookie session's
|
|
100
|
+
* user switch or sign-out fires only `onIdentityChange` (no token changes
|
|
101
|
+
* hands) — subscribing to one leaves the other's previous rows on screen.
|
|
102
|
+
*/
|
|
103
|
+
declare const subscribeAdminAuthIdentity: (client: LunoraClient, onChange: () => void) => (() => void);
|
|
104
|
+
/** `true` when the server reports rows beyond the loaded window; `false` before the first page resolves, so "load more" past the end is a no-op. */
|
|
105
|
+
declare const adminAuthListHasMore: (page: AuthPage<unknown> | undefined) => boolean;
|
|
5
106
|
/**
|
|
6
107
|
* Every {@link AuthStatus}, as a value — the contract table in this module's
|
|
7
108
|
* header, and the `@lunora/client` docs table that restates it for consumers,
|
|
@@ -48,4 +149,4 @@ interface IdentityStore {
|
|
|
48
149
|
* returns the same store, keeping the single-fetch / fan-out invariant.
|
|
49
150
|
*/
|
|
50
151
|
declare const getIdentityStore: (client: LunoraClient) => IdentityStore;
|
|
51
|
-
export { AUTH_STATUSES, type AuthStatus, type IdentityStore, getIdentityStore, isAuthenticatedStatus, isLoadingStatus };
|
|
152
|
+
export { ADMIN_AUTH_DEFAULT_PAGE_SIZE, AUTH_STATUSES, type AdminAuthList, type AuthStatus, type AuthUsersListFilter, type IdentityStore, adminAuthListHasMore, adminAuthListQueryKey, authOrganizationsList, authSessionsList, authSignUpInvitationsList, authUsersList, getIdentityStore, isAuthenticatedStatus, isLoadingStatus, subscribeAdminAuthIdentity };
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@lunora/client/auth` — framework-agnostic identity store, and the auth-gate
|
|
3
|
+
* contract every UI adapter implements.
|
|
4
|
+
*
|
|
5
|
+
* The `LunoraClient` is framework-neutral and exposes auth through an async
|
|
6
|
+
* `getCurrentUser()` plus `onAuthTokenChange`. This module lifts the per-client
|
|
7
|
+
* identity caching and listener-fan-out into a shared store that every UI
|
|
8
|
+
* adapter (React, Vue, Solid, Svelte, Angular) consumes, so only one fetch runs
|
|
9
|
+
* at a time and all mounted hooks re-render together when identity resolves or
|
|
10
|
+
* the token changes.
|
|
11
|
+
*
|
|
12
|
+
* ## The auth-gate contract
|
|
13
|
+
*
|
|
14
|
+
* **Read this before adding or changing a gate in any adapter.** Five adapters
|
|
15
|
+
* expose the same three-state gate, and they must agree on what each state
|
|
16
|
+
* means; deriving a gate from `user !== null` (or from the token alone) is how
|
|
17
|
+
* they last disagreed. The single source of truth is {@link AuthStatus}, and the
|
|
18
|
+
* two predicates {@link isAuthenticatedStatus} / {@link isLoadingStatus} — an
|
|
19
|
+
* adapter maps its reactive primitive onto those and adds nothing of its own.
|
|
20
|
+
*
|
|
21
|
+
* | status | meaning | gate |
|
|
22
|
+
* | ------------------ | ---------------------------------------------------------------- | --------------- |
|
|
23
|
+
* | `unauthenticated` | the server answered that there is no session | signed out |
|
|
24
|
+
* | `loading` | the first identity resolve is in flight | loading |
|
|
25
|
+
* | `authenticated` | the server returned a user | authenticated |
|
|
26
|
+
* | `unreachable` | a credential is held but the identity endpoint could not be reached | authenticated |
|
|
27
|
+
*
|
|
28
|
+
* No row says "no bearer token". A **cookie session carries no token here** —
|
|
29
|
+
* it is better-auth's default, what `@lunora/auth-ui` is built on, and what
|
|
30
|
+
* `examples/auth-playground` ships (`createAuthClient` plus
|
|
31
|
+
* `new LunoraClient({ url })`, never `setAuthToken`). Answering
|
|
32
|
+
* `unauthenticated` off a null token alone declared every user of every such
|
|
33
|
+
* app signed out without asking the server, which also left
|
|
34
|
+
* `LunoraClient`'s identity fingerprint `null` for all of them — and a
|
|
35
|
+
* fingerprint that is `null` for everyone is what turns the offline-queue,
|
|
36
|
+
* read-cache and socket identity gates into `null === null`. The first resolve
|
|
37
|
+
* therefore ALWAYS asks; only after an answer does a cleared token
|
|
38
|
+
* short-circuit.
|
|
39
|
+
*
|
|
40
|
+
* `unreachable` counts as authenticated because the **credential** is what
|
|
41
|
+
* authorises requests; a failed identity round-trip is a fact about the network,
|
|
42
|
+
* not about the session. Treating it as signed out turns every offline reload
|
|
43
|
+
* into a sign-out, and treating it as loading spins a fallback for the whole
|
|
44
|
+
* offline period — both of which shipped.
|
|
45
|
+
*
|
|
46
|
+
* The consequence a UI has to respect: `user` may be `null` while the gate says
|
|
47
|
+
* authenticated. Branch on `status`, never on `user === null`, to tell "signed
|
|
48
|
+
* out" from "signed in, identity not resolved yet".
|
|
49
|
+
*/
|
|
50
|
+
import { L as LunoraClient, U as User } from "../packem_shared/lunora-client.d-cLNaBGfy.js";
|
|
51
|
+
import { AuthPage, AuthSession, AuthUser } from '@lunora/runtime';
|
|
2
52
|
import '@lunora/errors';
|
|
3
53
|
import "../packem_shared/function-reference.d-Br_hsKje.js";
|
|
4
|
-
|
|
54
|
+
/** Default page size for the first read; a "load more" grows the requested window by the page size. */
|
|
55
|
+
declare const ADMIN_AUTH_DEFAULT_PAGE_SIZE = 50;
|
|
56
|
+
/** One paged admin-auth collection: the key that identifies its inputs, and how to read a `{ limit }` window from the top. */
|
|
57
|
+
interface AdminAuthList<T> {
|
|
58
|
+
/** Read the first `limit` rows. `AuthPage` is offset/limit-based, so a larger window re-reads from the top rather than appending. */
|
|
59
|
+
readonly fetchPage: (limit: number) => Promise<AuthPage<T>>;
|
|
60
|
+
/** Every input that should invalidate the cache — not `fetchPage`, which is a fresh closure per call. */
|
|
61
|
+
readonly key: ReadonlyArray<unknown>;
|
|
62
|
+
}
|
|
63
|
+
/** Search / filter / sort inputs for {@link authUsersList}. */
|
|
64
|
+
interface AuthUsersListFilter {
|
|
65
|
+
filterField?: string;
|
|
66
|
+
filterValue?: string;
|
|
67
|
+
search?: string;
|
|
68
|
+
searchField?: string;
|
|
69
|
+
sortBy?: string;
|
|
70
|
+
sortDirection?: "asc" | "desc";
|
|
71
|
+
}
|
|
72
|
+
/** Users, via the admin-gated `GET /_lunora/admin/auth/users` (`client.listAuthUsers`). */
|
|
73
|
+
declare const authUsersList: (client: LunoraClient, filter?: AuthUsersListFilter) => AdminAuthList<AuthUser>;
|
|
74
|
+
/** Organizations (better-auth `organization` plugin), via `client.listAuthOrganizations`. */
|
|
75
|
+
declare const authOrganizationsList: (client: LunoraClient) => AdminAuthList<Record<string, unknown>>;
|
|
76
|
+
/** Sign-up invitations (`inviteOnly` plugin), via `client.listAuthSignUpInvitations`. Rows are unfiltered and newest-first. */
|
|
77
|
+
declare const authSignUpInvitationsList: (client: LunoraClient) => AdminAuthList<Record<string, unknown>>;
|
|
78
|
+
/** Auth sessions, optionally scoped to one user, via `client.listAuthSessions`. */
|
|
79
|
+
declare const authSessionsList: (client: LunoraClient, options?: {
|
|
80
|
+
userId?: string;
|
|
81
|
+
}) => AdminAuthList<AuthSession>;
|
|
82
|
+
/**
|
|
83
|
+
* The cache key for one window of an admin list: `[namespace, identity, ...list.key, limit]`.
|
|
84
|
+
*
|
|
85
|
+
* The acting identity (slot 1) partitions the cache, or a credential swap on the
|
|
86
|
+
* same client (admin A → admin B) would serve A's cached rows to B until the
|
|
87
|
+
* refetch lands. It is `client.currentIdentity()` — a `subj:` label or a
|
|
88
|
+
* non-reversible token hash — never the bearer token: query keys are not
|
|
89
|
+
* private (persisters write them to `localStorage`, devtools render them,
|
|
90
|
+
* telemetry logs them), and a same-user token refresh keeps the same key.
|
|
91
|
+
*
|
|
92
|
+
* An adapter that keeps the previous window visible while a larger one loads
|
|
93
|
+
* must only do so when slot 1 is unchanged, so one identity's rows never stand
|
|
94
|
+
* in for another's.
|
|
95
|
+
*/
|
|
96
|
+
declare const adminAuthListQueryKey: (identity: string | null, list: AdminAuthList<unknown>, limit: number) => ReadonlyArray<unknown>;
|
|
97
|
+
/**
|
|
98
|
+
* Subscribe to every change of `client.currentIdentity()`. Both signals are
|
|
99
|
+
* needed: a bearer swap fires `onAuthTokenChange`, while a cookie session's
|
|
100
|
+
* user switch or sign-out fires only `onIdentityChange` (no token changes
|
|
101
|
+
* hands) — subscribing to one leaves the other's previous rows on screen.
|
|
102
|
+
*/
|
|
103
|
+
declare const subscribeAdminAuthIdentity: (client: LunoraClient, onChange: () => void) => (() => void);
|
|
104
|
+
/** `true` when the server reports rows beyond the loaded window; `false` before the first page resolves, so "load more" past the end is a no-op. */
|
|
105
|
+
declare const adminAuthListHasMore: (page: AuthPage<unknown> | undefined) => boolean;
|
|
5
106
|
/**
|
|
6
107
|
* Every {@link AuthStatus}, as a value — the contract table in this module's
|
|
7
108
|
* header, and the `@lunora/client` docs table that restates it for consumers,
|
|
@@ -48,4 +149,4 @@ interface IdentityStore {
|
|
|
48
149
|
* returns the same store, keeping the single-fetch / fan-out invariant.
|
|
49
150
|
*/
|
|
50
151
|
declare const getIdentityStore: (client: LunoraClient) => IdentityStore;
|
|
51
|
-
export { AUTH_STATUSES, type AuthStatus, type IdentityStore, getIdentityStore, isAuthenticatedStatus, isLoadingStatus };
|
|
152
|
+
export { ADMIN_AUTH_DEFAULT_PAGE_SIZE, AUTH_STATUSES, type AdminAuthList, type AuthStatus, type AuthUsersListFilter, type IdentityStore, adminAuthListHasMore, adminAuthListQueryKey, authOrganizationsList, authSessionsList, authSignUpInvitationsList, authUsersList, getIdentityStore, isAuthenticatedStatus, isLoadingStatus, subscribeAdminAuthIdentity };
|
package/dist/auth/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{ADMIN_AUTH_DEFAULT_PAGE_SIZE as U,adminAuthListHasMore as k,adminAuthListQueryKey as p,authOrganizationsList as _,authSessionsList as m,authSignUpInvitationsList as v,authUsersList as E,subscribeAdminAuthIdentity as w}from"../packem_shared/ADMIN_AUTH_DEFAULT_PAGE_SIZE-V9c3bHU1.mjs";const S=["authenticated","loading","unauthenticated","unreachable"],y=t=>t==="authenticated"||t==="unreachable",b=t=>t==="loading",f=new WeakMap,A=t=>{const n=new Set;let u=null,r="loading",c=!1,h=!1,a;const g=()=>{for(const e of n)e()};let o=0;const s=(e,i)=>{(r!==e||u!==i)&&(r=e,u=i,g())},d=(e=!1)=>{o+=1;const i=o;if(!e&&t.getAuthToken()===null&&h){s("unauthenticated",null);return}s(u===null?"loading":"authenticated",u),t.getCurrentUser().then(l=>{i===o&&(h=!0,s(l===null?"unauthenticated":"authenticated",l),l!==null&&a===`subj:${l.id}`&&(a=void 0))}).catch(()=>{a=void 0,i===o&&s("unreachable",u)})};return t.expectIdentityResolution(),t.onAuthTokenChange(()=>{d()}),t.onIdentityChange(()=>{if(!c||t.getAuthToken()!==null)return;const e=t.currentIdentity();e===null?s("unauthenticated",null):e!==a&&(a=e,d(!0))}),t.onConnectionStatus(e=>{e==="connected"&&r==="unreachable"&&d(!0)}),{getStatus:()=>r,getUser:()=>u,subscribe:e=>(n.add(e),c||(c=!0,d()),()=>{n.delete(e)})}},I=t=>{let n=f.get(t);return n||(n=A(t),f.set(t,n)),n};export{U as ADMIN_AUTH_DEFAULT_PAGE_SIZE,S as AUTH_STATUSES,k as adminAuthListHasMore,p as adminAuthListQueryKey,_ as authOrganizationsList,m as authSessionsList,v as authSignUpInvitationsList,E as authUsersList,I as getIdentityStore,y as isAuthenticatedStatus,b as isLoadingStatus,w as subscribeAdminAuthIdentity};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions
|
|
2
|
-
export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OnlineOnlyOption, type z as OptimisticLocalStore, type E as OptimisticUpdate, type I as OutboxMutation, type J as OutboxSink, type K as PersistedMutation, type P as Preloaded, type N as ReplayCredential, type T as ReplayIdentityVerdict, type V as RoomRef, type W as RowOp, type X as RpcEnvelope, type Y as RpcResponseBody, type Z as ScheduleRecord, type _ as ScheduleRetryPolicy, type $ as SchedulerPoolStatus, type a0 as SchedulerStatus, type a1 as ServerMessage, type a2 as ServerPokeEndMessage, type a3 as ServerPokePartMessage, type a4 as ServerPokeStartMessage, type a5 as ShardTrafficEntry, type a6 as ShardTrafficResult, type a7 as StorageListPage, type a8 as StorageObject, type a9 as StoredQuery, type aa as StreamHandle, type ab as SubscriptionCallback, type b as SubscriptionErrorCallback, ac as SubscriptionRegistry, type ad as SubscriptionState, type ae as SyncStatus, type af as SyncWatermark, type
|
|
1
|
+
import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, L as LunoraClient, a as Unsubscribe, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions } from "./packem_shared/lunora-client.d-dAc3I0a1.mjs";
|
|
2
|
+
export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OnlineOnlyOption, type z as OptimisticLocalStore, type E as OptimisticUpdate, type I as OutboxMutation, type J as OutboxSink, type K as PersistedMutation, type P as Preloaded, type N as ReplayCredential, type T as ReplayIdentityVerdict, type V as RoomRef, type W as RowOp, type X as RpcEnvelope, type Y as RpcResponseBody, type Z as ScheduleRecord, type _ as ScheduleRetryPolicy, type $ as SchedulerPoolStatus, type a0 as SchedulerStatus, type a1 as ServerMessage, type a2 as ServerPokeEndMessage, type a3 as ServerPokePartMessage, type a4 as ServerPokeStartMessage, type a5 as ShardTrafficEntry, type a6 as ShardTrafficResult, type a7 as StorageListPage, type a8 as StorageObject, type a9 as StoredQuery, type aa as StreamHandle, type ab as SubscriptionCallback, type b as SubscriptionErrorCallback, ac as SubscriptionRegistry, type ad as SubscriptionState, type ae as SyncStatus, type af as SyncWatermark, type U as User, type ag as WorkflowInstanceAction, type ah as WorkflowInstanceDetail, type ai as WorkflowInstancePage, type aj as WorkflowInstanceStatus, type ak as WorkflowInstanceSummary, type al as WorkflowStepDetail, type am as WsTokenProvider, an as createClientQuery, ao as createLocalStore, ap as createStream } from "./packem_shared/lunora-client.d-dAc3I0a1.mjs";
|
|
3
3
|
import { LunoraError, LunoraErrorCode } from '@lunora/errors';
|
|
4
4
|
export type { LunoraErrorCode } from '@lunora/errors';
|
|
5
|
-
export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-
|
|
5
|
+
export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-DJrMasnC.mjs";
|
|
6
6
|
import { F as FunctionReference } from "./packem_shared/function-reference.d-Br_hsKje.mjs";
|
|
7
7
|
export type { A as ArgsOf, R as ReturnOf } from "./packem_shared/function-reference.d-Br_hsKje.mjs";
|
|
8
8
|
export type { AuthCapabilities, AuthConfigInfo, AuthImpersonation, AuthPage, AuthSession, AuthUser, AuthUserFieldSpec, CronJobInfo, KvKeyEntry, KvKeyListResult, KvNamespaceSummary, KvValueResult, PipelineLogColumnMap, PipelineLogCursor, PipelineLogField, PipelineLogPage, PipelineLogQuery, PipelineLogRow, VectorIndexSummary, VectorQueryMatch } from '@lunora/runtime';
|
|
@@ -249,6 +249,38 @@ interface AsyncStorageQueryCacheOptions {
|
|
|
249
249
|
* path.
|
|
250
250
|
*/
|
|
251
251
|
declare const createAsyncStorageQueryCache: (options: AsyncStorageQueryCacheOptions) => QueryCacheAdapter;
|
|
252
|
+
interface AuthTokenProviderOptions {
|
|
253
|
+
/**
|
|
254
|
+
* The stable user id behind the token, passed as `setAuthToken`'s `subject`
|
|
255
|
+
* so a refreshed token is not mistaken for an account switch (which would
|
|
256
|
+
* reject the queued offline writes `OFFLINE_IDENTITY_CHANGED`).
|
|
257
|
+
*/
|
|
258
|
+
subject?: string | null;
|
|
259
|
+
}
|
|
260
|
+
/** A provider token's fetcher: the current token, or `null` once the user is signed out. */
|
|
261
|
+
type AuthTokenFetcher = () => Promise<string | null>;
|
|
262
|
+
/**
|
|
263
|
+
* Keep the client's bearer in sync with an external identity provider (Clerk,
|
|
264
|
+
* WorkOS, Auth0…): fetch a token now, install it with `setAuthToken(token,
|
|
265
|
+
* subject)`, and fetch the next one shortly before the current one's `exp`.
|
|
266
|
+
* `onTokenExpired` (a socket closed `4001`, a refused offline replay) triggers
|
|
267
|
+
* an immediate refresh too.
|
|
268
|
+
*
|
|
269
|
+
* - One timer chain: a refresh in flight is shared, and each refresh replaces
|
|
270
|
+
* the pending timer.
|
|
271
|
+
* - `fetchToken` resolving `null` means signed out: the token is cleared and
|
|
272
|
+
* no refresh is scheduled. Map the provider's "not signed in" error to `null`
|
|
273
|
+
* (WorkOS `LoginRequiredError`; Clerk's `getToken()` already resolves `null`).
|
|
274
|
+
* - Any other error keeps the current token and retries after 5 s.
|
|
275
|
+
*
|
|
276
|
+
* Returns a stop function; call it on unmount or before installing another
|
|
277
|
+
* provider.
|
|
278
|
+
*
|
|
279
|
+
* ```ts
|
|
280
|
+
* const stop = setAuthTokenProvider(client, () => getToken(), { subject: userId });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
declare const setAuthTokenProvider: (client: LunoraClient, fetchToken: AuthTokenFetcher, options?: AuthTokenProviderOptions) => Unsubscribe;
|
|
252
284
|
/** Default in-memory bookmark store. Survives the lifetime of the client. */
|
|
253
285
|
declare const createInMemoryBookmarkStorage: () => BookmarkStorage;
|
|
254
286
|
/**
|
|
@@ -1164,4 +1196,4 @@ declare const createIndexedDbQueryCache: (options?: IndexedDbQueryCacheOptions)
|
|
|
1164
1196
|
* ```
|
|
1165
1197
|
*/
|
|
1166
1198
|
declare const createSnapshotPrecondition: (client: LunoraClient, functionRef: FunctionReference, args: Record<string, unknown>, shardKey?: string) => (() => boolean);
|
|
1167
|
-
export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeError, type LiveStreamSubscribeOptions, type LiveTopicOptions, type LiveTopicRef, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscribeLiveTopicOptions, type SubscriptionError, TabCoordinator, TransportError, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, liveTopicSubscription, maxSeq, queryCacheKey, reconcileOptimistic, subscribeLiveTopic };
|
|
1199
|
+
export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type AuthTokenFetcher, type AuthTokenProviderOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeError, type LiveStreamSubscribeOptions, type LiveTopicOptions, type LiveTopicRef, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscribeLiveTopicOptions, type SubscriptionError, TabCoordinator, TransportError, type Unsubscribe, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, liveTopicSubscription, maxSeq, queryCacheKey, reconcileOptimistic, setAuthTokenProvider, subscribeLiveTopic };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions
|
|
2
|
-
export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OnlineOnlyOption, type z as OptimisticLocalStore, type E as OptimisticUpdate, type I as OutboxMutation, type J as OutboxSink, type K as PersistedMutation, type P as Preloaded, type N as ReplayCredential, type T as ReplayIdentityVerdict, type V as RoomRef, type W as RowOp, type X as RpcEnvelope, type Y as RpcResponseBody, type Z as ScheduleRecord, type _ as ScheduleRetryPolicy, type $ as SchedulerPoolStatus, type a0 as SchedulerStatus, type a1 as ServerMessage, type a2 as ServerPokeEndMessage, type a3 as ServerPokePartMessage, type a4 as ServerPokeStartMessage, type a5 as ShardTrafficEntry, type a6 as ShardTrafficResult, type a7 as StorageListPage, type a8 as StorageObject, type a9 as StoredQuery, type aa as StreamHandle, type ab as SubscriptionCallback, type b as SubscriptionErrorCallback, ac as SubscriptionRegistry, type ad as SubscriptionState, type ae as SyncStatus, type af as SyncWatermark, type
|
|
1
|
+
import { R as ReconnectOptions, c as PersistenceAdapter, Q as QueryCacheAdapter, L as LunoraClient, a as Unsubscribe, B as BookmarkStorage, C as ConnectionStatus, S as SubscriptionError, H as HttpStreamRef, d as HttpStreamArgsOf, e as HttpStreamChunkOf, f as StreamIterable, O as OfflineQueueOptions } from "./packem_shared/lunora-client.d-cLNaBGfy.js";
|
|
2
|
+
export { type A as ActionCallOptions, type g as BatchSlot, type h as CachedQuery, type i as ClientDebugShard, type j as ClientDebugSnapshot, type k as ClientDebugSubscription, type l as ClientMessage, type m as ClientQueryRef, type n as ClientShapeSubscribeMessage, type o as ClientShapeUnsubscribeMessage, D as DEFAULT_MAX_BUFFER, type F as FunctionArgumentDescriptor, type p as FunctionDescriptor, type G as GlobalFacetResult, type q as GlobalFacetValue, type r as GlobalFilterClause, type s as GlobalTableInfo, type t as GlobalTablePage, type u as HttpStreamCallArgs, type v as LunoraClientError, type w as LunoraClientOptions, type M as MutationCallOptions, type x as MutationSettledEvent, type y as OnlineOnlyOption, type z as OptimisticLocalStore, type E as OptimisticUpdate, type I as OutboxMutation, type J as OutboxSink, type K as PersistedMutation, type P as Preloaded, type N as ReplayCredential, type T as ReplayIdentityVerdict, type V as RoomRef, type W as RowOp, type X as RpcEnvelope, type Y as RpcResponseBody, type Z as ScheduleRecord, type _ as ScheduleRetryPolicy, type $ as SchedulerPoolStatus, type a0 as SchedulerStatus, type a1 as ServerMessage, type a2 as ServerPokeEndMessage, type a3 as ServerPokePartMessage, type a4 as ServerPokeStartMessage, type a5 as ShardTrafficEntry, type a6 as ShardTrafficResult, type a7 as StorageListPage, type a8 as StorageObject, type a9 as StoredQuery, type aa as StreamHandle, type ab as SubscriptionCallback, type b as SubscriptionErrorCallback, ac as SubscriptionRegistry, type ad as SubscriptionState, type ae as SyncStatus, type af as SyncWatermark, type U as User, type ag as WorkflowInstanceAction, type ah as WorkflowInstanceDetail, type ai as WorkflowInstancePage, type aj as WorkflowInstanceStatus, type ak as WorkflowInstanceSummary, type al as WorkflowStepDetail, type am as WsTokenProvider, an as createClientQuery, ao as createLocalStore, ap as createStream } from "./packem_shared/lunora-client.d-cLNaBGfy.js";
|
|
3
3
|
import { LunoraError, LunoraErrorCode } from '@lunora/errors';
|
|
4
4
|
export type { LunoraErrorCode } from '@lunora/errors';
|
|
5
|
-
export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-
|
|
5
|
+
export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-BWyb1pSK.js";
|
|
6
6
|
import { F as FunctionReference } from "./packem_shared/function-reference.d-Br_hsKje.js";
|
|
7
7
|
export type { A as ArgsOf, R as ReturnOf } from "./packem_shared/function-reference.d-Br_hsKje.js";
|
|
8
8
|
export type { AuthCapabilities, AuthConfigInfo, AuthImpersonation, AuthPage, AuthSession, AuthUser, AuthUserFieldSpec, CronJobInfo, KvKeyEntry, KvKeyListResult, KvNamespaceSummary, KvValueResult, PipelineLogColumnMap, PipelineLogCursor, PipelineLogField, PipelineLogPage, PipelineLogQuery, PipelineLogRow, VectorIndexSummary, VectorQueryMatch } from '@lunora/runtime';
|
|
@@ -249,6 +249,38 @@ interface AsyncStorageQueryCacheOptions {
|
|
|
249
249
|
* path.
|
|
250
250
|
*/
|
|
251
251
|
declare const createAsyncStorageQueryCache: (options: AsyncStorageQueryCacheOptions) => QueryCacheAdapter;
|
|
252
|
+
interface AuthTokenProviderOptions {
|
|
253
|
+
/**
|
|
254
|
+
* The stable user id behind the token, passed as `setAuthToken`'s `subject`
|
|
255
|
+
* so a refreshed token is not mistaken for an account switch (which would
|
|
256
|
+
* reject the queued offline writes `OFFLINE_IDENTITY_CHANGED`).
|
|
257
|
+
*/
|
|
258
|
+
subject?: string | null;
|
|
259
|
+
}
|
|
260
|
+
/** A provider token's fetcher: the current token, or `null` once the user is signed out. */
|
|
261
|
+
type AuthTokenFetcher = () => Promise<string | null>;
|
|
262
|
+
/**
|
|
263
|
+
* Keep the client's bearer in sync with an external identity provider (Clerk,
|
|
264
|
+
* WorkOS, Auth0…): fetch a token now, install it with `setAuthToken(token,
|
|
265
|
+
* subject)`, and fetch the next one shortly before the current one's `exp`.
|
|
266
|
+
* `onTokenExpired` (a socket closed `4001`, a refused offline replay) triggers
|
|
267
|
+
* an immediate refresh too.
|
|
268
|
+
*
|
|
269
|
+
* - One timer chain: a refresh in flight is shared, and each refresh replaces
|
|
270
|
+
* the pending timer.
|
|
271
|
+
* - `fetchToken` resolving `null` means signed out: the token is cleared and
|
|
272
|
+
* no refresh is scheduled. Map the provider's "not signed in" error to `null`
|
|
273
|
+
* (WorkOS `LoginRequiredError`; Clerk's `getToken()` already resolves `null`).
|
|
274
|
+
* - Any other error keeps the current token and retries after 5 s.
|
|
275
|
+
*
|
|
276
|
+
* Returns a stop function; call it on unmount or before installing another
|
|
277
|
+
* provider.
|
|
278
|
+
*
|
|
279
|
+
* ```ts
|
|
280
|
+
* const stop = setAuthTokenProvider(client, () => getToken(), { subject: userId });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
declare const setAuthTokenProvider: (client: LunoraClient, fetchToken: AuthTokenFetcher, options?: AuthTokenProviderOptions) => Unsubscribe;
|
|
252
284
|
/** Default in-memory bookmark store. Survives the lifetime of the client. */
|
|
253
285
|
declare const createInMemoryBookmarkStorage: () => BookmarkStorage;
|
|
254
286
|
/**
|
|
@@ -1164,4 +1196,4 @@ declare const createIndexedDbQueryCache: (options?: IndexedDbQueryCacheOptions)
|
|
|
1164
1196
|
* ```
|
|
1165
1197
|
*/
|
|
1166
1198
|
declare const createSnapshotPrecondition: (client: LunoraClient, functionRef: FunctionReference, args: Record<string, unknown>, shardKey?: string) => (() => boolean);
|
|
1167
|
-
export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeError, type LiveStreamSubscribeOptions, type LiveTopicOptions, type LiveTopicRef, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscribeLiveTopicOptions, type SubscriptionError, TabCoordinator, TransportError, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, liveTopicSubscription, maxSeq, queryCacheKey, reconcileOptimistic, subscribeLiveTopic };
|
|
1199
|
+
export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type AsyncStorageQueryCacheOptions, type AuthTokenFetcher, type AuthTokenProviderOptions, type BookmarkStorage, CONFLICT_ERROR_CODE, type ConnectLiveStreamOptions, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, type LiveStream, type LiveStreamEvent, type LiveStreamSubscribeError, type LiveStreamSubscribeOptions, type LiveTopicOptions, type LiveTopicRef, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type StreamIterable, type SubscribeLiveTopicOptions, type SubscriptionError, TabCoordinator, TransportError, type Unsubscribe, applyDelta, connectLiveStream, createAsyncStoragePersistence, createAsyncStorageQueryCache, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createSnapshotPrecondition, getErrorCode, getRetryAfterMs, httpStream, isAuthReplayFailure, isConflictError, isForbiddenError, isMutationDelta, isRateLimitedError, isUnauthorizedError, liveTopicSubscription, maxSeq, queryCacheKey, reconcileOptimistic, setAuthTokenProvider, subscribeLiveTopic };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RETIRE_AFTER_DURABLE_SEQ_ADVANCE as o,maxSeq as t,reconcileOptimistic as a}from"./packem_shared/RETIRE_AFTER_DURABLE_SEQ_ADVANCE-DoEHtuR8.mjs";import{createAsyncStoragePersistence as i}from"./packem_shared/createAsyncStoragePersistence-6FCvqc6C.mjs";import{createAsyncStorageQueryCache as n}from"./packem_shared/createAsyncStorageQueryCache-
|
|
1
|
+
import{RETIRE_AFTER_DURABLE_SEQ_ADVANCE as o,maxSeq as t,reconcileOptimistic as a}from"./packem_shared/RETIRE_AFTER_DURABLE_SEQ_ADVANCE-DoEHtuR8.mjs";import{createAsyncStoragePersistence as i}from"./packem_shared/createAsyncStoragePersistence-6FCvqc6C.mjs";import{createAsyncStorageQueryCache as n}from"./packem_shared/createAsyncStorageQueryCache-D8NJXPJa.mjs";import{setAuthTokenProvider as s}from"./packem_shared/setAuthTokenProvider-DhBppDiZ.mjs";import{default as x}from"./packem_shared/createInMemoryBookmarkStorage-BooZhW0n.mjs";import{createCallRunner as l}from"./packem_shared/createCallRunner-Bwcrfh76.mjs";import{createClientQuery as d}from"./packem_shared/createClientQuery-B8Nfj-7o.mjs";import{TabCoordinator as R}from"./packem_shared/TabCoordinator-DBuR7Dwv.mjs";import{a as S,i as A}from"./packem_shared/delta-merge-Ls3DED4g.mjs";import{CONFLICT_ERROR_CODE as T,TransportError as b,getErrorCode as D,getRetryAfterMs as L,isAuthReplayFailure as Q,isConflictError as _,isForbiddenError as F,isRateLimitedError as I,isUnauthorizedError as M}from"./packem_shared/CONFLICT_ERROR_CODE-B7qNZMMk.mjs";import{httpStream as O}from"./packem_shared/httpStream-B9iENFKq.mjs";import{c as v}from"./packem_shared/live-stream-DBKgZlnb.mjs";import{liveTopicSubscription as k,subscribeLiveTopic as B}from"./packem_shared/liveTopicSubscription-DQtKMFKw.mjs";import{c as N}from"./packem_shared/local-store-C3bw2MPY.mjs";import{LunoraClient as K}from"./packem_shared/LunoraClient-C0k-uoqW.mjs";import{createMutatorRunner as X}from"./packem_shared/createMutatorRunner-CuMRJpUx.mjs";import{O as w}from"./packem_shared/offline-queue-BEqCPDmw.mjs";import{createInMemoryPersistence as H,createIndexedDbPersistence as J}from"./packem_shared/createInMemoryPersistence-C-IzNVbg.mjs";import{preloadQuery as Y,preloadedQueryResult as Z}from"./packem_shared/preloadQuery-uFy24PCR.mjs";import{createInMemoryQueryCache as ee,createIndexedDbQueryCache as re,queryCacheKey as oe}from"./packem_shared/createInMemoryQueryCache-DR6AorA2.mjs";import{createReconnect as ae}from"./packem_shared/createReconnect-CjTmjJDH.mjs";import{c as ie}from"./packem_shared/snapshot-precondition-BEtcSbWr.mjs";import{DEFAULT_MAX_BUFFER as ne,createStream as me}from"./packem_shared/DEFAULT_MAX_BUFFER-Bd-_iyiV.mjs";import{SubscriptionRegistry as fe}from"./packem_shared/SubscriptionRegistry-BKgQtuh9.mjs";export{T as CONFLICT_ERROR_CODE,ne as DEFAULT_MAX_BUFFER,K as LunoraClient,w as OfflineQueue,o as RETIRE_AFTER_DURABLE_SEQ_ADVANCE,fe as SubscriptionRegistry,R as TabCoordinator,b as TransportError,S as applyDelta,v as connectLiveStream,i as createAsyncStoragePersistence,n as createAsyncStorageQueryCache,l as createCallRunner,d as createClientQuery,x as createInMemoryBookmarkStorage,H as createInMemoryPersistence,ee as createInMemoryQueryCache,J as createIndexedDbPersistence,re as createIndexedDbQueryCache,N as createLocalStore,X as createMutatorRunner,ae as createReconnect,ie as createSnapshotPrecondition,me as createStream,D as getErrorCode,L as getRetryAfterMs,O as httpStream,Q as isAuthReplayFailure,_ as isConflictError,F as isForbiddenError,A as isMutationDelta,I as isRateLimitedError,M as isUnauthorizedError,k as liveTopicSubscription,t as maxSeq,Y as preloadQuery,Z as preloadedQueryResult,oe as queryCacheKey,a as reconcileOptimistic,s as setAuthTokenProvider,B as subscribeLiveTopic};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const h="lunora-admin-auth-list",c=50,A=(t,s={})=>{const{filterField:n,filterValue:i,search:e,searchField:o,sortBy:r,sortDirection:a}=s;return{fetchPage:u=>t.listAuthUsers({filterField:n,filterValue:i,limit:u,search:e,searchField:o,sortBy:r,sortDirection:a}),key:["users",{filterField:n,filterValue:i,search:e,searchField:o,sortBy:r,sortDirection:a}]}},l=t=>({fetchPage:s=>t.listAuthOrganizations({limit:s}),key:["organizations"]}),d=t=>({fetchPage:s=>t.listAuthSignUpInvitations({limit:s}),key:["sign-up-invitations"]}),y=(t,s={})=>{const{userId:n}=s;return{fetchPage:i=>t.listAuthSessions({limit:i,userId:n}),key:["sessions",{userId:n}]}},f=(t,s,n)=>[h,t??"anon",...s.key,n],g=(t,s)=>{const n=t.onAuthTokenChange(s),i=t.onIdentityChange(s);return()=>{n(),i()}},I=t=>t!==void 0&&t.rows.length<t.total;export{c as ADMIN_AUTH_DEFAULT_PAGE_SIZE,I as adminAuthListHasMore,f as adminAuthListQueryKey,l as authOrganizationsList,y as authSessionsList,d as authSignUpInvitationsList,A as authUsersList,g as subscribeAdminAuthIdentity};
|