@nkzw/fate 0.1.3 → 1.0.0-rc.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 (170) hide show
  1. package/README.md +810 -129
  2. package/docs/api/classes/FateClient.md +832 -0
  3. package/docs/api/functions/clientRoot.md +27 -0
  4. package/docs/api/functions/createClient.md +21 -0
  5. package/docs/api/functions/createHTTPTransport.md +51 -0
  6. package/docs/api/functions/createTRPCTransport.md +46 -0
  7. package/docs/api/functions/getListEntries.md +15 -0
  8. package/docs/api/functions/getSelectionPlan.md +36 -0
  9. package/docs/api/functions/isRecord.md +15 -0
  10. package/docs/api/functions/isViewTag.md +17 -0
  11. package/docs/api/functions/liveConnectionTopic.md +19 -0
  12. package/docs/api/functions/liveEntityTopic.md +19 -0
  13. package/docs/api/functions/liveGlobalConnectionTopic.md +15 -0
  14. package/docs/api/functions/mutation.md +32 -0
  15. package/docs/api/functions/toEntityId.md +21 -0
  16. package/docs/api/functions/view.md +26 -0
  17. package/docs/api/index.md +81 -0
  18. package/docs/api/interfaces/FateThenable.md +31 -0
  19. package/docs/api/interfaces/Transport.md +199 -0
  20. package/docs/api/server/classes/FateRequestError.md +67 -0
  21. package/docs/api/server/drizzle/functions/createDrizzleFate.md +431 -0
  22. package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +21 -0
  23. package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +21 -0
  24. package/docs/api/server/drizzle/index.md +23 -0
  25. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +15 -0
  26. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +5 -0
  27. package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +21 -0
  28. package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +337 -0
  29. package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +29 -0
  30. package/docs/api/server/functions/bindSourceProcedures.md +32 -0
  31. package/docs/api/server/functions/computed.md +43 -0
  32. package/docs/api/server/functions/count.md +21 -0
  33. package/docs/api/server/functions/createFateFetchHandler.md +21 -0
  34. package/docs/api/server/functions/createFateServer.md +41 -0
  35. package/docs/api/server/functions/createHonoFateHandler.md +21 -0
  36. package/docs/api/server/functions/createLiveEventBus.md +17 -0
  37. package/docs/api/server/functions/createNestedSourcePlan.md +103 -0
  38. package/docs/api/server/functions/createResolver.md +74 -0
  39. package/docs/api/server/functions/createSourcePlan.md +95 -0
  40. package/docs/api/server/functions/createSourceProcedures.md +46 -0
  41. package/docs/api/server/functions/dataView.md +32 -0
  42. package/docs/api/server/functions/field.md +15 -0
  43. package/docs/api/server/functions/getNestedSelection.md +19 -0
  44. package/docs/api/server/functions/getScopedArgs.md +21 -0
  45. package/docs/api/server/functions/hasNestedSelection.md +19 -0
  46. package/docs/api/server/functions/list.md +28 -0
  47. package/docs/api/server/functions/refetchSourceById.md +55 -0
  48. package/docs/api/server/functions/resolveSourceById.md +55 -0
  49. package/docs/api/server/functions/resolveSourceByIds.md +55 -0
  50. package/docs/api/server/functions/resolveSourceConnection.md +67 -0
  51. package/docs/api/server/functions/resolver.md +42 -0
  52. package/docs/api/server/functions/toPrismaSelect.md +25 -0
  53. package/docs/api/server/functions/withConnection.md +24 -0
  54. package/docs/api/server/index.md +109 -0
  55. package/docs/api/server/prisma/functions/createPrismaFate.md +435 -0
  56. package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +21 -0
  57. package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +21 -0
  58. package/docs/api/server/prisma/functions/prismaConnectionArgs.md +57 -0
  59. package/docs/api/server/prisma/index.md +23 -0
  60. package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +59 -0
  61. package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +5 -0
  62. package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +343 -0
  63. package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +31 -0
  64. package/docs/api/server/type-aliases/ComputedField.md +55 -0
  65. package/docs/api/server/type-aliases/ComputedSelection.md +5 -0
  66. package/docs/api/server/type-aliases/ConnectionItem.md +29 -0
  67. package/docs/api/server/type-aliases/ConnectionPagination.md +39 -0
  68. package/docs/api/server/type-aliases/ConnectionResult.md +29 -0
  69. package/docs/api/server/type-aliases/CountSelection.md +29 -0
  70. package/docs/api/server/type-aliases/CountWhere.md +5 -0
  71. package/docs/api/server/type-aliases/DataViewListOptions.md +13 -0
  72. package/docs/api/server/type-aliases/DataViewOrderBy.md +5 -0
  73. package/docs/api/server/type-aliases/DataViewOrderDirection.md +5 -0
  74. package/docs/api/server/type-aliases/DataViewResult.md +11 -0
  75. package/docs/api/server/type-aliases/Entity.md +21 -0
  76. package/docs/api/server/type-aliases/FateServer.md +75 -0
  77. package/docs/api/server/type-aliases/FateServerManifest.md +5 -0
  78. package/docs/api/server/type-aliases/FieldSelection.md +21 -0
  79. package/docs/api/server/type-aliases/LiveConnectionEventType.md +5 -0
  80. package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +5 -0
  81. package/docs/api/server/type-aliases/LiveEventBus.md +5 -0
  82. package/docs/api/server/type-aliases/LiveEventType.md +5 -0
  83. package/docs/api/server/type-aliases/LiveSourceEvent.md +5 -0
  84. package/docs/api/server/type-aliases/NativeFateAPI.md +47 -0
  85. package/docs/api/server/type-aliases/OrderDirection.md +5 -0
  86. package/docs/api/server/type-aliases/SourceConfig.md +55 -0
  87. package/docs/api/server/type-aliases/SourceDefinition.md +55 -0
  88. package/docs/api/server/type-aliases/SourceOrder.md +5 -0
  89. package/docs/api/server/type-aliases/SourceOrderField.md +21 -0
  90. package/docs/api/server/type-aliases/SourcePlan.md +29 -0
  91. package/docs/api/server/type-aliases/SourcePlanNode.md +29 -0
  92. package/docs/api/server/type-aliases/SourceRegistry.md +11 -0
  93. package/docs/api/server/type-aliases/SourceRelation.md +15 -0
  94. package/docs/api/server/type-aliases/SourceRelationConfig.md +23 -0
  95. package/docs/api/server/variables/byIdInput.md +5 -0
  96. package/docs/api/server/variables/connectionArgs.md +7 -0
  97. package/docs/api/type-aliases/ConnectionMetadata.md +7 -0
  98. package/docs/api/type-aliases/ConnectionRef.md +13 -0
  99. package/docs/api/type-aliases/Entity.md +15 -0
  100. package/docs/api/type-aliases/EntityId.md +7 -0
  101. package/docs/api/type-aliases/FateLiveConnectionEvent.md +5 -0
  102. package/docs/api/type-aliases/FateLiveEvent.md +5 -0
  103. package/docs/api/type-aliases/FateMutations.md +7 -0
  104. package/docs/api/type-aliases/FateOperation.md +5 -0
  105. package/docs/api/type-aliases/FateProtocolRequest.md +5 -0
  106. package/docs/api/type-aliases/FateProtocolResponse.md +5 -0
  107. package/docs/api/type-aliases/FateRecord.md +7 -0
  108. package/docs/api/type-aliases/FateRoots.md +7 -0
  109. package/docs/api/type-aliases/InferFateAPI.md +11 -0
  110. package/docs/api/type-aliases/List.md +5 -0
  111. package/docs/api/type-aliases/ListEntry.md +5 -0
  112. package/docs/api/type-aliases/ListItem.md +13 -0
  113. package/docs/api/type-aliases/Mask.md +15 -0
  114. package/docs/api/type-aliases/MutationDefinition.md +21 -0
  115. package/docs/api/type-aliases/MutationEntity.md +13 -0
  116. package/docs/api/type-aliases/MutationIdentifier.md +19 -0
  117. package/docs/api/type-aliases/MutationInput.md +13 -0
  118. package/docs/api/type-aliases/MutationResult.md +13 -0
  119. package/docs/api/type-aliases/NodesItem.md +13 -0
  120. package/docs/api/type-aliases/Pagination.md +39 -0
  121. package/docs/api/type-aliases/Request.md +7 -0
  122. package/docs/api/type-aliases/RequestMode.md +7 -0
  123. package/docs/api/type-aliases/RequestOptions.md +7 -0
  124. package/docs/api/type-aliases/RequestResult.md +18 -0
  125. package/docs/api/type-aliases/Selection.md +13 -0
  126. package/docs/api/type-aliases/Snapshot.md +7 -0
  127. package/docs/api/type-aliases/TypeConfig.md +41 -0
  128. package/docs/api/type-aliases/View.md +17 -0
  129. package/docs/api/type-aliases/ViewData.md +18 -0
  130. package/docs/api/type-aliases/ViewEntity.md +13 -0
  131. package/docs/api/type-aliases/ViewEntityName.md +13 -0
  132. package/docs/api/type-aliases/ViewRef.md +13 -0
  133. package/docs/api/type-aliases/ViewSelection.md +13 -0
  134. package/docs/api/type-aliases/ViewSnapshot.md +18 -0
  135. package/docs/api/type-aliases/ViewTag.md +7 -0
  136. package/docs/api/variables/ConnectionTag.md +7 -0
  137. package/docs/guide/actions.md +263 -0
  138. package/docs/guide/core-concepts.md +22 -0
  139. package/docs/guide/getting-started.md +57 -0
  140. package/docs/guide/list-views.md +86 -0
  141. package/docs/guide/live-views.md +245 -0
  142. package/docs/guide/requests.md +130 -0
  143. package/docs/guide/server-integration.md +630 -0
  144. package/docs/guide/views.md +278 -0
  145. package/docs/guide/void-integration.md +167 -0
  146. package/docs/index.md +4 -0
  147. package/lib/cli.mjs +17 -250
  148. package/lib/clientStub.d.mts +6 -0
  149. package/lib/clientStub.mjs +6 -0
  150. package/lib/executor-BqwHdN3n.d.mts +468 -0
  151. package/lib/index.d.mts +64 -2
  152. package/lib/index.mjs +1961 -555
  153. package/lib/list-4wRNSVgI.d.mts +10 -0
  154. package/lib/list-C_mi6GnE.mjs +16 -0
  155. package/lib/list.d.mts +2 -0
  156. package/lib/list.mjs +2 -0
  157. package/lib/liveTopics-DzNtJaBD.mjs +197 -0
  158. package/lib/{record-DnhZuvUe.mjs → record-AeZJC9fd.mjs} +1 -2
  159. package/lib/record-ENh92gyb.d.mts +315 -0
  160. package/lib/server/drizzle.d.mts +304 -0
  161. package/lib/server/drizzle.mjs +688 -0
  162. package/lib/server/prisma.d.mts +309 -0
  163. package/lib/server/prisma.mjs +345 -0
  164. package/lib/server.d.mts +82 -183
  165. package/lib/server.mjs +870 -416
  166. package/lib/sourceRouter-Bwpkr062.mjs +972 -0
  167. package/lib/{types-HECWvGpd.d.mts → types-Dz46PXr3.d.mts} +215 -63
  168. package/lib/vite.d.mts +17 -0
  169. package/lib/vite.mjs +592 -0
  170. package/package.json +44 -6
@@ -0,0 +1,109 @@
1
+ # @nkzw/fate/server
2
+
3
+ The fate server library.
4
+
5
+ ## Example
6
+
7
+ ```ts
8
+ import { dataView } from '@nkzw/fate/server';
9
+ ```
10
+
11
+ ## Classes
12
+
13
+ - [FateRequestError](classes/FateRequestError.md)
14
+
15
+ ## Type Aliases
16
+
17
+ - [ComputedField](type-aliases/ComputedField.md)
18
+ - [ComputedSelection](type-aliases/ComputedSelection.md)
19
+ - [ConnectionItem](type-aliases/ConnectionItem.md)
20
+ - [ConnectionPagination](type-aliases/ConnectionPagination.md)
21
+ - [ConnectionResult](type-aliases/ConnectionResult.md)
22
+ - [CountSelection](type-aliases/CountSelection.md)
23
+ - [CountWhere](type-aliases/CountWhere.md)
24
+ - [DataViewListOptions](type-aliases/DataViewListOptions.md)
25
+ - [DataViewOrderBy](type-aliases/DataViewOrderBy.md)
26
+ - [DataViewOrderDirection](type-aliases/DataViewOrderDirection.md)
27
+ - [DataViewResult](type-aliases/DataViewResult.md)
28
+ - [Entity](type-aliases/Entity.md)
29
+ - [FateServer](type-aliases/FateServer.md)
30
+ - [FateServerManifest](type-aliases/FateServerManifest.md)
31
+ - [FieldSelection](type-aliases/FieldSelection.md)
32
+ - [LiveConnectionEventType](type-aliases/LiveConnectionEventType.md)
33
+ - [LiveConnectionSourceEvent](type-aliases/LiveConnectionSourceEvent.md)
34
+ - [LiveEventBus](type-aliases/LiveEventBus.md)
35
+ - [LiveEventType](type-aliases/LiveEventType.md)
36
+ - [LiveSourceEvent](type-aliases/LiveSourceEvent.md)
37
+ - [NativeFateAPI](type-aliases/NativeFateAPI.md)
38
+ - [OrderDirection](type-aliases/OrderDirection.md)
39
+ - [SourceConfig](type-aliases/SourceConfig.md)
40
+ - [SourceDefinition](type-aliases/SourceDefinition.md)
41
+ - [SourceOrder](type-aliases/SourceOrder.md)
42
+ - [SourceOrderField](type-aliases/SourceOrderField.md)
43
+ - [SourcePlan](type-aliases/SourcePlan.md)
44
+ - [SourcePlanNode](type-aliases/SourcePlanNode.md)
45
+ - [SourceRegistry](type-aliases/SourceRegistry.md)
46
+ - [SourceRelation](type-aliases/SourceRelation.md)
47
+ - [SourceRelationConfig](type-aliases/SourceRelationConfig.md)
48
+
49
+ ## Variables
50
+
51
+ - [byIdInput](variables/byIdInput.md)
52
+ - [connectionArgs](variables/connectionArgs.md)
53
+
54
+ ## Functions
55
+
56
+ - [bindSourceProcedures](functions/bindSourceProcedures.md)
57
+ - [computed](functions/computed.md)
58
+ - [count](functions/count.md)
59
+ - [createFateFetchHandler](functions/createFateFetchHandler.md)
60
+ - [createFateServer](functions/createFateServer.md)
61
+ - [createHonoFateHandler](functions/createHonoFateHandler.md)
62
+ - [createLiveEventBus](functions/createLiveEventBus.md)
63
+ - [createNestedSourcePlan](functions/createNestedSourcePlan.md)
64
+ - [createResolver](functions/createResolver.md)
65
+ - [createSourcePlan](functions/createSourcePlan.md)
66
+ - [createSourceProcedures](functions/createSourceProcedures.md)
67
+ - [dataView](functions/dataView.md)
68
+ - [field](functions/field.md)
69
+ - [getNestedSelection](functions/getNestedSelection.md)
70
+ - [getScopedArgs](functions/getScopedArgs.md)
71
+ - [hasNestedSelection](functions/hasNestedSelection.md)
72
+ - [list](functions/list.md)
73
+ - [refetchSourceById](functions/refetchSourceById.md)
74
+ - [resolver](functions/resolver.md)
75
+ - [resolveSourceById](functions/resolveSourceById.md)
76
+ - [resolveSourceByIds](functions/resolveSourceByIds.md)
77
+ - [resolveSourceConnection](functions/resolveSourceConnection.md)
78
+ - [toPrismaSelect](functions/toPrismaSelect.md)
79
+ - [withConnection](functions/withConnection.md)
80
+
81
+ ## References
82
+
83
+ ### InferFateAPI
84
+
85
+ Re-exports [InferFateAPI](../type-aliases/InferFateAPI.md)
86
+
87
+ ***
88
+
89
+ ### isRecord
90
+
91
+ Re-exports [isRecord](../functions/isRecord.md)
92
+
93
+ ***
94
+
95
+ ### liveConnectionTopic
96
+
97
+ Re-exports [liveConnectionTopic](../functions/liveConnectionTopic.md)
98
+
99
+ ***
100
+
101
+ ### liveEntityTopic
102
+
103
+ Re-exports [liveEntityTopic](../functions/liveEntityTopic.md)
104
+
105
+ ***
106
+
107
+ ### liveGlobalConnectionTopic
108
+
109
+ Re-exports [liveGlobalConnectionTopic](../functions/liveGlobalConnectionTopic.md)
@@ -0,0 +1,435 @@
1
+ # Function: createPrismaFate()
2
+
3
+ > **createPrismaFate**\<`Context`, `Procedure`\>(`__namedParameters`): `object`
4
+
5
+ Defined in: [packages/fate/src/server/prisma.ts:749](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/server/prisma.ts#L749)
6
+
7
+ ## Type Parameters
8
+
9
+ ### Context
10
+
11
+ `Context`
12
+
13
+ ### Procedure
14
+
15
+ `Procedure` *extends* `ProcedureLike`
16
+
17
+ ## Parameters
18
+
19
+ ### \_\_namedParameters
20
+
21
+ `PrismaSourceAdapterOptions`\<`Context`\> & `object`
22
+
23
+ ## Returns
24
+
25
+ `object`
26
+
27
+ ### connection
28
+
29
+ > **connection**: \<`TItem`, `TNode`, `TAdditionalInput`\>(`options`) => `ConnectionProcedure`\<`ConnectionInputWithAdditional`\<`TAdditionalInput`\>, [`ConnectionResult`](../../type-aliases/ConnectionResult.md)\<`TNode`\>\>
30
+
31
+ #### Type Parameters
32
+
33
+ ##### TItem
34
+
35
+ `TItem`
36
+
37
+ ##### TNode
38
+
39
+ `TNode` = `TItem`
40
+
41
+ ##### TAdditionalInput
42
+
43
+ `TAdditionalInput` *extends* `AdditionalInputSchema` \| `undefined` = `undefined`
44
+
45
+ #### Parameters
46
+
47
+ ##### options
48
+
49
+ ###### defaultSize?
50
+
51
+ `number`
52
+
53
+ ###### getCursor?
54
+
55
+ (`node`) => `string`
56
+
57
+ ###### input?
58
+
59
+ `TAdditionalInput`
60
+
61
+ ###### map?
62
+
63
+ `MapFn`\<`ProcedureContext`\<`Procedure`\>, `TItem`, `TNode`, `ConnectionInputWithAdditional`\<`TAdditionalInput`\>\>
64
+
65
+ ###### query
66
+
67
+ `QueryFn`\<`ProcedureContext`\<`Procedure`\>, `TItem`, `ConnectionInputWithAdditional`\<`TAdditionalInput`\>\>
68
+
69
+ #### Returns
70
+
71
+ `ConnectionProcedure`\<`ConnectionInputWithAdditional`\<`TAdditionalInput`\>, [`ConnectionResult`](../../type-aliases/ConnectionResult.md)\<`TNode`\>\>
72
+
73
+ ### createPlan
74
+
75
+ > **createPlan**: \<`Item`\>(`__namedParameters`) => `object`
76
+
77
+ #### Type Parameters
78
+
79
+ ##### Item
80
+
81
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
82
+
83
+ #### Parameters
84
+
85
+ ##### \_\_namedParameters
86
+
87
+ `SourceInput` & `object`
88
+
89
+ #### Returns
90
+
91
+ `object`
92
+
93
+ ##### args
94
+
95
+ > **args**: [`FateRecord`](../../../type-aliases/FateRecord.md) \| `undefined`
96
+
97
+ ##### ctx
98
+
99
+ > **ctx**: `Context` \| `undefined`
100
+
101
+ ##### resolve
102
+
103
+ > **resolve**: (`item`) => `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)\>
104
+
105
+ ###### Parameters
106
+
107
+ ###### item
108
+
109
+ `Item`
110
+
111
+ ###### Returns
112
+
113
+ `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)\>
114
+
115
+ ##### resolveMany
116
+
117
+ > **resolveMany**: (`items`) => `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)[]\>
118
+
119
+ ###### Parameters
120
+
121
+ ###### items
122
+
123
+ [`FateRecord`](../../../type-aliases/FateRecord.md)[]
124
+
125
+ ###### Returns
126
+
127
+ `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)[]\>
128
+
129
+ ##### root
130
+
131
+ > **root**: [`SourcePlanNode`](../../type-aliases/SourcePlanNode.md)\<`unknown`, `unknown`\>
132
+
133
+ ##### selectedPaths
134
+
135
+ > **selectedPaths**: `Set`\<`string`\>
136
+
137
+ ##### source
138
+
139
+ > **source**: [`SourceDefinition`](../../type-aliases/SourceDefinition.md)\<`Item`, `unknown`\>
140
+
141
+ ##### view
142
+
143
+ > **view**: `DataView`\<`Item`\>
144
+
145
+ ### fetchById
146
+
147
+ > **fetchById**: \<`Item`\>(`__namedParameters`) => `Promise`\<`Item` \| `null`\>
148
+
149
+ #### Type Parameters
150
+
151
+ ##### Item
152
+
153
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
154
+
155
+ #### Parameters
156
+
157
+ ##### \_\_namedParameters
158
+
159
+ ###### ctx
160
+
161
+ `Context`
162
+
163
+ ###### extra?
164
+
165
+ [`FateRecord`](../../../type-aliases/FateRecord.md)
166
+
167
+ ###### id
168
+
169
+ `string`
170
+
171
+ ###### plan
172
+
173
+ [`SourcePlan`](../../type-aliases/SourcePlan.md)\<`Item`, `Context`\>
174
+
175
+ #### Returns
176
+
177
+ `Promise`\<`Item` \| `null`\>
178
+
179
+ ### fetchByIds
180
+
181
+ > **fetchByIds**: \<`Item`\>(`__namedParameters`) => `Promise`\<`Item`[]\>
182
+
183
+ #### Type Parameters
184
+
185
+ ##### Item
186
+
187
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
188
+
189
+ #### Parameters
190
+
191
+ ##### \_\_namedParameters
192
+
193
+ ###### ctx
194
+
195
+ `Context`
196
+
197
+ ###### extra?
198
+
199
+ [`FateRecord`](../../../type-aliases/FateRecord.md)
200
+
201
+ ###### ids
202
+
203
+ `string`[]
204
+
205
+ ###### plan
206
+
207
+ [`SourcePlan`](../../type-aliases/SourcePlan.md)\<`Item`, `Context`\>
208
+
209
+ #### Returns
210
+
211
+ `Promise`\<`Item`[]\>
212
+
213
+ ### fetchConnection
214
+
215
+ > **fetchConnection**: \<`Item`\>(`__namedParameters`) => `Promise`\<`Item`[]\>
216
+
217
+ #### Type Parameters
218
+
219
+ ##### Item
220
+
221
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
222
+
223
+ #### Parameters
224
+
225
+ ##### \_\_namedParameters
226
+
227
+ ###### ctx
228
+
229
+ `Context`
230
+
231
+ ###### cursor?
232
+
233
+ `string`
234
+
235
+ ###### direction
236
+
237
+ `"forward"` \| `"backward"`
238
+
239
+ ###### extra?
240
+
241
+ [`FateRecord`](../../../type-aliases/FateRecord.md)
242
+
243
+ ###### plan
244
+
245
+ [`SourcePlan`](../../type-aliases/SourcePlan.md)\<`Item`, `Context`\>
246
+
247
+ ###### skip?
248
+
249
+ `number`
250
+
251
+ ###### take
252
+
253
+ `number`
254
+
255
+ #### Returns
256
+
257
+ `Promise`\<`Item`[]\>
258
+
259
+ ### getSource
260
+
261
+ > **getSource**: \<`Item`\>(`target`) => [`SourceDefinition`](../../type-aliases/SourceDefinition.md)\<`Item`, `unknown`\>
262
+
263
+ #### Type Parameters
264
+
265
+ ##### Item
266
+
267
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
268
+
269
+ #### Parameters
270
+
271
+ ##### target
272
+
273
+ `SourceTarget`\<`Item`\>
274
+
275
+ #### Returns
276
+
277
+ [`SourceDefinition`](../../type-aliases/SourceDefinition.md)\<`Item`, `unknown`\>
278
+
279
+ ### procedures
280
+
281
+ > **procedures**: \<`Item`, `ById`, `List`\>(`input`) => `SourceProcedureResult`\<`ById`, `List`, `Procedure`, \<`TItem`, `TNode`, `TAdditionalInput`\>(`options`) => `ConnectionProcedure`\<`ConnectionInputWithAdditional`\<`TAdditionalInput`\>, [`ConnectionResult`](../../type-aliases/ConnectionResult.md)\<`TNode`\>\>\>
282
+
283
+ #### Type Parameters
284
+
285
+ ##### Item
286
+
287
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md)
288
+
289
+ ##### ById
290
+
291
+ `ById` *extends* `boolean` \| `undefined` = `undefined`
292
+
293
+ ##### List
294
+
295
+ `List` *extends* `boolean` \| `ListConfig` \| `undefined` = `undefined`
296
+
297
+ #### Parameters
298
+
299
+ ##### input
300
+
301
+ `ViewProcedureInput`\<`Item`, `ById`, `List`\>
302
+
303
+ #### Returns
304
+
305
+ `SourceProcedureResult`\<`ById`, `List`, `Procedure`, \<`TItem`, `TNode`, `TAdditionalInput`\>(`options`) => `ConnectionProcedure`\<`ConnectionInputWithAdditional`\<`TAdditionalInput`\>, [`ConnectionResult`](../../type-aliases/ConnectionResult.md)\<`TNode`\>\>\>
306
+
307
+ ### registry
308
+
309
+ > **registry**: [`SourceRegistry`](../../type-aliases/SourceRegistry.md)\<`Context`\>
310
+
311
+ ### resolveById
312
+
313
+ > **resolveById**: \<`Item`\>(`__namedParameters`) => `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md) \| `null`\>
314
+
315
+ #### Type Parameters
316
+
317
+ ##### Item
318
+
319
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
320
+
321
+ #### Parameters
322
+
323
+ ##### \_\_namedParameters
324
+
325
+ ###### ctx
326
+
327
+ `Context`
328
+
329
+ ###### extra?
330
+
331
+ [`FateRecord`](../../../type-aliases/FateRecord.md)
332
+
333
+ ###### id
334
+
335
+ `string`
336
+
337
+ ###### input
338
+
339
+ `SourceInput`
340
+
341
+ ###### view
342
+
343
+ `ViewTarget`\<`Item`\>
344
+
345
+ #### Returns
346
+
347
+ `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md) \| `null`\>
348
+
349
+ ### resolveByIds
350
+
351
+ > **resolveByIds**: \<`Item`\>(`__namedParameters`) => `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)[]\>
352
+
353
+ #### Type Parameters
354
+
355
+ ##### Item
356
+
357
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
358
+
359
+ #### Parameters
360
+
361
+ ##### \_\_namedParameters
362
+
363
+ ###### ctx
364
+
365
+ `Context`
366
+
367
+ ###### extra?
368
+
369
+ [`FateRecord`](../../../type-aliases/FateRecord.md)
370
+
371
+ ###### ids
372
+
373
+ `string`[]
374
+
375
+ ###### input
376
+
377
+ `SourceInput`
378
+
379
+ ###### view
380
+
381
+ `ViewTarget`\<`Item`\>
382
+
383
+ #### Returns
384
+
385
+ `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)[]\>
386
+
387
+ ### resolveConnection
388
+
389
+ > **resolveConnection**: \<`Item`\>(`__namedParameters`) => `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)[]\>
390
+
391
+ #### Type Parameters
392
+
393
+ ##### Item
394
+
395
+ `Item` *extends* [`FateRecord`](../../../type-aliases/FateRecord.md) = [`FateRecord`](../../../type-aliases/FateRecord.md)
396
+
397
+ #### Parameters
398
+
399
+ ##### \_\_namedParameters
400
+
401
+ ###### ctx
402
+
403
+ `Context`
404
+
405
+ ###### cursor?
406
+
407
+ `string`
408
+
409
+ ###### direction
410
+
411
+ `"forward"` \| `"backward"`
412
+
413
+ ###### extra?
414
+
415
+ [`FateRecord`](../../../type-aliases/FateRecord.md)
416
+
417
+ ###### input
418
+
419
+ `SourceInput`
420
+
421
+ ###### skip?
422
+
423
+ `number`
424
+
425
+ ###### take
426
+
427
+ `number`
428
+
429
+ ###### view
430
+
431
+ `ViewTarget`\<`Item`\>
432
+
433
+ #### Returns
434
+
435
+ `Promise`\<[`FateRecord`](../../../type-aliases/FateRecord.md)[]\>
@@ -0,0 +1,21 @@
1
+ # Function: createPrismaSourceAdapter()
2
+
3
+ > **createPrismaSourceAdapter**\<`Context`\>(`__namedParameters`): [`PrismaSourceAdapter`](../type-aliases/PrismaSourceAdapter.md)\<`Context`\>
4
+
5
+ Defined in: [packages/fate/src/server/prisma.ts:350](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/server/prisma.ts#L350)
6
+
7
+ ## Type Parameters
8
+
9
+ ### Context
10
+
11
+ `Context`
12
+
13
+ ## Parameters
14
+
15
+ ### \_\_namedParameters
16
+
17
+ `PrismaSourceAdapterOptions`\<`Context`\>
18
+
19
+ ## Returns
20
+
21
+ [`PrismaSourceAdapter`](../type-aliases/PrismaSourceAdapter.md)\<`Context`\>
@@ -0,0 +1,21 @@
1
+ # Function: createPrismaSourceRegistry()
2
+
3
+ > **createPrismaSourceRegistry**\<`Context`\>(`options`): [`SourceRegistry`](../../type-aliases/SourceRegistry.md)\<`Context`\>
4
+
5
+ Defined in: [packages/fate/src/server/prisma.ts:745](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/server/prisma.ts#L745)
6
+
7
+ ## Type Parameters
8
+
9
+ ### Context
10
+
11
+ `Context`
12
+
13
+ ## Parameters
14
+
15
+ ### options
16
+
17
+ `PrismaSourceAdapterOptions`\<`Context`\>
18
+
19
+ ## Returns
20
+
21
+ [`SourceRegistry`](../../type-aliases/SourceRegistry.md)\<`Context`\>
@@ -0,0 +1,57 @@
1
+ # Function: prismaConnectionArgs()
2
+
3
+ > **prismaConnectionArgs**(`__namedParameters`): `object`
4
+
5
+ Defined in: [packages/fate/src/server/prisma.ts:288](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/server/prisma.ts#L288)
6
+
7
+ ## Parameters
8
+
9
+ ### \_\_namedParameters
10
+
11
+ #### cursor?
12
+
13
+ `string`
14
+
15
+ #### direction
16
+
17
+ `"forward"` \| `"backward"`
18
+
19
+ #### node
20
+
21
+ [`SourcePlanNode`](../../type-aliases/SourcePlanNode.md)\<`any`, `any`\>
22
+
23
+ #### skip?
24
+
25
+ `number`
26
+
27
+ #### take
28
+
29
+ `number`
30
+
31
+ ## Returns
32
+
33
+ `object`
34
+
35
+ ### cursor?
36
+
37
+ > `optional` **cursor?**: `object`
38
+
39
+ #### cursor.id
40
+
41
+ > **id**: `string` = `cursor`
42
+
43
+ ### orderBy
44
+
45
+ > **orderBy**: `object`[]
46
+
47
+ #### Index Signature
48
+
49
+ \[`key`: `string`\]: [`OrderDirection`](../../type-aliases/OrderDirection.md)
50
+
51
+ ### skip?
52
+
53
+ > `optional` **skip?**: `number`
54
+
55
+ ### take
56
+
57
+ > **take**: `number`
@@ -0,0 +1,23 @@
1
+ # @nkzw/fate/server/prisma
2
+
3
+ Fate's Prisma integration.
4
+
5
+ ## Example
6
+
7
+ ```ts
8
+ import { createPrismaFate } from '@nkzw/fate/server/prisma';
9
+ ```
10
+
11
+ ## Type Aliases
12
+
13
+ - [PrismaDelegate](type-aliases/PrismaDelegate.md)
14
+ - [PrismaQueryExtra](type-aliases/PrismaQueryExtra.md)
15
+ - [PrismaSourceAdapter](type-aliases/PrismaSourceAdapter.md)
16
+ - [PrismaViewConfig](type-aliases/PrismaViewConfig.md)
17
+
18
+ ## Functions
19
+
20
+ - [createPrismaFate](functions/createPrismaFate.md)
21
+ - [createPrismaSourceAdapter](functions/createPrismaSourceAdapter.md)
22
+ - [createPrismaSourceRegistry](functions/createPrismaSourceRegistry.md)
23
+ - [prismaConnectionArgs](functions/prismaConnectionArgs.md)