@nkzw/fate 0.1.2 → 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.
- package/README.md +810 -129
- package/docs/api/classes/FateClient.md +832 -0
- package/docs/api/functions/clientRoot.md +27 -0
- package/docs/api/functions/createClient.md +21 -0
- package/docs/api/functions/createHTTPTransport.md +51 -0
- package/docs/api/functions/createTRPCTransport.md +46 -0
- package/docs/api/functions/getListEntries.md +15 -0
- package/docs/api/functions/getSelectionPlan.md +36 -0
- package/docs/api/functions/isRecord.md +15 -0
- package/docs/api/functions/isViewTag.md +17 -0
- package/docs/api/functions/liveConnectionTopic.md +19 -0
- package/docs/api/functions/liveEntityTopic.md +19 -0
- package/docs/api/functions/liveGlobalConnectionTopic.md +15 -0
- package/docs/api/functions/mutation.md +32 -0
- package/docs/api/functions/toEntityId.md +21 -0
- package/docs/api/functions/view.md +26 -0
- package/docs/api/index.md +81 -0
- package/docs/api/interfaces/FateThenable.md +31 -0
- package/docs/api/interfaces/Transport.md +199 -0
- package/docs/api/server/classes/FateRequestError.md +67 -0
- package/docs/api/server/drizzle/functions/createDrizzleFate.md +431 -0
- package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +21 -0
- package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +21 -0
- package/docs/api/server/drizzle/index.md +23 -0
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +15 -0
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +5 -0
- package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +21 -0
- package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +337 -0
- package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +29 -0
- package/docs/api/server/functions/bindSourceProcedures.md +32 -0
- package/docs/api/server/functions/computed.md +43 -0
- package/docs/api/server/functions/count.md +21 -0
- package/docs/api/server/functions/createFateFetchHandler.md +21 -0
- package/docs/api/server/functions/createFateServer.md +41 -0
- package/docs/api/server/functions/createHonoFateHandler.md +21 -0
- package/docs/api/server/functions/createLiveEventBus.md +17 -0
- package/docs/api/server/functions/createNestedSourcePlan.md +103 -0
- package/docs/api/server/functions/createResolver.md +74 -0
- package/docs/api/server/functions/createSourcePlan.md +95 -0
- package/docs/api/server/functions/createSourceProcedures.md +46 -0
- package/docs/api/server/functions/dataView.md +32 -0
- package/docs/api/server/functions/field.md +15 -0
- package/docs/api/server/functions/getNestedSelection.md +19 -0
- package/docs/api/server/functions/getScopedArgs.md +21 -0
- package/docs/api/server/functions/hasNestedSelection.md +19 -0
- package/docs/api/server/functions/list.md +28 -0
- package/docs/api/server/functions/refetchSourceById.md +55 -0
- package/docs/api/server/functions/resolveSourceById.md +55 -0
- package/docs/api/server/functions/resolveSourceByIds.md +55 -0
- package/docs/api/server/functions/resolveSourceConnection.md +67 -0
- package/docs/api/server/functions/resolver.md +42 -0
- package/docs/api/server/functions/toPrismaSelect.md +25 -0
- package/docs/api/server/functions/withConnection.md +24 -0
- package/docs/api/server/index.md +109 -0
- package/docs/api/server/prisma/functions/createPrismaFate.md +435 -0
- package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +21 -0
- package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +21 -0
- package/docs/api/server/prisma/functions/prismaConnectionArgs.md +57 -0
- package/docs/api/server/prisma/index.md +23 -0
- package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +59 -0
- package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +5 -0
- package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +343 -0
- package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +31 -0
- package/docs/api/server/type-aliases/ComputedField.md +55 -0
- package/docs/api/server/type-aliases/ComputedSelection.md +5 -0
- package/docs/api/server/type-aliases/ConnectionItem.md +29 -0
- package/docs/api/server/type-aliases/ConnectionPagination.md +39 -0
- package/docs/api/server/type-aliases/ConnectionResult.md +29 -0
- package/docs/api/server/type-aliases/CountSelection.md +29 -0
- package/docs/api/server/type-aliases/CountWhere.md +5 -0
- package/docs/api/server/type-aliases/DataViewListOptions.md +13 -0
- package/docs/api/server/type-aliases/DataViewOrderBy.md +5 -0
- package/docs/api/server/type-aliases/DataViewOrderDirection.md +5 -0
- package/docs/api/server/type-aliases/DataViewResult.md +11 -0
- package/docs/api/server/type-aliases/Entity.md +21 -0
- package/docs/api/server/type-aliases/FateServer.md +75 -0
- package/docs/api/server/type-aliases/FateServerManifest.md +5 -0
- package/docs/api/server/type-aliases/FieldSelection.md +21 -0
- package/docs/api/server/type-aliases/LiveConnectionEventType.md +5 -0
- package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +5 -0
- package/docs/api/server/type-aliases/LiveEventBus.md +5 -0
- package/docs/api/server/type-aliases/LiveEventType.md +5 -0
- package/docs/api/server/type-aliases/LiveSourceEvent.md +5 -0
- package/docs/api/server/type-aliases/NativeFateAPI.md +47 -0
- package/docs/api/server/type-aliases/OrderDirection.md +5 -0
- package/docs/api/server/type-aliases/SourceConfig.md +55 -0
- package/docs/api/server/type-aliases/SourceDefinition.md +55 -0
- package/docs/api/server/type-aliases/SourceOrder.md +5 -0
- package/docs/api/server/type-aliases/SourceOrderField.md +21 -0
- package/docs/api/server/type-aliases/SourcePlan.md +29 -0
- package/docs/api/server/type-aliases/SourcePlanNode.md +29 -0
- package/docs/api/server/type-aliases/SourceRegistry.md +11 -0
- package/docs/api/server/type-aliases/SourceRelation.md +15 -0
- package/docs/api/server/type-aliases/SourceRelationConfig.md +23 -0
- package/docs/api/server/variables/byIdInput.md +5 -0
- package/docs/api/server/variables/connectionArgs.md +7 -0
- package/docs/api/type-aliases/ConnectionMetadata.md +7 -0
- package/docs/api/type-aliases/ConnectionRef.md +13 -0
- package/docs/api/type-aliases/Entity.md +15 -0
- package/docs/api/type-aliases/EntityId.md +7 -0
- package/docs/api/type-aliases/FateLiveConnectionEvent.md +5 -0
- package/docs/api/type-aliases/FateLiveEvent.md +5 -0
- package/docs/api/type-aliases/FateMutations.md +7 -0
- package/docs/api/type-aliases/FateOperation.md +5 -0
- package/docs/api/type-aliases/FateProtocolRequest.md +5 -0
- package/docs/api/type-aliases/FateProtocolResponse.md +5 -0
- package/docs/api/type-aliases/FateRecord.md +7 -0
- package/docs/api/type-aliases/FateRoots.md +7 -0
- package/docs/api/type-aliases/InferFateAPI.md +11 -0
- package/docs/api/type-aliases/List.md +5 -0
- package/docs/api/type-aliases/ListEntry.md +5 -0
- package/docs/api/type-aliases/ListItem.md +13 -0
- package/docs/api/type-aliases/Mask.md +15 -0
- package/docs/api/type-aliases/MutationDefinition.md +21 -0
- package/docs/api/type-aliases/MutationEntity.md +13 -0
- package/docs/api/type-aliases/MutationIdentifier.md +19 -0
- package/docs/api/type-aliases/MutationInput.md +13 -0
- package/docs/api/type-aliases/MutationResult.md +13 -0
- package/docs/api/type-aliases/NodesItem.md +13 -0
- package/docs/api/type-aliases/Pagination.md +39 -0
- package/docs/api/type-aliases/Request.md +7 -0
- package/docs/api/type-aliases/RequestMode.md +7 -0
- package/docs/api/type-aliases/RequestOptions.md +7 -0
- package/docs/api/type-aliases/RequestResult.md +18 -0
- package/docs/api/type-aliases/Selection.md +13 -0
- package/docs/api/type-aliases/Snapshot.md +7 -0
- package/docs/api/type-aliases/TypeConfig.md +41 -0
- package/docs/api/type-aliases/View.md +17 -0
- package/docs/api/type-aliases/ViewData.md +18 -0
- package/docs/api/type-aliases/ViewEntity.md +13 -0
- package/docs/api/type-aliases/ViewEntityName.md +13 -0
- package/docs/api/type-aliases/ViewRef.md +13 -0
- package/docs/api/type-aliases/ViewSelection.md +13 -0
- package/docs/api/type-aliases/ViewSnapshot.md +18 -0
- package/docs/api/type-aliases/ViewTag.md +7 -0
- package/docs/api/variables/ConnectionTag.md +7 -0
- package/docs/guide/actions.md +263 -0
- package/docs/guide/core-concepts.md +22 -0
- package/docs/guide/getting-started.md +57 -0
- package/docs/guide/list-views.md +86 -0
- package/docs/guide/live-views.md +245 -0
- package/docs/guide/requests.md +130 -0
- package/docs/guide/server-integration.md +630 -0
- package/docs/guide/views.md +278 -0
- package/docs/guide/void-integration.md +167 -0
- package/docs/index.md +4 -0
- package/lib/cli.mjs +17 -250
- package/lib/clientStub.d.mts +6 -0
- package/lib/clientStub.mjs +6 -0
- package/lib/executor-BqwHdN3n.d.mts +468 -0
- package/lib/index.d.mts +64 -3
- package/lib/index.mjs +1965 -559
- package/lib/list-4wRNSVgI.d.mts +10 -0
- package/lib/list-C_mi6GnE.mjs +16 -0
- package/lib/list.d.mts +2 -0
- package/lib/list.mjs +2 -0
- package/lib/liveTopics-DzNtJaBD.mjs +197 -0
- package/lib/{record-DnhZuvUe.mjs → record-AeZJC9fd.mjs} +1 -2
- package/lib/record-ENh92gyb.d.mts +315 -0
- package/lib/server/drizzle.d.mts +304 -0
- package/lib/server/drizzle.mjs +688 -0
- package/lib/server/prisma.d.mts +309 -0
- package/lib/server/prisma.mjs +345 -0
- package/lib/server.d.mts +82 -184
- package/lib/server.mjs +870 -416
- package/lib/sourceRouter-Bwpkr062.mjs +972 -0
- package/lib/{types-Djlh7mMH.d.mts → types-Dz46PXr3.d.mts} +327 -197
- package/lib/vite.d.mts +17 -0
- package/lib/vite.mjs +592 -0
- package/package.json +44 -6
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
# Class: FateClient\<Roots, Mutations\>
|
|
2
|
+
|
|
3
|
+
Defined in: [packages/fate/src/client.ts:361](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L361)
|
|
4
|
+
|
|
5
|
+
Core client that normalizes records, manages the view cache, and coordinates
|
|
6
|
+
data fetching.
|
|
7
|
+
|
|
8
|
+
## Type Parameters
|
|
9
|
+
|
|
10
|
+
### Roots
|
|
11
|
+
|
|
12
|
+
`Roots` *extends* [`FateRoots`](../type-aliases/FateRoots.md)
|
|
13
|
+
|
|
14
|
+
### Mutations
|
|
15
|
+
|
|
16
|
+
`Mutations` *extends* [`FateMutations`](../type-aliases/FateMutations.md)
|
|
17
|
+
|
|
18
|
+
## Constructors
|
|
19
|
+
|
|
20
|
+
### Constructor
|
|
21
|
+
|
|
22
|
+
> **new FateClient**\<`Roots`, `Mutations`\>(`options`): `FateClient`\<`Roots`, `Mutations`\>
|
|
23
|
+
|
|
24
|
+
Defined in: [packages/fate/src/client.ts:400](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L400)
|
|
25
|
+
|
|
26
|
+
#### Parameters
|
|
27
|
+
|
|
28
|
+
##### options
|
|
29
|
+
|
|
30
|
+
`FateClientOptions`\<`Roots`, `Mutations`\>
|
|
31
|
+
|
|
32
|
+
#### Returns
|
|
33
|
+
|
|
34
|
+
`FateClient`\<`Roots`, `Mutations`\>
|
|
35
|
+
|
|
36
|
+
## Properties
|
|
37
|
+
|
|
38
|
+
### actions
|
|
39
|
+
|
|
40
|
+
> `readonly` **actions**: `MutationTreeFromRecord`\<`Mutations`\>
|
|
41
|
+
|
|
42
|
+
Defined in: [packages/fate/src/client.ts:396](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L396)
|
|
43
|
+
|
|
44
|
+
***
|
|
45
|
+
|
|
46
|
+
### mutations
|
|
47
|
+
|
|
48
|
+
> `readonly` **mutations**: `MutationTreeFromRecord`\<`Mutations`\>
|
|
49
|
+
|
|
50
|
+
Defined in: [packages/fate/src/client.ts:397](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L397)
|
|
51
|
+
|
|
52
|
+
***
|
|
53
|
+
|
|
54
|
+
### roots
|
|
55
|
+
|
|
56
|
+
> `readonly` **roots**: `Roots`
|
|
57
|
+
|
|
58
|
+
Defined in: [packages/fate/src/client.ts:398](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L398)
|
|
59
|
+
|
|
60
|
+
***
|
|
61
|
+
|
|
62
|
+
### store
|
|
63
|
+
|
|
64
|
+
> `readonly` **store**: `Store`
|
|
65
|
+
|
|
66
|
+
Defined in: [packages/fate/src/client.ts:389](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L389)
|
|
67
|
+
|
|
68
|
+
## Methods
|
|
69
|
+
|
|
70
|
+
### assertLiveConnectionSupport()
|
|
71
|
+
|
|
72
|
+
> **assertLiveConnectionSupport**(): `void`
|
|
73
|
+
|
|
74
|
+
Defined in: [packages/fate/src/client.ts:845](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L845)
|
|
75
|
+
|
|
76
|
+
#### Returns
|
|
77
|
+
|
|
78
|
+
`void`
|
|
79
|
+
|
|
80
|
+
***
|
|
81
|
+
|
|
82
|
+
### assertLiveViewSupport()
|
|
83
|
+
|
|
84
|
+
> **assertLiveViewSupport**(): `void`
|
|
85
|
+
|
|
86
|
+
Defined in: [packages/fate/src/client.ts:837](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L837)
|
|
87
|
+
|
|
88
|
+
#### Returns
|
|
89
|
+
|
|
90
|
+
`void`
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
94
|
+
### clearOptimisticUpdate()
|
|
95
|
+
|
|
96
|
+
> **clearOptimisticUpdate**(`token`): `void`
|
|
97
|
+
|
|
98
|
+
Defined in: [packages/fate/src/client.ts:1496](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1496)
|
|
99
|
+
|
|
100
|
+
#### Parameters
|
|
101
|
+
|
|
102
|
+
##### token
|
|
103
|
+
|
|
104
|
+
`number` \| `null`
|
|
105
|
+
|
|
106
|
+
#### Returns
|
|
107
|
+
|
|
108
|
+
`void`
|
|
109
|
+
|
|
110
|
+
***
|
|
111
|
+
|
|
112
|
+
### deleteRecord()
|
|
113
|
+
|
|
114
|
+
> **deleteRecord**(`type`, `id`, `snapshots?`, `listSnapshots?`): `void`
|
|
115
|
+
|
|
116
|
+
Defined in: [packages/fate/src/client.ts:650](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L650)
|
|
117
|
+
|
|
118
|
+
#### Parameters
|
|
119
|
+
|
|
120
|
+
##### type
|
|
121
|
+
|
|
122
|
+
`string`
|
|
123
|
+
|
|
124
|
+
##### id
|
|
125
|
+
|
|
126
|
+
`string` \| `number`
|
|
127
|
+
|
|
128
|
+
##### snapshots?
|
|
129
|
+
|
|
130
|
+
`Map`\<`string`, `Readonly`\<\{ `mask?`: `FieldMask`; `record?`: [`FateRecord`](../type-aliases/FateRecord.md); \}\>\>
|
|
131
|
+
|
|
132
|
+
##### listSnapshots?
|
|
133
|
+
|
|
134
|
+
`Map`\<`string`, `Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: readonly (`string` \| `undefined`)[]; `forwardPageLimit?`: `number`; `ids`: readonly `string`[]; `liveAfterIds?`: readonly `string`[]; `liveBeforeIds?`: readonly `string`[]; `pagination?`: [`Pagination`](../type-aliases/Pagination.md); `pendingAfterIds?`: readonly `string`[]; `pendingBeforeIds?`: readonly `string`[]; \}\>\>
|
|
135
|
+
|
|
136
|
+
#### Returns
|
|
137
|
+
|
|
138
|
+
`void`
|
|
139
|
+
|
|
140
|
+
***
|
|
141
|
+
|
|
142
|
+
### executeMutation()
|
|
143
|
+
|
|
144
|
+
> **executeMutation**(`key`, `input`, `select`, `options?`): `Promise`\<`unknown`\>
|
|
145
|
+
|
|
146
|
+
Defined in: [packages/fate/src/client.ts:594](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L594)
|
|
147
|
+
|
|
148
|
+
#### Parameters
|
|
149
|
+
|
|
150
|
+
##### key
|
|
151
|
+
|
|
152
|
+
`string`
|
|
153
|
+
|
|
154
|
+
##### input
|
|
155
|
+
|
|
156
|
+
`unknown`
|
|
157
|
+
|
|
158
|
+
##### select
|
|
159
|
+
|
|
160
|
+
`Set`\<`string`\>
|
|
161
|
+
|
|
162
|
+
##### options?
|
|
163
|
+
|
|
164
|
+
###### args?
|
|
165
|
+
|
|
166
|
+
[`FateRecord`](../type-aliases/FateRecord.md)
|
|
167
|
+
|
|
168
|
+
###### plan?
|
|
169
|
+
|
|
170
|
+
`SelectionPlan`
|
|
171
|
+
|
|
172
|
+
#### Returns
|
|
173
|
+
|
|
174
|
+
`Promise`\<`unknown`\>
|
|
175
|
+
|
|
176
|
+
***
|
|
177
|
+
|
|
178
|
+
### filterSelectionForPendingOptimistics()
|
|
179
|
+
|
|
180
|
+
> **filterSelectionForPendingOptimistics**(`entityId`, `select`, `options?`): `Set`\<`string`\>
|
|
181
|
+
|
|
182
|
+
Defined in: [packages/fate/src/client.ts:1559](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1559)
|
|
183
|
+
|
|
184
|
+
#### Parameters
|
|
185
|
+
|
|
186
|
+
##### entityId
|
|
187
|
+
|
|
188
|
+
`string` \| `null`
|
|
189
|
+
|
|
190
|
+
##### select
|
|
191
|
+
|
|
192
|
+
`Set`\<`string`\>
|
|
193
|
+
|
|
194
|
+
##### options?
|
|
195
|
+
|
|
196
|
+
###### excludeToken?
|
|
197
|
+
|
|
198
|
+
`number` \| `null`
|
|
199
|
+
|
|
200
|
+
#### Returns
|
|
201
|
+
|
|
202
|
+
`Set`\<`string`\>
|
|
203
|
+
|
|
204
|
+
***
|
|
205
|
+
|
|
206
|
+
### gc()
|
|
207
|
+
|
|
208
|
+
> **gc**(): `void`
|
|
209
|
+
|
|
210
|
+
Defined in: [packages/fate/src/client.ts:1868](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1868)
|
|
211
|
+
|
|
212
|
+
Removes records and lists that are not reachable from retained requests or
|
|
213
|
+
the release buffer.
|
|
214
|
+
|
|
215
|
+
Garbage collection is scheduled automatically when retained requests are
|
|
216
|
+
released. Calling this method manually is mainly useful in tests and custom
|
|
217
|
+
memory-management flows.
|
|
218
|
+
|
|
219
|
+
#### Returns
|
|
220
|
+
|
|
221
|
+
`void`
|
|
222
|
+
|
|
223
|
+
***
|
|
224
|
+
|
|
225
|
+
### getPendingOptimisticMask()
|
|
226
|
+
|
|
227
|
+
> **getPendingOptimisticMask**(`entityId`, `options?`): `FieldMask` \| `null`
|
|
228
|
+
|
|
229
|
+
Defined in: [packages/fate/src/client.ts:1518](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1518)
|
|
230
|
+
|
|
231
|
+
#### Parameters
|
|
232
|
+
|
|
233
|
+
##### entityId
|
|
234
|
+
|
|
235
|
+
`string` \| `null`
|
|
236
|
+
|
|
237
|
+
##### options?
|
|
238
|
+
|
|
239
|
+
###### excludeToken?
|
|
240
|
+
|
|
241
|
+
`number` \| `null`
|
|
242
|
+
|
|
243
|
+
#### Returns
|
|
244
|
+
|
|
245
|
+
`FieldMask` \| `null`
|
|
246
|
+
|
|
247
|
+
***
|
|
248
|
+
|
|
249
|
+
### getRequestKey()
|
|
250
|
+
|
|
251
|
+
> **getRequestKey**(`request`): `string`
|
|
252
|
+
|
|
253
|
+
Defined in: [packages/fate/src/client.ts:2086](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L2086)
|
|
254
|
+
|
|
255
|
+
#### Parameters
|
|
256
|
+
|
|
257
|
+
##### request
|
|
258
|
+
|
|
259
|
+
[`Request`](../type-aliases/Request.md)
|
|
260
|
+
|
|
261
|
+
#### Returns
|
|
262
|
+
|
|
263
|
+
`string`
|
|
264
|
+
|
|
265
|
+
***
|
|
266
|
+
|
|
267
|
+
### getRequestResult()
|
|
268
|
+
|
|
269
|
+
> **getRequestResult**\<`R`\>(`request`): [`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>
|
|
270
|
+
|
|
271
|
+
Defined in: [packages/fate/src/client.ts:2226](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L2226)
|
|
272
|
+
|
|
273
|
+
#### Type Parameters
|
|
274
|
+
|
|
275
|
+
##### R
|
|
276
|
+
|
|
277
|
+
`R` *extends* [`Request`](../type-aliases/Request.md)
|
|
278
|
+
|
|
279
|
+
#### Parameters
|
|
280
|
+
|
|
281
|
+
##### request
|
|
282
|
+
|
|
283
|
+
`R`
|
|
284
|
+
|
|
285
|
+
#### Returns
|
|
286
|
+
|
|
287
|
+
[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>
|
|
288
|
+
|
|
289
|
+
***
|
|
290
|
+
|
|
291
|
+
### getTypeConfig()
|
|
292
|
+
|
|
293
|
+
> **getTypeConfig**(`type`): [`TypeConfig`](../type-aliases/TypeConfig.md)
|
|
294
|
+
|
|
295
|
+
Defined in: [packages/fate/src/client.ts:586](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L586)
|
|
296
|
+
|
|
297
|
+
#### Parameters
|
|
298
|
+
|
|
299
|
+
##### type
|
|
300
|
+
|
|
301
|
+
`string`
|
|
302
|
+
|
|
303
|
+
#### Returns
|
|
304
|
+
|
|
305
|
+
[`TypeConfig`](../type-aliases/TypeConfig.md)
|
|
306
|
+
|
|
307
|
+
***
|
|
308
|
+
|
|
309
|
+
### loadConnection()
|
|
310
|
+
|
|
311
|
+
> **loadConnection**\<`V`\>(`view`, `connection`, `args`, `options?`): `Promise`\<`Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: readonly (`string` \| `undefined`)[]; `forwardPageLimit?`: `number`; `ids`: readonly `string`[]; `liveAfterIds?`: readonly `string`[]; `liveBeforeIds?`: readonly `string`[]; `pagination?`: [`Pagination`](../type-aliases/Pagination.md); `pendingAfterIds?`: readonly `string`[]; `pendingBeforeIds?`: readonly `string`[]; \}\> \| `undefined`\>
|
|
312
|
+
|
|
313
|
+
Defined in: [packages/fate/src/client.ts:1583](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1583)
|
|
314
|
+
|
|
315
|
+
#### Type Parameters
|
|
316
|
+
|
|
317
|
+
##### V
|
|
318
|
+
|
|
319
|
+
`V` *extends* [`View`](../type-aliases/View.md)\<`any`, `any`\>
|
|
320
|
+
|
|
321
|
+
#### Parameters
|
|
322
|
+
|
|
323
|
+
##### view
|
|
324
|
+
|
|
325
|
+
`V`
|
|
326
|
+
|
|
327
|
+
##### connection
|
|
328
|
+
|
|
329
|
+
[`ConnectionMetadata`](../type-aliases/ConnectionMetadata.md)
|
|
330
|
+
|
|
331
|
+
##### args
|
|
332
|
+
|
|
333
|
+
`Record`\<`string`, `unknown`\>
|
|
334
|
+
|
|
335
|
+
##### options?
|
|
336
|
+
|
|
337
|
+
###### direction?
|
|
338
|
+
|
|
339
|
+
`"forward"` \| `"backward"`
|
|
340
|
+
|
|
341
|
+
#### Returns
|
|
342
|
+
|
|
343
|
+
`Promise`\<`Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: readonly (`string` \| `undefined`)[]; `forwardPageLimit?`: `number`; `ids`: readonly `string`[]; `liveAfterIds?`: readonly `string`[]; `liveBeforeIds?`: readonly `string`[]; `pagination?`: [`Pagination`](../type-aliases/Pagination.md); `pendingAfterIds?`: readonly `string`[]; `pendingBeforeIds?`: readonly `string`[]; \}\> \| `undefined`\>
|
|
344
|
+
|
|
345
|
+
***
|
|
346
|
+
|
|
347
|
+
### prepareRequestForRender()
|
|
348
|
+
|
|
349
|
+
> **prepareRequestForRender**\<`R`\>(`request`, `options`): `Readonly`\<\{ `promise`: `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>; `requestKey`: `string`; \}\>
|
|
350
|
+
|
|
351
|
+
Defined in: [packages/fate/src/client.ts:1753](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1753)
|
|
352
|
+
|
|
353
|
+
#### Type Parameters
|
|
354
|
+
|
|
355
|
+
##### R
|
|
356
|
+
|
|
357
|
+
`R` *extends* [`Request`](../type-aliases/Request.md)
|
|
358
|
+
|
|
359
|
+
#### Parameters
|
|
360
|
+
|
|
361
|
+
##### request
|
|
362
|
+
|
|
363
|
+
`R`
|
|
364
|
+
|
|
365
|
+
##### options
|
|
366
|
+
|
|
367
|
+
`Readonly`\<\{ `mode?`: [`RequestMode`](../type-aliases/RequestMode.md); \}\> \| `undefined`
|
|
368
|
+
|
|
369
|
+
#### Returns
|
|
370
|
+
|
|
371
|
+
`Readonly`\<\{ `promise`: `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>; `requestKey`: `string`; \}\>
|
|
372
|
+
|
|
373
|
+
***
|
|
374
|
+
|
|
375
|
+
### readView()
|
|
376
|
+
|
|
377
|
+
> **readView**\<`T`, `S`, `V`\>(`view`, `ref`): [`FateThenable`](../interfaces/FateThenable.md)\<`Readonly`\<\{ `coverage`: readonly readonly \[`string`, `ReadonlySet`\<`string`\>\][]; `data`: [`ViewData`](../type-aliases/ViewData.md)\<`T`, `S`\>; \}\>\>
|
|
378
|
+
|
|
379
|
+
Defined in: [packages/fate/src/client.ts:713](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L713)
|
|
380
|
+
|
|
381
|
+
#### Type Parameters
|
|
382
|
+
|
|
383
|
+
##### T
|
|
384
|
+
|
|
385
|
+
`T` *extends* [`Entity`](../type-aliases/Entity.md)
|
|
386
|
+
|
|
387
|
+
##### S
|
|
388
|
+
|
|
389
|
+
`S` *extends* [`Selection`](../type-aliases/Selection.md)\<`T`\>
|
|
390
|
+
|
|
391
|
+
##### V
|
|
392
|
+
|
|
393
|
+
`V` *extends* [`View`](../type-aliases/View.md)\<`T`, `S`\>
|
|
394
|
+
|
|
395
|
+
#### Parameters
|
|
396
|
+
|
|
397
|
+
##### view
|
|
398
|
+
|
|
399
|
+
`V`
|
|
400
|
+
|
|
401
|
+
##### ref
|
|
402
|
+
|
|
403
|
+
[`ViewRef`](../type-aliases/ViewRef.md)\<`T`\[`"__typename"`\]\>
|
|
404
|
+
|
|
405
|
+
#### Returns
|
|
406
|
+
|
|
407
|
+
[`FateThenable`](../interfaces/FateThenable.md)\<`Readonly`\<\{ `coverage`: readonly readonly \[`string`, `ReadonlySet`\<`string`\>\][]; `data`: [`ViewData`](../type-aliases/ViewData.md)\<`T`, `S`\>; \}\>\>
|
|
408
|
+
|
|
409
|
+
***
|
|
410
|
+
|
|
411
|
+
### ref()
|
|
412
|
+
|
|
413
|
+
> **ref**\<`T`\>(`type`, `id`, `view`): [`ViewRef`](../type-aliases/ViewRef.md)\<`T`\[`"__typename"`\]\>
|
|
414
|
+
|
|
415
|
+
Defined in: [packages/fate/src/client.ts:700](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L700)
|
|
416
|
+
|
|
417
|
+
#### Type Parameters
|
|
418
|
+
|
|
419
|
+
##### T
|
|
420
|
+
|
|
421
|
+
`T` *extends* [`Entity`](../type-aliases/Entity.md)
|
|
422
|
+
|
|
423
|
+
#### Parameters
|
|
424
|
+
|
|
425
|
+
##### type
|
|
426
|
+
|
|
427
|
+
`T`\[`"__typename"`\]
|
|
428
|
+
|
|
429
|
+
##### id
|
|
430
|
+
|
|
431
|
+
`string` \| `number`
|
|
432
|
+
|
|
433
|
+
##### view
|
|
434
|
+
|
|
435
|
+
[`View`](../type-aliases/View.md)\<`T`, [`Selection`](../type-aliases/Selection.md)\<`T`\>\>
|
|
436
|
+
|
|
437
|
+
#### Returns
|
|
438
|
+
|
|
439
|
+
[`ViewRef`](../type-aliases/ViewRef.md)\<`T`\[`"__typename"`\]\>
|
|
440
|
+
|
|
441
|
+
***
|
|
442
|
+
|
|
443
|
+
### registerOptimisticUpdate()
|
|
444
|
+
|
|
445
|
+
> **registerOptimisticUpdate**(`entityId`, `select`): `number` \| `null`
|
|
446
|
+
|
|
447
|
+
Defined in: [packages/fate/src/client.ts:1477](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1477)
|
|
448
|
+
|
|
449
|
+
#### Parameters
|
|
450
|
+
|
|
451
|
+
##### entityId
|
|
452
|
+
|
|
453
|
+
`string` \| `null`
|
|
454
|
+
|
|
455
|
+
##### select
|
|
456
|
+
|
|
457
|
+
`ReadonlySet`\<`string`\>
|
|
458
|
+
|
|
459
|
+
#### Returns
|
|
460
|
+
|
|
461
|
+
`number` \| `null`
|
|
462
|
+
|
|
463
|
+
***
|
|
464
|
+
|
|
465
|
+
### registerPendingOptimisticMutation()
|
|
466
|
+
|
|
467
|
+
> **registerPendingOptimisticMutation**(`entityId`, `promise`): `void`
|
|
468
|
+
|
|
469
|
+
Defined in: [packages/fate/src/client.ts:1447](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1447)
|
|
470
|
+
|
|
471
|
+
#### Parameters
|
|
472
|
+
|
|
473
|
+
##### entityId
|
|
474
|
+
|
|
475
|
+
`string`
|
|
476
|
+
|
|
477
|
+
##### promise
|
|
478
|
+
|
|
479
|
+
`Promise`\<`unknown`\>
|
|
480
|
+
|
|
481
|
+
#### Returns
|
|
482
|
+
|
|
483
|
+
`void`
|
|
484
|
+
|
|
485
|
+
***
|
|
486
|
+
|
|
487
|
+
### releaseRequest()
|
|
488
|
+
|
|
489
|
+
> **releaseRequest**(`request`, `mode`): `void`
|
|
490
|
+
|
|
491
|
+
Defined in: [packages/fate/src/client.ts:1807](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1807)
|
|
492
|
+
|
|
493
|
+
#### Parameters
|
|
494
|
+
|
|
495
|
+
##### request
|
|
496
|
+
|
|
497
|
+
[`Request`](../type-aliases/Request.md)
|
|
498
|
+
|
|
499
|
+
##### mode
|
|
500
|
+
|
|
501
|
+
[`RequestMode`](../type-aliases/RequestMode.md)
|
|
502
|
+
|
|
503
|
+
#### Returns
|
|
504
|
+
|
|
505
|
+
`void`
|
|
506
|
+
|
|
507
|
+
***
|
|
508
|
+
|
|
509
|
+
### releaseRequestKey()
|
|
510
|
+
|
|
511
|
+
> **releaseRequestKey**(`requestKey`, `mode`): `void`
|
|
512
|
+
|
|
513
|
+
Defined in: [packages/fate/src/client.ts:1811](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1811)
|
|
514
|
+
|
|
515
|
+
#### Parameters
|
|
516
|
+
|
|
517
|
+
##### requestKey
|
|
518
|
+
|
|
519
|
+
`string`
|
|
520
|
+
|
|
521
|
+
##### mode
|
|
522
|
+
|
|
523
|
+
[`RequestMode`](../type-aliases/RequestMode.md)
|
|
524
|
+
|
|
525
|
+
#### Returns
|
|
526
|
+
|
|
527
|
+
`void`
|
|
528
|
+
|
|
529
|
+
***
|
|
530
|
+
|
|
531
|
+
### request()
|
|
532
|
+
|
|
533
|
+
> **request**\<`R`\>(`request`, `options?`): `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>
|
|
534
|
+
|
|
535
|
+
Defined in: [packages/fate/src/client.ts:1736](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1736)
|
|
536
|
+
|
|
537
|
+
#### Type Parameters
|
|
538
|
+
|
|
539
|
+
##### R
|
|
540
|
+
|
|
541
|
+
`R` *extends* [`Request`](../type-aliases/Request.md)
|
|
542
|
+
|
|
543
|
+
#### Parameters
|
|
544
|
+
|
|
545
|
+
##### request
|
|
546
|
+
|
|
547
|
+
`R`
|
|
548
|
+
|
|
549
|
+
##### options?
|
|
550
|
+
|
|
551
|
+
`Readonly`\<\{ `mode?`: [`RequestMode`](../type-aliases/RequestMode.md); \}\>
|
|
552
|
+
|
|
553
|
+
#### Returns
|
|
554
|
+
|
|
555
|
+
`Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>
|
|
556
|
+
|
|
557
|
+
***
|
|
558
|
+
|
|
559
|
+
### requestForRender()
|
|
560
|
+
|
|
561
|
+
> **requestForRender**\<`R`\>(`request`, `options?`): `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>
|
|
562
|
+
|
|
563
|
+
Defined in: [packages/fate/src/client.ts:1746](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1746)
|
|
564
|
+
|
|
565
|
+
#### Type Parameters
|
|
566
|
+
|
|
567
|
+
##### R
|
|
568
|
+
|
|
569
|
+
`R` *extends* [`Request`](../type-aliases/Request.md)
|
|
570
|
+
|
|
571
|
+
#### Parameters
|
|
572
|
+
|
|
573
|
+
##### request
|
|
574
|
+
|
|
575
|
+
`R`
|
|
576
|
+
|
|
577
|
+
##### options?
|
|
578
|
+
|
|
579
|
+
`Readonly`\<\{ `mode?`: [`RequestMode`](../type-aliases/RequestMode.md); \}\>
|
|
580
|
+
|
|
581
|
+
#### Returns
|
|
582
|
+
|
|
583
|
+
`Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>
|
|
584
|
+
|
|
585
|
+
***
|
|
586
|
+
|
|
587
|
+
### resolveOptimisticEntity()
|
|
588
|
+
|
|
589
|
+
> **resolveOptimisticEntity**(`optimisticEntityId`, `resolvedEntityId`): `void`
|
|
590
|
+
|
|
591
|
+
Defined in: [packages/fate/src/client.ts:1472](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1472)
|
|
592
|
+
|
|
593
|
+
#### Parameters
|
|
594
|
+
|
|
595
|
+
##### optimisticEntityId
|
|
596
|
+
|
|
597
|
+
`string`
|
|
598
|
+
|
|
599
|
+
##### resolvedEntityId
|
|
600
|
+
|
|
601
|
+
`string`
|
|
602
|
+
|
|
603
|
+
#### Returns
|
|
604
|
+
|
|
605
|
+
`void`
|
|
606
|
+
|
|
607
|
+
***
|
|
608
|
+
|
|
609
|
+
### restore()
|
|
610
|
+
|
|
611
|
+
> **restore**(`id`, `snapshot`): `void`
|
|
612
|
+
|
|
613
|
+
Defined in: [packages/fate/src/client.ts:668](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L668)
|
|
614
|
+
|
|
615
|
+
#### Parameters
|
|
616
|
+
|
|
617
|
+
##### id
|
|
618
|
+
|
|
619
|
+
`string`
|
|
620
|
+
|
|
621
|
+
##### snapshot
|
|
622
|
+
|
|
623
|
+
[`Snapshot`](../type-aliases/Snapshot.md)
|
|
624
|
+
|
|
625
|
+
#### Returns
|
|
626
|
+
|
|
627
|
+
`void`
|
|
628
|
+
|
|
629
|
+
***
|
|
630
|
+
|
|
631
|
+
### restoreList()
|
|
632
|
+
|
|
633
|
+
> **restoreList**(`name`, `list?`): `void`
|
|
634
|
+
|
|
635
|
+
Defined in: [packages/fate/src/client.ts:673](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L673)
|
|
636
|
+
|
|
637
|
+
#### Parameters
|
|
638
|
+
|
|
639
|
+
##### name
|
|
640
|
+
|
|
641
|
+
`string`
|
|
642
|
+
|
|
643
|
+
##### list?
|
|
644
|
+
|
|
645
|
+
`Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: readonly (`string` \| `undefined`)[]; `forwardPageLimit?`: `number`; `ids`: readonly `string`[]; `liveAfterIds?`: readonly `string`[]; `liveBeforeIds?`: readonly `string`[]; `pagination?`: [`Pagination`](../type-aliases/Pagination.md); `pendingAfterIds?`: readonly `string`[]; `pendingBeforeIds?`: readonly `string`[]; \}\>
|
|
646
|
+
|
|
647
|
+
#### Returns
|
|
648
|
+
|
|
649
|
+
`void`
|
|
650
|
+
|
|
651
|
+
***
|
|
652
|
+
|
|
653
|
+
### retain()
|
|
654
|
+
|
|
655
|
+
> **retain**(`request`): `RetainHandle`
|
|
656
|
+
|
|
657
|
+
Defined in: [packages/fate/src/client.ts:1842](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1842)
|
|
658
|
+
|
|
659
|
+
Keeps the records and lists reachable from a request alive until the
|
|
660
|
+
returned handle is disposed.
|
|
661
|
+
|
|
662
|
+
`useRequest` calls this automatically while the component is mounted.
|
|
663
|
+
Use it directly for non-React request lifetimes, tests, or preloaded data
|
|
664
|
+
that must survive manual garbage collection.
|
|
665
|
+
|
|
666
|
+
#### Parameters
|
|
667
|
+
|
|
668
|
+
##### request
|
|
669
|
+
|
|
670
|
+
[`Request`](../type-aliases/Request.md)
|
|
671
|
+
|
|
672
|
+
#### Returns
|
|
673
|
+
|
|
674
|
+
`RetainHandle`
|
|
675
|
+
|
|
676
|
+
***
|
|
677
|
+
|
|
678
|
+
### retainRequestKey()
|
|
679
|
+
|
|
680
|
+
> **retainRequestKey**(`requestKey`, `mode?`): `RetainHandle`
|
|
681
|
+
|
|
682
|
+
Defined in: [packages/fate/src/client.ts:1823](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L1823)
|
|
683
|
+
|
|
684
|
+
#### Parameters
|
|
685
|
+
|
|
686
|
+
##### requestKey
|
|
687
|
+
|
|
688
|
+
`string`
|
|
689
|
+
|
|
690
|
+
##### mode?
|
|
691
|
+
|
|
692
|
+
[`RequestMode`](../type-aliases/RequestMode.md)
|
|
693
|
+
|
|
694
|
+
#### Returns
|
|
695
|
+
|
|
696
|
+
`RetainHandle`
|
|
697
|
+
|
|
698
|
+
***
|
|
699
|
+
|
|
700
|
+
### rootListRef()
|
|
701
|
+
|
|
702
|
+
> **rootListRef**(`entityId`, `rootView`): `Readonly`\<\{ `__typename`: `string`; `[ViewsTag]`: `Set`\<`string`\>; `id`: `string` \| `number`; \}\>
|
|
703
|
+
|
|
704
|
+
Defined in: [packages/fate/src/client.ts:708](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L708)
|
|
705
|
+
|
|
706
|
+
#### Parameters
|
|
707
|
+
|
|
708
|
+
##### entityId
|
|
709
|
+
|
|
710
|
+
`string`
|
|
711
|
+
|
|
712
|
+
##### rootView
|
|
713
|
+
|
|
714
|
+
[`View`](../type-aliases/View.md)\<`any`, `any`\>
|
|
715
|
+
|
|
716
|
+
#### Returns
|
|
717
|
+
|
|
718
|
+
`Readonly`\<\{ `__typename`: `string`; `[ViewsTag]`: `Set`\<`string`\>; `id`: `string` \| `number`; \}\>
|
|
719
|
+
|
|
720
|
+
***
|
|
721
|
+
|
|
722
|
+
### subscribeLiveListView()
|
|
723
|
+
|
|
724
|
+
> **subscribeLiveListView**\<`V`\>(`view`, `connection`): () => `void`
|
|
725
|
+
|
|
726
|
+
Defined in: [packages/fate/src/client.ts:937](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L937)
|
|
727
|
+
|
|
728
|
+
#### Type Parameters
|
|
729
|
+
|
|
730
|
+
##### V
|
|
731
|
+
|
|
732
|
+
`V` *extends* [`View`](../type-aliases/View.md)\<`any`, `any`\>
|
|
733
|
+
|
|
734
|
+
#### Parameters
|
|
735
|
+
|
|
736
|
+
##### view
|
|
737
|
+
|
|
738
|
+
`V`
|
|
739
|
+
|
|
740
|
+
##### connection
|
|
741
|
+
|
|
742
|
+
[`ConnectionMetadata`](../type-aliases/ConnectionMetadata.md)
|
|
743
|
+
|
|
744
|
+
#### Returns
|
|
745
|
+
|
|
746
|
+
() => `void`
|
|
747
|
+
|
|
748
|
+
***
|
|
749
|
+
|
|
750
|
+
### subscribeLiveView()
|
|
751
|
+
|
|
752
|
+
> **subscribeLiveView**\<`T`, `S`, `V`\>(`view`, `ref`): () => `void`
|
|
753
|
+
|
|
754
|
+
Defined in: [packages/fate/src/client.ts:853](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L853)
|
|
755
|
+
|
|
756
|
+
#### Type Parameters
|
|
757
|
+
|
|
758
|
+
##### T
|
|
759
|
+
|
|
760
|
+
`T` *extends* [`Entity`](../type-aliases/Entity.md)
|
|
761
|
+
|
|
762
|
+
##### S
|
|
763
|
+
|
|
764
|
+
`S` *extends* [`Selection`](../type-aliases/Selection.md)\<`T`\>
|
|
765
|
+
|
|
766
|
+
##### V
|
|
767
|
+
|
|
768
|
+
`V` *extends* [`View`](../type-aliases/View.md)\<`T`, `S`\>
|
|
769
|
+
|
|
770
|
+
#### Parameters
|
|
771
|
+
|
|
772
|
+
##### view
|
|
773
|
+
|
|
774
|
+
`V`
|
|
775
|
+
|
|
776
|
+
##### ref
|
|
777
|
+
|
|
778
|
+
[`ViewRef`](../type-aliases/ViewRef.md)\<`T`\[`"__typename"`\]\>
|
|
779
|
+
|
|
780
|
+
#### Returns
|
|
781
|
+
|
|
782
|
+
() => `void`
|
|
783
|
+
|
|
784
|
+
***
|
|
785
|
+
|
|
786
|
+
### write()
|
|
787
|
+
|
|
788
|
+
> **write**(`type`, `data`, `select`, `snapshots?`, `plan?`, `pathPrefix?`, `blockedMask?`, `insert?`, `listSnapshots?`): `string`
|
|
789
|
+
|
|
790
|
+
Defined in: [packages/fate/src/client.ts:626](https://github.com/nkzw-tech/fate/blob/d972c17c02c8292194208ab53c91f9216703a5a7/packages/fate/src/client.ts#L626)
|
|
791
|
+
|
|
792
|
+
#### Parameters
|
|
793
|
+
|
|
794
|
+
##### type
|
|
795
|
+
|
|
796
|
+
`string`
|
|
797
|
+
|
|
798
|
+
##### data
|
|
799
|
+
|
|
800
|
+
[`FateRecord`](../type-aliases/FateRecord.md)
|
|
801
|
+
|
|
802
|
+
##### select
|
|
803
|
+
|
|
804
|
+
`ReadonlySet`\<`string`\>
|
|
805
|
+
|
|
806
|
+
##### snapshots?
|
|
807
|
+
|
|
808
|
+
`Map`\<`string`, `Readonly`\<\{ `mask?`: `FieldMask`; `record?`: [`FateRecord`](../type-aliases/FateRecord.md); \}\>\>
|
|
809
|
+
|
|
810
|
+
##### plan?
|
|
811
|
+
|
|
812
|
+
`SelectionPlan`
|
|
813
|
+
|
|
814
|
+
##### pathPrefix?
|
|
815
|
+
|
|
816
|
+
`string` \| `null`
|
|
817
|
+
|
|
818
|
+
##### blockedMask?
|
|
819
|
+
|
|
820
|
+
`FieldMask` \| `null`
|
|
821
|
+
|
|
822
|
+
##### insert?
|
|
823
|
+
|
|
824
|
+
`InsertPosition`
|
|
825
|
+
|
|
826
|
+
##### listSnapshots?
|
|
827
|
+
|
|
828
|
+
`Map`\<`string`, `Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: readonly (`string` \| `undefined`)[]; `forwardPageLimit?`: `number`; `ids`: readonly `string`[]; `liveAfterIds?`: readonly `string`[]; `liveBeforeIds?`: readonly `string`[]; `pagination?`: [`Pagination`](../type-aliases/Pagination.md); `pendingAfterIds?`: readonly `string`[]; `pendingBeforeIds?`: readonly `string`[]; \}\>\>
|
|
829
|
+
|
|
830
|
+
#### Returns
|
|
831
|
+
|
|
832
|
+
`string`
|