@nkzw/fate 1.1.0 → 1.2.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 +745 -24
- package/docs/api/classes/FateClient.md +63 -39
- package/docs/api/functions/clientRoot.md +1 -1
- package/docs/api/functions/createClient.md +1 -1
- package/docs/api/functions/createGraphQLTransport.md +1 -1
- package/docs/api/functions/createHTTPTransport.md +1 -1
- package/docs/api/functions/createTRPCTransport.md +1 -1
- package/docs/api/functions/defer.md +21 -0
- package/docs/api/functions/getDeferredMetadata.md +21 -0
- package/docs/api/functions/getListEntries.md +1 -1
- package/docs/api/functions/getSelectionPlan.md +1 -1
- package/docs/api/functions/graphqlMutation.md +1 -1
- package/docs/api/functions/isDeferred.md +15 -0
- package/docs/api/functions/isRecord.md +1 -1
- package/docs/api/functions/isViewTag.md +1 -1
- package/docs/api/functions/liveConnectionTopic.md +1 -1
- package/docs/api/functions/liveEntityTopic.md +1 -1
- package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
- package/docs/api/functions/mutation.md +1 -1
- package/docs/api/functions/toEntityId.md +1 -1
- package/docs/api/functions/view.md +1 -1
- package/docs/api/index.md +9 -0
- package/docs/api/interfaces/FateThenable.md +3 -3
- package/docs/api/interfaces/Transport.md +7 -7
- package/docs/api/server/classes/FateRequestError.md +5 -5
- package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
- package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
- package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
- package/docs/api/server/functions/bindSourceProcedures.md +1 -1
- package/docs/api/server/functions/computed.md +1 -1
- package/docs/api/server/functions/count.md +1 -1
- package/docs/api/server/functions/createFateFetchHandler.md +1 -1
- package/docs/api/server/functions/createFateServer.md +1 -1
- package/docs/api/server/functions/createHonoFateHandler.md +1 -1
- package/docs/api/server/functions/createLiveEventBus.md +1 -1
- package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
- package/docs/api/server/functions/createResolver.md +1 -1
- package/docs/api/server/functions/createSourcePlan.md +1 -1
- package/docs/api/server/functions/createSourceProcedures.md +1 -1
- package/docs/api/server/functions/dataView.md +1 -1
- package/docs/api/server/functions/field.md +1 -1
- package/docs/api/server/functions/getNestedSelection.md +1 -1
- package/docs/api/server/functions/getScopedArgs.md +1 -1
- package/docs/api/server/functions/hasNestedSelection.md +1 -1
- package/docs/api/server/functions/list.md +1 -1
- package/docs/api/server/functions/refetchSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceByIds.md +1 -1
- package/docs/api/server/functions/resolveSourceConnection.md +1 -1
- package/docs/api/server/functions/resolver.md +1 -1
- package/docs/api/server/functions/toPrismaSelect.md +1 -1
- package/docs/api/server/functions/withConnection.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
- package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
- package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
- package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
- package/docs/api/server/type-aliases/ComputedField.md +5 -5
- package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
- package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
- package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
- package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
- package/docs/api/server/type-aliases/CountSelection.md +4 -4
- package/docs/api/server/type-aliases/CountWhere.md +1 -1
- package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
- package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
- package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
- package/docs/api/server/type-aliases/DataViewResult.md +1 -1
- package/docs/api/server/type-aliases/Entity.md +1 -1
- package/docs/api/server/type-aliases/FateServer.md +5 -5
- package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
- package/docs/api/server/type-aliases/FieldSelection.md +3 -3
- package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
- package/docs/api/server/type-aliases/LiveEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
- package/docs/api/server/type-aliases/OrderDirection.md +1 -1
- package/docs/api/server/type-aliases/SourceConfig.md +6 -6
- package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
- package/docs/api/server/type-aliases/SourceOrder.md +1 -1
- package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
- package/docs/api/server/type-aliases/SourcePlan.md +1 -1
- package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
- package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
- package/docs/api/server/type-aliases/SourceRelation.md +1 -1
- package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
- package/docs/api/server/variables/byIdInput.md +1 -1
- package/docs/api/server/variables/connectionArgs.md +1 -1
- package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
- package/docs/api/type-aliases/ConnectionRef.md +1 -1
- package/docs/api/type-aliases/Deferred.md +19 -0
- package/docs/api/type-aliases/DeferredMetadata.md +7 -0
- package/docs/api/type-aliases/DeferredSelection.md +13 -0
- package/docs/api/type-aliases/DeferredSnapshot.md +11 -0
- package/docs/api/type-aliases/Entity.md +2 -2
- package/docs/api/type-aliases/EntityId.md +1 -1
- package/docs/api/type-aliases/FateDehydratedState.md +1 -1
- package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
- package/docs/api/type-aliases/FateLiveEvent.md +1 -1
- package/docs/api/type-aliases/FateMutations.md +1 -1
- package/docs/api/type-aliases/FateOperation.md +1 -1
- package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
- package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
- package/docs/api/type-aliases/FateRecord.md +1 -1
- package/docs/api/type-aliases/FateRoots.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
- package/docs/api/type-aliases/GraphQLTransportOptions.md +11 -11
- package/docs/api/type-aliases/HydrateOptions.md +1 -1
- package/docs/api/type-aliases/HydrationLimits.md +1 -1
- package/docs/api/type-aliases/InferFateAPI.md +1 -1
- package/docs/api/type-aliases/List.md +1 -1
- package/docs/api/type-aliases/ListEntry.md +1 -1
- package/docs/api/type-aliases/ListItem.md +1 -1
- package/docs/api/type-aliases/Mask.md +1 -1
- package/docs/api/type-aliases/MutationDefinition.md +1 -1
- package/docs/api/type-aliases/MutationEntity.md +1 -1
- package/docs/api/type-aliases/MutationIdentifier.md +1 -1
- package/docs/api/type-aliases/MutationInput.md +1 -1
- package/docs/api/type-aliases/MutationResult.md +1 -1
- package/docs/api/type-aliases/NodesItem.md +1 -1
- package/docs/api/type-aliases/Pagination.md +5 -5
- package/docs/api/type-aliases/Request.md +1 -1
- package/docs/api/type-aliases/RequestMode.md +1 -1
- package/docs/api/type-aliases/RequestOptions.md +1 -1
- package/docs/api/type-aliases/RequestResult.md +1 -1
- package/docs/api/type-aliases/Selection.md +1 -1
- package/docs/api/type-aliases/Snapshot.md +1 -1
- package/docs/api/type-aliases/TypeConfig.md +4 -4
- package/docs/api/type-aliases/View.md +1 -1
- package/docs/api/type-aliases/ViewData.md +1 -1
- package/docs/api/type-aliases/ViewEntity.md +1 -1
- package/docs/api/type-aliases/ViewEntityName.md +1 -1
- package/docs/api/type-aliases/ViewRef.md +1 -1
- package/docs/api/type-aliases/ViewSelection.md +1 -1
- package/docs/api/type-aliases/ViewSnapshot.md +1 -1
- package/docs/api/type-aliases/ViewTag.md +1 -1
- package/docs/api/variables/ConnectionTag.md +1 -1
- package/docs/api/variables/DeferTag.md +7 -0
- package/docs/api/variables/DeferredTag.md +7 -0
- package/docs/guide/actions.md +7 -7
- package/docs/guide/deferred-views.md +62 -0
- package/docs/guide/getting-started.md +21 -3
- package/docs/guide/vue.md +256 -0
- package/docs/index.md +1 -0
- package/docs/{guide/graphql-integration.md → integrations/graphql.md} +53 -6
- package/docs/{guide/server-integration.md → integrations/server.md} +93 -7
- package/docs/{guide/void-integration.md → integrations/void.md} +94 -12
- package/lib/{executor-sLcAqDMs.d.mts → executor-Dh-MLUXc.d.mts} +1 -1
- package/lib/{graphqlTransport-DbRHbYtb.d.mts → graphqlTransport-B3cbhvJX.d.mts} +1 -1
- package/lib/graphqlTransport.d.mts +1 -1
- package/lib/index.d.mts +10 -5
- package/lib/index.mjs +119 -3
- package/lib/{list-CMQOQGdn.d.mts → list-BrL6PD_6.d.mts} +1 -1
- package/lib/list.d.mts +1 -1
- package/lib/{record-BtdKzEGI.d.mts → record-BkvZwvFk.d.mts} +2 -2
- package/lib/server/drizzle.d.mts +2 -2
- package/lib/server/prisma.d.mts +2 -2
- package/lib/server.d.mts +3 -3
- package/lib/{transport-BTgtSwOM.d.mts → transport-BjGm__3t.d.mts} +36 -3
- package/lib/vite.d.mts +1 -1
- package/package.json +1 -1
package/lib/list.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getListEntries, t as ListEntry } from "./list-
|
|
1
|
+
import { n as getListEntries, t as ListEntry } from "./list-BrL6PD_6.mjs";
|
|
2
2
|
export { ListEntry, getListEntries };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as AnyRecord } from "./transport-
|
|
2
|
-
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-
|
|
1
|
+
import { r as AnyRecord } from "./transport-BjGm__3t.mjs";
|
|
2
|
+
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-Dh-MLUXc.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/liveTopics.d.ts
|
|
5
5
|
declare const liveEntityTopic: (type: string, id: string | number) => string;
|
package/lib/server/drizzle.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, t as SourceRegistry } from "../executor-
|
|
1
|
+
import { r as AnyRecord, rt as QueryProcedure } from "../transport-BjGm__3t.mjs";
|
|
2
|
+
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, t as SourceRegistry } from "../executor-Dh-MLUXc.mjs";
|
|
3
3
|
import { AnyColumn, SQLWrapper, Table } from "drizzle-orm";
|
|
4
4
|
|
|
5
5
|
//#region src/server/drizzle.d.ts
|
package/lib/server/prisma.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, s as OrderDirection, t as SourceRegistry } from "../executor-
|
|
1
|
+
import { r as AnyRecord, rt as QueryProcedure } from "../transport-BjGm__3t.mjs";
|
|
2
|
+
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, s as OrderDirection, t as SourceRegistry } from "../executor-Dh-MLUXc.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/server/prisma.d.ts
|
|
5
5
|
type PrismaDelegate = {
|
package/lib/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, _ as LiveEventBus, b as createLiveEventBus, c as FateServer, d as NativeFateAPI, f as createFateFetchHandler, g as LiveConnectionSourceEvent, h as LiveConnectionEventType, l as FateServerManifest, m as createHonoFateHandler, p as createFateServer, s as FateRequestError, t as isRecord, u as InferFateAPI, v as LiveEventType, x as liveConnectionTopic, y as LiveSourceEvent } from "./record-
|
|
3
|
-
import { A as DataViewListOptions, B as dataView, C as connectionArgs, D as CountSelection, E as ComputedSelection, F as FieldSelection, H as list$1, I as ViewPlan, L as computed, M as DataViewOrderDirection, N as DataViewResult, O as CountWhere, P as Entity, R as count, S as ConnectionResult, T as ComputedField, U as resolver, V as field, _ as createSourcePlan, a as resolveSourceConnection, b as ConnectionItem, c as SourceConfig, d as SourceOrderField, f as SourcePlan, g as createNestedSourcePlan, h as SourceRelationConfig, i as resolveSourceByIds, j as DataViewOrderBy, l as SourceDefinition, m as SourceRelation, n as refetchSourceById, p as SourcePlanNode, r as resolveSourceById, s as OrderDirection, t as SourceRegistry, u as SourceOrder, v as getNestedSelection, w as withConnection, x as ConnectionPagination, y as hasNestedSelection, z as createResolver } from "./executor-
|
|
1
|
+
import { nt as AnyProcedure, r as AnyRecord$1 } from "./transport-BjGm__3t.mjs";
|
|
2
|
+
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, _ as LiveEventBus, b as createLiveEventBus, c as FateServer, d as NativeFateAPI, f as createFateFetchHandler, g as LiveConnectionSourceEvent, h as LiveConnectionEventType, l as FateServerManifest, m as createHonoFateHandler, p as createFateServer, s as FateRequestError, t as isRecord, u as InferFateAPI, v as LiveEventType, x as liveConnectionTopic, y as LiveSourceEvent } from "./record-BkvZwvFk.mjs";
|
|
3
|
+
import { A as DataViewListOptions, B as dataView, C as connectionArgs, D as CountSelection, E as ComputedSelection, F as FieldSelection, H as list$1, I as ViewPlan, L as computed, M as DataViewOrderDirection, N as DataViewResult, O as CountWhere, P as Entity, R as count, S as ConnectionResult, T as ComputedField, U as resolver, V as field, _ as createSourcePlan, a as resolveSourceConnection, b as ConnectionItem, c as SourceConfig, d as SourceOrderField, f as SourcePlan, g as createNestedSourcePlan, h as SourceRelationConfig, i as resolveSourceByIds, j as DataViewOrderBy, l as SourceDefinition, m as SourceRelation, n as refetchSourceById, p as SourcePlanNode, r as resolveSourceById, s as OrderDirection, t as SourceRegistry, u as SourceOrder, v as getNestedSelection, w as withConnection, x as ConnectionPagination, y as hasNestedSelection, z as createResolver } from "./executor-Dh-MLUXc.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/server/input.d.ts
|
|
@@ -741,6 +741,10 @@ type RequestMode = /** (default) Use cached data if present, otherwise fetch. */
|
|
|
741
741
|
type RequestOptions = Readonly<{
|
|
742
742
|
mode?: RequestMode;
|
|
743
743
|
}>;
|
|
744
|
+
type DeferredSnapshot<T> = Readonly<{
|
|
745
|
+
coverage: ReadonlyArray<readonly [id: EntityId, paths: ReadonlySet<string>]>;
|
|
746
|
+
data: T;
|
|
747
|
+
}>;
|
|
744
748
|
type FateClientOptions<Roots extends FateRoots, Mutations extends FateMutations, HydrationScope extends string> = {
|
|
745
749
|
/**
|
|
746
750
|
* Number of recently released requests to keep retained before their records
|
|
@@ -775,6 +779,7 @@ declare class FateClient<Roots extends FateRoots, Mutations extends FateMutation
|
|
|
775
779
|
private readonly parentLists;
|
|
776
780
|
private readonly rootLists;
|
|
777
781
|
private readonly pending;
|
|
782
|
+
private readonly pendingDeferred;
|
|
778
783
|
private readonly pendingOptimisticMutations;
|
|
779
784
|
private readonly optimisticMasks;
|
|
780
785
|
private readonly optimisticByEntity;
|
|
@@ -836,6 +841,7 @@ declare class FateClient<Roots extends FateRoots, Mutations extends FateMutation
|
|
|
836
841
|
[ViewsTag]: Set<string>;
|
|
837
842
|
}>;
|
|
838
843
|
readView<T extends Entity, S extends Selection<T>, V extends View<T, S>>(view: V, ref: ViewRef<T['__typename']>): FateThenable<ViewSnapshot<T, S>>;
|
|
844
|
+
readDeferred<T>(deferred: Deferred<T>): PromiseLike<DeferredSnapshot<T>>;
|
|
839
845
|
assertLiveViewSupport(): void;
|
|
840
846
|
assertLiveConnectionSupport(): void;
|
|
841
847
|
subscribeLiveView<T extends Entity, S extends Selection<T>, V extends View<T, S>>(view: V, ref: ViewRef<T['__typename']>): () => void;
|
|
@@ -926,6 +932,9 @@ declare class FateClient<Roots extends FateRoots, Mutations extends FateMutation
|
|
|
926
932
|
private clearStalledRequestsForEntity;
|
|
927
933
|
private pendingPrefix;
|
|
928
934
|
private pendingKey;
|
|
935
|
+
private deferredPendingKey;
|
|
936
|
+
private deferredSelectionSignature;
|
|
937
|
+
private hasMissingDeferredList;
|
|
929
938
|
private liveSubscriptionKey;
|
|
930
939
|
private liveConnectionSubscriptionKey;
|
|
931
940
|
private releaseLiveSubscription;
|
|
@@ -1004,6 +1013,10 @@ declare const ViewKind: unique symbol;
|
|
|
1004
1013
|
declare const ViewsTag: unique symbol;
|
|
1005
1014
|
/** Symbol attached to connection results so pagination helpers can find their metadata. */
|
|
1006
1015
|
declare const ConnectionTag: unique symbol;
|
|
1016
|
+
/** Symbol used to mark a selection as deferred. */
|
|
1017
|
+
declare const DeferTag: unique symbol;
|
|
1018
|
+
/** Symbol attached to deferred values returned from masked views. */
|
|
1019
|
+
declare const DeferredTag: unique symbol;
|
|
1007
1020
|
declare const __FateEntityBrand: unique symbol;
|
|
1008
1021
|
declare const __FateSelectionBrand: unique symbol;
|
|
1009
1022
|
declare const __FateMutationEntityBrand: unique symbol;
|
|
@@ -1011,6 +1024,7 @@ declare const __FateMutationInputBrand: unique symbol;
|
|
|
1011
1024
|
declare const __FateMutationResultBrand: unique symbol;
|
|
1012
1025
|
declare const __FateRootResultBrand: unique symbol;
|
|
1013
1026
|
declare const __FateRootTypeBrand: unique symbol;
|
|
1027
|
+
declare const __FateDeferredBrand: unique symbol;
|
|
1014
1028
|
type __ViewEntityAnchor<T extends Entity> = {
|
|
1015
1029
|
readonly [__FateEntityBrand]?: T;
|
|
1016
1030
|
};
|
|
@@ -1097,6 +1111,24 @@ type ConnectionRef<TName extends string> = Readonly<{
|
|
|
1097
1111
|
}>;
|
|
1098
1112
|
pagination?: Pagination;
|
|
1099
1113
|
}>;
|
|
1114
|
+
/** Selection wrapper created by `defer(...)`. */
|
|
1115
|
+
type DeferredSelection<S> = Readonly<{
|
|
1116
|
+
[DeferTag]: S;
|
|
1117
|
+
}>;
|
|
1118
|
+
/** Runtime metadata used by the client to resolve a deferred field. */
|
|
1119
|
+
type DeferredMetadata = Readonly<{
|
|
1120
|
+
field: string;
|
|
1121
|
+
id: string | number;
|
|
1122
|
+
owner: EntityId;
|
|
1123
|
+
selection: unknown;
|
|
1124
|
+
type: string;
|
|
1125
|
+
}>;
|
|
1126
|
+
/** A deferred value returned from a masked view. Existing view hooks resolve it when read. */
|
|
1127
|
+
type Deferred<T> = Readonly<{
|
|
1128
|
+
[DeferredTag]: DeferredMetadata;
|
|
1129
|
+
}> & {
|
|
1130
|
+
readonly [__FateDeferredBrand]: T;
|
|
1131
|
+
};
|
|
1100
1132
|
/** Base shape shared by all entities fetched by fate. */
|
|
1101
1133
|
type Entity = {
|
|
1102
1134
|
__typename: string;
|
|
@@ -1120,7 +1152,8 @@ type ConnectionSelectionBase<T extends Entity> = Readonly<{
|
|
|
1120
1152
|
type ConnectionSelection<T extends Entity> = ConnectionSelectionBase<T> | (SelectionArgs & ConnectionSelectionBase<T>);
|
|
1121
1153
|
type BaseSelectionFieldValue<T extends Entity, K extends keyof T> = NonNullable<T[K]> extends Array<infer U extends Entity> ? true | Selection<U> | ConnectionSelection<U> | View<U, Selection<U>> : NonNullable<T[K]> extends Entity ? true | Selection<NonNullable<T[K]>> | View<NonNullable<T[K]>, Selection<NonNullable<T[K]>>> : NonNullable<T[K]> extends AnyRecord ? PlainObjectSelection<NonNullable<T[K]>> : true;
|
|
1122
1154
|
type SelectionFieldValue<T extends Entity, K extends keyof T> = BaseSelectionFieldValue<T, K> | SelectionArgs | (SelectionArgs & Extract<BaseSelectionFieldValue<T, K>, object>);
|
|
1123
|
-
type
|
|
1155
|
+
type DeferrableSelectionFieldValue<T extends Entity, K extends keyof T> = SelectionFieldValue<T, K> | DeferredSelection<SelectionFieldValue<T, K>>;
|
|
1156
|
+
type SelectionShape<T extends Entity> = { [K in keyof T as K extends '__typename' ? never : K]?: DeferrableSelectionFieldValue<T, K> } & {
|
|
1124
1157
|
__typename?: true;
|
|
1125
1158
|
};
|
|
1126
1159
|
type SelectionViewSpread<T extends Entity> = { readonly [K in ViewTag]?: Readonly<{
|
|
@@ -1182,7 +1215,7 @@ type EntityName<T> = T extends {
|
|
|
1182
1215
|
__typename: infer N extends string;
|
|
1183
1216
|
} ? N : never;
|
|
1184
1217
|
/** Recursively applies a view selection to an entity to mask fields that aren't selected. */
|
|
1185
|
-
type MaskNonNullish<T, S> = T extends Array<infer U extends Entity> ? S extends true ? Array<U> : S extends ConnectionLikeSelection ? ConnectionMask<U, S> : HasViewTag<S> extends true ? Array<ViewRef<U['__typename']>> : Array<Mask<U, S>> : S extends true ? T : S extends object ? HasViewTag<S> extends true ? NonNullish<T> extends Entity ? ViewRef<EntityName<NonNullish<T>>> : ViewRef<EntityName<NonNullable<T>>> : { [K in keyof S as K extends 'args' ? never : K]: S[K] extends true ? NonNullish<T>[Extract<K, keyof T>] : Mask<NonNullish<T>[Extract<K, keyof T>], Extract<S[K], object>> } & (T extends Entity ? Pick<NonNullish<T>, '__typename'> : Record<never, never>) : T;
|
|
1218
|
+
type MaskNonNullish<T, S> = T extends Array<infer U extends Entity> ? S extends true ? Array<U> : S extends ConnectionLikeSelection ? ConnectionMask<U, S> : HasViewTag<S> extends true ? Array<ViewRef<U['__typename']>> : Array<Mask<U, S>> : S extends true ? T : S extends object ? HasViewTag<S> extends true ? NonNullish<T> extends Entity ? ViewRef<EntityName<NonNullish<T>>> : ViewRef<EntityName<NonNullable<T>>> : { [K in keyof S as K extends 'args' ? never : K]: S[K] extends true ? NonNullish<T>[Extract<K, keyof T>] : S[K] extends DeferredSelection<infer DeferredSelectionValue> ? Deferred<Mask<NonNullish<T>[Extract<K, keyof T>], DeferredSelectionValue>> : Mask<NonNullish<T>[Extract<K, keyof T>], Extract<S[K], object>> } & (T extends Entity ? Pick<NonNullish<T>, '__typename'> : Record<never, never>) : T;
|
|
1186
1219
|
type Mask<T, S> = WithNullish<T, MaskNonNullish<NonNullish<T>, S>>;
|
|
1187
1220
|
/** Entity type captured from a view definition. */
|
|
1188
1221
|
type ViewEntity<V> = V extends View<infer T, any> ? T : never;
|
|
@@ -1410,4 +1443,4 @@ declare function createTRPCTransport<AppRouter extends AnyRouter, Mutations exte
|
|
|
1410
1443
|
queries?: TRPCQueryResolvers<AppRouter>;
|
|
1411
1444
|
}): Transport<MutationMapFromResolvers<Mutations>>;
|
|
1412
1445
|
//#endregion
|
|
1413
|
-
export {
|
|
1446
|
+
export { HydrateOptions as $, Snapshot as A, ViewTag as B, MutationShape as C, RequestResult as D, Request$1 as E, ViewEntity as F, mutation as G, __FateSelectionBrand as H, ViewEntityName as I, RequestMode as J, DeferredSnapshot as K, ViewRef as L, TypeName as M, View as N, RootDefinition as O, ViewData as P, FateDehydratedState as Q, ViewSelection as R, MutationResult as S, Pagination as T, isViewTag as U, __FateEntityBrand as V, FateMutations as W, createClient as X, RequestOptions as Y, getSelectionPlan as Z, Mask as _, ConnectionRef as a, MutationIdentifier as b, Deferred as c, DeferredTag as d, HydrationLimits as et, Entity as f, ListItem as g, FateThenable as h, ConnectionMetadata as i, TypeConfig as j, Selection as k, DeferredMetadata as l, FateRoots as m, createTRPCTransport as n, AnyProcedure as nt, ConnectionTag as o, EntityId as p, FateClient as q, AnyRecord as r, QueryProcedure as rt, DeferTag as s, Transport as t, List as tt, DeferredSelection as u, MutationDefinition as v, NodesItem as w, MutationInput as x, MutationEntity as y, ViewSnapshot as z };
|
package/lib/vite.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { Plugin } from "vite";
|
|
|
4
4
|
type FateViteTransport = 'graphql' | 'native' | 'trpc' | 'void';
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/vite.d.ts
|
|
7
|
-
type ClientRuntime = '@nkzw/fate' | 'react-fate';
|
|
7
|
+
type ClientRuntime = '@nkzw/fate' | 'react-fate' | 'vue-fate';
|
|
8
8
|
type FateVitePluginOptions = {
|
|
9
9
|
clientModule?: ClientRuntime;
|
|
10
10
|
generatedFile?: false | string;
|