@lunora/solid 1.0.0-alpha.237 → 1.0.0-alpha.238

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 CHANGED
@@ -102,7 +102,7 @@ render(
102
102
  | `createQuery` | `useQuery` | Live query signal — returns `() => T \| undefined`, re-subscribes on arg change. |
103
103
  | `createMutation` | `useMutation` | Optimistic mutation handle (`data`, `error`, `pending`, `mutate`, `reset`). |
104
104
  | `createSubscription` | `useSubscription` | Raw subscription signal — unbounded live stream. |
105
- | `createLiveTopic` | `useLiveTopic` | One live topic on the shared stream — `lastEvent` and `error` accessors. |
105
+ | `createLiveTopic` | `useLiveTopic` | One declared live topic — `lastEvent` and `error` accessors. |
106
106
  | `createPaginatedQuery` | `usePaginatedQuery` | Cursor-paginated query with `loadMore`, `status`, `results`, and `error` signals. |
107
107
  | `createInfiniteQuery` | `useInfiniteQuery` | Infinite-scroll variant of `createPaginatedQuery`. |
108
108
  | `createAuth` | `useAuth` | Reactive auth state (`token`, `user`, `status` signals + `setToken`). |
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, LiveStreamSubscribeError, SubscribeLiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
1
+ import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, LiveStreamSubscribeError, LiveTopicRef, LiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
2
2
  export type { ArgsOf, FunctionReference, MutatorHandle, MutatorTransaction, OptimisticUpdate, Preloaded, ReturnOf, SubscriptionError, SubscriptionErrorCallback, Unsubscribe } from '@lunora/client';
3
3
  import { Context, Accessor } from 'solid-js';
4
4
  import { AuthStatus } from '@lunora/client/auth';
@@ -618,22 +618,25 @@ declare const createFlags: <T extends Record<string, FlagValue>>(flags: T) => Ac
618
618
  *
619
619
  * A thin lifecycle wrapper over `subscribeLiveTopic` from `@lunora/client`: it
620
620
  * subscribes when the owner mounts, unsubscribes on cleanup, and resubscribes when
621
- * the url, topic or connection options change. Callbacks are not part of that
621
+ * the topic or the connection options change. Callbacks are not part of that
622
622
  * identity, so a new `onEvent` / `onError` never reopens the subscription.
623
623
  */
624
- interface CreateLiveTopicResult {
624
+ interface CreateLiveTopicResult<Payload = unknown> {
625
625
  /** The shard's refusal of this subscription (403, 409, 429 and similar), or `undefined`. */
626
626
  error: Accessor<LiveStreamSubscribeError | undefined>;
627
627
  /** The last payload delivered on the topic, or `undefined` until the first event. */
628
- lastEvent: Accessor<unknown>;
628
+ lastEvent: Accessor<Payload | undefined>;
629
629
  }
630
630
  /**
631
- * Follow `options.topic` on the shared live connection for `options.url`.
631
+ * Follow the topic `topic` names on the live connection shared by its stream's route. Pass the
632
+ * reference `_generated/live.ts` hands out (`live.posts.post({ postId })`), plain or as an
633
+ * accessor; the route is resolved against the `LunoraClient` from the nearest `LunoraContext`,
634
+ * and `lastEvent` and `onEvent` are typed by the payload the topic declares.
632
635
  *
633
- * `options` may be a plain object or an accessor. The `onEvent` and `onError`
634
- * callbacks are read at call time, so the latest identity is always the one invoked.
636
+ * `options` may be a plain object or an accessor. The `onEvent` and `onError` callbacks are
637
+ * read at call time, so the latest identity is always the one invoked.
635
638
  */
636
- declare const createLiveTopic: (options: SubscribeLiveTopicOptions | Accessor<SubscribeLiveTopicOptions>) => CreateLiveTopicResult;
639
+ declare const createLiveTopic: <Payload>(topic: LiveTopicRef<Payload> | Accessor<LiveTopicRef<Payload>>, options?: LiveTopicOptions<Payload> | Accessor<LiveTopicOptions<Payload>>) => CreateLiveTopicResult<Payload>;
637
640
  interface MutationHandle<F extends FunctionReference> {
638
641
  /** The latest invocation's resolved value, or `undefined` before the first success. */
639
642
  data: Accessor<ReturnOf<F> | undefined>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, LiveStreamSubscribeError, SubscribeLiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
1
+ import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, LiveStreamSubscribeError, LiveTopicRef, LiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
2
2
  export type { ArgsOf, FunctionReference, MutatorHandle, MutatorTransaction, OptimisticUpdate, Preloaded, ReturnOf, SubscriptionError, SubscriptionErrorCallback, Unsubscribe } from '@lunora/client';
3
3
  import { Context, Accessor } from 'solid-js';
4
4
  import { AuthStatus } from '@lunora/client/auth';
@@ -618,22 +618,25 @@ declare const createFlags: <T extends Record<string, FlagValue>>(flags: T) => Ac
618
618
  *
619
619
  * A thin lifecycle wrapper over `subscribeLiveTopic` from `@lunora/client`: it
620
620
  * subscribes when the owner mounts, unsubscribes on cleanup, and resubscribes when
621
- * the url, topic or connection options change. Callbacks are not part of that
621
+ * the topic or the connection options change. Callbacks are not part of that
622
622
  * identity, so a new `onEvent` / `onError` never reopens the subscription.
623
623
  */
624
- interface CreateLiveTopicResult {
624
+ interface CreateLiveTopicResult<Payload = unknown> {
625
625
  /** The shard's refusal of this subscription (403, 409, 429 and similar), or `undefined`. */
626
626
  error: Accessor<LiveStreamSubscribeError | undefined>;
627
627
  /** The last payload delivered on the topic, or `undefined` until the first event. */
628
- lastEvent: Accessor<unknown>;
628
+ lastEvent: Accessor<Payload | undefined>;
629
629
  }
630
630
  /**
631
- * Follow `options.topic` on the shared live connection for `options.url`.
631
+ * Follow the topic `topic` names on the live connection shared by its stream's route. Pass the
632
+ * reference `_generated/live.ts` hands out (`live.posts.post({ postId })`), plain or as an
633
+ * accessor; the route is resolved against the `LunoraClient` from the nearest `LunoraContext`,
634
+ * and `lastEvent` and `onEvent` are typed by the payload the topic declares.
632
635
  *
633
- * `options` may be a plain object or an accessor. The `onEvent` and `onError`
634
- * callbacks are read at call time, so the latest identity is always the one invoked.
636
+ * `options` may be a plain object or an accessor. The `onEvent` and `onError` callbacks are
637
+ * read at call time, so the latest identity is always the one invoked.
635
638
  */
636
- declare const createLiveTopic: (options: SubscribeLiveTopicOptions | Accessor<SubscribeLiveTopicOptions>) => CreateLiveTopicResult;
639
+ declare const createLiveTopic: <Payload>(topic: LiveTopicRef<Payload> | Accessor<LiveTopicRef<Payload>>, options?: LiveTopicOptions<Payload> | Accessor<LiveTopicOptions<Payload>>) => CreateLiveTopicResult<Payload>;
637
640
  interface MutationHandle<F extends FunctionReference> {
638
641
  /** The latest invocation's resolved value, or `undefined` before the first success. */
639
642
  data: Accessor<ReturnOf<F> | undefined>;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{LunoraContext as r,useLunora as o}from"./packem_shared/LunoraContext-BWsj_3CK.mjs";import{createAction as c,createActionForClient as n}from"./packem_shared/createAction-BZkayM2R.mjs";import{createAgent as m}from"./packem_shared/createAgent-BN_C_ztD.mjs";import{createAgentChat as x}from"./packem_shared/createAgentChat-BWtnorVh.mjs";import{createAgentState as u}from"./packem_shared/createAgentState-Cl09r0tX.mjs";import{createAgentToolEvents as A}from"./packem_shared/createAgentToolEvents-on8XD92W.mjs";import{AuthLoading as l,Authenticated as s,Unauthenticated as h,createAuth as L}from"./packem_shared/AuthLoading-DjUnIaP5.mjs";import{default as y}from"./packem_shared/createConnectionStatus-D8bC05Jn.mjs";import{createFlag as P,createFlags as S}from"./packem_shared/createFlag-Bww9WQUu.mjs";import{createLiveTopic as M}from"./packem_shared/createLiveTopic-EjgSMydg.mjs";import{createMutation as T,createMutationForClient as b}from"./packem_shared/createMutation-DM2mXpq3.mjs";import{createMutator as I}from"./packem_shared/createMutator-q9cMjGKv.mjs";import{createInfiniteQuery as U,createPaginatedQuery as V}from"./packem_shared/createInfiniteQuery-CwGPFeuc.mjs";import{createPresence as k}from"./packem_shared/createPresence-DkTotieP.mjs";import{createQuery as w}from"./packem_shared/createQuery-oNQqVGjE.mjs";import{createRateLimit as B}from"./packem_shared/createRateLimit-CIVWrD5H.mjs";import{createStream as G}from"./packem_shared/createStream-CCAOb9q1.mjs";import{createSubscription as J}from"./packem_shared/createSubscription-DiyhxkoK.mjs";import{createVoiceAgent as N}from"./packem_shared/createVoiceAgent-BtRfW4lS.mjs";import{default as W}from"./packem_shared/hydratePreloaded-DCi296oW.mjs";import{LunoraProvider as Y}from"./packem_shared/LunoraProvider-DMhpuxvx.mjs";export{l as AuthLoading,s as Authenticated,r as LunoraContext,Y as LunoraProvider,h as Unauthenticated,c as createAction,n as createActionForClient,m as createAgent,x as createAgentChat,u as createAgentState,A as createAgentToolEvents,L as createAuth,y as createConnectionStatus,P as createFlag,S as createFlags,U as createInfiniteQuery,M as createLiveTopic,T as createMutation,b as createMutationForClient,I as createMutator,V as createPaginatedQuery,k as createPresence,w as createQuery,B as createRateLimit,G as createStream,J as createSubscription,N as createVoiceAgent,W as hydratePreloaded,o as useLunora};
1
+ import{LunoraContext as r,useLunora as o}from"./packem_shared/LunoraContext-BWsj_3CK.mjs";import{createAction as c,createActionForClient as n}from"./packem_shared/createAction-BZkayM2R.mjs";import{createAgent as m}from"./packem_shared/createAgent-BN_C_ztD.mjs";import{createAgentChat as x}from"./packem_shared/createAgentChat-BWtnorVh.mjs";import{createAgentState as u}from"./packem_shared/createAgentState-Cl09r0tX.mjs";import{createAgentToolEvents as A}from"./packem_shared/createAgentToolEvents-on8XD92W.mjs";import{AuthLoading as l,Authenticated as s,Unauthenticated as h,createAuth as L}from"./packem_shared/AuthLoading-DjUnIaP5.mjs";import{default as y}from"./packem_shared/createConnectionStatus-D8bC05Jn.mjs";import{createFlag as P,createFlags as S}from"./packem_shared/createFlag-Bww9WQUu.mjs";import{createLiveTopic as M}from"./packem_shared/createLiveTopic-CgkjI8l8.mjs";import{createMutation as T,createMutationForClient as b}from"./packem_shared/createMutation-DM2mXpq3.mjs";import{createMutator as I}from"./packem_shared/createMutator-q9cMjGKv.mjs";import{createInfiniteQuery as U,createPaginatedQuery as V}from"./packem_shared/createInfiniteQuery-CwGPFeuc.mjs";import{createPresence as k}from"./packem_shared/createPresence-DkTotieP.mjs";import{createQuery as w}from"./packem_shared/createQuery-oNQqVGjE.mjs";import{createRateLimit as B}from"./packem_shared/createRateLimit-CIVWrD5H.mjs";import{createStream as G}from"./packem_shared/createStream-CCAOb9q1.mjs";import{createSubscription as J}from"./packem_shared/createSubscription-DiyhxkoK.mjs";import{createVoiceAgent as N}from"./packem_shared/createVoiceAgent-BtRfW4lS.mjs";import{default as W}from"./packem_shared/hydratePreloaded-DCi296oW.mjs";import{LunoraProvider as Y}from"./packem_shared/LunoraProvider-DMhpuxvx.mjs";export{l as AuthLoading,s as Authenticated,r as LunoraContext,Y as LunoraProvider,h as Unauthenticated,c as createAction,n as createActionForClient,m as createAgent,x as createAgentChat,u as createAgentState,A as createAgentToolEvents,L as createAuth,y as createConnectionStatus,P as createFlag,S as createFlags,U as createInfiniteQuery,M as createLiveTopic,T as createMutation,b as createMutationForClient,I as createMutator,V as createPaginatedQuery,k as createPresence,w as createQuery,B as createRateLimit,G as createStream,J as createSubscription,N as createVoiceAgent,W as hydratePreloaded,o as useLunora};
@@ -0,0 +1 @@
1
+ import{subscribeLiveTopic as m,liveTopicSubscription as d}from"@lunora/client";import{createSignal as i}from"solid-js";import{useLunora as y}from"./LunoraContext-BWsj_3CK.mjs";import{t as E}from"./reactive-args-qKMBsFpd.mjs";const p=e=>({headers:e.headers,maxDelayMs:e.maxDelayMs,retryDelay:e.retryDelay,sessionKey:e.sessionKey,topic:e.topic,url:e.url,withCredentials:e.withCredentials}),T=(e,t={})=>{const c=y(),a=typeof e=="function"?e:()=>e,v=typeof t=="function"?t:()=>t,o=()=>d(c,a(),v()),[l,s]=i(void 0),[u,n]=i(void 0);return E(()=>p(o()),f=>(s(()=>{}),n(()=>{}),m({...f,onError:r=>{n(()=>r),o().onError?.(r)},onEvent:r=>{s(()=>r),n(()=>{}),o().onEvent?.(r)}}))),{error:u,lastEvent:l}};export{T as createLiveTopic};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/solid",
3
- "version": "1.0.0-alpha.237",
3
+ "version": "1.0.0-alpha.238",
4
4
  "description": "SolidJS adapter for Lunora — live queries, optimistic mutations, and reactive loaders",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -54,9 +54,9 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@lunora/client": "1.0.0-alpha.228",
57
+ "@lunora/client": "1.0.0-alpha.229",
58
58
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
59
- "@lunora/ratelimit": "1.0.0-alpha.151",
59
+ "@lunora/ratelimit": "1.0.0-alpha.152",
60
60
  "@lunora/wire": "1.0.0-alpha.1",
61
61
  "@visulima/storage-client": "1.0.9"
62
62
  },
@@ -1 +0,0 @@
1
- import{subscribeLiveTopic as v}from"@lunora/client";import{createSignal as s}from"solid-js";import{t as d}from"./reactive-args-qKMBsFpd.mjs";const l=e=>({headers:e.headers,maxDelayMs:e.maxDelayMs,retryDelay:e.retryDelay,sessionKey:e.sessionKey,topic:e.topic,url:e.url,withCredentials:e.withCredentials}),f=e=>{const t=typeof e=="function"?e:()=>e,[c,n]=s(void 0),[i,o]=s(void 0);return d(()=>l(t()),a=>(n(()=>{}),o(()=>{}),v({...a,onError:r=>{o(()=>r),t().onError?.(r)},onEvent:r=>{n(()=>r),o(()=>{}),t().onEvent?.(r)}}))),{error:i,lastEvent:c}};export{f as createLiveTopic};