@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.
Files changed (174) hide show
  1. package/README.md +745 -24
  2. package/docs/api/classes/FateClient.md +63 -39
  3. package/docs/api/functions/clientRoot.md +1 -1
  4. package/docs/api/functions/createClient.md +1 -1
  5. package/docs/api/functions/createGraphQLTransport.md +1 -1
  6. package/docs/api/functions/createHTTPTransport.md +1 -1
  7. package/docs/api/functions/createTRPCTransport.md +1 -1
  8. package/docs/api/functions/defer.md +21 -0
  9. package/docs/api/functions/getDeferredMetadata.md +21 -0
  10. package/docs/api/functions/getListEntries.md +1 -1
  11. package/docs/api/functions/getSelectionPlan.md +1 -1
  12. package/docs/api/functions/graphqlMutation.md +1 -1
  13. package/docs/api/functions/isDeferred.md +15 -0
  14. package/docs/api/functions/isRecord.md +1 -1
  15. package/docs/api/functions/isViewTag.md +1 -1
  16. package/docs/api/functions/liveConnectionTopic.md +1 -1
  17. package/docs/api/functions/liveEntityTopic.md +1 -1
  18. package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
  19. package/docs/api/functions/mutation.md +1 -1
  20. package/docs/api/functions/toEntityId.md +1 -1
  21. package/docs/api/functions/view.md +1 -1
  22. package/docs/api/index.md +9 -0
  23. package/docs/api/interfaces/FateThenable.md +3 -3
  24. package/docs/api/interfaces/Transport.md +7 -7
  25. package/docs/api/server/classes/FateRequestError.md +5 -5
  26. package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
  27. package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
  28. package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
  29. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
  30. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
  31. package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
  32. package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
  33. package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
  34. package/docs/api/server/functions/bindSourceProcedures.md +1 -1
  35. package/docs/api/server/functions/computed.md +1 -1
  36. package/docs/api/server/functions/count.md +1 -1
  37. package/docs/api/server/functions/createFateFetchHandler.md +1 -1
  38. package/docs/api/server/functions/createFateServer.md +1 -1
  39. package/docs/api/server/functions/createHonoFateHandler.md +1 -1
  40. package/docs/api/server/functions/createLiveEventBus.md +1 -1
  41. package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
  42. package/docs/api/server/functions/createResolver.md +1 -1
  43. package/docs/api/server/functions/createSourcePlan.md +1 -1
  44. package/docs/api/server/functions/createSourceProcedures.md +1 -1
  45. package/docs/api/server/functions/dataView.md +1 -1
  46. package/docs/api/server/functions/field.md +1 -1
  47. package/docs/api/server/functions/getNestedSelection.md +1 -1
  48. package/docs/api/server/functions/getScopedArgs.md +1 -1
  49. package/docs/api/server/functions/hasNestedSelection.md +1 -1
  50. package/docs/api/server/functions/list.md +1 -1
  51. package/docs/api/server/functions/refetchSourceById.md +1 -1
  52. package/docs/api/server/functions/resolveSourceById.md +1 -1
  53. package/docs/api/server/functions/resolveSourceByIds.md +1 -1
  54. package/docs/api/server/functions/resolveSourceConnection.md +1 -1
  55. package/docs/api/server/functions/resolver.md +1 -1
  56. package/docs/api/server/functions/toPrismaSelect.md +1 -1
  57. package/docs/api/server/functions/withConnection.md +1 -1
  58. package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
  59. package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
  60. package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
  61. package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
  62. package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
  63. package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
  64. package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
  65. package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
  66. package/docs/api/server/type-aliases/ComputedField.md +5 -5
  67. package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
  68. package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
  69. package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
  70. package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
  71. package/docs/api/server/type-aliases/CountSelection.md +4 -4
  72. package/docs/api/server/type-aliases/CountWhere.md +1 -1
  73. package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
  74. package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
  75. package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
  76. package/docs/api/server/type-aliases/DataViewResult.md +1 -1
  77. package/docs/api/server/type-aliases/Entity.md +1 -1
  78. package/docs/api/server/type-aliases/FateServer.md +5 -5
  79. package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
  80. package/docs/api/server/type-aliases/FieldSelection.md +3 -3
  81. package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
  82. package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
  83. package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
  84. package/docs/api/server/type-aliases/LiveEventType.md +1 -1
  85. package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
  86. package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
  87. package/docs/api/server/type-aliases/OrderDirection.md +1 -1
  88. package/docs/api/server/type-aliases/SourceConfig.md +6 -6
  89. package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
  90. package/docs/api/server/type-aliases/SourceOrder.md +1 -1
  91. package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
  92. package/docs/api/server/type-aliases/SourcePlan.md +1 -1
  93. package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
  94. package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
  95. package/docs/api/server/type-aliases/SourceRelation.md +1 -1
  96. package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
  97. package/docs/api/server/variables/byIdInput.md +1 -1
  98. package/docs/api/server/variables/connectionArgs.md +1 -1
  99. package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
  100. package/docs/api/type-aliases/ConnectionRef.md +1 -1
  101. package/docs/api/type-aliases/Deferred.md +19 -0
  102. package/docs/api/type-aliases/DeferredMetadata.md +7 -0
  103. package/docs/api/type-aliases/DeferredSelection.md +13 -0
  104. package/docs/api/type-aliases/DeferredSnapshot.md +11 -0
  105. package/docs/api/type-aliases/Entity.md +2 -2
  106. package/docs/api/type-aliases/EntityId.md +1 -1
  107. package/docs/api/type-aliases/FateDehydratedState.md +1 -1
  108. package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
  109. package/docs/api/type-aliases/FateLiveEvent.md +1 -1
  110. package/docs/api/type-aliases/FateMutations.md +1 -1
  111. package/docs/api/type-aliases/FateOperation.md +1 -1
  112. package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
  113. package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
  114. package/docs/api/type-aliases/FateRecord.md +1 -1
  115. package/docs/api/type-aliases/FateRoots.md +1 -1
  116. package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
  117. package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
  118. package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
  119. package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
  120. package/docs/api/type-aliases/GraphQLTransportOptions.md +11 -11
  121. package/docs/api/type-aliases/HydrateOptions.md +1 -1
  122. package/docs/api/type-aliases/HydrationLimits.md +1 -1
  123. package/docs/api/type-aliases/InferFateAPI.md +1 -1
  124. package/docs/api/type-aliases/List.md +1 -1
  125. package/docs/api/type-aliases/ListEntry.md +1 -1
  126. package/docs/api/type-aliases/ListItem.md +1 -1
  127. package/docs/api/type-aliases/Mask.md +1 -1
  128. package/docs/api/type-aliases/MutationDefinition.md +1 -1
  129. package/docs/api/type-aliases/MutationEntity.md +1 -1
  130. package/docs/api/type-aliases/MutationIdentifier.md +1 -1
  131. package/docs/api/type-aliases/MutationInput.md +1 -1
  132. package/docs/api/type-aliases/MutationResult.md +1 -1
  133. package/docs/api/type-aliases/NodesItem.md +1 -1
  134. package/docs/api/type-aliases/Pagination.md +5 -5
  135. package/docs/api/type-aliases/Request.md +1 -1
  136. package/docs/api/type-aliases/RequestMode.md +1 -1
  137. package/docs/api/type-aliases/RequestOptions.md +1 -1
  138. package/docs/api/type-aliases/RequestResult.md +1 -1
  139. package/docs/api/type-aliases/Selection.md +1 -1
  140. package/docs/api/type-aliases/Snapshot.md +1 -1
  141. package/docs/api/type-aliases/TypeConfig.md +4 -4
  142. package/docs/api/type-aliases/View.md +1 -1
  143. package/docs/api/type-aliases/ViewData.md +1 -1
  144. package/docs/api/type-aliases/ViewEntity.md +1 -1
  145. package/docs/api/type-aliases/ViewEntityName.md +1 -1
  146. package/docs/api/type-aliases/ViewRef.md +1 -1
  147. package/docs/api/type-aliases/ViewSelection.md +1 -1
  148. package/docs/api/type-aliases/ViewSnapshot.md +1 -1
  149. package/docs/api/type-aliases/ViewTag.md +1 -1
  150. package/docs/api/variables/ConnectionTag.md +1 -1
  151. package/docs/api/variables/DeferTag.md +7 -0
  152. package/docs/api/variables/DeferredTag.md +7 -0
  153. package/docs/guide/actions.md +7 -7
  154. package/docs/guide/deferred-views.md +62 -0
  155. package/docs/guide/getting-started.md +21 -3
  156. package/docs/guide/vue.md +256 -0
  157. package/docs/index.md +1 -0
  158. package/docs/{guide/graphql-integration.md → integrations/graphql.md} +53 -6
  159. package/docs/{guide/server-integration.md → integrations/server.md} +93 -7
  160. package/docs/{guide/void-integration.md → integrations/void.md} +94 -12
  161. package/lib/{executor-sLcAqDMs.d.mts → executor-Dh-MLUXc.d.mts} +1 -1
  162. package/lib/{graphqlTransport-DbRHbYtb.d.mts → graphqlTransport-B3cbhvJX.d.mts} +1 -1
  163. package/lib/graphqlTransport.d.mts +1 -1
  164. package/lib/index.d.mts +10 -5
  165. package/lib/index.mjs +119 -3
  166. package/lib/{list-CMQOQGdn.d.mts → list-BrL6PD_6.d.mts} +1 -1
  167. package/lib/list.d.mts +1 -1
  168. package/lib/{record-BtdKzEGI.d.mts → record-BkvZwvFk.d.mts} +2 -2
  169. package/lib/server/drizzle.d.mts +2 -2
  170. package/lib/server/prisma.d.mts +2 -2
  171. package/lib/server.d.mts +3 -3
  172. package/lib/{transport-BTgtSwOM.d.mts → transport-BjGm__3t.d.mts} +36 -3
  173. package/lib/vite.d.mts +1 -1
  174. 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-CMQOQGdn.mjs";
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-BTgtSwOM.mjs";
2
- import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-sLcAqDMs.mjs";
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;
@@ -1,5 +1,5 @@
1
- import { Z as QueryProcedure, r as AnyRecord } from "../transport-BTgtSwOM.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-sLcAqDMs.mjs";
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
@@ -1,5 +1,5 @@
1
- import { Z as QueryProcedure, r as AnyRecord } from "../transport-BTgtSwOM.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-sLcAqDMs.mjs";
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 { X as AnyProcedure, r as AnyRecord$1 } from "./transport-BTgtSwOM.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-BtdKzEGI.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-sLcAqDMs.mjs";
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 SelectionShape<T extends Entity> = { [K in keyof T as K extends '__typename' ? never : K]?: SelectionFieldValue<T, K> } & {
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 { ViewEntity as A, mutation as B, RootDefinition as C, TypeName as D, TypeConfig as E, ViewTag as F, getSelectionPlan as G, RequestMode as H, __FateEntityBrand as I, HydrationLimits as J, FateDehydratedState as K, __FateSelectionBrand as L, ViewRef as M, ViewSelection as N, View as O, ViewSnapshot as P, isViewTag as R, RequestResult as S, Snapshot as T, RequestOptions as U, FateClient as V, createClient as W, AnyProcedure as X, List as Y, QueryProcedure as Z, MutationResult as _, ConnectionRef as a, Pagination as b, EntityId as c, ListItem as d, Mask as f, MutationInput as g, MutationIdentifier as h, ConnectionMetadata as i, ViewEntityName as j, ViewData as k, FateRoots as l, MutationEntity as m, createTRPCTransport as n, ConnectionTag as o, MutationDefinition as p, HydrateOptions as q, AnyRecord as r, Entity as s, Transport as t, FateThenable as u, MutationShape as v, Selection as w, Request$1 as x, NodesItem as y, FateMutations as z };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nkzw/fate",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "fate is a modern data client for React.",
5
5
  "homepage": "https://github.com/nkzw-tech/fate",
6
6
  "license": "MIT",