@nkzw/fate 1.3.3 → 1.4.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 (169) hide show
  1. package/docs/api/classes/FateClient.md +40 -40
  2. package/docs/api/functions/clientRoot.md +1 -1
  3. package/docs/api/functions/createClient.md +1 -1
  4. package/docs/api/functions/createGraphQLTransport.md +1 -1
  5. package/docs/api/functions/createHTTPTransport.md +1 -1
  6. package/docs/api/functions/createTRPCTransport.md +1 -1
  7. package/docs/api/functions/defer.md +1 -1
  8. package/docs/api/functions/getDeferredMetadata.md +1 -1
  9. package/docs/api/functions/getListEntries.md +1 -1
  10. package/docs/api/functions/getSelectionPlan.md +1 -1
  11. package/docs/api/functions/graphqlMutation.md +1 -1
  12. package/docs/api/functions/isDeferred.md +1 -1
  13. package/docs/api/functions/isRecord.md +1 -1
  14. package/docs/api/functions/isViewTag.md +1 -1
  15. package/docs/api/functions/liveConnectionTopic.md +1 -1
  16. package/docs/api/functions/liveEntityTopic.md +1 -1
  17. package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
  18. package/docs/api/functions/mutation.md +1 -1
  19. package/docs/api/functions/toEntityId.md +1 -1
  20. package/docs/api/functions/view.md +1 -1
  21. package/docs/api/interfaces/FateThenable.md +3 -3
  22. package/docs/api/interfaces/Transport.md +7 -7
  23. package/docs/api/server/classes/FateRequestError.md +5 -5
  24. package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
  25. package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
  26. package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
  27. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
  28. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
  29. package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
  30. package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
  31. package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
  32. package/docs/api/server/functions/bindSourceProcedures.md +1 -1
  33. package/docs/api/server/functions/computed.md +1 -1
  34. package/docs/api/server/functions/count.md +1 -1
  35. package/docs/api/server/functions/createFateFetchHandler.md +1 -1
  36. package/docs/api/server/functions/createFateServer.md +1 -1
  37. package/docs/api/server/functions/createHonoFateHandler.md +1 -1
  38. package/docs/api/server/functions/createLiveEventBus.md +1 -1
  39. package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
  40. package/docs/api/server/functions/createResolver.md +1 -1
  41. package/docs/api/server/functions/createSourcePlan.md +1 -1
  42. package/docs/api/server/functions/createSourceProcedures.md +1 -1
  43. package/docs/api/server/functions/dataView.md +1 -1
  44. package/docs/api/server/functions/field.md +1 -1
  45. package/docs/api/server/functions/getNestedSelection.md +1 -1
  46. package/docs/api/server/functions/getScopedArgs.md +1 -1
  47. package/docs/api/server/functions/hasNestedSelection.md +1 -1
  48. package/docs/api/server/functions/list.md +1 -1
  49. package/docs/api/server/functions/refetchSourceById.md +1 -1
  50. package/docs/api/server/functions/resolveSourceById.md +1 -1
  51. package/docs/api/server/functions/resolveSourceByIds.md +1 -1
  52. package/docs/api/server/functions/resolveSourceConnection.md +1 -1
  53. package/docs/api/server/functions/resolver.md +1 -1
  54. package/docs/api/server/functions/toPrismaSelect.md +1 -1
  55. package/docs/api/server/functions/withConnection.md +1 -1
  56. package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
  57. package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
  58. package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
  59. package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
  60. package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
  61. package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
  62. package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
  63. package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
  64. package/docs/api/server/type-aliases/ComputedField.md +5 -5
  65. package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
  66. package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
  67. package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
  68. package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
  69. package/docs/api/server/type-aliases/CountSelection.md +4 -4
  70. package/docs/api/server/type-aliases/CountWhere.md +1 -1
  71. package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
  72. package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
  73. package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
  74. package/docs/api/server/type-aliases/DataViewResult.md +1 -1
  75. package/docs/api/server/type-aliases/Entity.md +1 -1
  76. package/docs/api/server/type-aliases/FateServer.md +5 -5
  77. package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
  78. package/docs/api/server/type-aliases/FieldSelection.md +3 -3
  79. package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
  80. package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
  81. package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
  82. package/docs/api/server/type-aliases/LiveEventType.md +1 -1
  83. package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
  84. package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
  85. package/docs/api/server/type-aliases/OrderDirection.md +1 -1
  86. package/docs/api/server/type-aliases/SourceConfig.md +6 -6
  87. package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
  88. package/docs/api/server/type-aliases/SourceOrder.md +1 -1
  89. package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
  90. package/docs/api/server/type-aliases/SourcePlan.md +1 -1
  91. package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
  92. package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
  93. package/docs/api/server/type-aliases/SourceRelation.md +1 -1
  94. package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
  95. package/docs/api/server/variables/byIdInput.md +1 -1
  96. package/docs/api/server/variables/connectionArgs.md +1 -1
  97. package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
  98. package/docs/api/type-aliases/ConnectionRef.md +1 -1
  99. package/docs/api/type-aliases/Deferred.md +1 -1
  100. package/docs/api/type-aliases/DeferredMetadata.md +1 -1
  101. package/docs/api/type-aliases/DeferredSelection.md +1 -1
  102. package/docs/api/type-aliases/DeferredSnapshot.md +1 -1
  103. package/docs/api/type-aliases/Entity.md +2 -2
  104. package/docs/api/type-aliases/EntityId.md +1 -1
  105. package/docs/api/type-aliases/FateDehydratedState.md +1 -1
  106. package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
  107. package/docs/api/type-aliases/FateLiveEvent.md +1 -1
  108. package/docs/api/type-aliases/FateMutations.md +1 -1
  109. package/docs/api/type-aliases/FateOperation.md +1 -1
  110. package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
  111. package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
  112. package/docs/api/type-aliases/FateRecord.md +1 -1
  113. package/docs/api/type-aliases/FateRoots.md +1 -1
  114. package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
  115. package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
  116. package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
  117. package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
  118. package/docs/api/type-aliases/GraphQLTransportOptions.md +11 -11
  119. package/docs/api/type-aliases/HydrateOptions.md +1 -1
  120. package/docs/api/type-aliases/HydrationLimits.md +1 -1
  121. package/docs/api/type-aliases/InferFateAPI.md +1 -1
  122. package/docs/api/type-aliases/List.md +1 -1
  123. package/docs/api/type-aliases/ListEntry.md +1 -1
  124. package/docs/api/type-aliases/ListItem.md +1 -1
  125. package/docs/api/type-aliases/Mask.md +1 -1
  126. package/docs/api/type-aliases/MutationDefinition.md +1 -1
  127. package/docs/api/type-aliases/MutationEntity.md +1 -1
  128. package/docs/api/type-aliases/MutationIdentifier.md +1 -1
  129. package/docs/api/type-aliases/MutationInput.md +1 -1
  130. package/docs/api/type-aliases/MutationResult.md +1 -1
  131. package/docs/api/type-aliases/NodesItem.md +1 -1
  132. package/docs/api/type-aliases/Pagination.md +5 -5
  133. package/docs/api/type-aliases/Request.md +1 -1
  134. package/docs/api/type-aliases/RequestMode.md +1 -1
  135. package/docs/api/type-aliases/RequestOptions.md +1 -1
  136. package/docs/api/type-aliases/RequestResult.md +1 -1
  137. package/docs/api/type-aliases/Selection.md +1 -1
  138. package/docs/api/type-aliases/Snapshot.md +1 -1
  139. package/docs/api/type-aliases/TypeConfig.md +4 -4
  140. package/docs/api/type-aliases/View.md +1 -1
  141. package/docs/api/type-aliases/ViewData.md +1 -1
  142. package/docs/api/type-aliases/ViewEntity.md +1 -1
  143. package/docs/api/type-aliases/ViewEntityName.md +1 -1
  144. package/docs/api/type-aliases/ViewRef.md +1 -1
  145. package/docs/api/type-aliases/ViewSelection.md +1 -1
  146. package/docs/api/type-aliases/ViewSnapshot.md +1 -1
  147. package/docs/api/type-aliases/ViewTag.md +1 -1
  148. package/docs/api/variables/ConnectionTag.md +1 -1
  149. package/docs/api/variables/DeferTag.md +1 -1
  150. package/docs/api/variables/DeferredTag.md +1 -1
  151. package/lib/cli.d.mts +1 -1
  152. package/lib/{executor-C8HNogYG.d.mts → executor-BRudKWDY.d.mts} +18 -65
  153. package/lib/{graphqlTransport-DskuXeUP.d.mts → graphqlTransport-BDR1pnUQ.d.mts} +3 -14
  154. package/lib/graphqlTransport.d.mts +1 -1
  155. package/lib/index.d.mts +6 -15
  156. package/lib/index.mjs +711 -623
  157. package/lib/{list-sI2UPhHc.d.mts → list-Bb1SeABn.d.mts} +1 -2
  158. package/lib/list.d.mts +1 -1
  159. package/lib/{record-CZyyeLa3.d.mts → record-BTUXkHQU.d.mts} +9 -18
  160. package/lib/server/drizzle.d.mts +45 -114
  161. package/lib/server/drizzle.mjs +1 -1
  162. package/lib/server/prisma.d.mts +52 -127
  163. package/lib/server/prisma.mjs +8 -2
  164. package/lib/server.d.mts +4 -16
  165. package/lib/server.mjs +2 -28
  166. package/lib/{transport-DhaVVq4P.d.mts → transport-Bo1Jgo9R.d.mts} +76 -103
  167. package/lib/vite.d.mts +0 -1
  168. package/lib/vite.mjs +1 -1
  169. package/package.json +5 -5
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **RequestResult**\<`R`, `Q`\> = `{ [K in keyof Q]: K extends keyof R ? ListResult<Q[K], RootType<R[K]>, RootResult<R[K]>> : never }`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:424](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L424)
5
+ Defined in: [packages/fate/src/types.ts:424](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L424)
6
6
 
7
7
  The result of a `FateClient.request` and `useRequest` call, mapping each
8
8
  request key to its corresponding result.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Selection**\<`T`\> = `SelectionShape`\<`T`\> & `SelectionViewSpread`\<`T`\>
4
4
 
5
- Defined in: [packages/fate/src/types.ts:229](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L229)
5
+ Defined in: [packages/fate/src/types.ts:229](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L229)
6
6
 
7
7
  Declarative selection of the fields a view needs from an entity.
8
8
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  > **Snapshot** = `Readonly`\<\{ `mask?`: `FieldMask`; `record?`: [`FateRecord`](FateRecord.md); \}\>
4
4
 
5
- Defined in: [packages/fate/src/types.ts:513](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L513)
5
+ Defined in: [packages/fate/src/types.ts:513](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L513)
6
6
 
7
7
  Snapshot captured before mutating the cache, used to roll back on errors.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **TypeConfig** = `object`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:124](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L124)
5
+ Defined in: [packages/fate/src/types.ts:124](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L124)
6
6
 
7
7
  Configuration for a server entity type used by the client cache.
8
8
 
@@ -12,7 +12,7 @@ Configuration for a server entity type used by the client cache.
12
12
 
13
13
  > `optional` **fields?**: `Record`\<`string`, `RelationDescriptor`\>
14
14
 
15
- Defined in: [packages/fate/src/types.ts:125](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L125)
15
+ Defined in: [packages/fate/src/types.ts:125](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L125)
16
16
 
17
17
  ***
18
18
 
@@ -20,7 +20,7 @@ Defined in: [packages/fate/src/types.ts:125](https://github.com/nkzw-tech/fate/b
20
20
 
21
21
  > **getId**: (`record`) => `string` \| `number`
22
22
 
23
- Defined in: [packages/fate/src/types.ts:126](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L126)
23
+ Defined in: [packages/fate/src/types.ts:126](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L126)
24
24
 
25
25
  #### Parameters
26
26
 
@@ -38,4 +38,4 @@ Defined in: [packages/fate/src/types.ts:126](https://github.com/nkzw-tech/fate/b
38
38
 
39
39
  > **type**: `string`
40
40
 
41
- Defined in: [packages/fate/src/types.ts:127](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L127)
41
+ Defined in: [packages/fate/src/types.ts:127](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L127)
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **View**\<`T`, `S`\> = `Readonly`\<\{\[`viewTag`: `` `__fate-view__${string}` ``\]: `Readonly`\<\{ `[ViewKind]`: `true`; `select`: `S`; \}\>; \}\> & `__ViewEntityAnchor`\<`T`\> & `__ViewSelectionAnchor`\<`S`\>
4
4
 
5
- Defined in: [packages/fate/src/types.ts:245](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L245)
5
+ Defined in: [packages/fate/src/types.ts:245](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L245)
6
6
 
7
7
  Definition of a view over an entity type, including the selection of fields.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewData**\<`T`, `S`\> = `Readonly`\<`S` *extends* [`Selection`](Selection.md)\<`T`\> ? [`Mask`](Mask.md)\<`T`, `S`\> : `T` & `object`\>
4
4
 
5
- Defined in: [packages/fate/src/types.ts:261](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L261)
5
+ Defined in: [packages/fate/src/types.ts:261](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L261)
6
6
 
7
7
  Data returned from a resolved view with masking applied and view tags
8
8
  attached for downstream composition.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewEntity**\<`V`\> = `V` *extends* [`View`](View.md)\<infer T, `any`\> ? `T` : `never`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:335](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L335)
5
+ Defined in: [packages/fate/src/types.ts:335](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L335)
6
6
 
7
7
  Entity type captured from a view definition.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewEntityName**\<`V`\> = [`ViewEntity`](ViewEntity.md)\<`V`\>\[`"__typename"`\] & `string`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:338](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L338)
5
+ Defined in: [packages/fate/src/types.ts:338](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L338)
6
6
 
7
7
  Name of the entity type captured from a view definition.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewRef**\<`TName`\> = `Readonly`\<\{ `__typename`: `TName`; `[ViewsTag]`: `Set`\<`string`\>; `id`: `string` \| `number`; \}\>
4
4
 
5
- Defined in: [packages/fate/src/types.ts:108](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L108)
5
+ Defined in: [packages/fate/src/types.ts:108](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L108)
6
6
 
7
7
  Reference to a normalized entity instance that can be resolved against one or more view tags.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewSelection**\<`V`\> = `V` *extends* `object` ? `S` : `never`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:341](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L341)
5
+ Defined in: [packages/fate/src/types.ts:341](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L341)
6
6
 
7
7
  Selection captured from a view definition.
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **ViewSnapshot**\<`T`, `S`\> = `Readonly`\<\{ `coverage`: `ReadonlyArray`\<readonly \[[`EntityId`](EntityId.md), `ReadonlySet`\<`string`\>\]\>; `data`: [`ViewData`](ViewData.md)\<`T`, `S`\>; \}\>
4
4
 
5
- Defined in: [packages/fate/src/types.ts:271](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L271)
5
+ Defined in: [packages/fate/src/types.ts:271](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L271)
6
6
 
7
7
  Snapshot returned by the cache for a view, including the masked data and all
8
8
  referenced entity IDs.
@@ -2,6 +2,6 @@
2
2
 
3
3
  > **ViewTag** = `` `__fate-view__${string}` ``
4
4
 
5
- Defined in: [packages/fate/src/types.ts:56](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L56)
5
+ Defined in: [packages/fate/src/types.ts:56](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L56)
6
6
 
7
7
  Unique key that identifies a view composition entry inside a selection or reference.
@@ -2,6 +2,6 @@
2
2
 
3
3
  > `const` **ConnectionTag**: *typeof* `ConnectionTag`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:20](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L20)
5
+ Defined in: [packages/fate/src/types.ts:20](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L20)
6
6
 
7
7
  Symbol attached to connection results so pagination helpers can find their metadata.
@@ -2,6 +2,6 @@
2
2
 
3
3
  > `const` **DeferTag**: *typeof* `DeferTag`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:23](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L23)
5
+ Defined in: [packages/fate/src/types.ts:23](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L23)
6
6
 
7
7
  Symbol used to mark a selection as deferred.
@@ -2,6 +2,6 @@
2
2
 
3
3
  > `const` **DeferredTag**: *typeof* `DeferredTag`
4
4
 
5
- Defined in: [packages/fate/src/types.ts:26](https://github.com/nkzw-tech/fate/blob/49490f5c07a65b981b4781ddf0441d15ad01b5ab/packages/fate/src/types.ts#L26)
5
+ Defined in: [packages/fate/src/types.ts:26](https://github.com/nkzw-tech/fate/blob/aec05ea2ab0386693600d573021cd2a93f1d8b59/packages/fate/src/types.ts#L26)
6
6
 
7
7
  Symbol attached to deferred values returned from masked views.
package/lib/cli.d.mts CHANGED
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,6 +1,5 @@
1
- import { r as AnyRecord, rt as QueryProcedure } from "./transport-DhaVVq4P.mjs";
1
+ import { nt as QueryProcedure, r as AnyRecord } from "./transport-Bo1Jgo9R.mjs";
2
2
  import { z } from "zod";
3
-
4
3
  //#region src/server/dataView.d.ts
5
4
  declare const dataViewFieldsKey: unique symbol;
6
5
  declare const dataViewBaseKey: unique symbol;
@@ -28,7 +27,7 @@ type CountSelection = {
28
27
  where?: CountWhere;
29
28
  };
30
29
  type ComputedSelection = CountSelection | FieldSelection;
31
- type ComputedDeps<Select extends Record<string, ComputedSelection> | undefined> = Select extends Record<string, ComputedSelection> ? { [Key in keyof Select]: Select[Key] extends CountSelection ? number : Select[Key] extends FieldSelection ? unknown : never } : Record<string, unknown>;
30
+ type ComputedDeps<Select extends Record<string, ComputedSelection> | undefined> = Select extends Record<string, ComputedSelection> ? { [Key in keyof Select]: Select[Key] extends CountSelection ? number : Select[Key] extends FieldSelection ? unknown : never; } : Record<string, unknown>;
32
31
  type ComputedResolve<Item extends AnyRecord, Result, Select extends Record<string, ComputedSelection> | undefined, Context> = Bivariant<(item: Item, deps: ComputedDeps<Select>, context?: Context, args?: AnyRecord) => Promise<Result> | Result>;
33
32
  /**
34
33
  * Field configuration for selecting and resolving a computed value on the backend.
@@ -49,7 +48,7 @@ type DataField<Item extends AnyRecord> = true | ComputedField<Item, any, any, an
49
48
  /**
50
49
  * Recursively serializes resolver results for transport across the network.
51
50
  */
52
- type Serializable<T> = T extends Date ? string : T extends Array<infer U> ? Array<Serializable<U>> : T extends object ? { [K in keyof T]: Serializable<T[K]> } : T;
51
+ type Serializable<T> = T extends Date ? string : T extends Array<infer U> ? Array<Serializable<U>> : T extends object ? { [K in keyof T]: Serializable<T[K]>; } : T;
53
52
  /**
54
53
  * Server-side mirror of a view definition describing how to select and resolve
55
54
  * fields when fulfilling a client request.
@@ -89,7 +88,7 @@ declare function dataView<Item extends AnyRecord>(typeName: string): <Fields ext
89
88
  * connection information.
90
89
  */
91
90
  declare const list: <Item extends AnyRecord>(view: DataView<Item>, options?: DataViewListOptions) => DataView<Item> & DataViewInternals<Item> & {
92
- kind: "list";
91
+ kind: 'list';
93
92
  };
94
93
  /**
95
94
  * Declares a resolver field inside a data view, optionally providing a
@@ -118,7 +117,7 @@ type ViewFieldConfig<V extends DataView<AnyRecord>> = V extends {
118
117
  readonly [dataViewFieldsKey]: infer Fields;
119
118
  } ? Fields : V['fields'];
120
119
  type RawFieldResult<Item extends AnyRecord, Key extends PropertyKey, Field extends DataField<Item>> = Field extends true ? Key extends keyof Item ? Item[Key] : never : Field extends DataView<infer ChildItem> ? Key extends keyof Item ? RelationResult<Item[Key], DataView<ChildItem>> : never : Field extends ComputedField<Item, any, any, any> ? ComputedResult<Field> : Field extends ResolverField<Item, any, any> ? ResolverResult<Field> : never;
121
- type RawDataViewResult<V extends DataView<AnyRecord>> = V extends DataView<infer Item> ? { [K in keyof ViewFieldConfig<V>]: RawFieldResult<Item, K, ViewFieldConfig<V>[K]> } : never;
120
+ type RawDataViewResult<V extends DataView<AnyRecord>> = V extends DataView<infer Item> ? { [K in keyof ViewFieldConfig<V>]: RawFieldResult<Item, K, ViewFieldConfig<V>[K]>; } : never;
122
121
  type DataViewResult<V extends DataView<AnyRecord>> = Serializable<RawDataViewResult<V>>;
123
122
  type WithTypename<T, Name extends string> = T & {
124
123
  __typename: Name;
@@ -150,12 +149,7 @@ type ViewPlan<Item extends AnyRecord = AnyRecord, Context = unknown> = {
150
149
  * Builds a resolver that applies a client's selection to a server data view,
151
150
  * filtering fields, running nested resolvers, and shaping Prisma selects.
152
151
  */
153
- declare function createResolver<Item extends AnyRecord, Context = unknown>({
154
- args,
155
- ctx,
156
- select,
157
- view
158
- }: {
152
+ declare function createResolver<Item extends AnyRecord, Context = unknown>({ args, ctx, select, view }: {
159
153
  args?: AnyRecord;
160
154
  ctx?: Context;
161
155
  select: Iterable<string>;
@@ -172,7 +166,7 @@ declare function createResolver<Item extends AnyRecord, Context = unknown>({
172
166
  type ConnectionInput = z.infer<typeof connectionInput>;
173
167
  type AdditionalInputSchema = z.ZodObject<Record<string, z.ZodTypeAny>>;
174
168
  type ConnectionInputWithAdditional<TAdditionalInput extends AdditionalInputSchema | undefined> = ConnectionInput & {
175
- args?: ConnectionInput['args'] extends infer A ? A & (TAdditionalInput extends AdditionalInputSchema ? z.infer<TAdditionalInput> : object) : never;
169
+ args?: ConnectionInput['args'] extends (infer A) ? A & (TAdditionalInput extends AdditionalInputSchema ? z.infer<TAdditionalInput> : object) : never;
176
170
  };
177
171
  type ConnectionCursor = string;
178
172
  /**
@@ -314,32 +308,22 @@ type SourcePlan<Item extends AnyRecord = AnyRecord, Context = unknown, Adapter =
314
308
  type DataViewModule = Record<string, unknown>;
315
309
  declare const hasNestedSelection: (select: Iterable<string>, field: string) => boolean;
316
310
  declare const getNestedSelection: (select: Iterable<string>, field: string) => Array<string>;
317
- declare function createSourcePlan<Item extends AnyRecord, Context = unknown, Adapter = unknown>({
318
- args,
319
- ctx,
320
- select,
321
- source
322
- }: {
311
+ declare function createSourcePlan<Item extends AnyRecord, Context = unknown, Adapter = unknown>({ args, ctx, select, source }: {
323
312
  args?: Record<string, unknown>;
324
313
  ctx?: Context;
325
314
  select: Iterable<string>;
326
315
  source: SourceDefinition<Item, Adapter>;
327
316
  }): {
328
- root: SourcePlanNode<unknown, Adapter>;
329
- source: SourceDefinition<Item, Adapter>;
330
317
  args: AnyRecord | undefined;
331
318
  ctx: Context | undefined;
332
319
  resolve: (item: Item) => Promise<AnyRecord>;
333
320
  resolveMany: (items: Array<AnyRecord>) => Promise<Array<AnyRecord>>;
334
321
  selectedPaths: Set<string>;
335
322
  view: DataView<Item>;
323
+ root: SourcePlanNode<unknown, Adapter>;
324
+ source: SourceDefinition<Item, Adapter>;
336
325
  };
337
- declare function createNestedSourcePlan<Item extends AnyRecord, Context = unknown, Adapter = unknown>({
338
- ctx,
339
- field,
340
- input,
341
- source
342
- }: {
326
+ declare function createNestedSourcePlan<Item extends AnyRecord, Context = unknown, Adapter = unknown>({ ctx, field, input, source }: {
343
327
  ctx?: Context;
344
328
  field: string;
345
329
  input: {
@@ -348,14 +332,14 @@ declare function createNestedSourcePlan<Item extends AnyRecord, Context = unknow
348
332
  };
349
333
  source: SourceDefinition<Item, Adapter>;
350
334
  }): {
351
- root: SourcePlanNode<unknown, Adapter>;
352
- source: SourceDefinition<Item, Adapter>;
353
335
  args: AnyRecord | undefined;
354
336
  ctx: Context | undefined;
355
337
  resolve: (item: Item) => Promise<AnyRecord>;
356
338
  resolveMany: (items: Array<AnyRecord>) => Promise<Array<AnyRecord>>;
357
339
  selectedPaths: Set<string>;
358
340
  view: DataView<Item>;
341
+ root: SourcePlanNode<unknown, Adapter>;
342
+ source: SourceDefinition<Item, Adapter>;
359
343
  };
360
344
  //#endregion
361
345
  //#region src/server/executor.d.ts
@@ -386,14 +370,7 @@ type SourceExecutor<Context, Item extends AnyRecord = AnyRecord, ByIdExtra = unk
386
370
  connection?: SourceConnectionHandler<Context, ConnectionExtra, Item>;
387
371
  };
388
372
  type SourceRegistry<Context> = Map<SourceDefinition<AnyRecord, unknown>, SourceExecutor<Context, AnyRecord, any, any, any>>;
389
- declare const resolveSourceByIds: <Context, Item extends AnyRecord>({
390
- ctx,
391
- extra,
392
- ids,
393
- input,
394
- registry,
395
- source
396
- }: {
373
+ declare const resolveSourceByIds: <Context, Item extends AnyRecord>({ ctx, extra, ids, input, registry, source }: {
397
374
  ctx: Context;
398
375
  extra?: unknown;
399
376
  ids: Array<string>;
@@ -404,14 +381,7 @@ declare const resolveSourceByIds: <Context, Item extends AnyRecord>({
404
381
  registry: SourceRegistry<Context>;
405
382
  source: SourceDefinition<Item, unknown>;
406
383
  }) => Promise<AnyRecord[]>;
407
- declare const resolveSourceById: <Context, Item extends AnyRecord>({
408
- ctx,
409
- extra,
410
- id,
411
- input,
412
- registry,
413
- source
414
- }: {
384
+ declare const resolveSourceById: <Context, Item extends AnyRecord>({ ctx, extra, id, input, registry, source }: {
415
385
  ctx: Context;
416
386
  extra?: unknown;
417
387
  id: string;
@@ -422,20 +392,10 @@ declare const resolveSourceById: <Context, Item extends AnyRecord>({
422
392
  registry: SourceRegistry<Context>;
423
393
  source: SourceDefinition<Item, unknown>;
424
394
  }) => Promise<AnyRecord | null>;
425
- declare const resolveSourceConnection: <Context, Item extends AnyRecord>({
426
- ctx,
427
- cursor,
428
- direction,
429
- extra,
430
- input,
431
- registry,
432
- skip,
433
- source,
434
- take
435
- }: {
395
+ declare const resolveSourceConnection: <Context, Item extends AnyRecord>({ ctx, cursor, direction, extra, input, registry, skip, source, take }: {
436
396
  ctx: Context;
437
397
  cursor?: string;
438
- direction: "backward" | "forward";
398
+ direction: 'backward' | 'forward';
439
399
  extra?: unknown;
440
400
  input: {
441
401
  args?: Record<string, unknown>;
@@ -446,14 +406,7 @@ declare const resolveSourceConnection: <Context, Item extends AnyRecord>({
446
406
  source: SourceDefinition<Item, unknown>;
447
407
  take: number;
448
408
  }) => Promise<AnyRecord[]>;
449
- declare const refetchSourceById: <Context, Item extends AnyRecord>({
450
- ctx,
451
- extra,
452
- id,
453
- input,
454
- registry,
455
- source
456
- }: {
409
+ declare const refetchSourceById: <Context, Item extends AnyRecord>({ ctx, extra, id, input, registry, source }: {
457
410
  ctx: Context;
458
411
  extra?: unknown;
459
412
  id: string;
@@ -1,5 +1,4 @@
1
- import { C as MutationShape, f as Entity, j as TypeConfig, t as Transport } from "./transport-DhaVVq4P.mjs";
2
-
1
+ import { A as TypeConfig, C as MutationShape, f as Entity, t as Transport } from "./transport-Bo1Jgo9R.mjs";
3
2
  //#region src/graphqlTransport.d.ts
4
3
  type TransportMutations = Record<string, MutationShape>;
5
4
  type EmptyTransportMutations = Record<never, MutationShape>;
@@ -31,7 +30,7 @@ type GraphQLMutationOutput<Definition> = Definition extends GraphQLMutationDefin
31
30
  type GraphQLMutationMap<Mutations> = Mutations extends Record<string, GraphQLMutationDefinition> ? { [K in keyof Mutations]: {
32
31
  input: GraphQLMutationInput<Mutations[K]>;
33
32
  output: GraphQLMutationOutput<Mutations[K]>;
34
- } } : EmptyTransportMutations;
33
+ }; } : EmptyTransportMutations;
35
34
  type GraphQLMutationRuntimeConfig = {
36
35
  entity: string;
37
36
  field: string;
@@ -59,16 +58,6 @@ declare function graphqlMutation<T extends Entity, Input, Output>(entity: T['__t
59
58
  field: string;
60
59
  inputArg?: false | string;
61
60
  }): GraphQLMutationDefinition<T, Input, Output>;
62
- declare function createGraphQLTransport<Mutations extends TransportMutations = EmptyTransportMutations>({
63
- decodeNodeId,
64
- encodeNodeId,
65
- fetch: fetchImpl,
66
- headers,
67
- live,
68
- mutations,
69
- roots,
70
- types: typeConfigs,
71
- url
72
- }: GraphQLTransportOptions<Mutations>): Transport<Mutations>;
61
+ declare function createGraphQLTransport<Mutations extends TransportMutations = EmptyTransportMutations>({ decodeNodeId, encodeNodeId, fetch: fetchImpl, headers, live, mutations, roots, types: typeConfigs, url }: GraphQLTransportOptions<Mutations>): Transport<Mutations>;
73
62
  //#endregion
74
63
  export { GraphQLTransportOptions as a, GraphQLMutationOutput as i, GraphQLMutationInput as n, createGraphQLTransport as o, GraphQLMutationMap as r, graphqlMutation as s, GraphQLMutationDefinition as t };
@@ -1,2 +1,2 @@
1
- import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-DskuXeUP.mjs";
1
+ import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-BDR1pnUQ.mjs";
2
2
  export { GraphQLMutationDefinition, GraphQLMutationInput, GraphQLMutationMap, GraphQLMutationOutput, GraphQLTransportOptions, createGraphQLTransport, graphqlMutation };
package/lib/index.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { $ as HydrateOptions, A as Snapshot, B as ViewTag, C as MutationShape, D as RequestResult, E as Request$1, F as ViewEntity, G as mutation, H as __FateSelectionBrand, I as ViewEntityName, J as RequestMode, K as DeferredSnapshot, L as ViewRef, M as TypeName, N as View, O as RootDefinition, P as ViewData, Q as FateDehydratedState, R as ViewSelection, S as MutationResult, T as Pagination, U as isViewTag, V as __FateEntityBrand, W as FateMutations, X as createClient, Y as RequestOptions, Z as getSelectionPlan, _ as Mask, a as ConnectionRef, b as MutationIdentifier, c as Deferred, d as DeferredTag, et as HydrationLimits, f as Entity, g as ListItem, h as FateThenable, i as ConnectionMetadata, j as TypeConfig, k as Selection, l as DeferredMetadata, m as FateRoots, n as createTRPCTransport, o as ConnectionTag, p as EntityId, q as FateClient, r as AnyRecord, s as DeferTag, t as Transport, tt as List, u as DeferredSelection, v as MutationDefinition, w as NodesItem, x as MutationInput, y as MutationEntity, z as ViewSnapshot } from "./transport-DhaVVq4P.mjs";
2
- import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-DskuXeUP.mjs";
3
- import { C as liveGlobalConnectionTopic, S as liveEntityTopic, a as FateProtocolRequest, i as FateOperation, n as FateLiveConnectionEvent, o as FateProtocolResponse, r as FateLiveEvent, t as isRecord, u as InferFateAPI, x as liveConnectionTopic } from "./record-CZyyeLa3.mjs";
4
- import { n as getListEntries, t as ListEntry } from "./list-sI2UPhHc.mjs";
5
-
1
+ import { $ as HydrationLimits, A as TypeConfig, B as __FateEntityBrand, C as MutationShape, D as RequestResult, E as Request$1, F as ViewEntityName, G as DeferredSnapshot, H as isViewTag, I as ViewRef, J as RequestOptions, K as FateClient, L as ViewSelection, M as View, N as ViewData, O as RootDefinition, P as ViewEntity, Q as HydrateOptions, R as ViewSnapshot, S as MutationResult, T as Pagination, U as FateMutations, V as __FateSelectionBrand, W as mutation, X as getSelectionPlan, Y as createClient, Z as FateDehydratedState, _ as Mask, a as ConnectionRef, b as MutationIdentifier, c as Deferred, d as DeferredTag, et as List, f as Entity, g as ListItem, h as FateThenable, i as ConnectionMetadata, j as TypeName, k as Selection, l as DeferredMetadata, m as FateRoots, n as createTRPCTransport, o as ConnectionTag, p as EntityId, q as RequestMode, r as AnyRecord, s as DeferTag, t as Transport, u as DeferredSelection, v as MutationDefinition, w as NodesItem, x as MutationInput, y as MutationEntity, z as ViewTag } from "./transport-Bo1Jgo9R.mjs";
2
+ import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-BDR1pnUQ.mjs";
3
+ import { C as liveGlobalConnectionTopic, S as liveEntityTopic, a as FateProtocolRequest, i as FateOperation, n as FateLiveConnectionEvent, o as FateProtocolResponse, r as FateLiveEvent, t as isRecord, u as InferFateAPI, x as liveConnectionTopic } from "./record-BTUXkHQU.mjs";
4
+ import { n as getListEntries, t as ListEntry } from "./list-Bb1SeABn.mjs";
6
5
  //#region src/defer.d.ts
7
6
  declare function defer<S>(selection: S): DeferredSelection<S>;
8
7
  declare const isDeferred: (value: unknown) => value is Deferred<unknown>;
@@ -50,15 +49,7 @@ type VoidLiveClientEvent<Data = unknown> = {
50
49
  topic: string;
51
50
  type?: string;
52
51
  };
53
- declare function createHTTPTransport<API extends FateAPIShape, Mutations extends TransportMutations = MutationMapFromAPI<API>>({
54
- eventSource,
55
- fetch: fetchImpl,
56
- headers,
57
- live,
58
- liveRetryMs,
59
- liveUrl,
60
- url
61
- }: {
52
+ declare function createHTTPTransport<API extends FateAPIShape, Mutations extends TransportMutations = MutationMapFromAPI<API>>({ eventSource, fetch: fetchImpl, headers, live, liveRetryMs, liveUrl, url }: {
62
53
  eventSource?: EventSourceConstructor;
63
54
  fetch?: FetchLike;
64
55
  headers?: HeadersFactory;
@@ -93,4 +84,4 @@ type SelectionValidation<T extends Entity, S extends Selection<T>> = Exclude<key
93
84
  */
94
85
  declare function view<T extends Entity>(): <S extends Selection<T>>(select: S & SelectionValidation<T, S>) => View<T, S>;
95
86
  //#endregion
96
- export { type ConnectionMetadata, type ConnectionRef, ConnectionTag, DeferTag, type Deferred, type DeferredMetadata, type DeferredSelection, type DeferredSnapshot, DeferredTag, type Entity, type EntityId, FateClient, type FateDehydratedState, type FateLiveConnectionEvent, type FateLiveEvent, type FateMutations, type FateOperation, type FateProtocolRequest, type FateProtocolResponse, type AnyRecord as FateRecord, type FateRoots, type FateThenable, type GraphQLMutationDefinition, type GraphQLMutationInput, type GraphQLMutationMap, type GraphQLMutationOutput, type GraphQLTransportOptions, type HydrateOptions, type HydrationLimits, type InferFateAPI, type List, type ListEntry, type ListItem, type Mask, type MutationDefinition, type MutationEntity, type MutationIdentifier, type MutationInput, type MutationResult, type NodesItem, type Pagination, type Request$1 as Request, type RequestMode, type RequestOptions, type RequestResult, type Selection, type Snapshot, type Transport, type TypeConfig, type View, type ViewData, type ViewEntity, type ViewEntityName, type ViewRef, type ViewSelection, type ViewSnapshot, type ViewTag, clientRoot, createClient, createGraphQLTransport, createHTTPTransport, createTRPCTransport, defer, getDeferredMetadata, getListEntries, getSelectionPlan, graphqlMutation, isDeferred, isRecord, isViewTag, liveConnectionTopic, liveEntityTopic, liveGlobalConnectionTopic, mutation, toEntityId, view };
87
+ export { type ConnectionMetadata, type ConnectionRef, ConnectionTag, DeferTag, type Deferred, type DeferredMetadata, type DeferredSelection, type DeferredSnapshot, DeferredTag, type Entity, type EntityId, FateClient, type FateDehydratedState, type FateLiveConnectionEvent, type FateLiveEvent, type FateMutations, type FateOperation, type FateProtocolRequest, type FateProtocolResponse, type AnyRecord as FateRecord, type FateRoots, type FateThenable, type GraphQLMutationDefinition, type GraphQLMutationInput, type GraphQLMutationMap, type GraphQLMutationOutput, type GraphQLTransportOptions, type HydrateOptions, type HydrationLimits, type InferFateAPI, type List, type ListEntry, type ListItem, type Mask, type MutationDefinition, type MutationEntity, type MutationIdentifier, type MutationInput, type MutationResult, type NodesItem, type Pagination, type Request$1 as Request, type RequestMode, type RequestOptions, type RequestResult, type Selection, type Transport, type TypeConfig, type View, type ViewData, type ViewEntity, type ViewEntityName, type ViewRef, type ViewSelection, type ViewSnapshot, type ViewTag, clientRoot, createClient, createGraphQLTransport, createHTTPTransport, createTRPCTransport, defer, getDeferredMetadata, getListEntries, getSelectionPlan, graphqlMutation, isDeferred, isRecord, isViewTag, liveConnectionTopic, liveEntityTopic, liveGlobalConnectionTopic, mutation, toEntityId, view };