@lunora/angular 1.0.0-alpha.51 → 1.0.0-alpha.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts
CHANGED
|
@@ -625,8 +625,6 @@ interface ConnectionStatusOptions {
|
|
|
625
625
|
* @experimental
|
|
626
626
|
*/
|
|
627
627
|
declare const connectionStatus: (options?: ConnectionStatusOptions) => Signal<ConnectionStatus>;
|
|
628
|
-
/** A targeting context merged on top of the app's default (`defineFlags({ identify })`). */
|
|
629
|
-
type FlagContext$1 = Record<string, unknown>;
|
|
630
628
|
/** The value kinds a flag resolves to — OpenFeature's boolean / number / string / structured (JSON) flags. */
|
|
631
629
|
type FlagValue$1 = boolean | number | string | {
|
|
632
630
|
[key: string]: unknown;
|
|
@@ -636,11 +634,6 @@ type FlagValue$1 = boolean | number | string | {
|
|
|
636
634
|
* @experimental
|
|
637
635
|
*/
|
|
638
636
|
type FlagValue = FlagValue$1;
|
|
639
|
-
/**
|
|
640
|
-
* Targeting context bag forwarded to the OpenFeature provider.
|
|
641
|
-
* @experimental
|
|
642
|
-
*/
|
|
643
|
-
type FlagContext = FlagContext$1;
|
|
644
637
|
/**
|
|
645
638
|
* `FlagOptions` is part of the experimental `@lunora/angular` API and may change without a major version bump.
|
|
646
639
|
* @experimental
|
|
@@ -648,11 +641,6 @@ type FlagContext = FlagContext$1;
|
|
|
648
641
|
interface FlagOptions {
|
|
649
642
|
/** Client to bind to. Defaults to the injected `LUNORA_CLIENT`. */
|
|
650
643
|
client?: LunoraClient;
|
|
651
|
-
/**
|
|
652
|
-
* Per-call targeting context merged on top of the app's default `identify`
|
|
653
|
-
* targeting key.
|
|
654
|
-
*/
|
|
655
|
-
context?: FlagContext;
|
|
656
644
|
/** `DestroyRef` whose `onDestroy` tears down the subscription. Defaults to `inject(DestroyRef)`. */
|
|
657
645
|
destroyRef?: DestroyRef;
|
|
658
646
|
}
|
|
@@ -664,6 +652,12 @@ interface FlagOptions {
|
|
|
664
652
|
* The flag's kind is inferred from `defaultValue`'s runtime type, so
|
|
665
653
|
* `flag("dark", false)` reads a boolean and `flag("hero", "control")` a string.
|
|
666
654
|
*
|
|
655
|
+
* The reactive channel is public, so the server evaluates every flag under the
|
|
656
|
+
* socket's own verified identity — the targeting key your `defineFlags({
|
|
657
|
+
* identify })` derives — and accepts no client-supplied targeting context. For
|
|
658
|
+
* evaluation under a context you compute, call `ctx.flags.*` inside a query,
|
|
659
|
+
* mutation, or action and return the resolved value.
|
|
660
|
+
*
|
|
667
661
|
* Evaluation runs through whatever OpenFeature provider the app wired in
|
|
668
662
|
* `lunora/flags.ts`; the read never throws — a provider error resolves the
|
|
669
663
|
* default (the same fail-open contract as server-side `ctx.flags`). No
|
|
@@ -683,11 +677,6 @@ declare const flag: <T extends FlagValue>(key: string, defaultValue: T, options?
|
|
|
683
677
|
interface FlagsOptions {
|
|
684
678
|
/** Client to bind to. Defaults to the injected `LUNORA_CLIENT`. */
|
|
685
679
|
client?: LunoraClient;
|
|
686
|
-
/**
|
|
687
|
-
* Targeting context shared by every flag in the set, merged on top of the
|
|
688
|
-
* app's default `identify` targeting key.
|
|
689
|
-
*/
|
|
690
|
-
context?: FlagContext;
|
|
691
680
|
/** `DestroyRef` whose `onDestroy` tears down the subscriptions. Defaults to `inject(DestroyRef)`. */
|
|
692
681
|
destroyRef?: DestroyRef;
|
|
693
682
|
}
|
|
@@ -696,7 +685,8 @@ interface FlagsOptions {
|
|
|
696
685
|
*
|
|
697
686
|
* Pass a record of `key → defaultValue`; each flag's kind is inferred from its
|
|
698
687
|
* default, and the returned signal holds the same-shaped record with resolved
|
|
699
|
-
* values (the defaults until each evaluation lands).
|
|
688
|
+
* values (the defaults until each evaluation lands). Like {@link flag} it
|
|
689
|
+
* evaluates under the socket's server-verified identity only.
|
|
700
690
|
*
|
|
701
691
|
* Call from an injection context:
|
|
702
692
|
* ```ts
|
|
@@ -1423,7 +1413,7 @@ interface VoiceAgentResult {
|
|
|
1423
1413
|
* @experimental
|
|
1424
1414
|
*/
|
|
1425
1415
|
declare const voiceAgent: (options: VoiceAgentOptions) => VoiceAgentResult;
|
|
1426
|
-
export { type AgentApi, type AgentChatApi, type AgentChatMessage, type AgentChatOptions, type AgentChatResult, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentResult, type AgentStateApi, type AgentStateOptions, type AgentStateResult, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentTokenStreamReference, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsOptions, type AgentToolEventsResult, type AuthGateResult, type AuthOptions, type AuthResult, type ConnectionStatusOptions, type
|
|
1416
|
+
export { type AgentApi, type AgentChatApi, type AgentChatMessage, type AgentChatOptions, type AgentChatResult, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentResult, type AgentStateApi, type AgentStateOptions, type AgentStateResult, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentTokenStreamReference, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsOptions, type AgentToolEventsResult, type AuthGateResult, type AuthOptions, type AuthResult, type ConnectionStatusOptions, type FlagOptions, type FlagValue, type FlagsOptions, type HeartbeatReference, type HydratePreloadedOptions, type HydratePreloadedResult, type InfiniteQueryResult, LUNORA_CLIENT, type ListPresentReference, type LiveQueryOptions, type MutateOptions, type MutatorResult, type PaginatedQueryOptions, type PaginatedQueryResult, type PresenceOptions, type PresenceResult,
|
|
1427
1417
|
/**
|
|
1428
1418
|
* The Angular adapter for Lunora.
|
|
1429
1419
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -625,8 +625,6 @@ interface ConnectionStatusOptions {
|
|
|
625
625
|
* @experimental
|
|
626
626
|
*/
|
|
627
627
|
declare const connectionStatus: (options?: ConnectionStatusOptions) => Signal<ConnectionStatus>;
|
|
628
|
-
/** A targeting context merged on top of the app's default (`defineFlags({ identify })`). */
|
|
629
|
-
type FlagContext$1 = Record<string, unknown>;
|
|
630
628
|
/** The value kinds a flag resolves to — OpenFeature's boolean / number / string / structured (JSON) flags. */
|
|
631
629
|
type FlagValue$1 = boolean | number | string | {
|
|
632
630
|
[key: string]: unknown;
|
|
@@ -636,11 +634,6 @@ type FlagValue$1 = boolean | number | string | {
|
|
|
636
634
|
* @experimental
|
|
637
635
|
*/
|
|
638
636
|
type FlagValue = FlagValue$1;
|
|
639
|
-
/**
|
|
640
|
-
* Targeting context bag forwarded to the OpenFeature provider.
|
|
641
|
-
* @experimental
|
|
642
|
-
*/
|
|
643
|
-
type FlagContext = FlagContext$1;
|
|
644
637
|
/**
|
|
645
638
|
* `FlagOptions` is part of the experimental `@lunora/angular` API and may change without a major version bump.
|
|
646
639
|
* @experimental
|
|
@@ -648,11 +641,6 @@ type FlagContext = FlagContext$1;
|
|
|
648
641
|
interface FlagOptions {
|
|
649
642
|
/** Client to bind to. Defaults to the injected `LUNORA_CLIENT`. */
|
|
650
643
|
client?: LunoraClient;
|
|
651
|
-
/**
|
|
652
|
-
* Per-call targeting context merged on top of the app's default `identify`
|
|
653
|
-
* targeting key.
|
|
654
|
-
*/
|
|
655
|
-
context?: FlagContext;
|
|
656
644
|
/** `DestroyRef` whose `onDestroy` tears down the subscription. Defaults to `inject(DestroyRef)`. */
|
|
657
645
|
destroyRef?: DestroyRef;
|
|
658
646
|
}
|
|
@@ -664,6 +652,12 @@ interface FlagOptions {
|
|
|
664
652
|
* The flag's kind is inferred from `defaultValue`'s runtime type, so
|
|
665
653
|
* `flag("dark", false)` reads a boolean and `flag("hero", "control")` a string.
|
|
666
654
|
*
|
|
655
|
+
* The reactive channel is public, so the server evaluates every flag under the
|
|
656
|
+
* socket's own verified identity — the targeting key your `defineFlags({
|
|
657
|
+
* identify })` derives — and accepts no client-supplied targeting context. For
|
|
658
|
+
* evaluation under a context you compute, call `ctx.flags.*` inside a query,
|
|
659
|
+
* mutation, or action and return the resolved value.
|
|
660
|
+
*
|
|
667
661
|
* Evaluation runs through whatever OpenFeature provider the app wired in
|
|
668
662
|
* `lunora/flags.ts`; the read never throws — a provider error resolves the
|
|
669
663
|
* default (the same fail-open contract as server-side `ctx.flags`). No
|
|
@@ -683,11 +677,6 @@ declare const flag: <T extends FlagValue>(key: string, defaultValue: T, options?
|
|
|
683
677
|
interface FlagsOptions {
|
|
684
678
|
/** Client to bind to. Defaults to the injected `LUNORA_CLIENT`. */
|
|
685
679
|
client?: LunoraClient;
|
|
686
|
-
/**
|
|
687
|
-
* Targeting context shared by every flag in the set, merged on top of the
|
|
688
|
-
* app's default `identify` targeting key.
|
|
689
|
-
*/
|
|
690
|
-
context?: FlagContext;
|
|
691
680
|
/** `DestroyRef` whose `onDestroy` tears down the subscriptions. Defaults to `inject(DestroyRef)`. */
|
|
692
681
|
destroyRef?: DestroyRef;
|
|
693
682
|
}
|
|
@@ -696,7 +685,8 @@ interface FlagsOptions {
|
|
|
696
685
|
*
|
|
697
686
|
* Pass a record of `key → defaultValue`; each flag's kind is inferred from its
|
|
698
687
|
* default, and the returned signal holds the same-shaped record with resolved
|
|
699
|
-
* values (the defaults until each evaluation lands).
|
|
688
|
+
* values (the defaults until each evaluation lands). Like {@link flag} it
|
|
689
|
+
* evaluates under the socket's server-verified identity only.
|
|
700
690
|
*
|
|
701
691
|
* Call from an injection context:
|
|
702
692
|
* ```ts
|
|
@@ -1423,7 +1413,7 @@ interface VoiceAgentResult {
|
|
|
1423
1413
|
* @experimental
|
|
1424
1414
|
*/
|
|
1425
1415
|
declare const voiceAgent: (options: VoiceAgentOptions) => VoiceAgentResult;
|
|
1426
|
-
export { type AgentApi, type AgentChatApi, type AgentChatMessage, type AgentChatOptions, type AgentChatResult, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentResult, type AgentStateApi, type AgentStateOptions, type AgentStateResult, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentTokenStreamReference, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsOptions, type AgentToolEventsResult, type AuthGateResult, type AuthOptions, type AuthResult, type ConnectionStatusOptions, type
|
|
1416
|
+
export { type AgentApi, type AgentChatApi, type AgentChatMessage, type AgentChatOptions, type AgentChatResult, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentResult, type AgentStateApi, type AgentStateOptions, type AgentStateResult, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentTokenStreamReference, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsOptions, type AgentToolEventsResult, type AuthGateResult, type AuthOptions, type AuthResult, type ConnectionStatusOptions, type FlagOptions, type FlagValue, type FlagsOptions, type HeartbeatReference, type HydratePreloadedOptions, type HydratePreloadedResult, type InfiniteQueryResult, LUNORA_CLIENT, type ListPresentReference, type LiveQueryOptions, type MutateOptions, type MutatorResult, type PaginatedQueryOptions, type PaginatedQueryResult, type PresenceOptions, type PresenceResult,
|
|
1427
1417
|
/**
|
|
1428
1418
|
* The Angular adapter for Lunora.
|
|
1429
1419
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{agent as t}from"./packem_shared/agent-BPvUvuXh.mjs";import{agentChat as m}from"./packem_shared/agentChat-BgD9zNFw.mjs";import{agentState as f}from"./packem_shared/agentState-BBAruY2b.mjs";import{agentToolEvents as n}from"./packem_shared/agentToolEvents-CUwrn-Nu.mjs";import{auth as i,authGate as u}from"./packem_shared/auth-BgwruT_M.mjs";import{LUNORA_CLIENT as c,injectLunoraClient as s,provideLunora as l}from"./packem_shared/LUNORA_CLIENT-B0toApHY.mjs";import{connectionStatus as L}from"./packem_shared/connectionStatus-UhmuwzMa.mjs";import{flag as v,flags as y}from"./packem_shared/flag-
|
|
1
|
+
import{agent as t}from"./packem_shared/agent-BPvUvuXh.mjs";import{agentChat as m}from"./packem_shared/agentChat-BgD9zNFw.mjs";import{agentState as f}from"./packem_shared/agentState-BBAruY2b.mjs";import{agentToolEvents as n}from"./packem_shared/agentToolEvents-CUwrn-Nu.mjs";import{auth as i,authGate as u}from"./packem_shared/auth-BgwruT_M.mjs";import{LUNORA_CLIENT as c,injectLunoraClient as s,provideLunora as l}from"./packem_shared/LUNORA_CLIENT-B0toApHY.mjs";import{connectionStatus as L}from"./packem_shared/connectionStatus-UhmuwzMa.mjs";import{flag as v,flags as y}from"./packem_shared/flag-CeGmnEZN.mjs";import{hydratePreloaded as C}from"./packem_shared/hydratePreloaded-C8lNoww0.mjs";import{liveQuery as S}from"./packem_shared/liveQuery-BvA2co81.mjs";import{mutate as I}from"./packem_shared/mutate-BZvLQLyu.mjs";import{mutator as P}from"./packem_shared/mutator-DjG1yGk8.mjs";import{infiniteQuery as b,paginatedQuery as j}from"./packem_shared/infiniteQuery-B5Q21vgn.mjs";import{presence as K}from"./packem_shared/presence-vJUxsR5f.mjs";import{rateLimit as R}from"./packem_shared/rateLimit-B3h9qzh-.mjs";import{runAction as _}from"./packem_shared/runAction-BfiPq4Xz.mjs";import{stream as q}from"./packem_shared/stream-CcjYdpzt.mjs";import{subscription as z}from"./packem_shared/subscription-DqtYnats.mjs";import{voiceAgent as D}from"./packem_shared/voiceAgent-CzyUcUKj.mjs";import{SKIP as H}from"@lunora/client/query";export{c as LUNORA_CLIENT,H as SKIP,t as agent,m as agentChat,f as agentState,n as agentToolEvents,i as auth,u as authGate,L as connectionStatus,v as flag,y as flags,C as hydratePreloaded,b as infiniteQuery,s as injectLunoraClient,S as liveQuery,I as mutate,P as mutator,j as paginatedQuery,K as presence,l as provideLunora,R as rateLimit,_ as runAction,q as stream,z as subscription,D as voiceAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{inject as l,DestroyRef as u,signal as a}from"@angular/core";import{resolveLunoraClient as i}from"./LUNORA_CLIENT-B0toApHY.mjs";import{s as d}from"./platform-I2VyCEIl.mjs";const m="__lunora_flags__:eval",_=t=>{const e=typeof t;return e==="boolean"||e==="number"||e==="string"?e:"object"},v={__lunoraRef:m},y=(t,e,n)=>{try{return t.subscribe(v,{default:e.default,key:e.key,type:_(e.default)},c=>{n(c)},{onError:()=>{n(e.default)}})}catch{return()=>{}}},k=(t,e,n={})=>{const c=i(n.client),f=n.destroyRef===void 0,o=n.destroyRef??l(u),r=a(e);return d(f)&&o.onDestroy(y(c,{default:e,key:t},s=>{r.set(s)})),r.asReadonly()},h=(t,e={})=>{const n=i(e.client),c=e.destroyRef===void 0,f=e.destroyRef??l(u),o=a({...t});if(!d(c))return o.asReadonly();const r=[];for(const[s,b]of Object.entries(t))r.push(y(n,{default:b,key:s},R=>{o.set({...o(),[s]:R})}));return f.onDestroy(()=>{for(const s of r)s()}),o.asReadonly()};export{k as flag,h as flags};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/angular",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.52",
|
|
4
4
|
"description": "Angular reactive adapter for Lunora — signal-based live queries and mutations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lunora/client": "1.0.0-alpha.
|
|
57
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
56
|
+
"@lunora/client": "1.0.0-alpha.68",
|
|
57
|
+
"@lunora/ratelimit": "1.0.0-alpha.32",
|
|
58
58
|
"@visulima/storage-client": "1.0.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{inject as l,DestroyRef as u,signal as a}from"@angular/core";import{resolveLunoraClient as d}from"./LUNORA_CLIENT-B0toApHY.mjs";import{s as i}from"./platform-I2VyCEIl.mjs";const m="__lunora_flags__:eval",x=n=>{const e=typeof n;return e==="boolean"||e==="number"||e==="string"?e:"object"},_={__lunoraRef:m},y=(n,e,t)=>{try{return n.subscribe(_,{context:e.context,default:e.default,key:e.key,type:x(e.default)},c=>{t(c)},{onError:()=>{t(e.default)}})}catch{return()=>{}}},g=(n,e,t={})=>{const c=d(t.client),f=t.destroyRef===void 0,o=t.destroyRef??l(u),r=a(e);return i(f)&&o.onDestroy(y(c,{context:t.context,default:e,key:n},s=>{r.set(s)})),r.asReadonly()},h=(n,e={})=>{const t=d(e.client),c=e.destroyRef===void 0,f=e.destroyRef??l(u),o=a({...n});if(!i(c))return o.asReadonly();const r=[];for(const[s,b]of Object.entries(n))r.push(y(t,{context:e.context,default:b,key:s},R=>{o.set({...o(),[s]:R})}));return f.onDestroy(()=>{for(const s of r)s()}),o.asReadonly()};export{g as flag,h as flags};
|